Commit 3adcf52c by Jason Merrill Committed by Jason Merrill

re PR debug/42800 (VLA DW_AT_upper_bound is no longer emitted)

	PR debug/42800
	* cfgexpand.c (expand_used_vars): Keep artificial non-ignored vars
	in cfun->local_decls even if they have register types.

From-SVN: r157014
parent a3b20e90
2010-02-23 Jason Merrill <jason@redhat.com> 2010-02-23 Jason Merrill <jason@redhat.com>
PR debug/42800
* cfgexpand.c (expand_used_vars): Keep artificial non-ignored vars
in cfun->local_decls even if they have register types.
PR c++/42837 PR c++/42837
* stor-layout.c (place_field): Don't warn about unnecessary * stor-layout.c (place_field): Don't warn about unnecessary
DECL_PACKED if the type is packed. DECL_PACKED if the type is packed.
......
...@@ -1331,8 +1331,7 @@ expand_used_vars (void) ...@@ -1331,8 +1331,7 @@ expand_used_vars (void)
if (is_gimple_reg (var)) if (is_gimple_reg (var))
{ {
TREE_USED (var) = 0; TREE_USED (var) = 0;
ggc_free (t); goto next;
continue;
} }
/* We didn't set a block for static or extern because it's hard /* We didn't set a block for static or extern because it's hard
to tell the difference between a global variable (re)declared to tell the difference between a global variable (re)declared
...@@ -1353,20 +1352,20 @@ expand_used_vars (void) ...@@ -1353,20 +1352,20 @@ expand_used_vars (void)
TREE_USED (var) = 1; TREE_USED (var) = 1;
if (expand_now) if (expand_now)
expand_one_var (var, true, true);
next:
if (DECL_ARTIFICIAL (var) && !DECL_IGNORED_P (var))
{ {
expand_one_var (var, true, true); rtx rtl = DECL_RTL_IF_SET (var);
if (DECL_ARTIFICIAL (var) && !DECL_IGNORED_P (var))
{
rtx rtl = DECL_RTL_IF_SET (var);
/* Keep artificial non-ignored vars in cfun->local_decls /* Keep artificial non-ignored vars in cfun->local_decls
chain until instantiate_decls. */ chain until instantiate_decls. */
if (rtl && (MEM_P (rtl) || GET_CODE (rtl) == CONCAT)) if (rtl && (MEM_P (rtl) || GET_CODE (rtl) == CONCAT))
{ {
TREE_CHAIN (t) = cfun->local_decls; TREE_CHAIN (t) = cfun->local_decls;
cfun->local_decls = t; cfun->local_decls = t;
continue; continue;
}
} }
} }
......
2010-02-23 Jason Merrill <jason@redhat.com>
PR debug/42800
* gcc.dg/debug/dwarf2/dwarf2.exp: Run c-c++-common dwarf2 tests.
* g++.dg/debug/dwarf2/dwarf2.exp: Likewise.
* c-c++-common/dwarf2/vla1.c: New.
2010-02-23 Jakub Jelinek <jakub@redhat.com> 2010-02-23 Jakub Jelinek <jakub@redhat.com>
PR target/43139 PR target/43139
...@@ -12,7 +19,7 @@ ...@@ -12,7 +19,7 @@
* gcc.dg/march.c: New. * gcc.dg/march.c: New.
* gcc.dg/march-generic.c: New. * gcc.dg/march-generic.c: New.
* gcc.dg/mtune.c: New. * gcc.dg/mtune.c: New.
2010-02-22 Sebastian Pop <sebastian.pop@amd.com> 2010-02-22 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/43083 PR middle-end/43083
......
// PR debug/42800
// { dg-options "-gdwarf-2 -dA" }
// { dg-final { scan-assembler "DW_AT_upper_bound" } }
int
f (int i)
{
char a[i];
return a[0];
}
...@@ -35,7 +35,7 @@ set comp_output [g++_target_compile \ ...@@ -35,7 +35,7 @@ set comp_output [g++_target_compile \
if { ! [string match "*: target system does not support the * debug format*" \ if { ! [string match "*: target system does not support the * debug format*" \
$comp_output] } { $comp_output] } {
remove-build-file "trivial.S" remove-build-file "trivial.S"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[C\]]] \ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.C $srcdir/c-c++-common/dwarf2/*.c]] \
"" $DEFAULT_CFLAGS "" $DEFAULT_CFLAGS
} }
......
...@@ -35,7 +35,7 @@ set comp_output [gcc_target_compile \ ...@@ -35,7 +35,7 @@ set comp_output [gcc_target_compile \
if { ! [string match "*: target system does not support the * debug format*" \ if { ! [string match "*: target system does not support the * debug format*" \
$comp_output] } { $comp_output] } {
remove-build-file "trivial.S" remove-build-file "trivial.S"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] \ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\] $srcdir/c-c++-common/dwarf2/*.c]] \
"" $DEFAULT_CFLAGS "" $DEFAULT_CFLAGS
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment