public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* TR29124 C++ Special Maths - Make <math.h> pull functions into global namespace.
@ 2016-01-21  1:30 Ed Smith-Rowland
  2016-01-21 12:29 ` Jonathan Wakely
  0 siblings, 1 reply; 11+ messages in thread
From: Ed Smith-Rowland @ 2016-01-21  1:30 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 467 bytes --]

Now that libstdc++ installs a proper math.h we can piggyback on that to 
put in the last bit of TR29124.

This patch adds the math special functions to c_compatibility/math.h in 
the global namespace.
I remove the XFAILs from the compile_2.cc tests.

This converts 21 XFAILs into 21 PASSes.

Tested on x86_64-linux.

I understand if this is too late.
I'll put it up on trunk and backport after stage 1 reopens.

Meanwhile I'll commit this to the tr29124 branch.

Ed


[-- Attachment #2: CL_tr29124_math_h --]
[-- Type: text/plain, Size: 1642 bytes --]

2016-01-20  Edward Smith-Rowland  <3dw4rd@verizon.net>

	TR29124 C++ Special Math - <math.h> pulls funcs into global namespace.
	* include/c_compatibility/math.h: Import the TR29124 functions
	into the global namespace.
	* testsuite/special_functions/01_assoc_laguerre/compile_2.cc: Remove
	xfail and make compile-only.
	* testsuite/special_functions/02_assoc_legendre/compile_2.cc: Ditto.
	* testsuite/special_functions/03_beta/compile_2.cc: Ditto.
	* testsuite/special_functions/04_comp_ellint_1/compile_2.cc: Ditto.
	* testsuite/special_functions/05_comp_ellint_2/compile_2.cc: Ditto.
	* testsuite/special_functions/06_comp_ellint_3/compile_2.cc: Ditto.
	* testsuite/special_functions/07_cyl_bessel_i/compile_2.cc: Ditto.
	* testsuite/special_functions/08_cyl_bessel_j/compile_2.cc: Ditto.
	* testsuite/special_functions/09_cyl_bessel_k/compile_2.cc: Ditto.
	* testsuite/special_functions/10_cyl_neumann/compile_2.cc: Ditto.
	* testsuite/special_functions/11_ellint_1/compile_2.cc: Ditto.
	* testsuite/special_functions/12_ellint_2/compile_2.cc: Ditto.
	* testsuite/special_functions/13_ellint_3/compile_2.cc: Ditto.
	* testsuite/special_functions/14_expint/compile_2.cc: Ditto.
	* testsuite/special_functions/15_hermite/compile_2.cc: Ditto.
	* testsuite/special_functions/16_laguerre/compile_2.cc: Ditto.
	* testsuite/special_functions/17_legendre/compile_2.cc: Ditto.
	* testsuite/special_functions/18_riemann_zeta/compile_2.cc: Ditto.
	* testsuite/special_functions/19_sph_bessel/compile_2.cc: Ditto.
	* testsuite/special_functions/20_sph_legendre/compile_2.cc: Ditto.
	* testsuite/special_functions/21_sph_neumann/compile_2.cc: Ditto.

[-- Attachment #3: patch_tr29124_math_h --]
[-- Type: text/plain, Size: 13917 bytes --]

Index: include/c_compatibility/math.h
===================================================================
--- include/c_compatibility/math.h	(revision 232610)
+++ include/c_compatibility/math.h	(working copy)
@@ -75,70 +75,71 @@
 #endif
 
 #if __STDCPP_WANT_MATH_SPEC_FUNCS__ == 1
-using std::assoc_laguerref
-using std::assoc_laguerrel
-using std::assoc_laguerre
-using std::assoc_legendref
-using std::assoc_legendrel
-using std::assoc_legendre
-using std::betaf
-using std::betal
-using std::beta
-using std::comp_ellint_1f
-using std::comp_ellint_1l
-using std::comp_ellint_1
-using std::comp_ellint_2f
-using std::comp_ellint_2l
-using std::comp_ellint_2
-using std::comp_ellint_3f
-using std::comp_ellint_3l
-using std::comp_ellint_3
-using std::cyl_bessel_if
-using std::cyl_bessel_il
-using std::cyl_bessel_i
-using std::cyl_bessel_jf
-using std::cyl_bessel_jl
-using std::cyl_bessel_j
-using std::cyl_bessel_kf
-using std::cyl_bessel_kl
-using std::cyl_bessel_k
-using std::cyl_neumannf
-using std::cyl_neumannl
-using std::cyl_neumann
-using std::ellint_1f
-using std::ellint_1l
-using std::ellint_1
-using std::ellint_2f
-using std::ellint_2l
-using std::ellint_2
-using std::ellint_3f
-using std::ellint_3l
-using std::ellint_3
-using std::expintf
-using std::expintl
-using std::expint
-using std::hermitef
-using std::hermitel
-using std::hermite
-using std::laguerref
-using std::laguerrel
-using std::laguerre
-using std::legendref
-using std::legendrel
-using std::legendre
-using std::riemann_zetaf
-using std::riemann_zetal
-using std::riemann_zeta
-using std::sph_besself
-using std::sph_bessell
-using std::sph_bessel
-using std::sph_legendref
-using std::sph_legendrel
-using std::sph_legendre
-using std::sph_neumannf
-using std::sph_neumannl
-using std::sph_neumann
-#endif
-#endif
+using std::assoc_laguerref;
+using std::assoc_laguerrel;
+using std::assoc_laguerre;
+using std::assoc_legendref;
+using std::assoc_legendrel;
+using std::assoc_legendre;
+using std::betaf;
+using std::betal;
+using std::beta;
+using std::comp_ellint_1f;
+using std::comp_ellint_1l;
+using std::comp_ellint_1;
+using std::comp_ellint_2f;
+using std::comp_ellint_2l;
+using std::comp_ellint_2;
+using std::comp_ellint_3f;
+using std::comp_ellint_3l;
+using std::comp_ellint_3;
+using std::cyl_bessel_if;
+using std::cyl_bessel_il;
+using std::cyl_bessel_i;
+using std::cyl_bessel_jf;
+using std::cyl_bessel_jl;
+using std::cyl_bessel_j;
+using std::cyl_bessel_kf;
+using std::cyl_bessel_kl;
+using std::cyl_bessel_k;
+using std::cyl_neumannf;
+using std::cyl_neumannl;
+using std::cyl_neumann;
+using std::ellint_1f;
+using std::ellint_1l;
+using std::ellint_1;
+using std::ellint_2f;
+using std::ellint_2l;
+using std::ellint_2;
+using std::ellint_3f;
+using std::ellint_3l;
+using std::ellint_3;
+using std::expintf;
+using std::expintl;
+using std::expint;
+using std::hermitef;
+using std::hermitel;
+using std::hermite;
+using std::laguerref;
+using std::laguerrel;
+using std::laguerre;
+using std::legendref;
+using std::legendrel;
+using std::legendre;
+using std::riemann_zetaf;
+using std::riemann_zetal;
+using std::riemann_zeta;
+using std::sph_besself;
+using std::sph_bessell;
+using std::sph_bessel;
+using std::sph_legendref;
+using std::sph_legendrel;
+using std::sph_legendre;
+using std::sph_neumannf;
+using std::sph_neumannl;
+using std::sph_neumann;
+#endif // __STDCPP_WANT_MATH_SPEC_FUNCS__
 
-#endif
+#endif // __cplusplus
+
+#endif // _GLIBCXX_MATH_H
Index: testsuite/special_functions/01_assoc_laguerre/compile_2.cc
===================================================================
--- testsuite/special_functions/01_assoc_laguerre/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/01_assoc_laguerre/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/02_assoc_legendre/compile_2.cc
===================================================================
--- testsuite/special_functions/02_assoc_legendre/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/02_assoc_legendre/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/03_beta/compile_2.cc
===================================================================
--- testsuite/special_functions/03_beta/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/03_beta/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/04_comp_ellint_1/compile_2.cc
===================================================================
--- testsuite/special_functions/04_comp_ellint_1/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/04_comp_ellint_1/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/05_comp_ellint_2/compile_2.cc
===================================================================
--- testsuite/special_functions/05_comp_ellint_2/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/05_comp_ellint_2/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/06_comp_ellint_3/compile_2.cc
===================================================================
--- testsuite/special_functions/06_comp_ellint_3/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/06_comp_ellint_3/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/07_cyl_bessel_i/compile_2.cc
===================================================================
--- testsuite/special_functions/07_cyl_bessel_i/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/07_cyl_bessel_i/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/08_cyl_bessel_j/compile_2.cc
===================================================================
--- testsuite/special_functions/08_cyl_bessel_j/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/08_cyl_bessel_j/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/09_cyl_bessel_k/compile_2.cc
===================================================================
--- testsuite/special_functions/09_cyl_bessel_k/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/09_cyl_bessel_k/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/10_cyl_neumann/compile_2.cc
===================================================================
--- testsuite/special_functions/10_cyl_neumann/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/10_cyl_neumann/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/11_ellint_1/compile_2.cc
===================================================================
--- testsuite/special_functions/11_ellint_1/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/11_ellint_1/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/12_ellint_2/compile_2.cc
===================================================================
--- testsuite/special_functions/12_ellint_2/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/12_ellint_2/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/13_ellint_3/compile_2.cc
===================================================================
--- testsuite/special_functions/13_ellint_3/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/13_ellint_3/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/14_expint/compile_2.cc
===================================================================
--- testsuite/special_functions/14_expint/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/14_expint/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/15_hermite/compile_2.cc
===================================================================
--- testsuite/special_functions/15_hermite/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/15_hermite/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/16_laguerre/compile_2.cc
===================================================================
--- testsuite/special_functions/16_laguerre/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/16_laguerre/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/17_legendre/compile_2.cc
===================================================================
--- testsuite/special_functions/17_legendre/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/17_legendre/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/18_riemann_zeta/compile_2.cc
===================================================================
--- testsuite/special_functions/18_riemann_zeta/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/18_riemann_zeta/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/19_sph_bessel/compile_2.cc
===================================================================
--- testsuite/special_functions/19_sph_bessel/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/19_sph_bessel/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/20_sph_legendre/compile_2.cc
===================================================================
--- testsuite/special_functions/20_sph_legendre/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/20_sph_legendre/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/21_sph_neumann/compile_2.cc
===================================================================
--- testsuite/special_functions/21_sph_neumann/compile_2.cc	(revision 232600)
+++ testsuite/special_functions/21_sph_neumann/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TR29124 C++ Special Maths - Make <math.h> pull functions into global namespace.
  2016-01-21  1:30 TR29124 C++ Special Maths - Make <math.h> pull functions into global namespace Ed Smith-Rowland
@ 2016-01-21 12:29 ` Jonathan Wakely
  2016-01-22  0:08   ` Ed Smith-Rowland
  0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Wakely @ 2016-01-21 12:29 UTC (permalink / raw)
  To: Ed Smith-Rowland; +Cc: libstdc++, gcc-patches

On 20/01/16 20:30 -0500, Ed Smith-Rowland wrote:
>Now that libstdc++ installs a proper math.h we can piggyback on that 
>to put in the last bit of TR29124.
>
>This patch adds the math special functions to c_compatibility/math.h 
>in the global namespace.
>I remove the XFAILs from the compile_2.cc tests.
>
>This converts 21 XFAILs into 21 PASSes.
>
>Tested on x86_64-linux.
>
>I understand if this is too late.
>I'll put it up on trunk and backport after stage 1 reopens.
>
>Meanwhile I'll commit this to the tr29124 branch.

I'm inclined to say the change is OK for trunk now. We've added math.h
and we've added the special functions, it would be good if the two new
things work together.

However ...

>Index: include/c_compatibility/math.h
>===================================================================
>--- include/c_compatibility/math.h	(revision 232610)
>+++ include/c_compatibility/math.h	(working copy)
>@@ -75,70 +75,71 @@
> #endif
>
> #if __STDCPP_WANT_MATH_SPEC_FUNCS__ == 1
>-using std::assoc_laguerref

This doesn't look like the right patch, because these lines aren't in
the version on trunk.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TR29124 C++ Special Maths - Make <math.h> pull functions into global namespace.
  2016-01-21 12:29 ` Jonathan Wakely
