Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7952 Discussions

icx error: ICE at -O1/2/3/s since icx-2023.1.0

Junwei_Zeng
Beginner
819 Views

Hi,

I used icx to compile the following code at -O1/2/3/s, and an internal compiler error (ICE) occurred. I found this bug was introduced starting from "x86-64 icx-2023.1.0".

Compiler explorer: https://godbolt.org/z/Ge593daPW

The bug code test.c is following:

 

int a;
int b[][4];
void c() {
  int *d;
  a = 0;
  for (; a; a++)
    d = &b[a + 5][a];
  d == c;
}

 

Below is the compilation command I used and the error message output by the compilation.

 

$ icx test.c -O1 -save-temps -v
Intel(R) oneAPI DPC++/C++ Compiler 2023.2.0 (2023.2.0.20230622)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm
Configuration file: /opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/../bin/icx.cfg
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/9
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/10
Candidate multilib: .;@m64
Selected multilib: .;@m64
 "/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang" -cc1 -triple x86_64-unknown-linux-gnu -E -save-temps=cwd -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name test.c -mrelocation-model static -fveclib=SVML -mframe-pointer=none -menable-no-infs -menable-no-nans -fapprox-func -funsafe-math-optimizations -fno-signed-zeros -mreassociate -freciprocal-math -fdenormal-fp-math=preserve-sign,preserve-sign -ffp-contract=fast -fno-rounding-math -ffast-math -ffinite-math-only -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -mllvm -x86-enable-unaligned-vector-move=true -tune-cpu generic -debugger-tuning=gdb -v -fcoverage-compilation-dir=/home/jwzeng/workplace/compiler_testing/scripts/testing-20231011-100s9csmith-v3-ubuntu/result/icx/compfail/S_3397553276/reduce -resource-dir /opt/intel/oneapi/compiler/2023.2.0/linux/lib/clang/17 -internal-isystem /opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/../compiler/include -internal-isystem /opt/intel/oneapi/compiler/2023.2.0/linux/lib/clang/17/include -internal-isystem /usr/local/include -internal-isystem /usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include -internal-externc-isystem /usr/include/x86_64-linux-gnu -internal-externc-isystem /include -internal-externc-isystem /usr/include -O1 -fdebug-compilation-dir=/home/jwzeng/workplace/compiler_testing/scripts/testing-20231011-100s9csmith-v3-ubuntu/result/icx/compfail/S_3397553276/reduce -ferror-limit 19 -fheinous-gnu-extensions -fgnuc-version=4.2.1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -fintel-compatibility -fintel-libirc-allowed -mllvm -disable-hir-generate-mkl-call -mllvm -loopopt=1 -floopopt-pipeline=light -mllvm -intel-abi-compatible=true -o test.i -x c test.c
clang -cc1 version 17.0.0 based upon LLVM 17.0.0git default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/10/../../../../x86_64-linux-gnu/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
 /opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/../compiler/include
 /opt/intel/oneapi/compiler/2023.2.0/linux/lib/clang/17/include
 /usr/local/include
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
 "/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang" -cc1 -triple x86_64-unknown-linux-gnu -S -save-temps=cwd -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name test.c -mrelocation-model static -fveclib=SVML -mframe-pointer=none -menable-no-infs -menable-no-nans -fapprox-func -funsafe-math-optimizations -fno-signed-zeros -mreassociate -freciprocal-math -fdenormal-fp-math=preserve-sign,preserve-sign -ffp-contract=fast -fno-rounding-math -ffast-math -ffinite-math-only -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -mllvm -x86-enable-unaligned-vector-move=true -tune-cpu generic -debugger-tuning=gdb -v -fcoverage-compilation-dir=/home/jwzeng/workplace/compiler_testing/scripts/testing-20231011-100s9csmith-v3-ubuntu/result/icx/compfail/S_3397553276/reduce -resource-dir /opt/intel/oneapi/compiler/2023.2.0/linux/lib/clang/17 -O1 -fdebug-compilation-dir=/home/jwzeng/workplace/compiler_testing/scripts/testing-20231011-100s9csmith-v3-ubuntu/result/icx/compfail/S_3397553276/reduce -ferror-limit 19 -fheinous-gnu-extensions -fgnuc-version=4.2.1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -fintel-compatibility -fintel-libirc-allowed -mllvm -disable-hir-generate-mkl-call -mllvm -loopopt=1 -floopopt-pipeline=light -mllvm -intel-abi-compatible=true -o test.s -x cpp-output test.i
