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

--- Comment #9 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jakub Jelinek
<ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:726682897d877afacb8164130cbbc715f8b44784

commit r12-9280-g726682897d877afacb8164130cbbc715f8b44784
Author: Jakub Jelinek <ja...@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  <ja...@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.

    (cherry picked from commit cc88366a80e35b3e53141f49d3071010ff3c2ef8)
  • [Bug c++/108934] [12 Regression... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to