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

Error : Verify Failed , when using --fast #1668

Closed
Tracked by #1600
gptsarthak opened this issue Apr 5, 2023 · 1 comment · Fixed by #1688
Closed
Tracked by #1600

Error : Verify Failed , when using --fast #1668

gptsarthak opened this issue Apr 5, 2023 · 1 comment · Fixed by #1688
Labels
bug Something isn't working

Comments

@gptsarthak
Copy link
Contributor

Came across this error when trying out benchmarks. Error occurs only when compiling with the --fast optimization.

def func() -> i32:
     return 30

def test() -> i32:
    temp: i32 = func()
    return temp

x : i32 
x = test()
print(x)
(lp) sarthak@pop-os:~/lpython$ lpython examples/test.py
30
(lp) sarthak@pop-os:~/lpython$ lpython --fast examples/test.py
ASR verify pass error: ASR verify: Block ~empty_block should resolve in current scope.
Internal Compiler Error: Unhandled exception
Traceback (most recent call last):
  Binary file "/home/sarthak/lpython/src/bin/lpython", in _start()
  File "./csu/../csu/libc-start.c", line 392, in __libc_start_main_impl()
  File "./csu/../sysdeps/nptl/libc_start_call_main.h", line 58, in __libc_start_call_main()
  File "/home/sarthak/lpython/src/bin/lpython.cpp", line 1750, in ??
    err = compile_python_to_object_file(arg_file, tmp_o, runtime_library_dir,
  File "/home/sarthak/lpython/src/bin/lpython.cpp", line 750, in ??
    res = fe.get_llvm3(*asr, pass_manager, diagnostics, infile);
  File "/home/sarthak/lpython/src/lpython/python_evaluator.cpp", line 58, in LCompilers::PythonCompiler::get_llvm3(LCompilers::ASR::TranslationUnit_t&, LCompilers::PassManager&, LCompilers::diag::Diagnostics&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    run_fn, infile);
  File "/home/sarthak/lpython/src/libasr/codegen/asr_to_llvm.cpp", line 7027, in LCompilers::asr_to_llvm(LCompilers::ASR::TranslationUnit_t&, LCompilers::diag::Diagnostics&, llvm::LLVMContext&, Allocator&, LCompilers::PassManager&, LCompilers::CompilerOptions&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    pass_manager.apply_passes(al, &asr, pass_options, diagnostics);
  File "/home/sarthak/lpython/src/libasr/pass/pass_manager.h", line 214, in LCompilers::PassManager::apply_passes(Allocator&, LCompilers::ASR::TranslationUnit_t*, LCompilers::PassOptions&, LCompilers::diag::Diagnostics&)
    _apply_passes(al, asr, _with_optimization_passes, pass_options,
LCompilersException: Verify failed
@certik certik added the bug Something isn't working label Apr 5, 2023
@certik certik mentioned this issue Apr 5, 2023
38 tasks
@certik
Copy link
Contributor

certik commented Apr 5, 2023

Thanks for reporting it, I added this to #1600. I think we need to start testing with --fast in our integration_tests to catch this earlier (#1669).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants