On Wed, Jun 04, 2025 at 05:07:13PM +0200, Jakub Jelinek wrote: > On Wed, Jun 04, 2025 at 05:02:45PM +0200, Stefan Schulze Frielinghaus wrote: > > Building a subreg in case of > > > > else if (GET_CODE (x) == CONST) > > { > > /* Extract the symbol ref from: > > (mem:QI (const:DI (unspec:DI [(symbol_ref:DI ("foo"))] > > UNSPEC_PLT/GOTENT))) */ > > Shouldn't that have one extra MEM somewhere?
The MEM referred to in the comment was stripped of previously: if (GET_CODE (x) != MEM) return orig_x; x = XEXP (x, 0); if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST && GET_CODE (XEXP (x, 0)) == REG && REGNO (XEXP (x, 0)) == PIC_OFFSET_TABLE_REGNUM) { y = XEXP (XEXP (x, 1), 0); if (GET_CODE (y) == UNSPEC && XINT (y, 1) == UNSPEC_GOT) y = XVECEXP (y, 0, 0); else return orig_x; } else if (GET_CODE (x) == CONST) { /* Extract the symbol ref from: (mem:QI (const:DI (unspec:DI [(symbol_ref:DI ("foo"))] UNSPEC_PLT/GOTENT))) */ y = XEXP (x, 0); if (GET_CODE (y) == UNSPEC && (XINT (y, 1) == UNSPEC_GOTENT || XINT (y, 1) == UNSPEC_PLT31)) y = XVECEXP (y, 0, 0); else return orig_x; } else return orig_x; if (GET_MODE (orig_x) != Pmode) { if (GET_MODE (orig_x) == BLKmode) return orig_x; y = lowpart_subreg (GET_MODE (orig_x), y, Pmode); if (y == NULL_RTX) return orig_x; } return y; } or did you mean another one? Cheers, Stefan