Commit b5d6a2ff by Richard Kenner Committed by Richard Kenner

stor-layout.c (reference_types_internal): New variable.

	* stor-layout.c (reference_types_internal): New variable.
	(internal_reference_types): New function.
	(layout_type, case REFERENCE_TYPE): Make Pmode if internal.
	* tree.h (internal_reference_types): New declaration.

From-SVN: r39491
parent 05bd3d41
Tue Feb 6 07:54:51 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Tue Feb 6 07:54:51 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* stor-layout.c (reference_types_internal): New variable.
(internal_reference_types): New function.
(layout_type, case REFERENCE_TYPE): Make Pmode if internal.
* tree.h (internal_reference_types): New declaration.
* cse.c (find_best_addr): Fix typo in computing cost. * cse.c (find_best_addr): Fix typo in computing cost.
Mon Feb 5 21:56:16 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> Mon Feb 5 21:56:16 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
......
/* C-compiler utilities for types and variables storage layout /* C-compiler utilities for types and variables storage layout
Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1996, 1998, Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1996, 1998,
1999, 2000 Free Software Foundation, Inc. 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -50,6 +50,11 @@ unsigned int maximum_field_alignment; ...@@ -50,6 +50,11 @@ unsigned int maximum_field_alignment;
May be overridden by front-ends. */ May be overridden by front-ends. */
unsigned int set_alignment = 0; unsigned int set_alignment = 0;
/* Nonzero if all REFERENCE_TYPEs are internal and hence should be
allocated in Pmode, not ptr_mode. Set only by internal_reference_types
called only by a front end. */
static int reference_types_internal = 0;
static void finalize_record_size PARAMS ((record_layout_info)); static void finalize_record_size PARAMS ((record_layout_info));
static void finalize_type_size PARAMS ((tree)); static void finalize_type_size PARAMS ((tree));
static void place_union_field PARAMS ((record_layout_info, tree)); static void place_union_field PARAMS ((record_layout_info, tree));
...@@ -64,6 +69,15 @@ static tree pending_sizes; ...@@ -64,6 +69,15 @@ static tree pending_sizes;
int immediate_size_expand; int immediate_size_expand;
/* Show that REFERENCE_TYPES are internal and should be Pmode. Called only
by front end. */
void
internal_reference_types ()
{
reference_types_internal = 1;
}
/* Get a list of all the objects put on the pending sizes list. */ /* Get a list of all the objects put on the pending sizes list. */
tree tree
...@@ -1315,11 +1329,17 @@ layout_type (type) ...@@ -1315,11 +1329,17 @@ layout_type (type)
case POINTER_TYPE: case POINTER_TYPE:
case REFERENCE_TYPE: case REFERENCE_TYPE:
TYPE_MODE (type) = ptr_mode; {
TYPE_SIZE (type) = bitsize_int (POINTER_SIZE); int nbits = ((TREE_CODE (type) == REFERENCE_TYPE
TYPE_SIZE_UNIT (type) = size_int (POINTER_SIZE / BITS_PER_UNIT); && reference_types_internal)
TREE_UNSIGNED (type) = 1; ? GET_MODE_BITSIZE (Pmode) : POINTER_SIZE);
TYPE_PRECISION (type) = POINTER_SIZE;
TYPE_MODE (type) = nbits == POINTER_SIZE ? ptr_mode : Pmode;
TYPE_SIZE (type) = bitsize_int (nbits);
TYPE_SIZE_UNIT (type) = size_int (nbits / BITS_PER_UNIT);
TREE_UNSIGNED (type) = 1;
TYPE_PRECISION (type) = nbits;
}
break; break;
case ARRAY_TYPE: case ARRAY_TYPE:
......
...@@ -2773,6 +2773,7 @@ extern void set_yydebug PARAMS ((int)); ...@@ -2773,6 +2773,7 @@ extern void set_yydebug PARAMS ((int));
/* In stor-layout.c */ /* In stor-layout.c */
extern void fixup_signed_type PARAMS ((tree)); extern void fixup_signed_type PARAMS ((tree));
extern void internal_reference_types PARAMS ((void));
/* varasm.c */ /* varasm.c */
extern void make_decl_rtl PARAMS ((tree, const char *)); extern void make_decl_rtl PARAMS ((tree, const char *));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment