On 7/6/2026 2:34 AM, Jim Lin wrote:
test_half_sign_needed is a negative test expecting a sign-extending
halfword load (lh).  With *p >> 8 on a 16-bit short only the high byte
is needed, so the compiler emits a sign-extending byte load (lb) and the
lh match fails.  Use *p >> 4 so the full halfword load is required.

gcc/testsuite/ChangeLog:

        * gcc.target/riscv/ext-dce-4.c (test_half_sign_needed): Shift
        by 4 instead of 8 to keep the lh load.
THanks.  I pushed this to the trunk.
jeff

Reply via email to