gnu.gcc.help
[Top] [All Lists]

Re: Output file crashes when turning optimization on (GCC 4.0.2)

Subject: Re: Output file crashes when turning optimization on (GCC 4.0.2)
From: alex-google-groups@xxxxxxxxxxx
Date: 22 Nov 2005 12:12:35 -0800
Newsgroups: gnu.gcc.help
Maurizio Loreti wrote:
> alex-google-groups@xxxxxxxxxxx writes:
>
> > I am trying to see which individual optimization option is causing
> > the problem.
>
> It is *much* more likely that the different optimization and the
> different program layout are causing a manifest effect due to one or
> more bugs in your program --- it is your program the cause, not the
> compiler and its optimizations.

Whilst I agree that's normally the case, I don't think it is the case
here, because:

1. No other changes I've introduced cause this problem (including
compiling for a completely different platform), whereas changing from
"-O2" to "-O1 plus all options documented to get to -O2" has
consistently produced the problem, on all platforms, even with
extensive other code changes in the same bits of code. And the error is
repeatable, in the same place.

2. Even if it was a manifest effect, "-O2", and "-O1 plus all the
documented options to get there" are meant to have exactly the same
effect, and thus produce (byte for byte) the same binary. Clearly, they
are doing something different.

Alex


<Prev in Thread] Current Thread [Next in Thread>