tree-ssa-ccp.c (ccp_fold_builtin): Strip conversion exprs with prejudice.
authorRichard Henderson <rth@redhat.com>
Sat, 10 Jul 2004 02:24:27 +0000 (19:24 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 10 Jul 2004 02:24:27 +0000 (19:24 -0700)
        * tree-ssa-ccp.c (ccp_fold_builtin): Strip conversion exprs
        with prejudice.

From-SVN: r84436

gcc/ChangeLog
gcc/tree-ssa-ccp.c

index 3fb67e77a89e7919cc1db8e393022bae38253ac2..47ada40da06fe3e3d7cf85bca7a0d900dbb5bb05 100644 (file)
@@ -2,6 +2,9 @@
 
        * builtins.c (expand_builtin_stpcpy): Don't modify len.
 
+       * tree-ssa-ccp.c (ccp_fold_builtin): Strip conversion exprs
+       with prejudice.
+
 2004-07-10  Kelley Cook  <kcook@gcc.gnu.org>
 
        * flags.h: Delete redundant prototypes that are being generated
index d2c503d6cebcd90a224182eed9a473a32a300cc3..01da8f88e07ceb3ca41b61ef79c8824690ff196b 100644 (file)
@@ -2405,7 +2405,16 @@ ccp_fold_builtin (tree stmt, tree fn)
     }
 
   if (result && ignore)
-    STRIP_NOPS (result);
+    {
+      /* STRIP_NOPS isn't strong enough -- it'll stop when we change modes,
+        but given that we're ignoring the result, we don't care what type
+        is being returned by the transformed function.  */
+      while (TREE_CODE (result) == NOP_EXPR
+            || TREE_CODE (result) == CONVERT_EXPR
+            || TREE_CODE (result) == NON_LVALUE_EXPR)
+       result = TREE_OPERAND (result, 0);
+    }
+
   return result;
 }