]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/28490 (ICE in ia64_expand_move, at config/ia64/ia64.c:1088)
authorSteve Ellcey <sje@cup.hp.com>
Mon, 9 Oct 2006 18:26:35 +0000 (18:26 +0000)
committerSteve Ellcey <sje@gcc.gnu.org>
Mon, 9 Oct 2006 18:26:35 +0000 (18:26 +0000)
PR target/28490
Backport from mainline
2006-09-15  Jim Wilson  <wilson@specifix.com>
2006-09-19  Steve Ellcey  <sje@cup.hp.com>
* config/ia64/ia64.c (ia64_legitimate_constant_p): Allow function
pointers as legitimate constants.  Handle symbol offsets same as
they are handled in ia64_expand_move and move_operand.

From-SVN: r117583

gcc/ChangeLog
gcc/config/ia64/ia64.c

index 597da2e099bce6614f039842f56b2004f94e4443..f0a7bf08e885f89572c7e5e98c2005aaa19309c4 100644 (file)
@@ -1,3 +1,13 @@
+2006-10-09  Steve Ellcey  <sje@cup.hp.com>
+
+       PR target/28490
+       Backport from mainline
+       2006-09-15  Jim Wilson  <wilson@specifix.com>
+       2006-09-19  Steve Ellcey  <sje@cup.hp.com>
+       * config/ia64/ia64.c (ia64_legitimate_constant_p): Allow function
+       pointers as legitimate constants.  Handle symbol offsets same as
+       they are handled in ia64_expand_move and move_operand.
+
 2006-10-08  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR debug/28980
index c4fd00b88744f3e4061c7ba2f87e6028d1df3bbe..6981091da169a2947a2c749baab438050e2c1aa0 100644 (file)
@@ -741,7 +741,30 @@ ia64_legitimate_constant_p (rtx x)
 
     case CONST:
     case SYMBOL_REF:
-      return tls_symbolic_operand_type (x) == 0;
+      /* ??? Short term workaround for PR 28490.  We must make the code here
+        match the code in ia64_expand_move and move_operand, even though they
+        are both technically wrong.  */
+      if (tls_symbolic_operand_type (x) == 0)
+       {
+         HOST_WIDE_INT addend = 0;
+         rtx op = x;
+
+         if (GET_CODE (op) == CONST
+             && GET_CODE (XEXP (op, 0)) == PLUS
+             && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT)
+           {
+             addend = INTVAL (XEXP (XEXP (op, 0), 1));
+             op = XEXP (XEXP (op, 0), 0);
+           }
+
+          if (any_offset_symbol_operand (op, GET_MODE (op))
+              || function_operand (op, GET_MODE (op)))
+            return true;
+         if (aligned_offset_symbol_operand (op, GET_MODE (op)))
+           return (addend & 0x3fff) == 0;
+         return false;
+       }
+      return false;
 
     default:
       return false;