Bug 54757 - FAIL: ext/random/beta_distribution/cons/default.cc (test for excess errors)
Summary: FAIL: ext/random/beta_distribution/cons/default.cc (test for excess errors)
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: 4.8.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-09-29 23:10 UTC by John David Anglin
Modified: 2012-10-01 23:13 UTC (History)
1 user (show)

See Also:
Host: hppa2.0w-hp-hpux11.11 *-*-darwin*
Target: hppa2.0w-hp-hpux11.11 *-*-darwin*
Build: hppa2.0w-hp-hpux11.11 *-*-darwin*
Known to work:
Known to fail:
Last reconfirmed: 2012-09-30 00:00:00


Attachments
include/c++/4.8.0/cmath for darwin (4.79 KB, text/plain)
2012-09-30 12:36 UTC, Dominique d'Humieres
Details
random.d.txt (397 bytes, text/plain)
2012-09-30 18:04 UTC, dave.anglin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description John David Anglin 2012-09-29 23:10:00 UTC
Executing on host: /test/gnu/gcc/objdir/./gcc/g++ -shared-libgcc -B/test/gnu/gcc/objdir/./gcc -nostdinc++ -L/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++
-v3/src -L/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/src/.libs -B/opt/gnu/gcc/gcc-4.8/hppa2.0w-hp-hpux11.11/bin/ -B/opt/gnu/gcc/gcc-4.8/hppa2.0w-hp
-hpux11.11/lib/ -isystem /opt/gnu/gcc/gcc-4.8/hppa2.0w-hp-hpux11.11/include -isystem /opt/gnu/gcc/gcc-4.8/hppa2.0w-hp-hpux11.11/sys-include -B/test/gnu/gcc/objd
ir/hppa2.0w-hp-hpux11.11/./libstdc++-v3/src/.libs -D_GLIBCXX_ASSERT -fmessage-le
ngth=0 -g -O2 -g -O2 -DLOCALEDIR="." -nostdinc++ -I/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/hppa2.0w-hp-hpux11.11 -I/test/gnu/gcc/objdir/
hppa2.0w-hp-hpux11.11/libstdc++-v3/include -I/test/gnu/gcc/gcc/libstdc++-v3/libsupc++ -I/test/gnu/gcc/gcc/libstdc++-v3/include/backward -I/test/gnu/gcc/gcc/libstdc++-v3/testsuite/util /test/gnu/gcc/gcc/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc   -std=c++0x ./libtestc++.a   -lm   -o ./default.exe    (timeout = 600)spawn /test/gnu/gcc/objdir/./gcc/g++ -shared-libgcc -B/test/gnu/gcc/objdir/./gcc -nostdinc++ -L/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/src -L/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/src/.libs -B/opt/gnu/gcc/gcc-4.8/hppa2.0w-hp-hpux11.11/bin/ -B/opt/gnu/gcc/gcc-4.8/hppa2.0w-hp-hpux11.11/lib/ -isystem /opt/gnu/gcc/gcc-4.8/hppa2.0w-hp-hpux11.11/include -isystem /opt/gnu/gcc/gcc-4.8/hppa2.0w-hp-hpux11.11/sys-include -B/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/./libstdc++-v3/src/.libs -D_GLIBCXX_ASSERT -fmessage-length=0 -g -O2 -g -O2 -DLOCALEDIR="." -nostdinc++ -I/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/hppa2.0w-hp-hpux11.11 -I/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include -I/test/gnu/gcc/gcc/libstdc++-v3/libsupc++ -I/test/gnu/gcc/gcc/libstdc++-v3/include/backward -I/test/gnu/gcc/gcc/libstdc++-v3/testsuite/util /test/gnu/gcc/gcc/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc -std=c++0x ./libtestc++.a -lm -o ./default.exe
In file included from /test/gnu/gcc/gcc/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc:24:0:
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random: In member function '__gnu_cxx::rice_distribution<_RealType>::result_type __gnu_cxx::rice_distribution<_RealType>::operator()(_UniformRandomNumberGenerator&)':
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:1045:11: error: 'hypot' is not a member of 'std'
    return std::hypot(__x, __y);
           ^
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:1045:11: note: suggested alternative:
In file included from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/cmath:46:0,
                 from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/random:38,
                 from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:38,
                 from /test/gnu/gcc/gcc/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc:24:
