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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157693
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-03-24 Jakub Jelinek <jakub@redhat.com>
+
+ 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.
+
2010-03-23 Mike Stump <mikestump@comcast.net>
PR target/33120
{
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
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;
}
if (cfun && EXPR_HAS_LOCATION (exp))
{
location_t saved_location = input_location;
+ location_t saved_curr_loc = get_curr_insn_source_location ();
+ tree saved_block = get_curr_insn_block ();
input_location = EXPR_LOCATION (exp);
set_curr_insn_source_location (input_location);
ret = expand_expr_real_1 (exp, target, tmode, modifier, alt_rtl);
input_location = saved_location;
+ set_curr_insn_block (saved_block);
+ set_curr_insn_source_location (saved_curr_loc);
}
else
{
{
gimple g = get_gimple_for_ssa_name (exp);
if (g)
- return expand_expr_real_1 (gimple_assign_rhs_to_tree (g), target,
- tmode, modifier, NULL);
+ return expand_expr_real (gimple_assign_rhs_to_tree (g), target,
+ tmode, modifier, NULL);
}
decl_rtl = get_rtx_for_ssa_name (exp);
exp = SSA_NAME_VAR (exp);
+2010-03-24 Jakub Jelinek <jakub@redhat.com>
+
+ PR debug/19192
+ PR debug/43479
+ * gcc.dg/guality/pr43479.c: New test.
+ * gcc.dg/debug/dwarf2/inline2.c (third): Make a a global var
+ and add volatile keyword.
+
2010-03-23 Mike Stump <mikestump@comcast.net>
* g++.dg/warn/Wstrict-aliasing-float-ref-int-obj.C: Enhance portability.
actually inlined. */
/* { dg-final { scan-assembler-times "(?:byte|data1)\[^\n\]*0x3\[^\n\]* DW_AT_inline" 3 } } */
+volatile int *a;
inline void
third (int arg3)
{
int var3 = arg3;
- int* a = 0;
a[0] = var3;
}
--- /dev/null
+/* PR debug/43479 */
+/* { dg-do run } */
+/* { dg-options "-g" } */
+
+__attribute__((noinline)) void
+foo (int k, int l, int m, int n)
+{
+ l++;
+ {
+ int h = n;
+ {
+ int i = k;
+ k++; /* { dg-final { gdb-test 13 "i" "6" } } */
+ } /* { dg-final { gdb-test 13 "h" "9" } } */
+ /* { dg-final { gdb-test 13 "n" "9" } } */
+ {
+ int j = m;
+ m++; /* { dg-final { gdb-test 18 "j" "8" } } */
+ } /* { dg-final { gdb-test 18 "h" "9" } } */
+ /* { dg-final { gdb-test 12 "n" "9" } } */
+ }
+ asm volatile ("" : : "r" (k), "r" (l));
+ asm volatile ("" : : "r" (m), "r" (n));
+}
+
+int
+main (void)
+{
+ int q = 6;
+ asm ("" : "+r" (q));
+ foo (q, q + 1, q + 2, q + 3);
+ return 0;
+}