aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-phiopt.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-12-21 20:26:34 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2017-12-21 20:26:34 +0100
commita4710e09ed089313e3d4189d00fcfc487262e05a (patch)
tree7eda300f6c4a50ae8f15d3f568032ab17bdd4068 /gcc/tree-ssa-phiopt.c
parentda98f7424ee636d5254b5b90adbdb9f880818692 (diff)
downloadgcc-a4710e09ed089313e3d4189d00fcfc487262e05a.zip
gcc-a4710e09ed089313e3d4189d00fcfc487262e05a.tar.gz
gcc-a4710e09ed089313e3d4189d00fcfc487262e05a.tar.bz2
re PR tree-optimization/83521 (ICE: verify_gimple failed (error: invalid operand in unary operation))
PR tree-optimization/83521 * tree-ssa-phiopt.c (factor_out_conditional_conversion): Use gimple_build_assign without code on result of fold_build1 (VIEW_CONVERT_EXPR, ...), as it might not create a VIEW_CONVERT_EXPR. * gcc.dg/pr83521.c: New test. From-SVN: r255952
Diffstat (limited to 'gcc/tree-ssa-phiopt.c')
-rw-r--r--gcc/tree-ssa-phiopt.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c
index 71e7b67..9e6eb9c 100644
--- a/gcc/tree-ssa-phiopt.c
+++ b/gcc/tree-ssa-phiopt.c
@@ -548,8 +548,12 @@ factor_out_conditional_conversion (edge e0, edge e1, gphi *phi,
/* Create the conversion stmt and insert it. */
if (convert_code == VIEW_CONVERT_EXPR)
- temp = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (result), temp);
- new_stmt = gimple_build_assign (result, convert_code, temp);
+ {
+ temp = fold_build1 (VIEW_CONVERT_EXPR, TREE_TYPE (result), temp);
+ new_stmt = gimple_build_assign (result, temp);
+ }
+ else
+ new_stmt = gimple_build_assign (result, convert_code, temp);
gsi = gsi_after_labels (gimple_bb (phi));
gsi_insert_before (&gsi, new_stmt, GSI_SAME_STMT);