----- Original Message ----- 
From: "Kai Tietz" <[email protected]>
To: <[email protected]>
Sent: Monday, September 10, 2012 10:15 PM
Subject: Re: [Mingw-w64-public] -ffloat-store not needed with 64-bit 
compiler


> 2012/9/8 Sisyphus <[email protected]>:
>> Hi,
>>
>> Attached is a small demo program (demo.c).
>>
>> With 32-bit mingw compilers (both mingw.org's 4.5.2 and mingw64's 4.6.3) 
>> the
>> output of that program differs, depending upon whether I build it with
>> -ffloat-store or not.
>> I've no problem with that - I think I understand what's going on.
>> To get the output I desire I build *with* -ffloat-store.
>>
>> When I switch to 64-bit mingw64 compilers (I've tried both 4.6.3 and 
>> 4.7.0)
>> I get the desired output *without* having to invoke -ffloat-store.
>> And if I do invoke -ffloat-store, I still get the same output.
>>
>> Why the different behaviour with the 64-bit compilers ?
>
> This is caused by x64 ABI and used optimization.  I tested your demo
> by x64 compiler with option -O2 and I noticed a code difference with
> option -ffloat-store -O2 vs -fno-float-store -O2 (default).

Did the output of the program change ?

With 32-bit mingw, when I run
gcc -o demo.exe demo.c

the output I get is:

1..1
#     a = [ 0  1  2  2  4  5  5  6  8  9 10 ]
#     b = [ 0  1  2  2  4  4  5  6  8  8  9 ]
# a - b = [ 0  0  0  0  0  1  0  0  0  1  1 ]
not ok 1 - lists are equal

Is there a way to get the same output with the 64-bit mingw compiler ?
(I admit, this is a different question to the one that I originally asked.)

With my 64-bit compilers, I've (now) tried different optimisations with 
both -fno-float-store and -ffloat-store, but I always seem to get output of:

1..1
#     a = [ 0  1  2  2  4  5  5  6  8  9 10 ]
#     b = [ 0  1  2  2  4  5  5  6  8  9 10 ]
# a - b = [ 0  0  0  0  0  0  0  0  0  0  0 ]
ok 1 - lists are equal

>> And a second question:
>> Is -fno-float-store a valid option ?
> Yes, it is.

Ok - thanks.

> It is a valid option and documented by gcc's documentation.  See for
> more details either invoke.texi or 'gcc info'.

How does one invoke either of these in mingw ? (Or msys.)

For reference, the documentation that I looked at was
http://gcc.gnu.org/onlinedocs/gcc-3.4.4/gcc/Option-Summary.html#Option-Summary
http://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/Option-Summary.html#Option-Summary
http://gcc.gnu.org/onlinedocs/gcc-4.7.0/gcc/Option-Summary.html#Option-Summary

Thanks Kai.
I appreciate that you take the time to answer my dumb questions.

Cheers,
Rob 


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to