/test/gnu/gcc/objdir/gcc/include-fixed/math.h:128:20: note:   'hypot'
      extern double hypot(double, double);
                    ^
In file included from /test/gnu/gcc/gcc/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc:24:0:
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random: In member function '__gnu_cxx::rice_distribution<_RealType>::result_type __gnu_cxx::rice_distribution<_RealType>::operator()(_UniformRandomNumberGenerator&, const __gnu_cxx::rice_distribution<_RealType>::param_type&)':
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:1057:11: error: 'hypot' is not a member of 'std'
    return std::hypot(__x, __y);
           ^
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:1057:11: note: suggested alternative:
In file included from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/cmath:46:0,
                 from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/random:38,
                 from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:38,
                 from /test/gnu/gcc/gcc/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc:24:
/test/gnu/gcc/objdir/gcc/include-fixed/math.h:128:20: note:   'hypot'
      extern double hypot(double, double);
                    ^
In file included from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:1852:0,
                 from /test/gnu/gcc/gcc/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc:24:
/test/gnu/gcc/gcc-4.8/libstdc++-v3/include/ext/random.tcc: In member function 'void __gnu_cxx::rice_distribution<_RealType>::__generate_impl(_OutputIterator, _OutputIterator, _UniformRandomNumberGenerator&, const __gnu_cxx::rice_distribution<_RealType>::param_type&)':
/test/gnu/gcc/gcc-4.8/libstdc++-v3/include/ext/random.tcc:735:15: error: 'hypot' is not a member of 'std'
      *__f++ = std::hypot(__x, __y);
               ^
/test/gnu/gcc/gcc-4.8/libstdc++-v3/include/ext/random.tcc:735:15: note: suggested alternative:
In file included from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/cmath:46:0,
                 from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/random:38,
                 from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:38,
                 from /test/gnu/gcc/gcc/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc:24:
/test/gnu/gcc/objdir/gcc/include-fixed/math.h:128:20: note:   'hypot'
      extern double hypot(double, double);
                    ^
compiler exited with status 1
output is:
In file included from /test/gnu/gcc/gcc/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc:24:0:
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random: In member function '__gnu_cxx::rice_distribution<_RealType>::result_type __gnu_cxx::rice_distribution<_RealType>::operator()(_UniformRandomNumberGenerator&)':
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:1045:11: error: 'hypot' is not a member of 'std'
    return std::hypot(__x, __y);
           ^
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:1045:11: note: suggested alternative:
In file included from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/cmath:46:0,
                 from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/random:38,
                 from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:38,
                 from /test/gnu/gcc/gcc/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc:24:
/test/gnu/gcc/objdir/gcc/include-fixed/math.h:128:20: note:   'hypot'
      extern double hypot(double, double);
                    ^
In file included from /test/gnu/gcc/gcc/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc:24:0:
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random: In member function '__gnu_cxx::rice_distribution<_RealType>::result_type __gnu_cxx::rice_distribution<_RealType>::operator()(_UniformRandomNumberGenerator&, const __gnu_cxx::rice_distribution<_RealType>::param_type&)':
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:1057:11: error: 'hypot' is not a member of 'std'
    return std::hypot(__x, __y);
           ^
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:1057:11: note: suggested alternative:
In file included from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/cmath:46:0,
                 from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/random:38,
                 from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:38,
                 from /test/gnu/gcc/gcc/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc:24:
/test/gnu/gcc/objdir/gcc/include-fixed/math.h:128:20: note:   'hypot'
      extern double hypot(double, double);
                    ^
In file included from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:1852:0,
                 from /test/gnu/gcc/gcc/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc:24:
