-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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] ICE on atand(x, y)
#78568
Comments
@llvm/issue-subscribers-flang-ir Author: None (k-arrows)
Reproducer (use command line `flang-new atand.f90`)
```console
$ cat atand.f90
program p
real x, y
x = 1.
y = x
print *, atand(x, y)
end
```
Assertion failure: flang-new: /tmp/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp:2124: mlir::Value fir::IntrinsicLibrary::genAtand(mlir::Type, llvm::ArrayRef<mlir::Value>): Assertion `args.size() == 1' failed. Stack dump: #<!-- -->0 0x000055e0852b1e2f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
#<!-- -->1 0x000055e0852b24b0 SignalHandler(int) Signals.cpp:0:0
#<!-- -->2 0x00007f53036af520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#<!-- -->3 0x00007f5303703a7c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#<!-- -->4 0x00007f5303703a7c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#<!-- -->5 0x00007f5303703a7c pthread_kill ./nptl/pthread_kill.c:89:10
#<!-- -->6 0x00007f53036af476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#<!-- -->7 0x00007f53036957f3 abort ./stdlib/abort.c:81:7
#<!-- -->8 0x00007f530369571b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#<!-- -->9 0x00007f53036a6e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#<!-- -->10 0x000055e086374b7d fir::IntrinsicLibrary::genAtand(mlir::Type, llvm::ArrayRef<mlir::Value>)
#<!-- -->11 0x000055e086392ff4 fir::ExtendedValue fir::IntrinsicLibrary::genElementalCall<mlir::Value (fir::IntrinsicLibrary::*)(mlir::Type, llvm::ArrayRef<mlir::Value>)>(mlir::Value (fir::IntrinsicLibrary::*)(mlir::Type, llvm::ArrayRef<mlir::Value>), llvm::StringRef, mlir::Type, llvm::ArrayRef<fir::ExtendedValue>, bool)
#<!-- -->12 0x000055e086392ea2 fir::invokeHandler(mlir::Value (fir::IntrinsicLibrary::*)(mlir::Type, llvm::ArrayRef<mlir::Value>), fir::IntrinsicHandler const&, std::optional<mlir::Type>, llvm::ArrayRef<fir::ExtendedValue>, bool, fir::IntrinsicLibrary&) IntrinsicCall.cpp:0:0
#<!-- -->13 0x000055e086392d7c std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<std::__detail::__variant::__deduce_visit_result<fir::ExtendedValue> (*)(fir::IntrinsicLibrary::genIntrinsicCall(llvm::StringRef, std::optional<mlir::Type>, llvm::ArrayRef<fir::ExtendedValue>)::$_1&&, std::variant<mlir::Value (fir::IntrinsicLibrary::*)(mlir::Type, llvm::ArrayRef<mlir::Value>), fir::ExtendedValue (fir::IntrinsicLibrary::*)(mlir::Type, llvm::ArrayRef<fir::ExtendedValue>), void (fir::IntrinsicLibrary::*)(llvm::ArrayRef<fir::ExtendedValue>)> const&)>, std::integer_sequence<unsigned long, 0ul>>::__visit_invoke(fir::IntrinsicLibrary::genIntrinsicCall(llvm::StringRef, std::optional<mlir::Type>, llvm::ArrayRef<fir::ExtendedValue>)::$_1&&, std::variant<mlir::Value (fir::IntrinsicLibrary::*)(mlir::Type, llvm::ArrayRef<mlir::Value>), fir::ExtendedValue (fir::IntrinsicLibrary::*)(mlir::Type, llvm::ArrayRef<fir::ExtendedValue>), void (fir::IntrinsicLibrary::*)(llvm::ArrayRef<fir::ExtendedValue>)> const&) IntrinsicCall.cpp:0:0
#<!-- -->14 0x000055e0863723ce fir::IntrinsicLibrary::genIntrinsicCall(llvm::StringRef, std::optional<mlir::Type>, llvm::ArrayRef<fir::ExtendedValue>)
#<!-- -->15 0x000055e08638c596 fir::genIntrinsicCall(fir::FirOpBuilder&, mlir::Location, llvm::StringRef, std::optional<mlir::Type>, llvm::ArrayRef<fir::ExtendedValue>, Fortran::lower::AbstractConverter*)
#<!-- -->16 0x000055e0857d42c9 genIntrinsicRefCore(llvm::SmallVector<std::optional<Fortran::lower::PreparedActualArgument>, 1u>&, Fortran::evaluate::SpecificIntrinsic const*, fir::IntrinsicArgumentLoweringRules const*, (anonymous namespace)::CallContext&) ConvertCall.cpp:0:0
#<!-- -->17 0x000055e0857d1284 genHLFIRIntrinsicRefCore(llvm::SmallVector<std::optional<Fortran::lower::PreparedActualArgument>, 1u>&, Fortran::evaluate::SpecificIntrinsic const*, fir::IntrinsicArgumentLoweringRules const*, (anonymous namespace)::CallContext&) ConvertCall.cpp:0:0
#<!-- -->18 0x000055e0857d02c8 genIntrinsicRef(Fortran::evaluate::SpecificIntrinsic const*, (anonymous namespace)::CallContext&) ConvertCall.cpp:0:0
#<!-- -->19 0x000055e0857cc428 Fortran::lower::convertCallToHLFIR(mlir::Location, Fortran::lower::AbstractConverter&, Fortran::evaluate::ProcedureRef const&, std::optional<mlir::Type>, Fortran::lower::SymMap&, Fortran::lower::StatementContext&)
#<!-- -->20 0x000055e085914c70 std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<std::__detail::__variant::__deduce_visit_result<hlfir::EntityWithAttributes> (*)(hlfir::EntityWithAttributes (anonymous namespace)::HlfirBuilder::gen<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>(Fortran::evaluate::Expr<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>> const&)::'lambda'(Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4> const&)&&, std::variant<Fortran::evaluate::ComplexComponent<4>, Fortran::evaluate::Parentheses<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Negate<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Add<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Subtract<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Multiply<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Divide<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Power<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::RealToIntPower<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Extremum<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Convert<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>, (Fortran::common::TypeCategory)0>, Fortran::evaluate::Convert<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>, (Fortran::common::TypeCategory)1>, Fortran::evaluate::Constant<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Designator<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>> const&)>, std::integer_sequence<unsigned long, 15ul>>::__visit_invoke(hlfir::EntityWithAttributes (anonymous namespace)::HlfirBuilder::gen<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>(Fortran::evaluate::Expr<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>> const&)::'lambda'(Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4> const&)&&, std::variant<Fortran::evaluate::ComplexComponent<4>, Fortran::evaluate::Parentheses<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Negate<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Add<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Subtract<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Multiply<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Divide<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Power<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::RealToIntPower<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Extremum<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Convert<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>, (Fortran::common::TypeCategory)0>, Fortran::evaluate::Convert<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>, (Fortran::common::TypeCategory)1>, Fortran::evaluate::Constant<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Designator<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>> const&) ConvertExprToHLFIR.cpp:0:0
#<!-- -->21 0x000055e085912d8b hlfir::EntityWithAttributes (anonymous namespace)::HlfirBuilder::gen<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>(Fortran::evaluate::Expr<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>> const&) ConvertExprToHLFIR.cpp:0:0
#<!-- -->22 0x000055e085904af7 hlfir::EntityWithAttributes (anonymous namespace)::HlfirBuilder::gen<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>> const&) ConvertExprToHLFIR.cpp:0:0
#<!-- -->23 0x000055e0858fb2e8 hlfir::EntityWithAttributes (anonymous namespace)::HlfirBuilder::gen<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&) ConvertExprToHLFIR.cpp:0:0
#<!-- -->24 0x000055e0858fb7fd Fortran::lower::convertExprToValue(mlir::Location, Fortran::lower::AbstractConverter&, Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, Fortran::lower::SymMap&, Fortran::lower::StatementContext&)
#<!-- -->25 0x000055e08576acdb (anonymous namespace)::FirConverter::genExprValue(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, Fortran::lower::StatementContext&, mlir::Location*) Bridge.cpp:0:0
#<!-- -->26 0x000055e0859802cc genOutputItemList(Fortran::lower::AbstractConverter&, mlir::Value, std::__cxx11::list<Fortran::parser::OutputItem, std::allocator<Fortran::parser::OutputItem>> const&, bool, bool, mlir::Value&, bool) IO.cpp:0:0
#<!-- -->27 0x000055e08597d063 Fortran::lower::genPrintStatement(Fortran::lower::AbstractConverter&, Fortran::parser::PrintStmt const&)
#<!-- -->28 0x000055e085786fe5 (anonymous namespace)::FirConverter::genFIR(Fortran::lower::pft::Evaluation&, bool) Bridge.cpp:0:0
#<!-- -->29 0x000055e0857b9db7 (anonymous namespace)::FirConverter::lowerFunc(Fortran::lower::pft::FunctionLikeUnit&) Bridge.cpp:0:0
#<!-- -->30 0x000055e0857690b3 Fortran::lower::LoweringBridge::lower(Fortran::parser::Program const&, Fortran::semantics::SemanticsContext const&)
#<!-- -->31 0x000055e0856ceba3 Fortran::frontend::CodeGenAction::beginSourceFileAction()
#<!-- -->32 0x000055e0852d47ef Fortran::frontend::FrontendAction::beginSourceFile(Fortran::frontend::CompilerInstance&, Fortran::frontend::FrontendInputFile const&)
#<!-- -->33 0x000055e0852c98b9 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&)
#<!-- -->34 0x000055e0852d7a3e Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*)
#<!-- -->35 0x000055e084f9243d fc1_main(llvm::ArrayRef<char const*>, char const*)
#<!-- -->36 0x000055e084f91426 main
#<!-- -->37 0x00007f5303696d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#<!-- -->38 0x00007f5303696e40 call_init ./csu/../csu/libc-start.c:128:20
#<!-- -->39 0x00007f5303696e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#<!-- -->40 0x000055e084f90985 _start
flang-new: error: unable to execute command: Aborted
flang-new: error: flang frontend command failed due to signal (use -v to see invocation)
flang-new version 18.0.0git (https://github.com/llvm/llvm-project.git 651a42ff65c3afc2a2ec6c7fc19009387757d686)
Target: x86_64-unknown-linux-gnu |
@llvm/issue-subscribers-bug Author: None (k-arrows)
Reproducer (use command line `flang-new atand.f90`)
```console
$ cat atand.f90
program p
real x, y
x = 1.
y = x
print *, atand(x, y)
end
```
Assertion failure: flang-new: /tmp/llvm-project/flang/lib/Optimizer/Builder/IntrinsicCall.cpp:2124: mlir::Value fir::IntrinsicLibrary::genAtand(mlir::Type, llvm::ArrayRef<mlir::Value>): Assertion `args.size() == 1' failed. Stack dump: #<!-- -->0 0x000055e0852b1e2f llvm::sys::PrintStackTrace(llvm::raw_ostream&, int)
#<!-- -->1 0x000055e0852b24b0 SignalHandler(int) Signals.cpp:0:0
#<!-- -->2 0x00007f53036af520 (/lib/x86_64-linux-gnu/libc.so.6+0x42520)
#<!-- -->3 0x00007f5303703a7c __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
#<!-- -->4 0x00007f5303703a7c __pthread_kill_internal ./nptl/pthread_kill.c:78:10
#<!-- -->5 0x00007f5303703a7c pthread_kill ./nptl/pthread_kill.c:89:10
#<!-- -->6 0x00007f53036af476 gsignal ./signal/../sysdeps/posix/raise.c:27:6
#<!-- -->7 0x00007f53036957f3 abort ./stdlib/abort.c:81:7
#<!-- -->8 0x00007f530369571b _nl_load_domain ./intl/loadmsgcat.c:1177:9
#<!-- -->9 0x00007f53036a6e96 (/lib/x86_64-linux-gnu/libc.so.6+0x39e96)
#<!-- -->10 0x000055e086374b7d fir::IntrinsicLibrary::genAtand(mlir::Type, llvm::ArrayRef<mlir::Value>)
#<!-- -->11 0x000055e086392ff4 fir::ExtendedValue fir::IntrinsicLibrary::genElementalCall<mlir::Value (fir::IntrinsicLibrary::*)(mlir::Type, llvm::ArrayRef<mlir::Value>)>(mlir::Value (fir::IntrinsicLibrary::*)(mlir::Type, llvm::ArrayRef<mlir::Value>), llvm::StringRef, mlir::Type, llvm::ArrayRef<fir::ExtendedValue>, bool)
#<!-- -->12 0x000055e086392ea2 fir::invokeHandler(mlir::Value (fir::IntrinsicLibrary::*)(mlir::Type, llvm::ArrayRef<mlir::Value>), fir::IntrinsicHandler const&, std::optional<mlir::Type>, llvm::ArrayRef<fir::ExtendedValue>, bool, fir::IntrinsicLibrary&) IntrinsicCall.cpp:0:0
#<!-- -->13 0x000055e086392d7c std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<std::__detail::__variant::__deduce_visit_result<fir::ExtendedValue> (*)(fir::IntrinsicLibrary::genIntrinsicCall(llvm::StringRef, std::optional<mlir::Type>, llvm::ArrayRef<fir::ExtendedValue>)::$_1&&, std::variant<mlir::Value (fir::IntrinsicLibrary::*)(mlir::Type, llvm::ArrayRef<mlir::Value>), fir::ExtendedValue (fir::IntrinsicLibrary::*)(mlir::Type, llvm::ArrayRef<fir::ExtendedValue>), void (fir::IntrinsicLibrary::*)(llvm::ArrayRef<fir::ExtendedValue>)> const&)>, std::integer_sequence<unsigned long, 0ul>>::__visit_invoke(fir::IntrinsicLibrary::genIntrinsicCall(llvm::StringRef, std::optional<mlir::Type>, llvm::ArrayRef<fir::ExtendedValue>)::$_1&&, std::variant<mlir::Value (fir::IntrinsicLibrary::*)(mlir::Type, llvm::ArrayRef<mlir::Value>), fir::ExtendedValue (fir::IntrinsicLibrary::*)(mlir::Type, llvm::ArrayRef<fir::ExtendedValue>), void (fir::IntrinsicLibrary::*)(llvm::ArrayRef<fir::ExtendedValue>)> const&) IntrinsicCall.cpp:0:0
#<!-- -->14 0x000055e0863723ce fir::IntrinsicLibrary::genIntrinsicCall(llvm::StringRef, std::optional<mlir::Type>, llvm::ArrayRef<fir::ExtendedValue>)
#<!-- -->15 0x000055e08638c596 fir::genIntrinsicCall(fir::FirOpBuilder&, mlir::Location, llvm::StringRef, std::optional<mlir::Type>, llvm::ArrayRef<fir::ExtendedValue>, Fortran::lower::AbstractConverter*)
#<!-- -->16 0x000055e0857d42c9 genIntrinsicRefCore(llvm::SmallVector<std::optional<Fortran::lower::PreparedActualArgument>, 1u>&, Fortran::evaluate::SpecificIntrinsic const*, fir::IntrinsicArgumentLoweringRules const*, (anonymous namespace)::CallContext&) ConvertCall.cpp:0:0
#<!-- -->17 0x000055e0857d1284 genHLFIRIntrinsicRefCore(llvm::SmallVector<std::optional<Fortran::lower::PreparedActualArgument>, 1u>&, Fortran::evaluate::SpecificIntrinsic const*, fir::IntrinsicArgumentLoweringRules const*, (anonymous namespace)::CallContext&) ConvertCall.cpp:0:0
#<!-- -->18 0x000055e0857d02c8 genIntrinsicRef(Fortran::evaluate::SpecificIntrinsic const*, (anonymous namespace)::CallContext&) ConvertCall.cpp:0:0
#<!-- -->19 0x000055e0857cc428 Fortran::lower::convertCallToHLFIR(mlir::Location, Fortran::lower::AbstractConverter&, Fortran::evaluate::ProcedureRef const&, std::optional<mlir::Type>, Fortran::lower::SymMap&, Fortran::lower::StatementContext&)
#<!-- -->20 0x000055e085914c70 std::__detail::__variant::__gen_vtable_impl<std::__detail::__variant::_Multi_array<std::__detail::__variant::__deduce_visit_result<hlfir::EntityWithAttributes> (*)(hlfir::EntityWithAttributes (anonymous namespace)::HlfirBuilder::gen<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>(Fortran::evaluate::Expr<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>> const&)::'lambda'(Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4> const&)&&, std::variant<Fortran::evaluate::ComplexComponent<4>, Fortran::evaluate::Parentheses<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Negate<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Add<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Subtract<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Multiply<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Divide<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Power<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::RealToIntPower<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Extremum<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Convert<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>, (Fortran::common::TypeCategory)0>, Fortran::evaluate::Convert<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>, (Fortran::common::TypeCategory)1>, Fortran::evaluate::Constant<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Designator<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>> const&)>, std::integer_sequence<unsigned long, 15ul>>::__visit_invoke(hlfir::EntityWithAttributes (anonymous namespace)::HlfirBuilder::gen<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>(Fortran::evaluate::Expr<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>> const&)::'lambda'(Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4> const&)&&, std::variant<Fortran::evaluate::ComplexComponent<4>, Fortran::evaluate::Parentheses<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Negate<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Add<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Subtract<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Multiply<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Divide<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Power<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::RealToIntPower<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Extremum<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Convert<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>, (Fortran::common::TypeCategory)0>, Fortran::evaluate::Convert<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>, (Fortran::common::TypeCategory)1>, Fortran::evaluate::Constant<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::ArrayConstructor<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::Designator<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>, Fortran::evaluate::FunctionRef<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>> const&) ConvertExprToHLFIR.cpp:0:0
#<!-- -->21 0x000055e085912d8b hlfir::EntityWithAttributes (anonymous namespace)::HlfirBuilder::gen<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>>(Fortran::evaluate::Expr<Fortran::evaluate::Type<(Fortran::common::TypeCategory)1, 4>> const&) ConvertExprToHLFIR.cpp:0:0
#<!-- -->22 0x000055e085904af7 hlfir::EntityWithAttributes (anonymous namespace)::HlfirBuilder::gen<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>>(Fortran::evaluate::Expr<Fortran::evaluate::SomeKind<(Fortran::common::TypeCategory)1>> const&) ConvertExprToHLFIR.cpp:0:0
#<!-- -->23 0x000055e0858fb2e8 hlfir::EntityWithAttributes (anonymous namespace)::HlfirBuilder::gen<Fortran::evaluate::SomeType>(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&) ConvertExprToHLFIR.cpp:0:0
#<!-- -->24 0x000055e0858fb7fd Fortran::lower::convertExprToValue(mlir::Location, Fortran::lower::AbstractConverter&, Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, Fortran::lower::SymMap&, Fortran::lower::StatementContext&)
#<!-- -->25 0x000055e08576acdb (anonymous namespace)::FirConverter::genExprValue(Fortran::evaluate::Expr<Fortran::evaluate::SomeType> const&, Fortran::lower::StatementContext&, mlir::Location*) Bridge.cpp:0:0
#<!-- -->26 0x000055e0859802cc genOutputItemList(Fortran::lower::AbstractConverter&, mlir::Value, std::__cxx11::list<Fortran::parser::OutputItem, std::allocator<Fortran::parser::OutputItem>> const&, bool, bool, mlir::Value&, bool) IO.cpp:0:0
#<!-- -->27 0x000055e08597d063 Fortran::lower::genPrintStatement(Fortran::lower::AbstractConverter&, Fortran::parser::PrintStmt const&)
#<!-- -->28 0x000055e085786fe5 (anonymous namespace)::FirConverter::genFIR(Fortran::lower::pft::Evaluation&, bool) Bridge.cpp:0:0
#<!-- -->29 0x000055e0857b9db7 (anonymous namespace)::FirConverter::lowerFunc(Fortran::lower::pft::FunctionLikeUnit&) Bridge.cpp:0:0
#<!-- -->30 0x000055e0857690b3 Fortran::lower::LoweringBridge::lower(Fortran::parser::Program const&, Fortran::semantics::SemanticsContext const&)
#<!-- -->31 0x000055e0856ceba3 Fortran::frontend::CodeGenAction::beginSourceFileAction()
#<!-- -->32 0x000055e0852d47ef Fortran::frontend::FrontendAction::beginSourceFile(Fortran::frontend::CompilerInstance&, Fortran::frontend::FrontendInputFile const&)
#<!-- -->33 0x000055e0852c98b9 Fortran::frontend::CompilerInstance::executeAction(Fortran::frontend::FrontendAction&)
#<!-- -->34 0x000055e0852d7a3e Fortran::frontend::executeCompilerInvocation(Fortran::frontend::CompilerInstance*)
#<!-- -->35 0x000055e084f9243d fc1_main(llvm::ArrayRef<char const*>, char const*)
#<!-- -->36 0x000055e084f91426 main
#<!-- -->37 0x00007f5303696d90 __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#<!-- -->38 0x00007f5303696e40 call_init ./csu/../csu/libc-start.c:128:20
#<!-- -->39 0x00007f5303696e40 __libc_start_main ./csu/../csu/libc-start.c:379:5
#<!-- -->40 0x000055e084f90985 _start
flang-new: error: unable to execute command: Aborted
flang-new: error: flang frontend command failed due to signal (use -v to see invocation)
flang-new version 18.0.0git (https://github.com/llvm/llvm-project.git 651a42ff65c3afc2a2ec6c7fc19009387757d686)
Target: x86_64-unknown-linux-gnu |
It seems that you found this here. |
Thank you for pointing that out. I should have written down the source. |
It seems that atand was introduced to flang in D144885. |
@yi-wu-arm Could you have a look when you get some time. |
This is because
atand(X) , while the intrinsics table have both twohttps://github.com/llvm/llvm-project/blob/2c78f3b86007fbf56a6f40b647b5cb757c082215/flang/lib/Evaluate/intrinsics.cpp#L335C1-L338C70 Working on providing a fix for this. |
Documented on https://gcc.gnu.org/onlinedocs/gcc-7.5.0/gfortran/ATAND.html :
But I couldn't find the doc for |
gfortran's documentation is correct. |
The working draft standard 2023:
https://j3-fortran.org/doc/year/24/24-007.pdf |
…pi(Y,X), atan2pi(Y,X) (llvm#79002) Fix: llvm#78568 --------- Co-authored-by: jeanPerier <jean.perier.polytechnique@gmail.com>
Reproducer (use command line
flang-new atand.f90
)Assertion failure:
Stack dump:
The text was updated successfully, but these errors were encountered: