This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PR63665


> 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.


-- 
Eric Botcazou
package Opt42 is

   type Index_Type is range 1 .. 7;
   type Row_Type is array (Index_Type) of Float;
   type Array_Type is array (Index_Type) of Row_Type;

   function "*" (Left, Right : in Array_Type) return Array_Type;

end Opt42;
-- { dg-do compile }
-- { dg-options "-cargs --param max-completely-peeled-insns=200 -margs -O3" }

package body Opt42 is

   function "*" (Left, Right : in Array_Type) return Array_Type is
      Temp   : Float;
      Result : Array_Type;
   begin
      for I in Index_Type loop
         for J in Index_Type loop
            Temp := 0.0;
            for K in Index_Type loop
               Temp := Temp + Left (I) (K) * Right (K) (J);
            end loop;
            Result (I) (J) := Temp;
         end loop;
      end loop;
      return Result;
   end "*";

end Opt42;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]