/test/gnu/gcc/gcc-4.8/libstdc++-v3/include/ext/random.tcc: In member function 'void __gnu_cxx::rice_distribution<_RealType>::__generate_impl(_OutputIterator, _OutputIterator, _UniformRandomNumberGenerator&, const __gnu_cxx::rice_distribution<_RealType>::param_type&)':
/test/gnu/gcc/gcc-4.8/libstdc++-v3/include/ext/random.tcc:735:15: error: 'hypot' is not a member of 'std'
      *__f++ = std::hypot(__x, __y);
               ^
/test/gnu/gcc/gcc-4.8/libstdc++-v3/include/ext/random.tcc:735:15: note: suggested alternative:
In file included from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/cmath:46:0,
                 from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/random:38,
                 from /test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:38,
                 from /test/gnu/gcc/gcc/libstdc++-v3/testsuite/ext/random/beta_distribution/cons/default.cc:24:
/test/gnu/gcc/objdir/gcc/include-fixed/math.h:128:20: note:   'hypot'
      extern double hypot(double, double);
                    ^

FAIL: ext/random/beta_distribution/cons/default.cc (test for excess errors)
Excess errors:
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:1045:11: error: 'hypot' is not a member of 'std'
/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/include/ext/random:1057:11: error: 'hypot' is not a member of 'std'
/test/gnu/gcc/gcc-4.8/libstdc++-v3/include/ext/random.tcc:735:15: error: 'hypot' is not a member of 'std'

UNRESOLVED: ext/random/beta_distribution/cons/default.cc compilation failed to produce executable

There are a bunch of other similar fails.
Comment 1 Paolo Carlini 2012-09-29 23:34:20 UTC
I suppose _GLIBCXX_USE_C99_MATH_TR1 remains undefined on hppa-hpux, right?

In that case, I would pre-approve a patch changing each of the three uses of the C99 hypot in include/ext/random and include/ext/random.tcc with std::sqrt(x*x + y*y) as a fall back, like:

#if _GLIBCXX_USE_C99_MATH_TR1
	    *__f++ = std::hypot(__x, __y);
#else
	    *__f++ = std::sqrt(__x * __x + __y * __y);
#endif

etc. Maybe also add a comment explaining that in the future we may want to do better (in terms of overflow, etc). Note however, that this is *already* the case for many old <random> facilities: if the macro in undefined the implementation is way worse.
Comment 2 dave.anglin 2012-09-30 00:50:17 UTC
On 29-Sep-12, at 7:34 PM, paolo.carlini at oracle dot com wrote:

>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54757
>
> --- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com>  
> 2012-09-29 23:34:20 UTC ---
> I suppose _GLIBCXX_USE_C99_MATH_TR1 remains undefined on hppa-hpux,  
> right?

Yes.

>
> In that case, I would pre-approve a patch changing each of the three  
> uses of
> the C99 hypot in include/ext/random and include/ext/random.tcc with
> std::sqrt(x*x + y*y) as a fall back, like:
>
> #if _GLIBCXX_USE_C99_MATH_TR1
>        *__f++ = std::hypot(__x, __y);
> #else
>        *__f++ = std::sqrt(__x * __x + __y * __y);
> #endif


There is an implementation of hypot, so I'm wondering if we can't do  
better.

Testing suggestion.

Dave
--
John David Anglin	dave.anglin@bell.net
Comment 3 Paolo Carlini 2012-09-30 09:44:27 UTC
Hi,

> There is an implementation of hypot, so I'm wondering if we can't do  
> better.

You mean in the libc? It's possible because as you can see the autoconf test handles all the C99 mathematical functions together and if only one is missing the check fails. Now, really, I don't think we want to go fine grained to the level of the single function, but if for example we figure out that a number of targets has available the entire subset of functions required for <random> and <ext/random> we could separate those. My point is that we should try to find patterns, like the long double functions are causing troubles and we can separate those. As I said, for those features - isn't just about math - I would rather not fragment everything down to single function, if possible.
 
> Testing suggestion.

Great, if it works, let's go with that for now. Then, longer term, if you have ideas about the above, please also feel free to send a message to the library mailing list.
Comment 4 Dominique d'Humieres 2012-09-30 12:35:12 UTC
I also see it on  *-*-darwin*. I have silenced the failures by replacing std:hypot with hypot.

