public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-7174] Fortran: call of overloaded ‘abs(long long int&)’ is ambiguous [PR109492]
@ 2023-04-13 20:47 Harald Anlauf
0 siblings, 0 replies; only message in thread
From: Harald Anlauf @ 2023-04-13 20:47 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:43816633afd275a9057232a6ebfdc19e441f09ec
commit r13-7174-g43816633afd275a9057232a6ebfdc19e441f09ec
Author: Harald Anlauf <anlauf@gmx.de>
Date: Thu Apr 13 22:42:23 2023 +0200
Fortran: call of overloaded ‘abs(long long int&)’ is ambiguous [PR109492]
gcc/fortran/ChangeLog:
PR fortran/109492
* trans-expr.cc (gfc_conv_power_op): Use absu_hwi and
unsigned HOST_WIDE_INT for portability.
Diff:
---
gcc/fortran/trans-expr.cc | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gcc/fortran/trans-expr.cc b/gcc/fortran/trans-expr.cc
index 79367fa2ae0..09cdd9263c4 100644
--- a/gcc/fortran/trans-expr.cc
+++ b/gcc/fortran/trans-expr.cc
@@ -3400,11 +3400,12 @@ gfc_conv_power_op (gfc_se * se, gfc_expr * expr)
&& TREE_CODE (TREE_TYPE (rse.expr)) == INTEGER_TYPE)
{
wi::tree_to_wide_ref wlhs = wi::to_wide (lse.expr);
- HOST_WIDE_INT v, w;
+ HOST_WIDE_INT v;
+ unsigned HOST_WIDE_INT w;
int kind, ikind, bit_size;
v = wlhs.to_shwi ();
- w = abs (v);
+ w = absu_hwi (v);
kind = expr->value.op.op1->ts.kind;
ikind = gfc_validate_kind (BT_INTEGER, kind, false);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-04-13 20:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-13 20:47 [gcc r13-7174] Fortran: call of overloaded ‘abs(long long int&)’ is ambiguous [PR109492] Harald Anlauf
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).