[PATCH]: Fix push of SP on 68HC12 and conflict between -mlong-calls and interrupt
Stephane Carrez
stcarrez@nerim.fr
Sun Mar 7 10:06:00 GMT 2004
Hi!
This patch fixes:
- the push of SP register for 68HC12. It was written 'sts -2,sp' which means
(MEM (PLUS SP -2)) but it must be written 'sts 2,-sp' which means
(MEM (PRE_DEC SP)). This form is used when comparing the SP with another
register (X, D, Y) as compare can only compare with memory or immediate.
- an interrupt handler that is compiled with -mlong-calls is marked with asm
.far which tells the linker to emit a trampoline when the function address
is taken. For an interrupt handler, this is wrong and causes a crash when
it returns. An interrupt handler must not be put in a banked area anyway.
This pb is registered in Savannah under
[bugs #8028] Problem with interrupt handlers and -mlong-calls
http://savannah.gnu.org/bugs/?func=detailitem&item_id=8028
Committed on 3_4 and mainline.
Stephane
2004-03-06 Stephane Carrez <stcarrez@nerim.fr>
* config/m68hc11/m68hc11.c (m68hc11_gen_movhi): Use 2,-sp to push
the stack register.
(expand_prologue): Don't make an interrupt or a trap handler a far
symbol.
(m68hc11_initial_elimination_offset): Likewise.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: m68hc11.c.diffs
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040307/de3203ea/attachment.ksh>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 253 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040307/de3203ea/attachment.sig>
More information about the Gcc-patches
mailing list