This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/35807] Compiler makes use of [std Y+1, rX] instruction without initializing r28,r29



------- Comment #2 from ruud at betaresearch dot nl  2008-04-02 22:39 -------
>From  Andy H <hutchinsonandy@aim.com>
[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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]