summaryrefslogtreecommitdiff
path: root/gcc/gimple.c
diff options
context:
space:
mode:
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-02 14:55:47 +0000
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>2011-08-02 14:55:47 +0000
commit752003127bcf897cc74b9417e170dd4c9d17eef1 (patch)
tree9ab01933186298e3c020529082506e008ea0077a /gcc/gimple.c
parent96dc081d8aefafb424bb9326d72fdde05886029e (diff)
downloadgcc-752003127bcf897cc74b9417e170dd4c9d17eef1.tar.gz
* gimple.c (canonicalize_cond_expr_cond): Handle cast from
boolean-type. (ssa_forward_propagate_and_combine): Interprete result of forward_propagate_comparison. * gcc/gimple-fold.c (fold_gimple_assign): Add canonicalization for boolean-typed operands for comparisons. * gcc.dg/tree-ssa/forwprop-15.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@177170 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple.c')
-rw-r--r--gcc/gimple.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/gimple.c b/gcc/gimple.c
index e3095d7e261..af23c6a3fc9 100644
--- a/gcc/gimple.c
+++ b/gcc/gimple.c
@@ -3160,7 +3160,9 @@ canonicalize_cond_expr_cond (tree t)
{
/* Strip conversions around boolean operations. */
if (CONVERT_EXPR_P (t)
- && truth_value_p (TREE_CODE (TREE_OPERAND (t, 0))))
+ && (truth_value_p (TREE_CODE (TREE_OPERAND (t, 0)))
+ || TREE_CODE (TREE_TYPE (TREE_OPERAND (t, 0)))
+ == BOOLEAN_TYPE))
t = TREE_OPERAND (t, 0);
/* For !x use x == 0. */