diff options
author | Alexandre Oliva <oliva@adacore.com> | 2023-06-13 05:52:22 -0300 |
---|---|---|
committer | Alexandre Oliva <oliva@gnu.org> | 2023-06-13 05:52:22 -0300 |
commit | d438b67e005bf8fc9e4af26410bf69816c30e969 (patch) | |
tree | a689745c70638c57d76ba2b1a0c19c17aeb22b09 /gcc/range-op-float.cc | |
parent | 0f3d07e16fec7bea2fd033d9ec8ff08ea7effa39 (diff) | |
download | gcc-d438b67e005bf8fc9e4af26410bf69816c30e969.zip gcc-d438b67e005bf8fc9e4af26410bf69816c30e969.tar.gz gcc-d438b67e005bf8fc9e4af26410bf69816c30e969.tar.bz2 |
fix frange_nextafter odr violation
C++ requires inline functions to be declared inline and defined in
every translation unit that uses them. frange_nextafter is used in
gimple-range-op.cc but it's only defined as inline in
range-op-float.cc. Drop the extraneous inline specifier.
Other non-static inline functions in range-op-float.cc are not
referenced elsewhere, so I'm making them static.
for gcc/ChangeLog
* range-op-float.cc (frange_nextafter): Drop inline.
(frelop_early_resolve): Add static.
(frange_float): Likewise.
Diffstat (limited to 'gcc/range-op-float.cc')
-rw-r--r-- | gcc/range-op-float.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc index f5c0cec..238a326 100644 --- a/gcc/range-op-float.cc +++ b/gcc/range-op-float.cc @@ -260,7 +260,7 @@ maybe_isnan (const frange &op1, const frange &op2) // Floating version of relop_early_resolve that takes into account NAN // and -ffinite-math-only. -inline bool +static inline bool frelop_early_resolve (irange &r, tree type, const frange &op1, const frange &op2, relation_trio rel, relation_kind my_rel) @@ -277,7 +277,7 @@ frelop_early_resolve (irange &r, tree type, // Set VALUE to its next real value, or INF if the operation overflows. -inline void +void frange_nextafter (enum machine_mode mode, REAL_VALUE_TYPE &value, const REAL_VALUE_TYPE &inf) @@ -2697,7 +2697,7 @@ namespace selftest // Build an frange from string endpoints. -inline frange +static inline frange frange_float (const char *lb, const char *ub, tree type = float_type_node) { REAL_VALUE_TYPE min, max; |