Prologue/epilogue sequences added to naked functions
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
The compiler inserts instructions into the prologue and/or epilogue of functions declared with __attribute_
The following test case demonstrates the issue:
struct foo { int a; int b; };
void __attribute_
__asm("bx lr");
}
struct foo __attribute_
__asm("bx lr");
}
When compiled with gcc-arm-
00000000 <frob>:
0: 463b mov r3, r7
2: e883 0003 stmia.w r3, {r0, r1}
6: 4770 bx lr
00000008 <return_a_foo>:
8: 4603 mov r3, r0
a: 4770 bx lr
c: 4618 mov r0, r3
e: bf00 nop
gcc-arm-
Changed in gcc-arm-embedded: | |
status: | New → Confirmed |
Hi Cory,
Thank you for reporting, I can confirm the same behavior. As far as I can tell this is generating suboptimal code sequences, but it shouldnt influence the correctness of the rest of the function. Do you have any example in which this behavior corrupts your function?
I will try to look into why this code is being inserted and I'll keep you posted!
Cheers,
Andre