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

Uroš Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2026-10-06
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
          Component|target                      |rtl-optimization

--- Comment #4 from Uroš Bizjak <ubizjak at gmail dot com> ---
_.fwprop1:

  148: r106:HF=[r118:DI+0x2]
      REG_DEAD r118:DI
  ...
  155: r213:HI=r106:HF#0
      REG_DEAD r106:HF
  156: r214:SI=zero_extend(r213:HI)
      REG_DEAD r213:HI
  159: r209:V2HF=r214:SI#0
      REG_DEAD r216:SI
  160: [r111:DI]=r209:V2HF
      REG_DEAD r209:V2HF

_.ext_dce:

Processing insn:
  156: r214:SI=zero_extend(r213:HI)
      REG_DEAD r213:HI
Trying to simplify pattern:
(zero_extend:SI (reg:HI 213 [ _9 ]))
rescanning insn with uid = 156.
Successfully transformed to:
(subreg:SI (reg:HI 213 [ _9 ]) 0)

  148: r106:HF=[r118:DI+0x2]
      REG_DEAD r118:DI
  ...
  155: r213:HI=r106:HF#0
      REG_DEAD r106:HF
  156: r214:SI=r213:HI#0
      REG_DEAD r213:HI
  159: r209:V2HF=r214:SI#0
      REG_DEAD r214:SI
  160: [r111:DI]=r209:V2HF
      REG_DEAD r209:V2HF

Compilation goes downhill from here.

_.combine:

allowing combination of insns 156 and 159
original costs 4 + 12 = 16
replacement cost 12
deferring deletion of insn with uid = 156.
modifying insn i3   159: r209:V2HF=r213:HI#0
      REG_DEAD r213:HI
deferring rescan insn with uid = 159.

  148: r106:HF=[r118:DI+0x2]
      REG_DEAD r118:DI
  ...
  155: r213:HI=r106:HF#0
      REG_DEAD r106:HF
  156: NOTE_INSN_DELETED
  159: r209:V2HF=r213:HI#0
      REG_DEAD r213:HI
  160: [r111:DI]=r209:V2HF
      REG_DEAD r209:V2HF

So, ext_dce pass is converting zero_extend (insn 156) with defined
high bits to a paradoxical subreg that has undefined high bits.

Confirmed as RTL optimization problem.

Reply via email to