I have tested the example from http://en.cppreference.com/w/cpp/numeric/math/hypot , i.e.,

#include <cmath>
#include <utility>
#include <iostream>
 
std::pair<double, double> cartesian_to_polar(double x, double y)
{
    return {std::hypot(x, y), std::atan2(y,x)};
}
 
int main()
{
    std::pair<double, double> polar = cartesian_to_polar(1, 1);
    std::cout << "(1,1) cartesian is (" << polar.first
               << "," << polar.second<< ") polar\n";
}

which fails to compile on darwin with

[macbook] f90/bug% g++48 -std=c++11 polar.cpp
polar.cpp: In function 'std::pair<double, double> cartesian_to_polar(double, double)':
polar.cpp:7:13: error: 'hypot' is not a member of 'std'
     return {std::hypot(x, y), std::atan2(y,x)};
             ^
polar.cpp:7:13: note: suggested alternative:
In file included from /usr/include/math.h:28:0,
                 from /opt/gcc/gcc4.8w/include/c++/4.8.0/cmath:46,
                 from polar.cpp:1:
/usr/include/architecture/i386/math.h:340:15: note:   'hypot'
 extern double hypot ( double, double );
               ^
polar.cpp:7:46: error: could not convert '{<expression error>, atan2(y, x)}' from '<brace-enclosed initializer list>' to 'std::pair<double, double>'
     return {std::hypot(x, y), std::atan2(y,x)};
                                              ^
while it compiles if I replace " return {std::hypot(x, y), std::atan2(y,x)};" with " return {hypot(x, y), std::atan2(y,x)}; ". Looking at include/c++/4.8.0/cmath, I don't understand why std::atan2(y,x) is found, but not std::hypot(x, y).
Comment 5 Dominique d'Humieres 2012-09-30 12:36:38 UTC
Created attachment 28302 [details]
include/c++/4.8.0/cmath for darwin
Comment 6 Paolo Carlini 2012-09-30 13:14:25 UTC
Simply, atan2 is C89, hypot is C99.

