public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/22318] New: debug info wrong for doubles followed by bools
@ 2005-07-06 1:21 charles at kde dot org
2005-07-06 1:24 ` [Bug debug/22318] " charles at kde dot org
2005-07-06 1:30 ` pinskia at gcc dot gnu dot org
0 siblings, 2 replies; 3+ messages in thread
From: charles at kde dot org @ 2005-07-06 1:21 UTC (permalink / raw)
To: gcc-bugs
This is a problem in gcc's default debug format. It works fine with -gstabs.
struct X
{
bool x;
double d;
};
int main()
{
X x;
x.d = 42.0;
}
When debugging with gdb, x.d will contain something wrong, (often something
like 5.301466631257326e-315). If you change the bool to another type or
remove that variable completely, the results are correct. If you move the bool
to the end of the structure, the results are also correct.
This bug does not affect the execution of the program.
I guess it's something to do with how gcc writes debug info for the size of a
bool in the structure, possibly related to packing.
I'm also able to reproduce this on gcc 3.3.4.
--
Summary: debug info wrong for doubles followed by bools
Product: gcc
Version: 3.3.6
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: debug
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: charles at kde dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: gcc version 3.3.6 (Debian 1:3.3.6-7)
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22318
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2005-07-06 1:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-06 1:21 [Bug debug/22318] New: debug info wrong for doubles followed by bools charles at kde dot org
2005-07-06 1:24 ` [Bug debug/22318] " charles at kde dot org
2005-07-06 1:30 ` pinskia at gcc dot gnu 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).