diff mbox

Fix m32c WRT fallthrus

Message ID 8e6d4da7-70f4-9794-74e6-25065dfde01e@redhat.com
State New
Headers show

Commit Message

Jeff Law Oct. 26, 2016, 4:08 p.m. UTC
In encode_pattern_1, we stuff the 'm' into the pattern for the memory 
operand, then want to recurse on the address.  So A fallthru seems 
reasonable.

In m32c_legitimate_address_p we have a special case for certain 
registers, but which does not apply to A0.  So we've got

   case ...
   case ...
     special handling
   case A0_REGNO:
     common handling

So fallthru is what we wanted here too.

Installing on the trunk.

Jeff
commit 90189036e0ed5752b5bb448962bda507b97c18c5
Author: law <law@138bc75d-0d04-0410-961f-82ee72b054a4>
Date:   Wed Oct 26 16:08:30 2016 +0000

    	* config/m32c/m32c.c (encode_pattern_1): Add fallthru comment.
    	(m32c_legitimate_address_p): Likewise.
    
    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@241572 138bc75d-0d04-0410-961f-82ee72b054a4
diff mbox

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 1e03936..4aec3eb 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@ 
 2016-10-26  Jeff Law  <law@redhat.com>
 
+	* config/m32c/m32c.c (encode_pattern_1): Add fallthru comment.
+	(m32c_legitimate_address_p): Likewise.
+
 	* config/m32r/m32r.c (m32r_print_operand): Adjust fallthru comment.
 
 	* config/mcore/mcore.c (mcore_gen_compare): Adjust fallthru comments.
diff --git a/gcc/config/m32c/m32c.c b/gcc/config/m32c/m32c.c
index 7d64c49..ccd9675 100644
--- a/gcc/config/m32c/m32c.c
+++ b/gcc/config/m32c/m32c.c
@@ -176,6 +176,7 @@  encode_pattern_1 (rtx x)
       break;
     case MEM:
       *patternp++ = 'm';
+      /* FALLTHRU */
     case CONST:
       encode_pattern_1 (XEXP (x, 0));
       break;
@@ -1696,6 +1697,7 @@  m32c_legitimate_address_p (machine_mode mode, rtx x, bool strict)
 	case SP_REGNO:
 	  if (TARGET_A16 && GET_MODE (x) == SImode)
 	    return 0;
+	  /* FALLTHRU */
 	case A0_REGNO:
 	  return 1;