On Tuesday 01 August 2006 10:08, R. Tyler Ballance wrote:
> I really don't want to start a holy war, but I am an idealist, and I
> don't think "we" as a community should settle for something like the
> GNU Compiler Collection (which I use every day, with about a 50/50
> love-hate relationship).

I am not a regular GCC user, but my recent experience with it has been quite 
bitter. Recently I came across a piece of code that only produces correct 
results with optimization turned on.

My colleague has, by accident, compiled a piece of code we are working on 
without any optimization, and we notice that the result produced by the 
unoptimized code is incorrect. As I trace through the code, I found a simple 
synchronization problem with an external variable being written to by the a 
number of threads concurrently.

The code was hacked up quickly by someone else, and he has been using the -O2 
flag all the time when he was writing the code, so the bug has gone 
undetected for a little while. The bug in our code is quickly fixed, and 
we're still trying to track down to see why the optimization covered up the 
bug.

I'm becoming slightly more cynical about testing any piece of C code with 
optimization turned on in GCC.

Reply via email to