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. */
32 #define CEIL(x,y) (((x) + (y) - 1) / (y))
34 /* Data type for the expressions representing sizes of data types.
35 It is the first integer type laid out. */
37 struct sizetype_tab sizetype_tab;
39 /* An integer constant with value 0 whose type is sizetype. */
43 /* An integer constant with value 1 whose type is sizetype. */
47 /* If nonzero, this is an upper limit on alignment of structure fields.
48 The value is measured in bits. */
49 int maximum_field_alignment;
51 /* If non-zero, the alignment of a bitstring or (power-)set value, in bits.
52 May be overridden by front-ends. */
53 int set_alignment = 0;
55 static tree layout_record PROTO((tree));
56 static void layout_union PROTO((tree));
58 /* SAVE_EXPRs for sizes of types and decls, waiting to be expanded. */
60 static tree pending_sizes;
62 /* Nonzero means cannot safely call expand_expr now,
63 so put variable sizes onto `pending_sizes' instead. */
65 int immediate_size_expand;
70 tree chain = pending_sizes;
73 /* Put each SAVE_EXPR into the current function. */
74 for (t = chain; t; t = TREE_CHAIN (t))
75 SAVE_EXPR_CONTEXT (TREE_VALUE (t)) = current_function_decl;
81 put_pending_sizes (chain)
87 pending_sizes = chain;
90 /* Given a size SIZE that may not be a constant, return a SAVE_EXPR
91 to serve as the actual size-expression for a type or decl. */
97 /* If the language-processor is to take responsibility for variable-sized
98 items (e.g., languages which have elaboration procedures like Ada),
99 just return SIZE unchanged. Likewise for self-referential sizes. */
100 if (TREE_CONSTANT (size)
101 || global_bindings_p () < 0 || contains_placeholder_p (size))
104 size = save_expr (size);
106 if (global_bindings_p ())
108 if (TREE_CONSTANT (size))
109 error ("type size can't be explicitly evaluated");
111 error ("variable-size type declared outside of any function");
116 if (immediate_size_expand)
117 /* NULL_RTX is not defined; neither is the rtx type.
118 Also, we would like to pass const0_rtx here, but don't have it. */
119 expand_expr (size, expand_expr (integer_zero_node, NULL_PTR, VOIDmode, 0),
122 pending_sizes = tree_cons (NULL_TREE, size, pending_sizes);
127 #ifndef MAX_FIXED_MODE_SIZE
128 #define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (DImode)
131 /* Return the machine mode to use for a nonscalar of SIZE bits.
132 The mode must be in class CLASS, and have exactly that many bits.
133 If LIMIT is nonzero, modes of wider than MAX_FIXED_MODE_SIZE will not
137 mode_for_size (size, class, limit)
139 enum mode_class class;
142 register enum machine_mode mode;
144 if (limit && size > (unsigned int)(MAX_FIXED_MODE_SIZE))
147 /* Get the first mode which has this size, in the specified class. */
148 for (mode = GET_CLASS_NARROWEST_MODE (class); mode != VOIDmode;
149 mode = GET_MODE_WIDER_MODE (mode))
150 if ((unsigned int)GET_MODE_BITSIZE (mode) == size)
156 /* Similar, but never return BLKmode; return the narrowest mode that
157 contains at least the requested number of bits. */
160 smallest_mode_for_size (size, class)
162 enum mode_class class;
164 register enum machine_mode mode;
166 /* Get the first mode which has at least this size, in the
168 for (mode = GET_CLASS_NARROWEST_MODE (class); mode != VOIDmode;
169 mode = GET_MODE_WIDER_MODE (mode))
170 if ((unsigned int)GET_MODE_BITSIZE (mode) >= size)
176 /* Find an integer mode of the exact same size, or BLKmode on failure. */
179 int_mode_for_mode (mode)
180 enum machine_mode mode;
182 switch (GET_MODE_CLASS (mode))
185 case MODE_PARTIAL_INT:
188 case MODE_COMPLEX_INT:
189 case MODE_COMPLEX_FLOAT:
191 mode = mode_for_size (GET_MODE_BITSIZE (mode), MODE_INT, 0);
207 /* Return the value of VALUE, rounded up to a multiple of DIVISOR. */
210 round_up (value, divisor)
214 return size_binop (MULT_EXPR,
215 size_binop (CEIL_DIV_EXPR, value, size_int (divisor)),
219 /* Set the size, mode and alignment of a ..._DECL node.
220 TYPE_DECL does need this for C++.
221 Note that LABEL_DECL and CONST_DECL nodes do not need this,
222 and FUNCTION_DECL nodes have them set up in a special (and simple) way.
223 Don't call layout_decl for them.
225 KNOWN_ALIGN is the amount of alignment we can assume this
226 decl has with no special effort. It is relevant only for FIELD_DECLs
227 and depends on the previous fields.
228 All that matters about KNOWN_ALIGN is which powers of 2 divide it.
229 If KNOWN_ALIGN is 0, it means, "as much alignment as you like":
230 the record will be aligned to suit. */
233 layout_decl (decl, known_align)
235 unsigned known_align;
237 register tree type = TREE_TYPE (decl);
238 register enum tree_code code = TREE_CODE (decl);
239 int spec_size = DECL_FIELD_SIZE (decl);
241 if (code == CONST_DECL)
244 if (code != VAR_DECL && code != PARM_DECL && code != RESULT_DECL
245 && code != FIELD_DECL && code != TYPE_DECL)
248 if (type == error_mark_node)
250 type = void_type_node;
254 /* Usually the size and mode come from the data type without change. */
256 DECL_MODE (decl) = TYPE_MODE (type);
257 TREE_UNSIGNED (decl) = TREE_UNSIGNED (type);
258 if (DECL_SIZE (decl) == 0)
259 DECL_SIZE (decl) = TYPE_SIZE (type);
261 if (code == FIELD_DECL && DECL_BIT_FIELD (decl))
263 if (spec_size == 0 && DECL_NAME (decl) != 0)
266 /* Size is specified number of bits. */
267 DECL_SIZE (decl) = size_int (spec_size);
269 /* Force alignment required for the data type.
270 But if the decl itself wants greater alignment, don't override that.
271 Likewise, if the decl is packed, don't override it. */
272 else if (DECL_ALIGN (decl) == 0
273 || (! DECL_PACKED (decl) && TYPE_ALIGN (type) > DECL_ALIGN (decl)))
274 DECL_ALIGN (decl) = TYPE_ALIGN (type);
276 /* See if we can use an ordinary integer mode for a bit-field. */
277 /* Conditions are: a fixed size that is correct for another mode
278 and occupying a complete byte or bytes on proper boundary. */
279 if (code == FIELD_DECL)
281 DECL_BIT_FIELD_TYPE (decl) = DECL_BIT_FIELD (decl) ? type : 0;
282 if (maximum_field_alignment != 0)
283 DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl),
284 (unsigned)maximum_field_alignment);
285 else if (DECL_PACKED (decl))
286 DECL_ALIGN (decl) = MIN (DECL_ALIGN (decl), BITS_PER_UNIT);
289 if (DECL_BIT_FIELD (decl)
290 && TYPE_SIZE (type) != 0
291 && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
292 && GET_MODE_CLASS (TYPE_MODE (type)) == MODE_INT)
294 register enum machine_mode xmode
295 = mode_for_size (TREE_INT_CST_LOW (DECL_SIZE (decl)), MODE_INT, 1);
298 && known_align % GET_MODE_ALIGNMENT (xmode) == 0)
300 DECL_ALIGN (decl) = MAX ((unsigned) GET_MODE_ALIGNMENT (xmode),
302 DECL_MODE (decl) = xmode;
303 DECL_SIZE (decl) = size_int (GET_MODE_BITSIZE (xmode));
304 /* This no longer needs to be accessed as a bit field. */
305 DECL_BIT_FIELD (decl) = 0;
309 /* Turn off DECL_BIT_FIELD if we won't need it set. */
310 if (DECL_BIT_FIELD (decl) && TYPE_MODE (type) == BLKmode
311 && known_align % TYPE_ALIGN (type) == 0
312 && DECL_SIZE (decl) != 0
313 && (TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST
314 || (TREE_INT_CST_LOW (DECL_SIZE (decl)) % BITS_PER_UNIT) == 0)
315 && DECL_ALIGN (decl) >= TYPE_ALIGN (type))
316 DECL_BIT_FIELD (decl) = 0;
318 /* Evaluate nonconstant size only once, either now or as soon as safe. */
319 if (DECL_SIZE (decl) != 0 && TREE_CODE (DECL_SIZE (decl)) != INTEGER_CST)
320 DECL_SIZE (decl) = variable_size (DECL_SIZE (decl));
323 /* Lay out a RECORD_TYPE type (a C struct).
324 This means laying out the fields, determining their positions,
325 and computing the overall size and required alignment of the record.
326 Note that if you set the TYPE_ALIGN before calling this
327 then the struct is aligned to at least that boundary.
329 If the type has basetypes, you must call layout_basetypes
330 before calling this function.
332 The return value is a list of static members of the record.
333 They still need to be laid out. */
340 unsigned record_align = MAX (BITS_PER_UNIT, TYPE_ALIGN (rec));
341 /* These must be laid out *after* the record is. */
342 tree pending_statics = NULL_TREE;
343 /* Record size so far is CONST_SIZE + VAR_SIZE bits,
344 where CONST_SIZE is an integer
345 and VAR_SIZE is a tree expression.
346 If VAR_SIZE is null, the size is just CONST_SIZE.
347 Naturally we try to avoid using VAR_SIZE. */
348 register HOST_WIDE_INT const_size = 0;
349 register tree var_size = 0;
350 /* Once we start using VAR_SIZE, this is the maximum alignment
351 that we know VAR_SIZE has. */
352 register int var_align = BITS_PER_UNIT;
354 #ifdef STRUCTURE_SIZE_BOUNDARY
355 /* Packed structures don't need to have minimum size. */
356 if (! TYPE_PACKED (rec))
357 record_align = MAX (record_align, STRUCTURE_SIZE_BOUNDARY);
360 for (field = TYPE_FIELDS (rec); field; field = TREE_CHAIN (field))
362 register int known_align = var_size ? var_align : const_size;
363 register int desired_align = 0;
365 /* If FIELD is static, then treat it like a separate variable,
366 not really like a structure field.
367 If it is a FUNCTION_DECL, it's a method.
368 In both cases, all we do is lay out the decl,
369 and we do it *after* the record is laid out. */
371 if (TREE_CODE (field) == VAR_DECL)
373 pending_statics = tree_cons (NULL_TREE, field, pending_statics);
376 /* Enumerators and enum types which are local to this class need not
377 be laid out. Likewise for initialized constant fields. */
378 if (TREE_CODE (field) != FIELD_DECL)
381 /* Lay out the field so we know what alignment it needs.
382 For a packed field, use the alignment as specified,
383 disregarding what the type would want. */
384 if (DECL_PACKED (field))
385 desired_align = DECL_ALIGN (field);
386 layout_decl (field, known_align);
387 if (! DECL_PACKED (field))
388 desired_align = DECL_ALIGN (field);
389 /* Some targets (i.e. VMS) limit struct field alignment
390 to a lower boundary than alignment of variables. */
391 #ifdef BIGGEST_FIELD_ALIGNMENT
392 desired_align = MIN (desired_align, BIGGEST_FIELD_ALIGNMENT);
394 #ifdef ADJUST_FIELD_ALIGN
395 desired_align = ADJUST_FIELD_ALIGN (field, desired_align);
398 /* Record must have at least as much alignment as any field.
399 Otherwise, the alignment of the field within the record
402 #ifndef PCC_BITFIELD_TYPE_MATTERS
403 record_align = MAX (record_align, desired_align);
405 if (PCC_BITFIELD_TYPE_MATTERS && TREE_TYPE (field) != error_mark_node
406 && DECL_BIT_FIELD_TYPE (field)
407 && ! integer_zerop (TYPE_SIZE (TREE_TYPE (field))))
409 /* For these machines, a zero-length field does not
410 affect the alignment of the structure as a whole.
411 It does, however, affect the alignment of the next field
412 within the structure. */
413 if (! integer_zerop (DECL_SIZE (field)))
414 record_align = MAX ((int)record_align, desired_align);
415 else if (! DECL_PACKED (field))
416 desired_align = TYPE_ALIGN (TREE_TYPE (field));
417 /* A named bit field of declared type `int'
418 forces the entire structure to have `int' alignment. */
419 if (DECL_NAME (field) != 0)
421 int type_align = TYPE_ALIGN (TREE_TYPE (field));
422 if (maximum_field_alignment != 0)
423 type_align = MIN (type_align, maximum_field_alignment);
424 else if (DECL_PACKED (field))
425 type_align = MIN (type_align, BITS_PER_UNIT);
427 record_align = MAX ((int)record_align, type_align);
431 record_align = MAX ((int)record_align, desired_align);
434 /* Does this field automatically have alignment it needs
435 by virtue of the fields that precede it and the record's
438 if (const_size % desired_align != 0
439 || (var_align % desired_align != 0
442 /* No, we need to skip space before this field.
443 Bump the cumulative size to multiple of field alignment. */
446 || var_align % desired_align == 0)
448 = CEIL (const_size, desired_align) * desired_align;
452 var_size = size_binop (PLUS_EXPR, var_size,
453 bitsize_int (const_size, 0L));
455 var_size = round_up (var_size, desired_align);
456 var_align = MIN (var_align, desired_align);
460 #ifdef PCC_BITFIELD_TYPE_MATTERS
461 if (PCC_BITFIELD_TYPE_MATTERS
462 && TREE_CODE (field) == FIELD_DECL
463 && TREE_TYPE (field) != error_mark_node
464 && DECL_BIT_FIELD_TYPE (field)
465 && !DECL_PACKED (field)
466 && maximum_field_alignment == 0
467 && !integer_zerop (DECL_SIZE (field)))
469 int type_align = TYPE_ALIGN (TREE_TYPE (field));
470 register tree dsize = DECL_SIZE (field);
471 int field_size = TREE_INT_CST_LOW (dsize);
473 /* A bit field may not span more units of alignment of its type
474 than its type itself. Advance to next boundary if necessary. */
475 if (((const_size + field_size + type_align - 1) / type_align
476 - const_size / type_align)
477 > TREE_INT_CST_LOW (TYPE_SIZE (TREE_TYPE (field))) / type_align)
478 const_size = CEIL (const_size, type_align) * type_align;
482 /* No existing machine description uses this parameter.
483 So I have made it in this aspect identical to PCC_BITFIELD_TYPE_MATTERS. */
484 #ifdef BITFIELD_NBYTES_LIMITED
485 if (BITFIELD_NBYTES_LIMITED
486 && TREE_CODE (field) == FIELD_DECL
487 && TREE_TYPE (field) != error_mark_node
488 && DECL_BIT_FIELD_TYPE (field)
489 && !DECL_PACKED (field)
490 && !integer_zerop (DECL_SIZE (field)))
492 int type_align = TYPE_ALIGN (TREE_TYPE (field));
493 register tree dsize = DECL_SIZE (field);
494 int field_size = TREE_INT_CST_LOW (dsize);
496 if (maximum_field_alignment != 0)
497 type_align = MIN (type_align, maximum_field_alignment);
498 /* ??? This test is opposite the test in the containing if
499 statement, so this code is unreachable currently. */
500 else if (DECL_PACKED (field))
501 type_align = MIN (type_align, BITS_PER_UNIT);
503 /* A bit field may not span the unit of alignment of its type.
504 Advance to next boundary if necessary. */
505 /* ??? This code should match the code above for the
506 PCC_BITFIELD_TYPE_MATTERS case. */
507 if (const_size / type_align
508 != (const_size + field_size - 1) / type_align)
509 const_size = CEIL (const_size, type_align) * type_align;
513 /* Size so far becomes the position of this field. */
515 if (var_size && const_size)
516 DECL_FIELD_BITPOS (field)
517 = size_binop (PLUS_EXPR, var_size, bitsize_int (const_size, 0L));
519 DECL_FIELD_BITPOS (field) = var_size;
522 DECL_FIELD_BITPOS (field) = size_int (const_size);
524 /* If this field ended up more aligned than we thought it
525 would be (we approximate this by seeing if its position
526 changed), lay out the field again; perhaps we can use an
527 integral mode for it now. */
528 if (known_align != const_size)
529 layout_decl (field, const_size);
532 /* Now add size of this field to the size of the record. */
535 register tree dsize = DECL_SIZE (field);
537 /* This can happen when we have an invalid nested struct definition,
538 such as struct j { struct j { int i; } }. The error message is
539 printed in finish_struct. */
542 else if (TREE_CODE (dsize) == INTEGER_CST
543 && ! TREE_CONSTANT_OVERFLOW (dsize)
544 && TREE_INT_CST_HIGH (dsize) == 0
545 && TREE_INT_CST_LOW (dsize) + const_size >= const_size)
546 /* Use const_size if there's no overflow. */
547 const_size += TREE_INT_CST_LOW (dsize);
553 var_size = size_binop (PLUS_EXPR, var_size, dsize);
558 /* Work out the total size and alignment of the record
559 as one expression and store in the record type.
560 Round it up to a multiple of the record's alignment. */
564 TYPE_SIZE (rec) = size_int (const_size);
570 = size_binop (PLUS_EXPR, var_size, bitsize_int (const_size, 0L));
571 TYPE_SIZE (rec) = var_size;
574 /* Determine the desired alignment. */
575 #ifdef ROUND_TYPE_ALIGN
576 TYPE_ALIGN (rec) = ROUND_TYPE_ALIGN (rec, TYPE_ALIGN (rec), record_align);
578 TYPE_ALIGN (rec) = MAX (TYPE_ALIGN (rec), record_align);
581 /* Record the un-rounded size in the binfo node. But first we check
582 the size of TYPE_BINFO to make sure that BINFO_SIZE is available. */
583 if (TYPE_BINFO (rec) && TREE_VEC_LENGTH (TYPE_BINFO (rec)) > 6)
584 TYPE_BINFO_SIZE (rec) = TYPE_SIZE (rec);
586 #ifdef ROUND_TYPE_SIZE
587 TYPE_SIZE (rec) = ROUND_TYPE_SIZE (rec, TYPE_SIZE (rec), TYPE_ALIGN (rec));
589 /* Round the size up to be a multiple of the required alignment */
590 TYPE_SIZE (rec) = round_up (TYPE_SIZE (rec), TYPE_ALIGN (rec));
593 return pending_statics;
596 /* Lay out a UNION_TYPE or QUAL_UNION_TYPE type.
597 Lay out all the fields, set their positions to zero,
598 and compute the size and alignment of the union (maximum of any field).
599 Note that if you set the TYPE_ALIGN before calling this
600 then the union align is aligned to at least that boundary. */
607 unsigned union_align = BITS_PER_UNIT;
609 /* The size of the union, based on the fields scanned so far,
610 is max (CONST_SIZE, VAR_SIZE).
611 VAR_SIZE may be null; then CONST_SIZE by itself is the size. */
612 register int const_size = 0;
613 register tree var_size = 0;
615 #ifdef STRUCTURE_SIZE_BOUNDARY
616 /* Packed structures don't need to have minimum size. */
617 if (! TYPE_PACKED (rec))
618 union_align = STRUCTURE_SIZE_BOUNDARY;
621 /* If this is a QUAL_UNION_TYPE, we want to process the fields in
622 the reverse order in building the COND_EXPR that denotes its
623 size. We reverse them again later. */
624 if (TREE_CODE (rec) == QUAL_UNION_TYPE)
625 TYPE_FIELDS (rec) = nreverse (TYPE_FIELDS (rec));
627 for (field = TYPE_FIELDS (rec); field; field = TREE_CHAIN (field))
629 /* Enums which are local to this class need not be laid out. */
630 if (TREE_CODE (field) == CONST_DECL || TREE_CODE (field) == TYPE_DECL)
633 layout_decl (field, 0);
634 DECL_FIELD_BITPOS (field) = bitsize_int (0L, 0L);
636 /* Union must be at least as aligned as any field requires. */
638 union_align = MAX (union_align, DECL_ALIGN (field));
640 #ifdef PCC_BITFIELD_TYPE_MATTERS
641 /* On the m88000, a bit field of declare type `int'
642 forces the entire union to have `int' alignment. */
643 if (PCC_BITFIELD_TYPE_MATTERS && DECL_BIT_FIELD_TYPE (field))
644 union_align = MAX (union_align, TYPE_ALIGN (TREE_TYPE (field)));
647 if (TREE_CODE (rec) == UNION_TYPE)
649 /* Set union_size to max (decl_size, union_size).
650 There are more and less general ways to do this.
651 Use only CONST_SIZE unless forced to use VAR_SIZE. */
653 if (TREE_CODE (DECL_SIZE (field)) == INTEGER_CST)
655 = MAX (const_size, TREE_INT_CST_LOW (DECL_SIZE (field)));
656 else if (var_size == 0)
657 var_size = DECL_SIZE (field);
659 var_size = size_binop (MAX_EXPR, var_size, DECL_SIZE (field));
661 else if (TREE_CODE (rec) == QUAL_UNION_TYPE)
662 var_size = fold (build (COND_EXPR, sizetype, DECL_QUALIFIER (field),
664 var_size ? var_size : bitsize_int (0L, 0L)));
667 if (TREE_CODE (rec) == QUAL_UNION_TYPE)
668 TYPE_FIELDS (rec) = nreverse (TYPE_FIELDS (rec));
670 /* Determine the ultimate size of the union (in bytes). */
671 if (NULL == var_size)
672 TYPE_SIZE (rec) = bitsize_int (CEIL (const_size, BITS_PER_UNIT)
673 * BITS_PER_UNIT, 0L);
674 else if (const_size == 0)
675 TYPE_SIZE (rec) = var_size;
677 TYPE_SIZE (rec) = size_binop (MAX_EXPR, var_size,
678 round_up (bitsize_int (const_size, 0L),
681 /* Determine the desired alignment. */
682 #ifdef ROUND_TYPE_ALIGN
683 TYPE_ALIGN (rec) = ROUND_TYPE_ALIGN (rec, TYPE_ALIGN (rec), union_align);
685 TYPE_ALIGN (rec) = MAX (TYPE_ALIGN (rec), union_align);
688 #ifdef ROUND_TYPE_SIZE
689 TYPE_SIZE (rec) = ROUND_TYPE_SIZE (rec, TYPE_SIZE (rec), TYPE_ALIGN (rec));
691 /* Round the size up to be a multiple of the required alignment */
692 TYPE_SIZE (rec) = round_up (TYPE_SIZE (rec), TYPE_ALIGN (rec));
696 /* Calculate the mode, size, and alignment for TYPE.
697 For an array type, calculate the element separation as well.
698 Record TYPE on the chain of permanent or temporary types
699 so that dbxout will find out about it.
701 TYPE_SIZE of a type is nonzero if the type has been laid out already.
702 layout_type does nothing on such a type.
704 If the type is incomplete, its TYPE_SIZE remains zero. */
711 tree pending_statics;
716 /* Do nothing if type has been laid out before. */
717 if (TYPE_SIZE (type))
720 /* Make sure all nodes we allocate are not momentary;
721 they must last past the current statement. */
722 old = suspend_momentary ();
724 /* Put all our nodes into the same obstack as the type. Also,
725 make expressions saveable (this is a no-op for permanent types). */
727 push_obstacks (TYPE_OBSTACK (type), TYPE_OBSTACK (type));
728 saveable_allocation ();
730 switch (TREE_CODE (type))
733 /* This kind of type is the responsibility
734 of the language-specific code. */
737 case BOOLEAN_TYPE: /* Used for Java, Pascal, and Chill. */
738 if (TYPE_PRECISION (type) == 0)
739 TYPE_PRECISION (type) = 1; /* default to one byte/boolean. */
740 /* ... fall through ... */
745 if (TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST
746 && tree_int_cst_sgn (TYPE_MIN_VALUE (type)) >= 0)
747 TREE_UNSIGNED (type) = 1;
749 TYPE_MODE (type) = smallest_mode_for_size (TYPE_PRECISION (type),
751 TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)), 0L);
752 TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
756 TYPE_MODE (type) = mode_for_size (TYPE_PRECISION (type), MODE_FLOAT, 0);
757 TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)), 0L);
758 TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
762 TREE_UNSIGNED (type) = TREE_UNSIGNED (TREE_TYPE (type));
764 = mode_for_size (2 * TYPE_PRECISION (TREE_TYPE (type)),
765 (TREE_CODE (TREE_TYPE (type)) == INTEGER_TYPE
766 ? MODE_COMPLEX_INT : MODE_COMPLEX_FLOAT),
768 TYPE_SIZE (type) = bitsize_int (GET_MODE_BITSIZE (TYPE_MODE (type)), 0L);
769 TYPE_SIZE_UNIT (type) = size_int (GET_MODE_SIZE (TYPE_MODE (type)));
773 TYPE_SIZE (type) = size_zero_node;
774 TYPE_SIZE_UNIT (type) = size_zero_node;
775 TYPE_ALIGN (type) = 1;
776 TYPE_MODE (type) = VOIDmode;
780 TYPE_SIZE (type) = bitsize_int (POINTER_SIZE, 0L);
781 TYPE_SIZE_UNIT (type) = size_int (POINTER_SIZE / BITS_PER_UNIT);
782 TYPE_MODE (type) = ptr_mode;
787 TYPE_MODE (type) = mode_for_size (2 * POINTER_SIZE, MODE_INT, 0);
788 TYPE_SIZE (type) = bitsize_int (2 * POINTER_SIZE, 0);
789 TYPE_SIZE_UNIT (type) = size_int ((2 * POINTER_SIZE) / BITS_PER_UNIT);
794 TYPE_MODE (type) = ptr_mode;
795 TYPE_SIZE (type) = bitsize_int (POINTER_SIZE, 0L);
796 TYPE_SIZE_UNIT (type) = size_int (POINTER_SIZE / BITS_PER_UNIT);
797 TREE_UNSIGNED (type) = 1;
798 TYPE_PRECISION (type) = POINTER_SIZE;
803 register tree index = TYPE_DOMAIN (type);
804 register tree element = TREE_TYPE (type);
806 build_pointer_type (element);
808 /* We need to know both bounds in order to compute the size. */
809 if (index && TYPE_MAX_VALUE (index) && TYPE_MIN_VALUE (index)
810 && TYPE_SIZE (element))
812 tree ub = TYPE_MAX_VALUE (index);
813 tree lb = TYPE_MIN_VALUE (index);
817 /* If UB is max (lb - 1, x), remove the MAX_EXPR since the
818 test for negative below covers it. */
819 if (TREE_CODE (ub) == MAX_EXPR
820 && TREE_CODE (TREE_OPERAND (ub, 0)) == MINUS_EXPR
821 && integer_onep (TREE_OPERAND (TREE_OPERAND (ub, 0), 1))
822 && operand_equal_p (TREE_OPERAND (TREE_OPERAND (ub, 0), 0),
824 ub = TREE_OPERAND (ub, 1);
825 else if (TREE_CODE (ub) == MAX_EXPR
826 && TREE_CODE (TREE_OPERAND (ub, 1)) == MINUS_EXPR
827 && integer_onep (TREE_OPERAND (TREE_OPERAND (ub, 1), 1))
828 && operand_equal_p (TREE_OPERAND (TREE_OPERAND (ub, 1),
831 ub = TREE_OPERAND (ub, 0);
833 /* The initial subtraction should happen in the original type so
834 that (possible) negative values are handled appropriately. */
835 length = size_binop (PLUS_EXPR, size_one_node,
836 fold (build (MINUS_EXPR, TREE_TYPE (lb),
839 /* If neither bound is a constant and sizetype is signed, make
840 sure the size is never negative. We should really do this
841 if *either* bound is non-constant, but this is the best
842 compromise between C and Ada. */
843 if (! TREE_UNSIGNED (sizetype)
844 && TREE_CODE (TYPE_MIN_VALUE (index)) != INTEGER_CST
845 && TREE_CODE (TYPE_MAX_VALUE (index)) != INTEGER_CST)
846 length = size_binop (MAX_EXPR, length, size_zero_node);
848 /* Special handling for arrays of bits (for Chill). */
849 element_size = TYPE_SIZE (element);
850 if (TYPE_PACKED (type) && INTEGRAL_TYPE_P (element))
852 HOST_WIDE_INT maxvalue, minvalue;
853 maxvalue = TREE_INT_CST_LOW (TYPE_MAX_VALUE (element));
854 minvalue = TREE_INT_CST_LOW (TYPE_MIN_VALUE (element));
855 if (maxvalue - minvalue == 1
856 && (maxvalue == 1 || maxvalue == 0))
857 element_size = integer_one_node;
860 TYPE_SIZE (type) = size_binop (MULT_EXPR, element_size, length);
862 /* If we know the size of the element, calculate the total
863 size directly, rather than do some division thing below.
864 This optimization helps Fortran assumed-size arrays
865 (where the size of the array is determined at runtime)
867 Note that we can't do this in the case where the size of
868 the elements is one bit since TYPE_SIZE_UNIT cannot be
869 set correctly in that case. */
870 if (TYPE_SIZE_UNIT (element) != 0
871 && element_size != integer_one_node)
873 TYPE_SIZE_UNIT (type)
874 = size_binop (MULT_EXPR, TYPE_SIZE_UNIT (element), length);
878 /* Now round the alignment and size,
879 using machine-dependent criteria if any. */
881 #ifdef ROUND_TYPE_ALIGN
883 = ROUND_TYPE_ALIGN (type, TYPE_ALIGN (element), BITS_PER_UNIT);
885 TYPE_ALIGN (type) = MAX (TYPE_ALIGN (element), BITS_PER_UNIT);
888 #ifdef ROUND_TYPE_SIZE
889 if (TYPE_SIZE (type) != 0)
892 tmp = ROUND_TYPE_SIZE (type, TYPE_SIZE (type), TYPE_ALIGN (type));
893 /* If the rounding changed the size of the type, remove any
894 pre-calculated TYPE_SIZE_UNIT. */
895 if (simple_cst_equal (TYPE_SIZE (type), tmp) != 1)
896 TYPE_SIZE_UNIT (type) = NULL;
897 TYPE_SIZE (type) = tmp;
901 TYPE_MODE (type) = BLKmode;
902 if (TYPE_SIZE (type) != 0
903 && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
904 /* BLKmode elements force BLKmode aggregate;
905 else extract/store fields may lose. */
906 && (TYPE_MODE (TREE_TYPE (type)) != BLKmode
907 || TYPE_NO_FORCE_BLK (TREE_TYPE (type))))
910 = mode_for_size (TREE_INT_CST_LOW (TYPE_SIZE (type)),
913 if (STRICT_ALIGNMENT && TYPE_ALIGN (type) < BIGGEST_ALIGNMENT
914 && (int)TYPE_ALIGN (type) < TREE_INT_CST_LOW (TYPE_SIZE (type))
915 && TYPE_MODE (type) != BLKmode)
917 TYPE_NO_FORCE_BLK (type) = 1;
918 TYPE_MODE (type) = BLKmode;
925 pending_statics = layout_record (type);
926 TYPE_MODE (type) = BLKmode;
927 if (TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST)
930 enum machine_mode mode = VOIDmode;
932 /* A record which has any BLKmode members must itself be BLKmode;
933 it can't go in a register.
934 Unless the member is BLKmode only because it isn't aligned. */
935 for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
939 if (TREE_CODE (field) != FIELD_DECL)
942 if (TYPE_MODE (TREE_TYPE (field)) == BLKmode
943 && ! TYPE_NO_FORCE_BLK (TREE_TYPE (field)))
946 if (TREE_CODE (DECL_FIELD_BITPOS (field)) != INTEGER_CST)
949 bitpos = TREE_INT_CST_LOW (DECL_FIELD_BITPOS (field));
951 /* Must be BLKmode if any field crosses a word boundary,
952 since extract_bit_field can't handle that in registers. */
953 if (bitpos / BITS_PER_WORD
954 != ((TREE_INT_CST_LOW (DECL_SIZE (field)) + bitpos - 1)
956 /* But there is no problem if the field is entire words. */
957 && TREE_INT_CST_LOW (DECL_SIZE (field)) % BITS_PER_WORD != 0)
960 /* If this field is the whole struct, remember its mode so
961 that, say, we can put a double in a class into a DF
962 register instead of forcing it to live in the stack. */
963 if (simple_cst_equal (TYPE_SIZE (type), DECL_SIZE (field)))
964 mode = DECL_MODE (field);
967 if (mode != VOIDmode)
968 /* We only have one real field; use its mode. */
969 TYPE_MODE (type) = mode;
972 = mode_for_size (TREE_INT_CST_LOW (TYPE_SIZE (type)),
975 /* If structure's known alignment is less than
976 what the scalar mode would need, and it matters,
977 then stick with BLKmode. */
979 && ! (TYPE_ALIGN (type) >= BIGGEST_ALIGNMENT
980 || ((int)TYPE_ALIGN (type)
981 >= TREE_INT_CST_LOW (TYPE_SIZE (type)))))
983 if (TYPE_MODE (type) != BLKmode)
984 /* If this is the only reason this type is BLKmode,
985 then don't force containing types to be BLKmode. */
986 TYPE_NO_FORCE_BLK (type) = 1;
987 TYPE_MODE (type) = BLKmode;
993 /* Lay out any static members. This is done now
994 because their type may use the record's type. */
995 while (pending_statics)
997 layout_decl (TREE_VALUE (pending_statics), 0);
998 pending_statics = TREE_CHAIN (pending_statics);
1003 case QUAL_UNION_TYPE:
1004 layout_union (type);
1005 TYPE_MODE (type) = BLKmode;
1006 if (TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
1007 /* If structure's known alignment is less than
1008 what the scalar mode would need, and it matters,
1009 then stick with BLKmode. */
1010 && (! STRICT_ALIGNMENT
1011 || TYPE_ALIGN (type) >= BIGGEST_ALIGNMENT
1012 || (int)TYPE_ALIGN (type) >= TREE_INT_CST_LOW (TYPE_SIZE (type))))
1015 /* A union which has any BLKmode members must itself be BLKmode;
1016 it can't go in a register.
1017 Unless the member is BLKmode only because it isn't aligned. */
1018 for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
1020 if (TREE_CODE (field) != FIELD_DECL)
1023 if (TYPE_MODE (TREE_TYPE (field)) == BLKmode
1024 && ! TYPE_NO_FORCE_BLK (TREE_TYPE (field)))
1029 = mode_for_size (TREE_INT_CST_LOW (TYPE_SIZE (type)),
1036 case SET_TYPE: /* Used by Chill and Pascal. */
1037 if (TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) != INTEGER_CST
1038 || TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) != INTEGER_CST)
1042 #ifndef SET_WORD_SIZE
1043 #define SET_WORD_SIZE BITS_PER_WORD
1045 int alignment = set_alignment ? set_alignment : SET_WORD_SIZE;
1047 = (TREE_INT_CST_LOW (TYPE_MAX_VALUE (TYPE_DOMAIN (type)))
1048 - TREE_INT_CST_LOW (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) + 1);
1050 = ((size_in_bits + alignment - 1) / alignment) * alignment;
1051 if (rounded_size > alignment)
1052 TYPE_MODE (type) = BLKmode;
1054 TYPE_MODE (type) = mode_for_size (alignment, MODE_INT, 1);
1055 TYPE_SIZE (type) = bitsize_int (rounded_size, 0L);
1056 TYPE_SIZE_UNIT (type) = size_int (rounded_size / BITS_PER_UNIT);
1057 TYPE_ALIGN (type) = alignment;
1058 TYPE_PRECISION (type) = size_in_bits;
1063 /* The size may vary in different languages, so the language front end
1064 should fill in the size. */
1065 TYPE_ALIGN (type) = BIGGEST_ALIGNMENT;
1066 TYPE_MODE (type) = BLKmode;
1073 /* Normally, use the alignment corresponding to the mode chosen.
1074 However, where strict alignment is not required, avoid
1075 over-aligning structures, since most compilers do not do this
1078 if (TYPE_MODE (type) != BLKmode && TYPE_MODE (type) != VOIDmode
1079 && (STRICT_ALIGNMENT
1080 || (TREE_CODE (type) != RECORD_TYPE && TREE_CODE (type) != UNION_TYPE
1081 && TREE_CODE (type) != QUAL_UNION_TYPE
1082 && TREE_CODE (type) != ARRAY_TYPE)))
1083 TYPE_ALIGN (type) = GET_MODE_ALIGNMENT (TYPE_MODE (type));
1085 /* Do machine-dependent extra alignment. */
1086 #ifdef ROUND_TYPE_ALIGN
1088 = ROUND_TYPE_ALIGN (type, TYPE_ALIGN (type), BITS_PER_UNIT);
1091 #ifdef ROUND_TYPE_SIZE
1092 if (TYPE_SIZE (type) != 0)
1094 = ROUND_TYPE_SIZE (type, TYPE_SIZE (type), TYPE_ALIGN (type));
1097 /* Evaluate nonconstant size only once, either now or as soon as safe. */
1098 if (TYPE_SIZE (type) != 0 && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
1099 TYPE_SIZE (type) = variable_size (TYPE_SIZE (type));
1101 /* If we failed to find a simple way to calculate the unit size
1102 of the type above, find it by division. */
1103 if (TYPE_SIZE_UNIT (type) == 0 && TYPE_SIZE (type) != 0)
1105 TYPE_SIZE_UNIT (type) = size_binop (FLOOR_DIV_EXPR, TYPE_SIZE (type),
1106 size_int (BITS_PER_UNIT));
1109 /* Once again evaluate only once, either now or as soon as safe. */
1110 if (TYPE_SIZE_UNIT (type) != 0
1111 && TREE_CODE (TYPE_SIZE_UNIT (type)) != INTEGER_CST)
1112 TYPE_SIZE_UNIT (type) = variable_size (TYPE_SIZE_UNIT (type));
1114 /* Also layout any other variants of the type. */
1115 if (TYPE_NEXT_VARIANT (type)
1116 || type != TYPE_MAIN_VARIANT (type))
1119 /* Record layout info of this variant. */
1120 tree size = TYPE_SIZE (type);
1121 tree size_unit = TYPE_SIZE_UNIT (type);
1122 int align = TYPE_ALIGN (type);
1123 enum machine_mode mode = TYPE_MODE (type);
1125 /* Copy it into all variants. */
1126 for (variant = TYPE_MAIN_VARIANT (type);
1128 variant = TYPE_NEXT_VARIANT (variant))
1130 TYPE_SIZE (variant) = size;
1131 TYPE_SIZE_UNIT (variant) = size_unit;
1132 TYPE_ALIGN (variant) = align;
1133 TYPE_MODE (variant) = mode;
1138 resume_momentary (old);
1141 /* Create and return a type for signed integers of PRECISION bits. */
1144 make_signed_type (precision)
1147 register tree type = make_node (INTEGER_TYPE);
1149 TYPE_PRECISION (type) = precision;
1151 /* Create the extreme values based on the number of bits. */
1153 TYPE_MIN_VALUE (type)
1154 = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
1155 ? 0 : (HOST_WIDE_INT) (-1) << (precision - 1)),
1156 (((HOST_WIDE_INT) (-1)
1157 << (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
1158 ? precision - HOST_BITS_PER_WIDE_INT - 1
1160 TYPE_MAX_VALUE (type)
1161 = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
1162 ? -1 : ((HOST_WIDE_INT) 1 << (precision - 1)) - 1),
1163 (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
1164 ? (((HOST_WIDE_INT) 1
1165 << (precision - HOST_BITS_PER_WIDE_INT - 1))) - 1
1168 /* Give this type's extreme values this type as their type. */
1170 TREE_TYPE (TYPE_MIN_VALUE (type)) = type;
1171 TREE_TYPE (TYPE_MAX_VALUE (type)) = type;
1173 /* The first type made with this or `make_unsigned_type'
1174 is the type for size values. */
1177 set_sizetype (type);
1179 /* Lay out the type: set its alignment, size, etc. */
1186 /* Create and return a type for unsigned integers of PRECISION bits. */
1189 make_unsigned_type (precision)
1192 register tree type = make_node (INTEGER_TYPE);
1194 TYPE_PRECISION (type) = precision;
1196 /* The first type made with this or `make_signed_type'
1197 is the type for size values. */
1201 TREE_UNSIGNED (type) = 1;
1202 set_sizetype (type);
1205 fixup_unsigned_type (type);
1209 /* Set sizetype to TYPE, and initialize *sizetype accordingly.
1210 Also update the type of any standard type's sizes made so far. */
1216 int oprecision = TYPE_PRECISION (type), precision;
1220 /* The *bitsizetype types use a precision that avoids overflows when
1221 calculating signed sizes / offsets in bits.
1223 We are allocating bitsizetype once and change it in place when
1224 we decide later that we want to change it. This way, we avoid the
1225 hassle of changing all the TYPE_SIZE (TREE_TYPE (sometype))
1226 individually in each front end. */
1228 bitsizetype = make_node (INTEGER_TYPE);
1229 if (TYPE_NAME (sizetype) && ! TYPE_NAME (bitsizetype))
1230 TYPE_NAME (bitsizetype) = TYPE_NAME (sizetype);
1232 precision = oprecision + BITS_PER_UNIT_LOG + 1;
1233 /* However, when cross-compiling from a 32 bit to a 64 bit host,
1234 we are limited to 64 bit precision. */
1235 if (precision > 2 * HOST_BITS_PER_WIDE_INT)
1236 precision = 2 * HOST_BITS_PER_WIDE_INT;
1237 TYPE_PRECISION (bitsizetype) = precision;
1238 if (TREE_UNSIGNED (type))
1239 fixup_unsigned_type (bitsizetype);
1241 fixup_signed_type (bitsizetype);
1242 layout_type (bitsizetype);
1244 if (TREE_UNSIGNED (type))
1246 usizetype = sizetype;
1247 ubitsizetype = bitsizetype;
1248 ssizetype = make_signed_type (oprecision);
1249 sbitsizetype = make_signed_type (precision);
1253 ssizetype = sizetype;
1254 sbitsizetype = bitsizetype;
1255 usizetype = make_unsigned_type (oprecision);
1256 ubitsizetype = make_unsigned_type (precision);
1260 /* Set the extreme values of TYPE based on its precision in bits,
1261 then lay it out. Used when make_signed_type won't do
1262 because the tree code is not INTEGER_TYPE.
1263 E.g. for Pascal, when the -fsigned-char option is given. */
1266 fixup_signed_type (type)
1269 register int precision = TYPE_PRECISION (type);
1271 TYPE_MIN_VALUE (type)
1272 = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
1273 ? 0 : (HOST_WIDE_INT) (-1) << (precision - 1)),
1274 (((HOST_WIDE_INT) (-1)
1275 << (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
1276 ? precision - HOST_BITS_PER_WIDE_INT - 1
1278 TYPE_MAX_VALUE (type)
1279 = build_int_2 ((precision - HOST_BITS_PER_WIDE_INT > 0
1280 ? -1 : ((HOST_WIDE_INT) 1 << (precision - 1)) - 1),
1281 (precision - HOST_BITS_PER_WIDE_INT - 1 > 0
1282 ? (((HOST_WIDE_INT) 1
1283 << (precision - HOST_BITS_PER_WIDE_INT - 1))) - 1
1286 TREE_TYPE (TYPE_MIN_VALUE (type)) = type;
1287 TREE_TYPE (TYPE_MAX_VALUE (type)) = type;
1289 /* Lay out the type: set its alignment, size, etc. */
1294 /* Set the extreme values of TYPE based on its precision in bits,
1295 then lay it out. This is used both in `make_unsigned_type'
1296 and for enumeral types. */
1299 fixup_unsigned_type (type)
1302 register int precision = TYPE_PRECISION (type);
1304 TYPE_MIN_VALUE (type) = build_int_2 (0, 0);
1305 TYPE_MAX_VALUE (type)
1306 = build_int_2 (precision - HOST_BITS_PER_WIDE_INT >= 0
1307 ? -1 : ((HOST_WIDE_INT) 1 << precision) - 1,
1308 precision - HOST_BITS_PER_WIDE_INT > 0
1309 ? ((unsigned HOST_WIDE_INT) ~0
1310 >> (HOST_BITS_PER_WIDE_INT
1311 - (precision - HOST_BITS_PER_WIDE_INT)))
1313 TREE_TYPE (TYPE_MIN_VALUE (type)) = type;
1314 TREE_TYPE (TYPE_MAX_VALUE (type)) = type;
1316 /* Lay out the type: set its alignment, size, etc. */
1321 /* Find the best machine mode to use when referencing a bit field of length
1322 BITSIZE bits starting at BITPOS.
1324 The underlying object is known to be aligned to a boundary of ALIGN bits.
1325 If LARGEST_MODE is not VOIDmode, it means that we should not use a mode
1326 larger than LARGEST_MODE (usually SImode).
1328 If no mode meets all these conditions, we return VOIDmode. Otherwise, if
1329 VOLATILEP is true or SLOW_BYTE_ACCESS is false, we return the smallest
1330 mode meeting these conditions.
1332 Otherwise (VOLATILEP is false and SLOW_BYTE_ACCESS is true), we return
1333 the largest mode (but a mode no wider than UNITS_PER_WORD) that meets
1334 all the conditions. */
1337 get_best_mode (bitsize, bitpos, align, largest_mode, volatilep)
1338 int bitsize, bitpos;
1340 enum machine_mode largest_mode;
1343 enum machine_mode mode;
1346 /* Find the narrowest integer mode that contains the bit field. */
1347 for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); mode != VOIDmode;
1348 mode = GET_MODE_WIDER_MODE (mode))
1350 unit = GET_MODE_BITSIZE (mode);
1351 if ((bitpos % unit) + bitsize <= unit)
1355 if (mode == MAX_MACHINE_MODE
1356 /* It is tempting to omit the following line
1357 if STRICT_ALIGNMENT is true.
1358 But that is incorrect, since if the bitfield uses part of 3 bytes
1359 and we use a 4-byte mode, we could get a spurious segv
1360 if the extra 4th byte is past the end of memory.
1361 (Though at least one Unix compiler ignores this problem:
1362 that on the Sequent 386 machine. */
1363 || MIN (unit, BIGGEST_ALIGNMENT) > align
1364 || (largest_mode != VOIDmode && unit > GET_MODE_BITSIZE (largest_mode)))
1367 if (SLOW_BYTE_ACCESS && ! volatilep)
1369 enum machine_mode wide_mode = VOIDmode, tmode;
1371 for (tmode = GET_CLASS_NARROWEST_MODE (MODE_INT); tmode != VOIDmode;
1372 tmode = GET_MODE_WIDER_MODE (tmode))
1374 unit = GET_MODE_BITSIZE (tmode);
1375 if (bitpos / unit == (bitpos + bitsize - 1) / unit
1376 && unit <= BITS_PER_WORD
1377 && unit <= MIN (align, BIGGEST_ALIGNMENT)
1378 && (largest_mode == VOIDmode
1379 || unit <= GET_MODE_BITSIZE (largest_mode)))
1383 if (wide_mode != VOIDmode)