summaryrefslogtreecommitdiff
path: root/gcc/fold-const.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-03 09:02:41 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2013-01-03 09:02:41 +0000
commitd871c5dca71fedee4b728ebe624b165205bca076 (patch)
tree0b6ed676df8d526772e919008d4fbf0a44fdc045 /gcc/fold-const.c
parent78ea005d112d4502514dd37361f2eb1f7acfa781 (diff)
downloadgcc-d871c5dca71fedee4b728ebe624b165205bca076.tar.gz
PR tree-optimization/55832
* fold-const.c (fold_binary_loc): For ABS_EXPR<x> >= 0 and ABS_EXPR<x> < 0 folding use constant_boolean_node instead of integer_{one,zero}_node. * gcc.c-torture/compile/pr55832.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@194836 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fold-const.c')
-rw-r--r--gcc/fold-const.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index 0a8b90a5d09..4f384a75344 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -1,7 +1,7 @@
/* Fold a constant sub-tree into a single node for C-compiler
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011,
- 2012 Free Software Foundation, Inc.
+ 2012, 2013 Free Software Foundation, Inc.
This file is part of GCC.
@@ -13519,7 +13519,9 @@ fold_binary_loc (location_t loc,
"when simplifying comparison of "
"absolute value and zero"),
WARN_STRICT_OVERFLOW_CONDITIONAL);
- return omit_one_operand_loc (loc, type, integer_one_node, arg0);
+ return omit_one_operand_loc (loc, type,
+ constant_boolean_node (true, type),
+ arg0);
}
/* Convert ABS_EXPR<x> < 0 to false. */
@@ -13533,7 +13535,9 @@ fold_binary_loc (location_t loc,
"when simplifying comparison of "
"absolute value and zero"),
WARN_STRICT_OVERFLOW_CONDITIONAL);
- return omit_one_operand_loc (loc, type, integer_zero_node, arg0);
+ return omit_one_operand_loc (loc, type,
+ constant_boolean_node (false, type),
+ arg0);
}
/* If X is unsigned, convert X < (1 << Y) into X >> Y == 0