aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1992-09-28 14:11:48 -0700
committerJim Wilson <wilson@gcc.gnu.org>1992-09-28 14:11:48 -0700
commitb676e9e2598abcfbc73b3dc54ef3057ef9e73c5d (patch)
treeeac5245a9ca0a900ff1f339ea0afab01870eda2b
parentb711cbccabc17d3b163099109047083365452a1b (diff)
downloadgcc-b676e9e2598abcfbc73b3dc54ef3057ef9e73c5d.zip
gcc-b676e9e2598abcfbc73b3dc54ef3057ef9e73c5d.tar.gz
gcc-b676e9e2598abcfbc73b3dc54ef3057ef9e73c5d.tar.bz2
(i960_round_tree): Correct conversion of bits to bytes to round up to nearest byte.
(i960_round_tree): Correct conversion of bits to bytes to round up to nearest byte. (i960_round_align): Likewise. From-SVN: r2271
-rw-r--r--gcc/config/i960/i960.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/config/i960/i960.c b/gcc/config/i960/i960.c
index 82342cc..0f4e5ae 100644
--- a/gcc/config/i960/i960.c
+++ b/gcc/config/i960/i960.c
@@ -2044,13 +2044,14 @@ tree
i960_round_size (tsize)
tree tsize;
{
- int size, align;
+ int size, byte_size, align;
if (TREE_CODE (tsize) != INTEGER_CST)
return tsize;
size = TREE_INT_CST_LOW (tsize);
- align = i960_object_bytes_bitalign (size / BITS_PER_UNIT);
+ byte_size = (size + BITS_PER_UNIT - 1) / BITS_PER_UNIT;
+ align = i960_object_bytes_bitalign (byte_size);
/* Handle #pragma align. */
if (align > i960_maxbitalignment)
@@ -2069,11 +2070,13 @@ i960_round_align (align, tsize)
int align;
tree tsize;
{
+ int byte_size;
+
if (TREE_CODE (tsize) != INTEGER_CST)
return align;
- align = i960_object_bytes_bitalign (TREE_INT_CST_LOW (tsize)
- / BITS_PER_UNIT);
+ byte_size = (TREE_INT_CST_LOW (tsize) + BITS_PER_UNIT - 1) / BITS_PER_UNIT;
+ align = i960_object_bytes_bitalign (byte_size);
return align;
}