* [PATCH] Do not consider vector CONSTRUCTORs is_gimple_constant
@ 2013-04-12 9:03 Richard Biener
0 siblings, 0 replies; only message in thread
From: Richard Biener @ 2013-04-12 9:03 UTC (permalink / raw)
To: gcc-patches
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 <rguenther@suse.de>
* 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 ----
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-04-12 7:56 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-12 9:03 [PATCH] Do not consider vector CONSTRUCTORs is_gimple_constant Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).