[Bug libstdc++/114101] FAIL: 26_numerics/headers/cmath/functions_std_c++17.cc -std=gnu++17 (test for excess errors)

2024-03-23 Thread dave.anglin at bell dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101

--- Comment #13 from dave.anglin at bell dot net ---
With the patch, we now have:
name7161.cc:5: error: #error '__cpp_lib_text_encoding' is false
compiler exited with status 1
UNSUPPORTED: std/text_encoding/cons.cc  -std=gnu++26
UNSUPPORTED: std/text_encoding/members.cc  -std=gnu++26
name7161.cc:5: error: #error '__cpp_lib_text_encoding' is false
compiler exited with status 1
UNSUPPORTED: std/text_encoding/requirements.cc  -std=gnu++26

The FAILs are gone.

[Bug libstdc++/114101] FAIL: 26_numerics/headers/cmath/functions_std_c++17.cc -std=gnu++17 (test for excess errors)

2024-03-22 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101

--- Comment #12 from Jonathan Wakely  ---
Here's a patch to make it UNSUPPORTED on any target that doesn't define the
feature's feature test macro
https://gcc.gnu.org/pipermail/gcc-patches/2024-March/648266.html

[Bug libstdc++/114101] FAIL: 26_numerics/headers/cmath/functions_std_c++17.cc -std=gnu++17 (test for excess errors)

2024-03-22 Thread dave.anglin at bell dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101

--- Comment #11 from dave.anglin at bell dot net ---
On 2024-03-22 3:00 p.m., redi at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101
>
> --- Comment #10 from Jonathan Wakely  ---
> This two depend on _GLIBCXX_USE_NL_LANGINFO_L which is set by:
>
>AC_TRY_COMPILE([
>#include 
>#if __has_include()
># include 
>#endif
>#include 
>],[
>  locale_t loc = newlocale(LC_ALL_MASK, "", (locale_t)0);
>  const char* enc = nl_langinfo_l(CODESET, loc);
>  freelocale(loc);
>], [ac_nl_langinfo_l=yes], [ac_nl_langinfo_l=no])
newlocale/freelocale aren't supported on hpux, so test needs to be skipped or
xfailed.

https://www.gnu.org/software/gnulib/manual/html_node/newlocale.html

[Bug libstdc++/114101] FAIL: 26_numerics/headers/cmath/functions_std_c++17.cc -std=gnu++17 (test for excess errors)

2024-03-22 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101

--- Comment #10 from Jonathan Wakely  ---
This two depend on _GLIBCXX_USE_NL_LANGINFO_L which is set by:

  AC_TRY_COMPILE([
  #include 
  #if __has_include()
  # include 
  #endif
  #include 
  ],[
locale_t loc = newlocale(LC_ALL_MASK, "", (locale_t)0);
const char* enc = nl_langinfo_l(CODESET, loc);
freelocale(loc);
  ], [ac_nl_langinfo_l=yes], [ac_nl_langinfo_l=no])

[Bug libstdc++/114101] FAIL: 26_numerics/headers/cmath/functions_std_c++17.cc -std=gnu++17 (test for excess errors)

2024-03-22 Thread danglin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101

--- Comment #9 from John David Anglin  ---
These two fails are different and not addressed by patch:

FAIL: std/text_encoding/cons.cc  -std=gnu++26 (test for excess errors)
UNRESOLVED: std/text_encoding/cons.cc  -std=gnu++26 compilation failed to
produce executable
FAIL: std/text_encoding/requirements.cc  -std=gnu++26 (test for excess errors)

FAIL: std/text_encoding/cons.cc  -std=gnu++26 (test for excess errors)
Excess errors:
/home/dave/gnu/gcc/gcc/libstdc++-v3/testsuite/std/text_encoding/cons.cc:12:
erro
r: 'text_encoding' is not a member of 'std'
/home/dave/gnu/gcc/gcc/libstdc++-v3/testsuite/std/text_encoding/cons.cc:13:
erro
r: 'e0' was not declared in this scope; did you mean 'y0'?
[...]

[Bug libstdc++/114101] FAIL: 26_numerics/headers/cmath/functions_std_c++17.cc -std=gnu++17 (test for excess errors)

2024-03-01 Thread danglin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101

