Skip to content
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

[fortran] Update gfortran disabled test list now that CLASS is lowered #109

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jeanPerier
Copy link
Contributor

All the TODOs and bugs related to CLASS have been implemented/fixed. Enable newly passing tests and move all other failing tests under existing or new categories. None of these failures are bugs, most are different TODOs, unimplemented runtime checks, or cases where flang will behave differently than gfortran on purpose.

All the TODOs and bugs related to CLASS have been implemented/fixed.
Enable newly passing tests and move all other failing tests under
existing or new categories. None of these failures are bugs, most
are different TODOs, unimplemented runtime checks, or cases where
flang will behave differently than gfortran on purpose.
@tarunprabhu
Copy link
Contributor

I seem to be getting a segfault when I build class_allocate_19.f03. This is Arch Linux on x86_64. I pulled an hour or so ago. Is anyone else seeing this?

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new -fc1 -triple x86_64-unknown-linux-gnu -emit-obj -D NDEBUG -I /vast/home/tarun/projects/workspace/x86_64/flang/install/release/include/flang -I /dev/shm/x86_64/llvm-test-suite/default/Fortran/gfortran/regression/gfortran-regression-execute-regression__class_allocate_19_f03.wd -fcolor-diagnostics -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu x86-64 -fversion-loops-for-stride -module-dir gfortran-regression-execute-regression__class_allocate_19_f03.wd -mframe-pointer=none -O3 -o CMakeFiles/gfortran-regression-execute-regression__class_allocate_19_f03.dir/class_allocate_19.f03.o -x f95-cpp-input /vast/home/tarun/projects/code/llvm-test-suite/repo/Fortran/gfortran/regression/class_allocate_19.f03
 #0 0x000055a6167d8fa6 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x16a2fa6)
 #1 0x000055a6167d6b7e llvm::sys::RunSignalHandlers() (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x16a0b7e)
 #2 0x000055a6167d99b9 SignalHandler(int) Signals.cpp:0:0
 #3 0x000014f7b096ccf0 __restore_rt (/lib/../lib64/libpthread.so.0+0x12cf0)
 #4 0x000055a6183fc8ab fir::FirOpBuilder::createConvert(mlir::Location, mlir::Type, mlir::Value) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x32c68ab)
 #5 0x000055a6173af705 genStructureComponentInit(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::semantics::Symbol const&, Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, mlir::Value) ConvertConstant.cpp:0:0
 #6 0x000055a61739817d genInlinedStructureCtorLitImpl(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::evaluate::StructureConstructor const&, mlir::Type) ConvertConstant.cpp:0:0
 #7 0x000055a6173c3a32 mlir::Value genInlinedArrayLit<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::lower::AbstractConverter&, mlir::Location, mlir::Type, Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&) ConvertConstant.cpp:0:0
 #8 0x000055a6173aaebd Fortran::lower::ConstantBuilder<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>::gen(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&, bool) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x2274ebd)
 #9 0x000055a61712626c fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&) ConvertExpr.cpp:0:0
