public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
@ 2023-11-16 20:06 sjames at gcc dot gnu.org
  2023-11-17  0:00 ` [Bug middle-end/112572] " sjames at gcc dot gnu.org
                   ` (34 more replies)
  0 siblings, 35 replies; 36+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-16 20:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112572
           Summary: [14 regression] LLVM miscompiled since
                    r14-5355-g3cd3a09b3f91a1
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
                CC: jakub at gcc dot gnu.org, rsandifo at gcc dot gnu.org,
                    slyfox at gcc dot gnu.org
  Target Milestone: ---

LLVM's test suite has many failures for me with trunk.

CCing jakub because he was able to run with the test failure in PR109462 and
I've got a very poor track record with being able to reduce LLVM, ditto slyfox
as he has a great track record with reducing LLVM (PR110228, PR110726,
PR110598).

This bisects to the same commit as PR112568 does (r14-5355-g3cd3a09b3f91a1).

I'll add some (large) reproduction instructions in a minute.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
@ 2023-11-17  0:00 ` sjames at gcc dot gnu.org
  2023-11-17  0:41 ` sjames at gcc dot gnu.org
                   ` (33 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-17  0:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Sam James <sjames at gcc dot gnu.org> ---
Attached a build script. I'm testing on the llvm-17.0.5 tag. All tests pass
with r14-5355-g3cd3a09b3f91a1 reverted.

Script to be run inside a git checkout of llvm-17.0.5:
```
#!/usr/bin/env bash
: ${CC:=gcc}
: ${CXX:=g++}
: ${CFLAGS:=-O3 -march=znver2}
: ${CXXFLAGS:=-O3 -march=znver2}
: ${CPPFLAGS:=-DNDEBUG}
: ${builddir:=/home/sam/data/build/llvm-project}
: ${srcdir:=/home/sam/git/llvm-project}

export CCACHE_DIR=/var/cache/ccache
export PYTHON=$(type -P python3.11)
export EPYTHON=python3.11

components=(
        compiler-rt
)

mkdir -p "${builddir}"

cmakeargs=(
        -B"${builddir}"
        -S"${srcdir}/llvm"
        -GNinja
        -DBUILD_SHARED_LIBS=OFF
        -DCMAKE_BUILD_TYPE=RelWithDebInfo
        -DLLVM_BUILD_TESTS=ON
        -DLLVM_INCLUDE_TESTS=ON
        -DLLVM_CCACHE_BUILD=ON
        -DLLVM_ENABLE_ASSERTIONS=NO
        -DLLVM_ENABLE_BINDINGS=OFF
        -DLLVM_ENABLE_PROJECTS="llvm" # ;clang;clang-tools-extra
        -DLLVM_ENABLE_ZSTD=yes
        -DLLVM_BUILD_LLVM_DYLIB=ON
        -DLLVM_ENABLE_FFI=yes
        -DLLVM_ENABLE_EH=ON -DLLVM_ENABLE_RTTI=ON
        -DLLVM_LINK_LLVM_DYLIB=ON
        -DLLVM_TARGETS_TO_BUILD="X86"
        -DLLVM_TARGETS_TO_BUILD=
       
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="AArch64;AMDGPU;ARM;AVR;BPF;Hexagon;Lanai;LoongArch;MSP430;Mips;NVPTX;PowerPC;RISCV;Sparc;SystemZ;VE;WebAssembly;X86;XCore"
        -DLLVM_INCLUDE_BENCHMARKS=OFF
        #-DLLVM_USE_LINKER=lld
        -DCMAKE_C_FLAGS="${CFLAGS}"
        -DCMAKE_CXX_FLAGS="${CXXFLAGS}"
        #-DLLVM_EXTERNAL_LIT="${EPREFIX:-/}/usr/bin/lit"
        -DPython3_EXECUTABLE="${PYTHON}"
        -DPython_EXECUTABLE="${PYTHON}"
)

export CC CXX CFLAGS CXXFLAGS CPPFLAGS

${CMAKE:-cmake} "${cmakeargs[@]}" "$@"
${NINJA:-ninja} -C "${builddir}"
ret=$?

for component in "${components[@]}" ; do
        mkdir -p "${builddir}-${component}"
        ${CMAKE:-cmake} "${cmakeargs[@]}" -B "${builddir}-${component}"
-S"${srcdir}/${component}" -DCOMPILER_RT_BUILD_SANITIZERS=ON
-DLLVM_BUILD_TESTS=ON "$@"
        ${NINJA:-ninja} -C "${builddir}-${component}" || exit 1
done

exit 0
```

Invocation:
```
bash ~/scripts/build-llvm ; ninja -C /home/sam/data/build/llvm-project
check-all
```

Failures:
```
********************
Failed Tests (22):
  LLVM :: CodeGen/X86/oddshuffles.ll
  LLVM :: CodeGen/X86/vector-interleaved-load-i64-stride-4.ll
  LLVM :: CodeGen/X86/vector-interleaved-load-i8-stride-3.ll
  LLVM :: CodeGen/X86/vector-interleaved-store-i64-stride-4.ll
  LLVM :: CodeGen/X86/vector-interleaved-store-i8-stride-3.ll
  LLVM :: CodeGen/X86/vector-interleaved-store-i8-stride-4.ll
  LLVM :: CodeGen/X86/vector-shuffle-combining-sse41.ll
  LLVM :: CodeGen/X86/x86-interleaved-access.ll
  LLVM ::
Transforms/InterleavedAccess/X86/interleaved-accesses-64bits-avx-inseltpoison.ll
  LLVM :: Transforms/InterleavedAccess/X86/interleaved-accesses-64bits-avx.ll
  LLVM :: Transforms/InterleavedAccess/X86/interleavedLoad-inseltpoison.ll
  LLVM :: Transforms/InterleavedAccess/X86/interleavedLoad.ll
  LLVM :: Transforms/InterleavedAccess/X86/interleavedStore-inseltpoison.ll
  LLVM :: Transforms/InterleavedAccess/X86/interleavedStore.ll
  LLVM-Unit :: CodeGen/./CodeGenTests/71/131
  LLVM-Unit :: CodeGen/./CodeGenTests/72/131
  LLVM-Unit :: CodeGen/./CodeGenTests/73/131
  LLVM-Unit :: CodeGen/./CodeGenTests/74/131
  LLVM-Unit :: CodeGen/./CodeGenTests/75/131
  LLVM-Unit :: CodeGen/./CodeGenTests/76/131
  LLVM-Unit :: CodeGen/./CodeGenTests/77/131
  LLVM-Unit :: CodeGen/./CodeGenTests/79/131
```

e.g.
```

