[Bug target/77822] [6 Regression] arm64 Error: immediate value out of range 0 to 63 at operand 3
ktkachov at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Nov 7 15:53:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77822
--- Comment #24 from ktkachov at gcc dot gnu.org ---
(In reply to Dominik Vogt from comment #23)
> Regarding the ARM patch:
>
> + {
> + if (!IN_RANGE (INTVAL (operands[2]) + INTVAL (operands[3]),
> + 1, GET_MODE_BITSIZE (DImode) - 1))
> + FAIL;
> + }
>
> Isn't this patch too simple? On s390x we get "pos" -N (operand 3) with
> "size" M, so the correct check should be:
>
> if (! IN_RANGE (INTVAL (operands[3]), 0, GET_MODE_BITSIZE (DImode) - 1)
> || IN_RANGE (INTVAL (operands[3]) + INTVAL (operands[2]),
> 1, GET_MODE_BITSIZE (DImode)))
> FAIL;
>
> It's just luck that the test program does not generate something like
>
> (zero_extract (...) (-1) (16))
>
> Which can only be caught by testing "pos" individually.
>
> --
>
> Also, I don't understand why the valid range is "1, GET_MODE_BITSIZE
> (DImode) - 1", shouldn't it be "1, GET_MODE_BITSIZE (DImode)" without the "-
> 1"?
operands[3] also gets the aarch64_simd_shift_imm_di predicate which checks that
IN_RANGE (INTVAL (op), 0, 63), so we should be okay
More information about the Gcc-bugs
mailing list