OSDN Git Service

* doc/tm.texi (Storage Layout): Remove ROUND_TYPE_SIZE and
authoraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 1 Jun 2003 19:44:22 +0000 (19:44 +0000)
committeraj <aj@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 1 Jun 2003 19:44:22 +0000 (19:44 +0000)
ROUND_TYPE_SIZE_UNIT.

* stor-layout.c (finalize_record_size): Remove usages of
ROUND_TYPE_SIZE and ROUND_TYPE_SIZE_UNIT.
(finalize_type_size): Likewise.
(layout_type): Likewise.

* system.h: Poison ROUND_TYPE_SIZE and ROUND_TYPE_SIZE_UNIT.

ada:
* utils.c (finish_record_type): Remove usages of
ROUND_TYPE_SIZE and ROUND_TYPE_SIZE_UNIT.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67313 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ada/ChangeLog
gcc/ada/utils.c
gcc/doc/tm.texi
gcc/stor-layout.c
gcc/system.h

index 9b6234b..14776d0 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-01  Andreas Jaeger  <aj@suse.de>
+
+       * utils.c (finish_record_type): Remove usages of ROUND_TYPE_SIZE
+       and ROUND_TYPE_SIZE_UNIT.
+
 2003-05-22   Geert Bosch <bosch@gnat.com>
 
        * gnat_rm.texi : Remove reference to Ada Core Technologies.
 
 2003-05-01  Laurent Guerby <guerby@acm.org>
 
-        PR ada/10546 
+        PR ada/10546
         * 5iosinte.ads: Increase pthread_cond_t size to match recent
         LinuxThread and NPTL version, merge from ACT.
-       
+
 2003-04-28  Zack Weinberg  <zack@codesourcery.com>
 
        * utils.c (convert): No need to clear TREE_CST_RTL.
index d579943..8322d35 100644 (file)
@@ -63,7 +63,7 @@
 /* If nonzero, pretend we are allocating at global level.  */
 int force_global;
 
-/* Tree nodes for the various types and decls we create.  */ 
+/* Tree nodes for the various types and decls we create.  */
 tree gnat_std_decls[(int) ADT_LAST];
 
 /* Functions to call for each of the possible raise reasons.  */
@@ -84,12 +84,12 @@ static GTY(()) tree pending_elaborations;
    lists for an inner context.  */
 
 struct e_stack GTY(()) {
-  struct e_stack *next; 
-  tree elab_list; 
+  struct e_stack *next;
+  tree elab_list;
 };
 static GTY(()) struct e_stack *elist_stack;
 
-/* This variable keeps a table for types for each precision so that we only 
+/* This variable keeps a table for types for each precision so that we only
    allocate each of them once. Signed and unsigned types are kept separate.
 
    Note that these types are only used when fold-const requests something
@@ -343,7 +343,7 @@ poplevel (keep, reverse, functionbody)
   for (subblock_node = decl_chain; subblock_node;
        subblock_node = TREE_CHAIN (subblock_node))
     if (DECL_NAME (subblock_node) != 0)
-      /* If the identifier was used or addressed via a local extern decl,  
+      /* If the identifier was used or addressed via a local extern decl,
         don't forget that fact.   */
       if (DECL_EXTERNAL (subblock_node))
        {
@@ -509,7 +509,7 @@ gnat_init_decl_processing ()
 
 }
 
-/* Create the predefined scalar types such as `integer_type_node' needed 
+/* Create the predefined scalar types such as `integer_type_node' needed
    in the gcc back-end and initialize the global binding level.  */
 
 void
@@ -589,7 +589,7 @@ init_gigi_decls (long_long_float_type, exception_type)
     = create_subprog_decl
     (get_identifier ("system__soft_links__set_jmpbuf_address_soft"),
      NULL_TREE,
-     build_function_type (void_type_node, 
+     build_function_type (void_type_node,
                          tree_cons (NULL_TREE, jmpbuf_ptr_type, endlink)),
      NULL_TREE, 0, 1, 1, 0);
 
@@ -681,7 +681,7 @@ init_gigi_decls (long_long_float_type, exception_type)
   main_identifier_node = get_identifier ("main");
 }
 \f