Confirmed that we don't have to do anything special besides making sure that C99 functions like hypot aren't used when _GLIBCXX_USE_C99_MATH_TR1 is not defined. In particular, we definitely don't want to fiddle with the global namespace, a sure recipe for maintainance nightmare.
Comment 7 Marc Glisse 2012-09-30 14:19:20 UTC
(In reply to comment #5)
> include/c++/4.8.0/cmath for darwin

Dominique, it would be more useful if you could show your libstdc++ config.log, and in particular the error message you got for the test "for ISO C99 support to TR1 in <math.h>", to know what functions are missing on darwin (or hppa or others), assuming there isn't already a PR somewhere about it.
Comment 8 Paolo Carlini 2012-09-30 15:32:09 UTC
Note that the last time I checked, on Leopard, darwin actually enabled _GLIBCXX_USE_C99_MATH_TR1.
Comment 9 Dominique d'Humieres 2012-09-30 15:33:18 UTC
(In reply to comment #7)
> > include/c++/4.8.0/cmath for darwin
>
> Dominique, it would be more useful if you could show your libstdc++ config.log,
> and in particular the error message you got for the test "for ISO C99 support
> to TR1 in <math.h>", to know what functions are missing on darwin (or hppa or
> others), assuming there isn't already a PR somewhere about it.

I see

...
configure:18907: checking for ISO C99 support to TR1 in <math.h>
configure:19031:  /opt/gcc/build_w/./gcc/xgcc -shared-libgcc -B/opt/gcc/build_w/./gcc -nostdinc++ -L/opt/gcc/build_w/x86_64-apple-darwin10.8.0/libstdc
++-v3/src -L/opt/gcc/build_w/x86_64-apple-darwin10.8.0/libstdc++-v3/src/.libs -B/opt/gcc/gcc4.8w/x86_64-apple-darwin10.8.0/bin/ -B/opt/gcc/gcc4.8w/x86
_64-apple-darwin10.8.0/lib/ -isystem /opt/gcc/gcc4.8w/x86_64-apple-darwin10.8.0/include -isystem /opt/gcc/gcc4.8w/x86_64-apple-darwin10.8.0/sys-includ
e    -c -g -O2 -std=c++98  conftest.cpp >&5
conftest.cpp: In function 'int main()':
conftest.cpp:129:15: error: 'llrint' was not declared in this scope
     llrint(0.0);
               ^
conftest.cpp:130:17: error: 'llrintf' was not declared in this scope
     llrintf(0.0f);
                 ^
conftest.cpp:131:17: error: 'llrintl' was not declared in this scope
     llrintl(0.0l);
                 ^
conftest.cpp:132:16: error: 'llround' was not declared in this scope
     llround(0.0);
                ^
conftest.cpp:133:18: error: 'llroundf' was not declared in this scope
     llroundf(0.0f);
                  ^
conftest.cpp:134:18: error: 'llroundl' was not declared in this scope
     llroundl(0.0l);
                  ^
configure:19031: $? = 1
configure: failed program was:
...
configure:19040: result: no
configure:19052: checking for ISO C99 support to TR1 in <inttypes.h>
configure:19072:  /opt/gcc/build_w/./gcc/xgcc -shared-libgcc -B/opt/gcc/build_w/./gcc -nostdinc++ -L/opt/gcc/build_w/x86_64-apple-darwin10.8.0/libstdc++-v3/src -L/opt/gcc/build_w/x86_64-apple-darwin10.8.0/libstdc++-v3/src/.libs -B/opt/gcc/gcc4.8w/x86_64-apple-darwin10.8.0/bin/ -B/opt/gcc/gcc4.8w/x86_64-apple-darwin10.8.0/lib/ -isystem /opt/gcc/gcc4.8w/x86_64-apple-darwin10.8.0/include -isystem /opt/gcc/gcc4.8w/x86_64-apple-darwin10.8.0/sys-include    -c -g -O2 -std=c++98  conftest.cpp >&5
configure:19072: $? = 0
configure:19079: result: yes
...
configure:19127: checking stdbool.h usability
...
configure:21386: result: no
configure:21408: checking for hypot declaration
configure:21433:  /opt/gcc/build_w/./gcc/xgcc -shared-libgcc -B/opt/gcc/build_w/./gcc -nostdinc++ -L/opt/gcc/build_w/x86_64-apple-darwin10.8.0/libstdc++-v3/src -L/opt/gcc/build_w/x86_64-apple-darwin10.8.0/libstdc++-v3/src/.libs -B/opt/gcc/gcc4.8w/x86_64-apple-darwin10.8.0/bin/ -B/opt/gcc/gcc4.8w/x86_64-apple-darwin10.8.0/lib/ -isystem /opt/gcc/gcc4.8w/x86_64-apple-darwin10.8.0/include -isystem /opt/gcc/gcc4.8w/x86_64-apple-darwin10.8.0/sys-include    -c -fno-builtin -D_GNU_SOURCE  conftest.cpp >&5
configure:21433: $? = 0
configure:21449: result: yes
configure:21455: checking for hypot
configure:21455: /opt/gcc/build_w/./gcc/xgcc -B/opt/gcc/build_w/./gcc/ -B/opt/gcc/gcc4.8w/x86_64-apple-darwin10.8.0/bin/ -B/opt/gcc/gcc4.8w/x86_64-apple-darwin10.8.0/lib/ -isystem /opt/gcc/gcc4.8w/x86_64-apple-darwin10.8.0/include -isystem /opt/gcc/gcc4.8w/x86_64-apple-darwin10.8.0/sys-include    -o conftest -g -O2   conftest.c  -lm >&5
conftest.c:134:6: warning: conflicting types for built-in function 'hypot' [enabled by default]
 char hypot ();
      ^
configure:21455: $? = 0
configure:21455: result: yes
configure:21529: checking for float trig functions
...
+ the same for hypotf and hypotl.

Is it enough or should I attach the full log?
Comment 10 Dominique d'Humieres 2012-09-30 15:37:29 UTC
> Note that the last time I checked, on Leopard, darwin actually enabled
> _GLIBCXX_USE_C99_MATH_TR1.

Well I may have been too quick to say *-*-darwin*, I am sure of ppc-darwin9 and x64_86-darwin10.
Apparently there is no failure for the libstdc++  tests and x64_86-darwin12 (see http://gcc.gnu.org/ml/gcc-testresults/2012-09/msg02713.html).
Comment 11 Paolo Carlini 2012-09-30 15:48:36 UTC
Just confirmed that Snow Leopard is still Ok. As far as I'm concerned, the current status is good enough.
Comment 12 dave.anglin 2012-09-30 16:06:52 UTC
On 30-Sep-12, at 10:19 AM, glisse at gcc dot gnu.org wrote:

> Dominique, it would be more useful if you could show your libstdc++  
> config.log,
> and in particular the error message you got for the test "for ISO  
> C99 support
> to TR1 in <math.h>", to know what functions are missing on darwin  
> (or hppa or
> others), assuming there isn't already a PR somewhere about it.

FWIW, the HP-UX 11.11 list is:

configure:18907: checking for ISO C99 support to TR1 in <math.h>
configure:19031:  /test/gnu/gcc/objdir/./gcc/xgcc -shared-libgcc -B/ 
test/gnu/gcc
/objdir/./gcc -nostdinc++ -L/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/ 
libstdc++
-v3/src -L/test/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libstdc++-v3/ 
src/.libs -B/o
pt/gnu/gcc/gcc-4.8/hppa2.0w-hp-hpux11.11/bin/ -B/opt/gnu/gcc/gcc-4.8/ 
hppa2.0w-hp
-hpux11.11/lib/ -isystem /opt/gnu/gcc/gcc-4.8/hppa2.0w-hp-hpux11.11/ 
include -isy
stem /opt/gnu/gcc/gcc-4.8/hppa2.0w-hp-hpux11.11/sys-include    -c -g - 
O2 -std=c+
+98  conftest.cpp >&5
conftest.cpp: In function 'int main()':
conftest.cpp:67:16: error: 'acoshf' was not declared in this scope
      acoshf(0.0f);
                 ^
conftest.cpp:68:16: error: 'acoshl' was not declared in this scope
      acoshl(0.0l);
                 ^
conftest.cpp:70:16: error: 'asinhf' was not declared in this scope
      asinhf(0.0f);
                 ^
conftest.cpp:71:16: error: 'asinhl' was not declared in this scope
      asinhl(0.0l);
                 ^
conftest.cpp:73:16: error: 'atanhf' was not declared in this scope
      atanhf(0.0f);
                 ^
conftest.cpp:74:16: error: 'atanhl' was not declared in this scope
      atanhl(0.0l);
                 ^
conftest.cpp:77:15: error: 'cbrtl' was not declared in this scope
      cbrtl(0.0l);
                ^
conftest.cpp:80:25: error: 'copysignl' was not declared in this scope
      copysignl(0.0l, 0.0l);
                          ^
conftest.cpp:82:14: error: 'erff' was not declared in this scope
      erff(0.0f);
               ^
conftest.cpp:83:14: error: 'erfl' was not declared in this scope
      erfl(0.0l);
               ^
conftest.cpp:85:15: error: 'erfcf' was not declared in this scope
      erfcf(0.0f);
                ^
conftest.cpp:86:15: error: 'erfcl' was not declared in this scope
      erfcl(0.0l);
                ^
conftest.cpp:88:15: error: 'exp2f' was not declared in this scope
      exp2f(0.0f);
                ^
conftest.cpp:89:15: error: 'exp2l' was not declared in this scope
      exp2l(0.0l);
                ^
conftest.cpp:91:16: error: 'expm1f' was not declared in this scope
      expm1f(0.0f);
                 ^
conftest.cpp:92:16: error: 'expm1l' was not declared in this scope
      expm1l(0.0l);
                 ^
conftest.cpp:94:21: error: 'fdimf' was not declared in this scope
      fdimf(0.0f, 0.0f);
                      ^
conftest.cpp:95:21: error: 'fdiml' was not declared in this scope
      fdiml(0.0l, 0.0l);
                      ^
conftest.cpp:96:22: error: 'fma' was not declared in this scope
      fma(0.0, 0.0, 0.0);
                       ^
conftest.cpp:97:26: error: 'fmaf' was not declared in this scope
      fmaf(0.0f, 0.0f, 0.0f);
                           ^
conftest.cpp:98:26: error: 'fmal' was not declared in this scope
      fmal(0.0l, 0.0l, 0.0l);
                           ^
conftest.cpp:100:21: error: 'fmaxf' was not declared in this scope
      fmaxf(0.0f, 0.0f);
                      ^
conftest.cpp:101:21: error: 'fmaxl' was not declared in this scope
      fmaxl(0.0l, 0.0l);
                      ^
conftest.cpp:103:21: error: 'fminf' was not declared in this scope
      fminf(0.0f, 0.0f);
                      ^
conftest.cpp:104:21: error: 'fminl' was not declared in this scope
      fminl(0.0l, 0.0l);
                      ^
conftest.cpp:106:22: error: 'hypotf' was not declared in this scope
      hypotf(0.0f, 0.0f);
                       ^
conftest.cpp:107:22: error: 'hypotl' was not declared in this scope
      hypotl(0.0l, 0.0l);
                       ^
conftest.cpp:109:16: error: 'ilogbf' was not declared in this scope
      ilogbf(0.0f);
                 ^
conftest.cpp:110:16: error: 'ilogbl' was not declared in this scope
      ilogbl(0.0l);
                 ^
conftest.cpp:112:17: error: 'lgammaf' was not declared in this scope
      lgammaf(0.0f);
                  ^
conftest.cpp:113:17: error: 'lgammal' was not declared in this scope
      lgammal(0.0l);
                  ^
conftest.cpp:115:17: error: 'llrintf' was not declared in this scope
      llrintf(0.0f);
                  ^
conftest.cpp:116:17: error: 'llrintl' was not declared in this scope
      llrintl(0.0l);
                  ^
conftest.cpp:118:18: error: 'llroundf' was not declared in this scope
      llroundf(0.0f);
                   ^
conftest.cpp:119:18: error: 'llroundl' was not declared in this scope
      llroundl(0.0l);
                   ^
conftest.cpp:121:16: error: 'log1pf' was not declared in this scope
      log1pf(0.0f);
                 ^
conftest.cpp:122:16: error: 'log1pl' was not declared in this scope
      log1pl(0.0l);
                 ^
conftest.cpp:125:15: error: 'log2l' was not declared in this scope
      log2l(0.0l);
                ^
conftest.cpp:127:15: error: 'logbf' was not declared in this scope
      logbf(0.0f);
                ^
conftest.cpp:128:15: error: 'logbl' was not declared in this scope
      logbl(0.0l);
                ^
conftest.cpp:130:16: error: 'lrintf' was not declared in this scope
      lrintf(0.0f);
                 ^
conftest.cpp:131:16: error: 'lrintl' was not declared in this scope
      lrintl(0.0l);
                 ^
conftest.cpp:133:17: error: 'lroundf' was not declared in this scope
      lroundf(0.0f);
                  ^
conftest.cpp:134:17: error: 'lroundl' was not declared in this scope
      lroundl(0.0l);
                  ^
conftest.cpp:136:11: error: 'nanf' was not declared in this scope
      nanf(0);
            ^
conftest.cpp:137:11: error: 'nanl' was not declared in this scope
      nanl(0);
            ^
conftest.cpp:139:20: error: 'nearbyintf' was not declared in this scope
      nearbyintf(0.0f);
                     ^
conftest.cpp:140:20: error: 'nearbyintl' was not declared in this scope
      nearbyintl(0.0l);
                     ^
conftest.cpp:143:26: error: 'nextafterl' was not declared in this scope
      nextafterl(0.0l, 0.0l);
                           ^
conftest.cpp:144:24: error: 'nexttoward' was not declared in this scope
      nexttoward(0.0, 0.0);
                         ^
conftest.cpp:145:27: error: 'nexttowardf' was not declared in this scope
      nexttowardf(0.0f, 0.0f);
                            ^
conftest.cpp:146:27: error: 'nexttowardl' was not declared in this scope
      nexttowardl(0.0l, 0.0l);
                            ^
conftest.cpp:148:26: error: 'remainderf' was not declared in this scope
      remainderf(0.0f, 0.0f);
                           ^
conftest.cpp:149:26: error: 'remainderl' was not declared in this scope
      remainderl(0.0l, 0.0l);
                           ^
conftest.cpp:151:26: error: 'remquof' was not declared in this scope
      remquof(0.0f, 0.0f, 0);
                           ^
conftest.cpp:152:26: error: 'remquol' was not declared in this scope
      remquol(0.0l, 0.0l, 0);
                           ^
conftest.cpp:154:15: error: 'rintf' was not declared in this scope
      rintf(0.0f);
                ^
conftest.cpp:155:15: error: 'rintl' was not declared in this scope
      rintl(0.0l);
                ^
conftest.cpp:157:16: error: 'roundf' was not declared in this scope
      roundf(0.0f);
                 ^
conftest.cpp:158:16: error: 'roundl' was not declared in this scope
      roundl(0.0l);
                 ^
conftest.cpp:159:20: error: 'scalbln' was not declared in this scope
      scalbln(0.0, 0l);
                     ^
conftest.cpp:160:22: error: 'scalblnf' was not declared in this scope
      scalblnf(0.0f, 0l);
                       ^
conftest.cpp:161:22: error: 'scalblnl' was not declared in this scope
      scalblnl(0.0l, 0l);
                       ^
conftest.cpp:163:20: error: 'scalbnf' was not declared in this scope
      scalbnf(0.0f, 0);
                     ^
conftest.cpp:164:20: error: 'scalbnl' was not declared in this scope
      scalbnl(0.0l, 0);
                     ^
conftest.cpp:165:15: error: 'tgamma' was not declared in this scope
      tgamma(0.0);
                ^
conftest.cpp:166:17: error: 'tgammaf' was not declared in this scope
      tgammaf(0.0f);
                  ^
conftest.cpp:167:17: error: 'tgammal' was not declared in this scope
      tgammal(0.0l);
                  ^
conftest.cpp:169:16: error: 'truncf' was not declared in this scope
      truncf(0.0f);
                 ^
conftest.cpp:170:16: error: 'truncl' was not declared in this scope
      truncl(0.0l);
                 ^

--
John David Anglin	dave.anglin@bell.net
Comment 13 Paolo Carlini 2012-09-30 16:16:25 UTC
Hopeless ;)
Comment 14 dave.anglin 2012-09-30 17:15:24 UTC
On 30-Sep-12, at 12:16 PM, paolo.carlini at oracle dot com wrote:

> Hopeless ;)

