diff options
author | Kai Tietz <ktietz@redhat.com> | 2011-05-19 13:16:20 +0200 |
---|---|---|
committer | Kai Tietz <ktietz@gcc.gnu.org> | 2011-05-19 13:16:20 +0200 |
commit | da5fb46991c2b6af4cb7271841429d26a8d7d78a (patch) | |
tree | 59b15ab519b18f6a41e0da7f63f9ab0b90d5213b /gcc/gimplify.c | |
parent | 0967b2288935f9ed8030ba4750c6247aa7329a08 (diff) | |
download | gcc-da5fb46991c2b6af4cb7271841429d26a8d7d78a.zip gcc-da5fb46991c2b6af4cb7271841429d26a8d7d78a.tar.gz gcc-da5fb46991c2b6af4cb7271841429d26a8d7d78a.tar.bz2 |
tree-cfg.c (verify_gimple_assign_binary): Barf on TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
2011-05-19 Kai Tietz <ktietz@redhat.com>
* tree-cfg.c (verify_gimple_assign_binary): Barf on
TRUTH_AND_EXPR, TRUTH_OR_EXPR, and TRUTH_XOR_EXPR.
(gimplify_expr): Move TRUTH_AND|OR|XOR_EXPR to its binary form.
From-SVN: r173903
Diffstat (limited to 'gcc/gimplify.c')
-rw-r--r-- | gcc/gimplify.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/gimplify.c b/gcc/gimplify.c index d776692..5fd22c0 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -7210,7 +7210,23 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, break; } } - + + /* With two-valued operand types binary truth expressions are + semantically equivalent to bitwise binary expressions. Canonicalize + them to the bitwise variant. */ switch (TREE_CODE (*expr_p)) + { + case TRUTH_AND_EXPR: + TREE_SET_CODE (*expr_p, BIT_AND_EXPR); + break; + case TRUTH_OR_EXPR: + TREE_SET_CODE (*expr_p, BIT_IOR_EXPR); + break; + case TRUTH_XOR_EXPR: + TREE_SET_CODE (*expr_p, BIT_XOR_EXPR); + break; + default: + break; + } /* Classified as tcc_expression. */ goto expr_2; |