re PR tree-optimization/63666 (FAIL: gcc.dg/vect/pr45752.c (internal compiler error))
authorRichard Biener <rguenther@suse.de>
Wed, 29 Oct 2014 09:22:55 +0000 (09:22 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Wed, 29 Oct 2014 09:22:55 +0000 (09:22 +0000)
2014-10-29  Richard Biener  <rguenther@suse.de>

PR tree-optimization/63666
* tree-vect-slp.c (vect_get_mask_element): Properly handle
accessing out-of-bound elements.

From-SVN: r216825

gcc/ChangeLog
gcc/tree-vect-slp.c

index 514cdd549900df7f52393565dedd2668513805bb..89665cfacd507be0acc5609ba813c33744b58f19 100644 (file)
@@ -1,3 +1,9 @@
+2014-10-29  Richard Biener  <rguenther@suse.de>
+
+       PR tree-optimization/63666
+       * tree-vect-slp.c (vect_get_mask_element): Properly handle
+       accessing out-of-bound elements.
+
 2014-10-29  Alexander Ivchenko  <alexander.ivchenko@intel.com>
            Maxim Kuznetsov  <maxim.kuznetsov@intel.com>
            Anna Tikhonova  <anna.tikhonova@intel.com>
index 90f5ef4b8da0f08670e52a2b5439159753f06f15..84bec9544fec2f1a9835891de337ce26e8030652 100644 (file)
@@ -2890,7 +2890,7 @@ vect_get_mask_element (gimple stmt, int first_mask_element, int m,
     }
 
   /* 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 node, vec<tree> dr_chain,
                                          &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)