[Bug 1019] New: Possible cross-compiler bug involving type coercion

bugzilla-daemon at bugzilla.openmoko.org bugzilla-daemon at bugzilla.openmoko.org
Thu Nov 22 08:24:33 CET 2007


http://bugzilla.openmoko.org/cgi-bin/bugzilla/show_bug.cgi?id=1019

           Summary: Possible cross-compiler bug involving type coercion
           Product: OpenMoko
           Version: 2007.2
          Platform: Neo1973
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: OE bitbake recipes  / build system
        AssignedTo: mickey at vanille-media.de
        ReportedBy: mail at mmontour.net
                CC: buglog at lists.openmoko.org


I'm not sure if this is actually a bug or is just due to some undefined behavior
in the program. Anyway, the following test code:

--
#include <stdio.h>
void P(unsigned int a, unsigned int b)
{
        printf("%08X %08X\n", a, b);
}

int x = 0xfedcba98;

int main(int argc, char *argv[])
{
        double Z = -2.0;
        P( x +(int)(50*Z), x + 50 * Z);

        return 0;
}
--
will print "FEDCBA34 FEDCBA34" when compiled and run on x86 Linux or on Powerpc
OSX. However, when cross-compiled and run on my Neo1973 it prints "FEDCBA34
00000000". This is the same with -O3 optimization or with no optimization. No
compiler warnings are produced. 

$build/tmp/cross/bin/arm-angstrom-linux-gnueabi-gcc --version
arm-angstrom-linux-gnueabi-gcc (GCC) 4.1.2

The compiler was built today (2007-11-21) using 2007.2 MokoMakefile.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




More information about the buglog mailing list