#10 0x000055a616ffe449 fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&) ConvertExpr.cpp:0:0
#11 0x000055a616ffe630 Fortran::lower::createSomeInitializerExpression(mlir::Location, Fortran::lower::AbstractConverter&, Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, Fortran::lower::SymMap&, Fortran::lower::StatementContext&) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x1ec8630)
#12 0x000055a61723230d std::_Function_handler<void (fir::FirOpBuilder&), defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr)::$_2>::_M_invoke(std::_Any_data const&, fir::FirOpBuilder&) ConvertVariable.cpp:0:0
#13 0x000055a61720b89e Fortran::lower::createGlobalInitialization(fir::FirOpBuilder&, fir::GlobalOp, std::function<void (fir::FirOpBuilder&)>) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x20d589e)
#14 0x000055a617213b1d defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr) ConvertVariable.cpp:0:0
#15 0x000055a617209c0a Fortran::lower::instantiateVariable(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, Fortran::lower::SymMap&, llvm::DenseMap<std::tuple<Fortran::semantics::Scope const*, unsigned long>, mlir::Value, llvm::DenseMapInfo<std::tuple<Fortran::semantics::Scope const*, unsigned long>, void>, llvm::detail::DenseMapPair<std::tuple<Fortran::semantics::Scope const*, unsigned long>, mlir::Value>>&) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x20d3c0a)
#16 0x000055a61720aeb0 Fortran::lower::genInitialDataTarget(Fortran::lower::AbstractConverter&, mlir::Location, mlir::Type, Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, bool) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x20d4eb0)
#17 0x000055a6173af526 genStructureComponentInit(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::semantics::Symbol const&, Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, mlir::Value) ConvertConstant.cpp:0:0
#18 0x000055a61739817d genInlinedStructureCtorLitImpl(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::evaluate::StructureConstructor const&, mlir::Type) ConvertConstant.cpp:0:0
#19 0x000055a617397f56 Fortran::lower::genInlinedStructureCtorLit(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::evaluate::StructureConstructor const&) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x2261f56)
#20 0x000055a617126150 fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&) ConvertExpr.cpp:0:0
#21 0x000055a616ffe449 fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&) ConvertExpr.cpp:0:0
#22 0x000055a616ffe630 Fortran::lower::createSomeInitializerExpression(mlir::Location, Fortran::lower::AbstractConverter&, Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, Fortran::lower::SymMap&, Fortran::lower::StatementContext&) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x1ec8630)
#23 0x000055a61723230d std::_Function_handler<void (fir::FirOpBuilder&), defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr)::$_2>::_M_invoke(std::_Any_data const&, fir::FirOpBuilder&) ConvertVariable.cpp:0:0
#24 0x000055a61720b89e Fortran::lower::createGlobalInitialization(fir::FirOpBuilder&, fir::GlobalOp, std::function<void (fir::FirOpBuilder&)>) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x20d589e)
#25 0x000055a617213b1d defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr) ConvertVariable.cpp:0:0
#26 0x000055a6172146b0 Fortran::lower::createRuntimeTypeInfoGlobal(Fortran::lower::AbstractConverter&, Fortran::semantics::Symbol const&) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x20de6b0)
#27 0x000055a616fc2ec0 (anonymous namespace)::TypeInfoConverter::createTypeInfoOpAndGlobal(Fortran::lower::AbstractConverter&, (anonymous namespace)::TypeInfoConverter::TypeInfo const&) Bridge.cpp:0:0
#28 0x000055a616fc2ddb std::_Function_handler<void (), (anonymous namespace)::FirConverter::run(Fortran::lower::pft::Program&)::'lambda0'()>::_M_invoke(std::_Any_data const&) Bridge.cpp:0:0
#29 0x000055a616fbc709 (anonymous namespace)::FirConverter::createGlobalOutsideOfFunctionLowering(std::function<void ()> const&) Bridge.cpp:0:0
#30 0x000055a616f2de3f Fortran::lower::LoweringBridge::lower(Fortran::parser::Program const&, Fortran::semantics::SemanticsContext const&) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x1df7e3f)
#31 0x000055a616e2ce6c Fortran::frontend::CodeGenAction::beginSourceFileAction() (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x1cf6e6c)
#32 0x000055a616812139 Fortran::frontend::FrontendAction::beginSourceFile(Fortran::frontend::CompilerInstance&, Fortran::frontend::FrontendInputFile const&) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x16dc139)
#33 0x000055a6167fad83 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x16c4d83)
#34 0x000055a616816c3d Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x16e0c3d)
#35 0x000055a61638445b fc1_main(llvm::ArrayRef<char const*>, char const*) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x124e45b)
#36 0x000055a616382a7b main (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x124ca7b)
#37 0x000014f7af53ad85 __libc_start_main (/lib/../lib64/libc.so.6+0x3ad85)
#38 0x000055a61638250e _start (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x124c50e)
flang-new: error: unable to execute command: Segmentation fault (core dumped)
flang-new: error: flang frontend command failed due to signal (use -v to see invocation)
flang-new version 19.0.0git (git@github.com:llvm-project-tlp/llvm-project.git e61922d327c39805a7303586f4b0accf3398c774)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin
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/class_allocate_19-67377e
flang-new: note: diagnostic msg: /tmp/class_allocate_19-67377e.sh
flang-new: note: diagnostic msg: 

********************
make[3]: *** [Fortran/gfortran/regression/CMakeFiles/gfortran-regression-execute-regression__class_allocate_19_f03.dir/build.make:75: Fortran/gfortran/regression/CMakeFiles/gfortran-regression-execute-regression__class_allocate_19_f03.dir/class_allocate_19.f03.o] Error 254
make[2]: *** [CMakeFiles/Makefile2:113450: Fortran/gfortran/regression/CMakeFiles/gfortran-regression-execute-regression__class_allocate_19_f03.dir/all] Error 2
make[1]: *** [CMakeFiles/Makefile2:113457: Fortran/gfortran/regression/CMakeFiles/gfortran-regression-execute-regression__class_allocate_19_f03.dir/rule] Error 2
make: *** [Makefile:47471: gfortran-regression-execute-regression__class_allocate_19_f03] Error 2

@jeanPerier
Copy link
Contributor Author

pulled an hour or so ago. Is anyone else seeing this?

Thanks for testing Tarun! I could not reproduce with my build and valgrind is green. There may be some undefined behavior to catch in lowering here.

  • What compiler version are you using for flang build?
  • Looking at the trace, I see nothing unexpected until the crash. Could you check if the crashing createConvert is this one? I am thinking addrFieldTy could be null if something is going wrong.

Copy link
Contributor

@tblah tblah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All passes for me on aarch64. Thanks for this!

Wait for Tarun's approval before merging.

@tarunprabhu
Copy link
Contributor

I am building flang with clang 17.

Below is a stacktrace from a debug build of flang. I haven't had a chance to look specifically if the addrFieldTy is null. Hopefully, I can do so tomorrow.

PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.	Program arguments: /vast/home/tarun/projects/workspace/x86_64/flang/install/debug/bin/flang-new -fc1 -triple x86_64-unknown-linux-gnu -emit-obj -D NDEBUG -I /vast/home/tarun/projects/workspace/x86_64/flang/install/debug/include/flang -I /dev/shm/x86_64/llvm-test-suite/default/Fortran/gfortran/regression/gfortran-regression-execute-regression__class_allocate_19_f03.wd -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu x86-64 -fversion-loops-for-stride -module-dir gfortran-regression-execute-regression__class_allocate_19_f03.wd -mframe-pointer=none -O3 -o CMakeFiles/gfortran-regression-execute-regression__class_allocate_19_f03.dir/class_allocate_19.f03.o -x f95-cpp-input /vast/home/tarun/projects/code/llvm-test-suite/repo/Fortran/gfortran/regression/class_allocate_19.f03
 #0 0x0000149e458a0706 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /vast/home/tarun/projects/code/flang/repo/llvm/lib/Support/Unix/Signals.inc:723:11
 #1 0x0000149e458a0ceb PrintStackTraceSignalHandler(void*) /vast/home/tarun/projects/code/flang/repo/llvm/lib/Support/Unix/Signals.inc:798:1
 #2 0x0000149e4589e923 llvm::sys::RunSignalHandlers() /vast/home/tarun/projects/code/flang/repo/llvm/lib/Support/Signals.cpp:105:5
 #3 0x0000149e458a1591 SignalHandler(int) /vast/home/tarun/projects/code/flang/repo/llvm/lib/Support/Unix/Signals.inc:413:1
 #4 0x0000149e57cbecf0 __restore_rt (/lib/../lib64/libpthread.so.0+0x12cf0)
 #5 0x000055e19b0c8bb6 mlir::TypeStorage::getAbstractType() /vast/home/tarun/projects/code/flang/repo/llvm/../mlir/include/mlir/IR/TypeSupport.h:173:5
 #6 0x000055e19b0c8b68 mlir::Type::getTypeID() /vast/home/tarun/projects/code/flang/repo/llvm/../mlir/include/mlir/IR/Types.h:112:37
 #7 0x000055e19b0d27c2 bool mlir::detail::StorageUserBase<fir::RecordType, mlir::Type, fir::detail::RecordTypeStorage, mlir::detail::TypeUniquer>::classof<mlir::Type>(mlir::Type) /vast/home/tarun/projects/code/flang/repo/llvm/../mlir/include/mlir/IR/StorageUniquerSupport.h:114:16
 #8 0x000055e19b0d270a llvm::CastInfo<fir::RecordType, mlir::Type const, void>::isPossible(mlir::Type) /vast/home/tarun/projects/code/flang/repo/llvm/../mlir/include/mlir/IR/Types.h:412:14
 #9 0x000055e19b0e333d bool llvm::isa<fir::RecordType, mlir::Type>(mlir::Type const&) /vast/home/tarun/projects/code/flang/repo/llvm/include/llvm/Support/Casting.h:549:10
