public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Daniel Berlin <dberlin@dberlin.org>
To: Gcc Mailing List <gcc@gcc.gnu.org>
Subject: PARM_DECL of DECL_SIZE 0, but TYPE_SIZE of 96 bits
Date: Wed, 29 Jun 2005 22:57:00 -0000	[thread overview]
Message-ID: <1120085832.7612.81.camel@linux-009002219098> (raw)

Why is that C++ can't create normal DECL's like everyone else?

Case in point:

(gdb)
 <parm_decl 0x40125000 it
    type <record_type 0x4010b2f4 node_iterator needs-constructing type_1
type_5 type_6 BLK
        size <integer_cst 0x4002aa80 constant invariant 96>
        unit size <integer_cst 0x4002aa98 constant invariant 12>
...

    addressable used BLK file minimal.c line 194 size <integer_cst
0x4002a960 0> unit size <integer_cst 0x4002a198 0>
$11 = void
(gdb) y



So we've got a parm decl that if you ask it for the DECL_SIZE, says 0,
but has a TYPE_SIZE of 12 bytes, and we access fields in it, etc.


This is causing a bug in detecting what portions of structures are used
in tree-ssa-alias, because we use DECL_SIZE, and this causes us to think
we use no part of the structure, since it gets min/max of 0!


I'm going to work around this by using TYPE_SIZE, but it would be nice
if somebody could explain the purpose for this behavior (if it's a bug,
i'll file a bug report). I would imagine we don't have truly empty
things in C++, so you could simply assert that TREE_INT_CST_LOW of
whatever you are setting DECL_SIZE to is not 0 and find these that way.


--Dan



             reply	other threads:[~2005-06-29 22:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-29 22:57 Daniel Berlin [this message]
2005-06-29 23:55 ` Richard Henderson
2005-06-30  1:17   ` Daniel Berlin
2005-06-30  4:35     ` [C++] " Richard Henderson
2005-06-30 21:12       ` Geoffrey Keating
2005-07-01  1:47         ` Daniel Berlin
2005-07-05  6:25           ` Mark Mitchell
2005-07-05 15:35     ` Mark Mitchell
2005-07-05 16:18       ` Daniel Berlin
2005-06-30 18:48 ` Giovanni Bajo
2005-06-30 19:02   ` Daniel Berlin

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=1120085832.7612.81.camel@linux-009002219098 \
    --to=dberlin@dberlin.org \
    --cc=gcc@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).