Andrea,
Consider long long broken on GCC 3.x compilers. I've had similar problems
on other platforms (including x86) as well. It also seems to depend on
surrounding code so reproducing the exact bug is very difficult.
Nico Coesel
At 11:43 23-6-2009 +0200, Andrea Guerra wrote:
>The mspgcc in use is msp430-gcc (GCC) 3.2.3, running on winXp with the
>following compiler options:
>
>-mmcu=msp430x436 -g -Os -Wall -Wcast-align -Wcast-qual -Wimplicit
>-Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith
>-Wredundant-decls -Wreturn-type -Wshadow -Wstrict-prototypes -Wswitch
>-Wunused -Winline
>
>The cpu is msp430f436.
>
>I've the following error code:
>
>typedef unsigned long u32;
>typedef unsigned long long u64;
>
>#define U32_MAX ((u32)4294967295uL)
>
>u64 macc;
>
>if (macc > (u64)U32_MAX)
> {
> macc = U32_MAX;
> }
>
>The compiler generate a code of the comparison "if (macc > (u64)U32_MAX)"
>completely wrong and the expression "macc = U32_MAX;" is executed every
>time. The compiled code is the following:
>