avr-gcc-list
[Top][All Lists]
Advanced

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

Re: [avr-gcc-list] optimizer removes volatile pin access code. why?


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] optimizer removes volatile pin access code. why?
Date: Tue, 27 Oct 2009 20:17:46 +0100 (MET)

Joerg Desch <address@hidden> wrote:

> With -Os enables, the setup of the port pin is removed! Without
> optimization the pin toggles as expected.

How did you verify it?

I don't believe the compiler removed the code.  (If you really think
it does, please supply a compilable code example.)  However, the
optimized code will just toggle the pin for a single CPU cycles only,
while the pin will stay a little longer at high in the non-optimized
example.  So if your oscilloscope is too slow, you might not notice
the pin actually becoming high for one clock period.

-- 
cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)




reply via email to

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