diff options
author | Richard Biener <rguenther@suse.de> | 2014-10-13 07:58:05 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2014-10-13 07:58:05 +0000 |
commit | d4f5cd5e82aca858b37d6cb927874e018bacce6a (patch) | |
tree | f3f3e955cc37835a4a5c65ea164c26f86aee90a4 /gcc/gimple-fold.c | |
parent | 641123eb5e66fc3794eaa102def2da24a36b7da9 (diff) | |
download | gcc-d4f5cd5e82aca858b37d6cb927874e018bacce6a.zip gcc-d4f5cd5e82aca858b37d6cb927874e018bacce6a.tar.gz gcc-d4f5cd5e82aca858b37d6cb927874e018bacce6a.tar.bz2 |
re PR c++/63419 (verify_gimple failed: "vector CONSTRUCTOR element is not a GIMPLE value")
2014-10-13 Richard Biener <rguenther@suse.de>
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
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r-- | gcc/gimple-fold.c | 17 |
1 files changed, 17 insertions, 0 deletions
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; +} |