@ 2016-01-22  0:08   ` Ed Smith-Rowland
  2016-01-22 10:39     ` Jonathan Wakely
  0 siblings, 1 reply; 11+ messages in thread
From: Ed Smith-Rowland @ 2016-01-22  0:08 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: libstdc++, gcc-patches

On 01/21/2016 07:29 AM, Jonathan Wakely wrote:
> On 20/01/16 20:30 -0500, Ed Smith-Rowland wrote:
>> Now that libstdc++ installs a proper math.h we can piggyback on that 
>> to put in the last bit of TR29124.
>>
>> This patch adds the math special functions to c_compatibility/math.h 
>> in the global namespace.
>> I remove the XFAILs from the compile_2.cc tests.
>>
>> This converts 21 XFAILs into 21 PASSes.
>>
>> Tested on x86_64-linux.
>>
>> I understand if this is too late.
>> I'll put it up on trunk and backport after stage 1 reopens.
>>
>> Meanwhile I'll commit this to the tr29124 branch.
>
> I'm inclined to say the change is OK for trunk now. We've added math.h
> and we've added the special functions, it would be good if the two new
> things work together.
>
> However ...
>
>> Index: include/c_compatibility/math.h
>> ===================================================================
>> --- include/c_compatibility/math.h    (revision 232610)
>> +++ include/c_compatibility/math.h    (working copy)
>> @@ -75,70 +75,71 @@
>> #endif
>>
>> #if __STDCPP_WANT_MATH_SPEC_FUNCS__ == 1
>> -using std::assoc_laguerref
>
> This doesn't look like the right patch, because these lines aren't in
> the version on trunk.
>
>
I must have given you a negative patch relative to the tr29124 
branch...  Sigh.
I'll make a new one.
Those lines have to be *added*.
Sorry.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TR29124 C++ Special Maths - Make <math.h> pull functions into global namespace.
  2016-01-22  0:08   ` Ed Smith-Rowland
@ 2016-01-22 10:39     ` Jonathan Wakely
  2016-01-22 23:19       ` Ed Smith-Rowland
  0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Wakely @ 2016-01-22 10:39 UTC (permalink / raw)
  To: Ed Smith-Rowland; +Cc: libstdc++, gcc-patches

On 21/01/16 19:07 -0500, Ed Smith-Rowland wrote:
>On 01/21/2016 07:29 AM, Jonathan Wakely wrote:
>>On 20/01/16 20:30 -0500, Ed Smith-Rowland wrote:
>>>Now that libstdc++ installs a proper math.h we can piggyback on 
>>>that to put in the last bit of TR29124.
>>>
>>>This patch adds the math special functions to 
>>>c_compatibility/math.h in the global namespace.
>>>I remove the XFAILs from the compile_2.cc tests.
>>>
>>>This converts 21 XFAILs into 21 PASSes.
>>>
>>>Tested on x86_64-linux.
>>>
>>>I understand if this is too late.
>>>I'll put it up on trunk and backport after stage 1 reopens.
>>>
>>>Meanwhile I'll commit this to the tr29124 branch.
>>
>>I'm inclined to say the change is OK for trunk now. We've added math.h
>>and we've added the special functions, it would be good if the two new
>>things work together.
>>
>>However ...
>>
>>>Index: include/c_compatibility/math.h
>>>===================================================================
>>>--- include/c_compatibility/math.h    (revision 232610)
>>>+++ include/c_compatibility/math.h    (working copy)
>>>@@ -75,70 +75,71 @@
>>>#endif
>>>
>>>#if __STDCPP_WANT_MATH_SPEC_FUNCS__ == 1
>>>-using std::assoc_laguerref
>>
>>This doesn't look like the right patch, because these lines aren't in
>>the version on trunk.
>>
>>
>I must have given you a negative patch relative to the tr29124 
>branch...  Sigh.
>I'll make a new one.
>Those lines have to be *added*.
>Sorry.

No problem. It looks like it was a partial patch, adding semi-colons
to the using declarations, so you just need to diff against the
previous revision instead.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TR29124 C++ Special Maths - Make <math.h> pull functions into global namespace.
  2016-01-22 10:39     ` Jonathan Wakely
