PR tree-optimization/49000
* tree-ssa.c (execute_update_addresses_taken): Call
maybe_rewrite_mem_ref_base on debug stmt value. If it couldn't
be rewritten and decl has been marked for renaming, reset
the debug stmt.
* gcc.dg/pr49000.c: New test.
From-SVN: r173849
+2011-05-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/49000
+ * tree-ssa.c (execute_update_addresses_taken): Call
+ maybe_rewrite_mem_ref_base on debug stmt value. If it couldn't
+ be rewritten and decl has been marked for renaming, reset
+ the debug stmt.
+
2011-05-17 Joseph Myers <joseph@codesourcery.com>
* config/i386/i386.c (ix86_valid_target_attribute_tree): Use
+2011-05-18 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/49000
+ * gcc.dg/pr49000.c: New test.
+
2011-05-17 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/invalid1.adb: New test.
--- /dev/null
+/* PR tree-optimization/49000 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+static
+foo (int x, int y)
+{
+ return x * y;
+}
+
+static int
+bar (int *z)
+{
+ return *z;
+}
+
+void
+baz (void)
+{
+ int a = 42;
+ int *b = &a;
+ foo (bar (&a), 3);
+}
+
+void
+test (void)
+{
+ baz ();
+}
}
}
+ else if (gimple_debug_bind_p (stmt)
+ && gimple_debug_bind_has_value_p (stmt))
+ {
+ tree *valuep = gimple_debug_bind_get_value_ptr (stmt);
+ tree decl;
+ maybe_rewrite_mem_ref_base (valuep);
+ decl = non_rewritable_mem_ref_base (*valuep);
+ if (decl && symbol_marked_for_renaming (decl))
+ gimple_debug_bind_reset_value (stmt);
+ }
+
if (gimple_references_memory_p (stmt)
|| is_gimple_debug (stmt))
update_stmt (stmt);