re PR target/63910 (ICE: simplify_immed_subreg, at simplify-rtx.c:5519 with -mstringo...
authorJakub Jelinek <jakub@redhat.com>
Fri, 21 Nov 2014 09:23:26 +0000 (10:23 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 21 Nov 2014 09:23:26 +0000 (10:23 +0100)
PR target/63910
* simplify-rtx.c (simplify_immed_subreg): Return NULL for integer
modes wider than MAX_BITSIZE_MODE_ANY_INT.  If not using
CONST_WIDE_INT, make sure r fits into CONST_DOUBLE.

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

From-SVN: r217908

gcc/ChangeLog
gcc/simplify-rtx.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr63910.c [new file with mode: 0644]

index bf03c81160b0c9d6804e9abd0c9d353857ed3e25..9f03c0f2432293b1836d6105b884c453af832cc0 100644 (file)
@@ -1,3 +1,10 @@
+2014-11-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/63910
+       * simplify-rtx.c (simplify_immed_subreg): Return NULL for integer
+       modes wider than MAX_BITSIZE_MODE_ANY_INT.  If not using
+       CONST_WIDE_INT, make sure r fits into CONST_DOUBLE.
+
 2014-11-21  Markus Trippelsdorf  <markus@trippelsdorf.de>
 
        * config/rs6000/rs6000.c (includes_rldic_lshift_p): Use
index 022e36fe7c0323c73404eacc0044dd2cd8caeac4..98d4cebf94f7a47dde80cdb3e8653ef38b58faee 100644 (file)
@@ -5504,6 +5504,8 @@ simplify_immed_subreg (machine_mode outermode, rtx op,
            HOST_WIDE_INT tmp[MAX_BITSIZE_MODE_ANY_INT / HOST_BITS_PER_WIDE_INT];
            wide_int r;
 
+           if (GET_MODE_PRECISION (outer_submode) > MAX_BITSIZE_MODE_ANY_INT)
+             return NULL_RTX;
            for (u = 0; u < units; u++)
              {
                unsigned HOST_WIDE_INT buf = 0;
@@ -5515,10 +5517,13 @@ simplify_immed_subreg (machine_mode outermode, rtx op,
                tmp[u] = buf;
                base += HOST_BITS_PER_WIDE_INT;
              }
-           gcc_assert (GET_MODE_PRECISION (outer_submode)
-                       <= MAX_BITSIZE_MODE_ANY_INT);
            r = wide_int::from_array (tmp, units,
                                      GET_MODE_PRECISION (outer_submode));
+#if TARGET_SUPPORTS_WIDE_INT == 0
+           /* Make sure r will fit into CONST_INT or CONST_DOUBLE.  */
+           if (wi::min_precision (r, SIGNED) > HOST_BITS_PER_DOUBLE_INT)
+             return NULL_RTX;
+#endif
            elems[elem] = immed_wide_int_const (r, outer_submode);
          }
          break;
index 9e0c6b826b18f368f55775130bd97c6aea800ab4..f065cc24c192bb4286773bce76fdb6353dcbb117 100644 (file)
@@ -1,3 +1,8 @@
+2014-11-21  Jakub Jelinek  <jakub@redhat.com>
+
+       PR target/63910
+       * gcc.target/i386/pr63910.c: New test.
+
 2014-11-21  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
 
        PR lto/63998
diff --git a/gcc/testsuite/gcc.target/i386/pr63910.c b/gcc/testsuite/gcc.target/i386/pr63910.c
new file mode 100644 (file)
index 0000000..2d5b3b8
--- /dev/null
@@ -0,0 +1,12 @@
+/* PR target/63910 */
+/* { dg-do compile } */
+/* { dg-options "-O -mstringop-strategy=vector_loop -mavx512f" } */
+
+extern void bar (float *c);
+
+void
+foo (void)
+{
+  float c[1024] = { };
+  bar (c);
+}