Commit b676e9e2 by Jim Wilson

(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
parent b711cbcc
...@@ -2044,13 +2044,14 @@ tree ...@@ -2044,13 +2044,14 @@ tree
i960_round_size (tsize) i960_round_size (tsize)
tree tsize; tree tsize;
{ {
int size, align; int size, byte_size, align;
if (TREE_CODE (tsize) != INTEGER_CST) if (TREE_CODE (tsize) != INTEGER_CST)
return tsize; return tsize;
size = TREE_INT_CST_LOW (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. */ /* Handle #pragma align. */
if (align > i960_maxbitalignment) if (align > i960_maxbitalignment)
...@@ -2069,11 +2070,13 @@ i960_round_align (align, tsize) ...@@ -2069,11 +2070,13 @@ i960_round_align (align, tsize)
int align; int align;
tree tsize; tree tsize;
{ {
int byte_size;
if (TREE_CODE (tsize) != INTEGER_CST) if (TREE_CODE (tsize) != INTEGER_CST)
return align; return align;
align = i960_object_bytes_bitalign (TREE_INT_CST_LOW (tsize) byte_size = (TREE_INT_CST_LOW (tsize) + BITS_PER_UNIT - 1) / BITS_PER_UNIT;
/ BITS_PER_UNIT); align = i960_object_bytes_bitalign (byte_size);
return align; return align;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment