Skip to content

LLVM: Stored value type does not match pointer operand type #1898

Open

Description

@certik
def main():
    siz: Const[u8] = u8(128)
    ai16: i16[siz] = empty(siz, dtype=int16)

main()

This gives:

code generation error: asr_to_llvm: module failed verification. Error:
Stored value type does not match pointer operand type!
  store i8 0, i32* %9, align 1
 i32Stored value type does not match pointer operand type!
  store i8 -128, i32* %10, align 1
 i32Stored value type does not match pointer operand type!
  store i8 -128, i32* %11, align 1
 i32

We should understand where these are coming from, and fix it. Most likely we need to give an error message in AST->ASR, and then also in verify(), or in the LLVM backend.

Activity

  1. Thirumalai-Shaktivel commented on Jul 5, 2023

    @Thirumalai-Shaktivel
    Collaborator

    Now we get:

    $ lpython examples/expr2.py
    ASR verify pass error: ASR verify: Start dimension must be a signed integer
    Internal Compiler Error: Unhandled exception
    Traceback (most recent call last):
      File "/Users/thirumalai/Open_Source/lpython/src/bin/lpython.cpp", line 1844
        err = compile_python_to_object_file(arg_file, tmp_o, runtime_library_dir,
      File "/Users/thirumalai/Open_Source/lpython/src/bin/lpython.cpp", line 783
        r1 = LCompilers::LPython::python_ast_to_asr(al, lm, nullptr, *ast, diagnostics, compiler_options,
      File "/Users/thirumalai/Open_Source/lpython/src/lpython/semantics/python_ast_to_asr.cpp", line 7679
        throw LCompilersException("Verify failed");
    LCompilersException: Verify failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions