------- Comment #4 from victork at gcc dot gnu dot org  2008-09-08 20:31 -------
Here is slightly simplified test:
================== cut ================================
typedef int int_t;
typedef void (*fun_t) (int);
fun_t fun_tab[400] __attribute__ ((__aligned__(16)));

void foo (int_t a);

void
bar ()
{
  int i;

  for (i = 0; i < 400; i++)
      fun_tab[i] = foo;
}
================== cut ================================

It started to fail with ICE from this revision:
Author: irar
Date: Mon Jun 16 10:39:07 2008
New Revision: 136843

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=136843
Log:
        PR tree-optimization/36493
        * tree-vect-transform.c (vect_create_data_ref_ptr): Remove TYPE from
        the arguments list. Use VECTYPE to create vector pointer.
        (vectorizable_store): Fail if accesses through a pointer to vectype
        do not alias the original memory reference operands.
        Call vect_create_data_ref_ptr without the removed argument.
        (vectorizable_load): Likewise.
        (vect_setup_realignment): Call vect_create_data_ref_ptr without the
        removed argument.


Added:
    trunk/gcc/testsuite/gcc.dg/vect/pr36493.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree-vect-transform.c

=======

And this is a change in vectorizer dump:
 bar ()
 {
   unsigned int ivtmp.15;
-  vector void (*<T3d3>) (int_t) * ivtmp.14;
+  vector void (*<T3c8>) (int) * ivtmp.14;
   vector void (*<T3c8>) (int) * vect_pfun_tab.13;
-  vector void (*<T3d3>) (int_t) * vect_pfun_tab.8;
+  vector void (*<T3c8>) (int) * vect_pfun_tab.8;
   vector void (*<T3d3>) (int_t) vect_cst_.7;
   unsigned int ivtmp.6;
   int i;

 <bb 2>:
   vect_cst_.7_9 = {foo, foo};
   vect_pfun_tab.13_8 = (vector void (*<T3c8>) (int) *) &fun_tab;
-  vect_pfun_tab.8_12 = (vector void (*<T3d3>) (int_t) *) vect_pfun_tab.13_8;
+  vect_pfun_tab.8_12 = vect_pfun_tab.13_8;

 <bb 3>:
   # ivtmp.15_15 = PHI <ivtmp.15_16(4), 0(2)>
   # ivtmp.14_13 = PHI <ivtmp.14_14(4), vect_pfun_tab.8_12(2)>
   # ivtmp.6_1 = PHI <ivtmp.6_5(4), 400(2)>
   # i_10 = PHI <i_4(4), 0(2)>
   *ivtmp.14_13 = vect_cst_.7_9;
   i_4 = i_10 + 1;
   ivtmp.6_5 = ivtmp.6_1 - 1;
   ivtmp.14_14 = ivtmp.14_13 + 16;
   ivtmp.15_16 = ivtmp.15_15 + 1;
   if (ivtmp.15_16 < 200)
     goto <bb 4>;
   else
     goto <bb 5>;

 <bb 4>:
   goto <bb 3>;

 <bb 5>:
   return;

 }

Thus, in new revision vars  *ivtmp.14" and "vect_cst_.7" have different types,
but the assignment "*ivtmp.14_13 = vect_cst_.7_9;" is done without a cast.


-- 

victork at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |victork at gcc dot gnu dot
                   |                            |org


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

Reply via email to