This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug other/42333] New: complex division failure on darwin10 with -lm
- From: "ghazi at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Dec 2009 16:25:52 -0000
- Subject: [Bug other/42333] New: complex division failure on darwin10 with -lm
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
As noted in PR42074, linking with the math library on darwin10 allows overflow
to occur during complex division. It was originally reported as a failure in
testcase gcc.dg/torture/builtin-math-7.c at all optimization levels. However
as described in http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42074#c10 the error
is related to using -lm on the reduced testcase below. Without -lm it passes,
with -lm a failure occurs. As such, it isn't necessarily a bug in GCC, however
this PR will help track if there is a possible workaround.
int main(void)
{
volatile _Complex double val = (__DBL_MAX__ * 0.5 + __DBL_MAX__ * 0.5i);
val /= (__DBL_MAX__ * 0.25 + __DBL_MAX__ * 0.25i);
__builtin_printf ("%g %g\n", __real (val), __imag (val));
if (val != 2) __builtin_abort();
return 0;
}
--
Summary: complex division failure on darwin10 with -lm
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: other
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ghazi at gcc dot gnu dot org
GCC target triplet: *-*-darwin10
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42333