1 /* C-compiler utilities for types and variables storage layout
2 Copyright (C) 1987, 88, 92-97, 1998 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
33 #define CEIL(x,y) (((x) + (y) - 1) / (y))
35 /* Data type for the expressions representing sizes of data types.
36 It is the first integer type laid out. */
38 struct sizetype_tab sizetype_tab;
40 /* An integer constant with value 0 whose type is sizetype. */
44 /* An integer constant with value 1 whose type is sizetype. */
48 /* If nonzero, this is an upper limit on alignment of structure fields.
49 The value is measured in bits. */
50 int maximum_field_alignment;
52 /* If non-zero, the alignment of a bitstring or (power-)set value, in bits.
53 May be overridden by front-ends. */
54 int set_alignment = 0;
56 static enum machine_mode smallest_mode_for_size PROTO((unsigned int,
58 static tree layout_record PROTO((tree));
59 static void layout_union PROTO((tree));
61 /* SAVE_EXPRs for sizes of types and decls, waiting to be expanded. */
63 static tree pending_sizes;
65 /* Nonzero means cannot safely call expand_expr now,
66 so put variable sizes onto `pending_sizes' instead. */
68 int immediate_size_expand;
73 tree chain = pending_sizes;
76 /* Put each SAVE_EXPR into the current function. */
77 for (t = chain; t; t = TREE_CHAIN (t))
78 SAVE_EXPR_CONTEXT (TREE_VALUE (t)) = current_function_decl;
84 put_pending_sizes (chain)
90 pending_sizes = chain;
93 /* Given a size SIZE that may not be a constant, return a SAVE_EXPR
94 to serve as the actual size-expression for a type or decl. */
100 /* If the language-processor is to take responsibility for variable-sized
101 items (e.g., languages which have elaboration procedures like Ada),
102 just return SIZE unchanged. Likewise for self-referential sizes. */
103 if (TREE_CONSTANT (size)
104 || global_bindings_p () < 0 || contains_placeholder_p (size))
107 size = save_expr (size);
109 if (global_bindings_p ())
111 if (TREE_CONSTANT (size))
112 error ("type size can't be explicitly evaluated");
114 error ("variable-size type declared outside of any function");
119 if (immediate_size_expand)
120 /* NULL_RTX is not defined; neither is the rtx type.
121 Also, we would like to pass const0_rtx here, but don't have it. */
122 expand_expr (size, expand_expr (integer_zero_node, NULL_PTR, VOIDmode, 0),
125 pending_sizes = tree_cons (NULL_TREE, size, pending_sizes);
130 #ifndef MAX_FIXED_MODE_SIZE
131 #define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (DImode)
134 /* Return the machine mode to use for a nonscalar of SIZE bits.
135 The mode must be in class CLASS, and have exactly that many bits.
136 If LIMIT is nonzero, modes of wider than MAX_FIXED_MODE_SIZE will not
140 mode_for_size (size, class, limit)
142 enum mode_class class;
145 register enum machine_mode mode;
147 if (limit && size > (unsigned int)(MAX_FIXED_MODE_SIZE))
150 /* Get the first mode which has this size, in the specified class. */
151 for (mode = GET_CLASS_NARROWEST_MODE (class); mode != VOIDmode;
152 mode = GET_MODE_WIDER_MODE (mode))
153 if ((unsigned int)GET_MODE_BITSIZE (mode) == size)
159 /* Similar, but never return BLKmode; return the narrowest mode that
160 contains at least the requested number of bits. */
162 static enum machine_mode
163 smallest_mode_for_size (size, class)
165 enum mode_class class;
167 register enum machine_mode mode;
169 /* Get the first mode which has at least this size, in the
171 for (mode = GET_CLASS_NARROWEST_MODE (class); mode != VOIDmode;
172 mode = GET_MODE_WIDER_MODE (mode))
173 if ((unsigned int)GET_MODE_BITSIZE (mode) >= size)
179 /* Find an integer mode of the exact same size, or BLKmode on failure. */
182 int_mode_for_mode (mode)
183 enum machine_mode mode;
185 switch (GET_MODE_CLASS (mode))
188 case MODE_PARTIAL_INT:
191 case MODE_COMPLEX_INT:
192 case MODE_COMPLEX_FLOAT:
194 mode = mode_for_size (GET_MODE_BITSIZE (mode), MODE_INT, 0);
210 /* Return the value of VALUE, rounded up to a multiple of DIVISOR. */
213 round_up (value, divisor)
217 return size_binop (MULT_EXPR,
218 size_binop (CEIL_DIV_EXPR, value, size_int (divisor)),
222 /* Set the size, mode and alignment of a ..._DECL node.
223 TYPE_DECL does need this for C++.
224 Note that LABEL_DECL and CONST_DECL nodes do not need this,
225 and FUNCTION_DECL nodes have them set up in a special (and simple) way.
226 Don't call layout_decl for them.
228 KNOWN_ALIGN is the amount of alignment we can assume this
229 decl has with no special effort. It is relevant only for FIELD_DECLs
230 and depends on the previous fields.
231 All that matters about KNOWN_ALIGN is which powers of 2 divide it.
232 If KNOWN_ALIGN is 0, it means, "as much alignment as you like":
233 the record will be aligned to suit. */
236 layout_decl (decl, known_align)
238 unsigned known_align;
240 register tree type = TREE_TYPE (decl);
241 register enum tree_code code = TREE_CODE (decl);
242 int spec_size = DECL_FIELD_SIZE (decl);
244 if (code == CONST_DECL)
247 if (code != VAR_DECL && code != PARM_DECL && code != RESULT_DECL
248 && code != FIELD_DECL && code != TYPE_DECL)
251 if (type == error_mark_node)
253 type = void_type_node;
257 /* Usually the size and mode come from the data type without change. */
259 DECL_MODE (decl) = TYPE_MODE (type);
260 TREE_UNSIGNED (decl) = TREE_UNSIGNED (type);
261 if (DECL_SIZE (decl) == 0)
262 DECL_SIZE (decl) = TYPE_SIZE (type);
264 if (code == FIELD_DECL && DECL_BIT_FIELD (decl))
266 if (spec_size == 0 && DECL_NAME (decl) != 0)
269 /* Size is specified number of bits. */
270 DECL_SIZE (decl) = size_int (spec_size);
272 /* Force alignment required for the data type.
273 But if the decl itself wants greater alignment, don't override that.
274 Likewise, if the decl is packed, don't override it. */
275 else if (DECL_ALIGN (decl) == 0
276 || (! DECL_PACKED (decl) && TYPE_ALIGN (type) > DECL_ALIGN (decl)))
277 DECL_ALIGN (decl) = TYPE_ALIGN (type);
279 /* See if we can use an ordinary integer mode for a bit-field. */
280 /* Conditions are: a fixed size that is correct for another mode
281 and occupying a complete byte or bytes on proper boundary. */
282 if (code == FIELD_DECL)
284 DECL_BIT_FIELD_TYPE (decl) = DECL_BIT_FIELD (decl) ? type : 0;
285 if (maximum_field_alignment != 0)
286 DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), maximum_field_alignment);
287 else if (DECL_PACKED (decl))
288 DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), BITS_PER_UNIT);
291 if (DECL_BIT_FIELD (decl)
292 && TYPE_SIZE (type) != 0
293 && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
294 && GET_MODE_CLASS (TYPE_MODE (type)) == MODE_INT)
296 register enum machine_mode xmode
297 = mode_for_size (TREE_INT_CST_LOW (DECL_SIZE (decl)), MODE_INT, 1);
300 && known_align % GET_MODE_ALIGNMENT (xmode) == 0)
302 DECL_ALIGN (decl) = MAX (GET_MODE_ALIGNMENT (xmode),
304 DECL_MODE (decl) = xmode;
305 DECL_SIZE (decl) = size_int (GET_MODE_BITSIZE (xmode));
306 /* This no longer needs to be accessed as a bit field. */
307 DECL_BIT_FIELD (decl) = 0;
311 /* Turn off DECL_BIT_FIELD if we won't need it set. */
312 if (DECL_BIT_FIELD (decl) && TYPE_MODE (type) == BLKmode
313 && known_align % TYPE_ALIGN (type) == 0
314 && DECL_SIZE (decl) != 0
315 && (TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST
316 || (TREE_INT_CST_LOW (DECL_SIZE (decl)) % BITS_PER_UNIT) == 0)
317 && DECL_ALIGN (decl) >= TYPE_ALIGN (type))
318 DECL_BIT_FIELD (decl) = 0;
320 /* Evaluate nonconstant size only once, either now or as soon as safe. */
321 if (DECL_SIZE (decl) != 0 && TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST)
322 DECL_SIZE (decl) = variable_size (DECL_SIZE (decl));
325 /* Lay out a RECORD_TYPE type (a C struct).
326 This means laying out the fields, determining their positions,
327 and computing the overall size and required alignment of the record.
328 Note that if you set the TYPE_ALIGN before calling this
329 then the struct is aligned to at least that boundary.
331 If the type has basetypes, you must call layout_basetypes
332 before calling this function.
334 The return value is a list of static members of the record.
335 They still need to be laid out. */
342 unsigned record_align = MAX (BITS_PER_UNIT, TYPE_ALIGN (rec));
343 /* These must be laid out *after* the record is. */
344 tree pending_statics = NULL_TREE;
345 /* Record size so far is CONST_SIZE + VAR_SIZE bits,
346 where CONST_SIZE is an integer
347 and VAR_SIZE is a tree expression.
348 If VAR_SIZE is null, the size is just CONST_SIZE.
349 Naturally we try to avoid using VAR_SIZE. */
350 register HOST_WIDE_INT const_size = 0;
351 register tree var_size = 0;
352 /* Once we start using VAR_SIZE, this is the maximum alignment
353 that we know VAR_SIZE has. */
354 register int var_align = BITS_PER_UNIT;
356 #ifdef STRUCTURE_SIZE_BOUNDARY
357 /* Packed structures don't need to have minimum size. */
358 if (! TYPE_PACKED (rec))
359 record_align = MAX (record_align, STRUCTURE_SIZE_BOUNDARY);
362 for (field = TYPE_FIELDS (rec); field; field = TREE_CHAIN (field))
364 register int known_align = var_size ? var_align : const_size;
365 register int desired_align = 0;
367 /* If FIELD is static, then treat it like a separate variable,
368 not really like a structure field.
369 If it is a FUNCTION_DECL, it's a method.
370 In both cases, all we do is lay out the decl,
371 and we do it *after* the record is laid out. */
373 if (TREE_CODE (field) == VAR_DECL)
375 pending_statics = tree_cons (NULL_TREE, field, pending_statics);
378 /* Enumerators and enum types which are local to this class need not
379 be laid out. Likewise for initialized constant fields. */
380 if (TREE_CODE (field) != FIELD_DECL)
383 /* Lay out the field so we know what alignment it needs.
384 For a packed field, use the alignment as specified,
385 disregarding what the type would want. */
386 if (DECL_PACKED (field))
387 desired_align = DECL_ALIGN (field);
388 layout_decl (field, known_align);
389 if (! DECL_PACKED (field))
390 desired_align = DECL_ALIGN (field);
391 /* Some targets (i.e. VMS) limit struct field alignment
392 to a lower boundary than alignment of variables. */
393 #ifdef BIGGEST_FIELD_ALIGNMENT
394 desired_align = MIN (desired_align, BIGGEST_FIELD_ALIGNMENT);
396 #ifdef ADJUST_FIELD_ALIGN
397 desired_align = ADJUST_FIELD_ALIGN (field, desired_align);
400 /* Record must have at least as much alignment as any field.
401 Otherwise, the alignment of the field within the record
404 #ifndef PCC_BITFIELD_TYPE_MATTERS
405 record_align = MAX (record_align, desired_align);
407 if (PCC_BITFIELD_TYPE_MATTERS && TREE_TYPE (field) != error_mark_node
408 && DECL_BIT_FIELD_TYPE (field)
409 && ! integer_zerop (TYPE_SIZE (TREE_TYPE (field))))
411 /* For these machines, a zero-length field does not
412 affect the alignment of the structure as a whole.
413 It does, however, affect the alignment of the next field
414 within the structure. */
415 if (! integer_zerop (DECL_SIZE (field)))
416 record_align = MAX (record_align, desired_align);
417 else if (! DECL_PACKED (field))
418 desired_align = TYPE_ALIGN (TREE_TYPE (field));
419 /* A named bit field of declared type `int'
420 forces the entire structure to have `int' alignment. */
421 if (DECL_NAME (field) != 0)
423 int type_align = TYPE_ALIGN (TREE_TYPE (field));
424 if (maximum_field_alignment != 0)
425 type_align = MIN (type_align, maximum_field_alignment);
426 else if (DECL_PACKED (field))
427 type_align = MIN (type_align, BITS_PER_UNIT);
429 record_align = MAX (record_align, type_align);
433 record_align = MAX (record_align, desired_align);
436 /* Does this field automatically have alignment it needs
437 by virtue of the fields that precede it and the record's
440 if (const_size % desired_align != 0
441 || (var_align % desired_align != 0
444 /* No, we need to skip space before this field.
445 Bump the cumulative size to multiple of field alignment. */
448 || var_align % desired_align == 0)
450 = CEIL (const_size, desired_align) * desired_align;
454 var_size = size_binop (PLUS_EXPR, var_size,
455 bitsize_int (const_size, 0L));
457 var_size = round_up (var_size, desired_align);
458 var_align = MIN (var_align, desired_align);
462 #ifdef PCC_BITFIELD_TYPE_MATTERS
463 if (PCC_BITFIELD_TYPE_MATTERS
464 && TREE_CODE (field) == FIELD_DECL
465 && TREE_TYPE (field) != error_mark_node
466 && DECL_BIT_FIELD_TYPE (field)
467 && !DECL_PACKED (field)
468 && maximum_field_alignment == 0
469 && !integer_zerop (DECL_SIZE (field)))
471 int type_align = TYPE_ALIGN (TREE_TYPE (field));
472 register tree dsize = DECL_SIZE (field);
473 int field_size = TREE_INT_CST_LOW (dsize);
475 /* A bit field may not span more units of alignment of its type
476 than its type itself. Advance to next boundary if necessary. */
477 if (((const_size + field_size + type_align - 1) / type_align
478 - const_size / type_align)
479 > TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (field))) / type_align)
480 const_size = CEIL (const_size, type_align) * type_align;
484 /* No existing machine description uses this parameter.
485 So I have made it in this aspect identical to PCC_BITFIELD_TYPE_MATTERS. */
486 #ifdef BITFIELD_NBYTES_LIMITED
487 if (BITFIELD_NBYTES_LIMITED
488 && TREE_CODE (field) == FIELD_DECL
489 && TREE_TYPE (field) != error_mark_node
490 && DECL_BIT_FIELD_TYPE (field)
491 && !DECL_PACKED (field)
492 && !integer_zerop (DECL_SIZE (field)))
494 int type_align = TYPE_ALIGN (TREE_TYPE (field));
495 register tree dsize = DECL_SIZE (field);
496 int field_size = TREE_INT_CST_LOW (dsize);
498 if (maximum_field_alignment != 0)
499 type_align = MIN (type_align, maximum_field_alignment);
500 /* ??? This test is opposite the test in the containing if
501 statement, so this code is unreachable currently. */
502 else if (DECL_PACKED (field))
503 type_align = MIN (type_align, BITS_PER_UNIT);
505 /* A bit field may not span the unit of alignment of its type.
506 Advance to next boundary if necessary. */
507 /* ??? This code should match the code above for the
508 PCC_BITFIELD_TYPE_MATTERS case. */
509 if (const_size / type_align
510 != (const_size + field_size - 1) / type_align)
511 const_size = CEIL (const_size, type_align) * type_align;
515 /* Size so far becomes the position of this field. */
517 if (var_size && const_size)
518 DECL_FIELD_BITPOS (field)
519 = size_binop (PLUS_EXPR, var_size, bitsize_int (const_size, 0L));
521 DECL_FIELD_BITPOS (field) = var_size;
524 DECL_FIELD_BITPOS (field) = size_int (const_size);
526 /* If this field ended up more aligned than we thought it
527 would be (we approximate this by seeing if its position
528 changed), lay out the field again; perhaps we can use an
529 integral mode for it now. */
530 if (known_align != const_size)
531 layout_decl (field, const_size);
534 /* Now add size of this field to the size of the record. */
537 register tree dsize = DECL_SIZE (field);
539 /* This can happen when we have an invalid nested struct definition,
540 such as struct j { struct j { int i; } }. The error message is
541 printed in finish_struct. */
544 else if (TREE_CODE (dsize) == INTEGER_CST
545 && ! TREE_CONSTANT_OVERFLOW (dsize)
546 && TREE_INT_CST_HIGH (dsize) == 0
547 && TREE_INT_CST_LOW (dsize) + const_size >= const_size)
548 /* Use const_size if there's no overflow. */
549 const_size += TREE_INT_CST_LOW (dsize);
555 var_size = size_binop (PLUS_EXPR, var_size, dsize);
560 /* Work out the total size and alignment of the record
561 as one expression and store in the record type.
562 Round it up to a multiple of the record's alignment. */
566 TYPE_SIZE (rec) = size_int (const_size);
572 = size_binop (PLUS_EXPR, var_size, bitsize_int (const_size, 0L));
573 TYPE_SIZE (rec) = var_size;
576 /* Determine the desired alignment. */
577 #ifdef ROUND_TYPE_ALIGN
578 TYPE_ALIGN (rec) = ROUND_TYPE_ALIGN (rec, TYPE_ALIGN (rec), record_align);
580 TYPE_ALIGN (rec) = MAX (TYPE_ALIGN (rec), record_align);
583 /* Record the un-rounded size in the binfo node. But first we check
584 the size of TYPE_BINFO to make sure that BINFO_SIZE is available. */
585 if (TYPE_BINFO (rec) && TREE_VEC_LENGTH (TYPE_BINFO (rec)) > 6)
586 TYPE_BINFO_SIZE (rec) = TYPE_SIZE (rec);
588 #ifdef ROUND_TYPE_SIZE
589 TYPE_SIZE (rec) = ROUND_TYPE_SIZE (rec, TYPE_SIZE (rec), TYPE_ALIGN (rec));
591 /* Round the size up to be a multiple of the required alignment */
592 TYPE_SIZE (rec) = round_up (TYPE_SIZE (rec), TYPE_ALIGN (rec));
595 return pending_statics;
598 /* Lay out a UNION_TYPE or QUAL_UNION_TYPE type.
599 Lay out all the fields, set their positions to zero,
600 and compute the size and alignment of the union (maximum of any field).
601 Note that if you set the TYPE_ALIGN before calling this
602 then the union align is aligned to at least that boundary. */
609 unsigned union_align = BITS_PER_UNIT;
611 /* The size of the union, based on the fields scanned so far,
612 is max (CONST_SIZE, VAR_SIZE).
613 VAR_SIZE may be null; then CONST_SIZE by itself is the size. */
614 register int const_size = 0;
615 register tree var_size = 0;
617 #ifdef STRUCTURE_SIZE_BOUNDARY
618 /* Packed structures don't need to have minimum size. */
619 if (! TYPE_PACKED (rec))
620 union_align = STRUCTURE_SIZE_BOUNDARY;
623 /* If this is a QUAL_UNION_TYPE, we want to process the fields in
624 the reverse order in building the COND_EXPR that denotes its
625 size. We reverse them again later. */
626 if (TREE_CODE (rec) == QUAL_UNION_TYPE)
627 TYPE_FIELDS (rec) = nreverse (TYPE_FIELDS (rec));
629 for (field = TYPE_FIELDS (rec); field; field = TREE_CHAIN (field))
631 /* Enums which are local to this class need not be laid out. */
632 if (TREE_CODE (field) == CONST_DECL || TREE_CODE (field) == TYPE_DECL)
635 layout_decl (field, 0);
636 DECL_FIELD_BITPOS (field) = bitsize_int (0L, 0L);
638 /* Union must be at least as aligned as any field requires. */
640 union_align = MAX (union_align, DECL_ALIGN (field));
642 #ifdef PCC_BITFIELD_TYPE_MATTERS
643 /* On the m88000, a bit field of declare type `int'
644 forces the entire union to have `int' alignment. */
645 if (PCC_BITFIELD_TYPE_MATTERS && DECL_BIT_FIELD_TYPE (field))
646 union_align = MAX (union_align, TYPE_ALIGN (TREE_TYPE (field)));
649 if (TREE_CODE (rec) == UNION_TYPE)
651 /* Set union_size to max (decl_size, union_size).
652 There are more and less general ways to do this.
653 Use only CONST_SIZE unless forced to use VAR_SIZE. */
655 if (TREE_CODE (DECL_SIZE (field)) == INTEGER_CST)
657 = MAX (const_size, TREE_INT_CST_LOW (DECL_SIZE (field)));
658 else if (var_size == 0)
659 var_size = DECL_SIZE (field);
661 var_size = size_binop (MAX_EXPR, var_size, DECL_SIZE (field));
663 else if (TREE_CODE (rec) == QUAL_UNION_TYPE)
664 var_size = fold (build (COND_EXPR, sizetype, DECL_QUALIFIER (field),
666 var_size ? var_size : bitsize_int (0L, 0L)));
669 if (TREE_CODE (rec) == QUAL_UNION_TYPE)
670 TYPE_FIELDS (rec) = nreverse (TYPE_FIELDS (rec));
672 /* Determine the ultimate size of the union (in bytes). */
673 if (NULL == var_size)
674 TYPE_SIZE (rec) = bitsize_int (CEIL (const_size, BITS_PER_UNIT)
675 * BITS_PER_UNIT, 0L);
676 else if (const_size == 0)
677 TYPE_SIZE (rec) = var_size;
679 TYPE_SIZE (rec) = size_binop (MAX_EXPR, var_size,
680 round_up (bitsize_int (const_size, 0L),
683 /* Determine the desired alignment. */
684 #ifdef ROUND_TYPE_ALIGN
685 TYPE_ALIGN (rec) = ROUND_TYPE_ALIGN (rec, TYPE_ALIGN (rec), union_align);
687 TYPE_ALIGN (rec) = MAX (TYPE_ALIGN (rec), union_align);
690 #ifdef ROUND_TYPE_SIZE
691 TYPE_SIZE (rec) = ROUND_TYPE_SIZE (rec, TYPE_SIZE (rec), TYPE_ALIGN (rec));
693 /* Round the size up to be a multiple of the required alignment */
694 TYPE_SIZE (rec) = round_up (TYPE_SIZE (rec), TYPE_ALIGN (rec));
698 /* Calculate the mode, size, and alignment for TYPE.
699 For an array type, calculate the element separation as well.
700 Record TYPE on the chain of permanent or temporary types
701 so that dbxout will find out about it.
703 TYPE_SIZE of a type is nonzero if the type has been laid out already.
704 layout_type does nothing on such a type.
706 If the type is incomplete, its TYPE_SIZE remains zero. */
713 tree pending_statics;
718 /* Do nothing if type has been laid out before. */
719 if (TYPE_SIZE (type))
722 /* Make sure all nodes we allocate are not momentary;
723 they must last past the current statement. */
724 old = suspend_momentary ();
726 /* Put all our nodes into the same obstack as the type. Also,
727 make expressions saveable (this is a no-op for permanent types). */
729 push_obstacks (TYPE_OBSTACK (type), TYPE_OBSTACK (type));
730 saveable_allocation ();
732 switch (TREE_CODE (type))
735 /* This kind of type is the responsibility
736 of the language-specific code. */
739 case BOOLEAN_TYPE: /* Used for Java, Pascal, and Chill. */
740 if (TYPE_PRECISION (type) == 0)
741 TYPE_PRECISION (type) = 1; /* default to one byte/boolean. */
742 /* ... fall through ... */
747 if (TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST
748 && tree_int_cst_sgn (TYPE_MIN_VALUE (type)) >= 0)
749 TREE_UNSIGNED (type) = 1;
751 TYPE_MODE (type) = smallest_mode_for_size (TYPE_PRECISION (type),
753 TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)), 0L);
754 TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
758 TYPE_MODE (type) = mode_for_size (TYPE_PRECISION (type), MODE_FLOAT, 0);
759 TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)), 0L);
760 TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
764 TREE_UNSIGNED (type) = TREE_UNSIGNED (TREE_TYPE (type));
766 = mode_for_size (2 * TYPE_PRECISION (TREE_TYPE (type)),
767 (TREE_CODE (TREE_TYPE (type)) == INTEGER_TYPE
768 ? MODE_COMPLEX_INT : MODE_COMPLEX_FLOAT),
770 TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)), 0L);
771 TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
775 TYPE_SIZE (type) = size_zero_node;
776 TYPE_SIZE_UNIT (type) = size_zero_node;
777 TYPE_ALIGN (type) = 1;
778 TYPE_MODE (type) = VOIDmode;
782 TYPE_SIZE (type) = bitsize_int (POINTER_SIZE, 0L);
783 TYPE_SIZE_UNIT (type) = size_int (POINTER_SIZE / BITS_PER_UNIT);
784 TYPE_MODE (type) = ptr_mode;
789 TYPE_MODE (type) = mode_for_size (2 * POINTER_SIZE, MODE_INT, 0);
790 TYPE_SIZE (type) = bitsize_int (2 * POINTER_SIZE, 0);
791 TYPE_SIZE_UNIT (type) = size_int ((2 * POINTER_SIZE) / BITS_PER_UNIT);
796 TYPE_MODE (type) = ptr_mode;
797 TYPE_SIZE (type) = bitsize_int (POINTER_SIZE, 0L);
798 TYPE_SIZE_UNIT (type) = size_int (POINTER_SIZE / BITS_PER_UNIT);
799 TREE_UNSIGNED (type) = 1;
800 TYPE_PRECISION (type) = POINTER_SIZE;
805 register tree index = TYPE_DOMAIN (type);
806 register tree element = TREE_TYPE (type);
808 build_pointer_type (element);
810 /* We need to know both bounds in order to compute the size. */
811 if (index && TYPE_MAX_VALUE (index) && TYPE_MIN_VALUE (index)
812 && TYPE_SIZE (element))
814 tree ub = TYPE_MAX_VALUE (index);
815 tree lb = TYPE_MIN_VALUE (index);
819 /* If UB is max (lb - 1, x), remove the MAX_EXPR since the
820 test for negative below covers it. */
821 if (TREE_CODE (ub) == MAX_EXPR
822 && TREE_CODE (TREE_OPERAND (ub, 0)) == MINUS_EXPR
823 && integer_onep (TREE_OPERAND (TREE_OPERAND (ub, 0), 1))
824 && operand_equal_p (TREE_OPERAND (TREE_OPERAND (ub, 0), 0),
826 ub = TREE_OPERAND (ub, 1);
827 else if (TREE_CODE (ub) == MAX_EXPR
828 && TREE_CODE (TREE_OPERAND (ub, 1)) == MINUS_EXPR
829 && integer_onep (TREE_OPERAND (TREE_OPERAND (ub, 1), 1))
830 && operand_equal_p (TREE_OPERAND (TREE_OPERAND (ub, 1),
833 ub = TREE_OPERAND (ub, 0);
835 /* The initial subtraction should happen in the original type so
836 that (possible) negative values are handled appropriately. */
837 length = size_binop (PLUS_EXPR, size_one_node,
838 fold (build (MINUS_EXPR, TREE_TYPE (lb),
841 /* If neither bound is a constant and sizetype is signed, make
842 sure the size is never negative. We should really do this
843 if *either* bound is non-constant, but this is the best
844 compromise between C and Ada. */
845 if (! TREE_UNSIGNED (sizetype)
846 && TREE_CODE (TYPE_MIN_VALUE (index)) != INTEGER_CST
847 && TREE_CODE (TYPE_MAX_VALUE (index)) != INTEGER_CST)
848 length = size_binop (MAX_EXPR, length, size_zero_node);
850 /* Special handling for arrays of bits (for Chill). */
851 element_size = TYPE_SIZE (element);
852 if (TYPE_PACKED (type) && INTEGRAL_TYPE_P (element))
854 HOST_WIDE_INT maxvalue, minvalue;
855 maxvalue = TREE_INT_CST_LOW (TYPE_MAX_VALUE (element));
856 minvalue = TREE_INT_CST_LOW (TYPE_MIN_VALUE (element));
857 if (maxvalue - minvalue == 1
858 && (maxvalue == 1 || maxvalue == 0))
859 element_size = integer_one_node;
862 TYPE_SIZE (type) = size_binop (MULT_EXPR, element_size, length);
864 /* If we know the size of the element, calculate the total
865 size directly, rather than do some division thing below.
866 This optimization helps Fortran assumed-size arrays
867 (where the size of the array is determined at runtime)
869 Note that we can't do this in the case where the size of
870 the elements is one bit since TYPE_SIZE_UNIT cannot be
871 set correctly in that case. */
872 if (TYPE_SIZE_UNIT (element) != 0
873 && element_size != integer_one_node)
875 TYPE_SIZE_UNIT (type)
876 = size_binop (MULT_EXPR, TYPE_SIZE_UNIT (element), length);
880 /* Now round the alignment and size,
881 using machine-dependent criteria if any. */
883 #ifdef ROUND_TYPE_ALIGN
885 = ROUND_TYPE_ALIGN (type, TYPE_ALIGN (element), BITS_PER_UNIT);
887 TYPE_ALIGN (type) = MAX (TYPE_ALIGN (element), BITS_PER_UNIT);
890 #ifdef ROUND_TYPE_SIZE
891 if (TYPE_SIZE (type) != 0)
894 tmp = ROUND_TYPE_SIZE (type, TYPE_SIZE (type), TYPE_ALIGN (type));
895 /* If the rounding changed the size of the type, remove any
896 pre-calculated TYPE_SIZE_UNIT. */
897 if (simple_cst_equal (TYPE_SIZE (type), tmp) != 1)
898 TYPE_SIZE_UNIT (type) = NULL;
899 TYPE_SIZE (type) = tmp;
903 TYPE_MODE (type) = BLKmode;
904 if (TYPE_SIZE (type) != 0
905 && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
906 /* BLKmode elements force BLKmode aggregate;
907 else extract/store fields may lose. */
908 && (TYPE_MODE (TREE_TYPE (type)) != BLKmode
909 || TYPE_NO_FORCE_BLK (TREE_TYPE (type))))
912 = mode_for_size (TREE_INT_CST_LOW (TYPE_SIZE (type)),
915 if (STRICT_ALIGNMENT && TYPE_ALIGN (type) < BIGGEST_ALIGNMENT
916 && TYPE_ALIGN (type) < TREE_INT_CST_LOW (TYPE_SIZE (type))
917 && TYPE_MODE (type) != BLKmode)
919 TYPE_NO_FORCE_BLK (type) = 1;
920 TYPE_MODE (type) = BLKmode;
927 pending_statics = layout_record (type);
928 TYPE_MODE (type) = BLKmode;
929 if (TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST)
932 enum machine_mode mode = VOIDmode;
934 /* A record which has any BLKmode members must itself be BLKmode;
935 it can't go in a register.
936 Unless the member is BLKmode only because it isn't aligned. */
937 for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
941 if (TREE_CODE (field) != FIELD_DECL)
944 if (TYPE_MODE (TREE_TYPE (field)) == BLKmode
945 && ! TYPE_NO_FORCE_BLK (TREE_TYPE (field)))
948 if (TREE_CODE (DECL_FIELD_BITPOS (field)) != INTEGER_CST)
951 bitpos = TREE_INT_CST_LOW (DECL_FIELD_BITPOS (field));
953 /* Must be BLKmode if any field crosses a word boundary,
954 since extract_bit_field can't handle that in registers. */
955 if (bitpos / BITS_PER_WORD
956 != ((TREE_INT_CST_LOW (DECL_SIZE (field)) + bitpos - 1)
958 /* But there is no problem if the field is entire words. */
959 && TREE_INT_CST_LOW (DECL_SIZE (field)) % BITS_PER_WORD != 0)
962 /* If this field is the whole struct, remember its mode so
963 that, say, we can put a double in a class into a DF
964 register instead of forcing it to live in the stack. */
965 if (simple_cst_equal (TYPE_SIZE (type), DECL_SIZE (field)))
966 mode = DECL_MODE (field);
969 if (mode != VOIDmode)
970 /* We only have one real field; use its mode. */
971 TYPE_MODE (type) = mode;
974 = mode_for_size (TREE_INT_CST_LOW (TYPE_SIZE (type)),
977 /* If structure's known alignment is less than
978 what the scalar mode would need, and it matters,
979 then stick with BLKmode. */
981 && ! (TYPE_ALIGN (type) >= BIGGEST_ALIGNMENT
982 || (TYPE_ALIGN (type)
983 >= TREE_INT_CST_LOW (TYPE_SIZE (type)))))
985 if (TYPE_MODE (type) != BLKmode)
986 /* If this is the only reason this type is BLKmode,
987 then don't force containing types to be BLKmode. */
988 TYPE_NO_FORCE_BLK (type) = 1;
989 TYPE_MODE (type) = BLKmode;
995 /* Lay out any static members. This is done now
996 because their type may use the record's type. */
997 while (pending_statics)
999 layout_decl (TREE_VALUE (pending_statics), 0);
1000 pending_statics = TREE_CHAIN (pending_statics);
1005 case QUAL_UNION_TYPE:
1006 layout_union (type);
1007 TYPE_MODE (type) = BLKmode;
1008 if (TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
1009 /* If structure's known alignment is less than
1010 what the scalar mode would need, and it matters,
1011 then stick with BLKmode. */
1012 && (! STRICT_ALIGNMENT
1013 || TYPE_ALIGN (type) >= BIGGEST_ALIGNMENT
1014 || TYPE_ALIGN (type) >= TREE_INT_CST_LOW (TYPE_SIZE (type))))
1017 /* A union which has any BLKmode members must itself be BLKmode;
1018 it can't go in a register.
1019 Unless the member is BLKmode only because it isn't aligned. */
1020 for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
1022 if (TREE_CODE (field) != FIELD_DECL)
1025 if (TYPE_MODE (TREE_TYPE (field)) == BLKmode
1026 && ! TYPE_NO_FORCE_BLK (TREE_TYPE (field)))
1031 = mode_for_size (TREE_INT_CST_LOW (TYPE_SIZE (type)),
1038 case SET_TYPE: /* Used by Chill and Pascal. */
1039 if (TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) != INTEGER_CST
1040 || TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) != INTEGER_CST)
1044 #ifndef SET_WORD_SIZE
1045 #define SET_WORD_SIZE BITS_PER_WORD
1047 int alignment = set_alignment ? set_alignment : SET_WORD_SIZE;
1049 = (TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))
1050 - TREE_INT_CST_LOW (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) + 1);
1052 = ((size_in_bits + alignment - 1) / alignment) * alignment;
1053 if (rounded_size > alignment)
1054 TYPE_MODE (type) = BLKmode;
1056 TYPE_MODE (type) = mode_for_size (alignment, MODE_INT, 1);
1057 TYPE_SIZE (type) = bitsize_int (rounded_size, 0L);
1058 TYPE_SIZE_UNIT (type) = size_int (rounded_size / BITS_PER_UNIT);
1059 TYPE_ALIGN (type) = alignment;
1060 TYPE_PRECISION (type) = size_in_bits;
1065 /* The size may vary in different languages, so the language front end
1066 should fill in the size. */
1067 TYPE_ALIGN (type) = BIGGEST_ALIGNMENT;
1068 TYPE_MODE (type) = BLKmode;
1075 /* Normally, use the alignment corresponding to the mode chosen.
1076 However, where strict alignment is not required, avoid
1077 over-aligning structures, since most compilers do not do this
1080 if (TYPE_MODE (type) != BLKmode && TYPE_MODE (type) != VOIDmode
1081 && (STRICT_ALIGNMENT
1082 || (TREE_CODE (type) != RECORD_TYPE && TREE_CODE (type) != UNION_TYPE
1083 && TREE_CODE (type) != QUAL_UNION_TYPE
1084 && TREE_CODE (type) != ARRAY_TYPE)))
1085 TYPE_ALIGN (type) = GET_MODE_ALIGNMENT (TYPE_MODE (type));
1087 /* Evaluate nonconstant size only once, either now or as soon as safe. */
1088 if (TYPE_SIZE (type) != 0 && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
1089 TYPE_SIZE (type) = variable_size (TYPE_SIZE (type));
1091 /* If we failed to find a simple way to calculate the unit size
1092 of the type above, find it by division. */
1093 if (TYPE_SIZE_UNIT (type) == 0 && TYPE_SIZE (type) != 0)
1095 TYPE_SIZE_UNIT (type) = size_binop (FLOOR_DIV_EXPR, TYPE_SIZE (type),
1096 size_int (BITS_PER_UNIT));
1099 /* Once again evaluate only once, either now or as soon as safe. */
1100 if (TYPE_SIZE_UNIT (type) != 0
1101 && TREE_CODE (TYPE_SIZE_UNIT (type)) != INTEGER_CST)
1102 TYPE_SIZE_UNIT (type) = variable_size (TYPE_SIZE_UNIT (type));
1104 /* Also layout any other variants of the type. */
1105 if (TYPE_NEXT_VARIANT (type)
1106 || type != TYPE_MAIN_VARIANT (type))
1109 /* Record layout info of this variant. */
1110 tree size = TYPE_SIZE (type);
1111 tree size_unit = TYPE_SIZE_UNIT (type);
1112 int align = TYPE_ALIGN (type);
1113 enum machine_mode mode = TYPE_MODE (type);
1115 /* Copy it into all variants. */
1116 for (variant = TYPE_MAIN_VARIANT (type);
1118 variant = TYPE_NEXT_VARIANT (variant))
1120 TYPE_SIZE (variant) = size;
1121 TYPE_SIZE_UNIT (variant) = size_unit;
1122 TYPE_ALIGN (variant) = align;
1123 TYPE_MODE (variant) = mode;
1128 resume_momentary (old);
1131 /* Create and return a type for signed integers of PRECISION bits. */
1134 make_signed_type (precision)
1137 register tree type = make_node (INTEGER_TYPE);
1139 TYPE_PRECISION (type) = precision;
1141 /* Create the extreme values based on the number of bits. */
1143 TYPE_MIN_VALUE (type)
1144 = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
1145 ? 0 : (HOST_WIDE_INT) (-1) << (precision - 1)),
1146 (((HOST_WIDE_INT) (-1)
1147 << (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
1148 ? precision - HOST_BITS_PER_WIDE_INT - 1
1150 TYPE_MAX_VALUE (type)
1151 = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
1152 ? -1 : ((HOST_WIDE_INT) 1 << (precision - 1)) - 1),
1153 (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
1154 ? (((HOST_WIDE_INT) 1
1155 << (precision - HOST_BITS_PER_WIDE_INT - 1))) - 1
1158 /* Give this type's extreme values this type as their type. */
1160 TREE_TYPE (TYPE_MIN_VALUE (type)) = type;
1161 TREE_TYPE (TYPE_MAX_VALUE (type)) = type;
1163 /* The first type made with this or `make_unsigned_type'
1164 is the type for size values. */
1167 set_sizetype (type);
1169 /* Lay out the type: set its alignment, size, etc. */
1176 /* Create and return a type for unsigned integers of PRECISION bits. */
1179 make_unsigned_type (precision)
1182 register tree type = make_node (INTEGER_TYPE);
1184 TYPE_PRECISION (type) = precision;
1186 /* The first type made with this or `make_signed_type'
1187 is the type for size values. */
1191 TREE_UNSIGNED (type) = 1;
1192 set_sizetype (type);
1195 fixup_unsigned_type (type);
1199 /* Set sizetype to TYPE, and initialize *sizetype accordingly.
1200 Also update the type of any standard type's sizes made so far. */
1206 int oprecision = TYPE_PRECISION (type), precision;
1210 /* The *bitsizetype types use a precision that avoids overflows when
1211 calculating signed sizes / offsets in bits.
1213 We are allocating bitsizetype once and change it in place when
1214 we decide later that we want to change it. This way, we avoid the
1215 hassle of changing all the TYPE_SIZE (TREE_TYPE (sometype))
1216 individually in each front end. */
1218 bitsizetype = make_node (INTEGER_TYPE);
1219 if (TYPE_NAME (sizetype) && ! TYPE_NAME (bitsizetype))
1220 TYPE_NAME (bitsizetype) = TYPE_NAME (sizetype);
1222 precision = oprecision + BITS_PER_UNIT_LOG + 1;
1223 /* However, when cross-compiling from a 32 bit to a 64 bit host,
1224 we are limited to 64 bit precision. */
1225 if (precision > 2 * HOST_BITS_PER_WIDE_INT)
1226 precision = 2 * HOST_BITS_PER_WIDE_INT;
1227 TYPE_PRECISION (bitsizetype) = precision;
1228 if (TREE_UNSIGNED (type))
1229 fixup_unsigned_type (bitsizetype);
1231 fixup_signed_type (bitsizetype);
1232 layout_type (bitsizetype);
1234 if (TREE_UNSIGNED (type))
1236 usizetype = sizetype;
1237 ubitsizetype = bitsizetype;
1238 ssizetype = make_signed_type (oprecision);
1239 sbitsizetype = make_signed_type (precision);
1243 ssizetype = sizetype;
1244 sbitsizetype = bitsizetype;
1245 usizetype = make_unsigned_type (oprecision);
1246 ubitsizetype = make_unsigned_type (precision);
1250 /* Set the extreme values of TYPE based on its precision in bits,
1251 then lay it out. Used when make_signed_type won't do
1252 because the tree code is not INTEGER_TYPE.
1253 E.g. for Pascal, when the -fsigned-char option is given. */
1256 fixup_signed_type (type)
1259 register int precision = TYPE_PRECISION (type);
1261 TYPE_MIN_VALUE (type)
1262 = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
1263 ? 0 : (HOST_WIDE_INT) (-1) << (precision - 1)),
1264 (((HOST_WIDE_INT) (-1)
1265 << (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
1266 ? precision - HOST_BITS_PER_WIDE_INT - 1
1268 TYPE_MAX_VALUE (type)
1269 = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
1270 ? -1 : ((HOST_WIDE_INT) 1 << (precision - 1)) - 1),
1271 (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
1272 ? (((HOST_WIDE_INT) 1
1273 << (precision - HOST_BITS_PER_WIDE_INT - 1))) - 1
1276 TREE_TYPE (TYPE_MIN_VALUE (type)) = type;
1277 TREE_TYPE (TYPE_MAX_VALUE (type)) = type;
1279 /* Lay out the type: set its alignment, size, etc. */
1284 /* Set the extreme values of TYPE based on its precision in bits,
1285 then lay it out. This is used both in `make_unsigned_type'
1286 and for enumeral types. */
1289 fixup_unsigned_type (type)
1292 register int precision = TYPE_PRECISION (type);
1294 TYPE_MIN_VALUE (type) = build_int_2 (0, 0);
1295 TYPE_MAX_VALUE (type)
1296 = build_int_2 (precision - HOST_BITS_PER_WIDE_INT >= 0
1297 ? -1 : ((HOST_WIDE_INT) 1 << precision) - 1,
1298 precision - HOST_BITS_PER_WIDE_INT > 0
1299 ? ((unsigned HOST_WIDE_INT) ~0
1300 >> (HOST_BITS_PER_WIDE_INT
1301 - (precision - HOST_BITS_PER_WIDE_INT)))
1303 TREE_TYPE (TYPE_MIN_VALUE (type)) = type;
1304 TREE_TYPE (TYPE_MAX_VALUE (type)) = type;
1306 /* Lay out the type: set its alignment, size, etc. */
1311 /* Find the best machine mode to use when referencing a bit field of length
1312 BITSIZE bits starting at BITPOS.
1314 The underlying object is known to be aligned to a boundary of ALIGN bits.
1315 If LARGEST_MODE is not VOIDmode, it means that we should not use a mode
1316 larger than LARGEST_MODE (usually SImode).
1318 If no mode meets all these conditions, we return VOIDmode. Otherwise, if
1319 VOLATILEP is true or SLOW_BYTE_ACCESS is false, we return the smallest
1320 mode meeting these conditions.
1322 Otherwise (VOLATILEP is false and SLOW_BYTE_ACCESS is true), we return
1323 the largest mode (but a mode no wider than UNITS_PER_WORD) that meets
1324 all the conditions. */
1327 get_best_mode (bitsize, bitpos, align, largest_mode, volatilep)
1328 int bitsize, bitpos;
1330 enum machine_mode largest_mode;
1333 enum machine_mode mode;
1336 /* Find the narrowest integer mode that contains the bit field. */
1337 for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); mode != VOIDmode;
1338 mode = GET_MODE_WIDER_MODE (mode))
1340 unit = GET_MODE_BITSIZE (mode);
1341 if ((bitpos % unit) + bitsize <= unit)
1345 if (mode == MAX_MACHINE_MODE
1346 /* It is tempting to omit the following line
1347 if STRICT_ALIGNMENT is true.
1348 But that is incorrect, since if the bitfield uses part of 3 bytes
1349 and we use a 4-byte mode, we could get a spurious segv
1350 if the extra 4th byte is past the end of memory.
1351 (Though at least one Unix compiler ignores this problem:
1352 that on the Sequent 386 machine. */
1353 || MIN (unit, BIGGEST_ALIGNMENT) > align
1354 || (largest_mode != VOIDmode && unit > GET_MODE_BITSIZE (largest_mode)))
1357 if (SLOW_BYTE_ACCESS && ! volatilep)
1359 enum machine_mode wide_mode = VOIDmode, tmode;
1361 for (tmode = GET_CLASS_NARROWEST_MODE (MODE_INT); tmode != VOIDmode;
1362 tmode = GET_MODE_WIDER_MODE (tmode))
1364 unit = GET_MODE_BITSIZE (tmode);
1365 if (bitpos / unit == (bitpos + bitsize - 1) / unit
1366 && unit <= BITS_PER_WORD
1367 && unit <= MIN (align, BIGGEST_ALIGNMENT)
1368 && (largest_mode == VOIDmode
1369 || unit <= GET_MODE_BITSIZE (largest_mode)))
1373 if (wide_mode != VOIDmode)
1380 /* Save all variables describing the current status into the structure *P.
1381 This is used before starting a nested function. */
1384 save_storage_status (p)
1385 struct function *p ATTRIBUTE_UNUSED;
1387 #if 0 /* Need not save, since always 0 and non0 (resp.) within a function. */
1388 p->pending_sizes = pending_sizes;
1389 p->immediate_size_expand = immediate_size_expand;
1393 /* Restore all variables describing the current status from the structure *P.
1394 This is used after a nested function. */
1397 restore_storage_status (p)
1398 struct function *p ATTRIBUTE_UNUSED;
1401 pending_sizes = p->pending_sizes;
1402 immediate_size_expand = p->immediate_size_expand;