From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id D66D63858C20; Thu, 8 Jun 2023 12:28:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D66D63858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1686227323; bh=nEurvIDaDgdwUd0SaHXH4BOL/1rqb85jxDTs5BwxLSo=; h=From:To:Subject:Date:From; b=UaeP4Tc817bOfK5U1Tx3skUjXotamvKSHGdgA9XHpc4IG8fIM+3EdJv60pSdX68GP 8cJZbQuj73uZXBEaOyblFXqY3zKKPOGV3QGqEzD4PKrWucQlzdplQujC+ifbKmSfij /2clug3XSuz/JOH+MdVHP3V41cWzwgNavbsAoMBc= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] fix frange_nextafter odr violation X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: 8b051050bb83c77b39a8d0b4c5ab07541a4dd0cc X-Git-Newrev: 66378d5d888aa625f73316c6189684aad4bd3022 Message-Id: <20230608122843.D66D63858C20@sourceware.org> Date: Thu, 8 Jun 2023 12:28:43 +0000 (GMT) List-Id: https://gcc.gnu.org/g:66378d5d888aa625f73316c6189684aad4bd3022 commit 66378d5d888aa625f73316c6189684aad4bd3022 Author: Alexandre Oliva Date: Thu Jun 8 09:17:46 2023 -0300 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. Diff: --- gcc/range-op-float.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gcc/range-op-float.cc b/gcc/range-op-float.cc index a99a6b01ed8..d6da2aa701e 100644 --- a/gcc/range-op-float.cc +++ b/gcc/range-op-float.cc @@ -255,7 +255,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) @@ -272,7 +272,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) @@ -2878,7 +2878,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;