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
This commit is contained in:
Jason Merrill 2010-02-23 13:32:09 -05:00 committed by Jason Merrill
parent a3b20e90b1
commit 3adcf52c82
6 changed files with 39 additions and 18 deletions

View File

@ -1,5 +1,9 @@
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
* stor-layout.c (place_field): Don't warn about unnecessary
DECL_PACKED if the type is packed.

View File

@ -1331,8 +1331,7 @@ expand_used_vars (void)
if (is_gimple_reg (var))
{
TREE_USED (var) = 0;
ggc_free (t);
continue;
goto next;
}
/* We didn't set a block for static or extern because it's hard
to tell the difference between a global variable (re)declared
@ -1353,20 +1352,20 @@ expand_used_vars (void)
TREE_USED (var) = 1;
if (expand_now)
{
expand_one_var (var, true, true);
if (DECL_ARTIFICIAL (var) && !DECL_IGNORED_P (var))
{
rtx rtl = DECL_RTL_IF_SET (var);
expand_one_var (var, true, true);
/* Keep artificial non-ignored vars in cfun->local_decls
chain until instantiate_decls. */
if (rtl && (MEM_P (rtl) || GET_CODE (rtl) == CONCAT))
{
TREE_CHAIN (t) = cfun->local_decls;
cfun->local_decls = t;
continue;
}
next:
if (DECL_ARTIFICIAL (var) && !DECL_IGNORED_P (var))
{
rtx rtl = DECL_RTL_IF_SET (var);
/* Keep artificial non-ignored vars in cfun->local_decls
chain until instantiate_decls. */
if (rtl && (MEM_P (rtl) || GET_CODE (rtl) == CONCAT))
{
TREE_CHAIN (t) = cfun->local_decls;
cfun->local_decls = t;
continue;
}
}

View File

@ -1,3 +1,10 @@
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>
PR target/43139
@ -12,7 +19,7 @@
* gcc.dg/march.c: New.
* gcc.dg/march-generic.c: New.
* gcc.dg/mtune.c: New.
2010-02-22 Sebastian Pop <sebastian.pop@amd.com>
PR middle-end/43083

View File

@ -0,0 +1,11 @@
// 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];
}

View File

@ -35,7 +35,7 @@ set comp_output [g++_target_compile \
if { ! [string match "*: target system does not support the * debug format*" \
$comp_output] } {
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
}

View File

@ -35,7 +35,7 @@ set comp_output [gcc_target_compile \
if { ! [string match "*: target system does not support the * debug format*" \
$comp_output] } {
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
}