diff mbox

[rs6000] Fix PR target/80107, ICE in final_scan_insn

Message ID b30aaf02-e1ad-3cd9-d779-53afc6269961@linux.vnet.ibm.com
State New
Headers show

Commit Message

Pat Haugen March 31, 2017, 3:25 p.m. UTC
float<QHI:mode><FP_ISA3:mode>2_internal uses gen_extendhidi2 on a VSX
register but extendhidi2 only supports GPRs if -mno-gen-cell-microcode
is in effect. Fixed by adding a check of TARGET_VSX_SMALL_INTEGER.

Bootstrap/regtest on powerpc64le-linux with no regressions, ok for
trunk? The -mvsx-small-integer option/code was introduced in GCC 7 so no
need for backport.

-Pat


2017-03-31  Pat Haugen  <pthaugen@us.ibm.com>

	PR target/80107
	* config/rs6000/rs6000.md (extendhi<mode>2): Add test for
	TARGET_VSX_SMALL_INTEGER.

testsuite/ChangeLog:
2017-03-31  Pat Haugen  <pthaugen@us.ibm.com>

	* gfortran.dg/pr80107.f: New.

Comments

Segher Boessenkool March 31, 2017, 3:35 p.m. UTC | #1
On Fri, Mar 31, 2017 at 10:25:00AM -0500, Pat Haugen wrote:
> float<QHI:mode><FP_ISA3:mode>2_internal uses gen_extendhidi2 on a VSX
> register but extendhidi2 only supports GPRs if -mno-gen-cell-microcode
> is in effect. Fixed by adding a check of TARGET_VSX_SMALL_INTEGER.

Yuck :-)

> Bootstrap/regtest on powerpc64le-linux with no regressions, ok for
> trunk? The -mvsx-small-integer option/code was introduced in GCC 7 so no
> need for backport.

With this line removed:
> +! { dg-prune-output "-mno-gen-cell-microcode requires -mcpu=cell" }

Okay, thanks!


Segher
diff mbox

Patch

Index: config/rs6000/rs6000.md
===================================================================
--- config/rs6000/rs6000.md	(revision 246534)
+++ config/rs6000/rs6000.md	(working copy)
@@ -954,7 +954,7 @@  (define_expand "extendhi<mode>2"
 (define_insn "*extendhi<mode>2"
   [(set (match_operand:EXTHI 0 "gpc_reg_operand" "=r,r,?*wK,?*wK")
 	(sign_extend:EXTHI (match_operand:HI 1 "reg_or_mem_operand" "m,r,Z,wK")))]
-  "rs6000_gen_cell_microcode"
+  "rs6000_gen_cell_microcode || TARGET_VSX_SMALL_INTEGER"
   "@
    lha%U1%X1 %0,%1
    extsh %0,%1
Index: testsuite/gfortran.dg/pr80107.f
===================================================================
--- testsuite/gfortran.dg/pr80107.f	(nonexistent)
+++ testsuite/gfortran.dg/pr80107.f	(working copy)
@@ -0,0 +1,7 @@ 
+! { dg-do compile { target { powerpc*-*-* } } }
+! { dg-options "-O0 -mpower9-dform-vector -mno-gen-cell-microcode" }
+
+      integer(kind=2) j, j2, ja
+      call c_c(CMPLX(j),(1.,0.),'CMPLX(integer(2))')
+      end
+! { dg-prune-output "-mno-gen-cell-microcode requires -mcpu=cell" }