]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: fix ICE on break with a label and a value
authorLucas Ly Ba <lucas.ly-ba@outlook.com>
Sat, 27 Jun 2026 19:15:51 +0000 (21:15 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Wed, 8 Jul 2026 15:22:49 +0000 (17:22 +0200)
commit34f5c37de80098cee2f29718dbaaae81355c1fac
treeba46b81f1a5fb073b248352a8ecbb555053eaa5e
parent55552cd4acbe884b6bf5e5783aa7a5a126a117a6
gccrs: fix ICE on break with a label and a value

A `break 'label value` expression looks up a temporary variable
associated with the labeled loop to hold the value, but labeled loops
never registered that temporary, leading to an ICE in the code
generator. Register the loop result temporary against the label.

gcc/rust/ChangeLog:

* backend/rust-compile-expr.cc (CompileExpr::visit): Associate the loop
result temporary with the loop label.

gcc/testsuite/ChangeLog:

* rust/compile/break-label-loop.rs: New test.

Signed-off-by: Lucas Ly Ba <lucas.ly-ba@outlook.com>
gcc/rust/backend/rust-compile-expr.cc
gcc/testsuite/rust/compile/break-label-loop.rs [new file with mode: 0644]