aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2010-03-24 14:41:30 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2010-03-24 14:41:30 +0100
commitd0ed412a967910ba8fe96f328a22dc72e945181a (patch)
tree20f32d2f9c282d0e29f5a06f4b4707bb295fab42 /gcc/cfgexpand.c
parent012cd3b6b52f81950a23953ef21e383d7bd29d06 (diff)
downloadgcc-d0ed412a967910ba8fe96f328a22dc72e945181a.zip
gcc-d0ed412a967910ba8fe96f328a22dc72e945181a.tar.gz
gcc-d0ed412a967910ba8fe96f328a22dc72e945181a.tar.bz2
re PR debug/19192 (Current development gcc generates inaccurate line info for example code)
PR debug/19192 PR debug/43479 * cfgexpand.c (gimple_assign_rhs_to_tree): Also set TREE_BLOCK from gimple_block. * expr.c (expand_expr_real): Restore previous curr_insn_source_location and curr_insn_block after expand_expr_real_1 call. (expand_expr_real_1) <case SSA_NAME>: Call expand_expr_real instead of expand_expr_real_1. * gcc.dg/guality/pr43479.c: New test. * gcc.dg/debug/dwarf2/inline2.c (third): Make a a global var and add volatile keyword. From-SVN: r157693
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index fcae897..a797af9 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -77,8 +77,12 @@ gimple_assign_rhs_to_tree (gimple stmt)
{
t = gimple_assign_rhs1 (stmt);
/* Avoid modifying this tree in place below. */
- if (gimple_has_location (stmt) && CAN_HAVE_LOCATION_P (t)
- && gimple_location (stmt) != EXPR_LOCATION (t))
+ if ((gimple_has_location (stmt) && CAN_HAVE_LOCATION_P (t)
+ && gimple_location (stmt) != EXPR_LOCATION (t))
+ || (gimple_block (stmt)
+ && currently_expanding_to_rtl
+ && EXPR_P (t)
+ && gimple_block (stmt) != TREE_BLOCK (t)))
t = copy_node (t);
}
else
@@ -86,6 +90,8 @@ gimple_assign_rhs_to_tree (gimple stmt)
if (gimple_has_location (stmt) && CAN_HAVE_LOCATION_P (t))
SET_EXPR_LOCATION (t, gimple_location (stmt));
+ if (gimple_block (stmt) && currently_expanding_to_rtl && EXPR_P (t))
+ TREE_BLOCK (t) = gimple_block (stmt);
return t;
}