You can add 56 test for this case: :::::::::::::: 56_dbl_sizet_cst_mul.c :::::::::::::: #include <stdio.h> static int debug, nfailed = 0;
static void check (const char* s) { double dbl = 44.361420; size_t len = 2; double res = dbl * 32 * len; /* 2839.130880 */ if (!(res > 2839.13 && res < 2839.14)) { ++nfailed; if (debug) printf ("%s %f V.S. %f\n", s, res, 2839.130880); } } int main (int argc, char **argv) { debug = argc > 1; check("double * size_r * cst"); printf ("%d test(s) failed\n", nfailed); return nfailed != 0; } :::::::::::::: 56_dbl_sizet_cst_mul.expect :::::::::::::: 0 test(s) failed -----Original Message----- From: tinycc-devel-bounces+eligis=orange...@nongnu.org [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On Behalf Of Christian Jullien Sent: samedi 2 février 2013 12:26 To: tinycc-devel@nongnu.org Subject: [Tinycc-devel] ARM (RPi) compiler bug Hi all, Trying to port my (extremely portable Bignum lib: http://sourceforge.net/projects/bigz/) This code snippet, isolates the error I get: #include <stdio.h> void main(void) { double dbl = 44.361420; size_t len = 2; printf("1) =>%f %ld\n", dbl, len); printf("2) =>%f\n", dbl * 64); printf("3) =>%f\n", dbl * 32 * len); // BUG here!!! } $ tcc -o foo foo.c && ./foo 1) =>44.361420 2 2) =>2839.130880 3) =>64384184694.211205 My conf: git clone -b mob git://repo.or.cz/tinycc.git cd tinycc git pull ./configure --with-libgcc make make test // no error $ uname -a Linux sims 3.6.11+ #366 PREEMPT Wed Jan 30 12:59:10 GMT 2013 armv6l GNU/Linux $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.7/lto-wrapper Target: arm-linux-gnueabihf Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5+rpi1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf Thread model: posix gcc version 4.7.2 (Debian 4.7.2-5+rpi1) _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel _______________________________________________ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel