I have a code that I want to port from Windows 32 bits to Linux 64 bits. This code makes a lot of calculations using basic floating point operations with double type numbers and I try to keep same results on both environments.
On Windows, I use VisualC++ to compile the code with the /fp:strict option. My first step was to port the code to Linux 32 bits (in fact compiling the code in 32 bits on a X86-64 Linux environment). The problem has already been widely addressed here (for example in this question). As advised, I've compiled the code using gcc and the options -msse2 -mfpmath=sse and the results were exactly the same between Windows 32 bits and Linux 32 bits.
I finally compiled the code in 64bits, expecting to conserve the same results... but there were a lot of differences. That matter has also been discussed (see here and there), but as I already use SSE floating point units thanks to gcc options, I normally should have observed the same results between Linux 32 and 64 bits.
So I'm a little stuck now. The only remaining explanation I can think of is that the problem lies within the code (stuff like comparing two double for equality - hope there isn't but can't be absolutely sure). What do you think ? Am I missing a point somewhere ? Is there another explanation I missed ?
Any advice will be greatly appreciated.
Note1 : I also tried the option -ffloat-store but it didn't help me get the results close to each other.