Actually, the situation might not be completely hopeless as the  
libquadmath
support works...

I had planned to implement the long double aliases but haven't had  
time to
get around to it.

--
John David Anglin	dave.anglin@bell.net
Comment 15 Paolo Carlini 2012-09-30 17:38:42 UTC
Created attachment 28305 [details]
random.d.txt

I was joking, but I see many failures, not only for long double. Anyway, let's make sure we have a fall back, for now.
Comment 16 dave.anglin 2012-09-30 18:04:26 UTC
I will commit the attached change if there are no objections.

--
John David Anglin	dave.anglin@bell.net
Comment 17 paolo@gcc.gnu.org 2012-10-01 23:10:08 UTC
Author: paolo
Date: Mon Oct  1 23:10:02 2012
New Revision: 191944

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=191944
Log:
2012-10-01  Paolo Carlini  <paolo.carlini@oracle.com>

	PR libstdc++/54757
	* include/ext/random (rice_distribution<>::operator()): Use std::hypot
	only if _GLIBCXX_USE_C99_MATH_TR1.
	* include/ext/random.tcc (rice_distribution<>::__generate_impl):
	Likewise.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/ext/random
    trunk/libstdc++-v3/include/ext/random.tcc
Comment 18 Paolo Carlini 2012-10-01 23:13:32 UTC
Done.