--- Comment #8 from John David Anglin  ---
Patch here:
https://gcc.gnu.org/pipermail/gcc-patches/2024-February/646905.html

[Bug libstdc++/114101] FAIL: 26_numerics/headers/cmath/functions_std_c++17.cc -std=gnu++17 (test for excess errors)

2024-02-25 Thread dave.anglin at bell dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101

--- Comment #7 from dave.anglin at bell dot net ---
On 2024-02-25 4:04 p.m., dave.anglin at bell dot net wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101
>
> --- Comment #6 from dave.anglin at bell dot net ---
> The  for HP-UX doesn't do this sort of thing:
>> extern double acos(double __x) __ATTR_CONST__;
>> #define acosf    acos        /**< The alias for acos().    */
>>
>> Technically, avr doesn't have a proper acosf.  If float and double differ, 
>> acos
>> won't handle exceptional
>> values correctly for acosf.  So, I think the AC_DEFINEs for the float 
>> variants
>> should be removed or
>> conditioned on some libc version.
> With my proposed patch, the avr defines for the float variants in
> crossconfig.m4 can be removed
> and the code will fallback to using the float stubs.
But I need to move the undefs for the C99 math funcs forward before the
declarations.

[Bug libstdc++/114101] FAIL: 26_numerics/headers/cmath/functions_std_c++17.cc -std=gnu++17 (test for excess errors)

2024-02-25 Thread dave.anglin at bell dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101

--- Comment #6 from dave.anglin at bell dot net ---
The  for HP-UX doesn't do this sort of thing:
> extern double acos(double __x) __ATTR_CONST__;
> #define acosf    acos        /**< The alias for acos().    */
>
> Technically, avr doesn't have a proper acosf.  If float and double differ, 
> acos
> won't handle exceptional
> values correctly for acosf.  So, I think the AC_DEFINEs for the float variants
> should be removed or
> conditioned on some libc version.
With my proposed patch, the avr defines for the float variants in
crossconfig.m4 can be removed
and the code will fallback to using the float stubs.

[Bug libstdc++/114101] FAIL: 26_numerics/headers/cmath/functions_std_c++17.cc -std=gnu++17 (test for excess errors)

2024-02-25 Thread danglin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101

--- Comment #5 from John David Anglin  ---
Test results without patch:
https://gcc.gnu.org/pipermail/gcc-testresults/2024-February/808830.html
=== libstdc++ tests ===


Running target unix
FAIL: 19_diagnostics/stacktrace/current.cc  -std=gnu++23 execution test
FAIL: 19_diagnostics/stacktrace/current.cc  -std=gnu++26 execution test
FAIL: 19_diagnostics/stacktrace/entry.cc  -std=gnu++23 execution test
FAIL: 19_diagnostics/stacktrace/entry.cc  -std=gnu++26 execution test
FAIL: 19_diagnostics/stacktrace/output.cc  -std=gnu++23 execution test
FAIL: 19_diagnostics/stacktrace/output.cc  -std=gnu++26 execution test
FAIL: 19_diagnostics/stacktrace/stacktrace.cc  -std=gnu++23 execution test
FAIL: 19_diagnostics/stacktrace/stacktrace.cc  -std=gnu++26 execution test
FAIL: 20_util/from_chars/4.cc  -std=gnu++17 execution test
FAIL: 20_util/from_chars/8.cc  -std=gnu++23 execution test
FAIL: 20_util/from_chars/8.cc  -std=gnu++26 execution test
FAIL: 20_util/to_chars/float128_c++23.cc  -std=gnu++23 execution test
FAIL: 20_util/to_chars/float128_c++23.cc  -std=gnu++26 execution test
FAIL: 26_numerics/headers/cmath/constexpr_std_c++23.cc  -std=gnu++23 (test for
excess errors)
FAIL: 26_numerics/headers/cmath/constexpr_std_c++23.cc  -std=gnu++26 (test for
excess errors)
FAIL: 26_numerics/headers/cmath/equivalent_functions.cc  -std=gnu++17 (test for
excess errors)
UNRESOLVED: 26_numerics/headers/cmath/equivalent_functions.cc  -std=gnu++17
compilation failed to produce executable
FAIL: 26_numerics/headers/cmath/functions_std_c++17.cc  -std=gnu++17 (test for
excess errors)
FAIL: 26_numerics/headers/cmath/functions_std_c++23.cc  -std=gnu++23 (test for
excess errors)
FAIL: 26_numerics/headers/cmath/functions_std_c++23.cc  -std=gnu++26 (test for
excess errors)
FAIL: 26_numerics/headers/cmath/nextafter_c++23.cc  -std=gnu++23 (test for
excess errors)
UNRESOLVED: 26_numerics/headers/cmath/nextafter_c++23.cc  -std=gnu++23
compilation failed to produce executable
FAIL: 26_numerics/headers/cmath/nextafter_c++23.cc  -std=gnu++26 (test for
excess errors)
UNRESOLVED: 26_numerics/headers/cmath/nextafter_c++23.cc  -std=gnu++26
compilation failed to produce executable
FAIL: 27_io/basic_ofstream/open/char/noreplace.cc  -std=gnu++17 execution test
FAIL: 27_io/basic_ofstream/open/wchar_t/noreplace.cc  -std=gnu++17 execution
test
FAIL: 29_atomics/atomic/lock_free_aliases.cc  -std=gnu++20 (test for excess
errors)
FAIL: 29_atomics/atomic/lock_free_aliases.cc  -std=gnu++26 (test for excess
errors)
FAIL: std/text_encoding/cons.cc  -std=gnu++26 (test for excess errors)
UNRESOLVED: std/text_encoding/cons.cc  -std=gnu++26 compilation failed to
produce executable
FAIL: std/text_encoding/requirements.cc  -std=gnu++26 (test for excess errors)

=== libstdc++ Summary ===

# of expected passes16365
# of unexpected failures27
# of expected failures  126
# of unresolved testcases   4
# of unsupported tests  1109

Compiler version: 14.0.1 20240223 (experimental) [remotes/origin/trunk
r14-9158-gfdf9df9d558] (GCC) 
Platform: hppa64-hp-hpux11.11
configure flags: --without-zstd --with-gnu-as --with-as=/opt/gnu64/bin/as
--with-ld=/usr/ccs/bin/ld --enable-shared --with-local-prefix=/opt/gnu64
--prefix=/opt/gnu64/gcc/gcc-14 --disable-nls --without-libiconv-prefix
--without-libintl-prefix --enable-threads=posix --with-gmp=/opt/gnu64/gcc/gmp
--with-isl=/opt/gnu64/gcc/gmp --with-stage1-ldflags='-Wl,+b
-Wl,/opt/gnu64/gcc/gcc-12/lib:/opt/gnu64/lib' --with-boot-ldflags=
--enable-checking=release --enable-libgomp --enable-libstdcxx CC=gcc CXX=g++
--disable-lto --enable-languages=c,c++


Test results with patch:
https://gcc.gnu.org/pipermail/gcc-testresults/2024-February/808771.html

=== libstdc++ tests ===


Running target unix
FAIL: 19_diagnostics/stacktrace/current.cc  -std=gnu++23 execution test
FAIL: 19_diagnostics/stacktrace/current.cc  -std=gnu++26 execution test
FAIL: 19_diagnostics/stacktrace/entry.cc  -std=gnu++23 execution test
FAIL: 19_diagnostics/stacktrace/entry.cc  -std=gnu++26 execution test
FAIL: 19_diagnostics/stacktrace/output.cc  -std=gnu++23 execution test
FAIL: 19_diagnostics/stacktrace/output.cc  -std=gnu++26 execution test
FAIL: 19_diagnostics/stacktrace/stacktrace.cc  -std=gnu++23 execution test
FAIL: 19_diagnostics/stacktrace/stacktrace.cc  -std=gnu++26 execution test
FAIL: 20_util/from_chars/4.cc  -std=gnu++17 execution test
FAIL: 20_util/from_chars/8.cc  -std=gnu++23 execution test
FAIL: 20_util/from_chars/8.cc  -std=gnu++26 execution test
FAIL: 20_util/to_chars/float128_c++23.cc  -std=gnu++23 execution test
FAIL: 20_util/to_chars/float128_c++23.cc  -std=gnu++26 execution test
FAIL: 20_util/to_chars/long_double.cc  -std=gnu++17 execution test
FAIL: 27_io/basic_ofstream/open/char/noreplace.cc  -std=gnu++17 execution test
FAIL: 27_io/basic_ofstream/open/wchar_t/noreplace.cc  -std=gnu++17 execution
test
FAIL: 