********************
FAIL: LLVM ::
Transforms/InterleavedAccess/X86/interleaved-accesses-64bits-avx.ll (39005 of
50818)
******************** TEST 'LLVM ::
Transforms/InterleavedAccess/X86/interleaved-accesses-64bits-avx.ll' FAILED
********************
Script:
--
: 'RUN: at line 2';   /home/sam/data/build/llvm-project/bin/opt <
/home/sam/git/llvm-project/llvm/test/Transforms/InterleavedAccess/X86/interleaved-accesses-64bits-avx.ll
-mtriple=x86_64-pc-linux  -mattr=+avx -interleaved-access -S |
/home/sam/data/build/llvm-project/bin/FileCheck
/home/sam/git/llvm-project/llvm/test/Transforms/InterleavedAccess/X86/interleaved-accesses-64bits-avx.ll
--
Exit Code: 2

Command Output (stderr):
--
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and
include the crash backtrace.
Stack dump:
0.      Program arguments: /home/sam/data/build/llvm-project/bin/opt
-mtriple=x86_64-pc-linux -mattr=+avx -interleaved-access -S
1.      Running pass 'Function Pass Manager' on module '<stdin>'.
2.      Running pass 'Interleaved Access Pass' on function '@load_factorf64_4'
#0 0x00007fedafb8253f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
/home/sam/git/llvm-project/llvm/lib/Support/Unix/Signals.inc:602:22
#1 0x00007fedafb80174 llvm::sys::RunSignalHandlers()
/home/sam/git/llvm-project/llvm/lib/Support/Signals.cpp:104:20
#2 0x00007fedafb802f6 SignalHandler(int)
/home/sam/git/llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
#3 0x00007fedae86dbe0 (/usr/lib64/libc.so.6+0x39be0)
#4 0x00007fedb39120f5
(/home/sam/data/build/llvm-project/bin/../lib/libLLVM-17.so+0x4b120f5)
FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/sam/data/build/llvm-project/bin/FileCheck
/home/sam/git/llvm-project/llvm/test/Transforms/InterleavedAccess/X86/interleaved-accesses-64bits-avx.ll
```

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
  2023-11-17  0:00 ` [Bug middle-end/112572] " sjames at gcc dot gnu.org
@ 2023-11-17  0:41 ` sjames at gcc dot gnu.org
  2023-11-17  4:13 ` sjames at gcc dot gnu.org
                   ` (32 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-17  0:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Sam James <sjames at gcc dot gnu.org> ---
With -DLLVM_ENABLE_ASSERTIONS=ON, I get:
```
Failed Tests (8):
  LLVM-Unit :: CodeGen/./CodeGenTests/75/134
  LLVM-Unit :: CodeGen/./CodeGenTests/76/134
  LLVM-Unit :: CodeGen/./CodeGenTests/77/134
  LLVM-Unit :: CodeGen/./CodeGenTests/78/134
  LLVM-Unit :: CodeGen/./CodeGenTests/79/134
  LLVM-Unit :: CodeGen/./CodeGenTests/80/134
  LLVM-Unit :: CodeGen/./CodeGenTests/81/134
  LLVM-Unit :: CodeGen/./CodeGenTests/83/134
```

But more notably, the failures are all like:
```
[ RUN      ] RegallocDevelopmentFeaturesTest.MBBFullTruncated
CodeGenTests:
/home/sam/git/llvm-project/llvm/include/llvm/CodeGen/SlotIndexes.h:112:
llvm::IndexListEntry* llvm::SlotIndex::listEntry() const: Assertion `isValid()
&& "Attempt to compare reserved index."' failed.
```

