summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-propagate.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-17 08:13:53 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2014-04-17 08:13:53 +0000
commitf540a052e5975baa8244237055382de88ba3fadb (patch)
tree68de519b6f715ed1c48ce0e8e44214180f6db8f2 /gcc/tree-ssa-propagate.c
parentaae8f54360718d5d70e336db02c183847c98c3ac (diff)
downloadgcc-f540a052e5975baa8244237055382de88ba3fadb.tar.gz
2014-04-17 Richard Biener <rguenther@suse.de>
PR middle-end/60849 * tree-ssa-propagate.c (valid_gimple_rhs_p): Only allow effective boolean results for comparisons. * g++.dg/opt/pr60849.C: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@209469 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-propagate.c')
-rw-r--r--gcc/tree-ssa-propagate.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/tree-ssa-propagate.c b/gcc/tree-ssa-propagate.c
index 840d7e76272..47fd15455b2 100644
--- a/gcc/tree-ssa-propagate.c
+++ b/gcc/tree-ssa-propagate.c
@@ -571,8 +571,14 @@ valid_gimple_rhs_p (tree expr)
/* All constants are ok. */
break;
- case tcc_binary:
case tcc_comparison:
+ if (!INTEGRAL_TYPE_P (TREE_TYPE (expr))
+ || (TREE_CODE (TREE_TYPE (expr)) != BOOLEAN_TYPE
+ && TYPE_PRECISION (TREE_TYPE (expr)) != 1))
+ return false;
+
+ /* Fallthru. */
+ case tcc_binary:
if (!is_gimple_val (TREE_OPERAND (expr, 0))
|| !is_gimple_val (TREE_OPERAND (expr, 1)))
return false;