------- Comment #7 from rguenth at gcc dot gnu dot org 2010-03-26 12:57 -------
(In reply to comment #6)
> > If this is indeed required for tree_low_cst (which is defined as signed
> > HWI!),
> > then the patch that reverses the semantics of my previous patch works as
> > well.
> >
> > Index: stor-layout.c
> > ===================================================================
> > --- stor-layout.c (revision 157742)
> > +++ stor-layout.c (working copy)
> > @@ -1349,9 +1349,9 @@ place_field (record_layout_info rli, tre
> > && host_integerp (TYPE_SIZE (TREE_TYPE (field)), 0)
> > && host_integerp (DECL_SIZE (field), 0))
> > {
> > - HOST_WIDE_INT bitsize = tree_low_cst (DECL_SIZE (field), 1);
> > + HOST_WIDE_INT bitsize = tree_low_cst (DECL_SIZE (field), 0);
> > HOST_WIDE_INT typesize
> > - = tree_low_cst (TYPE_SIZE (TREE_TYPE (field)), 1);
> > + = tree_low_cst (TYPE_SIZE (TREE_TYPE (field)), 0);
> >
> > if (typesize < bitsize)
> > rli->remaining_in_alignment = 0;
>
> Yep, that's the right version.
Well, but negative sizes do not make much sense, so I think ,1 makes more
sense (with unsigned HOST_WIDE_INT then).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43528