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  <meiss...@linux.vnet.ibm.com>
            Vladimir Makarov  <vmaka...@redhat.com>

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

-- 
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797
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

Reply via email to