diff mbox

TR29124 C++ Special Maths - Make <math.h> pull functions into global namespace.

Message ID C328DFD7-A8C2-4F80-B2A0-5204458500C3@comcast.net
State New
Headers show

Commit Message

Mike Stump Feb. 12, 2016, 8:39 p.m. UTC
On Feb 12, 2016, at 10:07 AM, Jonathan Wakely <jwakely@redhat.com> wrote:

> On 12/02/16 09:52 -0800, Mike Stump wrote:
>> On Feb 11, 2016, at 3:57 AM, Jonathan Wakely <jwakely@redhat.com> wrote:
>>> On 10/02/16 22:36 -0800, Mike Stump wrote:
>>>> I’m seeing:
>>>> 
>>>> /home/mrs/work1/gcc/libstdc++-v3/testsuite/special_functions/18_riemann_zeta/check_value.cc: In function 'void test(const testcase_riemann_zeta<Tp> (&)[Num], Tp)':
>>>> /home/mrs/work1/gcc/libstdc++-v3/testsuite/special_functions/18_riemann_zeta/check_value.cc:285:15: error: 'riemann_zeta' is not a member of 'std'
>>>> compiler exited with status 1
>>>> output is:
>>>> /home/mrs/work1/gcc/libstdc++-v3/testsuite/special_functions/18_riemann_zeta/check_value.cc: In function 'void test(const testcase_riemann_zeta<Tp> (&)[Num], Tp)':
>>>> /home/mrs/work1/gcc/libstdc++-v3/testsuite/special_functions/18_riemann_zeta/check_value.cc:285:15: error: 'riemann_zeta' is not a member of 'std'
>>>> 
>>>> FAIL: special_functions/18_riemann_zeta/check_value.cc (test for excess errors)
>>>> Excess errors:
>>>> /home/mrs/work1/gcc/libstdc++-v3/testsuite/special_functions/18_riemann_zeta/check_value.cc:285:15: error: 'riemann_zeta' is not a member of 'std'
>>>> 
>>>> UNRESOLVED: special_functions/18_riemann_zeta/check_value.cc compilation failed to produce executable
>>>> extra_tool_flags are:
>>>> -D__STDCPP_WANT_MATH_SPEC_FUNCS__
>>>> 
>>>> on a recent trunk.  This is a typical newlib port.  Not sure if this is a real bug or not, but thought I’d forward it long.
>>> 
>>> This confused me at first, but I think what must be happening is that
>>> your newlib port doesn't use c_model=c_global, so it uses a <cmath>
>>> header that doesn't #include <bits/spec_fun.h>.
>> 
>>> What does your $target/libstdc++-v3/config.log show instead of
>>> c_global here?
>> 
>> configure:16304: "C" header strategy set to c_global
>> 
>> So, I don’t know of a better way to do this, other than just provide the .ii file.  You can see what it was including, and where it didn’t include what you wanted.  We can then go from there.  I fear a longer series of 20 questions.  The good news is that this is the _only_ recent failure.
>> 
>> /home/mrs/work1/gcc-obj/./gcc/xg++ -shared-libgcc -B/home/mrs/work1/gcc-obj/./gcc -nostdinc++ -L/home/mrs/work1/gcc-obj/machine/libstdc++-v3/src -L/home/mrs/work1/gcc-obj/machine/libstdc++-v3/src/.libs -L/home/mrs/work1/gcc-obj/machine/libstdc++-v3/libsupc++/.libs -B/home/mrs/work1/install/machine/bin/ -B/home/mrs/work1/install/machine/lib/ -isystem /home/mrs/work1/install/machine/include -isystem /home/mrs/work1/install/machine/sys-include -B/home/mrs/work1/gcc-obj/machine/./libstdc++-v3/src/.libs -D_GLIBCXX_ASSERT -fmessage-length=0 -ffunction-sections -fdata-sections -g -O2 -mno-oe -DLOCALEDIR="." -nostdinc++ -I/home/mrs/work1/gcc-obj/machine/libstdc++-v3/include/machine -I/home/mrs/work1/gcc-obj/machine/libstdc++-v3/include -I/home/mrs/work1/gcc/libstdc++-v3/libsupc++ -I/home/mrs/work1/gcc/libstdc++-v3/include/backward -I/home/mrs/work1/gcc/libstdc++-v3/testsuite/util /home/mrs/work1/gcc/libstdc++-v3/testsuite/special_functions/18_riemann_zeta/check_value.cc -DMAX_ITERATIONS=5 -fno-diagnostics-show-caret -fdiagnostics-color=never ./libtestc++.a -Wl,--gc-sections -L/home/mrs/work1/gcc-obj/machine/libstdc++-v3/src/filesystem/.libs -mno-oe -lm -o ./check_value.exe -E
> 
> Thanks, the preprocessed file did help, because it showed that
> -D__STDCPP_WANT_MATH_SPEC_FUNCS__ was not being used, which is because
> we have this in the test:
> 
> // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
> ...
> // { dg-options "-DMAX_ITERATIONS=5" { target simulator } }