Backtrace:
```
gdb) bt
#0  0x00007fffedec2f9c in ?? () from /usr/lib64/libc.so.6
#1  0x00007fffede6db32 in raise () from /usr/lib64/libc.so.6
#2  0x00007fffede564f0 in abort () from /usr/lib64/libc.so.6
#3  0x00007fffede56418 in ?? () from /usr/lib64/libc.so.6
#4  0x00007fffede66362 in __assert_fail () from /usr/lib64/libc.so.6
#5  0x00007fffefa95239 in llvm::SlotIndex::listEntry (this=<synthetic pointer>)
at /home/sam/git/llvm-project/llvm/include/llvm/CodeGen/SlotIndexes.h:111
#6  llvm::SlotIndex::listEntry (this=<optimized out>) at
/home/sam/git/llvm-project/llvm/include/llvm/CodeGen/SlotIndexes.h:111
#7  llvm::SlotIndex::getIndex (this=<optimized out>) at
/home/sam/git/llvm-project/llvm/include/llvm/CodeGen/SlotIndexes.h:121
#8  llvm::SlotIndex::operator< (other=..., this=<synthetic pointer>) at
/home/sam/git/llvm-project/llvm/include/llvm/CodeGen/SlotIndexes.h:177
#9  operator() (B=..., A=..., __closure=<synthetic pointer>) at
/home/sam/git/llvm-project/llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp:968
#10
__gnu_cxx::__ops::_Iter_comp_iter<extractInstructionFeatures(llvm::SmallVectorImpl<LRStartEndInfo>&,
llvm::MLModelRunner*, llvm::function_ref<int(llvm::SlotIndex)>,
llvm::function_ref<float(llvm::SlotIndex)>,
llvm::function_ref<llvm::MachineBasicBlock*(llvm::SlotIndex)>, int, int, int,
int, llvm::SlotIndex)::<lambda(LRStartEndInfo, LRStartEndInfo)>
>::operator()<LRStartEndInfo*, LRStartEndInfo*> (
    __it2=0x7fffffffbd40, __it1=0x7fffffffbdd0, this=<synthetic pointer>) at
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/predefined_ops.h:158
#11 std::__insertion_sort<LRStartEndInfo*,
__gnu_cxx::__ops::_Iter_comp_iter<extractInstructionFeatures(llvm::SmallVectorImpl<LRStartEndInfo>&,
llvm::MLModelRunner*, llvm::function_ref<int(llvm::SlotIndex)>,
llvm::function_ref<float(llvm::SlotIndex)>,
llvm::function_ref<llvm::MachineBasicBlock*(llvm::SlotIndex)>, int, int, int,
int, llvm::SlotIndex)::<lambda(LRStartEndInfo, LRStartEndInfo)> >
>(LRStartEndInfo *, LRStartEndInfo *,
__gnu_cxx::__ops::_Iter_comp_iter<extractInstructionFeatures(llvm::SmallVectorImpl<LRStartEndInfo>&,
llvm::MLModelRunner*, llvm::function_ref<int(llvm::SlotIndex)>,
llvm::function_ref<float(llvm::SlotIndex)>,
llvm::function_ref<llvm::MachineBasicBlock*(llvm::SlotIndex)>, int, int, int,
int, llvm::SlotIndex)::<lambda(LRStartEndInfo, LRStartEndInfo)> >)
(__first=__first@entry=0x7fffffffbd40,
    __last=__last@entry=0x7fffffffbbd0, __comp=...) at
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/stl_algo.h:1771
#12 0x00007fffefa97ceb in std::__final_insertion_sort<LRStartEndInfo*,
__gnu_cxx::__ops::_Iter_comp_iter<extractInstructionFeatures(llvm::SmallVectorImpl<LRStartEndInfo>&,
llvm::MLModelRunner*, llvm::function_ref<int(llvm::SlotIndex)>,
llvm::function_ref<float(llvm::SlotIndex)>,
llvm::function_ref<llvm::MachineBasicBlock*(llvm::SlotIndex)>, int, int, int,
int, llvm::SlotIndex)::<lambda(LRStartEndInfo, LRStartEndInfo)> > >
(__comp=..., __last=0x7fffffffbbd0, __first=0x7fffffffbd40) at
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/stl_algo.h:1816
#13 std::__sort<LRStartEndInfo*,
__gnu_cxx::__ops::_Iter_comp_iter<extractInstructionFeatures(llvm::SmallVectorImpl<LRStartEndInfo>&,
llvm::MLModelRunner*, llvm::function_ref<int(llvm::SlotIndex)>,
llvm::function_ref<float(llvm::SlotIndex)>,
llvm::function_ref<llvm::MachineBasicBlock*(llvm::SlotIndex)>, int, int, int,
int, llvm::SlotIndex)::<lambda(LRStartEndInfo, LRStartEndInfo)> > >
(__comp=...,
    __last=0x7fffffffbd58, __first=0x7fffffffbd40) at
/usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/stl_algo.h:1902
#14 std::sort<LRStartEndInfo*,
extractInstructionFeatures(llvm::SmallVectorImpl<LRStartEndInfo>&,
llvm::MLModelRunner*, llvm::function_ref<int(llvm::SlotIndex)>,
llvm::function_ref<float(llvm::SlotIndex)>,
llvm::function_ref<llvm::MachineBasicBlock*(llvm::SlotIndex)>, int, int, int,
int, llvm::SlotIndex)::<lambda(LRStartEndInfo, LRStartEndInfo)> > (__comp=...,
__last=0x7fffffffbd58, __first=0x7fffffffbd40)
    at /usr/lib/gcc/x86_64-pc-linux-gnu/14/include/g++-v14/bits/stl_algo.h:4798
#15 extractInstructionFeatures(llvm::SmallVectorImpl<LRStartEndInfo>&,
llvm::MLModelRunner*, llvm::function_ref<int (llvm::SlotIndex)>,
llvm::function_ref<float (llvm::SlotIndex)>,
llvm::function_ref<llvm::MachineBasicBlock* (llvm::SlotIndex)>, int, int, int,
int, llvm::SlotIndex) (LRPosInfo=...,
RegallocRunner=RegallocRunner@entry=0x7fffffffbb80, GetOpcode=...,
GetMBBFreq=..., GetMBBReference=...,
    InstructionsIndex=0, InstructionsMappingIndex=1, MBBFreqIndex=2,
MBBMappingIndex=3, LastIndex=...) at
/home/sam/git/llvm-project/llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp:966
#16 0x0000555555700ecf in (anonymous
namespace)::RegallocDevelopmentFeaturesTest_MBBFullTruncated_Test::TestBody
(this=<optimized out>)
    at
/home/sam/git/llvm-project/llvm/unittests/CodeGen/MLRegallocDevelopmentFeatures.cpp:265
#17 0x000055555571f987 in
testing::internal::HandleSehExceptionsInMethodIfSupported<testing::Test, void>
(location=0x555555757610 "the test body", method=<optimized out>,
object=0x555555a0adc0)
    at
/home/sam/git/llvm-project/third-party/unittest/googletest/src/gtest.cc:2414
#18 testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>
(object=object@entry=0x555555a0adc0, method=<optimized out>,
location=location@entry=0x555555757610 "the test body")
    at
/home/sam/git/llvm-project/third-party/unittest/googletest/src/gtest.cc:2469
#19 0x00005555557209e1 in testing::Test::Run (this=0x555555a0adc0) at
/home/sam/git/llvm-project/third-party/unittest/googletest/src/gtest.cc:2508
[...]
```

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
  2023-11-17  0:00 ` [Bug middle-end/112572] " sjames at gcc dot gnu.org
  2023-11-17  0:41 ` sjames at gcc dot gnu.org
@ 2023-11-17  4:13 ` sjames at gcc dot gnu.org
  2023-11-17  4:14 ` sjames at gcc dot gnu.org
                   ` (31 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-17  4:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Sam James <sjames at gcc dot gnu.org> ---
It's a bit easier with the following as you get many split libLLVM* linked into
unittests/CodeGen/CodeGenTests (which is a convenient reproducer I'm running):
```
-DBUILD_SHARED_LIBS=ON
-DLLVM_BUILD_LLVM_DYLIB=OFF
-DLLVM_LINK_LLVM_DYLIB=ON
```

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-11-17  4:13 ` sjames at gcc dot gnu.org
@ 2023-11-17  4:14 ` sjames at gcc dot gnu.org
  2023-11-17  5:21 ` sjames at gcc dot gnu.org
                   ` (30 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-17  4:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Sam James <sjames at gcc dot gnu.org> ---
The bad object is lib/libLLVMCodeGen.so.17, it seems. Swapping it with a good
one & rebuilding w/ ninja makes that test pass.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-11-17  4:14 ` sjames at gcc dot gnu.org
@ 2023-11-17  5:21 ` sjames at gcc dot gnu.org
  2023-11-17  5:23 ` pinskia at gcc dot gnu.org
                   ` (29 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-17  5:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Sam James <sjames at gcc dot gnu.org> ---
* https://dev.gentoo.org/~sam/bugs/gcc/gcc-llvm-x86/libLLVMCodeGen.so.17-bad.xz
*
https://dev.gentoo.org/~sam/bugs/gcc/gcc-llvm-x86/libLLVMCodeGen.so.17-good.xz

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-11-17  5:21 ` sjames at gcc dot gnu.org
@ 2023-11-17  5:23 ` pinskia at gcc dot gnu.org
  2023-11-17  5:28 ` pinskia at gcc dot gnu.org
                   ` (28 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-17  5:23 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |blocker
   Target Milestone|---                         |14.0
                 CC|                            |pinskia at gcc dot gnu.org
           Priority|P3                          |P1
           Keywords|                            |wrong-code

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-11-17  5:23 ` pinskia at gcc dot gnu.org
@ 2023-11-17  5:28 ` pinskia at gcc dot gnu.org
  2023-11-17 10:43 ` jakub at gcc dot gnu.org
                   ` (27 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-17  5:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So the thing to look for the placement of vzeroupper. That is what mode
switching is used for inside the x86 back-end.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-11-17  5:28 ` pinskia at gcc dot gnu.org
@ 2023-11-17 10:43 ` jakub at gcc dot gnu.org
  2023-11-18 10:18 ` sjames at gcc dot gnu.org
                   ` (26 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-11-17 10:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
In any case, it would be useful to narrow it to a single CU, if you know
libLLVMCodeGen.so.17 is bad and have trees built by good vs. bad revision, take
the link line of that library, amend all .o objects with absolute paths to the
good objects in a text file, run that + test, then replace second half of the
paths with the ones to bad objects, etc.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-11-17 10:43 ` jakub at gcc dot gnu.org
@ 2023-11-18 10:18 ` sjames at gcc dot gnu.org
  2023-11-18 10:19 ` sjames at gcc dot gnu.org
                   ` (25 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-18 10:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Sam James <sjames at gcc dot gnu.org> ---
Bringing MLRegallocEvictAdvisor.cpp.o into a good build then relinking
lib/libLLVMCodeGen.so.17 is enough to break it.

Some selected diffs:
```
│  llvm::NextPowerOf2(unsigned long):
│  /home/sam/git/llvm-project/llvm/include/llvm/Support/MathExtras.h:356
│       inc    %rdi
│  unsigned int const& std::max<unsigned int>(unsigned int const&, unsigned int
const&):
│ -/tmp/build-reverted/include/c++/14.0.0/bits/stl_algobase.h:262
│ +/tmp/build/include/c++/14.0.0/bits/stl_algobase.h:262
│       cmp    %eax,%edi
│       cmovb  %eax,%edi
│  llvm::DenseMap<unsigned int, (anonymous namespace)::LIFeatureComponents,
llvm::DenseMapInfo<unsigned int, void>, llvm::detail::DenseMapPair<unsigned
int, (anonymous namespace)::LIFeatureComponents> >::grow
(unsigned int):
│  /home/sam/git/llvm-project/llvm/include/llvm/ADT/DenseMap.h:892
│       mov    %edi,0x18(%rbx)
│  allocateBuckets():
│  /home/sam/git/llvm-project/llvm/include/llvm/ADT/DenseMap.h:899
│ @@ -321,9 +321,9 @@
│  /home/sam/git/llvm-project/llvm/include/llvm/ADT/DenseMap.h:658
(discriminator 3)
│       cmp    %r10d,%edx
│       je     135 <llvm::DenseMap<unsigned int, (anonymous
namespace)::LIFeatureComponents, llvm::DenseMapInfo<unsigned int, void>,
llvm::detail::DenseMapPair<unsigned int, (anonymous namespace)::LIFeatureCo
mponents> >::grow(unsigned int)+0x135>
│       mov    0xc(%rsp),%r15d
│       jmp    199 <llvm::DenseMap<unsigned int, (anonymous
namespace)::LIFeatureComponents, llvm::DenseMapInfo<unsigned int, void>,
llvm::detail::DenseMapPair<unsigned int, (anonymous namespace)::LIFeatureCo
mponents> >::grow(unsigned int)+0x199>
│  initEmpty():
│  /home/sam/git/llvm-project/llvm/include/llvm/ADT/DenseMap.h:658
(discriminator 3)
│ -     call   288 <.LC133>
│ +     call   288 <.LC133+0x8>


