Intel® oneAPI Base Toolkit
Support for the core tools and libraries within the base toolkit that are used to build and deploy high-performance data-centric applications.
419 Discussions

Compilation fails with optimization set higher than -O1

marcinblazejowski
1,993 Views

Hi,

this is a report produced by icx (Debian testing/unstable, oneAPI installed from DEB-s):

CFLAGS="-march=native -mtune=native -O3"
CXXLAGS="-march=native -mtune=native -O3"

 

NOTE: setting to "-O1" works well!!

 

../libtool --mode=compile icx -mavx -Winline -qopenmp -c -march=native -mtune=native -O3 -I.. -I../../gui -DHAVE_CONFIG_H -I../../lib/src    -I/usr/include/libxml2  -I../../plugin -I/
usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include   -I/include -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthre
ad -I/usr/include/libmount -I/usr/include/blkid  -I../../plugin/libsvm -I../../plugin/libshp -Wno-deprecated-declarations -I. ../../plugin/rq/rqbr.c
libtool: compile:  icx -mavx -Winline -qopenmp -c -march=native -mtune=native -O3 -I.. -I../../gui -DHAVE_CONFIG_H -I../../lib/src -I/usr/include/libxml2 -I../../plugin -I/usr/include
/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/include -I/usr/include/json-glib-1.0 -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -pthread -I/usr/inc
lude/libmount -I/usr/include/blkid -I../../plugin/libsvm -I../../plugin/libshp -Wno-deprecated-declarations -I. ../../plugin/rq/rqbr.c  -fPIC -DPIC -o .libs/rqbr.o
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/su
pport/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/2022.2.1/linux/bin-llvm/clang @/tmp/icxargbYYw1k
1.      <eof> parser at end of file
2.      Optimizer
#0 0x000055b8b0e7cafa llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x3ad4afa)
#1 0x000055b8b0e7afb0 llvm::sys::RunSignalHandlers() (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x3ad2fb0)
#2 0x000055b8b0e043b7 (anonymous namespace)::CrashRecoveryContextImpl::HandleCrash(int, unsigned long) CrashRecoveryContext.cpp:0:0
#3 0x000055b8b0e045e5 CrashRecoverySignalHandler(int) CrashRecoveryContext.cpp:0:0
#4 0x00007f0458ea6f90 (/lib/x86_64-linux-gnu/libc.so.6+0x3bf90)
#5 0x000055b8b1111fc3 llvm::vpo::VPLoopEntityList::isMinMaxLastItem(llvm::vpo::VPReduction const&) const (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x3d69fc3)
#6 0x000055b8b1119042 llvm::vpo::ReductionDescr::passToVPlan(llvm::vpo::VPlanVector*, llvm::vpo::VPLoop const*) (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x3d71042)
#7 0x000055b8b11b5ab0 llvm::vpo::VPLoopEntitiesConverter<llvm::vpo::ReductionDescr, llvm::loopopt::HLLoop, HLLoop2VPLoopMapper>::passToVPlan(llvm::vpo::VPlanVector*, HLLoop2VPLoopMap
per&) IntelVPlanHCFGBuilderHIR.cpp:0:0
#8 0x000055b8b11ae544 llvm::vpo::VPlanHCFGBuilderHIR::passEntitiesToVPlan(llvm::SmallVector<std::__1::unique_ptr<llvm::vpo::VPLoopEntitiesConverterBase, std::__1::default_delete<llvm
::vpo::VPLoopEntitiesConverterBase>>, 2u>&) (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x3e06544)
#9 0x000055b8b114cb3a llvm::vpo::VPlanHCFGBuilder::buildHierarchicalCFG() (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x3da4b3a)
#10 0x000055b8b11895f7 llvm::vpo::LoopVectorizationPlannerHIR::buildInitialVPlan(llvm::vpo::VPExternalValues&, llvm::vpo::VPUnlinkedInstructions&, std::__1::basic_string<char, std::__
1::char_traits<char>, std::__1::allocator<char>>, llvm::ScalarEvolution*) (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x3de15f7)
#11 0x000055b8b10bb2de llvm::vpo::LoopVectorizationPlanner::buildInitialVPlans(llvm::LLVMContext*, llvm::DataLayout const*, std::__1::basic_string<char, std::__1::char_traits<char>, s
td::__1::allocator<char>>, llvm::ScalarEvolution*, bool) (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x3d132de)
#12 0x000055b8b10b073c llvm::vpo::VPlanDriverHIRImpl::processLoop(llvm::loopopt::HLLoop*, llvm::Function&, llvm::vpo::WRNVecLoopNode*) (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-l
lvm/clang+0x3d0873c)
#13 0x000055b8b10b3b3c llvm::vpo::VPlanDriverHIRImpl::runImpl(llvm::Function&, llvm::loopopt::HIRFramework*, llvm::loopopt::HIRLoopStatistics*, llvm::loopopt::HIRDDAnalysis*, llvm::lo
opopt::HIRSafeReductionAnalysis*, llvm::OptReportVerbosity::Level, llvm::vpo::WRegionInfo*, llvm::TargetTransformInfo*, llvm::TargetLibraryInfo*, llvm::AssumptionCache*, llvm::Dominat
orTree*, std::__1::function<void (llvm::Function*)>) (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x3d0bb3c)
#14 0x000055b8b10b3cc7 llvm::vpo::VPlanDriverHIRPass::runImpl(llvm::Function&, llvm::AnalysisManager<llvm::Function>&, llvm::loopopt::HIRFramework&) (/opt/intel/oneapi/compiler/2022.2
.1/linux/bin-llvm/clang+0x3d0bcc7)
#15 0x000055b8b219c1c0 llvm::detail::PassModel<llvm::Function, llvm::vpo::VPlanDriverHIRPass, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llv
m::AnalysisManager<llvm::Function>&) PassBuilder.cpp:0:0
#16 0x000055b8b085f455 llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function>>::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/opt/intel/oneapi/compil
er/2022.2.1/linux/bin-llvm/clang+0x34b7455)
#17 0x000055b8b193233d 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>&) BackendUtil.cpp:0:0
#18 0x000055b8b0866be2 llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x34bebe2)
#19 0x000055b8b193410d llvm::detail::PassModel<llvm::Module, llvm::ModuleToFunctionPassAdaptor, llvm::PreservedAnalyses, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm:
:AnalysisManager<llvm::Module>&) BackendUtil.cpp:0:0
#20 0x000055b8b085df7e llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module>>::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/opt/intel/oneapi/compiler/2022.
2.1/linux/bin-llvm/clang+0x34b5f7e)
#21 0x000055b8b192ba67 (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
#22 0x000055b8b1924839 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOpt
ions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::__1::unique_ptr<llvm::raw_pwrite_stream, std::__1::default_delete<llvm::raw_pwrite_stream>>) (/opt/intel/oneapi
/compiler/2022.2.1/linux/bin-llvm/clang+0x457c839)
#23 0x000055b8b1cb01dc clang::BackendConsumer::HandleTranslationUnit(clang::ASTContext&) CodeGenAction.cpp:0:0
#24 0x000055b8b29bbb1b clang::ParseAST(clang::Sema&, bool, bool) (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x5613b1b)
#25 0x000055b8b1caee78 clang::CodeGenAction::ExecuteAction() (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x4906e78)
#26 0x000055b8b1c2ab7b clang::FrontendAction::Execute() (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x4882b7b)
#27 0x000055b8b1bbdd46 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x4815d46)
#28 0x000055b8b1cabedc clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x4903edc)
#29 0x000055b8afe1770b cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x2a6f70b)
#30 0x000055b8afe1540d ExecuteCC1Tool(llvm::SmallVectorImpl<char const*>&) driver.cpp:0:0
#31 0x000055b8b1ad0482 void llvm::function_ref<void ()>::callback_fn<clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__1::basic_string<char, s
td::__1::char_traits<char>, std::__1::allocator<char>>*, bool*) const::$_1>(long) Job.cpp:0:0
#32 0x000055b8b0e04321 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x3a5c321)
#33 0x000055b8b1acf8db clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef>>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocato
r<char>>*, bool*) const (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x47278db)
#34 0x000055b8b1a8b9b9 clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&, bool) const (/opt/intel/oneapi/compiler/2022.2.1/linux
/bin-llvm/clang+0x46e39b9)
#35 0x000055b8b1a8be23 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&, bool) const (
/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x46e3e23)
#36 0x000055b8b1aaa69c clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::__1::pair<int, clang::driver::Command const*>>&) (/opt/intel/o
neapi/compiler/2022.2.1/linux/bin-llvm/clang+0x470269c)
#37 0x000055b8afe138d5 clang_main(int, char**) (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x2a6b8d5)
#38 0x00007f0458e9218a __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#39 0x00007f0458e92245 call_init ./csu/../csu/libc-start.c:128:20
#40 0x00007f0458e92245 __libc_start_main ./csu/../csu/libc-start.c:368:5
#41 0x000055b8afe12369 _start (/opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm/clang+0x2a6a369)
icx: error: clang frontend command failed with exit code 139 (use -v to see invocation)
Intel(R) oneAPI DPC++/C++ Compiler 2022.2.1 (2022.2.1.20221020)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm
Configuration file: /opt/intel/oneapi/compiler/2022.2.1/linux/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/rqbr-0f83e3.c
icx: note: diagnostic msg: /tmp/rqbr-0f83e3.sh
icx: note: diagnostic msg:  

