Guest
#1171365
Hi,
I am trying to write mixed ARM/Thumb code and compile it with WinARM.
Unfortunately if I use -mthumb-interwork option, my program don't work,
because gcc generates wrong code for some interrupt functions
(_attribute_ ((interrupt ("IRQ")))).
GCC inserts 'sub' instruction in enter/exit code twice:
sub lr, lr, #4
stmfd sp!, {r.., lr}
.
.
.
ldmfd sp!, {r.., lr}
subs pc, lr, #4
This bug is not new and it is not fixed (bug #16634 and #25428 on gcc
bugzilla).
But if I compile ARM code without -mthumb-interwork option my interrupt
function work correctly. I changed my make file for compile ARM code
without -mthumb-interwork, and compile Thumb code and linking all with
-mthumb-interwork option.
I excluded $(THUMB_IW) option from ALL_CFLAGS and ALL_ASFLAGS, and
inserted it into thumb compile command (...$(THUMB) $(THUMB_IW)...). So,
my programm is working.
For Martin Thomas:
May be you will change standard WinARM make file, and other people will
not have this problem?