avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Wrong excution order in 4.1.1, but not 3.4.5, regress


From: David Brown
Subject: Re: [avr-gcc-list] Wrong excution order in 4.1.1, but not 3.4.5, regression?
Date: Tue, 20 Feb 2007 09:24:49 +0100
User-agent: Thunderbird 1.5.0.9 (Windows/20061207)

Bob Paddock wrote:
On Monday 19 February 2007 19:34, Eric Weddington wrote:

I can't fully tell what's going on with just the asm snippets you provide.

I spent a while trying to get a reproducible version in a few
lines, but that kept changing the results.


If you can't post a cut-down version, then at least post a compilable section of your code with the minimal necessary typedef's and other definitions included. To be able to test your code, people will have to be able to reproduce the bug.

If the same code is generating assembly with different ordering despite the volatiles, then it is quite likely that there is a bug somewhere. However, I don't know if the C standard is clear on expressions such as "a = b = c", when some or all of these are volatile - it could be that both implementations are correct because the rules are not strict. At the risk of sounding patronising, I'd say that almost any code with "a = b = c" expressions is incorrect code because it is far from clear what you mean, and if volatiles are involved then it is undoubtedly wrong. When the code is re-written to actually say what you mean, do you still get a difference?

Regards,

David


If you think that this is a GCC bug, then please fill out a GCC bug report.

All I know for sure is the code compiled with 3.4.5 works, with 4.1.1
it does not.

Thanks for checking the known bug list first. :-)

If you fill in a GCC bug report, feel free to put my email address on the CC
list of the bug report.

Ok.  I'll try to take care of that in the morning.  For now I'll just keep
using 3.4.5, the code produced there looked far less convoluted, plus
the added bonus of working correctly. :-)








reply via email to

[Prev in Thread] Current Thread [Next in Thread]