varasm.c (output_constant_pool): Use floor_log2 instead of exact_log2 for ASM_OUTPUT_...
authorVladimir N. Makarov <vmakarov@cygnus.com>
Thu, 21 Jan 1999 11:20:09 +0000 (11:20 +0000)
committerVladimir Makarov <vmakarov@gcc.gnu.org>
Thu, 21 Jan 1999 11:20:09 +0000 (11:20 +0000)
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.

From-SVN: r24800

gcc/ChangeLog
gcc/emit-rtl.c
gcc/stor-layout.c
gcc/tm.texi
gcc/varasm.c

index f3333c4f536c77fdedb542920543f64a8984f6c9..9bc917bafcba37dea5654ce756a685b110f8c4fd 100644 (file)
@@ -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.
index 49255443362190916ac251e07b6e837f284c79c5..22fdaf692dbee2e76b02b8c293c966b863c5ad6e 100644 (file)
@@ -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)
index 1379811cea739307555a25d39370d6f53a585bab..a712664843feda314ef5dae8ce1a1e14b7002edb 100644 (file)
@@ -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));
index f08cbf9574c4c35e2a815872ac306ea4e707a3f0..cba1b66813388dda980d7b4eeee96adad57a0ece 100644 (file)
@@ -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
index 748d0cbaa842a45edf4f46b1ec533e193b2d2875..9fad6eb3993285c9280a776bebe061ca8873fe36 100644 (file)
@@ -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);