```
│  std::unique_ptr<llvm::MachineOperand* [],
std::default_delete<llvm::MachineOperand* []> >::operator[](unsigned long)
const:
│ -/tmp/build-reverted/include/c++/14.0.0/bits/unique_ptr.h:726 (discriminator
4)
│ +/tmp/build/include/c++/14.0.0/bits/unique_ptr.h:726 (discriminator 4)
│       lea    0x0(%rip),%rcx        # 16f7 <(anonymous
namespace)::MLEvictAdvisor::extractFeatures(llvm::SmallVectorImpl<llvm::LiveInterval
const*> const&, llvm::SmallVectorImpl<float>&, unsigned long, long,
 long, float, llvm::SmallVectorImpl<LRStartEndInfo>&) const [clone
.isra.0]+0x16f7>
│   R_X86_64_PC32       .LC78-0x4
│       lea    0x0(%rip),%rdx        # 16fe <(anonymous
namespace)::MLEvictAdvisor::extractFeatures(llvm::SmallVectorImpl<llvm::LiveInterval
const*> const&, llvm::SmallVectorImpl<float>&, unsigned long, long,
 long, float, llvm::SmallVectorImpl<LRStartEndInfo>&) const [clone
.isra.0]+0x16fe>
│   R_X86_64_PC32       .LC79-0x4
│       mov    $0x2d6,%esi
│       lea    0x0(%rip),%rdi        # 170a <(anonymous
namespace)::MLEvictAdvisor::extractFeatures(llvm::SmallVectorImpl<llvm::LiveInterval
const*> const&, llvm::SmallVectorImpl<float>&, unsigned long, long,
 long, float, llvm::SmallVectorImpl<LRStartEndInfo>&) const [clone
.isra.0]+0x170a>
│   R_X86_64_PC32       .LC80-0x4
│ @@ -2665,9 +2665,9 @@
│       vxorps %xmm3,%xmm3,%xmm3
│       shr    %rdx
│       or     %rax,%rdx
│       vcvtsi2ss %rdx,%xmm3,%xmm0
│       vaddss %xmm0,%xmm0,%xmm1
│       jmp    472 <(anonymous
namespace)::MLEvictAdvisor::extractFeatures(llvm::SmallVectorImpl<llvm::LiveInterval
const*> const&, llvm::SmallVectorImpl<float>&, unsigned long, long, long,
float, llvm::Small
VectorImpl<LRStartEndInfo>&) const [clone .isra.0]+0x472>
│       mov    %rax,%rbx
│ -     jmp    1ad0 <.LC100+0x8d8>
│ +     jmp    1ad0 <.LC100+0x8f0>
```

```
│  extractInstructionFeatures(llvm::SmallVectorImpl<LRStartEndInfo>&,
llvm::MLModelRunner*, llvm::function_ref<int (llvm::SlotIndex)>,
llvm::function_ref<float (llvm::SlotIndex)>, llvm::function_ref<llvm::Mac
hineBasicBlock* (llvm::SlotIndex)>, int, int, int, int, llvm::SlotIndex):
│ -/tmp/build-reverted/include/c++/14.0.0/bits/stl_algo.h:1897
│ +/tmp/build/include/c++/14.0.0/bits/stl_algo.h:1897
│       cmp    %rcx,%r12
│  __sort<LRStartEndInfo*,
__gnu_cxx::__ops::_Iter_comp_iter<extractInstructionFeatures(llvm::SmallVectorImpl<LRStartEndInfo>&,
llvm::MLModelRunner*, llvm::function_ref<int(llvm::SlotIndex)>,
llvm::function_r
ef<float(llvm::SlotIndex)>,
llvm::function_ref<llvm::MachineBasicBlock*(llvm::SlotIndex)>, int, int, int,
int, llvm::SlotIndex)::<lambda(LRStartEndInfo, LRStartEndInfo)> > >():
│ -/tmp/build-reverted/include/c++/14.0.0/bits/stl_algo.h:1897
│ +/tmp/build/include/c++/14.0.0/bits/stl_algo.h:1897
│       je     e8
<extractInstructionFeatures(llvm::SmallVectorImpl<LRStartEndInfo>&,
llvm::MLModelRunner*, llvm::function_ref<int (llvm::SlotIndex)>,
llvm::function_ref<float (llvm::SlotIndex)>,
llvm::function_ref<llvm::MachineBasicBlock* (llvm::SlotIndex)>, int, int, int,
int, llvm::SlotIndex)+0xe8>
│ -/tmp/build-reverted/include/c++/14.0.0/bits/stl_algo.h:1900
│ +/tmp/build/include/c++/14.0.0/bits/stl_algo.h:1900
│       mov    %rbx,%rax
│       movabs $0xaaaaaaaaaaaaaaab,%rdx
│ -/tmp/build-reverted/include/c++/14.0.0/bits/stl_algo.h:1899
│ -     mov    %rcx,%rsi
│ +/tmp/build/include/c++/14.0.0/bits/stl_algo.h:1899
│ +     mov    %r15,%rsi
│       mov    %r12,%rdi
│ -/tmp/build-reverted/include/c++/14.0.0/bits/stl_algo.h:1900
│ +/tmp/build/include/c++/14.0.0/bits/stl_algo.h:1900
│       sar    $0x3,%rax
│ -     mov    %rcx,%r15
│       imul   %rdx,%rax
│  long std::__lg<long>(long):
```