#10 0x000055e19b583785 bool mlir::Type::isa<fir::RecordType>() const /vast/home/tarun/projects/code/flang/repo/llvm/../mlir/include/mlir/IR/Types.h:321:3
#11 0x000055e19b580552 fir::isa_derived(mlir::Type) /vast/home/tarun/projects/code/flang/repo/flang/include/flang/Optimizer/Dialect/FIRType.h:124:50
#12 0x000055e19ef7ecad fir::FirOpBuilder::createConvert(mlir::Location, mlir::Type, mlir::Value) /vast/home/tarun/projects/code/flang/repo/flang/lib/Optimizer/Builder/FIRBuilder.cpp:396:5
#13 0x000055e19c13d59f genStructureComponentInit(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::semantics::Symbol const&, Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, mlir::Value) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertConstant.cpp:425:36
#14 0x000055e19c12a99c genInlinedStructureCtorLitImpl(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::evaluate::StructureConstructor const&, mlir::Type) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertConstant.cpp:507:11
#15 0x000055e19c135759 genScalarLit(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::evaluate::StructureConstructor const&, mlir::Type, bool) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertConstant.cpp:524:12
#16 0x000055e19c167b17 mlir::Value genInlinedArrayLit<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::lower::AbstractConverter&, mlir::Location, mlir::Type, Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertConstant.cpp:578:11
#17 0x000055e19c1353c9 fir::ExtendedValue genArrayLit<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&, bool) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertConstant.cpp:700:29
#18 0x000055e19c16b4a4 Fortran::lower::ConstantBuilder<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>::gen(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&, bool) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertConstant.cpp:726:5
#19 0x000055e19b9badf6 fir::ExtendedValue Fortran::lower::convertConstant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&, bool) /vast/home/tarun/projects/code/flang/repo/flang/include/flang/Lower/ConvertConstant.h:53:3
#20 0x000055e19b7cbf70 (anonymous namespace)::ScalarExprLowering::genval(Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertExpr.cpp:1314:3
#21 0x000055e19b7cfd0b auto fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&)::operator()<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>>(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&) const /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertExpr.cpp:2966:53
#22 0x000055e19b7cfcc8 Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> std::__invoke_impl<fir::ExtendedValue, fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&), Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&>(std::__invoke_other, fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&)&&, Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/invoke.h:61:14
#23 0x000055e19b7cfc68 std::__invoke_result<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>, Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&>::type std::__invoke<fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&), Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&>(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>&&, Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/invoke.h:96:14
#24 0x000055e19b7cfaa0 std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<std::__detail::__variant::__deduce_visit_result<fir::ExtendedValue> (*)(fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&)&&, std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&)>, std::integer_sequence<unsigned long, 0ul>>::__visit_invoke(fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&)&&, std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/variant:1031:11
#25 0x000055e19b7cf9a4 decltype(auto) std::__do_visit<std::__detail::__variant::__deduce_visit_result<fir::ExtendedValue>, fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&), std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>(fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&)&&, std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/variant:1783:5
#26 0x000055e19b7cf82e std::invoke_result<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>, std::__conditional<is_lvalue_reference_v<std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>>::type<std::variant_alternative<0ul, std::remove_reference<decltype(__variant::__as(std::declval<std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>()))>::type>::type&, std::variant_alternative<0ul, std::remove_reference<decltype(__variant::__as(std::declval<std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>()))>::type>::type&&>>::type std::visit<fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&), std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>&&, std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/variant:1846:13
#27 0x000055e19b7cf608 fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertExpr.cpp:2966:7
#28 0x000055e19b8f551b auto fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&)::operator()<Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>>(Fortran::evaluate::SomeType const&) const /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertExpr.cpp:2966:53
#29 0x000055e19b8f54d8 Fortran::evaluate::SomeType std::__invoke_impl<fir::ExtendedValue, fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&), Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&>(std::__invoke_other, fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&)&&, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/invoke.h:61:14
#30 0x000055e19b8f5478 std::__invoke_result<Fortran::evaluate::SomeType, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&>::type std::__invoke<fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&), Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&>(Fortran::evaluate::SomeType&&, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/invoke.h:96:14
#31 0x000055e19b8f4c60 std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<std::__detail::__variant::__deduce_visit_result<fir::ExtendedValue> (*)(fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&)&&, std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&)>, std::integer_sequence<unsigned long, 9ul>>::__visit_invoke(fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&)&&, std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/variant:1031:11
#32 0x000055e19b8f48fa decltype(auto) std::__do_visit<std::__detail::__variant::__deduce_visit_result<fir::ExtendedValue>, fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&), std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>(fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&)&&, std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/variant:1792:5
#33 0x000055e19b8f479e std::invoke_result<Fortran::evaluate::SomeType, std::__conditional<is_lvalue_reference_v<std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>>::type<std::variant_alternative<0ul, std::remove_reference<decltype(__variant::__as(std::declval<std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>()))>::type>::type&, std::variant_alternative<0ul, std::remove_reference<decltype(__variant::__as(std::declval<std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>()))>::type>::type&&>>::type std::visit<fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&), std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>(Fortran::evaluate::SomeType&&, std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/variant:1846:13
#34 0x000055e19b5d2278 fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertExpr.cpp:2966:7
#35 0x000055e19b5d23a6 Fortran::lower::createSomeInitializerExpression(mlir::Location, Fortran::lower::AbstractConverter&, Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, Fortran::lower::SymMap&, Fortran::lower::StatementContext&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertExpr.cpp:7260:3
#36 0x000055e19bb8dde3 genInitializerExprValue(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, Fortran::lower::StatementContext&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertVariable.cpp:128:10
#37 0x000055e19bb8fec7 defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr)::$_2::operator()(fir::FirOpBuilder&) const /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertVariable.cpp:539:42
#38 0x000055e19bb8fe0d void std::__invoke_impl<void, defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr)::$_2&, fir::FirOpBuilder&>(std::__invoke_other, defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr)::$_2&, fir::FirOpBuilder&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/invoke.h:61:7
#39 0x000055e19bb8fdbd std::enable_if<is_invocable_r_v<void, defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr)::$_2&, fir::FirOpBuilder&>, void>::type std::__invoke_r<void, defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr)::$_2&, fir::FirOpBuilder&>(defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr)::$_2&, fir::FirOpBuilder&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/invoke.h:117:5
#40 0x000055e19bb8fca5 std::_Function_handler<void (fir::FirOpBuilder&), defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr)::$_2>::_M_invoke(std::_Any_data const&, fir::FirOpBuilder&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/std_function.h:290:2
#41 0x000055e19b8f74ad std::function<void (fir::FirOpBuilder&)>::operator()(fir::FirOpBuilder&) const /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/std_function.h:591:2
#42 0x000055e19bb8178d Fortran::lower::createGlobalInitialization(fir::FirOpBuilder&, fir::GlobalOp, std::function<void (fir::FirOpBuilder&)>) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertVariable.cpp:462:3
#43 0x000055e19bb897aa defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertVariable.cpp:535:7
#44 0x000055e19bb93081 declareGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertVariable.cpp:165:12
#45 0x000055e19bb8aac4 instantiateGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, Fortran::lower::SymMap&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertVariable.cpp:649:14
#46 0x000055e19bb80ca4 Fortran::lower::instantiateVariable(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, Fortran::lower::SymMap&, llvm::DenseMap<std::tuple<Fortran::semantics::Scope const*, unsigned long>, mlir::Value, llvm::DenseMapInfo<std::tuple<Fortran::semantics::Scope const*, unsigned long>, void>, llvm::detail::DenseMapPair<std::tuple<Fortran::semantics::Scope const*, unsigned long>, mlir::Value>>&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertVariable.cpp:2258:5
#47 0x000055e19bb8114f Fortran::lower::genInitialDataTarget(Fortran::lower::AbstractConverter&, mlir::Location, mlir::Type, Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, bool) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertVariable.cpp:233:24
#48 0x000055e19c13d0b1 genStructureComponentInit(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::semantics::Symbol const&, Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, mlir::Value) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertConstant.cpp:386:9
#49 0x000055e19c12a99c genInlinedStructureCtorLitImpl(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::evaluate::StructureConstructor const&, mlir::Type) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertConstant.cpp:507:11
#50 0x000055e19c12a406 Fortran::lower::genInlinedStructureCtorLit(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::evaluate::StructureConstructor const&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertConstant.cpp:810:10
#51 0x000055e19b7cc040 (anonymous namespace)::ScalarExprLowering::genval(Fortran::evaluate::StructureConstructor const&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertExpr.cpp:915:7
#52 0x000055e19b7cff1b auto fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&)::operator()<Fortran::evaluate::StructureConstructor>(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&) const /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertExpr.cpp:2966:53
#53 0x000055e19b7cfed8 Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> std::__invoke_impl<fir::ExtendedValue, fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&), Fortran::evaluate::StructureConstructor const&>(std::__invoke_other, fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&)&&, Fortran::evaluate::StructureConstructor const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/invoke.h:61:14
#54 0x000055e19b7cfe78 std::__invoke_result<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>, Fortran::evaluate::StructureConstructor const&>::type std::__invoke<fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&), Fortran::evaluate::StructureConstructor const&>(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>&&, Fortran::evaluate::StructureConstructor const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/invoke.h:96:14
#55 0x000055e19b7cfb40 std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<std::__detail::__variant::__deduce_visit_result<fir::ExtendedValue> (*)(fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&)&&, std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&)>, std::integer_sequence<unsigned long, 2ul>>::__visit_invoke(fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&)&&, std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/variant:1031:11
#56 0x000055e19b7cf9d0 decltype(auto) std::__do_visit<std::__detail::__variant::__deduce_visit_result<fir::ExtendedValue>, fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&), std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>(fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&)&&, std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/variant:1785:5
#57 0x000055e19b7cf82e std::invoke_result<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>, std::__conditional<is_lvalue_reference_v<std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>>::type<std::variant_alternative<0ul, std::remove_reference<decltype(__variant::__as(std::declval<std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>()))>::type>::type&, std::variant_alternative<0ul, std::remove_reference<decltype(__variant::__as(std::declval<std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>()))>::type>::type&&>>::type std::visit<fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&)::'lambda'(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5> const&), std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>(Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>&&, std::variant<Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::StructureConstructor, Fortran::evaluate::Designator<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>, Fortran::evaluate::Parentheses<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/variant:1846:13
#58 0x000055e19b7cf608 fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertExpr.cpp:2966:7
#59 0x000055e19b8f551b auto fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&)::operator()<Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>>(Fortran::evaluate::SomeType const&) const /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertExpr.cpp:2966:53
#60 0x000055e19b8f54d8 Fortran::evaluate::SomeType std::__invoke_impl<fir::ExtendedValue, fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&), Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&>(std::__invoke_other, fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&)&&, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/invoke.h:61:14
#61 0x000055e19b8f5478 std::__invoke_result<Fortran::evaluate::SomeType, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&>::type std::__invoke<fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&), Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&>(Fortran::evaluate::SomeType&&, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/invoke.h:96:14
#62 0x000055e19b8f4c60 std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<std::__detail::__variant::__deduce_visit_result<fir::ExtendedValue> (*)(fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&)&&, std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&)>, std::integer_sequence<unsigned long, 9ul>>::__visit_invoke(fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&)&&, std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/variant:1031:11
#63 0x000055e19b8f48fa decltype(auto) std::__do_visit<std::__detail::__variant::__deduce_visit_result<fir::ExtendedValue>, fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&), std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>(fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&)&&, std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/variant:1792:5
#64 0x000055e19b8f479e std::invoke_result<Fortran::evaluate::SomeType, std::__conditional<is_lvalue_reference_v<std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>>::type<std::variant_alternative<0ul, std::remove_reference<decltype(__variant::__as(std::declval<std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>()))>::type>::type&, std::variant_alternative<0ul, std::remove_reference<decltype(__variant::__as(std::declval<std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>()))>::type>::type&&>>::type std::visit<fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&)::'lambda'(Fortran::evaluate::SomeType const&), std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&>(Fortran::evaluate::SomeType&&, std::variant<Fortran::evaluate::value::Integer<128, true, 32, unsigned int, unsigned long>, Fortran::evaluate::NullPointer, Fortran::evaluate::ProcedureDesignator, Fortran::evaluate::ProcedureRef, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)0>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)2>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)3>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)4>>, Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>> const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/variant:1846:13
#65 0x000055e19b5d2278 fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertExpr.cpp:2966:7
#66 0x000055e19b5d23a6 Fortran::lower::createSomeInitializerExpression(mlir::Location, Fortran::lower::AbstractConverter&, Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, Fortran::lower::SymMap&, Fortran::lower::StatementContext&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertExpr.cpp:7260:3
#67 0x000055e19bb8dde3 genInitializerExprValue(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, Fortran::lower::StatementContext&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertVariable.cpp:128:10
#68 0x000055e19bb8fec7 defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr)::$_2::operator()(fir::FirOpBuilder&) const /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertVariable.cpp:539:42
#69 0x000055e19bb8fe0d void std::__invoke_impl<void, defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr)::$_2&, fir::FirOpBuilder&>(std::__invoke_other, defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr)::$_2&, fir::FirOpBuilder&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/invoke.h:61:7
#70 0x000055e19bb8fdbd std::enable_if<is_invocable_r_v<void, defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr)::$_2&, fir::FirOpBuilder&>, void>::type std::__invoke_r<void, defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr)::$_2&, fir::FirOpBuilder&>(defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr)::$_2&, fir::FirOpBuilder&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/invoke.h:117:5
#71 0x000055e19bb8fca5 std::_Function_handler<void (fir::FirOpBuilder&), defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr)::$_2>::_M_invoke(std::_Any_data const&, fir::FirOpBuilder&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/std_function.h:290:2
#72 0x000055e19b8f74ad std::function<void (fir::FirOpBuilder&)>::operator()(fir::FirOpBuilder&) const /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/std_function.h:591:2
#73 0x000055e19bb8178d Fortran::lower::createGlobalInitialization(fir::FirOpBuilder&, fir::GlobalOp, std::function<void (fir::FirOpBuilder&)>) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertVariable.cpp:462:3
#74 0x000055e19bb897aa defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertVariable.cpp:535:7
#75 0x000055e19bb8b5c4 Fortran::lower::createRuntimeTypeInfoGlobal(Fortran::lower::AbstractConverter&, Fortran::semantics::Symbol const&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/ConvertVariable.cpp:2346:3
#76 0x000055e19b0b9f79 (anonymous namespace)::TypeInfoConverter::createTypeInfoOpAndGlobal(Fortran::lower::AbstractConverter&, (anonymous namespace)::TypeInfoConverter::TypeInfo const&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/Bridge.cpp:195:5
#77 0x000055e19b0b9ea4 (anonymous namespace)::TypeInfoConverter::createTypeInfo(Fortran::lower::AbstractConverter&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/Bridge.cpp:182:33
#78 0x000055e19b0b9e12 (anonymous namespace)::FirConverter::run(Fortran::lower::pft::Program&)::'lambda0'()::operator()() const /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/Bridge.cpp:347:58
#79 0x000055e19b0b9de5 void std::__invoke_impl<void, (anonymous namespace)::FirConverter::run(Fortran::lower::pft::Program&)::'lambda0'()&>(std::__invoke_other, (anonymous namespace)::FirConverter::run(Fortran::lower::pft::Program&)::'lambda0'()&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/invoke.h:61:7
#80 0x000055e19b0b9d95 std::enable_if<is_invocable_r_v<void, (anonymous namespace)::FirConverter::run(Fortran::lower::pft::Program&)::'lambda0'()&>, void>::type std::__invoke_r<void, (anonymous namespace)::FirConverter::run(Fortran::lower::pft::Program&)::'lambda0'()&>((anonymous namespace)::FirConverter::run(Fortran::lower::pft::Program&)::'lambda0'()&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/invoke.h:117:5
#81 0x000055e19b0b9ccd std::_Function_handler<void (), (anonymous namespace)::FirConverter::run(Fortran::lower::pft::Program&)::'lambda0'()>::_M_invoke(std::_Any_data const&) /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/std_function.h:290:2
#82 0x000055e19ae22f85 std::function<void ()>::operator()() const /vast/home/tarun/gentoo/x86_64/usr/lib/gcc/x86_64-pc-linux-gnu/12.1.0/include/g++-v12/bits/std_function.h:591:2
#83 0x000055e19b0b0ba7 (anonymous namespace)::FirConverter::createGlobalOutsideOfFunctionLowering(std::function<void ()> const&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/Bridge.cpp:4821:37
#84 0x000055e19b06f603 (anonymous namespace)::FirConverter::run(Fortran::lower::pft::Program&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/Bridge.cpp:346:5
#85 0x000055e19b06f1b8 Fortran::lower::LoweringBridge::lower(Fortran::parser::Program const&, Fortran::semantics::SemanticsContext const&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Lower/Bridge.cpp:5327:13
#86 0x000055e19adef7f0 Fortran::frontend::CodeGenAction::beginSourceFileAction() /vast/home/tarun/projects/code/flang/repo/flang/lib/Frontend/FrontendActions.cpp:310:6
#87 0x000055e19addac05 Fortran::frontend::FrontendAction::beginSourceFile(Fortran::frontend::CompilerInstance&, Fortran::frontend::FrontendInputFile const&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Frontend/FrontendAction.cpp:104:7
#88 0x000055e19adad626 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) /vast/home/tarun/projects/code/flang/repo/flang/lib/Frontend/CompilerInstance.cpp:172:9
#89 0x000055e19ade3309 Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) /vast/home/tarun/projects/code/flang/repo/flang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:221:8
#90 0x000055e19adabf0d fc1_main(llvm::ArrayRef<char const*>, char const*) /vast/home/tarun/projects/code/flang/repo/flang/tools/flang-driver/fc1_main.cpp:67:11
#91 0x000055e19ada5878 executeFC1Tool(llvm::SmallVectorImpl<char const*>&) /vast/home/tarun/projects/code/flang/repo/flang/tools/flang-driver/driver.cpp:66:5
#92 0x000055e19ada5026 main /vast/home/tarun/projects/code/flang/repo/flang/tools/flang-driver/driver.cpp:109:7
#93 0x0000149e43c90d85 __libc_start_main (/lib/../lib64/libc.so.6+0x3ad85)
#94 0x000055e19ada4c5e _start (/vast/home/tarun/projects/workspace/x86_64/flang/install/debug/bin/flang-new+0x6fe2c5e)
flang-new: error: unable to execute command: Segmentation fault (core dumped)
flang-new: error: flang frontend command failed due to signal (use -v to see invocation)
flang-new version 19.0.0git (git@github.com:llvm-project-tlp/llvm-project.git 3fbac79064e405a54388d11370ab5a8f0f23914d)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /vast/home/tarun/projects/workspace/x86_64/flang/install/debug/bin
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/class_allocate_19-265f52
flang-new: note: diagnostic msg: /tmp/class_allocate_19-265f52.sh
flang-new: note: diagnostic msg: 

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

