mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-18 14:30:42 +08:00
re PR c/19771 (VLA deallocation)
PR c/19771 * c-semantics.c (pop_stmt_list): Propagate STATEMENT_LIST_HAS_LABEL to parent statement list. testsuite: * gcc.c-torture/execute/vla-dealloc-1.c: New test. From-SVN: r146358
This commit is contained in:
parent
28143fdd2f
commit
20845d3582
@ -1,3 +1,9 @@
|
||||
2009-04-19 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
PR c/19771
|
||||
* c-semantics.c (pop_stmt_list): Propagate
|
||||
STATEMENT_LIST_HAS_LABEL to parent statement list.
|
||||
|
||||
2009-04-19 Adam Nemet <anemet@caviumnetworks.com>
|
||||
|
||||
* config/mips/mips.h (mips_tune_attr): New macro.
|
||||
|
@ -70,6 +70,8 @@ pop_stmt_list (tree t)
|
||||
{
|
||||
chain = TREE_CHAIN (u);
|
||||
TREE_CHAIN (u) = NULL_TREE;
|
||||
if (chain)
|
||||
STATEMENT_LIST_HAS_LABEL (chain) |= STATEMENT_LIST_HAS_LABEL (u);
|
||||
if (t == u)
|
||||
break;
|
||||
u = chain;
|
||||
|
@ -1,3 +1,8 @@
|
||||
2009-04-19 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
PR c/19771
|
||||
* gcc.c-torture/execute/vla-dealloc-1.c: New test.
|
||||
|
||||
2009-04-19 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
PR c/38243
|
||||
|
22
gcc/testsuite/gcc.c-torture/execute/vla-dealloc-1.c
Normal file
22
gcc/testsuite/gcc.c-torture/execute/vla-dealloc-1.c
Normal file
@ -0,0 +1,22 @@
|
||||
/* VLAs should be deallocated on a jump to before their definition,
|
||||
including a jump to a label in an inner scope. PR 19771. */
|
||||
|
||||
void *volatile p;
|
||||
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
int n = 0;
|
||||
if (0)
|
||||
{
|
||||
lab:;
|
||||
}
|
||||
int x[n % 1000 + 1];
|
||||
x[0] = 1;
|
||||
x[n % 1000] = 2;
|
||||
p = x;
|
||||
n++;
|
||||
if (n < 1000000)
|
||||
goto lab;
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user