-/* This function is called indirectly from toplev.c to handle incomplete 
+/* This function is called indirectly from toplev.c to handle incomplete
    declarations, i.e. VAR_DECL nodes whose DECL_SIZE is zero.  To be precise,
    compile_file in toplev.c makes an indirect call through the function pointer
    incomplete_decl_finalize_hook which is initialized to this routine in
@@ -695,9 +695,9 @@ gnat_finish_incomplete_decl (dont_care)
 }
 \f
 /* Given a record type (RECORD_TYPE) and a chain of FIELD_DECL
-   nodes (FIELDLIST), finish constructing the record or union type. 
+   nodes (FIELDLIST), finish constructing the record or union type.
    If HAS_REP is nonzero, this record has a rep clause; don't call
-   layout_type but merely set the size and alignment ourselves. 
+   layout_type but merely set the size and alignment ourselves.
    If DEFER_DEBUG is nonzero, do not call the debugging routines
    on this type; it will be done later. */
 
@@ -847,14 +847,8 @@ finish_record_type (record_type, fieldlist, has_rep, defer_debug)
       && ! TYPE_CONTAINS_TEMPLATE_P (record_type))
     SET_TYPE_ADA_SIZE (record_type, ada_size);
 
-#ifdef ROUND_TYPE_SIZE
-  size = ROUND_TYPE_SIZE (record_type, size, TYPE_ALIGN (record_type));
-  size_unit = ROUND_TYPE_SIZE_UNIT (record_type, size_unit,
-                                   TYPE_ALIGN (record_type) / BITS_PER_UNIT);
-#else
   size = round_up (size, TYPE_ALIGN (record_type));
   size_unit = round_up (size_unit, TYPE_ALIGN (record_type) / BITS_PER_UNIT);
-#endif
 
   if (has_rep
       && ! (TREE_CODE (record_type) == RECORD_TYPE
@@ -917,7 +911,7 @@ finish_record_type (record_type, fieldlist, has_rep, defer_debug)
                 a boundary and they something was added.  Check for the
                 first case first.  If not, see if there is any evidence
                 of rounding.  If so, round the last position and try
-                again. 
+                again.
 
                 If this is a union, the position can be taken as zero. */
 
@@ -1111,7 +1105,7 @@ split_plus (in, pvar)
    PARM_DECL nodes that are the subprogram arguments.  CICO_LIST is the
    copy-in/copy-out list to be stored into TYPE_CICO_LIST.
    RETURNS_UNCONSTRAINED is nonzero if the function returns an unconstrained
-   object.  RETURNS_BY_REF is nonzero if the function returns by reference. 
+   object.  RETURNS_BY_REF is nonzero if the function returns by reference.
    RETURNS_WITH_DSP is nonzero if the function is to return with a
    depressed stack pointer.  */
 
@@ -1208,7 +1202,7 @@ create_index_type (min, max, index)
 }
 \f
 /* Return a TYPE_DECL node. TYPE_NAME gives the name of the type (a character
-   string) and TYPE is a ..._TYPE node giving its data type. 
+   string) and TYPE is a ..._TYPE node giving its data type.
    ARTIFICIAL_P is nonzero if this is a declaration that was generated
    by the compiler.  DEBUG_INFO_P is nonzero if we need to write debugging
    information about this type.  */
@@ -1253,9 +1247,9 @@ create_type_decl (type_name, type, attr_list, artificial_p, debug_info_p)
 
    PUBLIC_FLAG is nonzero if this definition is to be made visible outside of
    the current compilation unit. This flag should be set when processing the
-   variable definitions in a package specification.  EXTERN_FLAG is nonzero 
+   variable definitions in a package specification.  EXTERN_FLAG is nonzero
    when processing an external variable declaration (as opposed to a
-   definition: no storage is to be allocated for the variable here). 
+   definition: no storage is to be allocated for the variable here).
 
    STATIC_FLAG is only relevant when not at top level.  In that case
    it indicates whether to always allocate storage to the variable.   */
@@ -1569,7 +1563,7 @@ process_attributes (decl, attr_list)
 \f
 /* Add some pending elaborations on the list.  */
 
-void 
+void
 add_pending_elaborations (var_decl, var_init)
      tree var_decl;
      tree var_init;