```
│  __sort<LRStartEndInfo*,
__gnu_cxx::__ops::_Iter_comp_iter<extractInstructionFeatures(llvm::SmallVectorImpl<LRStartEndInfo>&,
llvm::MLModelRunner*, llvm::function_ref<int(llvm::SlotIndex)>,
llvm::function_ref<float(llvm::SlotIndex)>,
llvm::function_ref<llvm::MachineBasicBlock*(llvm::SlotIndex)>, int, int, int,
int, llvm::SlotIndex)::<lambda(LRStartEndInfo, LRStartEndInfo)> > >():
│ -/tmp/build-reverted/include/c++/14.0.0/bits/stl_algo.h:1899
│ +/tmp/build/include/c++/14.0.0/bits/stl_algo.h:1899
│       add    %rdx,%rdx
│ -     call   a0
<extractInstructionFeatures(llvm::SmallVectorImpl<LRStartEndInfo>&,
llvm::MLModelRunner*, llvm::function_ref<int (llvm::SlotIndex)>,
llvm::function_ref<float (llvm::SlotIndex)>, llvm::functi
on_ref<llvm::MachineBasicBlock* (llvm::SlotIndex)>, int, int, int, int,
llvm::SlotIndex)+0xa0>
│ +     call   9d
<extractInstructionFeatures(llvm::SmallVectorImpl<LRStartEndInfo>&,
llvm::MLModelRunner*, llvm::function_ref<int (llvm::SlotIndex)>,
llvm::function_ref<float (llvm::SlotIndex)>, llvm::functi
on_ref<llvm::MachineBasicBlock* (llvm::SlotIndex)>, int, int, int, int,
llvm::SlotIndex)+0x9d>
│   R_X86_64_PC32      
.text._ZSt16__introsort_loopIP14LRStartEndInfolN9__gnu_cxx5__ops15_Iter_comp_iterIZ26extractInstructionFeaturesRN4llvm15SmallVectorImplIS0_EEPNS5_13MLModelRunnerENS5_12function_refIFiN
S5_9SlotIndexEEEENSB_IFfSC_EEENSB_IFPNS5_17MachineBasicBlockESC_EEEiiiiSC_EUlS0_S0_E_EEEvT_SN_T0_T1_-0x4
│  extractInstructionFeatures(llvm::SmallVectorImpl<LRStartEndInfo>&,
llvm::MLModelRunner*, llvm::function_ref<int (llvm::SlotIndex)>,
llvm::function_ref<float (llvm::SlotIndex)>, llvm::function_ref<llvm::Mac
hineBasicBlock* (llvm::SlotIndex)>, int, int, int, int, llvm::SlotIndex):
```

