[Bug middle-end/47602] Permit inline asm to clobber PIC register

ebotcazou at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 4 08:49:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47602

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot
                   |                            |gnu.org

--- Comment #9 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-02-04 08:48:46 UTC ---
> I'm suggesting saving and restoring it around the asm statement itself, not in
> the prologue and epilogue.

Although the error was primarily RTH's idea, I still think it's very
reasonable.
When you write inline asm, you're expecting a certain degree of control over
the generated code; knowing that you're clobbering the PIC register can be
useful, especially on a register-starved architecture like the x86.  If you
stand by your clobbering, then writing the conditional save-and-restore code is
trivial.



More information about the Gcc-bugs mailing list