+2015-01-14 Richard Biener <rguenther@suse.de>
+
+ PR lto/64415
+ * tree-inline.c (insert_debug_decl_map): Check destination
+ function MAY_HAVE_DEBUG_STMTS.
+ (insert_init_debug_bind): Likewise.
+ (insert_init_stmt): Remove redundant check.
+ (remap_gimple_stmt): Drop debug stmts if the destination
+ function has var-tracking assignments disabled.
+
2015-01-14 Martin Liska <mliska@suse.cz>
* ipa-icf-gimple.c (func_checker::compare_operand): Add support for
+2015-01-14 Richard Biener <rguenther@suse.de>
+
+ PR lto/64415
+ * gcc.dg/lto/pr64415_0.c: New testcase.
+ * gcc.dg/lto/pr64415_1.c: Likewise.
+
2015-01-14 Martin Liska <mliska@suse.cz>
* gcc.dg/ipa/pr64307.c: New test.
--- /dev/null
+/* { dg-lto-do link } */
+/* { dg-require-effective-target fpic } */
+/* { dg-lto-options { { -O -flto -fpic } } } */
+/* { dg-extra-ld-options { -shared } } */
+
+extern void bar(char *, int);
+
+extern char *baz;
+
+void foo()
+{
+ bar(baz, 0);
+}
if (!gimple_in_ssa_p (id->src_cfun))
return;
- if (!MAY_HAVE_DEBUG_STMTS)
+ if (!opt_for_fn (id->dst_fn, flag_var_tracking_assignments))
return;
if (!target_for_debug_bind (key))
bool skip_first = false;
gimple_seq stmts = NULL;
+ if (is_gimple_debug (stmt)
+ && !opt_for_fn (id->dst_fn, flag_var_tracking_assignments))
+ return stmts;
+
/* Begin by recognizing trees that we'll completely rewrite for the
inlining context. Our output for these trees is completely
different from out input (e.g. RETURN_EXPR is deleted, and morphs
if (!gimple_in_ssa_p (id->src_cfun))
return NULL;
- if (!MAY_HAVE_DEBUG_STMTS)
+ if (!opt_for_fn (id->dst_fn, flag_var_tracking_assignments))
return NULL;
tracked_var = target_for_debug_bind (var);
gsi_insert_after (&si, init_stmt, GSI_NEW_STMT);
gimple_regimplify_operands (init_stmt, &si);
- if (!is_gimple_debug (init_stmt) && MAY_HAVE_DEBUG_STMTS)
+ if (!is_gimple_debug (init_stmt))
{
tree def = gimple_assign_lhs (init_stmt);
insert_init_debug_bind (id, bb, def, def, init_stmt);