@tarunprabhu
Copy link
Contributor

Jean, as you suspected addrFieldTy is indeed becoming null. Unfortunately I might not have time to debug this in detail but I should be able to provide the values for other variables and function arguments if that might help.

@jeanPerier
Copy link
Contributor Author

Jean, as you suspected addrFieldTy is indeed becoming null. Unfortunately I might not have time to debug this in detail but I should be able to provide the values for other variables and function arguments if that might help.

No problem, thanks for finding the bug. Can you dump cPtrRecTy and addrFieldName with llvm::errs() before the crash? that will be a good starting point until I can reproduce the build. BTW, where you using libc++ with clang 17 to building flang, or a GNU libstdc++ version?

@tarunprabhu
Copy link
Contributor

tarunprabhu commented Mar 21, 2024

I use GNU libstdc++.

The values of various variables in the code are below. They were printed immediately after they were set.

componentTy: !fir.type<_QM__fortran_builtinsT__builtin_c_ptr{_QM__fortran_builtinsT__builtin_c_ptr.__address:i64}>
cPtrRecTy: !fir.type<_QM__fortran_builtinsT__builtin_c_ptr{_QM__fortran_builtinsT__builtin_c_ptr.__address:i64}>
addrFieldName: __address
addrFieldTy: <<NULL TYPE>>

