Article View: gnu.gcc.bug
Article #6023Incorrect size of structure on m68k-sun-sunos4.1.1 gcc2.7.2
From: Nate Bohlmann
Date: Sun, 05 Jan 1997 00:00
Date: Sun, 05 Jan 1997 00:00
37 lines
1856 bytes
1856 bytes
I have discovered a bug in the 2.7.2 version of GCC which causes the
compiler to miscalculate the size of a structure for an m68k-sun-sunos4.1.1
machine. The following structure should be one byte in length but the
compiler calculates it as two bytes.
struct FlagByte{
unsigned char flag1 : 1;
unsigned char flag2 : 1;
unsigned char flag3 : 1;
unsigned char flag4 : 1;
unsigned char flag5 : 1;
unsigned char flag6 : 1;
unsigned char flag7 : 1;
unsigned char flag8 : 1;
}
this code generates the following stab:
.stabs "FlagByte:T20=s2flag1:11,0,1;flag2:11,1,1;\\",128,0,0,0
.stabs "flag3:11,2,1;flag4:11,3,1;flag5:11,4,1;\\",128,0,0,0
.stabs "flag5:11,2,1;flag6:11,3,1;flag7:11,4,1;\\",128,0,0,0
This seems to occur for all odd-numbered length structs so it looks like
the compiler is promoting the length to be on a word boundry.
I am willing to do all the digging necessary to fix this but do not know
where to start so if someone knows immediately where to look, let me know.
Or, better yet, if anyone has a patch for this, it'd be much appreciated.
Thanks,
Nate
--
Nathan Bohlmann preferred --> njb@elfwerks.com
Elfwerks Consulting http://www.elfwerks.com/~njb
Technical Details
Message-ID:
<9701060157.AA07344@vu-alumni.elfwerks.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113d02,24e06586982adde0,start X-Google-Attributes: gid113d02,public From: njb@elfwerks.com (Nate Bohlmann) Subject: Incorrect size of structure on m68k-sun-sunos4.1.1 gcc2.7.2 Date: 1997/01/05 Message-ID: <9701060157.AA07344@vu-alumni.elfwerks.com> X-Deja-AN: 207967038 sender: bug-gcc-request@prep.ai.mit.edu content-type: text/plain; charset=US-ASCII x-gateway: relay2.UU.NET from bug-gcc to gnu.gcc.bug; Sun, 5 Jan 1997 21:13:22 EST mime-version: 1.0 newsgroups: gnu.gcc.bug x-mailer: ELM [version 2.4 PL24]