diff options
author | Alan Hayward <alan.hayward@arm.com> | 2016-06-10 08:46:55 +0000 |
---|---|---|
committer | Alan Hayward <alahay01@gcc.gnu.org> | 2016-06-10 08:46:55 +0000 |
commit | 89851e4c1363247b62cbff5a495317f582931c0c (patch) | |
tree | 0bde144b4e342adbcb5c77fd9d6cca5d48e066c7 /gcc/tree-vect-loop.c | |
parent | 200eafbfaeb8e4f9a14efa50c8427ab9004b6400 (diff) | |
download | gcc-89851e4c1363247b62cbff5a495317f582931c0c.zip gcc-89851e4c1363247b62cbff5a495317f582931c0c.tar.gz gcc-89851e4c1363247b62cbff5a495317f582931c0c.tar.bz2 |
re PR tree-optimization/71407 (ICE at -O3 in 32-bit and 64-bit modes on x86_64-linux-gnu (verify_gimple: integral result type precision does not match field size of BIT_FIELD_REF))
2016-06-10 Alan Hayward <alan.hayward@arm.com>
gcc/
PR tree-optimization/71407
PR tree-optimization/71416
* tree-vect-loop.c (vectorizable_live_operation): Use vectype for
BIT_FIELD_REF type.
testsuite/
PR tree-optimization/71407
PR tree-optimization/71416
* gcc.dg/vect/pr71407.c: New
* gcc.dg/vect/pr71416-1.c: New
* gcc.dg/vect/pr71416-2.c: New
From-SVN: r237288
Diffstat (limited to 'gcc/tree-vect-loop.c')
-rw-r--r-- | gcc/tree-vect-loop.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/gcc/tree-vect-loop.c b/gcc/tree-vect-loop.c index 1f61c83..1231b95 100644 --- a/gcc/tree-vect-loop.c +++ b/gcc/tree-vect-loop.c @@ -6353,7 +6353,7 @@ vectorizable_live_operation (gimple *stmt, worklist.safe_push (use_stmt); gcc_assert (worklist.length () == 1); - bitsize = TYPE_SIZE (lhs_type); + bitsize = TYPE_SIZE (TREE_TYPE (vectype)); vec_bitsize = TYPE_SIZE (vectype); /* Get the vectorized lhs of STMT and the lane to use (counted in bits). */ @@ -6399,15 +6399,18 @@ vectorizable_live_operation (gimple *stmt, /* Create a new vectorized stmt for the uses of STMT and insert outside the loop. */ - tree new_name = make_ssa_name (lhs_type); - tree new_tree = build3 (BIT_FIELD_REF, lhs_type, vec_lhs, bitsize, bitstart); - gimple *new_stmt = gimple_build_assign (new_name, new_tree); - gsi_insert_on_edge_immediate (single_exit (loop), new_stmt); + gimple_seq stmts = NULL; + tree new_tree = build3 (BIT_FIELD_REF, TREE_TYPE (vectype), vec_lhs, bitsize, + bitstart); + new_tree = force_gimple_operand (fold_convert (lhs_type, new_tree), &stmts, + true, NULL_TREE); + if (stmts) + gsi_insert_seq_on_edge_immediate (single_exit (loop), stmts); /* Replace all uses of the USE_STMT in the worklist with the newly inserted statement. */ use_stmt = worklist.pop (); - replace_uses_by (gimple_phi_result (use_stmt), new_name); + replace_uses_by (gimple_phi_result (use_stmt), new_tree); update_stmt (use_stmt); return true; |