|
From: | Georg-Johann Lay |
Subject: | Re: [avr-gcc-list] Weird optimization issue with avr-gcc 4.5.3, re "naked." |
Date: | Sat, 28 Jan 2012 00:32:00 +0100 |
User-agent: | Mozilla Thunderbird 1.0.7 (Windows/20050923) |
Jan Waclawek schrieb:
Moreover, in 4.7 it also stores the variable to stack frame even without naked, so that could be called a missed optimisation/regression.
Thanks for pointing this out. I was lost in all that optimization conversation and thought it was an optimization issue from the first post.
There is nothing written like "program crashes because non-existent frame used".
So the very problem is that there is a frame needed and there is none because of "naked".
Well, that's a bug in the user code, not in the application:You must not assume that the C code need no frame, even if it is a reasonable assumption like here.
However, the frame is really strange and my first suspect is the evildoer: -fcaller-saves.
That option causes evil in some places, or let me put things the other way round: In some cases -fno-caller-saves can avoid harm like spill fails in presence of high register pressure, see PR50925.
Johann
[Prev in Thread] | Current Thread | [Next in Thread] |