rs6000: Fix an ICE with -mno-direct-move (PR85291)

Message ID aee6b1e371c3fb8f3a2c0246611d11aa6cda0d2c.1523560584.git.segher@kernel.crashing.org
State New
Headers show
Series
  • rs6000: Fix an ICE with -mno-direct-move (PR85291)
Related show

Commit Message

Segher Boessenkool April 12, 2018, 7:47 p.m.
This fixes an ICE with -mno-direct-move.

Tested etc.; committing.


Segher


2018-04-12  Segher Boessenkool  <segher@kernel.crashing.org>

	* config/rs6000/rs6000.md (fix_trunc<mode>si2): Use legacy code if
	asked to not generate direct moves.
	(fix_trunc<mode>si2_stfiwx): Similar.
	(fix_trunc<mode>si2_internal): Similar.

---
 gcc/config/rs6000/rs6000.md | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Patch

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 25ac0b8..de652fa 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -5591,7 +5591,7 @@  (define_expand "fix_trunc<mode>si2"
 	(fix:SI (match_operand:SFDF 1 "gpc_reg_operand")))]
   "TARGET_HARD_FLOAT && <TARGET_FLOAT>"
 {
-  if (!TARGET_P8_VECTOR)
+  if (!(TARGET_P8_VECTOR && TARGET_DIRECT_MOVE))
     {
       rtx src = force_reg (<MODE>mode, operands[1]);
 
@@ -5618,7 +5618,7 @@  (define_insn_and_split "fix_trunc<mode>si2_stfiwx"
   "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT
    && (<MODE>mode != SFmode || TARGET_SINGLE_FLOAT)
    && TARGET_STFIWX && can_create_pseudo_p ()
-   && !TARGET_P8_VECTOR"
+   && !(TARGET_P8_VECTOR && TARGET_DIRECT_MOVE)"
   "#"
   ""
   [(pc)]
@@ -5659,7 +5659,8 @@  (define_insn_and_split "fix_trunc<mode>si2_internal"
 	(fix:SI (match_operand:SFDF 1 "gpc_reg_operand" "d,<rreg>")))
    (clobber (match_operand:DI 2 "gpc_reg_operand" "=1,d"))
    (clobber (match_operand:DI 3 "offsettable_mem_operand" "=o,o"))]
-  "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT && !TARGET_P8_VECTOR"
+  "TARGET_HARD_FLOAT && TARGET_DOUBLE_FLOAT
+   && !(TARGET_P8_VECTOR && TARGET_DIRECT_MOVE)"
   "#"
   ""
   [(pc)]