summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-25 01:19:23 +0000
committerrth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>2001-07-25 01:19:23 +0000
commit0994d2ed2aaa8b7ed9d83f647eee956d2ed9c342 (patch)
treef1df0ac597914393101a30e742c277cec9f14f44
parent6f2c24560b6b87b3eee8b6f4e1ce3a7a12b46589 (diff)
downloadppe42-gcc-0994d2ed2aaa8b7ed9d83f647eee956d2ed9c342.tar.gz
ppe42-gcc-0994d2ed2aaa8b7ed9d83f647eee956d2ed9c342.zip
* stor-layout.c (get_mode_alignment): make it work when
BITS_PER_UNIT is not a power of two. * builtins.c (get_pointer_alignment): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@44322 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/builtins.c4
-rw-r--r--gcc/stor-layout.c3
3 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 819ee9b8a78..e7b06d2a3ff 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2001-07-24 Lars Brinkhoff <lars@nocrew.org>
+
+ * stor-layout.c (get_mode_alignment): make it work when
+ BITS_PER_UNIT is not a power of two.
+ * builtins.c (get_pointer_alignment): Likewise.
+
2001-07-24 Richard Henderson <rth@redhat.com>
* simplify-rtx.c (avoid_constant_pool_reference): Coerce
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 8a44a7c6798..c2ce7c8d49b 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -186,8 +186,8 @@ get_pointer_alignment (exp, max_align)
if (! host_integerp (TREE_OPERAND (exp, 1), 1))
return align;
- while (((tree_low_cst (TREE_OPERAND (exp, 1), 1) * BITS_PER_UNIT)
- & (max_align - 1))
+ while (((tree_low_cst (TREE_OPERAND (exp, 1), 1))
+ & (max_align / BITS_PER_UNIT - 1))
!= 0)
max_align >>= 1;
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 3e7fb19073d..2ac72e38f25 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -1866,10 +1866,11 @@ unsigned int
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;
OpenPOWER on IntegriCloud