]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: fix ICE on empty constexpr loops
authorTom Schollenberger <tss2344@g.rit.edu>
Thu, 8 May 2025 11:26:07 +0000 (07:26 -0400)
committerPhilip Herron <philip.herron@embecosm.com>
Thu, 8 May 2025 15:37:43 +0000 (15:37 +0000)
commit339415a5a865649972b255cc697691d493453e41
tree2fb95faafcae346041be6043cbe0a48fae61a637
parentfc6b54365731c2ebfa1974058c48772e03203fdd
gccrs: fix ICE on empty constexpr loops

Empty loops have no body which means this is a NULL_TREE during const
evaluation which needs a check. Fixes Rust-GCC #3618.

gcc/rust/ChangeLog:

* backend/rust-constexpr.cc (eval_constant_expression):  Check if t is a NULL_TREE

gcc/testsuite/ChangeLog:

* rust/compile/issue-3618.rs: Test empty loops error properly.

Signed-off-by: Tom Schollenberger <tss2344@g.rit.edu>
gcc/rust/backend/rust-constexpr.cc
gcc/testsuite/rust/compile/issue-3618.rs [new file with mode: 0644]