[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:38:22 -0700 (PDT)

>From 'info gcc',

   You can prevent an `asm' instruction from being deleted, moved
significantly, or combined, by writing the keyword `volatile' after the

Changing the code fragment to
  line3[20] = ' ';
  line4[20] = ' ';
  asm volatile("sbi 0x1b,4" : :);         
  atan_rad = atan2(cos_rad,sin_rad);  
  asm volatile("cbi 0x1b,4" : :);         

does not alter the result.

The .elf code is incorrect!

reply via email to

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