1 /* PR rtl-optimization/9771 */ 2 /* { dg-do run { target i?86-*-* } } */ 3 /* { dg-options "-O2 -fomit-frame-pointer -ffixed-ebp" } */ 4 5 extern void abort(void); 6 extern void exit(int); 7 8 register long *B asm ("ebp"); 9 10 long x = 10; 11 long y = 20; 12 bar(void)13void bar(void) 14 { 15 B = &y; 16 } 17 foo()18void foo() 19 { 20 long *adr = B; 21 long save = *adr; 22 23 *adr = 123; 24 25 bar(); 26 27 *adr = save; 28 } 29 main()30int main() 31 { 32 B = &x; 33 34 foo(); 35 36 if (x != 10 || y != 20) 37 abort(); 38 39 /* We can't return, as our caller may assume %ebp is preserved! */ 40 /* We could save/restore it (like foo), but its easier to exit. */ 41 exit(0); 42 } 43 44