From da6d971d5f2418f0e5661700224b7dfe8727e2e2 Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Fri, 2 Dec 2005 09:46:17 +0000 Subject: [PATCH] convert.c (convert_to_integer): Fix compare for nonpositive constant to use tree_int_cst_sgn <= 0. 2005-12-02 Richard Guenther * convert.c (convert_to_integer): Fix compare for nonpositive constant to use tree_int_cst_sgn <= 0. From-SVN: r107882 --- gcc/ChangeLog | 5 +++++ gcc/convert.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b521d3f506c..b583ee5f028 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2005-12-02 Richard Guenther + + * convert.c (convert_to_integer): Fix compare for nonpositive + constant to use tree_int_cst_sgn <= 0. + 2005-12-02 Richard Guenther * convert.c (convert_to_integer): Use fold_convert instead diff --git a/gcc/convert.c b/gcc/convert.c index ece3637e93d..49d4a3ac5d6 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;