>Number: 10857
>Category: inline-asm
>Synopsis: Inlining a function with inline-asm: "error: impossible constraint in `asm'"
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Mon May 19 11:16:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Bernd Trog
>Release: gcc-3.3.0
>Organization:
>Environment:
avr-gcc -v
Reading specs from /src/build/gcc-330/lib/gcc-lib/avr/3.3/specs
Configured with: /src/gcc-330/configure -v --target=avr --prefix=/src/build/gcc-330 --with-gnu-ld --with-gnu-as --disable-nls --enable-languages=c,ada
Thread model: single
gcc version 3.3
>Description:
$ avr-gcc test.c
test.c: In function `write_byte':
test.c:8: warning: asm operand 0 probably doesn't match constraints
test.c:8: error: impossible constraint in `asm'
Note: The information for operand 0 is available
at compile-time(#define PORTD 0x12)!
>How-To-Repeat:
#define PORTD 0x12
static
inline
void
write_byte( unsigned char adr, unsigned char data )
{
asm("out %0, %1" : : "I" (adr), "r" (data) );
}
int main(void)
{
write_byte( PORTD, 4);
return 0;
}
>Fix:
unknown
>Release-Note:
>Audit-Trail:
>Unformatted:
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.