[edit] Added GNU

@tarunprabhu
Copy link
Contributor

And the value of recTy printed just before componentTy

recTy: !fir.type<_QM__fortran_type_infoTcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,genre:i8,category:i8,kind:i8,rank:i8,__padding0:!fir.array<4xi8>,offset:i64,characterlen:!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>,derived:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype{binding:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTbinding{proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{_QM__fortran_builtinsT__builtin_c_funptr.__address:i64}>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>}>>>>,name:!fir.box<!fir.ptr<!fir.char<1,?>>>,sizeinbytes:i64,uninstantiated:!fir.box<!fir.ptr<!fir.type<_QM__fortran_type_infoTderivedtype>>>,kindparameter:!fir.box<!fir.ptr<!fir.array<?xi64>>>,lenparameterkind:!fir.box<!fir.ptr<!fir.array<?xi8>>>,component:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTcomponent>>>>,procptr:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTprocptrcomponent{name:!fir.box<!fir.ptr<!fir.char<1,?>>>,offset:i64,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{_QM__fortran_builtinsT__builtin_c_funptr.__address:i64}>}>>>>,special:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTspecialbinding{which:i8,isargdescriptorset:i8,istypebound:i8,isargcontiguousset:i8,__padding0:!fir.array<4xi8>,proc:!fir.type<_QM__fortran_builtinsT__builtin_c_funptr{_QM__fortran_builtinsT__builtin_c_funptr.__address:i64}>}>>>>,specialbitset:i32,hasparent:i8,noinitializationneeded:i8,nodestructionneeded:i8,nofinalizationneeded:i8,__padding0:!fir.array<4xi8>}>>>,lenvalue:!fir.box<!fir.ptr<!fir.array<?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,bounds:!fir.box<!fir.ptr<!fir.array<?x?x!fir.type<_QM__fortran_type_infoTvalue{genre:i8,__padding0:!fir.array<7xi8>,value:i64}>>>>,initialization:!fir.type<_QM__fortran_builtinsT__builtin_c_ptr{_QM__fortran_builtinsT__builtin_c_ptr.__address:i64}>}>

