public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] libstdc++/complex: Remove implicit type casts in complex
@ 2023-03-27 21:23 Weslley da Silva Pereira
  2023-05-11 21:57 ` Jonathan Wakely
  0 siblings, 1 reply; 5+ messages in thread
From: Weslley da Silva Pereira @ 2023-03-27 21:23 UTC (permalink / raw)
  To: libstdc++, gcc-patches


[-- Attachment #1.1: Type: text/plain, Size: 1104 bytes --]

Dear all,

Here follows a patch that removes implicit type casts in std::complex.

*Description:* The current implementation of `complex<_Tp>` assumes that
`int, double, long double` are explicitly convertible to `_Tp`. Moreover,
it also assumes that:

1. `int` is implicitly convertible to `_Tp`, e.g., when using
`complex<_Tp>(1)`.
2. `long double` can be attributed to a `_Tp` variable, e.g., when using
`const _Tp __pi_2 = 1.5707963267948966192313216916397514L`.

This patch transforms the implicit casts (1) and (2) into explicit type
casts. As a result, `std::complex` is now able to support more types. One
example is the type `Eigen::Half` from
https://eigen.tuxfamily.org/dox-devel/Half_8h_source.html which does not
implement implicit type conversions.

*ChangeLog:*
libstdc++-v3/ChangeLog:

        * include/std/complex:

*Patch:* fix_complex.diff. (Also at
https://github.com/gcc-mirror/gcc/pull/84)

*OBS:* I didn't find a good reason for adding new tests or test results
here since this is really a small upgrade (in my view) to std::complex.

Sincerely,
  Weslley

-- 
Weslley S. Pereira

[-- Attachment #2: fix_complex.diff --]
[-- Type: text/x-patch, Size: 2541 bytes --]

diff --git a/libstdc++-v3/include/std/complex b/libstdc++-v3/include/std/complex
index 0f5f14c3ddb..1a4ac8a2a54 100644
--- a/libstdc++-v3/include/std/complex
+++ b/libstdc++-v3/include/std/complex
@@ -80,7 +80,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
   template<typename _Tp>
     _GLIBCXX20_CONSTEXPR complex<_Tp> conj(const complex<_Tp>&);
   ///  Return complex with magnitude @a rho and angle @a theta.
-  template<typename _Tp> complex<_Tp> polar(const _Tp&, const _Tp& = 0);
+  template<typename _Tp> complex<_Tp> polar(const _Tp&, const _Tp& = _Tp(0));
 
   // Transcendentals:
   /// Return complex cosine of @a z.
@@ -961,7 +961,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     inline complex<_Tp>
     polar(const _Tp& __rho, const _Tp& __theta)
     {
-      __glibcxx_assert( __rho >= 0 );
+      __glibcxx_assert( __rho >= _Tp(0) );
       return complex<_Tp>(__rho * cos(__theta), __rho * sin(__theta));
     }
 
@@ -1161,13 +1161,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
 
       if (__x == _Tp())
         {
-          _Tp __t = sqrt(abs(__y) / 2);
+          _Tp __t = sqrt(abs(__y) / _Tp(2));
           return complex<_Tp>(__t, __y < _Tp() ? -__t : __t);
         }
       else
         {
-          _Tp __t = sqrt(2 * (std::abs(__z) + abs(__x)));
-          _Tp __u = __t / 2;
+          _Tp __t = sqrt(_Tp(2) * (std::abs(__z) + abs(__x)));
+          _Tp __u = __t / _Tp(2);
           return __x > _Tp()
             ? complex<_Tp>(__u, __y / __t)
             : complex<_Tp>(abs(__y) / __t, __y < _Tp() ? -__u : __u);
@@ -1257,7 +1257,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     complex<_Tp>
     __complex_pow_unsigned(complex<_Tp> __x, unsigned __n)
     {
-      complex<_Tp> __y = __n % 2 ? __x : complex<_Tp>(1);
+      complex<_Tp> __y = __n % 2 ? __x : complex<_Tp>(_Tp(1));
 
       while (__n >>= 1)
         {
@@ -1280,7 +1280,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     pow(const complex<_Tp>& __z, int __n)
     {
       return __n < 0
-	? complex<_Tp>(1) / std::__complex_pow_unsigned(__z, -(unsigned)__n)
+	? complex<_Tp>(_Tp(1)) / std::__complex_pow_unsigned(__z, -(unsigned)__n)
         : std::__complex_pow_unsigned(__z, __n);
     }
 
@@ -2017,7 +2017,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
     __complex_acos(const std::complex<_Tp>& __z)
     {
       const std::complex<_Tp> __t = std::asin(__z);
-      const _Tp __pi_2 = 1.5707963267948966192313216916397514L;
+      const _Tp __pi_2 = _Tp(1.5707963267948966192313216916397514L);
       return std::complex<_Tp>(__pi_2 - __t.real(), -__t.imag());
     }
 

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

* Re: [PATCH] libstdc++/complex: Remove implicit type casts in complex
  2023-03-27 21:23 [PATCH] libstdc++/complex: Remove implicit type casts in complex Weslley da Silva Pereira
@ 2023-05-11 21:57 ` Jonathan Wakely
  2023-11-03 17:47   ` Weslley da Silva Pereira
  0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Wakely @ 2023-05-11 21:57 UTC (permalink / raw)
  To: Weslley da Silva Pereira; +Cc: libstdc++, gcc-patches

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

On Mon, 27 Mar 2023 at 22:25, Weslley da Silva Pereira via Libstdc++ <
libstdc++@gcc.gnu.org> wrote:

> Dear all,
>
> Here follows a patch that removes implicit type casts in std::complex.
>
> *Description:* The current implementation of `complex<_Tp>` assumes that
> `int, double, long double` are explicitly convertible to `_Tp`. Moreover,
> it also assumes that:
>
> 1. `int` is implicitly convertible to `_Tp`, e.g., when using
> `complex<_Tp>(1)`.
> 2. `long double` can be attributed to a `_Tp` variable, e.g., when using
> `const _Tp __pi_2 = 1.5707963267948966192313216916397514L`.
>
> This patch transforms the implicit casts (1) and (2) into explicit type
> casts. As a result, `std::complex` is now able to support more types. One
> example is the type `Eigen::Half` from
> https://eigen.tuxfamily.org/dox-devel/Half_8h_source.html which does not
> implement implicit type conversions.
>
> *ChangeLog:*
> libstdc++-v3/ChangeLog:
>
>         * include/std/complex:
>

Thank you for the patch. Now that we're in developement stage 1 for GCC 14,
it's time to consider it.

You're missing a proper changelog entry, I suggest:

       * include/std/complex (polar, __complex_sqrt)
       (__complex_pow_unsigned, pow, __complex_acos): Replace implicit
       conversions from int and long double to value_type.

You're also missing either a copyright assignment on file with the FSF
(unless you've completed that paperwork?), or a DCO sign-off. Please see
https://gcc.gnu.org/contribute.html#legal and https://gcc.gnu.org/dco.html
for more details.


>
> *Patch:* fix_complex.diff. (Also at
> https://github.com/gcc-mirror/gcc/pull/84)
>
> *OBS:* I didn't find a good reason for adding new tests or test results
> here since this is really a small upgrade (in my view) to std::complex.
>

I don't agree. The purpose of this is to support std::complex<Foo> for a
type Foo without implicit conversions (which isn't required by the standard
btw, only the floating-point types are required to work, but we can support
others as an extension). Without tests, we don't know if that goal has been
met, and we don't know if the goal continues to be met in future versions.
A test would ensure that we don't accidentally re-introduce code requiring
implicit conversions.

With a suitable test, I think this patch will be OK for GCC 14.

Thanks again for contributing.

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

* Re: [PATCH] libstdc++/complex: Remove implicit type casts in complex
  2023-05-11 21:57 ` Jonathan Wakely
@ 2023-11-03 17:47   ` Weslley da Silva Pereira
  2023-11-06 10:44     ` Jonathan Wakely
  0 siblings, 1 reply; 5+ messages in thread
From: Weslley da Silva Pereira @ 2023-11-03 17:47 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: libstdc++, gcc-patches


