]> git.ipfire.org Git - thirdparty/gcc.git/commit
bpf: correct bpf_print_operand for floats [PR108293]
authorDavid Faust <david.faust@oracle.com>
Tue, 10 Jan 2023 18:53:12 +0000 (10:53 -0800)
committerDavid Faust <david.faust@oracle.com>
Wed, 11 Jan 2023 16:36:48 +0000 (08:36 -0800)
commitc7279270a2deda81eaeba37a87d721bee0ed6004
tree238d9aaa375eb8c178d3331cc06469d8a13eaae5
parent3e1cba12a8d71e70235a9a9b8f1a237a561db3e7
bpf: correct bpf_print_operand for floats [PR108293]

The existing logic in bpf_print_operand was only correct for integral
CONST_DOUBLEs, and emitted garbage for floating point modes. Fix it so
floating point mode operands are correctly handled.

PR target/108293

gcc/

* config/bpf/bpf.cc (bpf_print_operand): Correct handling for
floating point modes.

gcc/testsuite/

* gcc.target/bpf/double-1.c: New test.
* gcc.target/bpf/double-2.c: New test.
* gcc.target/bpf/float-1.c: New test.
gcc/config/bpf/bpf.cc
gcc/testsuite/gcc.target/bpf/double-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/bpf/double-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/bpf/float-1.c [new file with mode: 0644]