This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[patch][graphite] Fix ICE in canonicalize_loop_ivs
- From: "Sebastian Pop" <sebpop at gmail dot com>
- To: "GCC Patches" <gcc-patches at gcc dot gnu dot org>, "Richard Guenther" <rguenther at suse dot de>
- Date: Thu, 11 Dec 2008 15:07:17 -0600
- Subject: [patch][graphite] Fix ICE in canonicalize_loop_ivs
Hi,
With this patch we are more strict wrt the definition of a reduction.
We do not allow ivs with other functions than affine ones. The patch has
been committed to graphite branch. Okay for trunk if passes regtest?
Thanks,
Sebastian Pop
--
AMD - GNU Tools
* gcc.dg/graphite/pr38409.c: New.
* graphite.c (nb_reductions_in_loop): Use simple_iv.
Index: testsuite/gcc.dg/graphite/pr38409.c
===================================================================
--- testsuite/gcc.dg/graphite/pr38409.c (revision 0)
+++ testsuite/gcc.dg/graphite/pr38409.c (revision 0)
@@ -0,0 +1,24 @@
+/* { dg-options "-O2 -floop-block" } */
+
+typedef struct test input ;
+struct test
+{
+ int type ;
+ int symflag ;
+};
+Chv_copyEntriesToVector ( input *chv,double *dvec)
+{
+ double *entries ;
+ int mm, nent;
+ int first, i, k , stride ;
+ if ( ((chv)->type == 1) )
+ {
+ for ( i = 0 ; i < 10 ; i++)
+ {
+ dvec[2*mm] = entries[2*k] ;
+ k += stride ;
+ stride -= 2 ;
+ }
+ }
+ return(mm) ;
+}
Index: graphite.c
===================================================================
--- graphite.c (revision 142692)
+++ graphite.c (working copy)
@@ -2127,13 +2127,14 @@ nb_reductions_in_loop (loop_p loop)
{
gimple phi = gsi_stmt (gsi);
tree scev;
+ affine_iv iv;
if (!is_gimple_reg (PHI_RESULT (phi)))
continue;
scev = analyze_scalar_evolution (loop, PHI_RESULT (phi));
scev = instantiate_parameters (loop, scev);
- if (chrec_contains_undetermined (scev))
+ if (!simple_iv (loop, phi, PHI_RESULT (phi), &iv, true))
res++;
}