avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[avr-libc-dev] Inline assembler and compiler optimization


From: Harald Kipp
Subject: [avr-libc-dev] Inline assembler and compiler optimization
Date: Tue, 17 Mar 2009 10:39:40 +0100
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

Hi all,

After we had some problems with inline assembly code in Nut/OS, Duane
Ellis explained to us, why compiler optimization may cause trouble with
inline assembler statements.
http://www.egnite.de/pipermail/en-nut-discussion/2008-February/008947.html

I updated
http://www.ethernut.de/en/documents/arm-inline-asm.html
recently to publish the results.

As this is all ARM stuff, you may want to concentrate on the chapter "C
code optimization".

Today I looked to avr-libc and found

# define sei()  __asm__ __volatile__ ("sei" ::)

According to the document above, this may not work as expected. It
should have been

# define sei()  __asm__ __volatile__ ("sei" :: "memory")

In fact I couldn't find a single memory clobber in avr-libc 1.6.2.

Did I overlook soemthing? Any comments are most welcome.

Harald




reply via email to

[Prev in Thread] Current Thread [Next in Thread]