aboutsummaryrefslogtreecommitdiff
path: root/gcc/f/com.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@vlsi1.ultra.nyu.edu>2000-02-20 01:11:00 +0000
committerRichard Kenner <kenner@gcc.gnu.org>2000-02-19 20:11:00 -0500
commit06ceef4e7bd12a2097bef4cd68d8d7397dac83ff (patch)
tree7f6c09091ffe927c1ab220b0ad2180cb341a9a84 /gcc/f/com.c
parentccd4c273d9fd62fa7d57061387ad73ffb1043aa0 (diff)
downloadgcc-06ceef4e7bd12a2097bef4cd68d8d7397dac83ff.zip
gcc-06ceef4e7bd12a2097bef4cd68d8d7397dac83ff.tar.gz
gcc-06ceef4e7bd12a2097bef4cd68d8d7397dac83ff.tar.bz2
c-common.c (decl_attributes): Set DECL_SIZE_UNIT.
* c-common.c (decl_attributes): Set DECL_SIZE_UNIT. * c-decl.c (duplicate_decls, finish_enum): Likewise. (finish_decl): Remove -Wlarger-than code from here. * flags.h (id_clash_len): Now int. (larger_than_size): Now HOST_WIDE_INT. * fold-const.c (size_int_wide): No more HIGH parm; NUMBER is signed. Clean up checking to see if in table. (make_bit_field_ref): Remove extra parm to bitsize_int. * ggc-common.c (ggc_mark_tree_children): Mark DECL_SIZE_UNIT. * print-tree.c (print_node): Print DECL_SIZE_UNIT and TYPE_SIZE_UNIT. * stmt.c (expand_decl): Use DECL_SIZE_UNIT for stack checking size and for computing size of decl. * stor-layout.c (layout_decl): Set DECL_SIZE_UNIT. Move -Wlarger-than code to here. (layout_record): Remove extra arg to bitsize_int. Set TYPE_BINFO_SIZE_UNIT. (layout_union): Remove extra arg to bitsize_int. Use proper type for size of QUAL_UNION. (layout_type): Remove extra arg to bitsize_int. * toplev.c (id_clash_len): Now int. (larger_than_size): Now HOST_WIDE_INT. (decode_W_option): Clean up id-clash and larger-than- cases. * tree.c (get_identifier, maybe_get_identifier): Remove unneeded casts. (expr_align, case FUNCTION_DECL): DECL_ALIGN is not defined. * tree.h (BINFO_SIZE_UNIT, TYPE_BINFO_SIZE_UNIT, DECL_SIZE_UNIT): New. (struct tree_decl): New field size_unit. (size_int_wide): No HIGH operand; NUMBER is now signed. (size_int_2): Deleted. (size_int, bitsize_int): Don't use it and rework args. * varasm.c (assemble_variable, output_constructor): Use DECL_SIZE_UNIT. * ch/decl.c (layout_enum): Set DECL_SIZE_UNIT. * ch/satisfy.c (safe_satisfy_decl): Likewise. * cp/class.c (build_primary_vtable, layout_vtable_decl): Likewise. (avoid_overlap, build_base_field): Likewise. (build_base_field, build_base_fields, is_empty_class): Test DECL_SIZE with integer_zero. (layout_class_type): Set CLASSTYPE_SIZE_UNIT. * cp/cp-tree.h (struct lang_type): New field size_unit. (CLASSTYPE_SIZE_UNIT): New macro. * cp/decl.c (init_decl_processing): Set DECL_SIZE_UNIT. (cp_finish_decl): Delete -Wlarger-than processing. * cp/optimize.c (remap_decl): Walk DECL_SIZE_UNIT. * cp/pt.c (tsubst_decl): Set DECL_SIZE_UNIT. * cp/tree.c (make_binfo): binfo vector is one entry longer. (walk_tree): Walk DECL_SIZE_UNIT. * f/com.c (ffecom_sym_transform): Use DECL_SIZE_UNIT. (ffecom_transform_common_, ffecom_transform_equiv_): Likewise. (duplicate_decls): Likewise. (ffecom_tree_canonize_ptr_): Delete extra arg to bitsize_int. (finish_decl): Delete -Wlarger-than processing. * java/class.c (build_class_ref, push_super_field): Set DECL_SIZE_UNIT. * java/constants.c (build_constants_constructor): Likewise. From-SVN: r32068
Diffstat (limited to 'gcc/f/com.c')
-rw-r--r--gcc/f/com.c63
1 files changed, 18 insertions, 45 deletions
diff --git a/gcc/f/com.c b/gcc/f/com.c
index 49560ac..b181f8e 100644
--- a/gcc/f/com.c
+++ b/gcc/f/com.c
@@ -1,5 +1,6 @@
/* com.c -- Implementation File (module.c template V1.0)
- Copyright (C) 1995-1999 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000
+ Free Software Foundation, Inc.
Contributed by James Craig Burley.
This file is part of GNU Fortran.
@@ -7762,15 +7763,12 @@ ffecom_sym_transform_ (ffesymbol s)
finish_decl (t, initexpr, FALSE);
- if ((st != NULL) && (DECL_SIZE (t) != error_mark_node))
+ if (st != NULL && DECL_SIZE (t) != error_mark_node)
{
- tree size_tree;
-
- size_tree = size_binop (CEIL_DIV_EXPR,
- DECL_SIZE (t),
- size_int (BITS_PER_UNIT));
- assert (TREE_INT_CST_HIGH (size_tree) == 0);
- assert (TREE_INT_CST_LOW (size_tree) == ffestorag_size (st));
+ assert (TREE_CODE (DECL_SIZE_UNIT (t)) == INTEGER_CST);
+ assert (TREE_INT_CST_HIGH (DECL_SIZE_UNIT (t)) == 0);
+ assert (TREE_INT_CST_LOW (DECL_SIZE_UNIT (t))
+ == ffestorag_size (st));
}
resume_momentary (yes);
@@ -8826,15 +8824,10 @@ ffecom_transform_common_ (ffesymbol s)
if (init)
{
- tree size_tree;
-
- assert (DECL_SIZE (cbt) != NULL_TREE);
- assert (TREE_CODE (DECL_SIZE (cbt)) == INTEGER_CST);
- size_tree = size_binop (CEIL_DIV_EXPR,
- DECL_SIZE (cbt),
- size_int (BITS_PER_UNIT));
- assert (TREE_INT_CST_HIGH (size_tree) == 0);
- assert (TREE_INT_CST_LOW (size_tree)
+ assert (DECL_SIZE_UNIT (cbt) != NULL_TREE);
+ assert (TREE_CODE (DECL_SIZE_UNIT (cbt)) == INTEGER_CST);
+ assert (TREE_INT_CST_HIGH (DECL_SIZE_UNIT (cbt)) == 0);
+ assert (TREE_INT_CST_LOW (DECL_SIZE_UNIT (cbt))
== ffeglobal_common_size (g) + ffeglobal_common_pad (g));
}
@@ -8966,13 +8959,9 @@ ffecom_transform_equiv_ (ffestorag eqst)
ffestorag_set_init (eqst, ffebld_new_any ());
{
- tree size_tree;
-
- size_tree = size_binop (CEIL_DIV_EXPR,
- DECL_SIZE (eqt),
- size_int (BITS_PER_UNIT));
- assert (TREE_INT_CST_HIGH (size_tree) == 0);
- assert (TREE_INT_CST_LOW (size_tree)
+ assert (TREE_CODE (DECL_SIZE_UNIT (eqt)) == INTEGER_CST);
+ assert (TREE_INT_CST_HIGH (DECL_SIZE_UNIT (eqt)) == 0);
+ assert (TREE_INT_CST_LOW (DECL_SIZE_UNIT (eqt))
== ffestorag_size (eqst) + ffestorag_modulo (eqst));
}
@@ -9120,7 +9109,7 @@ ffecom_tree_canonize_ptr_ (tree *decl, tree *offset,
case PARM_DECL:
*decl = t;
- *offset = bitsize_int (0L, 0L);
+ *offset = bitsize_int (0);
break;
case ADDR_EXPR:
@@ -9128,7 +9117,7 @@ ffecom_tree_canonize_ptr_ (tree *decl, tree *offset,
{
/* A reference to COMMON. */
*decl = TREE_OPERAND (t, 0);
- *offset = bitsize_int (0L, 0L);
+ *offset = bitsize_int (0);
break;
}
/* Fall through. */
@@ -9249,7 +9238,7 @@ ffecom_tree_canonize_ref_ (tree *decl, tree *offset,
case VAR_DECL:
case PARM_DECL:
*decl = t;
- *offset = bitsize_int (0L, 0L);
+ *offset = bitsize_int (0);
*size = TYPE_SIZE (TREE_TYPE (t));
return;
@@ -13839,6 +13828,7 @@ duplicate_decls (tree newdecl, tree olddecl)
{
/* Since the type is OLDDECL's, make OLDDECL's size go with. */
DECL_SIZE (newdecl) = DECL_SIZE (olddecl);
+ DECL_SIZE_UNIT (newdecl) = DECL_SIZE_UNIT (olddecl);
if (TREE_CODE (olddecl) != FUNCTION_DECL)
if (DECL_ALIGN (olddecl) > DECL_ALIGN (newdecl))
DECL_ALIGN (newdecl) = DECL_ALIGN (olddecl);
@@ -14148,23 +14138,6 @@ finish_decl (tree decl, tree init, bool is_top_level)
}
}
- /* If requested, warn about definitions of large data objects. */
-
- if (warn_larger_than
- && (TREE_CODE (decl) == VAR_DECL || TREE_CODE (decl) == PARM_DECL)
- && !DECL_EXTERNAL (decl))
- {
- register tree decl_size = DECL_SIZE (decl);
-
- if (decl_size && TREE_CODE (decl_size) == INTEGER_CST)
- {
- unsigned units = TREE_INT_CST_LOW (decl_size) / BITS_PER_UNIT;
-
- if (units > larger_than_size)
- warning_with_decl (decl, "size of `%s' is %u bytes", units);
- }
- }
-
/* If we have gone back from temporary to permanent allocation, actually
free the temporary space that we no longer need. */
if (temporary && !allocation_temporary_p ())