public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/12999] New: Internal compiler error for syntax error with __attribute__ ((packed))
@ 2003-11-10 22:29 tron dot thomas at verizon dot net
2003-11-10 22:35 ` [Bug c++/12999] " bangerth at dealii dot org
0 siblings, 1 reply; 2+ messages in thread
From: tron dot thomas at verizon dot net @ 2003-11-10 22:29 UTC (permalink / raw)
To: gcc-bugs
Save the following code in a module name StructSize.c:
#include <stdio.h>
typedef unsigned char ILubyte;
typedef unsigned short ILushort;
typedef short ILshort;
int main()
{
#pragma pack(1)
typedef struct TARGAHEAD
{
ILubyte IDLen;
ILubyte ColMapPresent;
ILubyte ImageType;
ILshort FirstEntry;
ILshort ColMapLen;
ILubyte ColMapEntSize;
ILshort OriginX;
ILshort OriginY;
ILushort Width;
ILushort Height;
ILubyte Bpp;
ILubyte ImageDesc;
} TARGAHEAD; __attribute__ ((packed)) TARGAHEAD;
#pragma pack()
printf("The structure size is %d bytes.\n", sizeof(TARGAHEAD));
return 0;
}
Note the code has a synatax error after the typedef statement for TARGAHEAD.
Attempt to build the code using the command: g++ -o StructSize StructSize.c
On version 3.3.2 of the GNU compiler the following output occurs:
StructSize.c: In function `int main()':
StructSize.c:25: internal compiler error: Bus error
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Found a Macintosh G4 system running Mac OS X 10.2.8.
--
Summary: Internal compiler error for syntax error with
__attribute__ ((packed))
Product: gcc
Version: 3.3.2
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: tron dot thomas at verizon dot net
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12999
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug c++/12999] Internal compiler error for syntax error with __attribute__ ((packed))
2003-11-10 22:29 [Bug c++/12999] New: Internal compiler error for syntax error with __attribute__ ((packed)) tron dot thomas at verizon dot net
@ 2003-11-10 22:35 ` bangerth at dealii dot org
0 siblings, 0 replies; 2+ messages in thread
From: bangerth at dealii dot org @ 2003-11-10 22:35 UTC (permalink / raw)
To: gcc-bugs
------- Additional Comments From bangerth at dealii dot org 2003-11-10 22:35 -------
Confirmed. Here's something smaller:
--------------------
void foo() {
typedef struct
{
int i;
} S; __attribute__ ((packed)) S;
}
--------------------
This ICEs with everything up to gcc3.3.2, so it's not a regression. In
addition, it is fixed in mainline, which reports
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/gcc -c x.cc
x.cc: In function `void foo()':
x.cc:5: error: declaration does not declare anything
So this is fixed.
W.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Keywords| |ice-on-invalid-code
Resolution| |FIXED
Target Milestone|--- |3.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12999
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-11-10 22:35 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-10 22:29 [Bug c++/12999] New: Internal compiler error for syntax error with __attribute__ ((packed)) tron dot thomas at verizon dot net
2003-11-10 22:35 ` [Bug c++/12999] " bangerth at dealii dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).