[dataflow or trunk?] PATCH: fix caller-save.c on sibcalls

Paolo Bonzini paolo.bonzini@lu.unisi.ch
Wed Feb 14 08:27:00 GMT 2007


Kenny sent me a testcase for which fwprop triggers an ICE on dataflow 
branch.  The ICE is in caller-save.c, so this is most likely a latent 
bug in this file.

The problem is that the sibcall pattern on arm does not clobber the link 
register; then, the link register happens to be live before and after 
the sibcall and caller-save.c tries to spill it to the stack.  This 
crashes because the register isn't otherwise used in the function, and a 
save area hasn't been reserved on the stack.

The attached mini patch seems to fix the problem, but I'm inexperienced 
enough in reload and the related parts of GCC, that I'm not sure it's 
just papering over the problem.  It has been tested with an assembly 
comparison of cc1 files on powerpc-apple-darwin on dataflow branch -- 
which gave no difference with or without the patch.

Does anybody think that this belongs to the trunk too, as the bug could 
be latent there?  I'll do a bootstrap on trunk too if it is approved for 
there; in the meanwhile, the dataflow people may want to bootstrap the 
branch with this patch on arm-elf, since the testcase showed the problem 
on that platform.

Thanks,

Paolo
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: kennys-bug.patch
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070214/e690b329/attachment.ksh>


More information about the Gcc-patches mailing list