********************
make: *** [Makefile:266: rqbr.lo] Błąd 1

0 Kudos
1 Solution
SeshaP_Intel
Moderator
1,337 Views

Hi,


Thank you for your patience. The issue raised by you has been fixed in the 2023.1 version which will be released in the coming months. If the issue still 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
9 Replies
SeshaP_Intel
Moderator
1,971 Views

Hi,


Thank you for posting in Intel Communities.

We were able to reproduce your issue with -O3 optimization flag.

Could you please provide the following details so that we can investigate the issue more from our end?

1. Have you tried with -O2 optimization flag. If you have tried let us know the results. 

2. oneAPI version you are using.

3. Clang version you are using.

4. Hardware you are using.

5. Please isolate the code where you are observing the error and provide the small reproducible code and steps you have followed.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
marcinblazejowski
1,960 Views

Hi,

1. Yes - with the same results as with -O3 => I would say that compilation not fail if I have "-Ox && x <=1".

2. I would say 2022.2.1 (current DEB-s from you repos).

3.  icx - v:
Intel(R) oneAPI DPC++/C++ Compiler 2022.2.1 (2022.2.1.20221020)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/intel/oneapi/compiler/2022.2.1/linux/bin-llvm
Configuration file: /opt/intel/oneapi/compiler/2022.2.1/linux/bin/icx.cfg
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64

