aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog13
-rw-r--r--gcc/emit-rtl.c10
-rw-r--r--gcc/stor-layout.c12
-rw-r--r--gcc/tm.texi18
-rw-r--r--gcc/varasm.c2
5 files changed, 42 insertions, 13 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f3333c4..9bc917b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,16 @@
+Thu Jan 21 14:13:31 1999 Vladimir N. Makarov <vmakarov@cygnus.com>
+
+ * varasm.c (output_constant_pool): Use floor_log2 instead of
+ exact_log2 for ASM_OUTPUT_ALIGN.
+
+ * stor-layout.c (layout_type): Do machine-dependent extra alignment.
+
+ * emit-rtl.c (operand_subword): Handle case when a subword outside
+ the operand.
+
+ * tm.texi (ROUND_TYPE_{SIZE,ALIGN}): More accurate descriptions of
+ the macros.
+
Thu Jan 21 01:59:30 1999 Richard Henderson <rth@cygnus.com>
* cse.c (fold_rtx): Revert 29 Dec change.
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 4925544..22fdaf6 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -1136,12 +1136,16 @@ operand_subword (op, i, validate_address, mode)
if (mode == VOIDmode)
abort ();
- /* If OP is narrower than a word or if we want a word outside OP, fail. */
+ /* If OP is narrower than a word, fail. */
if (mode != BLKmode
- && (GET_MODE_SIZE (mode) < UNITS_PER_WORD
- || (i + 1) * UNITS_PER_WORD > GET_MODE_SIZE (mode)))
+ && (GET_MODE_SIZE (mode) < UNITS_PER_WORD))
return 0;
+ /* If we want a word outside OP, return zero. */
+ if (mode != BLKmode
+ && (i + 1) * UNITS_PER_WORD > GET_MODE_SIZE (mode))
+ return const0_rtx;
+
/* If OP is already an integer word, return it. */
if (GET_MODE_CLASS (mode) == MODE_INT
&& GET_MODE_SIZE (mode) == UNITS_PER_WORD)
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 1379811..a712664 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -1085,6 +1085,18 @@ layout_type (type)
&& TREE_CODE (type) != ARRAY_TYPE)))
TYPE_ALIGN (type) = GET_MODE_ALIGNMENT (TYPE_MODE (type));
+ /* Do machine-dependent extra alignment. */
+#ifdef ROUND_TYPE_ALIGN
+ TYPE_ALIGN (type)
+ = ROUND_TYPE_ALIGN (type, TYPE_ALIGN (type), BITS_PER_UNIT);
+#endif
+
+#ifdef ROUND_TYPE_SIZE
+ if (TYPE_SIZE (type) != 0)
+ TYPE_SIZE (type)
+ = ROUND_TYPE_SIZE (type, TYPE_SIZE (type), TYPE_ALIGN (type));
+#endif
+
/* Evaluate nonconstant size only once, either now or as soon as safe. */
if (TYPE_SIZE (type) != 0 && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
TYPE_SIZE (type) = variable_size (TYPE_SIZE (type));
diff --git a/gcc/tm.texi b/gcc/tm.texi
index f08cbf9..cba1b66 100644
--- a/gcc/tm.texi
+++ b/gcc/tm.texi
@@ -966,18 +966,18 @@ Like PCC_BITFIELD_TYPE_MATTERS except that its effect is limited to
aligning a bitfield within the structure.
@findex ROUND_TYPE_SIZE
-@item ROUND_TYPE_SIZE (@var{struct}, @var{size}, @var{align})
-Define this macro as an expression for the overall size of a structure
-(given by @var{struct} as a tree node) when the size computed from the
-fields is @var{size} and the alignment is @var{align}.
+@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{size} up to a multiple of @var{align}.
+The default is to round @var{computed} up to a multiple of @var{specified}.
@findex ROUND_TYPE_ALIGN
-@item ROUND_TYPE_ALIGN (@var{struct}, @var{computed}, @var{specified})
-Define this macro as an expression for the alignment of a structure
-(given by @var{struct} as a tree node) if the alignment computed in the
-usual way is @var{computed} and the alignment explicitly specified was
+@item ROUND_TYPE_ALIGN (@var{type}, @var{computed}, @var{specified})
+Define this macro as an expression for the alignment of a type (given
+by @var{type} as a tree node) if the alignment computed in the usual
+way is @var{computed} and the alignment explicitly specified was
@var{specified}.
The default is to use @var{specified} if it is larger; otherwise, use
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 748d0cb..9fad6eb 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -3634,7 +3634,7 @@ output_constant_pool (fnname, fndecl)
#endif
if (pool->align > 1)
- ASM_OUTPUT_ALIGN (asm_out_file, exact_log2 (pool->align));
+ ASM_OUTPUT_ALIGN (asm_out_file, floor_log2 (pool->align));
/* Output the label. */
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, "LC", pool->labelno);