public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/100912] powerpc64le: ieee128 long double incorrectly printed when using shared libstdc++
Date: Mon, 14 Feb 2022 17:27:23 +0000	[thread overview]
Message-ID: <bug-100912-4-ph9TVQIBds@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100912-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100912

--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:3d50dede07de0923f0f320d385162e546445e640

commit r12-7231-g3d50dede07de0923f0f320d385162e546445e640
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Feb 14 16:46:55 2022 +0000

    libstdc++: Fix stream extraction of IEEE128 long double [PR100912]

    The std::__convert_from_v helper that formats double and long double
    values into a char buffer was not being duplicated for the two long
    double ABIs. This resulted in an ODR violation inside the library, where
    some callers needed it to use snprintf to format __ibm128 values and
    other callers needed it to use __snprintfieee128 to format __ieee128
    values. The linker discarded one of the definitions, leaving one set of
    callers using the wrong code.

    This puts __convert_from_v in the __gnu_cxx_ieee128 inline namespace
    when long double is __ieee128, so that there are two different
    definitions of the function.

    The std::money_put::__do_put overload for __ibm128 values needs a
    different fix, because that is defined when long double is __ieee128 and
    so would call the one in the inline namespace. That can be fixed by just
    inlining the code directly into the function and using an asm alias to
    call the right version of snprintf for the __ibm128 format. The code to
    do that can be simpler than __convert_from_v because if we're defining
    the ALT128_COMPAT symbols we know that we have a recent glibc and so we
    can assume that uselocale and snprintf are supported.

    libstdc++-v3/ChangeLog:

            PR libstdc++/100912
            * config/locale/gnu/c_locale.h (__convert_from_v): Use inline
            namespace for IEEE128 long double mode.
            * config/os/gnu-linux/ldbl-ieee128-extra.ver: Add new symbol
            version and export __gnu_cxx_ieee128::__convert_from_v.
            * include/bits/locale_facets_nonio.tcc (money_put::__do_put):
            Make __ibm128 overload use snprintf directly
            * testsuite/util/testsuite_abi.cc: Add new symbol version.
            Remove stable IEEE128/LDBL versions.

  parent reply	other threads:[~2022-02-14 17:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-04 18:51 [Bug libstdc++/100912] New: " msc at linux dot ibm.com
2021-06-04 22:27 ` [Bug target/100912] " pinskia at gcc dot gnu.org
2021-06-05 10:51 ` redi at gcc dot gnu.org
2021-06-07 13:27 ` msc at linux dot ibm.com
2021-06-07 13:50 ` msc at linux dot ibm.com
2021-10-11 10:08 ` [Bug libstdc++/100912] " qiu.chaofan at outlook dot com
2021-10-13  8:56 ` qiu.chaofan at outlook dot com
2021-10-13  9:16 ` redi at gcc dot gnu.org
2021-10-21  3:47 ` qiu.chaofan at outlook dot com
2021-12-06  6:26 ` qiu.chaofan at outlook dot com
2022-01-10  9:57 ` qiu.chaofan at outlook dot com
2022-01-10 10:01 ` redi at gcc dot gnu.org
2022-02-14 17:27 ` cvs-commit at gcc dot gnu.org [this message]
2022-02-14 17:29 ` redi at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-100912-4-ph9TVQIBds@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).