aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimplify.c
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2015-06-02 09:47:02 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2015-06-02 09:47:02 +0000
commitb47717225bfbffb2e06c0f2a7e72b458ba40fc17 (patch)
treec009a29e58892337c44ffe37ae1b46fd9e9f6802 /gcc/gimplify.c
parent6903dd4fb91f9be3e316cf1e6844ff0e15bde10d (diff)
downloadgcc-b47717225bfbffb2e06c0f2a7e72b458ba40fc17.zip
gcc-b47717225bfbffb2e06c0f2a7e72b458ba40fc17.tar.gz
gcc-b47717225bfbffb2e06c0f2a7e72b458ba40fc17.tar.bz2
gimplify.c (gimplify_modify_expr): Do not create a DECL_DEBUG_EXPR if the target doesn't belong to the current...
* gimplify.c (gimplify_modify_expr): Do not create a DECL_DEBUG_EXPR if the target doesn't belong to the current function. From-SVN: r224019
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r--gcc/gimplify.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 58a60bf..721afd1 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -4707,12 +4707,14 @@ gimplify_modify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
return gimplify_modify_expr_complex_part (expr_p, pre_p, want_value);
/* Try to alleviate the effects of the gimplification creating artificial
- temporaries (see for example is_gimple_reg_rhs) on the debug info. */
+ temporaries (see for example is_gimple_reg_rhs) on the debug info, but
+ make sure not to create DECL_DEBUG_EXPR links across functions. */
if (!gimplify_ctxp->into_ssa
&& TREE_CODE (*from_p) == VAR_DECL
&& DECL_IGNORED_P (*from_p)
&& DECL_P (*to_p)
- && !DECL_IGNORED_P (*to_p))
+ && !DECL_IGNORED_P (*to_p)
+ && decl_function_context (*to_p) == current_function_decl)
{
if (!DECL_NAME (*from_p) && DECL_NAME (*to_p))
DECL_NAME (*from_p)