On Wed, Nov 19, 2014 at 02:23:47PM -0800, Mike Stump wrote: > On Nov 19, 2014, at 1:57 PM, Jakub Jelinek <ja...@redhat.com> wrote: > > Though, following patch is just fine for me too, I don't think it will > > make a significant difference: > > This version is fine by me.
Richard, are you ok with that too? Bootstrapped/regtested on x86_64-linux and i686-linux now. 2014-11-20 Jakub Jelinek <ja...@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. * gcc.target/i386/pr63910.c: New test. --- gcc/simplify-rtx.c.jj 2014-11-19 09:17:15.491327992 +0100 +++ gcc/simplify-rtx.c 2014-11-19 12:28:16.223808178 +0100 @@ -5504,6 +5504,8 @@ simplify_immed_subreg (machine_mode oute 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 oute 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; --- gcc/testsuite/gcc.target/i386/pr63910.c.jj 2014-11-19 12:04:23.490489130 +0100 +++ gcc/testsuite/gcc.target/i386/pr63910.c 2014-11-19 12:04:23.490489130 +0100 @@ -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); +} Jakub