aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-12-14 19:33:50 +1030
committerAlan Modra <amodra@gcc.gnu.org>2018-12-14 19:33:50 +1030
commit04f4909a1e91c3fc350789aa5a46390df3aa89f3 (patch)
tree2880d6a4e8af9bedc4f6b452ccbae0be613a1997
parent6c4ff3c98c19594ed17f3ad8a3a25a5939e16b30 (diff)
downloadgcc-04f4909a1e91c3fc350789aa5a46390df3aa89f3.zip
gcc-04f4909a1e91c3fc350789aa5a46390df3aa89f3.tar.gz
gcc-04f4909a1e91c3fc350789aa5a46390df3aa89f3.tar.bz2
[RS6000] PR88311, mlongcall indirections are optimised away
Masking CALL_LONG from the cookie was done in order to simplify and correct length attribute calculations for indirect calls at one point in my call series tidy when the indirect patterns used alternatives "0,n" on the cookie operand. (Leaving the CALL_LONG in place calculated the wrong length for long calls without fp args.) This is no longer necessary now that the indirect sysv call patterns explicitly test for the fp arg bits in their length attribute expressions. And without the CALL_LONG to disable insns like call_value_local_svsv, combine merrily replaces the indirect long call sequence with a direct call. As it should. This patch reinstates the CALL_LONG bit. PR rtl-optimization/88311 * config/rs6000/rs6000.c (rs6000_call_sysv): Do not mask cookie. (rs6000_sibcall_sysv): Likewise. From-SVN: r267123
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/rs6000/rs6000.c6
2 files changed, 8 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 6222a3f..aa26099 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2018-12-14 Alan Modra <amodra@gmail.com>
+
+ PR rtl-optimization/88311
+ * config/rs6000/rs6000.c (rs6000_call_sysv): Do not mask cookie.
+ (rs6000_sibcall_sysv): Likewise.
+
2018-12-14 Segher Boessenkool <segher@kernel.crashing.org>
PR rtl-optimization/88001
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 88f4f62..c4682fc 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -37978,8 +37978,7 @@ rs6000_call_sysv (rtx value, rtx func_desc, rtx tlsarg, rtx cookie)
if (value != NULL_RTX)
call[0] = gen_rtx_SET (value, call[0]);
- unsigned int mask = CALL_V4_SET_FP_ARGS | CALL_V4_CLEAR_FP_ARGS;
- call[1] = gen_rtx_USE (VOIDmode, GEN_INT (INTVAL (cookie) & mask));
+ call[1] = gen_rtx_USE (VOIDmode, cookie);
call[2] = gen_rtx_CLOBBER (VOIDmode, gen_rtx_REG (Pmode, LR_REGNO));
insn = gen_rtx_PARALLEL (VOIDmode, gen_rtvec_v (3, call));
@@ -38043,8 +38042,7 @@ rs6000_sibcall_sysv (rtx value, rtx func_desc, rtx tlsarg, rtx cookie)
if (value != NULL_RTX)
call[0] = gen_rtx_SET (value, call[0]);
- unsigned int mask = CALL_V4_SET_FP_ARGS | CALL_V4_CLEAR_FP_ARGS;
- call[1] = gen_rtx_USE (VOIDmode, GEN_INT (INTVAL (cookie) & mask));
+ call[1] = gen_rtx_USE (VOIDmode, cookie);
call[2] = simple_return_rtx;
insn = gen_rtx_PARALLEL (VOIDmode, gen_rtvec_v (3, call));