Frama-C Bug Tracking System - Frama-C
View Issue Details
0000785Frama-CKernelpublic2011-04-11 16:172014-02-12 16:59
pascal 
pascal 
normalminorhave not tried
closedfixed 
Frama-C GIT, precise the release id 
Frama-C Nitrogen-20111001 
0000785: 12799, doubtful choice of promotion x86_64 mode (csmith)
int x; long x2; unsigned long x9[6][2]; #if 0 #define d(n, v) Frama_C_show_each##n(v); #else #define d(n, v) #endif main(){ x2 = 2793414595; for (int i = 0; i < 6; i++) { for (int j = 0; j < 2; j++) x9[i][j] = 1U; } d(102, (0x090E7AF82577C8A6LL | x9[1][0]) ) d(103, (~(x2 || x9[1][0])) ) d(95, ((0x090E7AF82577C8A6LL | x9[0][1]) <= (~(x2 || x9[0][1])))) x = ((0x090E7AF82577C8A6LL | x9[0][1]) <= (~(x2 || x9[0][1]))); return x; } ~/ppc/bin/toplevel.opt -val -machdep x86_64 r.c -slevel 5000 ... [value] Values for function main: x ? {0; } BUT: gcc -std=c99 r.c ; ./a.out ; echo $? 1 NOTE THAT: ~/ppc/bin/toplevel.opt -print -machdep x86_64 r.c [kernel] preprocessing with "gcc -C -E -I. r.c" ... x = (0x090E7AF82577C8A6LL | (long long )x9[0][1]) <= (long long )(~ tmp); } return (x); } gcc is the computation server's, supposed to match x86_64. x9[0][1] is an unsigned long. The promotion of the arguments of | seems to be wrong in Frama-C's front-end according to 6.3.1.8 (p 45), where the very last case of ยง1 seems to apply.
In addition to the computation server's GCC (version 4.4.3 (Ubuntu 4.4.3-4ubuntu5)), this one also predicts the result 1 for x when compiling with -m64: gcc -m64 -v Using built-in specs. Target: powerpc-apple-darwin9 Configured with: /var/tmp/gcc/gcc-5493~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin9 --program-prefix= --host=powerpc-apple-darwin9 --target=powerpc-apple-darwin9 Thread model: posix gcc version 4.0.1 (Apple Inc. build 5493)
No tags attached.
Issue History
2011-04-11 16:17pascalNew Issue
2011-04-11 16:33pascalAdditional Information Updated
2011-04-15 18:40pascalStatusnew => assigned
2011-04-15 18:40pascalAssigned To => pascal
2011-04-15 18:48svnCheckin
2011-04-15 18:48svnStatusassigned => resolved
2011-04-15 18:48svnResolutionopen => fixed
2011-10-10 14:13signolesFixed in Version => Frama-C Nitrogen-20111001
2011-10-10 14:14signolesStatusresolved => closed
2014-02-12 16:59pascalNote Added: 0004805
2014-02-12 16:59pascalStatusclosed => resolved

Notes
(0004805)
pascal   
2014-02-12 16:59   
Fix committed to stable/neon branch.