This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/63665] [4.8/4.9 Regression] wrong code with signed overflow even with -fwrapv
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 28 Oct 2014 12:52:20 +0000
- Subject: [Bug tree-optimization/63665] [4.8/4.9 Regression] wrong code with signed overflow even with -fwrapv
- Auto-submitted: auto-generated
- References: <bug-63665-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63665
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Latent issue.
pr45752.c:40:3: note: Load permutation 2 2 2 2 2 3 3 3 3 3 0 0 0 0 0 1 1 1 1 1
4 4 4 4 4
We have a SLP group size of 5 and computed an unroll factor of 2 (ok). It
looks
to me that
Index: gcc/tree-vect-slp.c
===================================================================
--- gcc/tree-vect-slp.c (revision 216771)
+++ gcc/tree-vect-slp.c (working copy)
@@ -3041,6 +3041,7 @@ vect_transform_slp_perm_load (slp_tree n
&number_of_mask_fixes, &mask_fixed,
&needs_first_vector))
return false;
+ gcc_assert (current_mask_element < 2 * nunits);
mask[index++] = current_mask_element;
if (index == nunits)
makes x86_64 ICE as well. The issue is that we suddenly need to skip _two_
vectors in vect_get_mask_element which isn't implemented so we get
out-of-bound indexes. Seems we need to iterate instead in which case
we will reject vectorization correctly with
pr45752.c:40:3: note: Load permutation 2 2 2 2 2 3 3 3 3 3 0 0 0 0 0 1 1 1 1 1
4 4 4 4 4
pr45752.c:40:3: note: permutation requires at least three vectors c_71 =
MEM[(unsigned int *)pInput2_135 + 8B];
pr45752.c:40:3: note: Build SLP failed: unsupported load permutation
*pOutput2_136 = _83;