This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/25428] New: arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ")))
- From: "th dot r dot klein at web dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Dec 2005 14:57:21 -0000
- Subject: [Bug c/25428] New: arm-elf-gcc generating wrong code with -O flag at functions with __attribute__ ((interrupt ("IRQ")))
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
If a little bit more complex interrupt function is required the compiler
genrates wrong code (olny with -O flag set).
Compiler generats:
sub lr, lr, #4
stmfd sp!, {r.., lr}
.
.
.
ldmfd sp!, {r.., lr}
subs pc, lr, #4
Here the LR is decremented one time too mutch.
Ether first or the second "sub" is wrong.
It should be:
sub lr, lr, #4
stmfd sp!, {r.., lr}
.
.
.
ldmfd sp!, {r.., lr}^
(the last '^' is important)
P.S. Since I can't add any attachments now. I'll try this after 'commit'.
--
Summary: arm-elf-gcc generating wrong code with -O flag at
functions with __attribute__ ((interrupt ("IRQ")))
Product: gcc
Version: 4.0.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: th dot r dot klein at web dot de
GCC host triplet: i386-freebds-elf
GCC target triplet: arm-unknown-elf
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25428