https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122270
Bug ID: 122270
Summary: riscv: during GIMPLE pass: internal compiler error: in
gsi_replace, at gimple-iterator.cc:438
Product: gcc
Version: 15.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: vhaudiquet343 at hotmail dot fr
Target Milestone: ---
When using GCC to build pytorch
(https://launchpad.net/ubuntu/+source/pytorch/2.6.0+dfsg-9/+build/31323165):
FAILED:
caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/cpu/DepthwiseConvKernel.cpp.DEFAULT.cpp.o
/usr/bin/c++ -DAT_PER_OPERATOR_HEADERS -DCAFFE2_BUILD_MAIN_LIB
-DFLASHATTENTION_DISABLE_ALIBI -DFMT_HEADER_ONLY=1 -DHAVE_MALLOC_USABLE_SIZE=1
-DHAVE_MMAP=1 -DHAVE_SHM_OPEN=1 -DHAVE_SHM_UNLINK=1
-DMINIZ_DISABLE_ZIP_READER_CRC32_CHECKS -DONNXIFI_ENABLE_EXT=1 -DONNX_ML=1
-DONNX_NAMESPACE=onnx -DTORCH_ENABLE_LLVM -DUSE_C10D_GLOO -DUSE_C10D_MPI
-DUSE_DISTRIBUTED -DUSE_EXTERNAL_MZCRC -DUSE_RPC -DUSE_TENSORPIPE
-D_FILE_OFFSET_BITS=64 -Dtorch_cpu_EXPORTS
-I/build/reproducible-path/pytorch-2.6.0+dfsg/build/aten/src
-I/build/reproducible-path/pytorch-2.6.0+dfsg/aten/src
-I/build/reproducible-path/pytorch-2.6.0+dfsg/build
-I/build/reproducible-path/pytorch-2.6.0+dfsg
-I/build/reproducible-path/pytorch-2.6.0+dfsg/cmake/../third_party/benchmark/include
-I/usr/lib/llvm-19/include
-I/build/reproducible-path/pytorch-2.6.0+dfsg/nlohmann
-I/build/reproducible-path/pytorch-2.6.0+dfsg/torch/csrc/api
-I/build/reproducible-path/pytorch-2.6.0+dfsg/torch/csrc/api/include
-I/build/reproducible-path/pytorch-2.6.0+dfsg/caffe2/aten/src/TH
-I/build/reproducible-path/pytorch-2.6.0+dfsg/build/caffe2/aten/src/TH
-I/build/reproducible-path/pytorch-2.6.0+dfsg/build/caffe2/aten/src
-I/build/reproducible-path/pytorch-2.6.0+dfsg/build/caffe2/../aten/src
-I/build/reproducible-path/pytorch-2.6.0+dfsg/torch/csrc
-I/build/reproducible-path/pytorch-2.6.0+dfsg/third_party/miniz-3.0.2
-I/build/reproducible-path/pytorch-2.6.0+dfsg/debian/kineto/libkineto/include
-I/build/reproducible-path/pytorch-2.6.0+dfsg/debian/kineto/libkineto/src
-I/build/reproducible-path/pytorch-2.6.0+dfsg/third_party/cpp-httplib
-I/build/reproducible-path/pytorch-2.6.0+dfsg/build/vulkan
-I/build/reproducible-path/pytorch-2.6.0+dfsg/aten/../third_party/VulkanMemoryAllocator
-I/build/reproducible-path/pytorch-2.6.0+dfsg/aten/src/ATen/..
-I/build/reproducible-path/pytorch-2.6.0+dfsg/c10/..
-I/build/reproducible-path/pytorch-2.6.0+dfsg/third_party/flatbuffers/include
-isystem
/build/reproducible-path/pytorch-2.6.0+dfsg/cmake/../third_party/googletest/googlemock/include
-isystem
/build/reproducible-path/pytorch-2.6.0+dfsg/cmake/../third_party/googletest/googletest/include
-isystem /usr/include/eigen3 -isystem
/build/reproducible-path/pytorch-2.6.0+dfsg/INTERFACE -isystem
/build/reproducible-path/pytorch-2.6.0+dfsg/third_party/nlohmann/include
-isystem /build/reproducible-path/pytorch-2.6.0+dfsg/caffe2 -isystem
/usr/lib/riscv64-linux-gnu/openmpi/include -isystem
/usr/lib/riscv64-linux-gnu/openmpi/include/openmpi -Wdate-time
-D_FORTIFY_SOURCE=3 -g -O2 -fno-omit-frame-pointer
-ffile-prefix-map=/build/reproducible-path/pytorch-2.6.0+dfsg=.
-fstack-protector-strong -Wformat -Werror=format-security
-fno-stack-clash-protection
-fdebug-prefix-map=/build/reproducible-path/pytorch-2.6.0+dfsg=/usr/src/pytorch-2.6.0+dfsg-9
-gsplit-dwarf -Wno-dangling-reference -I/usr -D_GLIBCXX_USE_CXX11_ABI=1
-fvisibility-inlines-hidden -DUSE_KINETO -DLIBKINETO_NOCUPTI
-DLIBKINETO_NOROCTRACER -DLIBKINETO_NOXPUPTI=ON -DUSE_VULKAN -DUSE_VULKAN_API
-DSYMBOLICATE_MOBILE_DEBUG_HANDLE -O2 -fPIC -Wall -Wextra -Werror=return-type
-Werror=non-virtual-dtor -Werror=range-loop-construct -Werror=bool-operation
-Wnarrowing -Wno-missing-field-initializers -Wno-type-limits -Wno-array-bounds
-Wno-unknown-pragmas -Wno-unused-parameter -Wno-strict-overflow
-Wno-strict-aliasing -Wno-stringop-overflow -Wsuggest-override -Wno-psabi
-Wno-error=old-style-cast -Wno-missing-braces -fdiagnostics-color=always
-faligned-new -Wno-unused-but-set-variable -Wno-maybe-uninitialized
-fno-math-errno -fno-trapping-math -Werror=format -Wno-error=dangling-reference
-Wno-error=redundant-move -Wno-stringop-overflow -O2 -g -DNDEBUG -std=gnu++17
-fPIC -DTORCH_USE_LIBUV -DCAFFE2_USE_GLOO -Wall -Wextra -Wdeprecated
-Wno-unused-parameter -Wno-missing-field-initializers -Wno-array-bounds
-Wno-unknown-pragmas -Wno-strict-overflow -Wno-strict-aliasing
-Wunused-function -Wunused-variable -Wunused-but-set-variable
-Wno-maybe-uninitialized -fvisibility=hidden -O2 -fopenmp -O3
-DCPU_CAPABILITY=DEFAULT -DCPU_CAPABILITY_DEFAULT -MD -MT
caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/cpu/DepthwiseConvKernel.cpp.DEFAULT.cpp.o
-MF
caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/cpu/DepthwiseConvKernel.cpp.DEFAULT.cpp.o.d
-o
caffe2/CMakeFiles/torch_cpu.dir/__/aten/src/ATen/native/cpu/DepthwiseConvKernel.cpp.DEFAULT.cpp.o
-c
/build/reproducible-path/pytorch-2.6.0+dfsg/build/aten/src/ATen/native/cpu/DepthwiseConvKernel.cpp.DEFAULT.cpp
during GIMPLE pass: lower
In file included from
/build/reproducible-path/pytorch-2.6.0+dfsg/build/aten/src/ATen/native/cpu/DepthwiseConvKernel.cpp.DEFAULT.cpp:1:
/build/reproducible-path/pytorch-2.6.0+dfsg/aten/src/ATen/native/cpu/DepthwiseConvKernel.cpp:
In function ‘void
at::native::{anonymous}::winograd_f2k3_kernel_transform__rvv(vfloat32m1_t,
vfloat32m1_t, vfloat32m1_t, vfloat32m1x4_t*)’:
/build/reproducible-path/pytorch-2.6.0+dfsg/aten/src/ATen/native/cpu/DepthwiseConvKernel.cpp:307:44:
internal compiler error: in gsi_replace, at gimple-iterator.cc:438
307 | *transform = __riscv_vset_v_f32m1_f32m1x4(*transform, 3, g2);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
0x238f2c9 diagnostic_context::diagnostic_impl(rich_location*,
diagnostic_metadata const*, diagnostic_option_id, char const*, void**,
diagnostic_t)
???:0
0x239bfcb internal_error(char const*, ...)
???:0
0x6781cd fancy_abort(char const*, int, char const*)
???:0
0xa47005 gsi_replace(gimple_stmt_iterator*, gimple*, bool)
???:0
0x1046305 riscv_gimple_fold_builtin(gimple_stmt_iterator*)
???:0
See preprocessed source attached, or build link for full build log.