This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: x86 PIC regressions
> Date: Fri, 18 Sep 1998 09:54:30 -0700
> From: Richard Henderson <rth@cygnus.com>
> On Fri, Sep 18, 1998 at 06:30:57PM +1000, Geoffrey KEATING wrote:
> > I draw your attention to
> >
> > extern int foo;
> > int something() {
> > asm ("" : "r"(&foo));
> > }
> >
> > which causes reload to pass (mem (symbol_ref "foo")) to mov*.
>
> Is there any particular reason we don't run validize this
> during initial rtl generation?
Oops. What I meant, of course, was
extern int foo;
int something() {
asm ("" : : "r"(&foo));
return 0;
}
which gets turned into
(insn 7 6 10 (asm_operands/v ("") ("") 0[
(symbol_ref:SI ("@foo"))
]
[
(asm_input:SI ("r"))
] ("t.c") 3) -1 (nil)
(nil))
I believe the reason it doesn't get modified is that until reload,
nothing looks at the constraints of an asm, and it might be
asm ("" : : "i"(&foo))
or similar.
--
Geoff Keating <Geoff.Keating@anu.edu.au>