@@ -1759,7 +1753,7 @@ begin_subprog_body (subprog_decl)
 
   /* Push all the PARM_DECL nodes onto the current scope (i.e. the scope of the
      subprogram body) so that they can be recognized as local variables in the
-     subprogram. 
+     subprogram.
 
      The list of PARM_DECL nodes is stored in the right order in
      DECL_ARGUMENTS.  Since ..._DECL nodes get stored in the reverse order in
@@ -1899,7 +1893,7 @@ builtin_function (name, type, function_code, class, library_name, attrs)
   return decl;
 }
 
-/* Return an integer type with the number of bits of precision given by  
+/* Return an integer type with the number of bits of precision given by
    PRECISION.  UNSIGNEDP is nonzero if the type is unsigned; otherwise
    it is a signed type.  */
 
@@ -2382,7 +2376,7 @@ build_vms_descriptor (type, mech, gnat_entity)
     case By_Descriptor_SB:
       field_list
        = chainon (field_list,
-                  make_descriptor_field 
+                  make_descriptor_field
                   ("SB_L1", gnat_type_for_size (32, 1), record_type,
                    TREE_CODE (type) == ARRAY_TYPE
                    ? TYPE_MIN_VALUE (TYPE_DOMAIN (type)) : size_zero_node));
@@ -2627,7 +2621,7 @@ update_pointer_to (old_type, new_type)
                       build (PLACEHOLDER_EXPR, ptr),
                       TREE_CHAIN (TYPE_FIELDS (ptr)));
 
-      update_pointer_to 
+      update_pointer_to
        (TREE_TYPE (TREE_TYPE (TYPE_FIELDS (ptr))),
         gnat_substitute_in_type (TREE_TYPE (TREE_TYPE (TYPE_FIELDS (ptr))),
                                  TREE_CHAIN (TYPE_FIELDS (ptr)), new_ref));
@@ -2920,7 +2914,7 @@ convert (type, expr)
 
     case INDIRECT_REF:
       /* If both types are record types, just convert the pointer and
-        make a new INDIRECT_REF. 
+        make a new INDIRECT_REF.
 
         ??? Disable this for now since it causes problems with the
         code in build_binary_op for MODIFY_EXPR which wants to
@@ -3233,7 +3227,7 @@ unchecked_convert (type, expr)
                                     GET_MODE_BITSIZE (TYPE_MODE (type))))
     {
       tree rec_type = make_node (RECORD_TYPE);
-      tree field = create_field_decl (get_identifier ("OBJ"), type, 
+      tree field = create_field_decl (get_identifier ("OBJ"), type,
                                      rec_type, 1, 0, 0, 0);
 
       TYPE_FIELDS (rec_type) = field;
index 322374f..839cf10 100644 (file)
@@ -1280,21 +1280,6 @@ Normally, this is not needed.  See the file @file{c4x.h} for an example
 of how to use this macro to prevent a structure having a floating point
 field from being accessed in an integer mode.
 
-@findex ROUND_TYPE_SIZE
-@item ROUND_TYPE_SIZE (@var{type}, @var{computed}, @var{specified})
-Define this macro as an expression for the overall size of a type
-(given by @var{type} as a tree node) when the size computed in the
-usual way is @var{computed} and the alignment is @var{specified}.
-
-The default is to round @var{computed} up to a multiple of @var{specified}.
-
-@findex ROUND_TYPE_SIZE_UNIT
-@item ROUND_TYPE_SIZE_UNIT (@var{type}, @var{computed}, @var{specified})
-Similar to @code{ROUND_TYPE_SIZE}, but sizes and alignments are
-specified in units (bytes).  If you define @code{ROUND_TYPE_SIZE},
-you must also define this macro and they must be defined consistently
-with each other.
-
 @findex ROUND_TYPE_ALIGN
 @item ROUND_TYPE_ALIGN (@var{type}, @var{computed}, @var{specified})
 Define this macro as an expression for the alignment of a type (given
index 14f0f86..c02192f 100644 (file)
@@ -1279,17 +1279,9 @@ finalize_record_size (rli)
       = size_binop (PLUS_EXPR, unpadded_size_unit, size_one_node);
 
   /* Round the size up to be a multiple of the required alignment */
-#ifdef ROUND_TYPE_SIZE
-  TYPE_SIZE (rli->t) = ROUND_TYPE_SIZE (rli->t, unpadded_size,
-                                       TYPE_ALIGN (rli->t));
-  TYPE_SIZE_UNIT (rli->t)
-    = ROUND_TYPE_SIZE_UNIT (rli->t, unpadded_size_unit,
-                           TYPE_ALIGN (rli->t) / BITS_PER_UNIT);
-#else
   TYPE_SIZE (rli->t) = round_up (unpadded_size, TYPE_ALIGN (rli->t));
   TYPE_SIZE_UNIT (rli->t) = round_up (unpadded_size_unit,
                                      TYPE_ALIGN (rli->t) / BITS_PER_UNIT);
-#endif
 
   if (warn_padded && TREE_CONSTANT (unpadded_size)
       && simple_cst_equal (unpadded_size, TYPE_SIZE (rli->t)) == 0)
@@ -1308,13 +1300,7 @@ finalize_record_size (rli)
       rli->unpacked_align = MAX (TYPE_ALIGN (rli->t), rli->unpacked_align);
 #endif
 
-#ifdef ROUND_TYPE_SIZE
-      unpacked_size = ROUND_TYPE_SIZE (rli->t, TYPE_SIZE (rli->t),
-                                      rli->unpacked_align);
-#else
       unpacked_size = round_up (TYPE_SIZE (rli->t), rli->unpacked_align);
-#endif
-
       if (simple_cst_equal (unpacked_size, TYPE_SIZE (rli->t)))
        {
          TYPE_PACKED (rli->t) = 0;
@@ -1470,17 +1456,9 @@ finalize_type_size (type)
 
   if (TYPE_SIZE (type) != 0)
     {
-#ifdef ROUND_TYPE_SIZE
-      TYPE_SIZE (type)
-       = ROUND_TYPE_SIZE (type, TYPE_SIZE (type), TYPE_ALIGN (type));
-      TYPE_SIZE_UNIT (type)
-       = ROUND_TYPE_SIZE_UNIT (type, TYPE_SIZE_UNIT (type),
-                               TYPE_ALIGN (type) / BITS_PER_UNIT);
-#else
       TYPE_SIZE (type) = round_up (TYPE_SIZE (type), TYPE_ALIGN (type));
       TYPE_SIZE_UNIT (type)
        = round_up (TYPE_SIZE_UNIT (type), TYPE_ALIGN (type) / BITS_PER_UNIT);
-#endif
     }
 
   /* Evaluate nonconstant sizes only once, either now or as soon as safe.  */
@@ -1779,22 +1757,6 @@ layout_type (type)
        TYPE_ALIGN (type) = MAX (TYPE_ALIGN (element), BITS_PER_UNIT);
 #endif
        TYPE_USER_ALIGN (type) = TYPE_USER_ALIGN (element);
-
-#ifdef ROUND_TYPE_SIZE
-       if (TYPE_SIZE (type) != 0)
-         {
-           tree tmp
-             = ROUND_TYPE_SIZE (type, TYPE_SIZE (type), TYPE_ALIGN (type));
-
-           /* If the rounding changed the size of the type, remove any
-              pre-calculated TYPE_SIZE_UNIT.  */
-           if (simple_cst_equal (TYPE_SIZE (type), tmp) != 1)
-             TYPE_SIZE_UNIT (type) = NULL;
-
-           TYPE_SIZE (type) = tmp;
-         }
-#endif
-
        TYPE_MODE (type) = BLKmode;
        if (TYPE_SIZE (type) != 0
 #ifdef MEMBER_TYPE_FORCES_BLK
index 145e775..d308323 100644 (file)
@@ -641,7 +641,8 @@ typedef char _Bool;
        FUNCTION_BLOCK_PROFILER_EXIT MACHINE_STATE_SAVE                    \
        MACHINE_STATE_RESTORE SCCS_DIRECTIVE SECTION_ASM_OP                \
        ASM_OUTPUT_DEFINE_LABEL_DIFFERENCE_SYMBOL ASM_OUTPUT_INTERNAL_LABEL \
-       OBJC_PROLOGUE ALLOCATE_TRAMPOLINE HANDLE_PRAGMA
+       OBJC_PROLOGUE ALLOCATE_TRAMPOLINE HANDLE_PRAGMA ROUND_TYPE_SIZE    \
+       ROUND_TYPE_SIZE_UNIT
 
 /* Hooks that are no longer used.  */
  #pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE  \