I've seen unfolded CONSTRUCTORs like { 1, 2, 3, 4 } being propagated
into binary stmt operands where they will sit forever, not being
folded (to VECTOR_CSTs) nor being considered for any constant folding
(which operates on VECTOR_CSTs only). There is no reason to allow
those unfolded CONSTRUCTORs as gimple operands - we don't allow
an unfolded 1 + 2 expression either (that is, either allow
everything TREE_CONSTANT or nothing but tcc_constant).
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.
Richard.
2013-04-12 Richard Biener <[email protected]>
* gimple.c (is_gimple_constant): Vector CONSTRUCTORs should
not be considered a gimple constant.
Index: gcc/gimple.c
===================================================================
*** gcc/gimple.c (revision 197802)
--- gcc/gimple.c (working copy)
*************** is_gimple_constant (const_tree t)
*** 2592,2604 ****
case VECTOR_CST:
return true;
- /* Vector constant constructors are gimple invariant. */
- case CONSTRUCTOR:
- if (TREE_TYPE (t) && TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
- return TREE_CONSTANT (t);
- else
- return false;
-
default:
return false;
}
--- 2592,2597 ----