re PR middle-end/65958 (-fstack-check breaks alloca on architectures using generic...
authorEric Botcazou <ebotcazou@adacore.com>
Fri, 4 Dec 2015 11:57:15 +0000 (11:57 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Fri, 4 Dec 2015 11:57:15 +0000 (11:57 +0000)
commit03c00798828246afcfd998988c9fee8321b9313c
treed944ebe798474d59975ae0092d6818956e8aeba8
parenta3eb8a52b5c1e1f3af616d88bf6a057dd4f81eb3
re PR middle-end/65958 (-fstack-check breaks alloca on architectures using generic stack checking)

PR middle-end/65958
* gimplify.c (struct gimplify_ctx): Turn boolean fields into 1-bit
fields, add keep_stack and reorder them.
(gimplify_bind_expr): Save gimplify_ctxp->keep_stack on entry then
set it to false.  Do not insert a stack save/restore pair if it has
been set to true by the gimplification of the statements.
Restore it to the saved value on exit if it is still false.
(gimplify_vla_decl): Do not set gimplify_ctxp->save_stack here.
(gimplify_call_expr) <BUILT_IN_ALLOCA[_WITH_ALIGN]>: New case.  Set
either save_stack or keep_stack depending on CALL_ALLOCA_FOR_VAR_P.
* doc/extend.texi (Variable Length): Document new behavior.
* doc/generic.texi (Blocks): Document new handling of VLAs.

From-SVN: r231260
gcc/ChangeLog
gcc/doc/extend.texi
gcc/doc/generic.texi
gcc/gimplify.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vla-24.c [new file with mode: 0644]