This is the mail archive of the gcc-bugs@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]

[Bug tree-optimization/36630] [4.3/4.4 Regression] ICE in vect_update_ivs_after_vectorizer



------- Comment #8 from irar at il dot ibm dot com  2008-09-03 10:43 -------
(In reply to comment #7)
> I still think that handling NULL from evolution_part_in_loop_num is the
> correct thing to do.  Even if you need to move this check to the analysis
> phase.
>
> The interesting thing is that the access function during
> vect_analyze_scalar_cycles_1 is
> 
> {2, +, 1}_1
> 
> which is because after the vectorized part of the loop the prologue
> remains which has a non-constant evolution start.


I tried to do the check during the analysis, but it seems impossible, since, as
you wrote, this access function does not exist during the analysis.

> 
> So with the reasoning that you analyzed the access function of the
> original loop properly you can probably strip the conversion that
> confuses you at just vect_update_ivs_after_vectorizer.  

I tested this on the vectorizer tests:

Index: tree-vect-transform.c
===================================================================
--- tree-vect-transform.c       (revision 139930)
+++ tree-vect-transform.c       (working copy)
@@ -6529,6 +6529,7 @@ vect_update_ivs_after_vectorizer (loop_v

       access_fn = analyze_scalar_evolution (loop, PHI_RESULT (phi));
       gcc_assert (access_fn);
+      STRIP_NOPS (access_fn);
       evolution_part =
         unshare_expr (evolution_part_in_loop_num (access_fn, loop->num));
       gcc_assert (evolution_part != NULL_TREE);


> (Or store
> the relevant information during analysis where the evolution is
> still simple enough)
> 
> This would fix the ICE, but I wonder if it may cause wrong code because
> of mismatched types somehow. 

At least, this does not happen with the vectorizer testsuite.

Another thing, 4.4 does not vectorize this loop anymore (and, therefore, there
is no ICE), because of unknown number of iterations: 

(analyze_scalar_evolution
  (loop_nb = 1)
  (scalar = i_18)
(get_scalar_evolution
  (scalar = i_18)
  (scalar_evolution = i_18))
(set_scalar_evolution
  (scalar = i_18)
  (scalar_evolution = i_18))
)
  (set_nb_iterations_in_loop = scev_not_known))
(get_loop_exit_condition
  if (y_3(D) > i_13)
)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36630


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