------- Additional Comments From dberlin at gcc dot gnu dot org 2005-05-31
16:37 -------
This is indeed an salias problem.
This was code i had warned Nathan about changing, for fear that something like
this might be exposed.
Nathan,
if (!var_can_have_subvars (field))
push = true;
else if (!(push_fields_onto_fieldstack
(TREE_TYPE (field), fieldstack,
offset + bitpos_of_field (field)))
&& DECL_SIZE (field)
&& !integer_zerop (DECL_SIZE (field)))
/* Empty structures may have actual size, like in C++. So
see if we didn't push any subfields and the size is
nonzero, push the field onto the stack */
push = true;
fails because DECL_SIZE (field) is 0.
(gdb) p debug_tree (field)
<field_decl 0x401bd2f4 lock
type <record_type 0x401bd144 spinlock_t type_0 BLK
size <integer_cst 0x40140990 constant invariant 0>
unit size <integer_cst 0x401401b0 constant invariant 0>
align 8 symtab 0 alias set -1 context <translation_unit_decl 0x401bd804
D.1247>>
BLK file /home/dberlin/saliastest.c line 4 size <integer_cst 0x40140990 0>
unit size <integer_cst 0x401401b0 0>
align 8 offset_align 128 offset <integer_cst 0x401401b0 0>
bit offset <integer_cst 0x40140408 type <integer_type 0x40148288
bit_size_type> constant invariant 32> context <record_type 0x401bd1b0> arguments
<integer_cst 0x401401b0 0>>
But we still need to push it onto the fieldlist anyway, because we have an
access to that member.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |nathan at codesourcery dot
| |com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=21839