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

Strangeness (maybe a bug?) in expmed.c: extract_bit_field_1()



In expmed.c: extract_bit_field_1() I see the following:


      /* On big-endian machines, we count bits from the most significant.
         If the bit field insn does not, we must invert.  */
      if (BITS_BIG_ENDIAN != BYTES_BIG_ENDIAN)
        xbitpos = unit - bitsize - xbitpos;

This produces a negative value for xbitpos for BIG_ENDIAN code, despite the fact that xbitpos is declared unsigned. The code in alpha/alpha.md that it calls promptly converts the bit offset back to its original value, and I have to do the same for my own BIG_ENDIAN port.

This smells like a bug, although I suspect changing it would break existing ports.

Thoughts?

--jeff


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