[Top][All Lists]

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

Re: [avr-gcc-list] Avr-gcc Produces Incorrect Code with -Os

From: Thomas D. Dean
Subject: Re: [avr-gcc-list] Avr-gcc Produces Incorrect Code with -Os
Date: Thu, 15 May 2008 09:56:38 -0700 (PDT)

I changed the code to

   asm volatile("sbi 0x14, 4"::);
   atn_rad = atan2(cos_rad,sin_rad);
   asm volatile("cbi 0x14, 4"::);

and the compiler still reordered the statements to put both the sbi
and cbi statements before the atan().

Changing atan2() to asin() or acos() gives the same incorrect result.

Changing atan2() to sin() keeps the statements in the correct order.


reply via email to

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