re PR target/83946 (Safe Indirect Jumps broken on AIX)
authorBill Schmidt <wschmidt@linux.vnet.ibm.com>
Sun, 21 Jan 2018 13:26:07 +0000 (13:26 +0000)
committerWilliam Schmidt <wschmidt@gcc.gnu.org>
Sun, 21 Jan 2018 13:26:07 +0000 (13:26 +0000)
[gcc]

2018-01-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
    David Edelsohn <dje.gcc@gmail.com>

PR target/83946
* config/rs6000/rs6000.md (*call_indirect_nonlocal_sysv<mode>):
Change "crset eq" to "crset 2".
(*call_value_indirect_nonlocal_sysv<mode>): Likewise.
(*call_indirect_aix<mode>_nospec): Likewise.
(*call_value_indirect_aix<mode>_nospec): Likewise.
(*call_indirect_elfv2<mode>_nospec): Likewise.
(*call_value_indirect_elfv2<mode>_nospec): Likewise.
(*sibcall_nonlocal_sysv<mode>): Change "crset eq" to "crset 2";
change assembly output from . to $.
(*sibcall_value_nonlocal_sysv<mode>): Likewise.
(indirect_jump<mode>_nospec): Change assembly output from . to $.
(*tablejump<mode>_internal1_nospec): Likewise.

[gcc/testsuite]

2018-01-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
    David Edelsohn <dje.gcc@gmail.com>

PR target/83946
* gcc.target/powerpc/safe-indirect-jump-1.c: Change expected
assembly output from "crset eq" to "crset 2".
* gcc.target/powerpc/safe-indirect-jump-2.c: Change expected
assembly output from . to $.
* gcc.target/powerpc/safe-indirect-jump-3.c: Likewise.
* gcc.target/powerpc/safe-indirect-jump-1.c: Change expected
assembly output from "crset eq" to "crset 2".
* gcc.target/powerpc/safe-indirect-jump-8.c: Change expected
assembly output from "crset eq" to "crset 2", and from . to $.

Co-Authored-By: David Edelsohn <dje.gcc@gmail.com>
From-SVN: r256931

gcc/ChangeLog
gcc/config/rs6000/rs6000.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-1.c
gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-2.c
gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-3.c
gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-7.c
gcc/testsuite/gcc.target/powerpc/safe-indirect-jump-8.c

index 25c0d814be46ebebfae0496938c07fb21583ff2d..4d56c473e68b13916f83e5bc8208bfc94d18f28e 100644 (file)
@@ -1,3 +1,20 @@
+2018-01-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
+           David Edelsohn <dje.gcc@gmail.com>
+
+       PR target/83946
+       * config/rs6000/rs6000.md (*call_indirect_nonlocal_sysv<mode>):
+       Change "crset eq" to "crset 2".
+       (*call_value_indirect_nonlocal_sysv<mode>): Likewise.
+       (*call_indirect_aix<mode>_nospec): Likewise.
+       (*call_value_indirect_aix<mode>_nospec): Likewise.
+       (*call_indirect_elfv2<mode>_nospec): Likewise.
+       (*call_value_indirect_elfv2<mode>_nospec): Likewise.
+       (*sibcall_nonlocal_sysv<mode>): Change "crset eq" to "crset 2";
+       change assembly output from . to $.
+       (*sibcall_value_nonlocal_sysv<mode>): Likewise.
+       (indirect_jump<mode>_nospec): Change assembly output from . to $.
+       (*tablejump<mode>_internal1_nospec): Likewise.
+
 2018-01-21  Oleg Endo  <olegendo@gcc.gnu.org>
 
        PR target/80870
index 4cef5bbc799b95fbb503ad51c23281276efb773f..757ec38084d286010c6c20d6336fecbcbc6243c7 100644 (file)
       || which_alternative == 1 || which_alternative == 3)
     return "b%T0l";
   else
-    return "crset eq\;beq%T0l-";
+    return "crset 2\;beq%T0l-";
 }
   [(set_attr "type" "jmpreg,jmpreg,jmpreg,jmpreg")
    (set (attr "length")
       || which_alternative == 1 || which_alternative == 3)
     return "b%T1l";
   else
-    return "crset eq\;beq%T1l-";
+    return "crset 2\;beq%T1l-";
 }
   [(set_attr "type" "jmpreg,jmpreg,jmpreg,jmpreg")
    (set (attr "length")
    (set (reg:P TOC_REGNUM) (unspec:P [(match_operand:P 3 "const_int_operand" "n,n")] UNSPEC_TOCSLOT))
    (clobber (reg:P LR_REGNO))]
   "DEFAULT_ABI == ABI_AIX && !rs6000_speculate_indirect_jumps"
-  "crset eq\;<ptrload> 2,%2\;beq%T0l-\;<ptrload> 2,%3(1)"
+  "crset 2\;<ptrload> 2,%2\;beq%T0l-\;<ptrload> 2,%3(1)"
   [(set_attr "type" "jmpreg")
    (set_attr "length" "16")])
 
    (set (reg:P TOC_REGNUM) (unspec:P [(match_operand:P 4 "const_int_operand" "n,n")] UNSPEC_TOCSLOT))
    (clobber (reg:P LR_REGNO))]
   "DEFAULT_ABI == ABI_AIX && !rs6000_speculate_indirect_jumps"
-  "crset eq\;<ptrload> 2,%3\;beq%T1l-\;<ptrload> 2,%4(1)"
+  "crset 2\;<ptrload> 2,%3\;beq%T1l-\;<ptrload> 2,%4(1)"
   [(set_attr "type" "jmpreg")
    (set_attr "length" "16")])
 
    (set (reg:P TOC_REGNUM) (unspec:P [(match_operand:P 2 "const_int_operand" "n,n")] UNSPEC_TOCSLOT))
    (clobber (reg:P LR_REGNO))]
   "DEFAULT_ABI == ABI_ELFv2 && !rs6000_speculate_indirect_jumps"
-  "crset eq\;beq%T0l-\;<ptrload> 2,%2(1)"
+  "crset 2\;beq%T0l-\;<ptrload> 2,%2(1)"
   [(set_attr "type" "jmpreg")
    (set_attr "length" "12")])
 
    (set (reg:P TOC_REGNUM) (unspec:P [(match_operand:P 3 "const_int_operand" "n,n")] UNSPEC_TOCSLOT))
    (clobber (reg:P LR_REGNO))]
   "DEFAULT_ABI == ABI_ELFv2 && !rs6000_speculate_indirect_jumps"
-  "crset eq\;beq%T1l-\;<ptrload> 2,%3(1)"
+  "crset 2\;beq%T1l-\;<ptrload> 2,%3(1)"
   [(set_attr "type" "jmpreg")
    (set_attr "length" "12")])
 
        return \"b%T0\";
       else
        /* Can use CR0 since it is volatile across sibcalls.  */
-       return \"crset eq\;beq%T0-\;b .\";
+       return \"crset 2\;beq%T0-\;b $\";
     }
   else if (DEFAULT_ABI == ABI_V4 && flag_pic)
     {
        return \"b%T1\";
       else
        /* Can use CR0 since it is volatile across sibcalls.  */
-       return \"crset eq\;beq%T1-\;b .\";
+       return \"crset 2\;beq%T1-\;b $\";
     }
   else if (DEFAULT_ABI == ABI_V4 && flag_pic)
     {
   [(set (pc) (match_operand:P 0 "register_operand" "c,*l"))
    (clobber (match_operand:CC 1 "cc_reg_operand" "=y,y"))]
   "!rs6000_speculate_indirect_jumps"
-  "crset %E1\;beq%T0- %1\;b ."
+  "crset %E1\;beq%T0- %1\;b $"
   [(set_attr "type" "jmpreg")
    (set_attr "length" "12")])
 
    (use (label_ref (match_operand 1)))
    (clobber (match_operand:CC 2 "cc_reg_operand" "=y,y"))]
   "!rs6000_speculate_indirect_jumps"
