This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/15306] Spurious "use of memory input without lvalue" warning
- From: "pgonzalez at bluel dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 6 May 2004 11:32:14 -0000
- Subject: [Bug c/15306] Spurious "use of memory input without lvalue" warning
- References: <20040506051145.15306.pgonzalez@bluel.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pgonzalez at bluel dot com 2004-05-06 11:32 -------
(In reply to comment #1)
> You want a constant but without the "immediate operand" syntax. Try the "i"
> constraint and %c0 to substitute.
This also produces the "ldr r1,#_Z15exampleFunctionv" output. I think
these problems are an idiosyncrasy of the ARM target. FYI the exact code
I tried was:
void exampleFunction() {
}
__attribute__((naked))
void thunk() {
asm volatile(
" stmfd sp!, {r0, r1, r2, r3, ip, lr, pc}\n"
" ldr r1, %c0\n"
" b overlayLoader\n"
: : "i"(exampleFunction) : "cc"
);
}
and the error was:
Test.s: Assembler messages:
Test.s:45: Error: bad expression -- `ldr r1,#_Z15exampleFunctionv'
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15306