> Should the dg-options directive for simulators be using
> dg-additional-options instead?

I think that’s a good call.  Testing it out:

Old tests that failed, that have disappeared: (Eeek!)

: special_functions/18_riemann_zeta/check_value.cc (test for excess errors)


Ok?

Comments

Jonathan Wakely Feb. 12, 2016, 9:01 p.m. UTC | #1
On 12/02/16 12:39 -0800, Mike Stump wrote:
>
>On Feb 12, 2016, at 10:07 AM, Jonathan Wakely <jwakely@redhat.com> wrote:
>
>> On 12/02/16 09:52 -0800, Mike Stump wrote:
>>> On Feb 11, 2016, at 3:57 AM, Jonathan Wakely <jwakely@redhat.com> wrote:
>>>> On 10/02/16 22:36 -0800, Mike Stump wrote:
>>>>> I’m seeing:
>>>>>
>>>>> /home/mrs/work1/gcc/libstdc++-v3/testsuite/special_functions/18_riemann_zeta/check_value.cc: In function 'void test(const testcase_riemann_zeta<Tp> (&)[Num], Tp)':
>>>>> /home/mrs/work1/gcc/libstdc++-v3/testsuite/special_functions/18_riemann_zeta/check_value.cc:285:15: error: 'riemann_zeta' is not a member of 'std'
>>>>> compiler exited with status 1
>>>>> output is:
>>>>> /home/mrs/work1/gcc/libstdc++-v3/testsuite/special_functions/18_riemann_zeta/check_value.cc: In function 'void test(const testcase_riemann_zeta<Tp> (&)[Num], Tp)':
>>>>> /home/mrs/work1/gcc/libstdc++-v3/testsuite/special_functions/18_riemann_zeta/check_value.cc:285:15: error: 'riemann_zeta' is not a member of 'std'
>>>>>
>>>>> FAIL: special_functions/18_riemann_zeta/check_value.cc (test for excess errors)
>>>>> Excess errors:
>>>>> /home/mrs/work1/gcc/libstdc++-v3/testsuite/special_functions/18_riemann_zeta/check_value.cc:285:15: error: 'riemann_zeta' is not a member of 'std'
>>>>>
>>>>> UNRESOLVED: special_functions/18_riemann_zeta/check_value.cc compilation failed to produce executable
>>>>> extra_tool_flags are:
>>>>> -D__STDCPP_WANT_MATH_SPEC_FUNCS__
>>>>>
>>>>> on a recent trunk.  This is a typical newlib port.  Not sure if this is a real bug or not, but thought I’d forward it long.
>>>>
>>>> This confused me at first, but I think what must be happening is that
>>>> your newlib port doesn't use c_model=c_global, so it uses a <cmath>
>>>> header that doesn't #include <bits/spec_fun.h>.
>>>
>>>> What does your $target/libstdc++-v3/config.log show instead of
>>>> c_global here?
>>>
>>> configure:16304: "C" header strategy set to c_global
>>>
>>> So, I don’t know of a better way to do this, other than just provide the .ii file.  You can see what it was including, and where it didn’t include what you wanted.  We can then go from there.  I fear a longer series of 20 questions.  The good news is that this is the _only_ recent failure.
>>>
>>> /home/mrs/work1/gcc-obj/./gcc/xg++ -shared-libgcc -B/home/mrs/work1/gcc-obj/./gcc -nostdinc++ -L/home/mrs/work1/gcc-obj/machine/libstdc++-v3/src -L/home/mrs/work1/gcc-obj/machine/libstdc++-v3/src/.libs -L/home/mrs/work1/gcc-obj/machine/libstdc++-v3/libsupc++/.libs -B/home/mrs/work1/install/machine/bin/ -B/home/mrs/work1/install/machine/lib/ -isystem /home/mrs/work1/install/machine/include -isystem /home/mrs/work1/install/machine/sys-include -B/home/mrs/work1/gcc-obj/machine/./libstdc++-v3/src/.libs -D_GLIBCXX_ASSERT -fmessage-length=0 -ffunction-sections -fdata-sections -g -O2 -mno-oe -DLOCALEDIR="." -nostdinc++ -I/home/mrs/work1/gcc-obj/machine/libstdc++-v3/include/machine -I/home/mrs/work1/gcc-obj/machine/libstdc++-v3/include -I/home/mrs/work1/gcc/libstdc++-v3/libsupc++ -I/home/mrs/work1/gcc/libstdc++-v3/include/backward -I/home/mrs/work1/gcc/libstdc++-v3/testsuite/util /home/mrs/work1/gcc/libstdc++-v3/testsuite/special_functions/18_riemann_zeta/check_value.cc -DMAX_ITERATIONS=5 -fno-diagnostics-show-caret -fdiagnostics-color=never ./libtestc++.a -Wl,--gc-sections -L/home/mrs/work1/gcc-obj/machine/libstdc++-v3/src/filesystem/.libs -mno-oe -lm -o ./check_value.exe -E
>>
>> Thanks, the preprocessed file did help, because it showed that
>> -D__STDCPP_WANT_MATH_SPEC_FUNCS__ was not being used, which is because
>> we have this in the test:
>>
>> // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
>> ...
>> // { dg-options "-DMAX_ITERATIONS=5" { target simulator } }
>
>> Should the dg-options directive for simulators be using
>> dg-additional-options instead?
>
>I think that’s a good call.  Testing it out:
>
>Old tests that failed, that have disappeared: (Eeek!)
>
>: special_functions/18_riemann_zeta/check_value.cc (test for excess errors)
>
>
>Ok?

