This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: PATCH: Allow BITS_PER_UNIT != 8


Lars Brinkhoff <lars.spam@nocrew.org> writes:
> The function get_mode_alignment() in stor-layout.c doesn't work if
> BITS_PER_UNIT isn't 2^n.

2001-02-13  lars brinkhoff  <lars@nocrew.org>

        * stor-layout.c (get_mode_alignment): Remove the restriction
        that BITS_PER_UNIT must be a power of 2.

Index: stor-layout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/stor-layout.c,v
retrieving revision 1.93
diff -u -r1.93 stor-layout.c
--- stor-layout.c       2001/02/06 13:04:43     1.93
+++ stor-layout.c       2001/02/13 14:42:43
@@ -1815,10 +1815,11 @@
 get_mode_alignment (mode)
      enum machine_mode mode;
 {
-  unsigned int alignment = GET_MODE_UNIT_SIZE (mode) * BITS_PER_UNIT;
+  unsigned int alignment = GET_MODE_UNIT_SIZE (mode);

   /* Extract the LSB of the size.  */
   alignment = alignment & -alignment;
+  alignment *= BITS_PER_UNIT;

   alignment = MIN (BIGGEST_ALIGNMENT, MAX (1, alignment));
   return alignment;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]