This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]