From 70430001b74d0f67386a6b3642c857b3389cd5d0 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 7 Feb 2022 09:31:07 +0100 Subject: middle-end/104402 - split out _Complex compares from COND_EXPRs This makes sure we always have a _Complex compare split to a different stmt for the compare operand in a COND_EXPR on GIMPLE. Complex lowering doesn't handle this and the change is something we want for all kind of compares at some point. 2022-02-07 Richard Biener PR middle-end/104402 * gimple-expr.cc (is_gimple_condexpr): _Complex typed compares are not valid. * tree-cfg.cc (verify_gimple_assign_ternary): For COND_EXPR check is_gimple_condexpr. * gcc.dg/torture/pr104402.c: New testcase. --- gcc/tree-cfg.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'gcc/tree-cfg.cc') diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc index 260a7fb..e321d92 100644 --- a/gcc/tree-cfg.cc +++ b/gcc/tree-cfg.cc @@ -4289,10 +4289,11 @@ verify_gimple_assign_ternary (gassign *stmt) /* Fallthrough. */ case COND_EXPR: if (!is_gimple_val (rhs1) - && verify_gimple_comparison (TREE_TYPE (rhs1), - TREE_OPERAND (rhs1, 0), - TREE_OPERAND (rhs1, 1), - TREE_CODE (rhs1))) + && (!is_gimple_condexpr (rhs1) + || verify_gimple_comparison (TREE_TYPE (rhs1), + TREE_OPERAND (rhs1, 0), + TREE_OPERAND (rhs1, 1), + TREE_CODE (rhs1)))) return true; if (!useless_type_conversion_p (lhs_type, rhs2_type) || !useless_type_conversion_p (lhs_type, rhs3_type)) -- cgit v1.1