@jeanPerier
Copy link
Contributor Author

Thanks for this info @tarunprabhu!

I could not reproduce with a static release build with clang 17.0.6 + gcc 13.1.0 libstdc++.... Can you give more details about the exact clang version and libstdc++ you are using?

Looking at the info you provided, the issue is that the "_QM__fortran_builtinsT__builtin_c_ptr" was not properly lowered, its field should simply be __address. This could mean that this check failed in you case.

But I do not get why it is only failing for specific builds, and why your build is passing the rest of the tests while usages of C_PTR are ubiquitous in flang (it is used under the hood in the derived type info every time a derived type is used)... So the undefined behaviour may also be somewhere else.

@tarunprabhu
Copy link
Contributor

I use GNU libstdc++ 12.1.0 and clang 17.0.6.

I see the same error on a static release build and a non-static (LLVM_LINK_LLVM_DYLIB=ON) debug build of flang.

Thanks for the pointers, Jean. I'll do some debugging on my end and see if I can narrow things down even further.

@jeanPerier
Copy link
Contributor Author

@tarunprabhu, I opened an issue for class_allocate_19.f03 and left it disabled until further investigation, please double check that the updated patch works for you now.

@tarunprabhu
Copy link
Contributor

Thanks Jean,

Unfortunately, now I see a segfault in regression/pointer_array_5.f90. I don't have time right now to investigate this. I might be able to get to it the week after next.

If no one else is running into these issues, I am fine with merging this patch so it's not blocked on me.

