https://gcc.gnu.org/bugzilla/show_bug.cgi?id=129091

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2026-11-27

--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

The code in question:
```
      /* THISSIZE must not overrun a word boundary.  Otherwise,
         store_fixed_bit_field will call us again, and we will mutually
         recurse forever.  */
      thissize = MIN (bitsize - bitsdone, BITS_PER_WORD);
      thissize = MIN (thissize, unit - thispos);

      if (reverse ? !BYTES_BIG_ENDIAN : BYTES_BIG_ENDIAN)
        {
          /* Fetch successively less significant portions.  */
          if (CONST_INT_P (value))
            part = GEN_INT (((unsigned HOST_WIDE_INT) (INTVAL (value))
                             >> (bitsize - bitsdone - thissize))
                            & ((HOST_WIDE_INT_1 << thissize) - 1));
          /* Likewise, but the source is little-endian.  */
          else if (reverse)
            part = extract_fixed_bit_field (word_mode, value, value_mode,
                                            thissize,
                                            bitsize - bitsdone - thissize,
                                            NULL_RTX, 1, false);
          else
            /* The args are chosen so that the last part includes the
               lsb.  Give extract_bit_field the value it needs (with
               endianness compensation) to fetch the piece we want.  */
            part = extract_fixed_bit_field (word_mode, value, value_mode,
                                            thissize,
                                            total_bits - bitsize + bitsdone,
                                            NULL_RTX, 1, false);
        }
      else
        {
          /* Fetch successively more significant portions.  */
          if (CONST_INT_P (value))
            part = GEN_INT (((unsigned HOST_WIDE_INT) (INTVAL (value))
                             >> bitsdone)
                            & ((HOST_WIDE_INT_1 << thissize) - 1));
          /* Likewise, but the source is big-endian.  */
          else if (reverse)
            part = extract_fixed_bit_field (word_mode, value, value_mode,
                                            thissize,
                                            total_bits - bitsdone - thissize,
                                            NULL_RTX, 1, false);
          else
            part = extract_fixed_bit_field (word_mode, value, value_mode,
                                            thissize, bitsdone, NULL_RTX,
                                            1, false);
        }

```

When thissize is 64, there is no need for a mask ...

Reply via email to