Enhance [VEC_]COND_EXPR verification

Message ID alpine.LSU.2.20.1805161220430.24704@zhemvz.fhfr.qr
State New
Headers show
Series
  • Enhance [VEC_]COND_EXPR verification
Related show

Commit Message

Richard Biener May 16, 2018, 10:21 a.m.
PR85794 shows we do not verify those.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.

Richard.

2018-05-16  Richard Biener  <rguenther@suse.de>

	* tree-cfg.c (verify_gimple_assign_ternary): Properly
	verify the [VEC_]COND_EXPR embedded comparison.

Patch

Index: gcc/tree-cfg.c
===================================================================
--- gcc/tree-cfg.c	(revision 260280)
+++ gcc/tree-cfg.c	(working copy)
@@ -4137,6 +4137,12 @@  verify_gimple_assign_ternary (gassign *s
 	}
       /* 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)))
+	return true;
       if (!useless_type_conversion_p (lhs_type, rhs2_type)
 	  || !useless_type_conversion_p (lhs_type, rhs3_type))
 	{