re PR middle-end/43513 (The stack pointer is adjusted twice)
authorTom de Vries <tom@codesourcery.com>
Sat, 30 Jul 2011 12:37:47 +0000 (12:37 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Sat, 30 Jul 2011 12:37:47 +0000 (12:37 +0000)
2011-07-30  Tom de Vries  <tom@codesourcery.com>

PR middle-end/43513
* tree-ssa-dce.c (ref_may_be_aliased): Add assert.
(propagate_necessity): Handle WITH_SIZE_EXPR call arg.

From-SVN: r176959

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

index 6c707bb6fd9b4cdbb0be6b4848fb2af3f69dc90f..99968b32857dcc3d12ea6b824755e9a9ec83de53 100644 (file)
@@ -1,3 +1,9 @@
+2011-07-30  Tom de Vries  <tom@codesourcery.com>
+
+       PR middle-end/43513
+       * tree-ssa-dce.c (ref_may_be_aliased): Add assert.
+       (propagate_necessity): Handle WITH_SIZE_EXPR call arg.
+
 2011-07-29  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * config/mips/driver-native.c [__sgi__]: Include <invent.h>,
index 9597b57393904d0f9f84551fb92f7d73e39d4ef4..bf69bbf26b27e7cbbd6078bd83442d93b21726c7 100644 (file)
@@ -490,6 +490,7 @@ find_obviously_necessary_stmts (struct edge_list *el)
 static bool
 ref_may_be_aliased (tree ref)
 {
+  gcc_assert (TREE_CODE (ref) != WITH_SIZE_EXPR);
   while (handled_component_p (ref))
     ref = TREE_OPERAND (ref, 0);
   if (TREE_CODE (ref) == MEM_REF
@@ -850,6 +851,8 @@ propagate_necessity (struct edge_list *el)
                  if (TREE_CODE (arg) == SSA_NAME
                      || is_gimple_min_invariant (arg))
                    continue;
+                 if (TREE_CODE (arg) == WITH_SIZE_EXPR)
+                   arg = TREE_OPERAND (arg, 0);
                  if (!ref_may_be_aliased (arg))
                    mark_aliased_reaching_defs_necessary (stmt, arg);
                }