This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/54894] [4.6/4.7/4.8 Regression] internal compiler error: in vect_get_vec_def_for_operand, at tree-vect-stmts.c:1286
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 11 Oct 2012 14:15:52 +0000
- Subject: [Bug tree-optimization/54894] [4.6/4.7/4.8 Regression] internal compiler error: in vect_get_vec_def_for_operand, at tree-vect-stmts.c:1286
- Auto-submitted: auto-generated
- References: <bug-54894-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54894
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |rguenth at gcc dot gnu.org
|gnu.org |
--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> 2012-10-11 14:15:52 UTC ---
(In reply to comment #3)
> I'd say the problem is that useless_type_conversion_p considers the overaligned
> double type compatible to double,
That's ok - alignment does not affect the values. useless_type_conversion_p
is about value-preserving conversions.
> yet get_vectype_for_scalar_type returns
> non-NULL for the normally aligned one and NULL for the overaligned one.
I think that was a bugfix, maybe not the best way. get_vectype_for_scalar_type
should probably simply drop the alignment and use natural alignment for
the vector type (thus, based on the mode). The idea of the fix was
to not need to care about extra padding, but data-ref analysis should
be the proper place to verify possible issues with that.
> During vectorizer analysis phase, we assume it is enough to call that function
> just for a single type for the stmt, not check all 3 types, that succeeds, but
> during transform phase we call it on all 3 and ICE.
Thus:
Index: gcc/tree-vect-stmts.c
===================================================================
--- gcc/tree-vect-stmts.c (revision 192359)
+++ gcc/tree-vect-stmts.c (working copy)
@@ -6060,11 +6060,6 @@ get_vectype_for_scalar_type_and_size (tr
&& GET_MODE_CLASS (inner_mode) != MODE_FLOAT)
return NULL_TREE;
- /* We can't build a vector type of elements with alignment bigger than
- their size. */
- if (nbytes < TYPE_ALIGN_UNIT (scalar_type))
- return NULL_TREE;
-
/* For vector types of elements whose mode precision doesn't
match their types precision we use a element type of mode
precision. The vectorization routines will have to make sure
@@ -6086,6 +6081,11 @@ get_vectype_for_scalar_type_and_size (tr
&& !POINTER_TYPE_P (scalar_type))
scalar_type = lang_hooks.types.type_for_mode (inner_mode, 1);
+ /* We can't build a vector type of elements with alignment bigger than
+ their size. */
+ if (nbytes < TYPE_ALIGN_UNIT (scalar_type))
+ scalar_type = lang_hooks.types.type_for_mode (inner_mode, 1);
+
/* If no size was supplied use the mode the target prefers. Otherwise
lookup a vector mode of the specified size. */
if (size == 0)