[Bug libstdc++/114101] FAIL: 26_numerics/headers/cmath/functions_std_c++17.cc -std=gnu++17 (test for excess errors)

2024-02-25 Thread dave.anglin at bell dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101

--- Comment #4 from dave.anglin at bell dot net ---
On 2024-02-25 2:21 p.m., redi at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101
>
> Jonathan Wakely  changed:
>
> What|Removed |Added
> 
> See Also||https://gcc.gnu.org/bugzill
> ||a/show_bug.cgi?id=111639
I haven't tested my hpux changes to crossconfig.m4.  I just added new defines
for some
float math functions that were missing from the list and slightly reorganized
the list into
something slightly closer to alphabetical order.

The  for HP-UX doesn't do this sort of thing:

extern double acos(double __x) __ATTR_CONST__;
#define acosf    acos        /**< The alias for acos().    */

Technically, avr doesn't have a proper acosf.  If float and double differ, acos
won't handle exceptional
values correctly for acosf.  So, I think the AC_DEFINEs for the float variants
should be removed or
conditioned on some libc version.

In my package, configure checks were added so that we now check all the C99
float variants.  As a result,
we now use the libc version instead of the stub version for some functions.

[Bug libstdc++/114101] FAIL: 26_numerics/headers/cmath/functions_std_c++17.cc -std=gnu++17 (test for excess errors)

2024-02-25 Thread dave.anglin at bell dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101

--- Comment #3 from dave.anglin at bell dot net ---
On 2024-02-25 2:21 p.m., redi at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101
>
> Jonathan Wakely  changed:
>
> What|Removed |Added
> 
> See Also||https://gcc.gnu.org/bugzill
> ||a/show_bug.cgi?id=86553
If a target has inconsistent declarations for any standard C99 functions, they
should be fixed
using a fixincludes hack.

Originally, I wrote a patch to add declarations for missing C99 functions on
hpux to math.h.
They were declared when __cplusplus was defined.  But then I realized they
would be
better in cmath as then all targets could potentially benefit.

They could be guarded by something like _GLIBCXX_NEED_C99_DECLARATIONS.  It
could
go in os_defines.h.  On hpux11, the configure checks are sufficient.  I think
they are also
sufficient on linux (test in progress).

[Bug libstdc++/114101] FAIL: 26_numerics/headers/cmath/functions_std_c++17.cc -std=gnu++17 (test for excess errors)

2024-02-25 Thread dave.anglin at bell dot net via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101

--- Comment #2 from dave.anglin at bell dot net ---
On 2024-02-25 2:17 p.m., redi at gcc dot gnu.org wrote:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101
>
> Jonathan Wakely  changed:
>
> What|Removed |Added
> 
> See Also||https://gcc.gnu.org/bugzill
> ||a/show_bug.cgi?id=79700
The patch I posted allows HP-UX targets to make use of the above change.  I
defined
_GLIBCXX_USE_C99_MATH_FUNCS and _GLIBCXX_USE_BUILTIN_FMAF in
config/os/hpux/os_defines.h:

+// Import C99 functions in  in  in namespace std in C++11.
+// Missing functions are handled by stubs.  The fma, nexttoward, scalbln
+// and tgamma are missing in HP-UX 11.  Many float variants are supported.
+#define _GLIBCXX_USE_C99_MATH_FUNCS 1
+#define _GLIBCXX_USE_C99_MATH_TR1 1

Had to add double stubs for fma, nexttoward, scalbln and tgamma to complete the
set
of required functions.

Currently, _GLIBCXX_USE_C99_MATH_FUNCS and _GLIBCXX_USE_C99_MATH_TR1 are
only enabled when configure detects the full set of C99 functions.

[Bug libstdc++/114101] FAIL: 26_numerics/headers/cmath/functions_std_c++17.cc -std=gnu++17 (test for excess errors)

2024-02-25 Thread danglin at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114101

--- Comment #1 from John David Anglin  ---
Created attachment 57529
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57529=edit
Preliminary patch.

Still need to review float and long double stubs to make sure they are complete
for libgm2.  Tested so far on hppa64-hp-hpux.

configure, config.h.in and src/c++98/Makefile.in need regeneration with
autoconf, autoheader and automake, respectively.