aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2005-12-02 09:46:17 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2005-12-02 09:46:17 +0000
commitda6d971d5f2418f0e5661700224b7dfe8727e2e2 (patch)
tree38fd12268a9596d8b1c5ff75d645982be50d4149 /gcc
parente7a6c1272ccfdeb0d21001de0f2cbd442d6b0af9 (diff)
downloadgcc-da6d971d5f2418f0e5661700224b7dfe8727e2e2.zip
gcc-da6d971d5f2418f0e5661700224b7dfe8727e2e2.tar.gz
gcc-da6d971d5f2418f0e5661700224b7dfe8727e2e2.tar.bz2
convert.c (convert_to_integer): Fix compare for nonpositive constant to use tree_int_cst_sgn <= 0.
2005-12-02 Richard Guenther <rguenther@suse.de> * convert.c (convert_to_integer): Fix compare for nonpositive constant to use tree_int_cst_sgn <= 0. From-SVN: r107882
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/convert.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b521d3f..b583ee5 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2005-12-02 Richard Guenther <rguenther@suse.de>
+ * convert.c (convert_to_integer): Fix compare for nonpositive
+ constant to use tree_int_cst_sgn <= 0.
+
+2005-12-02 Richard Guenther <rguenther@suse.de>
+
* convert.c (convert_to_integer): Use fold_convert instead
of fold_build1 (NOP_EXPR, ...). Use tree_int_cst_sgn < 0
instead of comparing against 0. Use build_int_cst instead
diff --git a/gcc/convert.c b/gcc/convert.c
index ece3637..49d4a3a 100644
--- a/gcc/convert.c
+++ b/gcc/convert.c
@@ -500,7 +500,7 @@ convert_to_integer (tree type, tree expr)
/* We can pass truncation down through right shifting
when the shift count is a nonpositive constant. */
if (TREE_CODE (TREE_OPERAND (expr, 1)) == INTEGER_CST
- && tree_int_cst_sgn (TREE_OPERAND (expr, 1)) < 0)
+ && tree_int_cst_sgn (TREE_OPERAND (expr, 1)) <= 0)
goto trunc1;
break;