Linux/ia64 failed to bootstrap

Eric Botcazou ebotcazou@libertysurf.fr
Fri Jun 27 16:37:00 GMT 2003


> As a bit of extra context: this also seems to be causing a bootstrap
> failure on mips-sgi-irix6.5, where the following code in c-decl.c is
> being miscompiled:
>
>   if (void_at_end && parms != 0
>       && TREE_CHAIN (parms) == 0
>       && VOID_TYPE_P (TREE_TYPE (parms))
>       && ! TREE_THIS_VOLATILE (parms)
>       && ! TREE_READONLY (parms)
>       && ! DECL_REGISTER (parms)
>       && DECL_NAME (parms) == 0)
>     {
>       parms = NULL_TREE;
>       storedecls (NULL_TREE);
>       return tree_cons (NULL_TREE, NULL_TREE,
> 			tree_cons (NULL_TREE, void_type_node, NULL_TREE));
>     }
>
> fold-const tries to combine the tree flag checks but ends up treating
> them as 32-bit values rather than 1-bit values.
>
> Reduced test case:
>
>     struct s {
>       unsigned a : 1;
>       unsigned b : 1;
>       unsigned c : 1;
>       double d;
>     };
>
>     int foo (struct s *s)
>     {
>       return (!s->b && !s->c);
>     }
>
> which gets compiled as:
>
>         li      $3,1                    # $3=1
>         ld      $2,0($4)
>         dsll    $3,$3,33                # $3=0x00000002_00000000
>         daddiu  $3,$3,-1                # $3=0x00000001_ffffffff
>         dsll    $3,$3,30                # $3=0x7fffffff_c0000000
>         and     $2,$2,$3
>         j       $31
>         sltu    $2,$2,1
>
> The mask being applied should be 0x60000000_00000000 instead.
>
> I can look into this tomorrow if no-one beats me to it.

I'm building a cross-compiler right now. Thanks for the reduced testcase.

-- 
Eric Botcazou



More information about the Gcc mailing list