This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.


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" }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]