diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2010-04-16 10:16:52 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2010-04-16 10:16:52 +0000 |
commit | 586388fd723b7c59d97304607357ca13dd3d20d9 (patch) | |
tree | d130186b36c958b0c3d54ab01e172031d9308604 /gcc/ada/gcc-interface/decl.c | |
parent | f0c6475aeaa426c110cdc4df6c63c0ee63e5776e (diff) | |
download | gcc-586388fd723b7c59d97304607357ca13dd3d20d9.zip gcc-586388fd723b7c59d97304607357ca13dd3d20d9.tar.gz gcc-586388fd723b7c59d97304607357ca13dd3d20d9.tar.bz2 |
uintp.adb (UI_From_Dint): Remove useless code.
* uintp.adb (UI_From_Dint): Remove useless code.
(UI_From_Int): Likewise.
* uintp.h: Reorder declarations.
(UI_From_gnu): Declare.
(UI_Base): Likewise.
(Vector_Template): Likewise.
(Vector_To_Uint): Likewise.
(Uint_0): Remove.
(Uint_1): Likewise.
* gcc-interface/gigi.h: Tweak comments.
* gcc-interface/cuintp.c (UI_From_gnu): New global function.
* gcc-interface/decl.c (maybe_pad_type): Do not warn if either size
overflows.
(annotate_value) <INTEGER_CST>: Call UI_From_gnu.
* gcc-interface/trans.c (post_error_ne_num): Call post_error_ne.
(post_error_ne_tree): Call UI_From_gnu and post_error_ne.
* gcc-interface/utils.c (max_size) <tcc_binary>: Do not special-case
TYPE_MAX_VALUE.
From-SVN: r158408
Diffstat (limited to 'gcc/ada/gcc-interface/decl.c')
-rw-r--r-- | gcc/ada/gcc-interface/decl.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c index 44c3929..1a42ff7 100644 --- a/gcc/ada/gcc-interface/decl.c +++ b/gcc/ada/gcc-interface/decl.c @@ -6281,7 +6281,9 @@ maybe_pad_type (tree type, tree size, unsigned int align, && !operand_equal_p (size, orig_size, 0) && !(TREE_CODE (size) == INTEGER_CST && TREE_CODE (orig_size) == INTEGER_CST - && tree_int_cst_lt (size, orig_size))) + && (TREE_OVERFLOW (size) + || TREE_OVERFLOW (orig_size) + || tree_int_cst_lt (size, orig_size)))) { Node_Id gnat_error_node = Empty; @@ -7087,7 +7089,7 @@ annotate_value (tree gnu_size) TCode tcode; Node_Ref_Or_Val ops[3], ret; struct tree_int_map **h = NULL; - int size, i; + int i; /* See if we've already saved the value for this node. */ if (EXPR_P (gnu_size)) @@ -7143,17 +7145,7 @@ annotate_value (tree gnu_size) return annotate_value (temp); } - if (!host_integerp (gnu_size, 1)) - return No_Uint; - - size = tree_low_cst (gnu_size, 1); - - /* This peculiar test is to make sure that the size fits in an int - on machines where HOST_WIDE_INT is not "int". */ - if (tree_low_cst (gnu_size, 1) == size) - return UI_From_Int (size); - else - return No_Uint; + return UI_From_gnu (gnu_size); case COMPONENT_REF: /* The only case we handle here is a simple discriminant reference. */ |