aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2007-02-15 21:43:28 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2007-02-15 21:43:28 +0000
commitf173837aade126f9e3185425ab4c9fca7f7345dd (patch)
tree60f67d7b33fd76061676f8017753f64f79016c81 /gcc
parentbefdad071460a1bb49cb37691c73721f2e88c282 (diff)
downloadgcc-f173837aade126f9e3185425ab4c9fca7f7345dd.zip
gcc-f173837aade126f9e3185425ab4c9fca7f7345dd.tar.gz
gcc-f173837aade126f9e3185425ab4c9fca7f7345dd.tar.bz2
gimplify.c (gimplify_modify_expr): During gimplification...
* gimplify.c (gimplify_modify_expr): During gimplification, attach a DECL on the rhs to a DECL on the lhs for debug info purposes if the former is ignored but not the latter. From-SVN: r122015
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/gimplify.c13
2 files changed, 19 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9ad61e2..2ea38dd 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2007-02-15 Eric Botcazou <ebotcazou@adacore.com>
+ * gimplify.c (gimplify_modify_expr): During gimplification, attach a
+ DECL on the rhs to a DECL on the lhs for debug info purposes if the
+ former is ignored but not the latter.
+
+2007-02-15 Eric Botcazou <ebotcazou@adacore.com>
+
* expr.c (expand_expr_real_1) <normal_inner_ref>: If a temporary
is made and the reference doesn't use the alias set of its type,
do not create the temporary using that type.
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 7ac43f4..d615aa3 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -3654,6 +3654,19 @@ gimplify_modify_expr (tree *expr_p, tree *pre_p, tree *post_p, bool want_value)
*to_p = make_ssa_name (*to_p, *expr_p);
}
+ /* Try to alleviate the effects of the gimplification creating artificial
+ temporaries (see for example is_gimple_reg_rhs) on the debug info. */
+ if (!gimplify_ctxp->into_ssa
+ && DECL_P (*from_p) && DECL_IGNORED_P (*from_p)
+ && DECL_P (*to_p) && !DECL_IGNORED_P (*to_p))
+ {
+ if (!DECL_NAME (*from_p) && DECL_NAME (*to_p))
+ DECL_NAME (*from_p)
+ = create_tmp_var_name (IDENTIFIER_POINTER (DECL_NAME (*to_p)));
+ DECL_DEBUG_EXPR_IS_FROM (*from_p) = 1;
+ SET_DECL_DEBUG_EXPR (*from_p, *to_p);
+ }
+
if (want_value)
{
tree_to_gimple_tuple (expr_p);