This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/49459] New: attribute((mode(byte))) in a typedef produces wrong debug information
- From: "pkoning at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 17 Jun 2011 18:29:10 +0000
- Subject: [Bug c/49459] New: attribute((mode(byte))) in a typedef produces wrong debug information
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49459
Summary: attribute((mode(byte))) in a typedef produces wrong
debug information
Product: gcc
Version: 4.5.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: pkoning@gcc.gnu.org
Created attachment 24554
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24554
Test case
The attached test case shows attribute((mode(byte))) used to produce enums that
are one byte long rather than the usual 4.
The compiler actually sees the correct value of sizeof() but GDB (7.2) does
not. This can be seen by compiling the test case; gdb shows the value of s1
as 1, but sizeof(foo) as 4.
When compiled with GCC 3.3.3, s1 and sizeof(foo) both show up as 1, as
expected.