------- Comment #6 from rguenth at gcc dot gnu dot org 2009-05-15 12:11 ------- We are vectorizing
<bb 4>: <bb 5>: # J1_43 = PHI <J1_36(6), J1_3(4)> J1_36 = J1_43 + 1; D.2354_35 = (long int) J1_36; VIEW_CONVERT_EXPR<struct loop_optimization1__r *[D.2335:D.2339]>(*_init$P_ARRAY_1)[D.2354_35]{lb: D.2335_26 sz: 8} = 0B; if (D.2336_6 != J1_36) goto <bb 6>; else goto <bb 7>; <bb 6>: goto <bb 5>; using a vector pointer of type vector struct loop_optimization1__r **. The issue here is that for VIEW_CONVERT_EXPR<struct loop_optimization1__r *[D.2335:D.2339]>(*_init$P_ARRAY_1)[D.2354_35] we use the alias set of *_init$P_ARRAY_1 because the array elements are non-aliased. As the vectorizer now creates an alias the resulting stores through the pointer to the vector type do not conflict with the original stores and we have created wrong code. How I love Ada ;) Well, the fix is to teach the vectorizer to never vectorize arrays with non-aliased components (or any aggregate with such elements). Or, as they were introduced to allow more optimization, finally drop this non-sensical non-aliased component stuff from the middle-end as well. :P -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40071