[-- Attachment #1.1: Type: text/plain, Size: 3640 bytes --]

Hi Jonathan,

I am sorry for the delay. The mailing lists libstdc++@gcc.gnu.org and
gcc-patches@gcc.gnu.org have just too many emails, so your email got lost.
I hope my changes still make sense to be included in GCC. Please, find my
comments below.

On Thu, May 11, 2023 at 3:57 PM Jonathan Wakely <jwakely@redhat.com> wrote:

>
>
> On Mon, 27 Mar 2023 at 22:25, Weslley da Silva Pereira via Libstdc++ <
> libstdc++@gcc.gnu.org> wrote:
>
>> Dear all,
>>
>> Here follows a patch that removes implicit type casts in std::complex.
>>
>> *Description:* The current implementation of `complex<_Tp>` assumes that
>> `int, double, long double` are explicitly convertible to `_Tp`. Moreover,
>> it also assumes that:
>>
>> 1. `int` is implicitly convertible to `_Tp`, e.g., when using
>> `complex<_Tp>(1)`.
>> 2. `long double` can be attributed to a `_Tp` variable, e.g., when using
>> `const _Tp __pi_2 = 1.5707963267948966192313216916397514L`.
>>
>> This patch transforms the implicit casts (1) and (2) into explicit type
>> casts. As a result, `std::complex` is now able to support more types. One
>> example is the type `Eigen::Half` from
>> https://eigen.tuxfamily.org/dox-devel/Half_8h_source.html which does not
>> implement implicit type conversions.
>>
>> *ChangeLog:*
>> libstdc++-v3/ChangeLog:
>>
>>         * include/std/complex:
>>
>
> Thank you for the patch. Now that we're in developement stage 1 for GCC
> 14, it's time to consider it.
>
> You're missing a proper changelog entry, I suggest:
>
>        * include/std/complex (polar, __complex_sqrt)
>        (__complex_pow_unsigned, pow, __complex_acos): Replace implicit
>        conversions from int and long double to value_type.
>

I agree with your proposal for the changelog.


> You're also missing either a copyright assignment on file with the FSF
> (unless you've completed that paperwork?), or a DCO sign-off. Please see
> https://gcc.gnu.org/contribute.html#legal and https://gcc.gnu.org/dco.html
> for more details.
>

Here is my DCO sign-off:

*Copyright:*
Signed-off-by: Weslley da Silva Pereira <weslley.spereira@gmail.com>


>
>
>>
>> *Patch:* fix_complex.diff. (Also at
>> https://github.com/gcc-mirror/gcc/pull/84)
>>
>> *OBS:* I didn't find a good reason for adding new tests or test results
>> here since this is really a small upgrade (in my view) to std::complex.
>>
>
> I don't agree. The purpose of this is to support std::complex<Foo> for a
> type Foo without implicit conversions (which isn't required by the standard
> btw, only the floating-point types are required to work, but we can support
> others as an extension). Without tests, we don't know if that goal has been
> met, and we don't know if the goal continues to be met in future versions.
> A test would ensure that we don't accidentally re-introduce code requiring
> implicit conversions.
>
> With a suitable test, I think this patch will be OK for GCC 14.
>
> Thanks again for contributing.
>
>
>
*Tests:*
See the attached file `test_complex_eigenhalf.cpp`

*Test results:*
- When using x86-64 GCC (trunk), I obtained compilation errors as shown in
the attached text file. Live example at: https://godbolt.org/z/oa9M34h8P.
- I observed no errors after applying the suggested patch on my machine.
- I tried it with the flag `-Wall`. No warnings were shown.
- My machine configuration and my GCC build information are displayed in
the file `config.log` generated by the configuration step of GCC.

Let me know if I need to do anything else.

Thanks,
  Weslley

-- 
Weslley S. Pereira

[-- Attachment #2: compiler_log_gcctrunk.txt --]
[-- Type: text/plain, Size: 11017 bytes --]

<source>: In function 'std::complex<_Tp> std::polar(const _Tp&, const _Tp&) [with _Tp = Eigen::half]':
<source>:13:20: error: could not convert '0' from 'int' to 'const Eigen::half&'
   13 |     z1 = std::polar(one);
      |          ~~~~~~~~~~^~~~~
      |                    |
      |                    int
<source>:13:20: note:   when instantiating default argument for call to 'std::complex<_Tp> std::polar(const _Tp&, const _Tp&) [with _Tp = Eigen::half]'
<source>: In function 'int main()':
<source>:13:20: error: invalid initialization of reference of type 'const Eigen::half&' from expression of type 'int'
In file included from <source>:1:
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:967:40: note: in passing argument 2 of 'std::complex<_Tp> std::polar(const _Tp&, const _Tp&) [with _Tp = Eigen::half]'
  967 |     polar(const _Tp& __rho, const _Tp& __theta)
      |                             ~~~~~~~~~~~^~~~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex: In instantiation of 'std::complex<_Tp> std::pow(const complex<_Tp>&, int) [with _Tp = Eigen::half]':
<source>:19:18:   required from here
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:967:40: note:    19 |     z3 = std::pow(z0, (unsigned)2);
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:967:40: note:       |          ~~~~~~~~^~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:1288:11: error: no matching function for call to 'std::complex<Eigen::half>::complex(int)'
 1288 |         ? complex<_Tp>(1) / std::__complex_pow_unsigned(__z, -(unsigned)__n)
      |           ^~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:153:28: note: candidate: 'template<class _Up> constexpr std::complex<_Tp>::complex(const std::complex<_Up>&) [with _Tp = Eigen::half]'
  153 |         _GLIBCXX_CONSTEXPR complex(const complex<_Up>& __z)
      |                            ^~~~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:153:28: note:   template argument deduction/substitution failed:
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:1288:11: note:   mismatched types 'const std::complex<_Tp>' and 'int'
 1288 |         ? complex<_Tp>(1) / std::__complex_pow_unsigned(__z, -(unsigned)__n)
      |           ^~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:145:17: note: candidate: 'constexpr std::complex<_Tp>::complex(const std::complex<_Tp>&) [with _Tp = Eigen::half]'
  145 |       constexpr complex(const complex&) = default;
      |                 ^~~~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:145:25: note:   no known conversion for argument 1 from 'int' to 'const std::complex<Eigen::half>&'
  145 |       constexpr complex(const complex&) = default;
      |                         ^~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:140:26: note: candidate: 'constexpr std::complex<_Tp>::complex(const _Tp&, const _Tp&) [with _Tp = Eigen::half]'
  140 |       _GLIBCXX_CONSTEXPR complex(const _Tp& __r = _Tp(), const _Tp& __i = _Tp())
      |                          ^~~~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:140:45: note:   no known conversion for argument 1 from 'int' to 'const Eigen::half&'
  140 |       _GLIBCXX_CONSTEXPR complex(const _Tp& __r = _Tp(), const _Tp& __i = _Tp())
      |                                  ~~~~~~~~~~~^~~~~~~~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex: In instantiation of 'std::complex<_Tp> std::__complex_sqrt(const complex<_Tp>&) [with _Tp = Eigen::half]':
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:1195:58:   required from 'std::complex<_Tp> std::sqrt(const complex<_Tp>&) [with _Tp = Eigen::half]'
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:140:45: note:  1195 |     sqrt(const complex<_Tp>& __z) { return __complex_sqrt(__z.__rep()); }
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:140:45: note:       |                                            ~~~~~~~~~~~~~~^~~~~~~~~~~~~
<source>:16:19:   required from here
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:140:45: note:    16 |     z2 = std::sqrt(z0);
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:140:45: note:       |          ~~~~~~~~~^~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:1174:25: error: conversion from 'float' to non-scalar type 'Eigen::half' requested
 1174 |           _Tp __t = sqrt(2 * (std::abs(__z) + abs(__x)));
      |                     ~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex: In instantiation of 'std::complex<_Tp> std::__complex_acos(const complex<_Tp>&) [with _Tp = Eigen::half]':
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2214:28:   required from 'std::complex<_Tp> std::acos(const complex<_Tp>&) [with _Tp = Eigen::half]'
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:1174:25: error:  2214 |     { return __complex_acos(__z.__rep()); }
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:1174:25: error:       |              ~~~~~~~~~~~~~~^~~~~~~~~~~~~
<source>:28:19:   required from here
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:1174:25: error:    28 |     z5 = std::acos(z0);
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:1174:25: error:       |          ~~~~~~~~~^~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error: conversion from 'long double' to non-scalar type 'const Eigen::half' requested
 2038 |       const _Tp __pi_2 = 1.5707963267948966192313216916397514L;
      |                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex: In instantiation of '_Tp std::__complex_arg(const complex<_Tp>&) [with _Tp = Eigen::half]':
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:919:56:   required from '_Tp std::arg(const complex<_Tp>&) [with _Tp = Eigen::half]'
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:   919 |     arg(const complex<_Tp>& __z) { return __complex_arg(__z.__rep()); }
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:       |                                           ~~~~~~~~~~~~~^~~~~~~~~~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:1071:55:   required from 'std::complex<_Tp> std::__complex_log(const complex<_Tp>&) [with _Tp = Eigen::half]'
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:  1071 |     { return complex<_Tp>(log(std::abs(__z)), std::arg(__z)); }
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:       |                                               ~~~~~~~~^~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:1086:56:   required from 'std::complex<_Tp> std::log(const complex<_Tp>&) [with _Tp = Eigen::half]'
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:  1086 |     log(const complex<_Tp>& __z) { return __complex_log(__z.__rep()); }
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:       |                                           ~~~~~~~~~~~~~^~~~~~~~~~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2350:22:   required from 'std::complex<_Tp> std::__complex_asinh(const complex<_Tp>&) [with _Tp = Eigen::half]'
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:  2350 |       return std::log(__t + __z);
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:       |              ~~~~~~~~^~~~~~~~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2369:29:   required from 'std::complex<_Tp> std::asinh(const complex<_Tp>&) [with _Tp = Eigen::half]'
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:  2369 |     { return __complex_asinh(__z.__rep()); }
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:       |              ~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2230:23:   required from 'std::complex<_Tp> std::__complex_asin(const complex<_Tp>&) [with _Tp = Eigen::half]'
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:  2230 |       __t = std::asinh(__t);
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:       |             ~~~~~~~~~~^~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2250:28:   required from 'std::complex<_Tp> std::asin(const complex<_Tp>&) [with _Tp = Eigen::half]'
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:  2250 |     { return __complex_asin(__z.__rep()); }
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:       |              ~~~~~~~~~~~~~~^~~~~~~~~~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2037:46:   required from 'std::complex<_Tp> std::__complex_acos(const complex<_Tp>&) [with _Tp = Eigen::half]'
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:  2037 |       const std::complex<_Tp> __t = std::asin(__z);
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:       |                                     ~~~~~~~~~^~~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2214:28:   required from 'std::complex<_Tp> std::acos(const complex<_Tp>&) [with _Tp = Eigen::half]'
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:  2214 |     { return __complex_acos(__z.__rep()); }
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:       |              ~~~~~~~~~~~~~~^~~~~~~~~~~~~
<source>:28:19:   required from here
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:    28 |     z5 = std::acos(z0);
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:2038:26: error:       |          ~~~~~~~~~^~~~
/opt/compiler-explorer/gcc-trunk-20231103/include/c++/14.0.0/complex:904:20: error: could not convert 'std::atan2((& __z)->std::complex<Eigen::half>::imag().Eigen::half::operator float(), (& __z)->std::complex<Eigen::half>::real().Eigen::half::operator float())' from 'float' to 'Eigen::half'
  904 |     { return  atan2(__z.imag(), __z.real()); }
      |               ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
      |                    |
      |                    float
Compiler returned: 1

[-- Attachment #3: test_complex_eigenhalf.cpp --]
[-- Type: text/x-c++src, Size: 681 bytes --]

#include <complex>
#include <Eigen/Core>

int main() {
    // Constants
    const Eigen::half one(1);
    const std::complex<Eigen::half> z0(one);

    // Local variables
    std::complex<Eigen::half> z1, z2, z3, z4, z5;

    // Assign using polar coordinates, second coordinate is zero
    z1 = std::polar(one);

    // Compute the square root
    z2 = std::sqrt(z0);

    // Compute the pow using an unsigned power
    z3 = std::pow(z0, (unsigned)2);

    // Compute the pow using a positive integer power
    z3 = std::pow(z0, 2);

    // Compute the pow using a negative integer power
    z4 = std::pow(z0, -2);

    // Compute the acos
    z5 = std::acos(z0);

    return 0;
}

[-- Attachment #4: config.log --]
[-- Type: text/x-log, Size: 32411 bytes --]

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ../gcc/configure --disable-multilib --disable-bootstrap

## --------- ##
## Platform. ##
## --------- ##

hostname = weslleyp-XPS-15-9510
uname -m = x86_64
uname -r = 5.15.0-88-generic
uname -s = Linux
uname -v = #98~20.04.1-Ubuntu SMP Mon Oct 9 16:43:45 UTC 2023

/usr/bin/uname -p = x86_64
/bin/uname -X     = unknown

/bin/arch              = x86_64
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /home/weslleyp/gems/bin
PATH: /home/weslleyp/MATLAB/R2022a/bin
PATH: /opt/intel/oneapi/vtune/2023.2.0/bin64
PATH: /opt/intel/oneapi/mpi/2021.10.0//libfabric/bin
PATH: /opt/intel/oneapi/mpi/2021.10.0//bin
PATH: /opt/intel/oneapi/mkl/2023.2.0/bin/intel64
PATH: /opt/intel/oneapi/dev-utilities/2021.10.0/bin
PATH: /opt/intel/oneapi/debugger/2023.2.0/gdb/intel64/bin
PATH: /opt/intel/oneapi/compiler/2023.2.1/linux/lib/oclfpga/bin
PATH: /opt/intel/oneapi/compiler/2023.2.1/linux/bin/intel64
PATH: /opt/intel/oneapi/compiler/2023.2.1/linux/bin
PATH: /home/weslleyp/gems/bin
PATH: /home/weslleyp/MATLAB/R2022a/bin
PATH: /home/weslleyp/miniconda3/condabin
PATH: /home/weslleyp/.local/bin
PATH: /home/weslleyp/bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
PATH: /usr/local/games
PATH: /snap/bin


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2396: checking build system type
configure:2410: result: x86_64-pc-linux-gnu
configure:2457: checking host system type
configure:2470: result: x86_64-pc-linux-gnu
configure:2490: checking target system type
configure:2503: result: x86_64-pc-linux-gnu
configure:2557: checking for a BSD-compatible install
configure:2625: result: /usr/bin/install -c
configure:2636: checking whether ln works
configure:2658: result: yes
configure:2662: checking whether ln -s works
configure:2666: result: yes
configure:2673: checking for a sed that does not truncate output
configure:2737: result: /usr/bin/sed
configure:2746: checking for gawk
configure:2762: found /usr/bin/gawk
configure:2773: result: gawk
configure:3299: checking for libatomic support
configure:3309: result: yes
configure:3318: checking for libitm support
configure:3328: result: yes
configure:3337: checking for libsanitizer support
configure:3347: result: yes
configure:3356: checking for libvtv support
configure:3366: result: yes
configure:3486: checking for libphobos support
configure:3496: result: yes
configure:4205: checking for gcc
configure:4221: found /usr/bin/gcc
configure:4232: result: gcc
configure:4461: checking for C compiler version
configure:4470: gcc --version >&5
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:4481: $? = 0
configure:4470: gcc -v >&5
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2) 
configure:4481: $? = 0
configure:4470: gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:4481: $? = 1
configure:4470: gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc: fatal error: no input files
compilation terminated.
configure:4481: $? = 1
configure:4501: checking whether the C compiler works
configure:4523: gcc    conftest.c  >&5
configure:4527: $? = 0
configure:4575: result: yes
configure:4578: checking for C compiler default output file name
configure:4580: result: a.out
configure:4586: checking for suffix of executables
configure:4593: gcc -o conftest    conftest.c  >&5
configure:4597: $? = 0
configure:4619: result: 
configure:4641: checking whether we are cross compiling
configure:4649: gcc -o conftest    conftest.c  >&5
configure:4653: $? = 0
configure:4660: ./conftest
configure:4664: $? = 0
configure:4652: result: no
configure:4657: checking for suffix of object files
configure:4679: gcc -c   conftest.c >&5
configure:4683: $? = 0
configure:4704: result: o
configure:4708: checking whether we are using the GNU C compiler
configure:4727: gcc -c   conftest.c >&5
configure:4727: $? = 0
configure:4736: result: yes
configure:4745: checking whether gcc accepts -g
configure:4765: gcc -c -g  conftest.c >&5
configure:4765: $? = 0
configure:4806: result: yes
configure:4823: checking for gcc option to accept ISO C89
configure:4886: gcc  -c -g -O2  conftest.c >&5
configure:4886: $? = 0
configure:4899: result: none needed
configure:4919: checking for gcc option to accept ISO C99
configure:5068: gcc  -c -g -O2  conftest.c >&5
configure:5068: $? = 0
configure:5081: result: none needed
configure:5154: checking for g++
configure:5170: found /usr/bin/g++
configure:5181: result: g++
configure:5208: checking for C++ compiler version
configure:5217: g++ --version >&5
g++ (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:5228: $? = 0
configure:5217: g++ -v >&5
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 9.4.0-1ubuntu1~20.04.2' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none=/build/gcc-9-9QDOt0/gcc-9-9.4.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 9.4.0 (Ubuntu 9.4.0-1ubuntu1~20.04.2) 
configure:5228: $? = 0
configure:5217: g++ -V >&5
g++: error: unrecognized command line option '-V'
g++: fatal error: no input files
compilation terminated.
configure:5228: $? = 1
configure:5217: g++ -qversion >&5
g++: error: unrecognized command line option '-qversion'; did you mean '--version'?
g++: fatal error: no input files
compilation terminated.
configure:5228: $? = 1
configure:5232: checking whether we are using the GNU C++ compiler
configure:5251: g++ -c   conftest.cpp >&5
configure:5251: $? = 0
configure:5260: result: yes
configure:5269: checking whether g++ accepts -g
configure:5289: g++ -c -g  conftest.cpp >&5
configure:5289: $? = 0
configure:5330: result: yes
configure:5379: checking whether g++ accepts -static-libstdc++ -static-libgcc
configure:5396: g++ -o conftest -g -O2   -static-libstdc++ -static-libgcc conftest.cpp  >&5
configure:5396: $? = 0
configure:5397: result: yes
configure:5461: checking for gnatbind
configure:5491: result: no
configure:5553: checking for gnatmake
configure:5583: result: no
configure:5602: checking whether compiler driver understands Ada and is recent enough
configure:5629: result: no
configure:5683: checking for gdc
configure:5713: result: no
configure:5732: checking whether the D compiler works
configure:5749: result: no
configure:5757: checking how to compare bootstrapped objects
configure:5782: result: cmp --ignore-initial=16 $$f1 $$f2
configure:5849: checking whether g++ supports C++11 features by default
configure:6145: g++ -c -g -O2  conftest.cpp >&5
configure:6145: $? = 0
configure:6152: result: yes
configure:7926: checking for objdir
configure:7941: result: .libs
configure:8111: checking for the correct version of gmp.h
configure:8130: gcc -c -g -O2   conftest.c >&5
configure:8130: $? = 0
configure:8148: gcc -c -g -O2   conftest.c >&5
configure:8148: $? = 0
configure:8149: result: yes
configure:8165: checking for the correct version of mpfr.h
configure:8183: gcc -c -g -O2   conftest.c >&5
configure:8183: $? = 0
configure:8200: gcc -c -g -O2   conftest.c >&5
configure:8200: $? = 0
configure:8201: result: yes
configure:8218: checking for the correct version of mpc.h
configure:8235: gcc -c -g -O2   conftest.c >&5
configure:8235: $? = 0
configure:8251: gcc -c -g -O2   conftest.c >&5
configure:8251: $? = 0
configure:8252: result: yes
configure:8270: checking for the correct version of the gmp/mpfr libraries
configure:8294: gcc -o conftest -g -O2    conftest.c  -lmpc -lmpfr -lgmp >&5
configure:8294: $? = 0
configure:8295: result: yes
configure:8310: checking for the correct version of the mpc libraries
configure:8331: gcc -o conftest -g -O2    conftest.c  -lmpc -lmpfr -lgmp >&5
configure:8331: $? = 0
configure:8332: result: yes
configure:8557: checking for isl 0.15 or later
configure:8570: gcc -o conftest -g -O2      -lisl -lmpc -lmpfr -lgmp conftest.c  -lisl -lgmp >&5
conftest.c:11:10: fatal error: isl/schedule.h: No such file or directory
   11 | #include <isl/schedule.h>
      |          ^~~~~~~~~~~~~~~~
compilation terminated.
configure:8570: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define HAVE_CXX11 1
| #define LT_OBJDIR ".libs/"
| /* end confdefs.h.  */
| #include <isl/schedule.h>
| int
| main ()
| {
| isl_options_set_schedule_serialize_sccs (NULL, 0);
|   ;
|   return 0;
| }
configure:8577: result: no
configure:8581: result: required isl version is 0.15 or later
configure:9804: checking for default BUILD_CONFIG
configure:9836: result: 
configure:9841: checking for --enable-vtable-verify
configure:9854: result: no
configure:10509: checking for bison
configure:10525: found /usr/bin/bison
configure:10536: result: bison -y
configure:10556: checking for bison
configure:10572: found /usr/bin/bison
configure:10583: result: bison
configure:10603: checking for gm4
configure:10633: result: no
configure:10603: checking for gnum4
configure:10633: result: no
configure:10603: checking for m4
configure:10619: found /usr/bin/m4
configure:10630: result: m4
configure:10650: checking for flex
configure:10666: found /usr/bin/flex
configure:10677: result: flex
configure:10698: checking for flex
configure:10714: found /usr/bin/flex
configure:10725: result: flex
configure:10745: checking for makeinfo
configure:10775: result: no
configure:10806: checking for expect
configure:10836: result: no
configure:10855: checking for runtest
configure:10885: result: no
configure:11000: checking for ar
configure:11016: found /usr/bin/ar
configure:11027: result: ar
configure:11141: checking for as
configure:11157: found /usr/bin/as
configure:11168: result: as
configure:11282: checking for dlltool
configure:11312: result: no
configure:11423: checking for dsymutil
configure:11439: found /usr/bin/dsymutil
configure:11450: result: dsymutil
configure:11564: checking for ld
configure:11580: found /usr/bin/ld
configure:11591: result: ld
configure:11705: checking for lipo
configure:11735: result: no
configure:11846: checking for nm
configure:11862: found /usr/bin/nm
configure:11873: result: nm
configure:11987: checking for ranlib
configure:12003: found /usr/bin/ranlib
configure:12014: result: ranlib
configure:12123: checking for strip
configure:12139: found /usr/bin/strip
configure:12150: result: strip
configure:12259: checking for windres
configure:12289: result: no
configure:12400: checking for windmc
configure:12430: result: no
configure:12541: checking for objcopy
configure:12557: found /usr/bin/objcopy
configure:12568: result: objcopy
configure:12682: checking for objdump
configure:12698: found /usr/bin/objdump
configure:12709: result: objdump
configure:12823: checking for otool
configure:12853: result: no
configure:12964: checking for readelf
configure:12980: found /usr/bin/readelf
configure:12991: result: readelf
configure:13021: checking for -plugin option
configure:13141: result: --plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so
configure:13288: checking for cc
configure:13304: found /usr/bin/cc
configure:13315: result: cc
configure:13449: checking for c++
configure:13465: found /usr/bin/c++
configure:13476: result: c++
configure:13610: checking for gcc
configure:13626: found /usr/bin/gcc
configure:13637: result: gcc
configure:13766: checking for gfortran
configure:13782: found /usr/bin/gfortran
configure:13793: result: gfortran
configure:13927: checking for gccgo
configure:13957: result: no
configure:14088: checking for gdc
configure:14118: result: no
configure:14249: checking for gm2
configure:14279: result: no
configure:14340: checking for ar
configure:14373: result: no
configure:14490: checking for ar
configure:14506: found /usr/bin/ar
configure:14517: result: ar
configure:14570: checking for as
configure:14603: result: no
configure:14720: checking for as
configure:14736: found /usr/bin/as
configure:14747: result: as
configure:14800: checking for dlltool
configure:14833: result: no
configure:14950: checking for dlltool
configure:14980: result: no
configure:15030: checking for dsymutil
configure:15063: result: no
configure:15180: checking for dsymutil
configure:15196: found /usr/bin/dsymutil
configure:15207: result: dsymutil
configure:15260: checking for ld
configure:15293: result: no
configure:15410: checking for ld
configure:15426: found /usr/bin/ld
configure:15437: result: ld
configure:15490: checking for lipo
configure:15523: result: no
configure:15640: checking for lipo
configure:15670: result: no
configure:15720: checking for nm
configure:15753: result: no
configure:15870: checking for nm
configure:15886: found /usr/bin/nm
configure:15897: result: nm
configure:15950: checking for objcopy
configure:15983: result: no
configure:16100: checking for objcopy
configure:16116: found /usr/bin/objcopy
configure:16127: result: objcopy
configure:16180: checking for objdump
configure:16213: result: no
configure:16330: checking for objdump
configure:16346: found /usr/bin/objdump
configure:16357: result: objdump
configure:16410: checking for otool
configure:16443: result: no
configure:16560: checking for otool
configure:16590: result: no
configure:16640: checking for ranlib
configure:16673: result: no
configure:16790: checking for ranlib
configure:16806: found /usr/bin/ranlib
configure:16817: result: ranlib
configure:16870: checking for readelf
configure:16903: result: no
configure:17020: checking for readelf
configure:17036: found /usr/bin/readelf
configure:17047: result: readelf
configure:17100: checking for strip
configure:17133: result: no
configure:17250: checking for strip
configure:17266: found /usr/bin/strip
configure:17277: result: strip
configure:17330: checking for windres
configure:17363: result: no
configure:17480: checking for windres
configure:17510: result: no
configure:17560: checking for windmc
configure:17593: result: no
configure:17710: checking for windmc
configure:17740: result: no
configure:17768: checking where to find the target ar
configure:17801: result: host tool
configure:17810: checking where to find the target as
configure:17843: result: host tool
configure:17852: checking where to find the target cc
configure:17875: result: just compiled
configure:17894: checking where to find the target c++
configure:17920: result: just compiled
configure:17939: checking where to find the target c++ for libstdc++
configure:17965: result: just compiled
configure:17984: checking where to find the target dlltool
configure:18017: result: host tool
configure:18026: checking where to find the target dsymutil
configure:18048: result: host tool
configure:18057: checking where to find the target gcc
configure:18080: result: just compiled
configure:18099: checking where to find the target gfortran
configure:18125: result: just compiled
configure:18144: checking where to find the target gccgo
configure:18180: result: host tool
configure:18189: checking where to find the target gdc
configure:18225: result: host tool
configure:18234: checking where to find the target gm2
configure:18270: result: host tool
configure:18279: checking where to find the target ld
configure:18312: result: host tool
configure:18321: checking where to find the target lipo
configure:18343: result: host tool
configure:18352: checking where to find the target nm
configure:18385: result: host tool
configure:18394: checking where to find the target objcopy
configure:18427: result: host tool
configure:18436: checking where to find the target objdump
configure:18469: result: host tool
configure:18478: checking where to find the target otool
configure:18500: result: host tool
configure:18509: checking where to find the target ranlib
configure:18542: result: host tool
configure:18551: checking where to find the target readelf
configure:18584: result: host tool
configure:18593: checking where to find the target strip
configure:18626: result: host tool
configure:18635: checking where to find the target windres
configure:18668: result: host tool
configure:18677: checking where to find the target windmc
configure:18710: result: host tool
configure:18747: checking whether to enable maintainer-specific portions of Makefiles
configure:18756: result: no
configure:18993: creating ./config.status

## ---------------------- ##
## Running config.status. ##
## ---------------------- ##

This file was extended by config.status, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  CONFIG_FILES    = 
  CONFIG_HEADERS  = 
  CONFIG_LINKS    = 
  CONFIG_COMMANDS = 
  $ ./config.status 

on weslleyp-XPS-15-9510

config.status:1087: creating Makefile

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-pc-linux-gnu
ac_cv_c_compiler_gnu=yes
ac_cv_cxx_compiler_gnu=yes
ac_cv_env_AR_FOR_TARGET_set=
ac_cv_env_AR_FOR_TARGET_value=
ac_cv_env_AR_set=
ac_cv_env_AR_value=
ac_cv_env_AS_FOR_TARGET_set=
ac_cv_env_AS_FOR_TARGET_value=
ac_cv_env_AS_set=
ac_cv_env_AS_value=
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_FOR_TARGET_set=
ac_cv_env_CC_FOR_TARGET_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=
ac_cv_env_CFLAGS_value=
ac_cv_env_CPPFLAGS_set=
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CXXFLAGS_set=
ac_cv_env_CXXFLAGS_value=
ac_cv_env_CXX_FOR_TARGET_set=
ac_cv_env_CXX_FOR_TARGET_value=
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_DLLTOOL_FOR_TARGET_set=
ac_cv_env_DLLTOOL_FOR_TARGET_value=
ac_cv_env_DLLTOOL_set=
ac_cv_env_DLLTOOL_value=
ac_cv_env_DSYMUTIL_FOR_TARGET_set=
ac_cv_env_DSYMUTIL_FOR_TARGET_value=
ac_cv_env_DSYMUTIL_set=
ac_cv_env_DSYMUTIL_value=
ac_cv_env_GCC_FOR_TARGET_set=
ac_cv_env_GCC_FOR_TARGET_value=
ac_cv_env_GDC_FOR_TARGET_set=
ac_cv_env_GDC_FOR_TARGET_value=
ac_cv_env_GFORTRAN_FOR_TARGET_set=
ac_cv_env_GFORTRAN_FOR_TARGET_value=
ac_cv_env_GM2_FOR_TARGET_set=
ac_cv_env_GM2_FOR_TARGET_value=
ac_cv_env_GOC_FOR_TARGET_set=
ac_cv_env_GOC_FOR_TARGET_value=
ac_cv_env_LDFLAGS_set=
ac_cv_env_LDFLAGS_value=
ac_cv_env_LD_FOR_TARGET_set=
ac_cv_env_LD_FOR_TARGET_value=
ac_cv_env_LD_set=
ac_cv_env_LD_value=
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LIPO_FOR_TARGET_set=
ac_cv_env_LIPO_FOR_TARGET_value=
ac_cv_env_LIPO_set=
ac_cv_env_LIPO_value=
ac_cv_env_NM_FOR_TARGET_set=
ac_cv_env_NM_FOR_TARGET_value=
ac_cv_env_NM_set=
ac_cv_env_NM_value=
ac_cv_env_OBJCOPY_FOR_TARGET_set=
ac_cv_env_OBJCOPY_FOR_TARGET_value=
ac_cv_env_OBJCOPY_set=
ac_cv_env_OBJCOPY_value=
ac_cv_env_OBJDUMP_FOR_TARGET_set=
ac_cv_env_OBJDUMP_FOR_TARGET_value=
ac_cv_env_OBJDUMP_set=
ac_cv_env_OBJDUMP_value=
ac_cv_env_OTOOL_FOR_TARGET_set=
ac_cv_env_OTOOL_FOR_TARGET_value=
ac_cv_env_OTOOL_set=
ac_cv_env_OTOOL_value=
ac_cv_env_RANLIB_FOR_TARGET_set=
ac_cv_env_RANLIB_FOR_TARGET_value=
ac_cv_env_RANLIB_set=
ac_cv_env_RANLIB_value=
ac_cv_env_READELF_FOR_TARGET_set=
ac_cv_env_READELF_FOR_TARGET_value=
ac_cv_env_READELF_set=
ac_cv_env_READELF_value=
ac_cv_env_STRIP_FOR_TARGET_set=
ac_cv_env_STRIP_FOR_TARGET_value=
ac_cv_env_STRIP_set=
ac_cv_env_STRIP_value=
ac_cv_env_WINDMC_FOR_TARGET_set=
ac_cv_env_WINDMC_FOR_TARGET_value=
ac_cv_env_WINDMC_set=
ac_cv_env_WINDMC_value=
ac_cv_env_WINDRES_FOR_TARGET_set=
ac_cv_env_WINDRES_FOR_TARGET_value=
ac_cv_env_WINDRES_set=
ac_cv_env_WINDRES_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_build_configargs_set=
ac_cv_env_build_configargs_value=
ac_cv_env_host_alias_set=
ac_cv_env_host_alias_value=
ac_cv_env_host_configargs_set=
ac_cv_env_host_configargs_value=
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_env_target_configargs_set=
ac_cv_env_target_configargs_value=
ac_cv_host=x86_64-pc-linux-gnu
ac_cv_objext=o
ac_cv_path_SED=/usr/bin/sed
ac_cv_path_install='/usr/bin/install -c'
ac_cv_prog_AR=ar
ac_cv_prog_AR_FOR_TARGET=ar
ac_cv_prog_AS=as
ac_cv_prog_AS_FOR_TARGET=as
ac_cv_prog_AWK=gawk
ac_cv_prog_BISON=bison
ac_cv_prog_CC_FOR_TARGET=cc
ac_cv_prog_CXX_FOR_TARGET=c++
ac_cv_prog_DSYMUTIL=dsymutil
ac_cv_prog_DSYMUTIL_FOR_TARGET=dsymutil
ac_cv_prog_FLEX=flex
ac_cv_prog_GCC_FOR_TARGET=gcc
ac_cv_prog_GFORTRAN_FOR_TARGET=gfortran
ac_cv_prog_LD=ld
ac_cv_prog_LD_FOR_TARGET=ld
ac_cv_prog_LEX=flex
ac_cv_prog_M4=m4
ac_cv_prog_NM=nm
ac_cv_prog_NM_FOR_TARGET=nm
ac_cv_prog_OBJCOPY=objcopy
ac_cv_prog_OBJCOPY_FOR_TARGET=objcopy
ac_cv_prog_OBJDUMP=objdump
ac_cv_prog_OBJDUMP_FOR_TARGET=objdump
ac_cv_prog_RANLIB=ranlib
ac_cv_prog_RANLIB_FOR_TARGET=ranlib
ac_cv_prog_READELF=readelf
ac_cv_prog_READELF_FOR_TARGET=readelf
ac_cv_prog_STRIP=strip
ac_cv_prog_STRIP_FOR_TARGET=strip
ac_cv_prog_YACC='bison -y'
ac_cv_prog_ac_ct_CC=gcc
ac_cv_prog_ac_ct_CXX=g++
ac_cv_prog_cc_c89=
ac_cv_prog_cc_c99=
ac_cv_prog_cc_g=yes
ac_cv_prog_cxx_g=yes
ac_cv_target=x86_64-pc-linux-gnu
acx_cv_cc_gcc_supports_ada=no
acx_cv_d_compiler_works=no
acx_cv_prog_LN=ln
ax_cv_cxx_compile_cxx11=yes
gcc_cv_isl=no
gcc_cv_prog_cmp_skip='cmp --ignore-initial=16 $$f1 $$f2'
gcc_cv_tool_dirs=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/14.0.0:/usr/local/libexec/gcc/x86_64-pc-linux-gnu:/usr/lib/gcc/x86_64-pc-linux-gnu/14.0.0:/usr/lib/gcc/x86_64-pc-linux-gnu:/usr/local/x86_64-pc-linux-gnu/bin/x86_64-pc-linux-gnu/14.0.0:/usr/local/x86_64-pc-linux-gnu/bin:
gcc_cv_tool_prefix=/usr/local
lt_cv_objdir=.libs

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR='ar'
AR_FOR_BUILD='$(AR)'
AR_FOR_TARGET='$(AR)'
AR_PLUGIN_OPTION='--plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so'
AS='as'
AS_FOR_BUILD='$(AS)'
AS_FOR_TARGET='$(AS)'
AWK='gawk'
BISON='bison'
BUILD_CONFIG=''
CC='gcc'
CC_FOR_BUILD='$(CC)'
CC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/'
CFLAGS='-g -O2'
CFLAGS_FOR_BUILD='-g -O2'
CFLAGS_FOR_TARGET='-g -O2'
COMPILER_AS_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/as'
COMPILER_LD_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/collect-ld'
COMPILER_NM_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/nm'
CONFIGURE_GDB_TK=''
CPPFLAGS=''
CPPFLAGS_FOR_BUILD=''
CPP_FOR_BUILD=''
CXX='g++'
CXXFLAGS='-g -O2'
CXXFLAGS_FOR_BUILD='-g -O2'
CXXFLAGS_FOR_TARGET='-g -O2'
CXX_FOR_BUILD='$(CXX)'
CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xg++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs'
DEBUG_PREFIX_CFLAGS_FOR_TARGET=''
DEFS='-DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DHAVE_CXX11=1 -DLT_OBJDIR=\".libs/\"'
DLLTOOL='dlltool'
DLLTOOL_FOR_BUILD='$(DLLTOOL)'
DLLTOOL_FOR_TARGET='$(DLLTOOL)'
DSYMUTIL='dsymutil'
DSYMUTIL_FOR_BUILD='$(DSYMUTIL)'
DSYMUTIL_FOR_TARGET='$(DSYMUTIL)'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
EXPECT='expect'
FLAGS_FOR_TARGET=' -B$(build_tooldir)/bin/ -B$(build_tooldir)/lib/ -isystem $(build_tooldir)/include -isystem $(build_tooldir)/sys-include'
FLEX='flex'
GCC_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -B$$r/$(HOST_SUBDIR)/gcc/'
GCC_SHLIB_SUBDIR=''
GDB_TK=''
GDC='no'
GDCFLAGS='-g -O2'
GDC_FOR_BUILD='$(GDC)'
GDC_FOR_TARGET='$(GDC)'
GFORTRAN_FOR_BUILD='$(GFORTRAN)'
GFORTRAN_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/gfortran -B$$r/$(HOST_SUBDIR)/gcc/'
GM2_FOR_TARGET='$(GM2)'
GNATBIND='no'
GNATMAKE='no'
GOC_FOR_BUILD='$(GOC)'
GOC_FOR_TARGET='$(GOC)'
HAVE_CXX11='1'
HAVE_CXX11_FOR_BUILD=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_GDB_TK=''
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
LD='ld'
LDFLAGS=''
LDFLAGS_FOR_BUILD=''
LDFLAGS_FOR_TARGET=''
LD_FOR_BUILD='$(LD)'
LD_FOR_TARGET='$(LD)'
LEX='flex'
LIBOBJS=''
LIBS=''
LIPO='lipo'
LIPO_FOR_TARGET='$(LIPO)'
LN='ln'
LN_S='ln -s'
LTLIBOBJS=''
M4='m4'
MAINT='#'
MAINTAINER_MODE_FALSE=''
MAINTAINER_MODE_TRUE='#'
MAKEINFO='/home/weslleyp/storage/gcc/missing makeinfo'
NM='nm'
NM_FOR_BUILD='$(NM)'
NM_FOR_TARGET='$(NM)'
OBJCOPY='objcopy'
OBJCOPY_FOR_TARGET='$(OBJCOPY)'
OBJDUMP='objdump'
OBJDUMP_FOR_TARGET='$(OBJDUMP)'
OBJEXT='o'
OTOOL='otool'
OTOOL_FOR_TARGET='$(OTOOL)'
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_URL=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PGO_BUILD_GEN_CFLAGS=''
PGO_BUILD_LTO_CFLAGS=''
PGO_BUILD_USE_CFLAGS=''
PICFLAG=''
PKG_CONFIG_PATH='/opt/intel/oneapi/vtune/2023.2.0/include/pkgconfig/lib64:/opt/intel/oneapi/tbb/2021.10.0/env/../lib/pkgconfig:/opt/intel/oneapi/mpi/2021.10.0/lib/pkgconfig:/opt/intel/oneapi/mkl/2023.2.0/lib/pkgconfig:/opt/intel/oneapi/dpl/2022.2.0/lib/pkgconfig:/opt/intel/oneapi/compiler/2023.2.1/lib/pkgconfig'
RANLIB='ranlib'
RANLIB_FOR_BUILD='$(RANLIB)'
RANLIB_FOR_TARGET='$(RANLIB)'
RANLIB_PLUGIN_OPTION='--plugin /usr/lib/gcc/x86_64-linux-gnu/9/liblto_plugin.so'
RAW_CXX_FOR_TARGET='$$r/$(HOST_SUBDIR)/gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/libsupc++/.libs'
READELF='readelf'
READELF_FOR_TARGET='$(READELF)'
RPATH_ENVVAR='LD_LIBRARY_PATH'
RUNTEST='runtest'
SED='/usr/bin/sed'
SHELL='/bin/bash'
STRIP='strip'
STRIP_FOR_TARGET='$(STRIP)'
SYSROOT_CFLAGS_FOR_TARGET=''
TOPLEVEL_CONFIGURE_ARGUMENTS='../gcc/configure --disable-multilib --disable-bootstrap'
WINDMC='windmc'
WINDMC_FOR_BUILD='$(WINDMC)'
WINDMC_FOR_TARGET='$(WINDMC)'
WINDRES='windres'
WINDRES_FOR_BUILD='$(WINDRES)'
WINDRES_FOR_TARGET='$(WINDRES)'
YACC='bison -y'
ac_ct_CC='gcc'
ac_ct_CXX='g++'
bindir='${exec_prefix}/bin'
build='x86_64-pc-linux-gnu'
build_alias=''
build_configargs=' --cache-file=./config.cache '\''--disable-multilib'\'' '\''--disable-bootstrap'\'' '\''--enable-languages=c,c++,fortran,lto,objc'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking --disable-year2038'
build_configdirs=' libiberty libcpp fixincludes'
build_cpu='x86_64'
build_libsubdir='build-x86_64-pc-linux-gnu'
build_noncanonical='x86_64-pc-linux-gnu'
build_os='linux-gnu'
build_subdir='build-x86_64-pc-linux-gnu'
build_tooldir='${exec_prefix}/x86_64-pc-linux-gnu'
build_vendor='pc'
compare_exclusions='gcc/cc*-checksum$(objext) | gcc/ada/*tools/* | gcc/m2/gm2-compiler-boot/M2Version* | gcc/m2/gm2-compiler-boot/SYSTEM* | gcc/m2/gm2version*'
configdirs=' intl libiberty zlib libbacktrace libcpp libcody libdecnumber fixincludes gcc libcc1 c++tools lto-plugin'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
do_compare='cmp --ignore-initial=16 $$f1 $$f2'
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='${prefix}'
extra_host_libiberty_configure_flags='--enable-shared'
extra_host_zlib_configure_flags=''
extra_isl_gmp_configure_flags=''
extra_linker_plugin_configure_flags=''
extra_linker_plugin_flags=''
extra_mpc_gmp_configure_flags=''
extra_mpc_mpfr_configure_flags=''
extra_mpfr_configure_flags=''
gcc_host_pie=''
get_gcc_base_ver='cat'
gmpinc=''
gmplibs='-lmpc -lmpfr -lgmp'
host='x86_64-pc-linux-gnu'
host_alias=''
host_configargs=' --cache-file=./config.cache  '\''--disable-multilib'\'' '\''--disable-bootstrap'\'' '\''--enable-languages=c,c++,fortran,lto,objc'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking --disable-year2038'
host_cpu='x86_64'
host_libs_picflag=''
host_noncanonical='x86_64-pc-linux-gnu'
host_os='linux-gnu'
host_pie='no'
host_shared='no'
host_subdir='.'
host_vendor='pc'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
islinc=''
isllibs=''
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
oldincludedir='/usr/include'
pdfdir='${docdir}'
poststage1_ldflags='-static-libstdc++ -static-libgcc'
poststage1_libs=''
prefix='/usr/local'
program_transform_name='s,y,y,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
stage1_cflags='-g'
stage1_checking='--enable-checking=yes,types,extra'
stage1_languages='c,c++,lto'
stage1_ldflags='-static-libstdc++ -static-libgcc'
stage1_libs=''
stage2_werror_flag='--enable-werror-always'
sysconfdir='${prefix}/etc'
target='x86_64-pc-linux-gnu'
target_alias=''
target_configargs='--cache-file=./config.cache   '\''--disable-multilib'\'' '\''--disable-bootstrap'\'' '\''--enable-languages=c,c++,fortran,lto,objc'\'' --program-transform-name='\''s,y,y,'\'' --disable-option-checking --disable-year2038'
target_configdirs=' libgcc libbacktrace libgomp libatomic libitm libstdc++-v3 libsanitizer libvtv libssp libquadmath libgfortran libobjc'
target_cpu='x86_64'
target_noncanonical='x86_64-pc-linux-gnu'
target_os='linux-gnu'
target_subdir='x86_64-pc-linux-gnu'
target_vendor='pc'
tooldir='${exec_prefix}/x86_64-pc-linux-gnu'

## ------------------- ##
## File substitutions. ##
## ------------------- ##

alphaieee_frag='/dev/null'
host_makefile_frag='/dev/null'
ospace_frag='/dev/null'
serialization_dependencies='serdep.tmp'
target_makefile_frag='../gcc/config/mt-gnu'

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
#define PACKAGE_URL ""
#define HAVE_CXX11 1
#define LT_OBJDIR ".libs/"

configure: exit 0

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

* Re: [PATCH] libstdc++/complex: Remove implicit type casts in complex
  2023-11-03 17:47   ` Weslley da Silva Pereira
@ 2023-11-06 10:44     ` Jonathan Wakely
  2023-11-26  1:49       ` Weslley da Silva Pereira
  0 siblings, 1 reply; 5+ messages in thread
From: Jonathan Wakely @ 2023-11-06 10:44 UTC (permalink / raw)
  To: Weslley da Silva Pereira; +Cc: libstdc++, gcc-patches

On Fri, 3 Nov 2023 at 17:47, Weslley da Silva Pereira
<weslley.spereira@gmail.com> wrote:
>
> Hi Jonathan,
>
> I am sorry for the delay. The mailing lists libstdc++@gcc.gnu.org and gcc-patches@gcc.gnu.org have just too many emails, so your email got lost. I hope my changes still make sense to be included in GCC. Please, find my comments below.

Hi,

Thanks for the updated patch, test etc. Yes, I think this still makes
sense and I'll take care of committing it.



>
> On Thu, May 11, 2023 at 3:57 PM Jonathan Wakely <jwakely@redhat.com> wrote:
>>
>>
>>
>> On Mon, 27 Mar 2023 at 22:25, Weslley da Silva Pereira via Libstdc++ <libstdc++@gcc.gnu.org> wrote:
>>>
>>> Dear all,
>>>
>>> Here follows a patch that removes implicit type casts in std::complex.
>>>
>>> *Description:* The current implementation of `complex<_Tp>` assumes that
>>> `int, double, long double` are explicitly convertible to `_Tp`. Moreover,
>>> it also assumes that:
>>>
>>> 1. `int` is implicitly convertible to `_Tp`, e.g., when using
>>> `complex<_Tp>(1)`.
>>> 2. `long double` can be attributed to a `_Tp` variable, e.g., when using
>>> `const _Tp __pi_2 = 1.5707963267948966192313216916397514L`.
>>>
>>> This patch transforms the implicit casts (1) and (2) into explicit type
>>> casts. As a result, `std::complex` is now able to support more types. One
>>> example is the type `Eigen::Half` from
>>> https://eigen.tuxfamily.org/dox-devel/Half_8h_source.html which does not
>>> implement implicit type conversions.
>>>
>>> *ChangeLog:*
>>> libstdc++-v3/ChangeLog:
>>>
>>>         * include/std/complex:
>>
>>
>> Thank you for the patch. Now that we're in developement stage 1 for GCC 14, it's time to consider it.
>>
>> You're missing a proper changelog entry, I suggest:
>>
>>        * include/std/complex (polar, __complex_sqrt)
>>        (__complex_pow_unsigned, pow, __complex_acos): Replace implicit
>>        conversions from int and long double to value_type.
>
>
> I agree with your proposal for the changelog.
>
>>
>> You're also missing either a copyright assignment on file with the FSF (unless you've completed that paperwork?), or a DCO sign-off. Please see https://gcc.gnu.org/contribute.html#legal and https://gcc.gnu.org/dco.html for more details.
>
>
> Here is my DCO sign-off:
>
> Copyright:
> Signed-off-by: Weslley da Silva Pereira <weslley.spereira@gmail.com>
>
>>
>>
>>>
>>>
>>> *Patch:* fix_complex.diff. (Also at
>>> https://github.com/gcc-mirror/gcc/pull/84)
>>>
>>> *OBS:* I didn't find a good reason for adding new tests or test results
>>> here since this is really a small upgrade (in my view) to std::complex.
>>
>>
>> I don't agree. The purpose of this is to support std::complex<Foo> for a type Foo without implicit conversions (which isn't required by the standard btw, only the floating-point types are required to work, but we can support others as an extension). Without tests, we don't know if that goal has been met, and we don't know if the goal continues to be met in future versions. A test would ensure that we don't accidentally re-introduce code requiring implicit conversions.
>>
>> With a suitable test, I think this patch will be OK for GCC 14.
>>
>> Thanks again for contributing.
>>
>>
>
> Tests:
> See the attached file `test_complex_eigenhalf.cpp`
>
> Test results:
> - When using x86-64 GCC (trunk), I obtained compilation errors as shown in the attached text file. Live example at: https://godbolt.org/z/oa9M34h8P.
> - I observed no errors after applying the suggested patch on my machine.
> - I tried it with the flag `-Wall`. No warnings were shown.
> - My machine configuration and my GCC build information are displayed in the file `config.log` generated by the configuration step of GCC.
>
> Let me know if I need to do anything else.
>
> Thanks,
>   Weslley
>
> --
> Weslley S. Pereira


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

* Re: [PATCH] libstdc++/complex: Remove implicit type casts in complex
  2023-11-06 10:44     ` Jonathan Wakely
@ 2023-11-26  1:49       ` Weslley da Silva Pereira
  0 siblings, 0 replies; 5+ messages in thread
From: Weslley da Silva Pereira @ 2023-11-26  1:49 UTC (permalink / raw)
  To: Jonathan Wakely; +Cc: libstdc++, gcc-patches

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

Hi Jonathan,

Is there a way I can see my patch merged (when it gets merged)?
Particularly, I want to have a link for the commit. I would like to add
this as "impact on third party software" for the software
https://github.com/tlapack/tlapack.

Thanks,
  Weslley

On Mon, Nov 6, 2023 at 3:44 AM Jonathan Wakely <jwakely@redhat.com> wrote:

> On Fri, 3 Nov 2023 at 17:47, Weslley da Silva Pereira
> <weslley.spereira@gmail.com> wrote:
> >
> > Hi Jonathan,
> >
> > I am sorry for the delay. The mailing lists libstdc++@gcc.gnu.org and
> gcc-patches@gcc.gnu.org have just too many emails, so your email got
> lost. I hope my changes still make sense to be included in GCC. Please,
> find my comments below.
>
> Hi,
>
> Thanks for the updated patch, test etc. Yes, I think this still makes
> sense and I'll take care of committing it.
>
>
>
> >
> > On Thu, May 11, 2023 at 3:57 PM Jonathan Wakely <jwakely@redhat.com>
> wrote:
> >>
> >>
> >>
> >> On Mon, 27 Mar 2023 at 22:25, Weslley da Silva Pereira via Libstdc++ <
> libstdc++@gcc.gnu.org> wrote:
> >>>
> >>> Dear all,
> >>>
> >>> Here follows a patch that removes implicit type casts in std::complex.
> >>>
> >>> *Description:* The current implementation of `complex<_Tp>` assumes
> that
> >>> `int, double, long double` are explicitly convertible to `_Tp`.
> Moreover,
> >>> it also assumes that:
> >>>
> >>> 1. `int` is implicitly convertible to `_Tp`, e.g., when using
> >>> `complex<_Tp>(1)`.
> >>> 2. `long double` can be attributed to a `_Tp` variable, e.g., when
> using
> >>> `const _Tp __pi_2 = 1.5707963267948966192313216916397514L`.
> >>>
> >>> This patch transforms the implicit casts (1) and (2) into explicit type
> >>> casts. As a result, `std::complex` is now able to support more types.
> One
> >>> example is the type `Eigen::Half` from
> >>> https://eigen.tuxfamily.org/dox-devel/Half_8h_source.html which does
> not
> >>> implement implicit type conversions.
> >>>
> >>> *ChangeLog:*
> >>> libstdc++-v3/ChangeLog:
> >>>
> >>>         * include/std/complex:
> >>
> >>
> >> Thank you for the patch. Now that we're in developement stage 1 for GCC
> 14, it's time to consider it.
> >>
> >> You're missing a proper changelog entry, I suggest:
> >>
> >>        * include/std/complex (polar, __complex_sqrt)
> >>        (__complex_pow_unsigned, pow, __complex_acos): Replace implicit
> >>        conversions from int and long double to value_type.
> >
> >
> > I agree with your proposal for the changelog.
> >
> >>
> >> You're also missing either a copyright assignment on file with the FSF
> (unless you've completed that paperwork?), or a DCO sign-off. Please see
> https://gcc.gnu.org/contribute.html#legal and https://gcc.gnu.org/dco.html
> for more details.
> >
> >
> > Here is my DCO sign-off:
> >
> > Copyright:
> > Signed-off-by: Weslley da Silva Pereira <weslley.spereira@gmail.com>
> >
> >>
> >>
> >>>
> >>>
> >>> *Patch:* fix_complex.diff. (Also at
> >>> https://github.com/gcc-mirror/gcc/pull/84)
> >>>
> >>> *OBS:* I didn't find a good reason for adding new tests or test results
> >>> here since this is really a small upgrade (in my view) to std::complex.
> >>
> >>
> >> I don't agree. The purpose of this is to support std::complex<Foo> for
> a type Foo without implicit conversions (which isn't required by the
> standard btw, only the floating-point types are required to work, but we
> can support others as an extension). Without tests, we don't know if that
> goal has been met, and we don't know if the goal continues to be met in
> future versions. A test would ensure that we don't accidentally
> re-introduce code requiring implicit conversions.
> >>
> >> With a suitable test, I think this patch will be OK for GCC 14.
> >>
> >> Thanks again for contributing.
> >>
> >>
> >
> > Tests:
> > See the attached file `test_complex_eigenhalf.cpp`
> >
> > Test results:
> > - When using x86-64 GCC (trunk), I obtained compilation errors as shown
> in the attached text file. Live example at:
> https://godbolt.org/z/oa9M34h8P.
> > - I observed no errors after applying the suggested patch on my machine.
> > - I tried it with the flag `-Wall`. No warnings were shown.
> > - My machine configuration and my GCC build information are displayed in
> the file `config.log` generated by the configuration step of GCC.
> >
> > Let me know if I need to do anything else.
> >
> > Thanks,
> >   Weslley
> >
> > --
> > Weslley S. Pereira
>
>

-- 
Weslley S. Pereira

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

end of thread, other threads:[~2023-11-26  1:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-27 21:23 [PATCH] libstdc++/complex: Remove implicit type casts in complex Weslley da Silva Pereira
2023-05-11 21:57 ` Jonathan Wakely
2023-11-03 17:47   ` Weslley da Silva Pereira
2023-11-06 10:44     ` Jonathan Wakely
2023-11-26  1:49       ` Weslley da Silva Pereira

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).