OK, thanks.
Mike Stump Feb. 12, 2016, 9:25 p.m. UTC | #2
On Feb 12, 2016, at 1:01 PM, Jonathan Wakely <jwakely@redhat.com> wrote:
> OK, thanks.

t double checked the log file:

  -D__STDCPP_WANT_MATH_SPEC_FUNCS__ -DMAX_ITERATIONS=5

which I neglected to do the first time.  With that check looking good as well, I checked it in, thanks.
diff mbox

Patch

diff --git a/libstdc++-v3/testsuite/special_functions/18_riemann_zeta/check_value.cc b/libstdc++-v3/testsuite/special_functions/18_riemann_zeta/check_value.cc
index d6b3171..f84edd8 100644
--- a/libstdc++-v3/testsuite/special_functions/18_riemann_zeta/check_value.cc
+++ b/libstdc++-v3/testsuite/special_functions/18_riemann_zeta/check_value.cc
@@ -20,7 +20,7 @@ 
 //  riemann_zeta
 
 // This can take long on simulators, timing out the test.
-// { dg-options "-DMAX_ITERATIONS=5" { target simulator } }
+// { dg-additional-options "-DMAX_ITERATIONS=5" { target simulator } }
 
 #ifndef MAX_ITERATIONS
 #define MAX_ITERATIONS (sizeof(data001) / sizeof(testcase_riemann_zeta<double>))
@@ -109,9 +109,6 @@  data001[55] =
 const double toler001 = 2.5000000000000020e-13;
 //  riemann_zeta
 
-// This can take long on simulators, timing out the test.
-// { dg-options "-DMAX_ITERATIONS=5" { target simulator } }
-
 #ifndef MAX_ITERATIONS
 #define MAX_ITERATIONS (sizeof(data001) / sizeof(testcase_riemann_zeta<double>))
 #endif