|If I have an AVR32 UC3 function compiled with __attribute__ ((naked)), the compiler doesn't generate any prolog or epilog code, but it still seems to assume the frame pointer (r7) is pointing somewhere useful, as this code cut and pasted from the disassembly window shows:
80000E2C pushm R0-R3, R4-R7
clearsv(); // clear GPIO interrupt
80000E2E mcall 0x80000e64
tptr = scheduler(); // see if another task is ready to run
80000E32 mcall 0x80000e68
80000E36 mov R8, R12
80000E38 st.w R7[-4], R8
80000E3C ld.w R8, R7[-4]
80000E40 cp.w R8, 0
80000E42 breq 0x80000e5e
Notice the references to r7? Why is the compiler assuming that r7 points to the stack frame?
This is in Atmel Studio 6, BTW.