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 c++/108934] [12/13 Regression] bit_cast'ing to long double errors out with "the argument cannot be interpreted" since gcc-12
Date: Thu, 02 Mar 2023 08:28:22 +0000	[thread overview]
Message-ID: <bug-108934-4-26QVcWbrUj@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108934-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #7 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:cc88366a80e35b3e53141f49d3071010ff3c2ef8

commit r13-6408-gcc88366a80e35b3e53141f49d3071010ff3c2ef8
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Mar 2 09:27:40 2023 +0100

    fold-const: Ignore padding bits in native_interpret_expr REAL_CST reverse
verification [PR108934]

    In the following testcase we try to std::bit_cast a (pair of) integral
    value(s) which has some non-zero bits in the place of x86 long double
    (for 64-bit 16 byte type with 10 bytes actually loaded/stored by hw,
    for 32-bit 12 byte) and starting with my PR104522 change we reject that
    as native_interpret_expr fails on it.  The PR104522 change extends what
    has been done before for MODE_COMPOSITE_P (but those don't have any padding
    bits) to all floating point types, because e.g. the exact x86 long double
    has various bit combinations we don't support, like
    pseudo-(denormals,infinities,NaNs) or unnormals.  The HW handles some of
    those as exceptional cases and others similarly to the non-pseudo ones.
    But for the padding bits it actually doesn't load/store those bits at all,
    it loads/stores 10 bytes.  So, I think we should exempt the padding bits
    from the reverse comparison (the native_encode_expr bits for the padding
    will be all zeros), which the following patch does.  For bit_cast it is
    similar to e.g. ignoring padding bits if the destination is a structure
    which has padding bits in there.

    The change changed auto-init-4.c to how it has been behaving before the
    PR105259 change, where some more VCEs can be now done.

    2023-03-02  Jakub Jelinek  <jakub@redhat.com>

            PR c++/108934
            * fold-const.cc (native_interpret_expr) <case REAL_CST>: Before
memcmp
            comparison copy the bytes from ptr to a temporary buffer and
clearing
            padding bits in there.

            * gcc.target/i386/auto-init-4.c: Revert PR105259 change.
            * g++.target/i386/pr108934.C: New test.

  parent reply	other threads:[~2023-03-02  8:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-25 22:58 [Bug c++/108934] New: " janpmoeller at gmx dot de
2023-02-25 23:09 ` [Bug c++/108934] " pinskia at gcc dot gnu.org
2023-02-25 23:09 ` pinskia at gcc dot gnu.org
2023-02-25 23:11 ` pinskia at gcc dot gnu.org
2023-02-25 23:15 ` pinskia at gcc dot gnu.org
2023-03-01 15:56 ` jakub at gcc dot gnu.org
2023-03-01 15:57 ` [Bug c++/108934] [12/13 Regression] " jakub at gcc dot gnu.org
2023-03-01 16:02 ` jakub at gcc dot gnu.org
2023-03-01 16:19 ` jakub at gcc dot gnu.org
2023-03-02  8:28 ` cvs-commit at gcc dot gnu.org [this message]
2023-03-02  8:29 ` [Bug c++/108934] [12 " jakub at gcc dot gnu.org
2023-03-19  5:30 ` cvs-commit at gcc dot gnu.org
2023-03-20 10:28 ` jakub 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-108934-4-26QVcWbrUj@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).