@ 2016-01-22 23:19       ` Ed Smith-Rowland
  2016-02-11  6:39         ` Mike Stump
  0 siblings, 1 reply; 11+ messages in thread
From: Ed Smith-Rowland @ 2016-01-22 23:19 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1826 bytes --]

On 01/22/2016 05:39 AM, Jonathan Wakely wrote:
> On 21/01/16 19:07 -0500, Ed Smith-Rowland wrote:
>> On 01/21/2016 07:29 AM, Jonathan Wakely wrote:
>>> On 20/01/16 20:30 -0500, Ed Smith-Rowland wrote:
>>>> Now that libstdc++ installs a proper math.h we can piggyback on 
>>>> that to put in the last bit of TR29124.
>>>>
>>>> This patch adds the math special functions to 
>>>> c_compatibility/math.h in the global namespace.
>>>> I remove the XFAILs from the compile_2.cc tests.
>>>>
>>>> This converts 21 XFAILs into 21 PASSes.
>>>>
>>>> Tested on x86_64-linux.
>>>>
>>>> I understand if this is too late.
>>>> I'll put it up on trunk and backport after stage 1 reopens.
>>>>
>>>> Meanwhile I'll commit this to the tr29124 branch.
>>>
>>> I'm inclined to say the change is OK for trunk now. We've added math.h
>>> and we've added the special functions, it would be good if the two new
>>> things work together.
>>>
>>> However ...
>>>
>>>> Index: include/c_compatibility/math.h
>>>> ===================================================================
>>>> --- include/c_compatibility/math.h    (revision 232610)
>>>> +++ include/c_compatibility/math.h    (working copy)
>>>> @@ -75,70 +75,71 @@
>>>> #endif
>>>>
>>>> #if __STDCPP_WANT_MATH_SPEC_FUNCS__ == 1
>>>> -using std::assoc_laguerref
>>>
>>> This doesn't look like the right patch, because these lines aren't in
>>> the version on trunk.
>>>
>>>
>> I must have given you a negative patch relative to the tr29124 
>> branch...  Sigh.
>> I'll make a new one.
>> Those lines have to be *added*.
>> Sorry.
>
> No problem. It looks like it was a partial patch, adding semi-colons
> to the using declarations, so you just need to diff against the
> previous revision instead.
>
>
Here are the correct patches.

