diff options
author | Roger Sayle <roger@eyesopen.com> | 2007-02-16 03:38:22 +0000 |
---|---|---|
committer | Roger Sayle <sayle@gcc.gnu.org> | 2007-02-16 03:38:22 +0000 |
commit | 939409afced0a24eb36b7bda1d98244f8a18e65d (patch) | |
tree | ab46b6fc569996fc94b0894059374459f6e9ad7f /gcc/tree-ssa-phiopt.c | |
parent | 3c32c87f609a47e126044ce2d3f29701fa2c4dcc (diff) | |
download | gcc-939409afced0a24eb36b7bda1d98244f8a18e65d.zip gcc-939409afced0a24eb36b7bda1d98244f8a18e65d.tar.gz gcc-939409afced0a24eb36b7bda1d98244f8a18e65d.tar.bz2 |
re PR middle-end/30391 (ICE at -O1 with conditional expressions and GIMPLE_MODIFY_STMT)
PR middle-end/30391
* tree.c (expr_align): Handle MODIFY_EXPR. GIMPLE_MODIFY_STMT
should be unreachable.
(build2_stat): Allow construction of MODIFY_EXPR at any time.
For the time being redirect GIMPLE_MODIFY_STMT to the new
(renamed) build_gimple_modify_stmt_stat.
(build2_gimple_stat): Rename to...
(build_gimple_modify_stmt_stat): Now longer take a CODE argument.
Always build a GIMPLE_MODIFY_STMT node.
* tree.h (build2_gimple, build2_gimple_stat): Delete.
(build_gimple_modify_stmt, build_gimple_modify_stmt_stat): New
declarations.
* tree-cfg.c (factor_computed_gotos, tree_merge_blocks,
gimplify_val): Use build_gimple_modify_stmt instead of build2_gimple.
* tree-complex.c (set_component_ssa_name, expand_complex_move,
expand_complex_div_wide): Likewise.
* tree-ssa-dom.c (record_equivalences_from_stmt): Likewise.
* tree-ssa-loop-im.c (schedule_sm): Likewise.
* tree-ssa-loop-ivopts.c (rewrite_use_nonlinear_expr): Likewise.
* tree-ssa-loop-manip.c (create_iv): Likewise.
* tree-ssa-phiopt.c (conditional_replacement, minmax_replacement,
abs_replacement): Likewise.
* tree-ssa-pre.c (create_expression_by_pieces, poolify_modify_stmt,
realify_fake_stores): Likewise.
* builtins.c (std_expand_builtin_va_start): Build a MODIFY_EXPR
node rather than a GIMPLE_MODIFY_STMT node.
(std_gimpify_va_arg_expr, expand_builtin_va_copy,
fold_builtin_memset, fold_builtin_memory_op, do_mpfr_sincos):
Likewise.
(integer_valued_real_p): Handle MODIFY_EXPR, not GIMPLE_MODIFY_STMT.
* expr.c (expand_expr_real_1): Handle both MODIFY_EXPR and
GIMPLE_MODIFY_STMT.
* gfortran.dg/pr30391-1.f90: New test case.
From-SVN: r122030
Diffstat (limited to 'gcc/tree-ssa-phiopt.c')
-rw-r--r-- | gcc/tree-ssa-phiopt.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gcc/tree-ssa-phiopt.c b/gcc/tree-ssa-phiopt.c index 2cc7ad7..f8e96bd 100644 --- a/gcc/tree-ssa-phiopt.c +++ b/gcc/tree-ssa-phiopt.c @@ -1,5 +1,5 @@ /* Optimization of PHI nodes by converting them into straightline code. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. @@ -439,7 +439,7 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb, TREE_OPERAND (old_result, 0), TREE_OPERAND (old_result, 1)); - new1 = build2_gimple (GIMPLE_MODIFY_STMT, new_var, new1); + new1 = build_gimple_modify_stmt (new_var, new1); SSA_NAME_DEF_STMT (new_var) = new1; bsi_insert_after (&bsi, new1, BSI_NEW_STMT); @@ -470,7 +470,7 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb, || (e1 == true_edge && integer_onep (arg1)) || (e1 == false_edge && integer_zerop (arg1))) { - new = build2_gimple (GIMPLE_MODIFY_STMT, new_var1, cond); + new = build_gimple_modify_stmt (new_var1, cond); } else { @@ -514,14 +514,14 @@ conditional_replacement (basic_block cond_bb, basic_block middle_bb, tmp = create_tmp_var (TREE_TYPE (op0), NULL); add_referenced_var (tmp); cond_tmp = make_ssa_name (tmp, NULL); - new = build2_gimple (GIMPLE_MODIFY_STMT, cond_tmp, op0); + new = build_gimple_modify_stmt (cond_tmp, op0); SSA_NAME_DEF_STMT (cond_tmp) = new; bsi_insert_after (&bsi, new, BSI_NEW_STMT); cond = fold_convert (TREE_TYPE (result), cond_tmp); } - new = build2_gimple (GIMPLE_MODIFY_STMT, new_var1, cond); + new = build_gimple_modify_stmt (new_var1, cond); } bsi_insert_after (&bsi, new, BSI_NEW_STMT); @@ -853,8 +853,7 @@ minmax_replacement (basic_block cond_bb, basic_block middle_bb, /* Emit the statement to compute min/max. */ result = duplicate_ssa_name (PHI_RESULT (phi), NULL); - new = build2_gimple (GIMPLE_MODIFY_STMT, result, - build2 (minmax, type, arg0, arg1)); + new = build_gimple_modify_stmt (result, build2 (minmax, type, arg0, arg1)); SSA_NAME_DEF_STMT (result) = new; bsi = bsi_last (cond_bb); bsi_insert_before (&bsi, new, BSI_NEW_STMT); @@ -966,8 +965,8 @@ abs_replacement (basic_block cond_bb, basic_block middle_bb, lhs = result; /* Build the modify expression with abs expression. */ - new = build2_gimple (GIMPLE_MODIFY_STMT, - lhs, build1 (ABS_EXPR, TREE_TYPE (lhs), rhs)); + new = build_gimple_modify_stmt (lhs, + build1 (ABS_EXPR, TREE_TYPE (lhs), rhs)); SSA_NAME_DEF_STMT (lhs) = new; bsi = bsi_last (cond_bb); @@ -978,8 +977,9 @@ abs_replacement (basic_block cond_bb, basic_block middle_bb, /* Get the right BSI. We want to insert after the recently added ABS_EXPR statement (which we know is the first statement in the block. */ - new = build2_gimple (GIMPLE_MODIFY_STMT, - result, build1 (NEGATE_EXPR, TREE_TYPE (lhs), lhs)); + new = build_gimple_modify_stmt (result, + build1 (NEGATE_EXPR, TREE_TYPE (lhs), + lhs)); SSA_NAME_DEF_STMT (result) = new; bsi_insert_after (&bsi, new, BSI_NEW_STMT); |