0.	Program arguments: /vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new -fc1 -triple x86_64-unknown-linux-gnu -emit-obj -D NDEBUG -I /vast/home/tarun/projects/workspace/x86_64/flang/install/release/include/flang -I /dev/shm/x86_64/llvm-test-suite/default/Fortran/gfortran/regression/gfortran-regression-execute-regression__pointer_array_5_f90.wd -fcolor-diagnostics -mrelocation-model pic -pic-level 2 -pic-is-pie -target-cpu x86-64 -fversion-loops-for-stride -module-dir gfortran-regression-execute-regression__pointer_array_5_f90.wd -resource-dir /vast/home/tarun/projects/workspace/x86_64/flang/install/release/lib/clang/19 -mframe-pointer=none -O3 -o CMakeFiles/gfortran-regression-execute-regression__pointer_array_5_f90.dir/pointer_array_5.f90.o -x f95-cpp-input /vast/home/tarun/projects/code/llvm-test-suite/repo/Fortran/gfortran/regression/pointer_array_5.f90
 #0 0x000055c0f1195cf6 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x160dcf6)
 #1 0x000055c0f11938ce llvm::sys::RunSignalHandlers() (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x160b8ce)
 #2 0x000055c0f1196709 SignalHandler(int) Signals.cpp:0:0
 #3 0x0000153700c10cf0 __restore_rt (/lib/../lib64/libpthread.so.0+0x12cf0)
 #4 0x000055c0f2dd496b fir::FirOpBuilder::createConvert(mlir::Location, mlir::Type, mlir::Value) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x324c96b)
 #5 0x000055c0f1d7ac44 genStructureComponentInit(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::semantics::Symbol const&, Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, mlir::Value) ConvertConstant.cpp:0:0
 #6 0x000055c0f1d6339d genInlinedStructureCtorLitImpl(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::evaluate::StructureConstructor const&, mlir::Type) ConvertConstant.cpp:0:0
 #7 0x000055c0f1d8ef62 mlir::Value genInlinedArrayLit<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::lower::AbstractConverter&, mlir::Location, mlir::Type, Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&) ConvertConstant.cpp:0:0
 #8 0x000055c0f1d7616e Fortran::lower::ConstantBuilder<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>::gen(Fortran::lower::AbstractConverter&, mlir::Location, Fortran::evaluate::Constant<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&, bool) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x21ee16e)
 #9 0x000055c0f1aeb50c fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)5>> const&) ConvertExpr.cpp:0:0
#10 0x000055c0f19c16c9 fir::ExtendedValue (anonymous namespace)::ScalarExprLowering::genval<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&) ConvertExpr.cpp:0:0
#11 0x000055c0f19c18b0 Fortran::lower::createSomeInitializerExpression(mlir::Location, Fortran::lower::AbstractConverter&, Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, Fortran::lower::SymMap&, Fortran::lower::StatementContext&) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x1e398b0)
#12 0x000055c0f1bf862d std::_Function_handler<void (fir::FirOpBuilder&), defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr)::$_2>::_M_invoke(std::_Any_data const&, fir::FirOpBuilder&) ConvertVariable.cpp:0:0
#13 0x000055c0f1bd15f1 Fortran::lower::createGlobalInitialization(fir::FirOpBuilder&, fir::GlobalOp, std::function<void (fir::FirOpBuilder&)>) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x20495f1)
#14 0x000055c0f1bd9af5 defineGlobal(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, llvm::StringRef, mlir::StringAttr, fir::CUDADataAttributeAttr) ConvertVariable.cpp:0:0
#15 0x000055c0f1bcf8ea Fortran::lower::instantiateVariable(Fortran::lower::AbstractConverter&, Fortran::lower::pft::Variable const&, Fortran::lower::SymMap&, llvm::DenseMap<std::tuple<Fortran::semantics::Scope const*, unsigned long>, mlir::Value, llvm::DenseMapInfo<std::tuple<Fortran::semantics::Scope const*, unsigned long>, void>, llvm::detail::DenseMapPair<std::tuple<Fortran::semantics::Scope const*, unsigned long>, mlir::Value>>&) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x20478ea)
#16 0x000055c0f1982fb6 (anonymous namespace)::FirConverter::startNewFunction(Fortran::lower::pft::FunctionLikeUnit&) Bridge.cpp:0:0
#17 0x000055c0f198141d (anonymous namespace)::FirConverter::lowerFunc(Fortran::lower::pft::FunctionLikeUnit&) Bridge.cpp:0:0
#18 0x000055c0f18ef317 Fortran::lower::LoweringBridge::lower(Fortran::parser::Program const&, Fortran::semantics::SemanticsContext const&) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x1d67317)
#19 0x000055c0f17ed92c Fortran::frontend::CodeGenAction::beginSourceFileAction() (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x1c6592c)
#20 0x000055c0f11cefc9 Fortran::frontend::FrontendAction::beginSourceFile(Fortran::frontend::CompilerInstance&, Fortran::frontend::FrontendInputFile const&) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x1646fc9)
#21 0x000055c0f11b7ad3 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x162fad3)
#22 0x000055c0f11d3acd Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x164bacd)
#23 0x000055c0f0d3fa3b fc1_main(llvm::ArrayRef<char const*>, char const*) (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x11b7a3b)
#24 0x000055c0f0d3e05b main (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x11b605b)
#25 0x00001536ff7ded85 __libc_start_main (/lib/../lib64/libc.so.6+0x3ad85)
#26 0x000055c0f0d3daee _start (/vast/home/tarun/projects/workspace/x86_64/flang/install/release/bin/flang-new+0x11b5aee)

@tblah
Copy link
Contributor

tblah commented Apr 18, 2024

All still pass for me

(finalize_38a.f90 fails for me on your branch, but that is fixed on main in 10275ac)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants