This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Trouble with inline void function using asm
- To: gcc at gcc dot gnu dot org
- Subject: Trouble with inline void function using asm
- From: "Jeff Hammond" <jshammond at my-deja dot com>
- Date: Tue, 23 Jan 2001 17:43:34 -0800
Hi,
I am trying to use the following inline function on my compiler.
inline void write_altmem(register short data, register int addr)
{
asm("SALT r%0,r%1,0 ; write_altmem"
: "r"(data) : "r"(addr) );
}
I get the error message:
memaccess.c:11: output operand constraint lacks `='
I didn't think that I would need a '=' since there are no output
variables. When I put an '=' in the first argument there are
no compiler errors but the compiler decides that this function
doesn't do anything and optimizes it out.
Any help with this will be appreciated.
Jeff
------------------------------------------------------------
--== Sent via Deja.com ==--
http://www.deja.com/