public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "charles at kde dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/22318] New: debug info wrong for doubles followed by bools
Date: Wed, 06 Jul 2005 01:21:00 -0000	[thread overview]
Message-ID: <20050706012134.22318.charles@kde.org> (raw)

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


             reply	other threads:[~2005-07-06  1:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-06  1:21 charles at kde dot org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050706012134.22318.charles@kde.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).