]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Fix ICE when checking shift's which are behind array refs
authorPhilip Herron <herron.philip@googlemail.com>
Wed, 16 Apr 2025 16:13:04 +0000 (17:13 +0100)
committerArthur Cohen <arthur.cohen@embecosm.com>
Mon, 28 Apr 2025 14:18:53 +0000 (16:18 +0200)
commit2cbb3bf90dd75f26f865eb4d9d51eaeca30f33a7
treec59d91dfa3acc17a54c6ad39c6be624e5849e963
parent75a57211f698242d247f5c4230b8348b236f9ded
gccrs: Fix ICE when checking shift's which are behind array refs

I copied a bad form of this check from the c front-end this updates it
to ensure the rhs is an INTEGER_CST and the lhs needs checked in the first
place.

Fixes Rust-GCC#3664

gcc/rust/ChangeLog:

* rust-gcc.cc (arithmetic_or_logical_expression): Ensure this is an integer

gcc/testsuite/ChangeLog:

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

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