[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-gcc-list] wrong code from avr-gcc 4.1.2?
From: |
Weddington, Eric |
Subject: |
RE: [avr-gcc-list] wrong code from avr-gcc 4.1.2? |
Date: |
Sun, 1 Jun 2008 21:28:36 -0600 |
Hi Dr. John,
Are you using a particular WinAVR version? i.e. a patched avr-gcc 4.1.2?
Or is this stock FSF 4.1.2?
Can you post the compiler output?
Sorry, but most of the developers are dealing with HEAD/4.4 or maybe
4.3.0. I understand that you're using 4.1.2 for TinyOS.
Eric
> -----Original Message-----
> From:
> address@hidden
> [mailto:address@hidden
> org] On Behalf Of John Regehr
> Sent: Sunday, June 01, 2008 9:14 PM
> To: address@hidden
> Subject: [avr-gcc-list] wrong code from avr-gcc 4.1.2?
>
> In the code below, avr-gcc 4.1.2 wants to return 1 from func_1() when
> compiling at -Os. Specifically I'm compiling like this:
>
> avr-gcc -fwrapv -Os -mmcu=atmega128 foo.c
>
> I believe the correct answer is 0 (this is what avr-gcc-4.2.2
> returns at
> all optimization levels). I don't think the -fwrapv is relevant here
> but include it to be on the safe side.
>
> John Regehr
>
>
>
> static inline unsigned long int
> div_rhs(const long int rhs)
> {
> if (rhs == 0) return 1;
> return rhs;
> }
>
> unsigned long g_66;
> long g_73;
>
> int func_1 (void)
> {
> unsigned long l_86 = -1L;
> unsigned long l_93 = -9L;
> if ((l_86 >= g_73) < (1 / div_rhs (l_93)))
> return 1;
> else
> return 0;
> }
>
>
>
>
> _______________________________________________
> AVR-GCC-list mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
>