diff mbox

, PR 69461, PowerPC specific fix for toc-fusion

Message ID 20160203233433.GA19926@ibm-tiger.the-meissners.org
State New
Headers show

Commit Message

Michael Meissner Feb. 3, 2016, 11:34 p.m. UTC
In PR 69461, Vlad mentioned that in rs6000_legitimate_address_p, I was trying
to validate an address for TOC fusion, but I was using a predicate that looked
for a MEM instead of an address.

I bootstrapped the compiler on a little endian power8 and there were no
regressions.  In addition, Segher Boessenkool, says that with Vlad's patch and
this patch, it fixes a lot of the errors that he was looking at.

Is the patch ok to check in?

2016-02-03  Michael Meissner  <meissner@linux.vnet.ibm.com>
	    Vladimir Makarov  <vmakarov@redhat.com>

	PR target/69461
	* config/rs6000/rs6000.c (rs6000_legitimate_address_p): Fix thinko
	in validating fused toc addresses.

Comments

David Edelsohn Feb. 4, 2016, 12:17 a.m. UTC | #1
On Wed, Feb 3, 2016 at 6:34 PM, Michael Meissner
<meissner@linux.vnet.ibm.com> wrote:
> In PR 69461, Vlad mentioned that in rs6000_legitimate_address_p, I was trying
> to validate an address for TOC fusion, but I was using a predicate that looked
> for a MEM instead of an address.
>
> I bootstrapped the compiler on a little endian power8 and there were no
> regressions.  In addition, Segher Boessenkool, says that with Vlad's patch and
> this patch, it fixes a lot of the errors that he was looking at.
>
> Is the patch ok to check in?
>
> 2016-02-03  Michael Meissner  <meissner@linux.vnet.ibm.com>
>             Vladimir Makarov  <vmakarov@redhat.com>
>
>         PR target/69461
>         * config/rs6000/rs6000.c (rs6000_legitimate_address_p): Fix thinko
>         in validating fused toc addresses.

Okay.

Thanks, David
diff mbox

Patch

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 233107)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -8399,7 +8399,8 @@  rs6000_legitimate_address_p (machine_mod
       && legitimate_constant_pool_address_p (x, mode,
 					     reg_ok_strict || lra_in_progress))
     return 1;
-  if (reg_offset_p && reg_addr[mode].fused_toc && toc_fusion_mem_wrapped (x, mode))
+  if (reg_offset_p && reg_addr[mode].fused_toc && GET_CODE (x) == UNSPEC
+      && XINT (x, 1) == UNSPEC_FUSION_ADDIS)
     return 1;
   /* For TImode, if we have load/store quad and TImode in VSX registers, only
      allow register indirect addresses.  This will allow the values to go in