This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/31128] __builtin_stack_restore/__builtin_stack_save should not be exposed to the user
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 28 May 2007 19:08:29 -0000
- Subject: [Bug c/31128] __builtin_stack_restore/__builtin_stack_save should not be exposed to the user
- References: <bug-31128-14221@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from pinskia at gcc dot gnu dot org 2007-05-28 19:08 -------
(In reply to comment #6)
> This is very useful for compilers generating C code (e.g. LLVM, and various
> other source -> C compilers). Why remove it? These compilers are generating
> partially structured code, that don't have syntactic blocks required for VLAs.
Because there are better ways of implementing that in the generated C code.
You can create a fake VLA (that is of size 0).
Like:
int f(int t1)
{
{
int t = 0;
int a[t];
int *b = __builtin_alloca(t1);
}
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31128