]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
expr.c (expand_expr): STRIP_NOPS before checking against MAX_INTEGER_COMPUTATION_MODE
authorJason Merrill <jason@yorick.cygnus.com>
Wed, 23 Jun 1999 00:49:46 +0000 (00:49 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 23 Jun 1999 00:49:46 +0000 (20:49 -0400)
* expr.c (expand_expr): STRIP_NOPS before checking against
MAX_INTEGER_COMPUTATION_MODE
(check_max_integer_computation_mode): Likewise.

From-SVN: r27715

gcc/ChangeLog
gcc/expr.c

index 64120f9022e3a76c78921df3db1ae93f625cb991..bcdcb16000657f3e09b36f6435b39a21a9068ba0 100644 (file)
@@ -1,3 +1,9 @@
+Wed Jun 23 00:48:21 1999  Jason Merrill  <jason@yorick.cygnus.com>
+
+       * expr.c (expand_expr): STRIP_NOPS before checking against
+       MAX_INTEGER_COMPUTATION_MODE
+       (check_max_integer_computation_mode): Likewise.
+
 Tue Jun 22 20:23:43 1999  Jim Wilson  <wilson@cygnus.com>
 
        * md.texi (smul@var{m}3_highpart): Add missing 's' prefix.
index dc9bca518ea0684f1728bbac2f865a37a3de2ac9..99c5e3671cc98e142108726187816a32ed52fc36 100644 (file)
@@ -5397,9 +5397,13 @@ void
 check_max_integer_computation_mode (exp)
     tree exp;
 {
-  enum tree_code code = TREE_CODE (exp);
+  enum tree_code code;
   enum machine_mode mode;
 
+  /* Strip any NOPs that don't change the mode.  */
+  STRIP_NOPS (exp);
+  code = TREE_CODE (exp);
+
   /* We must allow conversions of constants to MAX_INTEGER_COMPUTATION_MODE.  */
   if (code == NOP_EXPR
       && TREE_CODE (TREE_OPERAND (exp, 0)) == INTEGER_CST)
@@ -5578,7 +5582,12 @@ expand_expr (exp, target, tmode, modifier)
     }
 
 #ifdef MAX_INTEGER_COMPUTATION_MODE
+  /* Only check stuff here if the mode we want is different from the mode
+     of the expression; if it's the same, check_max_integer_computiation_mode
+     will handle it.  Do we really need to check this stuff at all?  */
+
   if (target
+      && GET_MODE (target) != mode
       && TREE_CODE (exp) != INTEGER_CST
       && TREE_CODE (exp) != PARM_DECL
       && TREE_CODE (exp) != ARRAY_REF
@@ -5595,7 +5604,8 @@ expand_expr (exp, target, tmode, modifier)
        fatal ("unsupported wide integer operation");
     }
 
-  if (TREE_CODE (exp) != INTEGER_CST
+  if (tmode != mode
+      && TREE_CODE (exp) != INTEGER_CST
       && TREE_CODE (exp) != PARM_DECL
       && TREE_CODE (exp) != ARRAY_REF
       && TREE_CODE (exp) != COMPONENT_REF