From fbd767b1b5d7c560272275e9e70f52f4f3a4e715 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Sun, 30 May 2010 15:26:53 +0000 Subject: tree-cfg.c (verify_gimple_assign_single): Implement verification for COND_EXPR rhs. 2010-05-30 Richard Guenther * tree-cfg.c (verify_gimple_assign_single): Implement verification for COND_EXPR rhs. From-SVN: r160055 --- gcc/ChangeLog | 5 +++++ gcc/tree-cfg.c | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 87f74a6..26b1dbb 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2010-05-30 Richard Guenther + + * tree-cfg.c (verify_gimple_assign_single): Implement + verification for COND_EXPR rhs. + 2010-05-30 Jan Hubicka * cgraph.h (cgraph_dump_file): Declare. diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index fc6ee35..18754c4 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -3608,6 +3608,20 @@ verify_gimple_assign_single (gimple stmt) return res; case COND_EXPR: + if (!is_gimple_reg (lhs) + || (!is_gimple_reg (TREE_OPERAND (rhs1, 0)) + && !COMPARISON_CLASS_P (TREE_OPERAND (rhs1, 0))) + || (!is_gimple_reg (TREE_OPERAND (rhs1, 1)) + && !is_gimple_min_invariant (TREE_OPERAND (rhs1, 1))) + || (!is_gimple_reg (TREE_OPERAND (rhs1, 2)) + && !is_gimple_min_invariant (TREE_OPERAND (rhs1, 2)))) + { + error ("invalid COND_EXPR in gimple assignment"); + debug_generic_stmt (rhs1); + return true; + } + return res; + case CONSTRUCTOR: case OBJ_TYPE_REF: case ASSERT_EXPR: -- cgit v1.1