> -----Original Message-----
> From: 
> avr-gcc-list-bounces+eric.weddington=atmel....@nongnu.org 
> [mailto:avr-gcc-list-bounces+eric.weddington=atmel....@nongnu.
> org] On Behalf Of David Brown
> Sent: Saturday, March 27, 2010 5:34 PM
> To: Szikra Istvan; avr-gcc-list@nongnu.org
> Subject: Re: [avr-gcc-list] Re: Inline vs. ? : operator
> 
> > My other problem with this is, it only "returns a value" when it's
> > executed indirectly (contained in a function, that provides it's c
> > parameter as a variable!). For example it does not generate an 'in'
> > instruction in the main program (function). If you were right about
> > that ?: should read the volatile twice, then it should happen at the
> > first bit_write() statement in the main function too.
> > 
> 
> I didn't notice this earlier.  But this behaviour, I believe, is the 
> erroneous behaviour.
> 
> It would seem that this situation is not entirely clear - the 
> compiler 
> should at least be consistent.  But it's not obvious what the correct 
> behaviour should be.  Note that we are concerned here about getting 
> /correct/ code - not necessarily the smallest and fastest code.
> 
> Perhaps some of those more familiar with the internals of gcc 
> and/or the 
> C standards may like to comment.  Otherwise, I'd recommend 
> avoiding the 
> ?: operator with volatiles - stick to code that you know 
> works correctly 
> and optimally.
> 

I will only comment on this when I see a well-formed bug report in the GCC bug 
database:
<http://gcc.gnu.org/bugzilla/>
It must include a buildable test case that shows the alleged issue.


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to