aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-fold.c
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2015-08-03 07:28:11 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2015-08-03 07:28:11 +0000
commit5c099d40da9eff21eea0606b7eb37e316d71c762 (patch)
treecd8b3fb60f1eddb4dd04f4bfc6ec240ee87fef8b /gcc/gimple-fold.c
parenta0c012fda997b1c2c918752f88abec680274ffe8 (diff)
downloadgcc-5c099d40da9eff21eea0606b7eb37e316d71c762.zip
gcc-5c099d40da9eff21eea0606b7eb37e316d71c762.tar.gz
gcc-5c099d40da9eff21eea0606b7eb37e316d71c762.tar.bz2
gimple-fold.c (fold_gimple_assign): Remove folding of the comparison in COND_EXPRs.
2015-08-03 Richard Biener <rguenther@suse.de> * gimple-fold.c (fold_gimple_assign): Remove folding of the comparison in COND_EXPRs. From-SVN: r226489
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r--gcc/gimple-fold.c48
1 files changed, 5 insertions, 43 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index 86caa8c..c624689 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -416,49 +416,11 @@ fold_gimple_assign (gimple_stmt_iterator *si)
break;
case GIMPLE_TERNARY_RHS:
- /* Try to fold a conditional expression. */
- if (gimple_assign_rhs_code (stmt) == COND_EXPR)
- {
- tree op0 = gimple_assign_rhs1 (stmt);
- tree tem;
- bool set = false;
- location_t cond_loc = gimple_location (stmt);
-
- if (COMPARISON_CLASS_P (op0))
- {
- fold_defer_overflow_warnings ();
- tem = fold_binary_loc (cond_loc,
- TREE_CODE (op0), TREE_TYPE (op0),
- TREE_OPERAND (op0, 0),
- TREE_OPERAND (op0, 1));
- /* This is actually a conditional expression, not a GIMPLE
- conditional statement, however, the valid_gimple_rhs_p
- test still applies. */
- set = (tem && is_gimple_condexpr (tem)
- && valid_gimple_rhs_p (tem));
- fold_undefer_overflow_warnings (set, stmt, 0);
- }
- else if (is_gimple_min_invariant (op0))
- {
- tem = op0;
- set = true;
- }
- else
- return NULL_TREE;
-
- if (set)
- result = fold_build3_loc (cond_loc, COND_EXPR,
- TREE_TYPE (gimple_assign_lhs (stmt)), tem,
- gimple_assign_rhs2 (stmt),
- gimple_assign_rhs3 (stmt));
- }
-
- if (!result)
- result = fold_ternary_loc (loc, subcode,
- TREE_TYPE (gimple_assign_lhs (stmt)),
- gimple_assign_rhs1 (stmt),
- gimple_assign_rhs2 (stmt),
- gimple_assign_rhs3 (stmt));
+ result = fold_ternary_loc (loc, subcode,
+ TREE_TYPE (gimple_assign_lhs (stmt)),
+ gimple_assign_rhs1 (stmt),
+ gimple_assign_rhs2 (stmt),
+ gimple_assign_rhs3 (stmt));
if (result)
{