From 13e889530d0da219afcbcd78c768688593dd5257 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Tue, 19 Jul 2016 14:16:54 +0000 Subject: gimple-fold.c (get_base_constructor): Add VIEW_CONVERT case, handle all tcc_constant bases and valueize SSA names. 2016-07-19 Richard Biener * gimple-fold.c (get_base_constructor): Add VIEW_CONVERT case, handle all tcc_constant bases and valueize SSA names. * tree-ssa-sccvn.c (fully_constant_vn_reference_p): Handle tcc_constant bases. * c-c++-common/vector-subscript-6.c: New testcase. * c-c++-common/vector-subscript-7.c: Likewise. From-SVN: r238475 --- gcc/tree-ssa-sccvn.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gcc/tree-ssa-sccvn.c') diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index e685342..e889d60 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -1337,6 +1337,11 @@ fully_constant_vn_reference_p (vn_reference_t ref) unsigned i; for (i = 0; i < operands.length (); ++i) { + if (TREE_CODE_CLASS (operands[i].opcode) == tcc_constant) + { + ++i; + break; + } if (operands[i].off == -1) return NULL_TREE; off += operands[i].off; -- cgit v1.1