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

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

Re: [avr-gcc-list] [avr] GCCAVR Bug


From: Jason Kyle
Subject: Re: [avr-gcc-list] [avr] GCCAVR Bug
Date: Tue Jan 9 21:39:04 2001

Anyone know if this was fixed?  Seem to recall something about it a long
time ago.  Ron is using the Volker Oth win32 build (2.95.2 + patch). Tried
it with avr-gcc-20001225 libc-20000730 and the code looked okay to me.

At 01:14 8/01/01 -0800, you wrote:
>Hi All
>
>This little C snippet embodies a bug in gccavr that cost me considerable
>trackdown time in a larger program. The key is the if statement combined
>with the following statement containing an array reference. If you run this
>in AVRStudio the array statement gets executed every time. Doesn't matter if
>the array is local or global. Change the following statement to a simple
>variable assign and all is well. Change the "if" to (a > b) and all is well.
>
>#include <stdlib.h>
>
>#define  LIMIT      25.0
>#define  MAXENTRY   5
>
>int main(void);
>
>int sum[MAXENTRY];
>
>int main(void)
>{
>   int i;
>   float a, b;
>
>   a = 10.0;
>   b = LIMIT;
>   for (i=0; i<MAXENTRY; i++)
>   {
>      if (a >= b)
>      {
>         sum[i] = sum[i] + 1;
>      }
>      b += LIMIT;
>   }
>
>   return 0;
>}
>
>I was going to post this off to Volker but he seems to have vanished. I then
>thought I would go look for the bug in the gccavr source, but the actual
>compiler code that generates the avr statements does not seem to be part of
>his package.
>
>Does anybody know who we can refer gccavr bugs to? Does anybody know whether
>the AVR port to gcc is available so we can try to fix this sort of bug
>ourselves?
>
>Cheers
>Ron Kreymborg
>
>
>
>
>AVR, it's just better.
>
>
>
>
>
>_______________________________________________
>avr-gcc-list mailing list
>address@hidden
>http://avr.jpk.co.nz/mailman/listinfo/avr-gcc-list
>
>




reply via email to

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