From d4f5cd5e82aca858b37d6cb927874e018bacce6a Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 13 Oct 2014 07:58:05 +0000 Subject: re PR c++/63419 (verify_gimple failed: "vector CONSTRUCTOR element is not a GIMPLE value") 2014-10-13 Richard Biener PR tree-optimization/63419 * gimple-fold.h (gimple_convert): New function. * gimple-fold.c (gimple_convert): Likewise. * tree-ssa-pre.c (create_expression_by_pieces): Use gimple_convert to split out required conversions early. * g++.dg/torture/pr63419.C: New testcase. From-SVN: r216138 --- gcc/gimple-fold.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'gcc/gimple-fold.c') diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index 76441c7..a0ce0db 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -5295,3 +5295,20 @@ rewrite_to_defined_overflow (gimple stmt) return stmts; } + +/* Return OP converted to TYPE by emitting a conversion statement on SEQ + if required using location LOC. Note that OP will be returned + unmodified if GIMPLE does not require an explicit conversion between + its type and TYPE. */ + +tree +gimple_convert (gimple_seq *seq, location_t loc, tree type, tree op) +{ + if (useless_type_conversion_p (type, TREE_TYPE (op))) + return op; + op = fold_convert_loc (loc, type, op); + gimple_seq stmts = NULL; + op = force_gimple_operand (op, &stmts, true, NULL_TREE); + gimple_seq_add_seq_without_update (seq, stmts); + return op; +} -- cgit v1.1