This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/23200] [4.0/4.1/4.2 regression] rejects "i"(&var + 1)
- From: "stsp at users dot sourceforge dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 5 Oct 2006 19:29:47 -0000
- Subject: [Bug inline-asm/23200] [4.0/4.1/4.2 regression] rejects "i"(&var + 1)
- References: <bug-23200-11104@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #25 from stsp at users dot sourceforge dot net 2006-10-05 19:29 -------
> "i"(&var) of course can't work with -fpic,
I tried it on an x86_64 today, and it seems to work.
If I use -m32, then it doesn't. Why?
> it would only work at the expense
> of text relocations, but those are not allowed on some architectures and
> highly undesirable on the rest of architectures.
Is this to always keep the .text section r/o?
> In position independent code,
> &var typically means you need to load that address from global offset table
So, as I understand your answer, the relocation at dynamic-link time
is not implemented at all (even on the arches where it is possible)?
> into a register, and a register of course can't satisfy "i" constraint.
Thanks for the hint. It looks like the things like "a"(&var) do
work with -fpic, which should be fine for my needs.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=23200