Re: [RFC] LRA: Carrying hard registers around
Richard Biener via Gcc <[email protected]> Thu, 25 Jun 2026 09:18:45 +0200
| Newsgroups | gmane.comp.gcc.devel |
|---|---|
| Message-ID | <CAFiYyc12yenD3tF6kb6CfHi2VDvst_UVNBdffX6YpK6nWFyFpA@mail.gmail.com> |
On Wed, Jun 24, 2026 at 7:34 PM Michael Matz via Gcc <[email protected]> wrote: > > 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 :-) They are also "funny" on the GIMPLE side with workarounds not to break them. Richard. > > 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.