This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/15306] Spurious "use of memory input without lvalue" warning


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]