]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
target/113255 - avoid REG_POINTER on a pointer difference
authorRichard Biener <rguenther@suse.de>
Thu, 1 Feb 2024 12:54:11 +0000 (13:54 +0100)
committerRichard Biener <rguenther@suse.de>
Mon, 5 Feb 2024 07:35:32 +0000 (08:35 +0100)
The following avoids re-using a register holding a pointer (and
thus might be REG_POINTER) for the result of a pointer difference
computation.  That might confuse heuristics in (broken) RTL alias
analysis which relies on REG_POINTER indicating that we're
dealing with one.

This alone doesn't fix anything.

PR target/113255
* config/i386/i386-expand.cc
(expand_set_or_cpymem_prologue_epilogue_by_misaligned_moves):
Use a new pseudo for the skipped number of bytes.

gcc/config/i386/i386-expand.cc

index 5706220823ab9ee700c0a599ca6342dd82a285ae..50f9fe2c0d73908d88b754131ff8e3f1d636061f 100644 (file)
@@ -8429,7 +8429,7 @@ expand_set_or_cpymem_prologue_epilogue_by_misaligned_moves (rtx destmem, rtx src
       /* See how many bytes we skipped.  */
       saveddest = expand_simple_binop (GET_MODE (*destptr), MINUS, saveddest,
                                       *destptr,
-                                      saveddest, 1, OPTAB_DIRECT);
+                                      NULL_RTX, 1, OPTAB_DIRECT);
       /* Adjust srcptr and count.  */
       if (!issetmem)
        *srcptr = expand_simple_binop (GET_MODE (*srcptr), MINUS, *srcptr,