http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60604
Bug ID: 60604 Summary: GCC incorrectly compiles s_csinh function on MIPS Product: gcc Version: 4.9.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: sje at gcc dot gnu.org Target: mips*-*-* Created attachment 32410 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32410&action=edit Test case While looking at a GCC fortran test failure (gfortran.dg/complex_intrinsic_3.f90) I tracked the problem down to GCC miscompiling the routine. I have attached a cutdown test case to this report. When compiled for mips32r2, big-endian, hard-float, and using -O0 or -O1 the attached program prints: x = 0.634964 1.298458 rcls = 4, icls = 4, t = 709 In __csinh(1), 0.634964 1.29846 In __csinh(2), 0.634964 1.29846 x = 0.000000 0.000000 When compiled with -O2 or -O3 it prints: x = 0.634964 1.298458 rcls = 4, icls = 4, t = 709 In __csinh(1), 0.634964 1.29846 In __csinh(2), 1.00959e+116 1.29846 In if statement x = 0.000000 0.000000 Somehow the optimized code is corrupting the input value of csinh.