This is the mail archive of the binutils@sourceware.org mailing list for the binutils 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]

RFC: Bogus gimplification type mismatch error ?


Hi Guys,

  I tried bootstrapping the mainline gcc sources over the weekend,
  using the current mainline binutils sources in an integrated source
  tree.  The bootstrap failed with a problem in bfd/elflink.c which I
  have already reported and worked around.  The build then failed
  later on with this error message:

    opcodes/i386-dis.c:4213: error: type mismatch in pointer plus expression
    struct dis386 *
    struct dis386[8] *
    unsigned int 
    dp = &float_reg + D.7721

  I tracked this down to this line in i386-dis.c:

    dp = &float_reg[floatop - 0xd8][modrm.reg];

  where the variables involved are typed as:

    const struct dis386 *dp;
    static const struct dis386 float_reg[][8] = { ....

  To me this looks wrong.  Gcc appears to have converted multiple
  deferences of a multidimensional array into a single dereference of
  the multidimensional array.

  I found a workaround by explicitly performing the two dereferences
  one after another like this:

    {
      typedef struct dis386 eight_dis386 [8];
      const eight_dis386 *dp8;

      dp8 = float_reg + (floatop - 0xd8);
      dp = dp8[modrm.reg];
    }

  But before I check such a patch in I would like to know if the gcc
  error message is really correct, or if I have run across a
  gimplification bug.

Cheers
  Nick


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