------- 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