From 0ac168a1cd87bfefee6f8ebad245080cfe16fc1d Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Fri, 23 Mar 2012 11:34:32 +0000 Subject: re PR tree-optimization/52678 (internal compiler error: in vect_update_ivs_after_vectorizer, at tree-vect-loop-manip.c:1842) 2012-03-23 Richard Guenther PR tree-optimization/52678 * tree-vectorizer.h (struct _stmt_vec_info): Add loop_phi_evolution_part member. (STMT_VINFO_LOOP_PHI_EVOLUTION_PART): New define. * tree-vect-loop.c (vect_analyze_scalar_cycles_1): Initialize STMT_VINFO_LOOP_PHI_EVOLUTION_PART. * tree-vect-loop-manip.c (vect_update_ivs_after_vectorizer): Use the cached evolution part and the PHI nodes value from the loop preheader edge instead of re-analyzing the evolution. * gfortran.dg/pr52678.f: New testcase. From-SVN: r185734 --- gcc/tree-vectorizer.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'gcc/tree-vectorizer.h') diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 14eb201..5f031b5 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -476,6 +476,13 @@ typedef struct _stmt_vec_info { tree dr_step; tree dr_aligned_to; + /* For loop PHI nodes, the evolution part of it. This makes sure + this information is still available in vect_update_ivs_after_vectorizer + where we may not be able to re-analyze the PHI nodes evolution as + peeling for the prologue loop can make it unanalyzable. The evolution + part is still correct though. */ + tree loop_phi_evolution_part; + /* Used for various bookkeeping purposes, generally holding a pointer to some other stmt S that is in some way "related" to this stmt. Current use of this field is: @@ -572,6 +579,7 @@ typedef struct _stmt_vec_info { #define STMT_VINFO_GROUP_SAME_DR_STMT(S) (S)->same_dr_stmt #define STMT_VINFO_GROUP_READ_WRITE_DEPENDENCE(S) (S)->read_write_dep #define STMT_VINFO_STRIDED_ACCESS(S) ((S)->first_element != NULL && (S)->data_ref_info) +#define STMT_VINFO_LOOP_PHI_EVOLUTION_PART(S) (S)->loop_phi_evolution_part #define GROUP_FIRST_ELEMENT(S) (S)->first_element #define GROUP_NEXT_ELEMENT(S) (S)->next_element -- cgit v1.1