From 6fc4fb069d3d11880c98cd3de62e6aa1ed26ca87 Mon Sep 17 00:00:00 2001
From: Jakub Jelinek <jakub@gcc.gnu.org>
Date: Fri, 5 Dec 2008 15:33:14 +0100
Subject: [PATCH] re PR tree-optimization/37716 (ice for legal C++ code with
 -O2 on 20080926)

	PR tree-optimization/37716
	* gimplify.c (gimplify_expr): Allow COND_EXPR if
	gimplify_ctxp->allow_rhs_cond_expr.

From-SVN: r142476
---
 gcc/ChangeLog  | 8 +++++++-
 gcc/gimplify.c | 2 +-
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 22ffd3aab03c..60d445505127 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,4 +1,10 @@
-2008-12-05 Uros Bizjak <ubizjak@gmail.com>
+2008-12-05  Jakub Jelinek  <jakub@redhat.com>
+
+	PR tree-optimization/37716
+	* gimplify.c (gimplify_expr): Allow COND_EXPR if
+	gimplify_ctxp->allow_rhs_cond_expr.
+
+2008-12-05  Uros Bizjak  <ubizjak@gmail.com>
 
 	* config/alpha/alpha.c (alpha_fold_vector_minmax): Create
 	VIEW_CONVERT_EXPR to convert output to long_integer_type_node.
diff --git a/gcc/gimplify.c b/gcc/gimplify.c
index 09f130ecc7e5..2fea882811f9 100644
--- a/gcc/gimplify.c
+++ b/gcc/gimplify.c
@@ -6941,7 +6941,7 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p,
 		  && code != ASM_EXPR
 		  && code != BIND_EXPR
 		  && code != CATCH_EXPR
-		  && code != COND_EXPR
+		  && (code != COND_EXPR || gimplify_ctxp->allow_rhs_cond_expr)
 		  && code != EH_FILTER_EXPR
 		  && code != GOTO_EXPR
 		  && code != LABEL_EXPR
-- 
GitLab