[Committed] Fix PR middle-end/36238

Andrew Pinski Andrew_Pinski@playstation.sony.com
Sun Aug 10 10:14:00 GMT 2008


Hi,
  The problem here is that during reload, a subreg of a mem is valid
but we call reg_or_subregno without checking to see if the subreg is
of a reg.
I fixed this issue the same way as PR 26826 was fixed, in fact the
pattern there is exactly the same here except that bug was located in
reload.c and this one is located in reload1.c so it looks like it was
missed when Richard fixed that original bug report.

Committed as obvious after a bootstrap/test on i386-darwin.  The test
ICE before and now passes.  Note this patch has also been in the PS3
compiler for a release now as I found this in the PS3 compiler for a
different test.

Thanks,
Andrew Pinski

ChangeLog:

* reload1.c (gen_reload): Guard calls to get_secondary_mem for memory subregs.

* gcc.c-torture/compile/pr36238.c: New testcase.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fixreload.diff.txt
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20080810/c109e9cf/attachment.txt>


More information about the Gcc-patches mailing list