[Bug tree-optimization/94784] ICE: in simplify_vector_constructor, at tree-ssa-forwprop.c:2482

felix.yang at huawei dot com gcc-bugzilla@gcc.gnu.org
Mon Apr 27 07:09:05 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94784

--- Comment #1 from Fei Yang <felix.yang at huawei dot com> ---
I did some check and it looks like everything works fine before the ICE.

The reason for the assert is that applying VIEW_CONVERT_EXPR to two general
vectors is dangerous in this context.  If through some bug we ended up with one
vector being V4HI and the other being V2SI (say), the assert stops us from
silently miscompiling the code.

In the testcase we have two vectors with the same ABI identity but with
different TYPE_MODEs. As suggested by Richard Sandiford, it would be better to
flip the assert around so that it checks that the two vectors have equal
TYPE_VECTOR_SUBPARTS and that converting the corresponding element types is a
useless_type_conversion_p.


More information about the Gcc-bugs mailing list