This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: GCC proposal for "@" asm constraint
Andrea Arcangeli wrote:
> > p is a variable. The _address_ of p is constant, but the reload is
> > not loading the address of p, it's loading the _value_. That value can
>
> Wrong: it's really loading the _address_. The value that is loaded into the
> register is the addess of p that is stored only in the .text and that is an
> immediate value embedded into the opcodes of the asm.
>
> If you can change the address it it means it's selfmodifying code, and GCC
> shouldn't really assume anything about that so GCC is _wrong_.
>
...
> 80483f5: a1 a4 95 04 08 mov 0x80495a4,%eax
That instruction loads the _value_ of p. I.e. reads the memory from
location 0x80495a4 into %eax. The source instruction was:
movl p,%eax
The instructions that you're thinking of, that load fixed addresses,
look like these:
mov $0x80495a4,%eax
lea 0x80495a4,%eax
or in source form:
movl $p,%eax
leal p,%eax
You must be working too hard.
Please take a short break, relax, enjoy nature again :-)
have a nice day,
-- Jamie