This is the mail archive of the gcc-patches@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]

Re: [PATCH] Fix PR optimization/11210


> 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


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