[PATCH]: Make valgrind happy with tree-ssa-structalias.c

Daniel Berlin dberlin@dberlin.org
Wed Sep 21 15:28:00 GMT 2005


On Wed, 2005-09-21 at 11:14 -0400, Andrew Pinski wrote:
> On Sep 21, 2005, at 11:09 AM, Daniel Berlin wrote:
> 
> > In get_constraint_for_component_ref, it is apparently possible for
> > bitsize to not be set by get_inner_reference, even though that would
> > have to be a bug, since it would imply either that DECL_SIZE of a
> > FIELD_DECL is NULL, or the first operand of a BIT_FIELD_REF was NULL.
> >
> > In fact, adding the following assert to get_inner_reference before the
> > check for size_tree != 0, finds the real bug here:
> >
> > gcc_assert (size_tree != 0 || (TREE_CODE (exp) != COMPONENT_REF  &&
> > TREE_CODE (exp) != BIT_FIELD_REF));
> >
> > we get a component_ref with:
> >
> >  arg 1 <field_decl 0x403462e0 augmentation type <array_type 0x40346284>
> >         BLK file ../../gcc/unwind-dw2-fde.h line 145
> >         align 8 offset_align 128
> >         offset <integer_cst 0x401691b0 constant invariant 0>
> >         bit offset <integer_cst 0x403450f0 constant invariant 72>
> > context <record_type 0x403460b8 dwarf_cie>>>
> >
> > DECL_SIZE on this field_decl is NULL.  I was always under the 
> > impression
> > that DECL_SIZE should always be set, even if it was to a non-constant
> > value.
> 
> DECL_SIZE is null when the type is not a complete type.

Uh, if the type is incomplete, it shouldn't be in the middle of a
COMPONENT_REF in the middle end.
:)





More information about the Gcc-patches mailing list