rust-lang / rust-lang/rustc_codegen_gcc

Support filter for exception handling

Open
#264 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement libgccjit
Dominant language
Rust
Stars
1.2k
Forks
105
Avg merge
8h 20m
Merged PRs (30d)
14

Description

https://github.com/rust-lang/rust/pull/104070#discussion_r1161104939

For this C++:

void b() noexcept {
    f();
}

we get this gimple:

void b ()
{
  try
    {
      f ();
    }
  catch
    {
      <<<eh_must_not_throw (terminate)>>>
    }
}

Seems like we just need to set TRY_CATCH_IS_CLEANUP on TRY_CATCH_EXPR.

EH_FILTER_EXPR might be better.

The test tests/run-make/forced-unwind-terminate-pof tests this.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/run-make/forced-unwind-terminate-pof and the linked Rust PR discussion. Compare the generated GIMPLE for the noexcept example, then determine whether TRY_CATCH_IS_CLEANUP or EH_FILTER_EXPR gives the intended exception handling; done when the test covers the expected terminate behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.