Re: [Bug target/38941] New: CX isn't preserved with shift

2009-01-22 Thread Andrew Thomas Pinski
Sent from my iPhone On Jan 22, 2009, at 5:54 PM, "hjl dot tools at gmail dot com" > wrote: On x86, CX is used for shift. If CX is used for a variable, it may not be preserved with shift: [...@gnu-9 reg-1]$ cat r.c extern void abort (void); void foo (int x) { if (x != 8) abort (); } vo

[Bug target/38941] New: CX isn't preserved with shift

2009-01-22 Thread hjl dot tools at gmail dot com
On x86, CX is used for shift. If CX is used for a variable, it may not be preserved with shift: [...@gnu-9 reg-1]$ cat r.c extern void abort (void); void foo (int x) { if (x != 8) abort (); } void bar (int g) { register int x __asm__("ecx"); x = 5; foo (1 << g); if (x != 5)