+2015-11-21 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/66432
+ * tree-inline.c (copy_debug_stmt): If
+ gimple_debug_source_bind_get_value is DECL_ORIGIN of a PARM_DECL
+ in decl_debug_args, don't call remap_gimple_op_r on it.
+
2015-11-07 Jan Hubicka <hubicka@ucw.cz>
* ipa-icf.c (sem_item::add_type): Do not look for TYPE_CANONICAL;
--- /dev/null
+/* PR debug/66432 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+extern void baz (const char *, const char *) __attribute__ ((__noreturn__));
+
+void
+foo (int x, int y[x][x])
+{
+ if (x < 2)
+ baz ("", "");
+}
+
+void
+bar (void)
+{
+ int z[2][2] = { { 1, 2 }, { 3, 4 } };
+ foo (2, z);
+}
else if (gimple_debug_source_bind_p (stmt))
{
gimple_debug_source_bind_set_var (stmt, t);
- walk_tree (gimple_debug_source_bind_get_value_ptr (stmt),
- remap_gimple_op_r, &wi, NULL);
/* When inlining and source bind refers to one of the optimized
away parameters, change the source bind into normal debug bind
referring to the corresponding DEBUG_EXPR_DECL that should have
break;
}
}
- }
+ }
+ if (gimple_debug_source_bind_p (stmt))
+ walk_tree (gimple_debug_source_bind_get_value_ptr (stmt),
+ remap_gimple_op_r, &wi, NULL);
}
processing_debug_stmt = 0;