This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RFA: Allow REG in mep_print_operand_address


Hi DJ,
  
  This is a simple patch to fix an ICE in the M32C port when compiling
  the gcc.dg/asm-4.c testcase.  The patch tweaks m32c_print_operand_address
  so that it will accept a REG as well as a MEM, which is inline with
  the behaviour of similar functions in the other ports.

  OK to apply once the mainline is back in stage 1 ?

Cheers
  Nick

gcc/ChangeLog
2009-02-04  Nick Clifton  <nickc@redhat.com>

	* config/m32c/m32c.c (m32c_print_operand_address): Accept REGs as
	well as MEMs.

Index: gcc/config/m32c/m32c.c
===================================================================
--- gcc/config/m32c/m32c.c	(revision 143919)
+++ gcc/config/m32c/m32c.c	(working copy)
@@ -2701,8 +2701,13 @@
 void
 m32c_print_operand_address (FILE * stream, rtx address)
 {
-  gcc_assert (GET_CODE (address) == MEM);
-  m32c_print_operand (stream, XEXP (address, 0), 0);
+  if (GET_CODE (address) == MEM)
+    address = XEXP (address, 0);
+  else
+    /* cf: gcc.dg/asm-4.c.  */
+    gcc_assert (GET_CODE (address) == REG);
+
+  m32c_print_operand (stream, address, 0);
 }
 
 /* Implements ASM_OUTPUT_REG_PUSH.  Control registers are pushed


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]