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: verification error after IR construction #351

Closed
deadprogram opened this issue May 14, 2019 · 9 comments
Closed

error: verification error after IR construction #351

deadprogram opened this issue May 14, 2019 · 9 comments
Labels
bug Something isn't working
Milestone

Comments

@deadprogram
Copy link
Member

When building the https://github.com/tinygo-org/drivers/tree/master/examples/espat/espconsole example as part of the build in the smoke test, the following error is now appearing:

$ tinygo build -size short -o test.elf -target=itsybitsy-m0 ./examples/espat/espconsole/main.go
conflicting debug info for argument
  call void @llvm.dbg.value(metadata i8* %0, metadata !30275, metadata !DIExpression(DW_OP_LLVM_fragment, 0, 32)), !dbg !30291
!30280 = !DILocalVariable(name: "s", arg: 1, scope: !30278, file: !29386, line: 171, type: !127)
!30275 = !DILocalVariable(name: "s", arg: 1, scope: !30270, file: !30271, line: 150, type: !127)
conflicting debug info for argument
  call void @llvm.dbg.value(metadata i8 %2, metadata !30276, metadata !DIExpression()), !dbg !30291
!30281 = !DILocalVariable(name: "c", arg: 2, scope: !30278, file: !29386, line: 171, type: !162)
!30276 = !DILocalVariable(name: "c", arg: 2, scope: !30270, file: !30271, line: 150, type: !162)
error: verification error after IR construction
@deadprogram
Copy link
Member Author

Verified that I can reproduce same issue on my machine.

@deadprogram deadprogram added the bug Something isn't working label May 14, 2019
@deadprogram
Copy link
Member Author

From using git bisect it would appear that commit 371c468 is what introduced this error:

$ git bisect bad 3c2639ad5520434a37488cedf3917630e7266964
Bisecting: 0 revisions left to test after this (roughly 1 step)
[371c468e8efcc6c415c4e955e69fc6072698f578] compiler: add debug info for function arguments

@aykevl
Copy link
Member

aykevl commented May 14, 2019

Thanks, will have to investigate. As a workaround, you can add -no-debug.

@aykevl
Copy link
Member

aykevl commented May 14, 2019

Thinking of it, perhaps we should also run the driver smoke tests as part of the compiler CI? That would catch bugs like these.

@deadprogram
Copy link
Member Author

I was thinking about exactly that. Seems like a very good idea.

@aykevl
Copy link
Member

aykevl commented May 14, 2019

... really weird, a function is being defined twice. And the first one is incorrect. This is probably an already existing bug that only surfaces after adding debug info.

@aykevl
Copy link
Member

aykevl commented May 14, 2019

This is the cause: golang/go@ad4a58e

@aykevl
Copy link
Member

aykevl commented May 14, 2019

See #352.

@deadprogram
Copy link
Member Author

Verified locally:

$ tinygo build -size short -o ./build/test.elf -target=itsybitsy-m0 ./examples/espat/espconsole/main.go

   code    data     bss |   flash     ram
  23184    1420    4468 |   24604    5888

Looks good!

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

No branches or pull requests

2 participants