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
This commit is contained in:
Richard Guenther 2005-12-02 09:46:17 +00:00 committed by Richard Biener
parent e7a6c1272c
commit da6d971d5f
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
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

View File

@ -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;