This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/17603] New: Cpowf and cpowl builtins broken
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 Sep 2004 09:38:57 -0000
- Subject: [Bug middle-end/17603] New: Cpowf and cpowl builtins broken
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Hi,
on some platforms, 26_numerics/complex/13450.cc has been failing for some time.
I tracked down the problem to the complex pow builtins. Just run (-O0 suffices)
the below:
#include <cassert>
// libstdc++/13450
int main()
{
__complex__ long double x;
__complex__ long double y;
__complex__ long double z;
__real__ x = -1.0l;
__imag__ x = 0.0l;
__real__ y = 0.5l;
__imag__ y = 0.0l;
z = __builtin_cpowl(x, y);
assert( __imag__ z > 0.99l && __imag__ z < 1.01l);
}
Indeed, if I print z inside gdb:
$1 = <invalid float value> + 3.6451995318824746025284059336194198e-4951 * I
instead of the expected (3.4 is ok): ~0 + 1 * I.
Similar problems affect __builtin_cpowf, just let me know and I can prepare
a suited testcase. In any case, in order to double check that everything is
finally ok, just run the libstdc++ testsuite ;) ...
--
Summary: Cpowf and cpowl builtins broken
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: critical
Priority: P2
Component: middle-end
AssignedTo: roger at eyesopen dot com
ReportedBy: pcarlini at suse dot de
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: x86_64-linux-gnu
GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17603