]> 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)
committerPhilip Herron <philip.herron@embecosm.com>
Wed, 16 Apr 2025 22:19:17 +0000 (22:19 +0000)
commit50a90f12af84ba2d203a0510bbeb41a383981303
treea4c06682ba956ea97f742ab1fd4dd3379d686a7e
parent95615a1ab48f1493fef21bb9f5f465f02ff527e4
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]