backport: re PR target/83946 (Safe Indirect Jumps broken on AIX)

[gcc]

2018-01-21  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	Backport from mainline
	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>

	Backport from mainline
	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 $.

From-SVN: r256932
This commit is contained in:
Bill Schmidt 2018-01-21 13:32:58 +00:00 committed by William Schmidt
parent 2b34fcaf99
commit 6a6eb20cce
8 changed files with 53 additions and 16 deletions

View File

@ -1,3 +1,23 @@
2018-01-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Backport from mainline
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>
Backport from mainline

View File

@ -11006,7 +11006,7 @@
|| 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")
@ -11119,7 +11119,7 @@
|| 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")
@ -11280,7 +11280,7 @@
(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")])
@ -11304,7 +11304,7 @@
(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")])
@ -11329,7 +11329,7 @@
(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")])
@ -11352,7 +11352,7 @@
(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")])
@ -11536,7 +11536,7 @@
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)
{
@ -11593,7 +11593,7 @@
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)
{
@ -13026,7 +13026,7 @@
[(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")])
@ -13133,7 +13133,7 @@
(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")])

View File

@ -1,3 +1,20 @@
2018-01-21 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Backport from mainline
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

View 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-" } } */

View 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 \$} } } */

View 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 \$} } } */

View 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-" } } */

View 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 \$} } } */