This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/27234] no way to stop gcc from mucking with the incoming argument stack on ia32
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Apr 2008 10:25:11 -0000
- Subject: [Bug target/27234] no way to stop gcc from mucking with the incoming argument stack on ia32
- References: <bug-27234-12219@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #18 from jakub at gcc dot gnu dot org 2008-04-11 10:25 -------
Seems I forgot to provide the testcase I was talking about. Here it is:
__attribute__((preserve_stack)) void f1 (int a, int b, int c, int d, int e)
{
int i;
for (i = 0; i < 50; i++)
{
// Simulate high register pressure, I'm lazy
asm volatile ("" : : "r" (e) : "%eax", "%ebx", "%ecx", "%edx", "%esi");
e++;
asm volatile ("" : : "r" (d) : "%eax", "%ebx", "%ecx", "%edx", "%esi");
}
}
__attribute__((preserve_stack)) void f2 (int a, int b, int c, int d, int e)
{
int i;
for (i = 0; i < 50; i++)
{
asm volatile ("" : : "m" (e) : "%eax", "%ebx", "%ecx", "%edx", "%esi",
"%edi");
e++;
}
}
extern int fn (int, int);
__attribute__((preserve_stack)) int f3 (int a, int b)
{
return fn (b, a);
}
__attribute__((preserve_stack)) int f4 (int a, int b)
{
return fn (a, b);
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27234