public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* PARM_DECL of DECL_SIZE 0, but TYPE_SIZE of 96 bits
@ 2005-06-29 22:57 Daniel Berlin
  2005-06-29 23:55 ` Richard Henderson
  2005-06-30 18:48 ` Giovanni Bajo
  0 siblings, 2 replies; 11+ messages in thread
From: Daniel Berlin @ 2005-06-29 22:57 UTC (permalink / raw)
  To: Gcc Mailing List

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



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2005-07-05 16:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-29 22:57 PARM_DECL of DECL_SIZE 0, but TYPE_SIZE of 96 bits Daniel Berlin
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

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).