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]

[PATCH cris]: Fix PR target/32808 RTL check failure building libgcc


   Not a whole lot will compile with RTL checking enabled on cris-axis-elf.
This patch fixes it. Ok for trunk?

:ADDPATCH cris:

2007-07-18  Rask Ingemann Lambertsen  <rask@sygehus.dk>

	PR target/32808
	* config/cris/cris.c (cris_print_index): Don't use XEXP before
	checking that the operand is an expression.

Index: config/cris/cris.c
===================================================================
--- config/cris/cris.c	(revision 126653)
+++ config/cris/cris.c	(working copy)
@@ -496,8 +496,6 @@ cris_operand_lossage (const char *msgid,
 static void
 cris_print_index (rtx index, FILE *file)
 {
-  rtx inner = XEXP (index, 0);
-
   /* Make the index "additive" unless we'll output a negative number, in
      which case the sign character is free (as in free beer).  */
   if (!CONST_INT_P (index) || INTVAL (index) >= 0)
@@ -514,8 +512,9 @@ cris_print_index (rtx index, FILE *file)
 
       putc (INTVAL (XEXP (index, 1)) == 2 ? 'w' : 'd', file);
     }
-  else if (GET_CODE (index) == SIGN_EXTEND && MEM_P (inner))
+  else if (GET_CODE (index) == SIGN_EXTEND && MEM_P (XEXP (index, 0)))
     {
+      rtx inner = XEXP (index, 0);
       rtx inner_inner = XEXP (inner, 0);
 
       if (GET_CODE (inner_inner) == POST_INC)
@@ -533,6 +532,7 @@ cris_print_index (rtx index, FILE *file)
     }
   else if (MEM_P (index))
     {
+      rtx inner = XEXP (index, 0);
       if (GET_CODE (inner) == POST_INC)
 	fprintf (file, "[$%s+].d", reg_names[REGNO (XEXP (inner, 0))]);
       else

-- 
Rask Ingemann Lambertsen


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