[Bug target/104674] [11 Regression] i686 sse2: The two results of __divmoddi4 are mixed up

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Mar 29 05:53:27 GMT 2022


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

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

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

commit r11-9720-gacb9ea44fcceea0a54a89c7f94af4338c10759ef
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Feb 25 12:06:52 2022 +0100

    i386: Use a new temp slot kind for splitter to floatdi<mode>2_i387_with_xmm
[PR104674]

    As mentioned in the PR, the following testcase is miscompiled for similar
    reasons as the already fixed PR78791 - we use SLOT_TEMP slots in various
    places during expansion and during expansion we can guarantee that the
    lifetime of those temporary slot doesn't overlap.  But the following
    splitter uses SLOT_TEMP too and in between expansion and split1 there is
    a possibility that something extends the lifetime of SLOT_TEMP created
    slots across an instruction that will be split by this splitter.

    The following patch fixes it by using a new temp slot kind to make sure
    it doesn't reuse a SLOT_TEMP that could be live across the instruction.

    2022-02-25  Jakub Jelinek  <jakub@redhat.com>

            PR target/104674
            * config/i386/i386.h (enum ix86_stack_slot): Add
SLOT_FLOATxFDI_387.
            * config/i386/i386.md (splitter to floatdi<mode>2_i387_with_xmm):
Use
            SLOT_FLOATxFDI_387 rather than SLOT_TEMP.

            * gcc.target/i386/pr104674.c: New test.

    (cherry picked from commit eabf7bbe601f2c0d87bd0a1012d7a602df2037da)


More information about the Gcc-bugs mailing list