Omitted conversion float -> double in x86 back-end

Michael Matz matz@suse.de
Tue Nov 21 17:55:00 GMT 2006


Hi,

On Tue, 21 Nov 2006, Roberto COSTA wrote:

> Hi Michael,
> too late, I've filed the report a few minutes ago.
> By the way, if I want to bypass the problem without paying any performance
> penalty, it is sufficient that I introduce a temporary variable in the C
> source.
> As a matter of fact, this looks to work:
> 
> double foo(signed long long l)
> {
>     double d = (float)l;
>     return d;
> }

Pure luck.  Try with -O2 or another compiler version and it will stop 
working again.  IOW: it's no workaround for the x87 problem.  The only one 
there is is -ffloat-store, and that is a performance sink.  Rule of thumb: 
don't use x87 math.


Ciao,
Michael.



More information about the Gcc mailing list