This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/29985] New: sin (x) / cos (x) is not always folded to tan (x)
- From: "ubizjak at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 26 Nov 2006 07:44:52 -0000
- Subject: [Bug tree-optimization/29985] New: sin (x) / cos (x) is not always folded to tan (x)
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This testcase shows the problem when compiled with -ffast-math:
double test1(double x)
{
double y1, y2;
y1 = sin(x);
y2 = cos(x);
return y1 / y2;
}
double test2(double x)
{
return sin(x) / cos(x);
}
gcc -O2 -ffast-math:
_.099t.optimized:
;; Function test2 (test2)
Analyzing Edge Insertions.
test2 (x)
{
<bb 2>:
return __builtin_tan (x) [tail call];
}
;; Function test1 (test1)
Analyzing Edge Insertions.
test1 (x)
{
<bb 2>:
return sin (x) / cos (x);
}
--
Summary: sin (x) / cos (x) is not always folded to tan (x)
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ubizjak at gmail dot com
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29985