]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Backport patch for PR86989 to 7
authorSegher Boessenkool <segher@kernel.crashing.org>
Wed, 12 Sep 2018 18:01:11 +0000 (20:01 +0200)
committerSegher Boessenkool <segher@gcc.gnu.org>
Wed, 12 Sep 2018 18:01:11 +0000 (20:01 +0200)
2018-09-12  Segher Boessenkool  <segher@kernel.crashing.org>

Backport from trunk
2018-08-24  Segher Boessenkool  <segher@kernel.crashing.org>

PR target/86989
* config/rs6000/rs6000.c (toc_relative_expr_p): Check that the base is
the TOC register.

From-SVN: r264247

gcc/ChangeLog
gcc/config/rs6000/rs6000.c

index d87df92a4069c8fdd5c17cbfd4e226c138800669..6014ee073592a698f2589cd57efd16bcd2620851 100644 (file)
@@ -1,3 +1,12 @@
+2018-09-12  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       Backport from trunk
+       2018-08-24  Segher Boessenkool  <segher@kernel.crashing.org>
+
+       PR target/86989
+       * config/rs6000/rs6000.c (toc_relative_expr_p): Check that the base is
+       the TOC register.
+
 2018-09-12  Andreas Krebbel  <krebbel@linux.ibm.com>
 
        Backport from mainline
index 61b3f51f2fae8ceeda332c22ce4d7473f33ee582..365f006af6266239f27d1b0db188efcb877a98ce 100644 (file)
@@ -8840,7 +8840,9 @@ toc_relative_expr_p (const_rtx op, bool strict)
     }
 
   return (GET_CODE (tocrel_base) == UNSPEC
-         && XINT (tocrel_base, 1) == UNSPEC_TOCREL);
+         && XINT (tocrel_base, 1) == UNSPEC_TOCREL
+         && REG_P (XVECEXP (tocrel_base, 0, 1))
+         && REGNO (XVECEXP (tocrel_base, 0, 1)) == TOC_REGISTER);
 }
 
 /* Return true if X is a constant pool address, and also for cmodel=medium