Commit 8b1cb95b by Geoff Keating Committed by Geoffrey Keating

varasm.c (output_constructor): Solve problem with long long bitfields...

* varasm.c (output_constructor): Solve problem with long long
bitfields, even on BYTES_BIG_ENDIAN machines (testcase 991118-1).

From-SVN: r30598
parent 06a964de
Sun Nov 21 17:11:13 1999 Geoffrey Keating <geoffk@cygnus.com>
* varasm.c (output_constructor): Solve problem with long long
bitfields, even on BYTES_BIG_ENDIAN machines (testcase 991118-1).
Fri Nov 19 06:32:19 CET 1999 Jan Hubicka <hubicka@freesoft.cz> Fri Nov 19 06:32:19 CET 1999 Jan Hubicka <hubicka@freesoft.cz>
* i386.md (neg, not and abs patterns): Revmap to use * i386.md (neg, not and abs patterns): Revmap to use
......
1999-11-19 Geoffrey Keating <geoffk@cygnus.com>
* gcc.c-torture/execute/991118-1.c: Also test case
where the word boundary does not split a byte evenly.
1999-11-19 Nathan Sidwell <nathan@acm.org> 1999-11-19 Nathan Sidwell <nathan@acm.org>
* g++.old-deja/g++.ext/restrict1.C: New test. * g++.old-deja/g++.ext/restrict1.C: New test.
......
...@@ -10,6 +10,18 @@ struct tmp2 ...@@ -10,6 +10,18 @@ struct tmp2
long long int pad : 12; long long int pad : 12;
}; };
struct tmp3
{
long long int pad : 11;
long long int field : 53;
};
struct tmp4
{
long long int field : 53;
long long int pad : 11;
};
struct tmp struct tmp
sub (struct tmp tmp) sub (struct tmp tmp)
{ {
...@@ -24,8 +36,24 @@ sub2 (struct tmp2 tmp2) ...@@ -24,8 +36,24 @@ sub2 (struct tmp2 tmp2)
return tmp2; return tmp2;
} }
struct tmp3
sub3 (struct tmp3 tmp3)
{
tmp3.field ^= 0x0018765412345678LL;
return tmp3;
}
struct tmp4
sub4 (struct tmp4 tmp4)
{
tmp4.field ^= 0x0018765412345678LL;
return tmp4;
}
struct tmp tmp = {0x123, 0x123456789ABCDLL}; struct tmp tmp = {0x123, 0x123456789ABCDLL};
struct tmp2 tmp2 = {0x123456789ABCDLL, 0x123}; struct tmp2 tmp2 = {0x123456789ABCDLL, 0x123};
struct tmp3 tmp3 = {0x123, 0x1FFFF00000000LL};
struct tmp4 tmp4 = {0x1FFFF00000000LL, 0x123};
main() main()
{ {
...@@ -40,6 +68,12 @@ main() ...@@ -40,6 +68,12 @@ main()
abort (); abort ();
if (tmp2.pad != 0x123 || tmp2.field != 0xFFF9551175BDFDB5LL) if (tmp2.pad != 0x123 || tmp2.field != 0xFFF9551175BDFDB5LL)
abort (); abort ();
tmp3 = sub3 (tmp3);
tmp4 = sub4 (tmp4);
if (tmp3.pad != 0x123 || tmp3.field != 0xFFF989AB12345678LL)
abort ();
if (tmp4.pad != 0x123 || tmp4.field != 0xFFF989AB12345678LL)
abort ();
exit (0); exit (0);
} }
...@@ -4536,7 +4536,8 @@ output_constructor (exp, size) ...@@ -4536,7 +4536,8 @@ output_constructor (exp, size)
if (shift < HOST_BITS_PER_WIDE_INT if (shift < HOST_BITS_PER_WIDE_INT
&& shift + this_time > HOST_BITS_PER_WIDE_INT) && shift + this_time > HOST_BITS_PER_WIDE_INT)
{ {
this_time = (HOST_BITS_PER_WIDE_INT - shift); this_time = shift + this_time - HOST_BITS_PER_WIDE_INT;
shift = HOST_BITS_PER_WIDE_INT;
} }
/* Now get the bits from the appropriate constant word. */ /* Now get the bits from the appropriate constant word. */
......
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