diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-03-14 05:09:19 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-03-14 05:09:19 -0500 |
commit | ff3225e75cb196c53e8cd7491759a111c44878f9 (patch) | |
tree | 7cf0c2eef1f973f7e48d31233e01f1b8fc265a78 /gcc | |
parent | 6aa10371a56f91774a606507b1a65ceae8eccdbc (diff) | |
download | gcc-ff3225e75cb196c53e8cd7491759a111c44878f9.zip gcc-ff3225e75cb196c53e8cd7491759a111c44878f9.tar.gz gcc-ff3225e75cb196c53e8cd7491759a111c44878f9.tar.bz2 |
(build_binary_op, pop_init_level, output_pending_init_elements): Call
tree_int_cst_sgn.
From-SVN: r6776
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/c-typeck.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c index 412f3c3..e8e970b 100644 --- a/gcc/c-typeck.c +++ b/gcc/c-typeck.c @@ -2037,7 +2037,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p) { if (TREE_CODE (op1) == INTEGER_CST) { - if (tree_int_cst_lt (op1, integer_zero_node)) + if (tree_int_cst_sgn (op1) < 0) warning ("right shift count is negative"); else { @@ -2069,7 +2069,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p) { if (TREE_CODE (op1) == INTEGER_CST) { - if (tree_int_cst_lt (op1, integer_zero_node)) + if (tree_int_cst_sgn (op1) < 0) warning ("left shift count is negative"); else if (TREE_INT_CST_HIGH (op1) != 0 || ((unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (op1) @@ -2097,7 +2097,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p) { if (TREE_CODE (op1) == INTEGER_CST) { - if (tree_int_cst_lt (op1, integer_zero_node)) + if (tree_int_cst_sgn (op1) < 0) warning ("shift count is negative"); else if (TREE_INT_CST_HIGH (op1) != 0 || ((unsigned HOST_WIDE_INT) TREE_INT_CST_LOW (op1) @@ -5397,9 +5397,10 @@ pop_init_level (implicit) TREE_TYPE (maxindex) = TYPE_DOMAIN (constructor_type); if (pedantic - && tree_int_cst_lt (TYPE_MAX_VALUE (TYPE_DOMAIN (constructor_type)), - integer_zero_node)) - error_with_decl (constructor_decl, "zero-size array `%s'"); + && (tree_int_cst_sgn (TYPE_MAX_VALUE (TYPE_DOMAIN (constructor_type))) + <= 0)) + error_with_decl (constructor_decl, + "zero or negative array size `%s'"); layout_type (constructor_type); size = int_size_in_bytes (constructor_type); pop_obstacks (); @@ -5736,7 +5737,8 @@ output_pending_init_elements (all) if (tree_int_cst_equal (TREE_PURPOSE (tail), constructor_unfilled_index)) { - output_init_element (TREE_VALUE (tail), TREE_TYPE (constructor_type), + output_init_element (TREE_VALUE (tail), + TREE_TYPE (constructor_type), constructor_unfilled_index, 0); goto retry; } @@ -5744,8 +5746,7 @@ output_pending_init_elements (all) constructor_unfilled_index)) ; else if (next == 0 - || tree_int_cst_lt (TREE_PURPOSE (tail), - next)) + || tree_int_cst_lt (TREE_PURPOSE (tail), next)) next = TREE_PURPOSE (tail); } else if (TREE_CODE (constructor_type) == RECORD_TYPE |