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

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

Re: [avr-gcc-list] My program runs correctly when compiled with -Os, bu


From: David Brown
Subject: Re: [avr-gcc-list] My program runs correctly when compiled with -Os, but not with -O2
Date: Fri, 07 Nov 2008 09:51:07 +0100
User-agent: Thunderbird 2.0.0.17 (Windows/20080914)

Lin Nan wrote:
> Could anybody give some tips on it?
>  

It's a little difficult without knowing anything more about your code,
but the most common cause for code that fails with higher optimisation
is missing or incorrect use of "volatile".  It's unusual that the change
from -Os to -O2 makes a difference, since there is seldom much
difference in the generated code.

Try to isolate the problem area and look at the generated assembly to
see the differences.

mvh.,

David





reply via email to

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