[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Inline assembler now geenerates an error message
From: |
Bernd Trog |
Subject: |
Re: [avr-gcc-list] Inline assembler now geenerates an error message |
Date: |
Tue, 4 Nov 2003 15:08:36 -0800 (PST) |
On Sun, 2 Nov 2003, Ebert, Rolf wrote:
> static inline void
> set_io (unsigned char port, unsigned char value) {
David Gay suggessted in
http://www.avr1.org/pipermail/avr-gcc-list/2003-July/004874.html
this:
set_io (const unsigned char port, const unsigned char value) {
> avr-inline-pb.c: In function `main':
> avr-inline-pb.c:3: warning: asm operand 1 probably doesn't match constraints
> avr-inline-pb.c:3: error: impossible constraint in `asm'
> avr-inline-pb.c: In function `set_io':
> avr-inline-pb.c:3: warning: asm operand 1 probably doesn't match constraints
When you use 'const' you still get the warnings, but no errors..
> Why don't I simply write my code like this:
>
> #include <avr/io.h>
> ...
> PORTD = 0xAA;
>
>
> Actually, I still want the Ada front end to get in a reasonable,
> i.e. usable, state. Ada does not have a prepocessor which is used
> very cleverly in the above statement.
IMO, the clever part is in the gcc-backend/optimzer - not in the
frontend/macros:
With '-O0'
PORTD = 0xAA;
compiles to
ldi r24, 0xAA ; 170
sts 0x0032, r24
So, the goal should be, to feed the frontend with normal Ada code
and let the backend/optimzer do it's job...somehow...
__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree