This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Allow BITS_PER_UNIT != 8
- To: gcc-patches at gcc dot gnu dot org
- Subject: Re: PATCH: Allow BITS_PER_UNIT != 8
- From: Lars Brinkhoff <lars dot spam at nocrew dot org>
- Date: 13 Feb 2001 15:49:01 +0100
- Organization: nocrew
- References: <85vgrjbxmu.fsf_-_@junk.nocrew.org> <854rz19cw8.fsf@junk.nocrew.org>
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;