Retested on x86-64-linux.

Committed as revision 232755.

Ed


[-- Attachment #2: CL_tr29124_math_h --]
[-- Type: text/plain, Size: 1643 bytes --]

2016-01-22  Edward Smith-Rowland  <3dw4rd@verizon.net>

	TR29124 C++ Special Math - <math.h> pulls funcs into global namespace.
	* include/c_compatibility/math.h: Import the TR29124 functions
	into the global namespace.
	* testsuite/special_functions/01_assoc_laguerre/compile_2.cc: Remove
	xfail and make compile-only.
	* testsuite/special_functions/02_assoc_legendre/compile_2.cc: Ditto.
	* testsuite/special_functions/03_beta/compile_2.cc: Ditto.
	* testsuite/special_functions/04_comp_ellint_1/compile_2.cc: Ditto.
	* testsuite/special_functions/05_comp_ellint_2/compile_2.cc: Ditto.
	* testsuite/special_functions/06_comp_ellint_3/compile_2.cc: Ditto.
	* testsuite/special_functions/07_cyl_bessel_i/compile_2.cc: Ditto.
	* testsuite/special_functions/08_cyl_bessel_j/compile_2.cc: Ditto.
	* testsuite/special_functions/09_cyl_bessel_k/compile_2.cc: Ditto.
	* testsuite/special_functions/10_cyl_neumann/compile_2.cc: Ditto.
	* testsuite/special_functions/11_ellint_1/compile_2.cc: Ditto.
	* testsuite/special_functions/12_ellint_2/compile_2.cc: Ditto.
	* testsuite/special_functions/13_ellint_3/compile_2.cc: Ditto.
	* testsuite/special_functions/14_expint/compile_2.cc: Ditto.
	* testsuite/special_functions/15_hermite/compile_2.cc: Ditto.
	* testsuite/special_functions/16_laguerre/compile_2.cc: Ditto.
	* testsuite/special_functions/17_legendre/compile_2.cc: Ditto.
	* testsuite/special_functions/18_riemann_zeta/compile_2.cc: Ditto.
	* testsuite/special_functions/19_sph_bessel/compile_2.cc: Ditto.
	* testsuite/special_functions/20_sph_legendre/compile_2.cc: Ditto.
	* testsuite/special_functions/21_sph_neumann/compile_2.cc: Ditto.


[-- Attachment #3: patch_tr29124_math_h --]
[-- Type: text/plain, Size: 12460 bytes --]

Index: include/c_compatibility/math.h
===================================================================
--- include/c_compatibility/math.h	(revision 232742)
+++ include/c_compatibility/math.h	(working copy)
@@ -111,5 +111,73 @@
 using std::trunc;
 #endif // C++11 && _GLIBCXX_USE_C99_MATH_TR1
 
-#endif
-#endif
+#if __STDCPP_WANT_MATH_SPEC_FUNCS__ == 1
+using std::assoc_laguerref;
+using std::assoc_laguerrel;
+using std::assoc_laguerre;
+using std::assoc_legendref;
+using std::assoc_legendrel;
+using std::assoc_legendre;
+using std::betaf;
+using std::betal;
+using std::beta;
+using std::comp_ellint_1f;
+using std::comp_ellint_1l;
+using std::comp_ellint_1;
+using std::comp_ellint_2f;
+using std::comp_ellint_2l;
+using std::comp_ellint_2;
+using std::comp_ellint_3f;
+using std::comp_ellint_3l;
+using std::comp_ellint_3;
+using std::cyl_bessel_if;
+using std::cyl_bessel_il;
+using std::cyl_bessel_i;
+using std::cyl_bessel_jf;
+using std::cyl_bessel_jl;
+using std::cyl_bessel_j;
+using std::cyl_bessel_kf;
+using std::cyl_bessel_kl;
+using std::cyl_bessel_k;
+using std::cyl_neumannf;
+using std::cyl_neumannl;
+using std::cyl_neumann;
+using std::ellint_1f;
+using std::ellint_1l;
+using std::ellint_1;
+using std::ellint_2f;
+using std::ellint_2l;
+using std::ellint_2;
+using std::ellint_3f;
+using std::ellint_3l;
+using std::ellint_3;
+using std::expintf;
+using std::expintl;
+using std::expint;
+using std::hermitef;
+using std::hermitel;
+using std::hermite;
+using std::laguerref;
+using std::laguerrel;
+using std::laguerre;
+using std::legendref;
+using std::legendrel;
+using std::legendre;
+using std::riemann_zetaf;
+using std::riemann_zetal;
+using std::riemann_zeta;
+using std::sph_besself;
+using std::sph_bessell;
+using std::sph_bessel;
+using std::sph_legendref;
+using std::sph_legendrel;
+using std::sph_legendre;
+using std::sph_neumannf;
+using std::sph_neumannl;
+using std::sph_neumann;
+#endif // __STDCPP_WANT_MATH_SPEC_FUNCS__
+
+#endif // __cplusplus
+
+#endif // _GLIBCXX_MATH_H
+
Index: testsuite/special_functions/01_assoc_laguerre/compile_2.cc
===================================================================
--- testsuite/special_functions/01_assoc_laguerre/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/01_assoc_laguerre/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/02_assoc_legendre/compile_2.cc
===================================================================
--- testsuite/special_functions/02_assoc_legendre/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/02_assoc_legendre/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/03_beta/compile_2.cc
===================================================================
--- testsuite/special_functions/03_beta/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/03_beta/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/04_comp_ellint_1/compile_2.cc
===================================================================
--- testsuite/special_functions/04_comp_ellint_1/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/04_comp_ellint_1/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/05_comp_ellint_2/compile_2.cc
===================================================================
--- testsuite/special_functions/05_comp_ellint_2/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/05_comp_ellint_2/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/06_comp_ellint_3/compile_2.cc
===================================================================
--- testsuite/special_functions/06_comp_ellint_3/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/06_comp_ellint_3/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/07_cyl_bessel_i/compile_2.cc
===================================================================
--- testsuite/special_functions/07_cyl_bessel_i/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/07_cyl_bessel_i/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/08_cyl_bessel_j/compile_2.cc
===================================================================
--- testsuite/special_functions/08_cyl_bessel_j/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/08_cyl_bessel_j/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/09_cyl_bessel_k/compile_2.cc
===================================================================
--- testsuite/special_functions/09_cyl_bessel_k/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/09_cyl_bessel_k/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/10_cyl_neumann/compile_2.cc
===================================================================
--- testsuite/special_functions/10_cyl_neumann/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/10_cyl_neumann/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/11_ellint_1/compile_2.cc
===================================================================
--- testsuite/special_functions/11_ellint_1/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/11_ellint_1/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/12_ellint_2/compile_2.cc
===================================================================
--- testsuite/special_functions/12_ellint_2/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/12_ellint_2/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/13_ellint_3/compile_2.cc
===================================================================
--- testsuite/special_functions/13_ellint_3/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/13_ellint_3/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/14_expint/compile_2.cc
===================================================================
--- testsuite/special_functions/14_expint/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/14_expint/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/15_hermite/compile_2.cc
===================================================================
--- testsuite/special_functions/15_hermite/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/15_hermite/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/16_laguerre/compile_2.cc
===================================================================
--- testsuite/special_functions/16_laguerre/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/16_laguerre/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/17_legendre/compile_2.cc
===================================================================
--- testsuite/special_functions/17_legendre/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/17_legendre/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/18_riemann_zeta/compile_2.cc
===================================================================
--- testsuite/special_functions/18_riemann_zeta/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/18_riemann_zeta/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/19_sph_bessel/compile_2.cc
===================================================================
--- testsuite/special_functions/19_sph_bessel/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/19_sph_bessel/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/20_sph_legendre/compile_2.cc
===================================================================
--- testsuite/special_functions/20_sph_legendre/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/20_sph_legendre/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.
Index: testsuite/special_functions/21_sph_neumann/compile_2.cc
===================================================================
--- testsuite/special_functions/21_sph_neumann/compile_2.cc	(revision 232742)
+++ testsuite/special_functions/21_sph_neumann/compile_2.cc	(working copy)
@@ -1,5 +1,4 @@
-// { dg-do compile { xfail *-*-* } }
-// { dg-excess-errors "" }
+// { dg-do compile }
 // { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
 
 // Copyright (C) 2016 Free Software Foundation, Inc.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TR29124 C++ Special Maths - Make <math.h> pull functions into global namespace.
  2016-01-22 23:19       ` Ed Smith-Rowland
@ 2016-02-11  6:39         ` Mike Stump
  2016-02-11 11:57           ` Jonathan Wakely
  0 siblings, 1 reply; 11+ messages in thread
From: Mike Stump @ 2016-02-11  6:39 UTC (permalink / raw)
  To: Ed Smith-Rowland; +Cc: Jonathan Wakely, libstdc++, gcc-patches

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.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TR29124 C++ Special Maths - Make <math.h> pull functions into global namespace.
  2016-02-11  6:39         ` Mike Stump
@ 2016-02-11 11:57           ` Jonathan Wakely
       [not found]             ` <9DEAAB23-9B86-4DAF-99D8-13F22C3A3A1D@comcast.net>
  0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Wakely @ 2016-02-11 11:57 UTC (permalink / raw)
  To: Mike Stump; +Cc: Ed Smith-Rowland, libstdc++, gcc-patches

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:16391: "C" header strategy set to c_global

(Alternatively, just look at where the
$target/libstdc++-v3/include/cmath symlink points).


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TR29124 C++ Special Maths - Make <math.h> pull functions into global namespace.
       [not found]             ` <9DEAAB23-9B86-4DAF-99D8-13F22C3A3A1D@comcast.net>
@ 2016-02-12 18:07               ` Jonathan Wakely
  2016-02-12 20:43                 ` Mike Stump
  0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Wakely @ 2016-02-12 18:07 UTC (permalink / raw)
  To: Mike Stump; +Cc: Ed Smith-Rowland, libstdc++, gcc-patches

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 } }

So on a simulator we *only* get the MAX_ITERATIONS macro, and not the
__STDCPP_WANT_MATH_SPEC_FUNCS__ one which is needed for the test to
compile (I was misled by the "extra_tool_flags are:" above which
suggested that was set, so I didn't even consider it wasn't!)

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


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TR29124 C++ Special Maths - Make <math.h> pull functions into global namespace.
  2016-02-12 18:07               ` Jonathan Wakely
@ 2016-02-12 20:43                 ` Mike Stump
  2016-02-12 21:01                   ` Jonathan Wakely
  0 siblings, 1 reply; 11+ messages in thread
From: Mike Stump @ 2016-02-12 20:43 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Ed Smith-Rowland, libstdc++, gcc-patches


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?

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

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TR29124 C++ Special Maths - Make <math.h> pull functions into global namespace.
  2016-02-12 20:43                 ` Mike Stump
@ 2016-02-12 21:01                   ` Jonathan Wakely
  2016-02-12 21:29                     ` Mike Stump
  0 siblings, 1 reply; 11+ messages in thread
From: Jonathan Wakely @ 2016-02-12 21:01 UTC (permalink / raw)
  To: Mike Stump; +Cc: Ed Smith-Rowland, libstdc++, gcc-patches

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.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: TR29124 C++ Special Maths - Make <math.h> pull functions into global namespace.
  2016-02-12 21:01                   ` Jonathan Wakely
@ 2016-02-12 21:29                     ` Mike Stump
  0 siblings, 0 replies; 11+ messages in thread
From: Mike Stump @ 2016-02-12 21:29 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: Ed Smith-Rowland, libstdc++, gcc-patches

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.

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-02-12 21:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-21  1:30 TR29124 C++ Special Maths - Make <math.h> pull functions into global namespace Ed Smith-Rowland
2016-01-21 12:29 ` Jonathan Wakely
2016-01-22  0:08   ` Ed Smith-Rowland
2016-01-22 10:39     ` Jonathan Wakely
2016-01-22 23:19       ` Ed Smith-Rowland
2016-02-11  6:39         ` Mike Stump
2016-02-11 11:57           ` Jonathan Wakely
     [not found]             ` <9DEAAB23-9B86-4DAF-99D8-13F22C3A3A1D@comcast.net>
2016-02-12 18:07               ` Jonathan Wakely
2016-02-12 20:43                 ` Mike Stump
2016-02-12 21:01                   ` Jonathan Wakely
2016-02-12 21:29                     ` Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).