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: Denis Chertykov
Subject: Re: [avr-gcc-list] [avr] GCCAVR Bug
Date: Thu Jan 11 08:38:11 2001

Jason Kyle <address@hidden> writes:

> 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;
> >}
> >

Today I have tried this example.
I havn't a bug.

Denis.




reply via email to

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