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] Fix up ix86_expand_adjust_ufix_to_sfix_si ICE (PR target/91931)


Hi!

The recent SUBREG simplification changes aren't as forgiving in the past and
ICE on invalid constants, in this case CONST_VECTOR:V8SI with 8x CONST_INT
0x80000000 element, which is invalid, because for SImode it needs to be sign
extended.

Fixed thusly, bootstrapped/regtested on x86_64-linux and i686-linux, ok for
trunk?

2019-09-30  Jakub Jelinek  <jakub@redhat.com>

	PR target/91931
	* config/i386/i386-expand.c (ix86_expand_adjust_ufix_to_sfix_si): Use
	gen_int_mode instead of GEN_INT.

	* gcc.target/i386/pr91931.c: New test.

--- gcc/config/i386/i386-expand.c.jj	2019-09-10 20:08:44.931792487 +0200
+++ gcc/config/i386/i386-expand.c	2019-09-29 13:19:47.122382234 +0200
@@ -1694,7 +1694,7 @@ ix86_expand_adjust_ufix_to_sfix_si (rtx
 				 OPTAB_DIRECT);
   else
     {
-      rtx two31 = GEN_INT (HOST_WIDE_INT_1U << 31);
+      rtx two31 = gen_int_mode (HOST_WIDE_INT_1U << 31, SImode);
       two31 = ix86_build_const_vector (intmode, 1, two31);
       *xorp = expand_simple_binop (intmode, AND,
 				   gen_lowpart (intmode, tmp[0]),
--- gcc/testsuite/gcc.target/i386/pr91931.c.jj	2019-09-29 13:22:58.502510721 +0200
+++ gcc/testsuite/gcc.target/i386/pr91931.c	2019-09-29 13:23:36.099946605 +0200
@@ -0,0 +1,5 @@
+/* PR target/91931 */
+/* { dg-do compile } */
+/* { dg-options "-O1 -ftree-loop-vectorize -mavx -mno-avx2" } */
+
+#include "../../gcc.dg/vect/pr32216.c"

	Jakub


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