Linux/ia64 failed to bootstrap

Richard Sandiford rsandifo@redhat.com
Fri Jun 27 16:33:00 GMT 2003


Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> writes:
> Rainer Orth <ro@techfak.uni-bielefeld.de> writes:
> > "H. J. Lu" <hjl@lucon.org> writes:
> > 
> > > Today's mainline failed to bootstrap on Linux/ia64. Stage1 compiler
> > > is pretty much broken. All generated .c files are different. Has
> > > anyone else seen it?
> > 
> > I'm getting a bootstrap failure on alpha-dec-osf5.1: insn-attrtab.c is
> > different between stages.
> 
> Richard Sandiford pointed out in private mail that this patch
> 
> 2003-06-18  Eric Botcazou  <ebotcazou@libertysurf.fr>
> 
> 	PR optimization/11210
> 	* fold-const (decode_field_reference): Strip only NOPs
> 	that don't affect the sign.
> 
> 	http://gcc.gnu.org/ml/gcc-patches/2003-06/msg02094.html
> 
> is likely the culprit.  Reverting it allowed me to continue bootstrap on
> alpha-dec-osf5.1: the insn-attrtab.c differences between stages vanished.

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.

Richard



More information about the Gcc mailing list