https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84010
--- Comment #5 from James Clarke <jrtc27 at jrtc27 dot com> --- My patch seems to work for this case: sethi %tie_hi22(tcg_ctx), %g2 ... add %g2, %tie_lo10(tcg_ctx), %g1 ldx [%l7 + %g1], %g1, %tie_ldx(tcg_ctx) stx %g2, [%fp+1783] ! note this is %g2, i.e. just the hi22... call gen_new_label, 0 ldx [%g7+%g1], %i5 ... ldx [%fp+1783], %g1 ! reload the hi22 add %g1, %tie_lo10(tcg_ctx), %i5 ldx [%l7 + %i5], %i5, %tie_ldx(tcg_ctx) ldx [%g7+%i5], %g1 The code gen is something else; I don't understand why it spills the result of the hi22 and re-adds the lo10 (which takes the worst aspects of rematerialisation and spilling), but that's a whole other story.