diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 2002-01-25 15:45:48 -0500 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 2002-01-25 15:45:48 -0500 |
commit | 995b5904391de6b8060e74e21654ed2ec5c8cd76 (patch) | |
tree | fb797ef05d7fb0f2a9ed54868b4bbdb2d6901c3b /gcc/c-decl.c | |
parent | 75eefe3fe069dc5affd43dd51acfff6c5a974f2d (diff) | |
download | gcc-995b5904391de6b8060e74e21654ed2ec5c8cd76.tar.gz |
builtins.c (expand_builtin_strncpy): Use integer_zerop instead of compare_tree_int.
* builtins.c (expand_builtin_strncpy): Use integer_zerop instead
of compare_tree_int.
(expand_builtin_strncat): Likewise.
* c-decl.c (finish_struct): Use tree_low_cst.
* tree.h (compare_tree_int): Arg is unsigned HOST_WIDE_INT.
* tree.c (compare_tree_int): Likewise.
From-SVN: r49222
Diffstat (limited to 'gcc/c-decl.c')
-rw-r--r-- | gcc/c-decl.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gcc/c-decl.c b/gcc/c-decl.c index 206c7718ba1..2d21a43ca80 100644 --- a/gcc/c-decl.c +++ b/gcc/c-decl.c @@ -5693,11 +5693,10 @@ finish_struct (t, fieldlist, attributes) field widths. */ if (DECL_INITIAL (x)) { - int max_width; - if (TYPE_MAIN_VARIANT (TREE_TYPE (x)) == c_bool_type_node) - max_width = CHAR_TYPE_SIZE; - else - max_width = TYPE_PRECISION (TREE_TYPE (x)); + int max_width + = (TYPE_MAIN_VARIANT (TREE_TYPE (x)) == c_bool_type_node + ? CHAR_TYPE_SIZE : TYPE_PRECISION (TREE_TYPE (x))); + if (tree_int_cst_sgn (DECL_INITIAL (x)) < 0) error_with_decl (x, "negative width in bit-field `%s'"); else if (0 < compare_tree_int (DECL_INITIAL (x), max_width)) @@ -5708,7 +5707,7 @@ finish_struct (t, fieldlist, attributes) { /* The test above has assured us that TREE_INT_CST_HIGH is 0. */ unsigned HOST_WIDE_INT width - = TREE_INT_CST_LOW (DECL_INITIAL (x)); + = tree_low_cst (DECL_INITIAL (x), 1); if (TREE_CODE (TREE_TYPE (x)) == ENUMERAL_TYPE && (width < min_precision (TYPE_MIN_VALUE (TREE_TYPE (x)), |