4. I'm not sure, but I think it is 15.x.x taken by you from git repo on February, 2022.

5. Dell Inspiron 17 7773 2-in-1 (service TAG: JK2KTJ2). I short: i7-8550U CPU @ 1.80GHz

6. Ohh, that would certainly not be easy. Don't get me wrong, it does not mean I don't want to do this. General remark: we're talking about gretl project (https://sourceforge.net/projects/gretl/), so isolating the very small piece of code could be tricky a little. However, you can play with the whole sources, don't you? But look at project activity: last night Alling Cottrell applied a patch which is 'temporary hack for icx and rqbr.c' [https://sourceforge.net/p/gretl/git/ci/51d5cda091025743a04767b687433ae10843588e/].

Marcin

0 Kudos
SeshaP_Intel
Moderator
1,898 Views

Hi,


We are unable to reproduce the issue while trying with -O1 optimization flag.

Could please let us know at which step of the code you are facing this issue?

Have you tried the temporary hack for icx? If works, please let us know the results.


Thanks and Regards,

Pendyala Sesha Srinivas


0 Kudos
marcinblazejowski
1,888 Views

Hi,

good for you!!! I would say then that your results are inline with mine, since I wrote:

  1. in the first post: 'NOTE: setting to "-O1" works well!!'.
  2. in the second post: 'I would say that compilation not fail if I have "-Ox && x <=1"'.

So again: compilation fails if I have -O2 or -O3 (more aggressive optimization). What might be important: vanilla clang-15 (15.0.6 from Debian repos) compiles the code regardless the optimization settings.

Cheers,
Marcin

0 Kudos
SeshaP_Intel
Moderator
1,800 Views

Hi,


We were able to reproduce your 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
1,338 Views

Hi,


Thank you for your patience. The issue raised by you has been fixed in the 2023.1 version which will be released in the coming months. If the issue still 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
marcinblazejowski
1,313 Views

Hi,

good to know, thanks!!!

 

Cheers,
Marcin

0 Kudos
aruhela
Novice
394 Views

Hi Pendyala ,

 

We (TACC users) do see the same error with the new release 24.1. I am submitting another ticket for it.

 

 

0 Kudos
marcinblazejowski
368 Views

Aruhela,

I cannot confirm this: in my case compilation with 24.1 works fine.

 

Marcin

0 Kudos
Reply