summaryrefslogtreecommitdiff
path: root/gcc/stor-layout.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/stor-layout.c')
-rw-r--r--gcc/stor-layout.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 2ccf45ee1f4..21a8f4404ae 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -390,7 +390,7 @@ layout_record (rec)
int type_align = TYPE_ALIGN (TREE_TYPE (field));
if (maximum_field_alignment != 0)
type_align = MIN (type_align, maximum_field_alignment);
- else if (TYPE_PACKED (rec))
+ else if (DECL_PACKED (field))
type_align = MIN (type_align, BITS_PER_UNIT);
record_align = MAX (record_align, type_align);
@@ -464,11 +464,15 @@ layout_record (rec)
if (maximum_field_alignment != 0)
type_align = MIN (type_align, maximum_field_alignment);
- else if (TYPE_PACKED (rec))
+ /* ??? This test is opposite the test in the containing if
+ statement, so this code is unreachable currently. */
+ else if (DECL_PACKED (field))
type_align = MIN (type_align, BITS_PER_UNIT);
/* A bit field may not span the unit of alignment of its type.
Advance to next boundary if necessary. */
+ /* ??? This code should match the code above for the
+ PCC_BITFIELD_TYPE_MATTERS case. */
if (const_size / type_align
!= (const_size + field_size - 1) / type_align)
const_size = CEIL (const_size, type_align) * type_align;
@@ -694,6 +698,11 @@ layout_type (type)
of the language-specific code. */
abort ();
+ case BOOLEAN_TYPE: /* Used for Java, Pascal, and Chill. */
+ if (TYPE_PRECISION (type) == 0)
+ TYPE_PRECISION (type) = 1; /* default to one byte/boolean. */
+ /* ... fall through ... */
+
case INTEGER_TYPE:
case ENUMERAL_TYPE:
case CHAR_TYPE:
@@ -944,18 +953,7 @@ layout_type (type)
}
break;
- /* Pascal and Chill types */
- case BOOLEAN_TYPE: /* store one byte/boolean for now. */
- TYPE_MODE (type) = QImode;
- TYPE_SIZE (type) = size_int (GET_MODE_BITSIZE (TYPE_MODE (type)));
- TYPE_PRECISION (type) = 1;
- TYPE_ALIGN (type) = GET_MODE_ALIGNMENT (TYPE_MODE (type));
- if (TREE_CODE (TYPE_MIN_VALUE (type)) == INTEGER_CST
- && tree_int_cst_sgn (TYPE_MIN_VALUE (type)) >= 0)
- TREE_UNSIGNED (type) = 1;
- break;
-
- case SET_TYPE:
+ case SET_TYPE: /* Used by Chill and Pascal. */
if (TREE_CODE (TYPE_MAX_VALUE (TYPE_DOMAIN (type))) != INTEGER_CST
|| TREE_CODE (TYPE_MIN_VALUE (TYPE_DOMAIN (type))) != INTEGER_CST)
abort();