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 middle-end/37491] [4.4 Regression] Revision 140257 causes vectorizer tests failures



------- Comment #15 from rguenth at gcc dot gnu dot org  2008-09-22 10:07 -------
This is because the original access is through a restricted pointer, so the
check is conservatively correct at this point.  We can move it to the
point where the vector pointer is created (but somehow I cannot make a
cross-compiler go past the support check for strided loads - what are the
commandline options required?).

So, can you check the following?  A similar change to vectorizable_store
would be needed.

Index: tree-vect-transform.c
===================================================================
*** tree-vect-transform.c       (revision 140544)
--- tree-vect-transform.c       (working copy)
*************** vectorizable_load (gimple stmt, gimple_s
*** 6388,6404 ****
        return false;
      }

-   /* If accesses through a pointer to vectype do not alias the original
-      memory reference we have a problem.  This should never happen.  */
-   if (get_alias_set (vectype) != get_alias_set (gimple_assign_rhs1 (stmt))
-       && !alias_set_subset_of (get_alias_set (vectype),
-                                get_alias_set (gimple_assign_rhs1 (stmt))))
-     {
-       if (vect_print_dump_info (REPORT_DETAILS))
-         fprintf (vect_dump, "???  vector type does not alias scalar type");
-       return false;
-     }
- 
    /* The vector component type needs to be trivially convertible to the
       scalar lhs.  This should always be the case.  */
    if (!useless_type_conversion_p (TREE_TYPE (scalar_dest), TREE_TYPE
(vectype)))
--- 6388,6393 ----
*************** vectorizable_load (gimple stmt, gimple_s
*** 6662,6667 ****
--- 6651,6663 ----
            default:
              gcc_unreachable ();
            }
+ 
+         /* If accesses through a pointer to vectype do not alias the original
+            memory reference we have a problem.  This should never happen.  */
+         gcc_assert (get_alias_set (data_ref) != get_alias_set
(gimple_assign_rhs1 (stmt))
+                     && !alias_set_subset_of (get_alias_set (data_ref),
+                                              get_alias_set
(gimple_assign_rhs1 (stmt))));
+ 
          vec_dest = vect_create_destination_var (scalar_dest, vectype);
          new_stmt = gimple_build_assign (vec_dest, data_ref);
          new_temp = make_ssa_name (vec_dest, new_stmt);


Note that this _does_ show that we create wrong alias information as the
pointer type vect_create_data_ref_ptr creates is _not_ marked restrict
which makes us emit wrong code (wrong code in the sense that our handling
of restrict pointers is not exactly correct).

So in the end we probably shouldn't open this can of worms and go back
to check the alias compatibility based on the types...  I will prepare
a patch for this.


-- 


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


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