clang -cc1 version 17.0.0 based upon LLVM 17.0.0git default target x86_64-unknown-linux-gnu
#include "..." search starts here:
End of search list.
test.c:8:5: warning: comparison of distinct pointer types ('int *' and 'void (*)()') [-Wcompare-distinct-pointer-types]
  d == c;
  ~ ^  ~
test.c:8:5: warning: equality comparison result unused [-Wunused-comparison]
  d == c;
  ~~^~~~
test.c:8:5: note: use '=' to turn this equality comparison into an assignment
  d == c;
    ^~
    =
test.c:2:5: warning: tentative array definition assumed to have one element
int b[][4];
    ^
PLEASE append the compiler options "-save-temps -v", rebuild the application to to get the full command which is failing and submit a bug report to https://software.intel.com/en-us/support/priority-support which includes the failing command, input files for the command and the crash backtrace (if any).
Stack dump:
0.	Program arguments: /opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang -cc1 -triple x86_64-unknown-linux-gnu -S -save-temps=cwd -disable-free -clear-ast-before-backend -disable-llvm-verifier -discard-value-names -main-file-name test.c -mrelocation-model static -fveclib=SVML -mframe-pointer=none -menable-no-infs -menable-no-nans -fapprox-func -funsafe-math-optimizations -fno-signed-zeros -mreassociate -freciprocal-math -fdenormal-fp-math=preserve-sign,preserve-sign -ffp-contract=fast -fno-rounding-math -ffast-math -ffinite-math-only -mconstructor-aliases -funwind-tables=2 -target-cpu x86-64 -mllvm -x86-enable-unaligned-vector-move=true -tune-cpu generic -debugger-tuning=gdb -v -fcoverage-compilation-dir=/home/jwzeng/workplace/compiler_testing/scripts/testing-20231011-100s9csmith-v3-ubuntu/result/icx/compfail/S_3397553276/reduce -resource-dir /opt/intel/oneapi/compiler/2023.2.0/linux/lib/clang/17 -O1 -fdebug-compilation-dir=/home/jwzeng/workplace/compiler_testing/scripts/testing-20231011-100s9csmith-v3-ubuntu/result/icx/compfail/S_3397553276/reduce -ferror-limit 19 -fheinous-gnu-extensions -fgnuc-version=4.2.1 -D__GCC_HAVE_DWARF2_CFI_ASM=1 -fintel-compatibility -fintel-libirc-allowed -mllvm -disable-hir-generate-mkl-call -mllvm -loopopt=1 -floopopt-pipeline=light -mllvm -intel-abi-compatible=true -o test.s -x cpp-output test.i
1.	<eof> parser at end of file
2.	Optimizer
 #0 0x0000560cefe4b353 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang+0x4f85353)
 #1 0x0000560cefe497d0 llvm::sys::RunSignalHandlers() (/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang+0x4f837d0)
 #2 0x0000560cefe4b99f SignalHandler(int) Signals.cpp:0:0
 #3 0x00007fbf33e8f520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
 #4 0x0000560cefb2dfb8 llvm::InstCombinerImpl::visitSExt(llvm::SExtInst&) InstCombineCasts.cpp:0:0
 #5 0x0000560cefad34bf llvm::InstCombinerImpl::run() InstructionCombining.cpp:0:0
 #6 0x0000560cefad4ca2 combineInstructionsOverFunction(llvm::Function&, llvm::InstructionWorklist&, llvm::AAResults*, llvm::AssumptionCache&, llvm::TargetLibraryInfo&, llvm::TargetTransformInfo&, llvm::DominatorTree&, llvm::OptimizationRemarkEmitter&, llvm::BlockFrequencyInfo*, llvm::ProfileSummaryInfo*, unsigned int, bool, bool, bool, bool, bool, llvm::LoopInfo*) InstructionCombining.cpp:0:0
 #7 0x0000560cefad3d55 llvm::InstCombinePass::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang+0x4c0dd55)
 #8 0x0000560cf087b73d llvm::detail::PassModel<llvm::Function, llvm::InstCombinePass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) BackendUtil.cpp:0:0
 #9 0x0000560cef9993a0 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang+0x4ad33a0)
