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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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 of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux