diff options
author | David Faust <david.faust@oracle.com> | 2023-08-21 13:34:08 -0700 |
---|---|---|
committer | David Faust <david.faust@oracle.com> | 2023-08-21 15:10:28 -0700 |
commit | e2c42860b6bad30bad8dd12fd0e25dc55646a69c (patch) | |
tree | 4a62b47bf34a7e00d5dd2667d9bbd9e214cfaea3 | |
parent | 36788c9ff6d044210ddee23154306ba54bc3087b (diff) | |
download | gcc-e2c42860b6bad30bad8dd12fd0e25dc55646a69c.zip gcc-e2c42860b6bad30bad8dd12fd0e25dc55646a69c.tar.gz gcc-e2c42860b6bad30bad8dd12fd0e25dc55646a69c.tar.bz2 |
bpf: neg instruction does not accept an immediate
The BPF virtual machine does not support neg nor neg32 instructions with
an immediate.
The erroneous instructions were removed from binutils:
https://sourceware.org/pipermail/binutils/2023-August/129135.html
Change the define_insn so that an immediate cannot be accepted.
From testing, a neg-immediate was probably never chosen over a
mov-immediate anyway.
gcc/
* config/bpf/bpf.md (neg): Second operand must be a register.
-rw-r--r-- | gcc/config/bpf/bpf.md | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/config/bpf/bpf.md b/gcc/config/bpf/bpf.md index a64de10..e87d721 100644 --- a/gcc/config/bpf/bpf.md +++ b/gcc/config/bpf/bpf.md @@ -163,8 +163,8 @@ ;;; Negation (define_insn "neg<AM:mode>2" - [(set (match_operand:AM 0 "register_operand" "=r,r") - (neg:AM (match_operand:AM 1 "reg_or_imm_operand" " 0,I")))] + [(set (match_operand:AM 0 "register_operand" "=r") + (neg:AM (match_operand:AM 1 "register_operand" " 0")))] "" "{neg<msuffix>\t%0|%w0 = -%w1}" [(set_attr "type" "<mtype>")]) |