aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorHerman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>1999-11-18 08:57:32 +0100
committerJeff Law <law@gcc.gnu.org>1999-11-18 00:57:32 -0700
commitdfb2c079b10deb732ecaefd0a3759ffcb2280dc0 (patch)
tree37845075fd4f70413bea7f65b66b9d236d72217d /gcc
parentee7602056eb3f0156d9c6b5eb2a8c9e1402997d2 (diff)
downloadgcc-dfb2c079b10deb732ecaefd0a3759ffcb2280dc0.zip
gcc-dfb2c079b10deb732ecaefd0a3759ffcb2280dc0.tar.gz
gcc-dfb2c079b10deb732ecaefd0a3759ffcb2280dc0.tar.bz2
* varasm.c (output_constructor) Solved problem with long long
bitfields. Corrected calculating this_time and shift. Also corrected calculating mask when BITS_PER_UNIT == 32 (c4x). From-SVN: r30571
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/varasm.c22
2 files changed, 20 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index baa083c..d8f2755 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+1999-11-18 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
+
+ * varasm.c (output_constructor) Solved problem with long long
+ bitfields. Corrected calculating this_time and shift. Also
+ corrected calculating mask when BITS_PER_UNIT == 32 (c4x).
+
Wed Nov 17 23:46:14 1999 Jeffrey A Law (law@cygnus.com)
* flow.c (split_edge): Take looping structure into account when
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 800465b..e3b0996 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -4530,12 +4530,13 @@ output_constructor (exp, size)
and put them into bytes from the most significant end. */
shift = end_offset - next_offset - this_time;
/* Don't try to take a bunch of bits that cross
- the word boundary in the INTEGER_CST. */
+ the word boundary in the INTEGER_CST. We can
+ only select bits from the LOW or HIGH part
+ not from both. */
if (shift < HOST_BITS_PER_WIDE_INT
&& shift + this_time > HOST_BITS_PER_WIDE_INT)
{
- this_time -= (HOST_BITS_PER_WIDE_INT - shift);
- shift = HOST_BITS_PER_WIDE_INT;
+ this_time = (HOST_BITS_PER_WIDE_INT - shift);
}
/* Now get the bits from the appropriate constant word. */
@@ -4550,8 +4551,10 @@ output_constructor (exp, size)
}
else
abort ();
+ /* Get the result. This works only when:
+ 1 <= this_time <= HOST_BITS_PER_WIDE_INT. */
byte |= (((value >> shift)
- & (((HOST_WIDE_INT) 1 << this_time) - 1))
+ & (((HOST_WIDE_INT) 2 << (this_time - 1)) - 1))
<< (BITS_PER_UNIT - this_time - next_bit));
}
else
@@ -4563,12 +4566,13 @@ output_constructor (exp, size)
shift = (next_offset
- TREE_INT_CST_LOW (DECL_FIELD_BITPOS (field)));
/* Don't try to take a bunch of bits that cross
- the word boundary in the INTEGER_CST. */
+ the word boundary in the INTEGER_CST. We can
+ only select bits from the LOW or HIGH part
+ not from both. */
if (shift < HOST_BITS_PER_WIDE_INT
&& shift + this_time > HOST_BITS_PER_WIDE_INT)
{
- this_time -= (HOST_BITS_PER_WIDE_INT - shift);
- shift = HOST_BITS_PER_WIDE_INT;
+ this_time = (HOST_BITS_PER_WIDE_INT - shift);
}
/* Now get the bits from the appropriate constant word. */
@@ -4581,8 +4585,10 @@ output_constructor (exp, size)
}
else
abort ();
+ /* Get the result. This works only when:
+ 1 <= this_time <= HOST_BITS_PER_WIDE_INT. */
byte |= (((value >> shift)
- & (((HOST_WIDE_INT) 1 << this_time) - 1))
+ & (((HOST_WIDE_INT) 2 << (this_time - 1)) - 1))
<< next_bit);
}
next_offset += this_time;