[Patch, committed] Fortran: call of overloaded ‘abs(long long int&)’ is ambiguous [PR109492]

2023-04-13 Thread Harald Anlauf via Gcc-patches
Dear all, I've committed the attached patch which fixes a portability issue when bootstrapping on Solaris. Discussed and confirmed in the PR by Jonathan for Solaris and regtested by me on x86_64-pc-linux-gnu. https://gcc.gnu.org/g:43816633afd275a9057232a6ebfdc19e441f09ec (Unfortunately the comm

Re: abs(long long)

2012-10-03 Thread Marc Glisse
On Wed, 3 Oct 2012, Gabriel Dos Reis wrote: On Tue, Oct 2, 2012 at 1:53 PM, Marc Glisse wrote: * include/c_std/cstdlib (abs(long long)): Define with __builtin_llabs when we have long long. (abs(__int128)): Define when we have __int128. This change is OK Thanks

Re: abs(long long)

2012-10-03 Thread Gabriel Dos Reis
never expanded inline (except maybe for > special constant input like 0) and expands to a call to the library function > asin. > > Would the attached patch be better, assuming it passes testing? For lldiv, > there is no builtin (for good reason). > > * include/c_std/cstdlib

Re: abs(long long)

2012-10-02 Thread Marc Glisse
hand is never expanded inline (except maybe for special constant input like 0) and expands to a call to the library function asin. Would the attached patch be better, assuming it passes testing? For lldiv, there is no builtin (for good reason). * include/c_std/cstdlib (abs(long long))

Re: abs(long long)

2012-10-02 Thread Gabriel Dos Reis
On Tue, Oct 2, 2012 at 8:07 AM, Marc Glisse wrote: > Or do you mean: > always call __builtin_llabs (whether we have an llabs or not), and let the > compiler replace it with either (x<0)?-x:x or a library call (I assume it > never does that unless it has seen a corresponding declaration)? See wha

Re: abs(long long)

2012-10-02 Thread Gabriel Dos Reis
On Tue, Oct 2, 2012 at 9:34 AM, Daniel Krügler wrote: > 2012/10/2 Marc Glisse : >> Here I am talking of a library issue: the wording that says that there are >> sufficient overloads such that integer types call the double version of math >> functions. It is fairly obvious that it doesn't apply to

Re: abs(long long)

2012-10-02 Thread Gabriel Dos Reis
On Tue, Oct 2, 2012 at 8:07 AM, Marc Glisse wrote: >>> The library installed by the system was compiled with g++, and is then >>> used >>> with clang++. If we can avoid installing 2 config.h files to make that >>> work... >> >> >> Two things: >> 1. that is clearly a clang problem. I don't think

Re: abs(long long)

2012-10-02 Thread Daniel Krügler
2012/10/2 Marc Glisse : > Here I am talking of a library issue: the wording that says that there are > sufficient overloads such that integer types call the double version of math > functions. It is fairly obvious that it doesn't apply to abs(long) for > instance which has an explicit overload. For

Re: abs(long long)

2012-10-02 Thread Marc Glisse
On Tue, 2 Oct 2012, Gabriel Dos Reis wrote: I understand that it is originally a library issue, but I don't think it makes sense to resolve it in isolation of that core issue. They seem mostly orthogonal to me, since the library only uses an informal language describing the desired outcome an

Re: abs(long long)

2012-10-02 Thread Gabriel Dos Reis
On Tue, Oct 2, 2012 at 4:21 AM, Marc Glisse wrote: > On Tue, 2 Oct 2012, Gabriel Dos Reis wrote: > >> On Tue, Oct 2, 2012 at 3:57 AM, Marc Glisse wrote: >>> >>> (Forgot libstdc++...) >>> >>> >>> Hello, >>> >>> here is the patch from PR54686. Several notes: >>> >>> * I'll have to ask experts if st

Re: abs(long long)

2012-10-02 Thread Marc Glisse
On Tue, 2 Oct 2012, Gabriel Dos Reis wrote: On Tue, Oct 2, 2012 at 3:57 AM, Marc Glisse wrote: (Forgot libstdc++...) Hello, here is the patch from PR54686. Several notes: * I'll have to ask experts if std::abs(unsigned) (yes, a weird thing to do, but still) is meant to return a double...

Re: abs(long long)

2012-10-02 Thread Gabriel Dos Reis
st check after the > review (no point if the patch needs changing again). In general, I think I have a bias toward using compiler intrinsics, for which the compiler already has lot of knowledge about. > > 2012-10-02 Marc Glisse > > PR libstdc++/54686 > * include

abs(long long)

2012-10-02 Thread Marc Glisse
sh/newlib. I'll do a last check after the review (no point if the patch needs changing again). 2012-10-02 Marc Glisse PR libstdc++/54686 * include/c_std/cstdlib (abs(long long)): Define fallback whenever we have long long but possibly not llabs. (abs(l

abs(long long)

2012-10-02 Thread Marc Glisse
do a last check after the review (no point if the patch needs changing again). 2012-10-02 Marc Glisse PR libstdc++/54686 * include/c_std/cstdlib (abs(long long)): Define fallback whenever we have long long but possibly not llabs. (abs(long long)): Use llabs