Skip to content

Crash with label in block #870

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

Closed
ChuanqiXu9 opened this issue Sep 20, 2024 · 1 comment · Fixed by #875
Closed

Crash with label in block #870

ChuanqiXu9 opened this issue Sep 20, 2024 · 1 comment · Fixed by #875

Comments

@ChuanqiXu9
Copy link
Member

Reproducer:

// repro.c
struct Struct {};
struct Struct get_struct ();
void do_something (struct Struct);
void test (int cand)
{
  {
    label:
      do_something(get_struct());
  }
}

Compile it with clang -fclangir -c repro.c we can get:

loc("repro.c":8:5): error: must be the first operation in a block
fatal error: error in backend: CIR codegen: module verification error before running CIR passes
@ChuanqiXu9 ChuanqiXu9 changed the title Crash with label in blocl Crash with label in block Sep 20, 2024
@bcardosolopes
Copy link
Member

cc: @gitoleg

bcardosolopes added a commit that referenced this issue Sep 23, 2024
This PR fixes the case, when a temporary var is used, and `alloca`
operation is inserted in the block start before the `label` operation.
Implementation: when we search for the `alloca` place in a block, we
take label operations into account as well.

Fix #870

---------

Co-authored-by: Bruno Cardoso Lopes <bcardosolopes@users.noreply.github.com>
Hugobros3 pushed a commit to shady-gang/clangir that referenced this issue Oct 2, 2024
This PR fixes the case, when a temporary var is used, and `alloca`
operation is inserted in the block start before the `label` operation.
Implementation: when we search for the `alloca` place in a block, we
take label operations into account as well.

Fix llvm#870

---------

Co-authored-by: Bruno Cardoso Lopes <bcardosolopes@users.noreply.github.com>
smeenai pushed a commit to smeenai/clangir that referenced this issue Oct 9, 2024
This PR fixes the case, when a temporary var is used, and `alloca`
operation is inserted in the block start before the `label` operation.
Implementation: when we search for the `alloca` place in a block, we
take label operations into account as well.

Fix llvm#870

---------

Co-authored-by: Bruno Cardoso Lopes <bcardosolopes@users.noreply.github.com>
smeenai pushed a commit to smeenai/clangir that referenced this issue Oct 9, 2024
This PR fixes the case, when a temporary var is used, and `alloca`
operation is inserted in the block start before the `label` operation.
Implementation: when we search for the `alloca` place in a block, we
take label operations into account as well.

Fix llvm#870

---------

Co-authored-by: Bruno Cardoso Lopes <bcardosolopes@users.noreply.github.com>
smeenai pushed a commit to smeenai/clangir that referenced this issue Oct 9, 2024
This PR fixes the case, when a temporary var is used, and `alloca`
operation is inserted in the block start before the `label` operation.
Implementation: when we search for the `alloca` place in a block, we
take label operations into account as well.

Fix llvm#870

---------

Co-authored-by: Bruno Cardoso Lopes <bcardosolopes@users.noreply.github.com>
keryell pushed a commit to keryell/clangir that referenced this issue Oct 19, 2024
This PR fixes the case, when a temporary var is used, and `alloca`
operation is inserted in the block start before the `label` operation.
Implementation: when we search for the `alloca` place in a block, we
take label operations into account as well.

Fix llvm#870

---------

Co-authored-by: Bruno Cardoso Lopes <bcardosolopes@users.noreply.github.com>
lanza pushed a commit that referenced this issue Nov 5, 2024
This PR fixes the case, when a temporary var is used, and `alloca`
operation is inserted in the block start before the `label` operation.
Implementation: when we search for the `alloca` place in a block, we
take label operations into account as well.

Fix #870

---------

Co-authored-by: Bruno Cardoso Lopes <bcardosolopes@users.noreply.github.com>
lanza pushed a commit that referenced this issue Mar 18, 2025
This PR fixes the case, when a temporary var is used, and `alloca`
operation is inserted in the block start before the `label` operation.
Implementation: when we search for the `alloca` place in a block, we
take label operations into account as well.

Fix #870

---------

Co-authored-by: Bruno Cardoso Lopes <bcardosolopes@users.noreply.github.com>
xlauko pushed a commit to trailofbits/instafix-llvm that referenced this issue Mar 28, 2025
This PR fixes the case, when a temporary var is used, and `alloca`
operation is inserted in the block start before the `label` operation.
Implementation: when we search for the `alloca` place in a block, we
take label operations into account as well.

Fix llvm/clangir#870

---------

Co-authored-by: Bruno Cardoso Lopes <bcardosolopes@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants