This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/35807] Compiler makes use of [std Y+1, rX] instruction without initializing r28,r29
- From: "ruud at betaresearch dot nl" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Apr 2008 22:39:28 -0000
- Subject: [Bug target/35807] Compiler makes use of [std Y+1, rX] instruction without initializing r28,r29
- References: <bug-35807-16008@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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