This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Patch,AVR]: Fix PR45263
- From: Georg-Johann Lay <avr at gjlay dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Denis Chertykov <chertykov at gmail dot com>, Anatoly Sokolov <aesok at post dot ru>, Eric Weddington <eric dot weddington at atmel dot com>
- Date: Fri, 01 Apr 2011 20:20:13 +0200
- Subject: [Patch,AVR]: Fix PR45263
This is straight forward fix for PR45263 (R20 clobbered by
constructor/destructor).
Using call-saved register like R15 is undesired because upcoming
ATtiny10 architecture.
2011-04-01 Georg-Johann Lay <avr@gjlay.de>
PR target/45263
* config/avr/libgcc.S (__do_global_ctors, __do_global_dtors): Save
R20 around calls of __tablejump_elpm__
Index: config/avr/libgcc.S
===================================================================
--- config/avr/libgcc.S (Revision 171824)
+++ config/avr/libgcc.S (Arbeitskopie)
@@ -802,7 +802,9 @@ __do_global_ctors:
mov_h r31, r29
mov_l r30, r28
out __RAMPZ__, r20
+ push r20
XCALL __tablejump_elpm__
+ pop r20
.L__do_global_ctors_start:
cpi r28, lo8(__ctors_start)
cpc r29, r17
@@ -843,7 +845,9 @@ __do_global_dtors:
mov_h r31, r29
mov_l r30, r28
out __RAMPZ__, r20
+ push r20
XCALL __tablejump_elpm__
+ pop r20
.L__do_global_dtors_start:
cpi r28, lo8(__dtors_end)
cpc r29, r17