-  "crset %E2\;beq%T0- %2\;b ."
+  "crset %E2\;beq%T0- %2\;b $"
   [(set_attr "type" "jmpreg")
    (set_attr "length" "12")])
 
index eb68dde3307bf7726d54705b466c8d0eb14bce38..7bde92d90e969ca921bea4d23e307e24502a063e 100644 (file)
@@ -1,3 +1,17 @@
+2018-01-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>
+           David Edelsohn <dje.gcc@gmail.com>
+
+       PR target/83946
+       * gcc.target/powerpc/safe-indirect-jump-1.c: Change expected
+       assembly output from "crset eq" to "crset 2".
+       * gcc.target/powerpc/safe-indirect-jump-2.c: Change expected
+       assembly output from . to $.
+       * gcc.target/powerpc/safe-indirect-jump-3.c: Likewise.
+       * gcc.target/powerpc/safe-indirect-jump-1.c: Change expected
+       assembly output from "crset eq" to "crset 2".
+       * gcc.target/powerpc/safe-indirect-jump-8.c: Change expected
+       assembly output from "crset eq" to "crset 2", and from . to $.
+
 2018-01-20  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        PR fortran/83900
index d66e9c3cdb9d0de87e52bd0844e240053f8d6d74..99cfab29e6eda941b08ee30486dd312bed83ed3d 100644 (file)
@@ -10,5 +10,5 @@ int bar ()
   return (*f) ();
 }
 
-/* { dg-final { scan-assembler "crset eq" } } */
+/* { dg-final { scan-assembler "crset 2" } } */
 /* { dg-final { scan-assembler "beqctrl-" } } */
index b51034fa1b0c259bd705a2658828074dea7f38f4..1c23a5d9addfc4bf3d20764791a0469dea31d203 100644 (file)
@@ -30,4 +30,4 @@ int foo (int x)
 
 /* { dg-final { scan-assembler "crset 30" } } */
 /* { dg-final { scan-assembler "beqctr- 7" } } */
-/* { dg-final { scan-assembler "b ." } } */
+/* { dg-final { scan-assembler {b \$} } } */
index 81da127cc17bfa43f5ec70326f262d0dabefeb66..d0eccc4f262fa3f6931c0e4d34a2c33d23d7023a 100644 (file)
@@ -49,4 +49,4 @@ int foo (int x)
 
 /* { dg-final { scan-assembler "crset 30" } } */
 /* { dg-final { scan-assembler "beqctr- 7" } } */
-/* { dg-final { scan-assembler "b ." } } */
+/* { dg-final { scan-assembler {b \$} } } */
index d19245e34c4fcf6b9bceb55ca5134dbe13669ed0..b1bdcca852400266ef64c3a2f53367e966004a31 100644 (file)
@@ -10,5 +10,5 @@ int bar ()
   return (*f) () * 53;
 }
 
-/* { dg-final { scan-assembler "crset eq" } } */
+/* { dg-final { scan-assembler "crset 2" } } */
 /* { dg-final { scan-assembler "beqctrl-" } } */
index be2150e0c148a5312160a68fd81fa69ca5e295d8..27642cc4450a9ef580f8f05f9712cc394f024a60 100644 (file)
@@ -10,6 +10,6 @@ int bar ()
   return (*f) ();
 }
 
-/* { dg-final { scan-assembler "crset eq" } } */
+/* { dg-final { scan-assembler "crset 2" } } */
 /* { dg-final { scan-assembler "beqctr-" } } */
-/* { dg-final { scan-assembler "b ." } } */
+/* { dg-final { scan-assembler {b \$} } } */