This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gcc 4.4.0 on ARM/WinCE float problem


I've been looking into this problem, I don't seem to be able to track it
down. With the addition of gcc-4.4.0 to the cegcc toolset, the ARM
float/double arithmetic appears to be broken.

Environment is cross-development for execution on Windows CE platforms,
for ARM processors.

I'm looking for pointers to understanding this. Fixes would be welcome
too but that might be a bit much to ask ;-)

Consider this test program. I'm not sure how sensible it is, but
it shows at least two current problems.

#include <stdio.h>
#include <windows.h>

main(int argc, char *argv[])
{
        double  d = 12.0;
        double  dd = d * 3.0;
        double  ddd = 36.0;
        float   fd = 36.0;

        printf("Foo %d %f %d\n", 34, d, 67);
        printf(" 12 * 3 -> %f\n", dd);
        printf(" 36 -> %f\n", fd);
        printf(" 36 d -> %f\n", ddd);
        exit (0);
}

Its output, with the gcc 4.4 build chain on my disk, is :

pavilion: {233} arm-mingw32ce-gcc -o float-n2.exe float.c
-Wstrict-aliasing=2
pavilion: {234} rcp float-n2.exe ipaq:/temp
pavilion: {235} rsh ipaq /temp/float-n2.exe
Foo 34 12.000000 67
 12 * 3 -> 0.000000
 36 -> 0.000000
 36 d -> 36.000000
pavilion: {236} 

The difference between the last two printf statements points out, I
think, that a problem exists around printf. Might be float to double
conversion.

The difference between the second and fourth printf statements points
out that a problem exists in arithmetic. (dd and ddd should be equal.)

The latter problem is the more urgent one for me.

Thanks for any help at all..

        Danny

P.S. All the code (tweaked gcc, binutils, etc) is in the SVN of the
cegcc project at http://sf.net/projects/cegcc .
-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]