Fix PR target/22260

Eric Botcazou ebotcazou@libertysurf.fr
Fri Jul 1 00:20:00 GMT 2005


This is an embarassing thinko in the new code to emit thunks without using 
delay slots if -fno-delayed-branch, for example at -O0 (retrospectively, I 
wonder whether adding this code was such a good idea), a regression present 
in the 4.x compilers.

Loading the PIC register in the thunk clobbers %o7... but also the PIC 
register itself that may have pointed to another GOT up to now.

Tested on sparc-sun-solaris2.8, applied to mainline and 4.0 branch as it's a 
serious wrong code generation bug for C++.


2005-06-30  Eric Botcazou  <ebotcazou@libertysurf.fr>

	PR target/22260
	* config/sparc/sparc.c (emit_and_preserve): Add 2nd register.
	Preserve the 2nd register too, if present.
	(sparc_output_mi_thunk) <PIC case>: Preserve the PIC register too.
	Adjust call to emit_and_preserve.

	
-- 
Eric Botcazou
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr22260.diff
Type: text/x-diff
Size: 2583 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050701/44624e40/attachment.bin>


More information about the Gcc-patches mailing list