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

--- Comment #3 from Sergei Trofimovich <slyfox at gcc dot gnu.org> ---
The clues:

1. I bisected gcc down to

  commit 2460f7cdef7ef9c971de79271afc0db73687a272
  Author: Aldy Hernandez <al...@redhat.com>
  Date:   Fri Sep 23 19:47:33 2022 +0200

    Set ranges from unreachable edges for all known ranges.

But I suspect it's not the culprit and only a trigger in inliner behaviour
change.

2. The bug is probably somewhere in mis-compilation of
llvm/lib/Target/RISCV/RISCVISelLowering.cpp. The following workaround repairs
the test:

--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -1,3 +1,4 @@
+#pragma GCC optimize(0)
 //===-- RISCVISelLowering.cpp - RISCV DAG Lowering Implementation 
--------===//
 //
 // Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.

$ timeout 10 bin/llc -mtriple=riscv32 -target-abi=ilp32d
-mattr=+v,+zfh,+experimental-zvfh,+f,+d -riscv-v-vector-bits-min=128
-riscv-v-fixed-length-vector-lmul-max=1 -verify-machineinstrs ./bug.ll && echo
FINISHED || echo TIMED OUT
'+experimental-zvfh' is not a recognized feature for this target (ignoring
feature)
'+experimental-zvfh' is not a recognized feature for this target (ignoring
feature)
'+experimental-zvfh' is not a recognized feature for this target (ignoring
feature)
FINISHED

3. It looks like using '-O2 --param=max-inline-insns-single=116' (instead of
-O3) against llvm/lib/Target/RISCV/RISCVISelLowering.cpp is enough to trigger
the bug. '-O2 --param=max-inline-insns-single=115' sees to work.

Reply via email to