re PR target/32808 (cris: ICE: RTL check: expected elt 0 type 'e' or 'u', have 'w...
authorRask Ingemann Lambertsen <rask@sygehus.dk>
Wed, 18 Jul 2007 13:47:28 +0000 (15:47 +0200)
committerRask Ingemann Lambertsen <rask@gcc.gnu.org>
Wed, 18 Jul 2007 13:47:28 +0000 (13:47 +0000)
PR target/32808
* config/cris/cris.c (cris_print_index): Don't use XEXP before
checking that the operand is an expression.

From-SVN: r126720

gcc/ChangeLog
gcc/config/cris/cris.c

index e39ccd6a5796e2967f7dda24b4c4ef21968326d3..5cf388443ad47672f1bfa8f06128e342b18ee358 100644 (file)
@@ -1,3 +1,9 @@
+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.
+
 2007-07-19  Christoph von Wittich  <Christoph_vW@reactos.org>
            Danny Smith  <dannysmith@users.sourceforge.net>
 
index 36537c54274ed3292b180cdb28c4b2d3e1d08bf2..e233bc7fa42344cfeca31c78773e156d35f421be 100644 (file)
@@ -496,8 +496,6 @@ cris_operand_lossage (const char *msgid, rtx op)
 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