This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/65958] -fstack-check breaks alloca on architectures using generic stack checking
- From: "ebotcazou at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 02 May 2015 09:40:33 +0000
- Subject: [Bug c/65958] -fstack-check breaks alloca on architectures using generic stack checking
- Auto-submitted: auto-generated
- References: <bug-65958-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65958
Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target|arm |
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-05-02
CC| |ebotcazou at gcc dot gnu.org
Target Milestone|--- |6.0
Summary|[arm] -fstack-check breaks |-fstack-check breaks alloca
|__builtin(alloca) |on architectures using
| |generic stack checking
Ever confirmed|0 |1
--- Comment #3 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
Known issue with architectures doing stack-checking the old way like ARM, but
the underlying issue is more general and related to VLAs:
extern void abort (void);
int foo (int n)
{
char *p, *q;
if (1)
{
char i[n];
p = __builtin_alloca (8);
p[0] = 1;
}
q = __builtin_alloca (64);
__builtin_memset (q, 0, 64);
return !p[0];
}
int main (void)
{
if (foo (48) != 0)
abort ();
return 0;
}
fails on x86-64 because of it (with or without -fstack-check).