Hello,
On Wed, 24 Jun 2026, Stefan Schulze Frielinghaus wrote:
> > > Due to register asm, hard register r18 is live across the division.
> >
> > And that's the bogosity. The register variable r18 can live in a
> > pseudo during that division, and _should_ live in a pseudo outside of
> > the specific setup/teardown sequences of the two inline asms.
>
> This is not how register asm is implemented in GCC. During expand
> assignments involving register asm reduce to simple hard register
> assignments (that is the whole point why I came up with [1] which is
> supposed to fix at least this). There are no pseudos involved.
That's the problem then. Register vars should expand to pseudos, and as
you can see in this thread I was pretty sure that its done that way after
all the years and something just broke that. Also see the bug Alexander
referenced, where also Segher agreed. Consider me baffled and surprised
that not more breaks left and right :-)
So, I don't want to distract you much further, and will get back to under
my stone, but I think instead of trying to rectify this brokenness it
would be better in the grander scheme of things if register vars were just
finally expanded as pseudos, with copy-in/out around inline asms.
(perhaps even copy-in/out around statements that aren't inline asms but
refer to the variable, just so to keep historic broken uses like "register
long stackp asm("sp"); return stackp;" working :-) )
Ciao,
Michael.