#10 0x0000560ceeedd43d llvm::detail::PassModel<llvm::Function, llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) NVPTXTargetMachine.cpp:0:0
#11 0x0000560cef9a0149 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang+0x4ada149)
#12 0x0000560ceeedd1ad llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) NVPTXTargetMachine.cpp:0:0
#13 0x0000560cef9982c0 llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang+0x4ad22c0)
#14 0x0000560cf0872dd6 (anonymous namespace)::EmitAssemblyHelper::RunOptimizationPipeline(clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream>>&, std::__1::unique_ptr<llvm::ToolOutputFile, std::__1::default_delete<llvm::ToolOutputFile>>&) BackendUtil.cpp:0:0
#15 0x0000560cf086d306 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream>>) (/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang+0x59a7306)
#16 0x0000560cf0bf9cfc clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) CodeGenAction.cpp:0:0
#17 0x0000560cf1d5c82b clang::ParseAST(clang::Sema&, bool, bool) (/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang+0x6e9682b)
#18 0x0000560cf0bf88fa clang::CodeGenAction::ExecuteAction() (/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang+0x5d328fa)
#19 0x0000560cf0b68efa clang::FrontendAction::Execute() (/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang+0x5ca2efa)
#20 0x0000560cf0af5875 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang+0x5c2f875)
#21 0x0000560cf0bf54b1 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang+0x5d2f4b1)
#22 0x0000560ceebb1cdd cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang+0x3cebcdd)
#23 0x0000560ceebadc30 ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&, llvm::ToolContext const&) driver.cpp:0:0
#24 0x0000560ceebad5c2 clang_main(int, char**, llvm::ToolContext const&) (/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang+0x3ce75c2)
#25 0x0000560ceebbab4e main (/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang+0x3cf4b4e)
#26 0x00007fbf33e76d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#27 0x00007fbf33e76e40 call_init ./csu/../csu/libc-start.c:128:20
#28 0x00007fbf33e76e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#29 0x0000560ceebaae29 _start (/opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/clang+0x3ce4e29)
icx: error: unable to execute command: Segmentation fault (core dumped)
icx: error: clang frontend command failed due to signal (use -v to see invocation)
Intel(R) oneAPI DPC++/C++ Compiler 2023.2.0 (2023.2.0.20230622)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm
Configuration file: /opt/intel/oneapi/compiler/2023.2.0/linux/bin-llvm/../bin/icx.cfg
icx: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
icx: note: diagnostic msg: /tmp/icx-3ff8ca/test-e900a8.c
icx: note: diagnostic msg: /tmp/icx-3ff8ca/test-e900a8.sh
icx: note: diagnostic msg: 

********************

 

The content of the "test.i" file generated by the `-save-temps` option is as follows:

 

# 1 "test.c"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 378 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "test.c" 2
int a;
int b[][4];
void c() {
  int *d;
  a = 0;
  for (; a; a++)
    d = &b[a + 5][a];
  d == c;
}

 

Hopefully the information provided above will help resolve the issue and enable you to better locate the bug and fix it.

 

Best regards,

Junwei Zeng.

Labels (1)
0 Kudos
1 Solution
SeshaP_Intel
Moderator
457 Views

Hi,


Thank you for your patience. The issue raised by you has been targeted to be fixed in the oneAPI 2024.1 version which will released in the coming months.

If the issue persists with the new release, then you can start a new discussion for the community to investigate.


Thanks and Regards,

Pendyala Sesha Srinivas


View solution in original post

0 Kudos
4 Replies
SeshaP_Intel
Moderator
749 Views

Hi,


Thank you for posting in Intel Communities.


We are working on your issue internally. We will get back to you soon.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
SeshaP_Intel
Moderator
630 Views

Hi,


Thanks for reporting this issue. We have informed the development team about it.

We will get back to you soon.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
SeshaP_Intel
Moderator
458 Views

Hi,


Thank you for your patience. The issue raised by you has been targeted to be fixed in the oneAPI 2024.1 version which will released in the coming months.

If the issue persists with the new release, then you can start a new discussion for the community to investigate.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
Junwei_Zeng
Beginner
426 Views
Hi,

 

Thank you for your prompt reply and confirmation. It's great to hear that this issue has been targeted to be fixed in the Intel oneAPI 2024.1 version.

 

Once the new version is available, I'll thoroughly test it to ensure the issue has been resolved. Should any concerns persist, I won't hesitate to reach out and seek further assistance from the community.

 

Again, thank you for your assistance in this matter.

 

Best regards,
Junwei Zeng.
0 Kudos
Reply