Message ID | alpine.LSU.2.11.1410281354540.19560@zhemvz.fhfr.qr |
---|---|
State | New |
Headers | show |
> 2014-10-28 Richard Biener <rguenther@suse.de> > > PR tree-optimization/63665 > * tree-vect-slp.c (vect_get_mask_element): Properly handle > accessing out-of-bound elements. Does fix it the assertion failure on the attached testcase? If so, would you mind committing the testcase with the patch? * gnat.dg/opt42.ad[sb]: New test.
On Wed, Oct 29, 2014 at 10:04 AM, Eric Botcazou <ebotcazou@adacore.com> wrote: >> 2014-10-28 Richard Biener <rguenther@suse.de> >> >> PR tree-optimization/63665 >> * tree-vect-slp.c (vect_get_mask_element): Properly handle >> accessing out-of-bound elements. > > Does fix it the assertion failure on the attached testcase? If so, would you > mind committing the testcase with the patch? Sorry - I saw this mail too late. The assert already triggers various existing tests in gcc.dg/vect on x86_64-linux so I didn't add a new one. Feel free to add the test if you think more Ada coverage is warranted here. Thanks, Richard. > > * gnat.dg/opt42.ad[sb]: New test. > > > -- > Eric Botcazou
Index: gcc/tree-vect-slp.c =================================================================== --- gcc/tree-vect-slp.c (revision 216771) +++ gcc/tree-vect-slp.c (working copy) @@ -2890,7 +2890,7 @@ vect_get_mask_element (gimple stmt, int } /* The mask requires the next vector. */ - if (*current_mask_element >= mask_nunits * 2) + while (*current_mask_element >= mask_nunits * 2) { if (*needs_first_vector || *mask_fixed) { @@ -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)