diff options
author | Philip Herron <herron.philip@googlemail.com> | 2025-03-28 16:59:33 +0000 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2025-03-28 18:34:20 +0000 |
commit | a0b21c94157d85f4ab87aa9aee83cb629678f72a (patch) | |
tree | bc773c5bb2e8812f2bd3b1d00ec94d7c348629da /gcc/rust/backend/rust-constexpr.cc | |
parent | ebac3ab5bec8a6f08f4549edfee799e64c719d0c (diff) | |
download | gcc-a0b21c94157d85f4ab87aa9aee83cb629678f72a.zip gcc-a0b21c94157d85f4ab87aa9aee83cb629678f72a.tar.gz gcc-a0b21c94157d85f4ab87aa9aee83cb629678f72a.tar.bz2 |
gccrs: Fix ICE in array ref constexpr
Since 898d55ad7e2 was fixed to remove the VIEW_CONVERT_EXPR from
array expressions we can now turn on the array element access
const expr.
Fixes Rust-GCC#3563
gcc/rust/ChangeLog:
* backend/rust-constexpr.cc (eval_store_expression): turn this back on
gcc/testsuite/ChangeLog:
* rust/compile/issue-3563.rs: New test.
Signed-off-by: Philip Herron <herron.philip@googlemail.com>
Diffstat (limited to 'gcc/rust/backend/rust-constexpr.cc')
-rw-r--r-- | gcc/rust/backend/rust-constexpr.cc | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/gcc/rust/backend/rust-constexpr.cc b/gcc/rust/backend/rust-constexpr.cc index 2f2bbbd..dc2d6b1 100644 --- a/gcc/rust/backend/rust-constexpr.cc +++ b/gcc/rust/backend/rust-constexpr.cc @@ -2697,10 +2697,8 @@ eval_store_expression (const constexpr_ctx *ctx, tree t, bool lval, } if (TREE_CODE (probe) == ARRAY_REF) { - // TODO - rust_unreachable (); - // elt = eval_and_check_array_index (ctx, probe, false, - // non_constant_p, overflow_p); + elt = eval_and_check_array_index (ctx, probe, false, + non_constant_p, overflow_p); if (*non_constant_p) return t; } |