This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR optimization/11210
- From: Eric Botcazou <ebotcazou at libertysurf dot fr>
- To: Ulrich Weigand <weigand at i1 dot informatik dot uni-erlangen dot de>
- Cc: wilson at tuliptree dot org,gcc-patches at gcc dot gnu dot org
- Date: Sat, 28 Jun 2003 23:33:45 +0200
- Subject: Re: [PATCH] Fix PR optimization/11210
- References: <200306281514.RAA06458@faui11.informatik.uni-erlangen.de>
> However, it did cause bootstrap failure on s390x due to miscompilation of
> the following snippet from getattrtab.c:
Yes, all 64-bit targets seem to have been affected.
> struct attr_desc
> {
> char *name;
> struct attr_desc *next;
> unsigned is_numeric : 1;
> unsigned negative_ok : 1;
> unsigned unsigned_p : 1;
> unsigned is_const : 1;
> unsigned is_special : 1;
> unsigned func_units_p : 1;
> unsigned blockage_p : 1;
> int lineno;
> };
>
> int
> test (struct attr_desc *attr)
> {
> if (! attr->is_special && ! attr->is_const)
> write_attr_get (attr);
> }
>
> fold_truthop would merge the two struct member accesses into a single
> check, but miscompute the necessary mask because it though the members
> were 32 bits wide instead of a single bit ...
Same problem on MIPS and everywhere else I think.
> > * fold-const (decode_field_reference): Record outermost type in
> > case the expression is a NOP. Strip all NOPs. Set the signedness
> > to that of the outermost type (if any) when the bitsize is equal
> > to the size of the type.
>
> This fixes the bootstrap problem on s390x-ibm-linux.
Thanks for testing the patch.
--
Eric Botcazou