Re: codegen differences for increment of a volatile int

2006-05-05 Thread Richard Henderson
On Fri, May 05, 2006 at 04:29:53AM -0700, Gary Funck wrote: > ... where, when incrmenting the non-volatile 'j', it chosses 'addl' > over 'incl'. Pentium 4 is stupid that way; addl is faster. r~

RE: codegen differences for increment of a volatile int

2006-05-05 Thread Gary Funck
> From: Bernd Jendrissek > Sent: Friday, May 05, 2006 12:50 AM [...] > Systems programmers should know better than to expect a particular > implementation of volatile. :) > > How, for example, would you suggest GCC generate code for this? > > volatile int qwerty; > > void p() > { > printf("q

Re: codegen differences for increment of a volatile int

2006-05-05 Thread Bernd Jendrissek
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, May 04, 2006 at 02:45:50PM -0700, Gary Funck wrote: > Beginning with this simple example, > > 1 int j; > 2 volatile int jv; > 3 void p() > 4 { > 5++j; > 6++jv; > 7 } > > when compiled with "gcc

Re: codegen differences for increment of a volatile int

2006-05-04 Thread Mike Stump
On May 4, 2006, at 2:45 PM, Gary Funck wrote: I've been looking at how GCC 4.0 handles "volatile" internally, and may have a question/two on that later, but in the meantime, I noticed some interesting differences in generated code that I thought were a bit unusual, and was wondering if someone he