On Jun 16, 2007, at 12:35 AM, Duncan Sands wrote:
>> Result compiled with llvm-g++ 2.0:
>> tan float: -2.18504
>> tan double: 0.309336
>
> This may be due to bug 1505.
It fails on x86 using x87 floating point, with the inliner not run,
because of 1505, yes. Gonsolo, is that your situation?
(What happens is, there is a wrapper in the header file for std::tan
(float),
like this:
inline float
tan(float __x)
{ return __builtin_tanf(__x); }
This wrapper is miscompiled due to 1505; when the inliner is run, no
problem.)
(But, when opt -std-compile-opts is run, the 'tan' call is evaluated
at compile
time, while 'tanf' resolves to a libc call. This is undesirable,
since the whole
reason tanf exists is that it's supposed to be faster than tan. Of
course you
have to be very careful about doing FP operations at compile time, but I
assume this is being done right; it's getting the right answer here,
anyway.)