]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Fix ICE during const expr eval on array expressions
authorPhilip Herron <herron.philip@googlemail.com>
Thu, 27 Mar 2025 17:27:56 +0000 (17:27 +0000)
committerPhilip Herron <philip.herron@embecosm.com>
Thu, 27 Mar 2025 18:19:43 +0000 (18:19 +0000)
commit898d55ad7e2ae64a0184d736f29a1184a29867c3
tree43270c0b3788a3cbc0439ecec2e6d227a8902e74
parent08bfb3550e76b14d6cb6e6eb1478bff79bacf091
gccrs: Fix ICE during const expr eval on array expressions

Array expressions are still getting turned into VIEW_CONVERT_EXPR's becuase
TYPE_MAIN_VARIANT is not set so then we might as well reuse the type-hasher
to sort this out.

Fixes Rust-GCC#3588

gcc/rust/ChangeLog:

* backend/rust-compile-context.h: only push named types
* backend/rust-compile-type.cc (TyTyResolveCompile::visit): run the type hasher

gcc/testsuite/ChangeLog:

* rust/compile/issue-3588.rs: New test.

Signed-off-by: Philip Herron <herron.philip@googlemail.com>
gcc/rust/backend/rust-compile-context.h
gcc/rust/backend/rust-compile-type.cc
gcc/testsuite/rust/compile/issue-3588.rs [new file with mode: 0644]