This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PARM_DECL of DECL_SIZE 0, but TYPE_SIZE of 96 bits


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]