```
│   R_X86_64_REX_GOTPCRELX      vtable for llvm::RegAllocEvictionAdvisor-0x4
│       vzeroupper
│ -     jmp    7bb <.LC76+0x7b>
│ +     jmp    7bb <.LC76+0x83>
```

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-11-18 10:18 ` sjames at gcc dot gnu.org
@ 2023-11-18 10:19 ` sjames at gcc dot gnu.org
  2023-11-18 10:23 ` sjames at gcc dot gnu.org
                   ` (24 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-18 10:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Sam James <sjames at gcc dot gnu.org> ---
*
https://dev.gentoo.org/~sam/bugs/gcc/gcc-llvm-x86/MLRegallocEvictAdvisor.cpp.o-bad.xz
*
https://dev.gentoo.org/~sam/bugs/gcc/gcc-llvm-x86/MLRegallocEvictAdvisor.cpp.o-good.xz

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2023-11-18 10:19 ` sjames at gcc dot gnu.org
@ 2023-11-18 10:23 ` sjames at gcc dot gnu.org
  2023-11-18 10:58 ` sjames at gcc dot gnu.org
                   ` (23 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-18 10:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Sam James <sjames at gcc dot gnu.org> ---
Created attachment 56629
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56629&action=edit
MLRegallocEvictAdvisor.cpp.ii.xz

Attaching preprocesed sources from:
```
/tmp/build/bin/g++ -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GNU_SOURCE
-D_LIBCPP_ENABLE_HARDENED_MODE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS -I/home/sam/data/build/llvm-project-bad/lib/CodeGen
-I/home/sam/git/llvm-project/llvm/lib/CodeGen
-I/home/sam/data/build/llvm-project-bad/include
-I/home/sam/git/llvm-project/llvm/include -O3 -march=znver2 -ggdb3 -fPIC
-fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time
-fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings
-Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long
-Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull
-Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move
-Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment
-Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color
-ffunction-sections -fdata-sections -O2 -g -DNDEBUG -std=c++17 -fPIC -UNDEBUG
-MD -MT lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MLRegallocEvictAdvisor.cpp.o -MF
lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MLRegallocEvictAdvisor.cpp.o.d -o
lib/CodeGen/CMakeFiles/LLVMCodeGen.dir/MLRegallocEvictAdvisor.cpp.o -c
/home/sam/git/llvm-project/llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp
-save-temps
```

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2023-11-18 10:23 ` sjames at gcc dot gnu.org
@ 2023-11-18 10:58 ` sjames at gcc dot gnu.org
  2023-11-18 10:59 ` sjames at gcc dot gnu.org
                   ` (22 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-18 10:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Sam James <sjames at gcc dot gnu.org> ---
The first pass to differ is expand.

Some selected diffs:
```
void llvm::cl::opt<std::__cxx11::basic_string<char> >::~opt (struct opt * const
this)
{
  bool [-(*<T8480>)-]{+(*<T8488>)+} (union _Any_data & {ref-all}, const union
_Any_data & {ref-all}, _Manager_operation) _15;
  union _Any_data * {ref-all} _16;
  char * _17;
  const char[16] * _18;
@@ -71879,7 +71879,7 @@ _32 replace with --> _32 = _31 + 1;

void llvm::cl::opt<std::__cxx11::basic_string<char> >::~opt (struct opt * const
this)
{
  bool [-(*<T8480>)-]{+(*<T8488>)+} (union _Any_data & {ref-all}, const union
_Any_data & {ref-all}, _Manager_operation) _15;
  union _Any_data * {ref-all} _16;
  char * _17;
  const char[16] * _18;
@@ -72195,14 +72195,14 @@ void llvm::cl::opt<std::__cxx11::basic_string<char>
>::~opt (struct opt * const
```

```
@@ -205739,7 +205739,7 @@ void llvm::cl::opt<std::__cxx11::basic_string<char>
>::opt<char [40], llvm::cl::
  long unsigned int _73;
  long unsigned int _74;
  void * _75;
  bool [-(*<T8480>)-]{+(*<T8488>)+} (union _Any_data & {ref-all}, const union
_Any_data & {ref-all}, _Manager_operation) _77;
  union _Any_data * {ref-all} _78;
  unsigned long _79;
  struct basic_string * _80;
@@ -206849,7 +206849,7 @@ void llvm::cl::opt<std::__cxx11::basic_string<char>
>::opt<char [40], llvm::cl::
  long unsigned int _73;
  long unsigned int _74;
  void * _75;
  bool [-(*<T8480>)-]{+(*<T8488>)+} (union _Any_data & {ref-all}, const union
_Any_data & {ref-all}, _Manager_operation) _77;
  union _Any_data * {ref-all} _78;
  unsigned long _79;
  struct basic_string * _80;
```

```
{
  bool [-(*<T8480>)-]{+(*<T8488>)+} (union _Any_data & {ref-all}, const union
_Any_data & {ref-all}, _Manager_operation) _12;
  union _Any_data * {ref-all} _13;
  char * _14;
  const char[16] * _15;
@@ -427838,7 +427838,7 @@ _29 replace with --> _29 = _28 + 1;

void llvm::cl::opt<std::__cxx11::basic_string<char> >::~opt (struct opt * const
this)
{
  bool [-(*<T8480>)-]{+(*<T8488>)+} (union _Any_data & {ref-all}, const union
_Any_data & {ref-all}, _Manager_operation) _12;
  union _Any_data * {ref-all} _13;
  char * _14;
  const char[16] * _15;
```

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2023-11-18 10:58 ` sjames at gcc dot gnu.org
@ 2023-11-18 10:59 ` sjames at gcc dot gnu.org
  2023-11-18 11:00 ` sjames at gcc dot gnu.org
                   ` (21 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-18 10:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Sam James <sjames at gcc dot gnu.org> ---
Created attachment 56630
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56630&action=edit
MLRegallocEvictAdvisor.cpp.cpp.262r.expand-bad.xz

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2023-11-18 10:59 ` sjames at gcc dot gnu.org
@ 2023-11-18 11:00 ` sjames at gcc dot gnu.org
  2023-11-18 11:11 ` jakub at gcc dot gnu.org
                   ` (20 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-18 11:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Sam James <sjames at gcc dot gnu.org> ---
Created attachment 56631
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=56631&action=edit
MLRegallocEvictAdvisor.cpp.cpp.262r.expand-good.xz

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2023-11-18 11:00 ` sjames at gcc dot gnu.org
@ 2023-11-18 11:11 ` jakub at gcc dot gnu.org
  2023-11-18 11:36 ` sjames at gcc dot gnu.org
                   ` (19 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-11-18 11:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Try to use optimize (0) attribute or corresponding pragma on some functions in
that file (just those where bad vs. good results in different code generation)
to find out which one is problematic?

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2023-11-18 11:11 ` jakub at gcc dot gnu.org
@ 2023-11-18 11:36 ` sjames at gcc dot gnu.org
  2023-11-18 21:00 ` pinskia at gcc dot gnu.org
                   ` (18 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-18 11:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Sam James <sjames at gcc dot gnu.org> ---
Looks like it's extractInstructionFeatures
(https://github.com/llvm/llvm-project/blob/llvmorg-17.0.5/llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp#L943).

Adding __attribute__((optimize("O0"))) to it makes the test pass.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (15 preceding siblings ...)
  2023-11-18 11:36 ` sjames at gcc dot gnu.org
@ 2023-11-18 21:00 ` pinskia at gcc dot gnu.org
  2023-11-18 21:13 ` pinskia at gcc dot gnu.org
                   ` (17 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-18 21:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note using -fdump-unnumbered might help to avoid dumping memory addresses that
were from memory addresses inside gcc itself.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (16 preceding siblings ...)
  2023-11-18 21:00 ` pinskia at gcc dot gnu.org
@ 2023-11-18 21:13 ` pinskia at gcc dot gnu.org
  2023-11-18 21:28 ` pinskia at gcc dot gnu.org
                   ` (16 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-18 21:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
It looks like another pass after vzeroupper depends on REG_DEAD/REG_UNUSED to
be correct but a different pass before that pass messes it up ...
I am still trying to figure out which pass is making the bad change.
Note vzeroupper does seems to be the same/correct but the updated
REG_DEAD/REG_UNUSED notes mess up the passes afterwards ...

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (17 preceding siblings ...)
  2023-11-18 21:13 ` pinskia at gcc dot gnu.org
@ 2023-11-18 21:28 ` pinskia at gcc dot gnu.org
  2023-11-18 21:38 ` slyfox at gcc dot gnu.org
                   ` (15 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-18 21:28 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-11-18
             Status|UNCONFIRMED                 |NEW

--- Comment #18 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This fixes the issue for me:
```
diff --git a/gcc/compare-elim.cc b/gcc/compare-elim.cc
index c59dc0cf5a5..50424bdfa09 100644
--- a/gcc/compare-elim.cc
+++ b/gcc/compare-elim.cc
@@ -908,6 +908,7 @@ static unsigned int
 execute_compare_elim_after_reload (void)
 {
   df_set_flags (DF_LR_RUN_DCE);
+  df_note_add_problem ();
   df_analyze ();

   gcc_checking_assert (!all_compares.exists ());

```

compare-elim.cc depends on up to date REG_UNUSED and between before vzeroupper
and cmpelim the note gets out of date.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (18 preceding siblings ...)
  2023-11-18 21:28 ` pinskia at gcc dot gnu.org
@ 2023-11-18 21:38 ` slyfox at gcc dot gnu.org
  2023-11-18 21:55 ` pinskia at gcc dot gnu.org
                   ` (14 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: slyfox at gcc dot gnu.org @ 2023-11-18 21:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
I spent some time poking at the bug and was not able to reproduce it on my
toolchain.

I was able to get it to fail on gentoo's toolchain and arrived at problems in
lib/Target/X86/X86InterleavedAccess.cpp. My theory is that
X86InterleavedAccessGroup::decompose() gets compiled incorrectly.

`-fPIE` seems to be the flag that triggers gcc to generate slightly incorrect
prologue (wrong register is being used). I filed a separate issue in case it's
an invalid manual reduction: https://gcc.gnu.org/PR112613

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (19 preceding siblings ...)
  2023-11-18 21:38 ` slyfox at gcc dot gnu.org
@ 2023-11-18 21:55 ` pinskia at gcc dot gnu.org
  2023-11-18 22:22 ` pinskia at gcc dot gnu.org
                   ` (13 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-18 21:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #20 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #18)
> compare-elim.cc depends on up to date REG_UNUSED and between before
> vzeroupper and cmpelim the note gets out of date.

Note it depends on it indirectly via single_set in fact any pass that uses
single_set will depends on the REG_UNUSED notes to be up to date.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (20 preceding siblings ...)
  2023-11-18 21:55 ` pinskia at gcc dot gnu.org
@ 2023-11-18 22:22 ` pinskia at gcc dot gnu.org
  2023-11-18 22:39 ` pinskia at gcc dot gnu.org
                   ` (12 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-18 22:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #21 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
So originally we had in vzeroupper:
```
(insn # # # 2 (set (reg/f:DI 43 r15 [orig:126 _84 ] [126])
        (reg/f:DI 2 cx [orig:126 _84 ] [126]))
"/home/sam/git/llvm-project/llvm/include/llvm/ADT/SmallVector.h":272:42 discrim
2# {*movdi_internal}
     (expr_list:REG_UNUSED (reg/f:DI 43 r15 [orig:126 _84 ] [126])
        (nil)))
(insn # # # 2 (set (reg/f:DI 43 r15 [orig:126 _84 ] [126])
        (reg/f:DI 2 cx [orig:126 _84 ] [126]))
"/tmp/build/include/c++/14.0.0/bits/stl_algo.h":1897:7# {*movdi_internal}
     (expr_list:REG_DEAD (reg/f:DI 2 cx [orig:126 _84 ] [126])
        (nil)))
```
And then in postreload we changed it to just:
```
(insn # # # 2 (set (reg/f:DI 43 r15 [orig:126 _84 ] [126])
        (reg/f:DI 2 cx [orig:126 _84 ] [126]))
"/home/sam/git/llvm-project/llvm/include/llvm/ADT/SmallVector.h":272:42 discrim
2# {*movdi_internal}
     (expr_list:REG_UNUSED (reg/f:DI 43 r15 [orig:126 _84 ] [126])
        (nil)))
```
Without updating the REG notes there. I suspect if we moved vzeroupper after
postreload it would also just had worked. reload/LRA looks like it likes to
generate extra moves that do the same thing ...
Moving vzeroupper after postreload will also reduce memory and compile time due
to less REG_DEAD/REG_UNUSED being generated ...

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (21 preceding siblings ...)
  2023-11-18 22:22 ` pinskia at gcc dot gnu.org
@ 2023-11-18 22:39 ` pinskia at gcc dot gnu.org
  2023-11-18 23:06 ` rsandifo at gcc dot gnu.org
                   ` (11 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-18 22:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #22 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 112613 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (22 preceding siblings ...)
  2023-11-18 22:39 ` pinskia at gcc dot gnu.org
@ 2023-11-18 23:06 ` rsandifo at gcc dot gnu.org
  2023-11-18 23:39 ` pinskia at gcc dot gnu.org
                   ` (10 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: rsandifo at gcc dot gnu.org @ 2023-11-18 23:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #23 from Richard Sandiford <rsandifo at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #18)
> compare-elim.cc depends on up to date REG_UNUSED and between before
> vzeroupper and cmpelim the note gets out of date.
Thanks for tracking it down.

I can't find this written down from a quick search, so perhaps I'm
misremembering, but I thought that REG_UNUSED notes had to be kept
up to date.  Only REG_DEAD ones are allowed to rot.  Like you say,
single_set is used all over the place, and is expected to be safe.

If so, I guess it's postreload that should be fixed.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (23 preceding siblings ...)
  2023-11-18 23:06 ` rsandifo at gcc dot gnu.org
@ 2023-11-18 23:39 ` pinskia at gcc dot gnu.org
  2023-11-19  7:21 ` pinskia at gcc dot gnu.org
                   ` (9 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-18 23:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #24 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Sandiford from comment #23)
> (In reply to Andrew Pinski from comment #18)
> > compare-elim.cc depends on up to date REG_UNUSED and between before
> > vzeroupper and cmpelim the note gets out of date.
> Thanks for tracking it down.
> 
> I can't find this written down from a quick search, so perhaps I'm
> misremembering, but I thought that REG_UNUSED notes had to be kept
> up to date.  Only REG_DEAD ones are allowed to rot.  Like you say,
> single_set is used all over the place, and is expected to be safe.
> 
> If so, I guess it's postreload that should be fixed.

Eric B. mentioned back in 2011, neither REG_DEAD nor REG_UNUSED needs to be
kept up to date:
https://gcc.gnu.org/pipermail/gcc-patches/2011-October/326733.html
Also see PR 48773 where he mentioned the same.
He mentioned the same thing again in 2018 even:
https://gcc.gnu.org/pipermail/gcc-patches/2018-October/508057.html


Though you mentioned the opposite here:
https://gcc.gnu.org/pipermail/gcc-patches/2023-October/634121.html

Though I wonder if this is all a mess due to single_set indirectly using them
which has been there since before 2000 (and before df was added).

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (24 preceding siblings ...)
  2023-11-18 23:39 ` pinskia at gcc dot gnu.org
@ 2023-11-19  7:21 ` pinskia at gcc dot gnu.org
  2023-11-19  9:24 ` ebotcazou at gcc dot gnu.org
                   ` (8 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-19  7:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #25 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 112568 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (25 preceding siblings ...)
  2023-11-19  7:21 ` pinskia at gcc dot gnu.org
@ 2023-11-19  9:24 ` ebotcazou at gcc dot gnu.org
  2023-11-19  9:42 ` sjames at gcc dot gnu.org
                   ` (7 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: ebotcazou at gcc dot gnu.org @ 2023-11-19  9:24 UTC (permalink / raw)
  To: gcc-bugs

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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu.org

--- Comment #26 from Eric Botcazou <ebotcazou at gcc dot gnu.org> ---
> Eric B. mentioned back in 2011, neither REG_DEAD nor REG_UNUSED needs to be
> kept up to date:
> https://gcc.gnu.org/pipermail/gcc-patches/2011-October/326733.html
> Also see PR 48773 where he mentioned the same.
> He mentioned the same thing again in 2018 even:
> https://gcc.gnu.org/pipermail/gcc-patches/2018-October/508057.html

REG_DEAD and REG_UNUSED notes are recomputed by DF so they do not need to be
maintained explicitly (although you may do it of course).  REG_EQUAL and
REG_EQUIV notes are not recomputed by DF so they need to maintained explicitly.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (26 preceding siblings ...)
  2023-11-19  9:24 ` ebotcazou at gcc dot gnu.org
@ 2023-11-19  9:42 ` sjames at gcc dot gnu.org
  2023-11-30 21:09 ` jakub at gcc dot gnu.org
                   ` (6 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-19  9:42 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #27 from Sam James <sjames at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #18)
> This fixes the issue for me:
> ```
> diff --git a/gcc/compare-elim.cc b/gcc/compare-elim.cc
> [...]

This solves both pipewire (unreported, was working on reducing it; found it
needed -fstack-protector-strong and I think PIE) and LLVM failures. Thank you
Andrew & thanks Sergei for looking at it too.

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112613#c3 is an interesting
comment wrt checking. Is that feasible?

It would be nice if this was catchable with --enable-checking=rtl or
--enable-checking=df (I don't test with this regularly, but it would've been
helpful after seeing the bisect result), especially given there's some clear
(possible) misuse.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (27 preceding siblings ...)
  2023-11-19  9:42 ` sjames at gcc dot gnu.org
@ 2023-11-30 21:09 ` jakub at gcc dot gnu.org
  2023-11-30 21:12 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-11-30 21:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #28 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
So, what is the state here?  Andrew, are you going to post the #c18 patch?
Do we have a reduced testcase?

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (28 preceding siblings ...)
  2023-11-30 21:09 ` jakub at gcc dot gnu.org
@ 2023-11-30 21:12 ` pinskia at gcc dot gnu.org
  2023-11-30 22:29 ` sjames at gcc dot gnu.org
                   ` (4 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-11-30 21:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #29 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #28)
> So, what is the state here?  Andrew, are you going to post the #c18 patch?
> Do we have a reduced testcase?

I was hoping someone else would take over since there seems to be a
disagreement of if the bug is in compare-elim or in postreload pass.

As far as a reduced testcase, I don't think we have one.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (29 preceding siblings ...)
  2023-11-30 21:12 ` pinskia at gcc dot gnu.org
@ 2023-11-30 22:29 ` sjames at gcc dot gnu.org
  2023-12-04  2:49 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-11-30 22:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #30 from Sam James <sjames at gcc dot gnu.org> ---
afaik the best we have so far is
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112613#c0

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (30 preceding siblings ...)
  2023-11-30 22:29 ` sjames at gcc dot gnu.org
@ 2023-12-04  2:49 ` pinskia at gcc dot gnu.org
  2023-12-04 11:01 ` sjames at gcc dot gnu.org
                   ` (2 subsequent siblings)
  34 siblings, 0 replies; 36+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-04  2:49 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=40209

--- Comment #31 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=40209#c5 (and other comments
there about single_use). This definitely has been a latent issue with
single_use for a long time now too ...

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (31 preceding siblings ...)
  2023-12-04  2:49 ` pinskia at gcc dot gnu.org
@ 2023-12-04 11:01 ` sjames at gcc dot gnu.org
  2023-12-06  9:02 ` jakub at gcc dot gnu.org
  2023-12-06 18:32 ` pinskia at gcc dot gnu.org
  34 siblings, 0 replies; 36+ messages in thread
From: sjames at gcc dot gnu.org @ 2023-12-04 11:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #32 from Sam James <sjames at gcc dot gnu.org> ---
(In reply to Sam James from comment #30)
> afaik the best we have so far is
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112613#c0

we also know that pipewire fails a test (test-filter) when built for -m32, but
I haven't reduced it. it's way smaller than llvm though and C.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (32 preceding siblings ...)
  2023-12-04 11:01 ` sjames at gcc dot gnu.org
@ 2023-12-06  9:02 ` jakub at gcc dot gnu.org
  2023-12-06 18:32 ` pinskia at gcc dot gnu.org
  34 siblings, 0 replies; 36+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-12-06  9:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #33 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This should be now hopefully latent after
r14-6210-ge44ed92dbbe9d4e5c23f486cd2f77a6f9ee513c5, we need to decide about the
updating and usability of REG_UNUSED notes, but after moving the pass it
shouldn't trigger on this testcase.

^ permalink raw reply	[flat|nested] 36+ messages in thread

* [Bug middle-end/112572] [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1
  2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
                   ` (33 preceding siblings ...)
  2023-12-06  9:02 ` jakub at gcc dot gnu.org
@ 2023-12-06 18:32 ` pinskia at gcc dot gnu.org
  34 siblings, 0 replies; 36+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-12-06 18:32 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #34 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #33)
> This should be now hopefully latent after
> r14-6210-ge44ed92dbbe9d4e5c23f486cd2f77a6f9ee513c5, we need to decide about
> the updating and usability of REG_UNUSED notes, but after moving the pass it
> shouldn't trigger on this testcase.

Which case this becomes a dup of bug 40209 which is tracking the single_set
usage issue (and has for a long time).

*** This bug has been marked as a duplicate of bug 40209 ***

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2023-12-06 18:32 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-16 20:06 [Bug middle-end/112572] New: [14 regression] LLVM miscompiled since r14-5355-g3cd3a09b3f91a1 sjames at gcc dot gnu.org
2023-11-17  0:00 ` [Bug middle-end/112572] " sjames at gcc dot gnu.org
2023-11-17  0:41 ` sjames at gcc dot gnu.org
2023-11-17  4:13 ` sjames at gcc dot gnu.org
2023-11-17  4:14 ` sjames at gcc dot gnu.org
2023-11-17  5:21 ` sjames at gcc dot gnu.org
2023-11-17  5:23 ` pinskia at gcc dot gnu.org
2023-11-17  5:28 ` pinskia at gcc dot gnu.org
2023-11-17 10:43 ` jakub at gcc dot gnu.org
2023-11-18 10:18 ` sjames at gcc dot gnu.org
2023-11-18 10:19 ` sjames at gcc dot gnu.org
2023-11-18 10:23 ` sjames at gcc dot gnu.org
2023-11-18 10:58 ` sjames at gcc dot gnu.org
2023-11-18 10:59 ` sjames at gcc dot gnu.org
2023-11-18 11:00 ` sjames at gcc dot gnu.org
2023-11-18 11:11 ` jakub at gcc dot gnu.org
2023-11-18 11:36 ` sjames at gcc dot gnu.org
2023-11-18 21:00 ` pinskia at gcc dot gnu.org
2023-11-18 21:13 ` pinskia at gcc dot gnu.org
2023-11-18 21:28 ` pinskia at gcc dot gnu.org
2023-11-18 21:38 ` slyfox at gcc dot gnu.org
2023-11-18 21:55 ` pinskia at gcc dot gnu.org
2023-11-18 22:22 ` pinskia at gcc dot gnu.org
2023-11-18 22:39 ` pinskia at gcc dot gnu.org
2023-11-18 23:06 ` rsandifo at gcc dot gnu.org
2023-11-18 23:39 ` pinskia at gcc dot gnu.org
2023-11-19  7:21 ` pinskia at gcc dot gnu.org
2023-11-19  9:24 ` ebotcazou at gcc dot gnu.org
2023-11-19  9:42 ` sjames at gcc dot gnu.org
2023-11-30 21:09 ` jakub at gcc dot gnu.org
2023-11-30 21:12 ` pinskia at gcc dot gnu.org
2023-11-30 22:29 ` sjames at gcc dot gnu.org
2023-12-04  2:49 ` pinskia at gcc dot gnu.org
2023-12-04 11:01 ` sjames at gcc dot gnu.org
2023-12-06  9:02 ` jakub at gcc dot gnu.org
2023-12-06 18:32 ` pinskia at gcc dot gnu.org

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).