* [Bug libstdc++/48933] Infinite recursion in tr1/cmath functions with complex parameters
2011-05-09 10:14 [Bug libstdc++/48933] New: Infinite recursion in tr1/cmath functions with complex parameters bisqwit at iki dot fi
@ 2011-05-09 10:46 ` paolo.carlini at oracle dot com
2011-05-09 10:49 ` redi at gcc dot gnu.org
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-05-09 10:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48933
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.05.09 10:26:00
AssignedTo|unassigned at gcc dot |paolo.carlini at oracle dot
|gnu.org |com
Ever Confirmed|0 |1
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-05-09 10:26:00 UTC ---
Apparently we need enable_ifs.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/48933] Infinite recursion in tr1/cmath functions with complex parameters
2011-05-09 10:14 [Bug libstdc++/48933] New: Infinite recursion in tr1/cmath functions with complex parameters bisqwit at iki dot fi
2011-05-09 10:46 ` [Bug libstdc++/48933] " paolo.carlini at oracle dot com
@ 2011-05-09 10:49 ` redi at gcc dot gnu.org
2011-05-09 11:00 ` bisqwit at iki dot fi
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2011-05-09 10:49 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48933
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-05-09 10:46:40 UTC ---
Yes, we should disable the TR1 math functions for anything that isn't integral
or floating point, because it happens with any non-integral, non-float type:
#include <tr1/cmath>
struct Foo { };
int main()
{
std::tr1::acosh( Foo() );
}
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/48933] Infinite recursion in tr1/cmath functions with complex parameters
2011-05-09 10:14 [Bug libstdc++/48933] New: Infinite recursion in tr1/cmath functions with complex parameters bisqwit at iki dot fi
2011-05-09 10:46 ` [Bug libstdc++/48933] " paolo.carlini at oracle dot com
2011-05-09 10:49 ` redi at gcc dot gnu.org
@ 2011-05-09 11:00 ` bisqwit at iki dot fi
2011-05-09 11:06 ` redi at gcc dot gnu.org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: bisqwit at iki dot fi @ 2011-05-09 11:00 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48933
--- Comment #4 from Joel Yliluoma <bisqwit at iki dot fi> 2011-05-09 10:51:28 UTC ---
There is, however, an asinh, a cbrt, a hypot etc. for complex types. I don't
know about standard, but mathematically they are well defined. (for example,
hypot(x,y) = sqrt(x*x + y*y), asinh(x) = log(x + sqrt(x*x + 1)))
For trunc & other rounding functions probably not so.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/48933] Infinite recursion in tr1/cmath functions with complex parameters
2011-05-09 10:14 [Bug libstdc++/48933] New: Infinite recursion in tr1/cmath functions with complex parameters bisqwit at iki dot fi
` (2 preceding siblings ...)
2011-05-09 11:00 ` bisqwit at iki dot fi
@ 2011-05-09 11:06 ` redi at gcc dot gnu.org
2011-05-09 11:08 ` paolo.carlini at oracle dot com
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2011-05-09 11:06 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48933
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-05-09 10:57:06 UTC ---
They're in C++0x but I don't think they're in TR1
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/48933] Infinite recursion in tr1/cmath functions with complex parameters
2011-05-09 10:14 [Bug libstdc++/48933] New: Infinite recursion in tr1/cmath functions with complex parameters bisqwit at iki dot fi
` (3 preceding siblings ...)
2011-05-09 11:06 ` redi at gcc dot gnu.org
@ 2011-05-09 11:08 ` paolo.carlini at oracle dot com
2011-05-09 11:17 ` paolo.carlini at oracle dot com
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-05-09 11:08 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48933
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.7.0
--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-05-09 10:39:07 UTC ---
Note of course, those infinite recursions can at best transformed to hard
errors, there is no, eg, trunc, for std::complex types.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/48933] Infinite recursion in tr1/cmath functions with complex parameters
2011-05-09 10:14 [Bug libstdc++/48933] New: Infinite recursion in tr1/cmath functions with complex parameters bisqwit at iki dot fi
` (4 preceding siblings ...)
2011-05-09 11:08 ` paolo.carlini at oracle dot com
@ 2011-05-09 11:17 ` paolo.carlini at oracle dot com
2011-05-09 15:46 ` paolo.carlini at oracle dot com
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-05-09 11:17 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48933
--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-05-09 11:01:44 UTC ---
The way tr1/cmath is currently implemented, roughly speaking *when* an overload
does not exist anyway an infinite recursion can happen. Thus, this is just a
QoI issue. But it's easy to fix, I'll do that momentarily.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/48933] Infinite recursion in tr1/cmath functions with complex parameters
2011-05-09 10:14 [Bug libstdc++/48933] New: Infinite recursion in tr1/cmath functions with complex parameters bisqwit at iki dot fi
` (5 preceding siblings ...)
2011-05-09 11:17 ` paolo.carlini at oracle dot com
@ 2011-05-09 15:46 ` paolo.carlini at oracle dot com
2011-05-09 15:48 ` paolo at gcc dot gnu.org
2011-12-19 2:22 ` redi at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-05-09 15:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48933
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-05-09 15:42:17 UTC ---
Done.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/48933] Infinite recursion in tr1/cmath functions with complex parameters
2011-05-09 10:14 [Bug libstdc++/48933] New: Infinite recursion in tr1/cmath functions with complex parameters bisqwit at iki dot fi
` (6 preceding siblings ...)
2011-05-09 15:46 ` paolo.carlini at oracle dot com
@ 2011-05-09 15:48 ` paolo at gcc dot gnu.org
2011-12-19 2:22 ` redi at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: paolo at gcc dot gnu.org @ 2011-05-09 15:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48933
--- Comment #7 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> 2011-05-09 15:38:25 UTC ---
Author: paolo
Date: Mon May 9 15:38:21 2011
New Revision: 173574
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173574
Log:
2011-05-09 Paolo Carlini <paolo.carlini@oracle.com>
PR libstdc++/48933
* include/c_global/cmath (acosh, asinh, atanh, cbrt, copysign,
erf, erfc, exp2, expm1, fdim, fma, fmax, hypot, ilogb, lgamma,
llrint, llround, log1p, log2, logb, lrint, lround, nearbyint,
nextafter, nexttoward, remainder, remquo, rint, round, scalbln,
scalbn, tgamma, trunc): Use __enable_if on the return type.
* include/tr1/cmath: Likewise.
* testsuite/26_numerics/headers/cmath/overloads_c++0x_neg.cc: New.
* testsuite/tr1/8_c_compatibility/cmath/overloads_neg.cc: Likewise.
Added:
trunk/libstdc++-v3/testsuite/26_numerics/headers/cmath/overloads_c++0x_neg.cc
trunk/libstdc++-v3/testsuite/tr1/8_c_compatibility/cmath/overloads_neg.cc
Modified:
trunk/libstdc++-v3/ChangeLog
trunk/libstdc++-v3/include/c_global/cmath
trunk/libstdc++-v3/include/tr1/cmath
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug libstdc++/48933] Infinite recursion in tr1/cmath functions with complex parameters
2011-05-09 10:14 [Bug libstdc++/48933] New: Infinite recursion in tr1/cmath functions with complex parameters bisqwit at iki dot fi
` (7 preceding siblings ...)
2011-05-09 15:48 ` paolo at gcc dot gnu.org
@ 2011-12-19 2:22 ` redi at gcc dot gnu.org
8 siblings, 0 replies; 10+ messages in thread
From: redi at gcc dot gnu.org @ 2011-12-19 2:22 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48933
--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> 2011-12-19 01:52:05 UTC ---
This has also been partially fixed for 4.6.3 by backporting the fix for bug
51083
^ permalink raw reply [flat|nested] 10+ messages in thread