This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/49813] [C++0x] sinh vs asinh vs constexpr
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 22 Jul 2011 10:40:10 +0000
- Subject: [Bug c++/49813] [C++0x] sinh vs asinh vs constexpr
- Auto-submitted: auto-generated
- References: <bug-49813-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49813
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target|x86_64-linux |
--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-07-22 10:38:42 UTC ---
We do have code to constant fold asinh in builtins.c:
static tree
fold_builtin_1 (location_t loc, tree fndecl, tree arg0, bool ignore)
{
...
CASE_FLT_FN (BUILT_IN_ASINH):
if (validate_arg (arg0, REAL_TYPE))
return do_mpfr_arg1 (arg0, type, mpfr_asinh, NULL, NULL, 0);
break;
It works for C:
#include <math.h>
int main()
{
const double ds = sinh(1.0); // Ok
const double das = asinh(1.0); // Doesn't compile.
}
in the .original dump:
;; Function main (null)
;; enabled by -tree-original
{
const double ds = 1.175201193643801378385660427738912403583526611328125e+0;
const double das = 8.8137358701954304773806825323845259845256805419921875e-1;
const double ds = 1.175201193643801378385660427738912403583526611328125e+0;
const double das =
8.8137358701954304773806825323845259845256805419921875e-1;
}