This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR63665
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Richard Biener <rguenther at suse dot de>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 29 Oct 2014 10:04:54 +0100
- Subject: Re: [PATCH] Fix PR63665
- Authentication-results: sourceware.org; auth=none
- References: <alpine dot LSU dot 2 dot 11 dot 1410281354540 dot 19560 at zhemvz dot fhfr dot qr>
> 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;