-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flang-new 19 crash when compiling following code #98644
Comments
This code doesn't look like it should compile to me at a glance, as the first argument to |
@llvm/issue-subscribers-flang-ir Author: None (mfvalin)
> flang-new --version
flang-new version 19.0.0git (https://github.com/llvm/llvm-project.git 8681202)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/llvm-beta/bin
Build config: +assertions
> cat serializer.F90
contains
end module > flang-new -c serializer.F90 PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT: (added .txt extension to be able to add diagnostic files) |
The |
this is a "reduced" code excerpt from a functional piece of code (tested with gnu C/aocc C/Nvidia C/Intel C) |
So it is, I can't read this afternoon apparently. Ignore my comment above! |
if this is of any help to pinpoint the problem: replacing size_elem = [jar_instance%size_elem] |
Most likely the same root cause as #97325. I will look at it. |
Functions returning C_PTR were lowered to function returning intptr (i64 on 64bit arch). This caused conflicts when these functions were defined as returning !fir.ref<none>/llvm.ptr in other compiler generated contexts (e.g., malloc). Lower them to return !fir.ref<none>. This should deal with #97325 and #98644.
Functions returning C_PTR were lowered to function returning intptr (i64 on 64bit arch). This caused conflicts when these functions were defined as returning !fir.ref<none>/llvm.ptr in other compiler generated contexts (e.g., malloc). Lower them to return !fir.ref<none>. This should deal with llvm#97325 and llvm#98644. (cherry picked from commit 1ead51a)
Functions returning C_PTR were lowered to function returning intptr (i64 on 64bit arch). This caused conflicts when these functions were defined as returning !fir.ref<none>/llvm.ptr in other compiler generated contexts (e.g., malloc). Lower them to return !fir.ref<none>. This should deal with llvm#97325 and llvm#98644. (cherry picked from commit 1ead51a)
Summary: Functions returning C_PTR were lowered to function returning intptr (i64 on 64bit arch). This caused conflicts when these functions were defined as returning !fir.ref<none>/llvm.ptr in other compiler generated contexts (e.g., malloc). Lower them to return !fir.ref<none>. This should deal with #97325 and #98644. Test Plan: Reviewers: Subscribers: Tasks: Tags: Differential Revision: https://phabricator.intern.facebook.com/D60250769
Functions returning C_PTR were lowered to function returning intptr (i64 on 64bit arch). This caused conflicts when these functions were defined as returning !fir.ref<none>/llvm.ptr in other compiler generated contexts (e.g., malloc). Lower them to return !fir.ref<none>. This should deal with llvm#97325 and llvm#98644.
The code now compiles without any errors on a recent main branch build of flang-new:
|
contains
!> Create a new data jar (size specified with a 64-bit integer), allocate data storage
function jar_new_i8(jar_instance, data_size) result(ok)
implicit none
class(jar), intent(INOUT) :: jar_instance !> Data jar instance
integer(C_INT64_T), intent(IN), value :: data_size !> Number of elements in jar
logical :: ok !> .true. if jar was successfully created, .false. otherwise
end module
#0 0x0000560d4d4fbdc8 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/opt/llvm-beta/bin/flang-new+0x128fdc8)
#1 0x0000560d4d4f98fe llvm::sys::RunSignalHandlers() (/opt/llvm-beta/bin/flang-new+0x128d8fe)
#2 0x0000560d4d4fc76d SignalHandler(int) Signals.cpp:0:0
#3 0x0000154a2133e420 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x14420)
#4 0x0000154a20d5800b raise /build/glibc-LcI20x/glibc-2.31/signal/../sysdeps/unix/sysv/linux/raise.c:51:1
#5 0x0000154a20d37859 abort /build/glibc-LcI20x/glibc-2.31/stdlib/abort.c:81:7
#6 0x0000154a20d37729 get_sysdep_segment_value /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:509:8
#7 0x0000154a20d37729 _nl_load_domain /build/glibc-LcI20x/glibc-2.31/intl/loadmsgcat.c:970:34
#8 0x0000154a20d48fd6 (/lib/x86_64-linux-gnu/libc.so.6+0x33fd6)
#9 0x0000560d51be7e15 (/opt/llvm-beta/bin/flang-new+0x597be15)
#10 0x0000560d51be7c2d llvm::StoreInst::StoreInst(llvm::Value*, llvm::Value*, bool, llvm::Align, llvm::InsertPosition) (/opt/llvm-beta/bin/flang-new+0x597bc2d)
#11 0x0000560d4d1014e5 llvm::IRBuilderBase::CreateAlignedStore(llvm::Value*, llvm::Value*, llvm::MaybeAlign, bool) (/opt/llvm-beta/bin/flang-new+0xe954e5)
#12 0x0000560d4f43ef49 convertOperationImpl(mlir::Operation&, llvm::IRBuilderBase&, mlir::LLVM::ModuleTranslation&) LLVMToLLVMIRTranslation.cpp:0:0
#13 0x0000560d4f95ed77 mlir::LLVM::ModuleTranslation::convertOperation(mlir::Operation&, llvm::IRBuilderBase&, bool) (/opt/llvm-beta/bin/flang-new+0x36f2d77)
#14 0x0000560d4f95f4fb mlir::LLVM::ModuleTranslation::convertBlockImpl(mlir::Block&, bool, llvm::IRBuilderBase&, bool) (/opt/llvm-beta/bin/flang-new+0x36f34fb)
#15 0x0000560d4f962e2c mlir::LLVM::ModuleTranslation::convertOneFunction(mlir::LLVM::LLVMFuncOp) (/opt/llvm-beta/bin/flang-new+0x36f6e2c)
#16 0x0000560d4f964c06 mlir::LLVM::ModuleTranslation::convertFunctions() (/opt/llvm-beta/bin/flang-new+0x36f8c06)
#17 0x0000560d4f966ff8 mlir::translateModuleToLLVMIR(mlir::Operation*, llvm::LLVMContext&, llvm::StringRef, bool) (/opt/llvm-beta/bin/flang-new+0x36faff8)
#18 0x0000560d4db34fcb Fortran::frontend::CodeGenAction::generateLLVMIR() (/opt/llvm-beta/bin/flang-new+0x18c8fcb)
#19 0x0000560d4db38fb7 Fortran::frontend::CodeGenAction::executeAction() (/opt/llvm-beta/bin/flang-new+0x18ccfb7)
#20 0x0000560d4d53453c Fortran::frontend::FrontendAction::execute() (/opt/llvm-beta/bin/flang-new+0x12c853c)
#21 0x0000560d4d51cee2 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) (/opt/llvm-beta/bin/flang-new+0x12b0ee2)
#22 0x0000560d4d5387c8 Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) (/opt/llvm-beta/bin/flang-new+0x12cc7c8)
#23 0x0000560d4d0bd8d6 fc1_main(llvm::ArrayRef<char const*>, char const*) (/opt/llvm-beta/bin/flang-new+0xe518d6)
#24 0x0000560d4d0bc866 main (/opt/llvm-beta/bin/flang-new+0xe50866)
#25 0x0000154a20d39083 __libc_start_main /build/glibc-LcI20x/glibc-2.31/csu/../csu/libc-start.c:342:3
#26 0x0000560d4d0bba6e _start (/opt/llvm-beta/bin/flang-new+0xe4fa6e)
flang-new: error: unable to execute command: Aborted (core dumped)
flang-new: error: flang frontend command failed due to signal (use -v to see invocation)
flang-new version 19.0.0git (https://github.com/llvm/llvm-project.git 8681202)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/llvm-beta/bin
Build config: +assertions
flang-new: note: diagnostic msg:
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
flang-new: note: diagnostic msg: /tmp/serializer-bdf1fd
flang-new: note: diagnostic msg: /tmp/serializer-bdf1fd.sh
flang-new: note: diagnostic msg:
(added .txt extension to be able to add diagnostic files)
serializer-bdf1fd.txt
serializer-bdf1fd.sh.txt
The text was updated successfully, but these errors were encountered: