------- Comment #2 from ruud at betaresearch dot nl  2008-04-02 22:39 -------
>From  Andy H <[EMAIL PROTECTED]>
[avr-gcc-list] Incorrect code by gcc?

Not a bug

According to the sources you posted,

privQueuRequestBody

void privQueuRequestBody(uint8_t uiSlot, int8_t siFreeFilling, uint16_t
uiTicksToWait) __attribute__ ( ( naked ) );

The relevant part being "naked"

That means gcc will omit prolog - which is where stack and frame pointer are
setup.
R28/29 is the frame pointer. What you see in assembler is gcc saving the
register around a call. Depending on optimization, it may choose to do this
rather than use a register (as the register would need to be saved on the
stack).

If you use naked, you must replace all of prolog/epilog by hand. (its normal
use is for assembler only functions)


Andy


-- 

ruud at betaresearch dot nl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35807

Reply via email to