public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/113469] New: RISC-V: Illegal Insn for test case 920501-8.c when make linux for rv32
@ 2024-01-18 7:26 pan2.li at intel dot com
2024-01-26 6:50 ` [Bug target/113469] " cvs-commit at gcc dot gnu.org
2024-01-26 7:14 ` pan2.li at intel dot com
0 siblings, 2 replies; 3+ messages in thread
From: pan2.li at intel dot com @ 2024-01-18 7:26 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113469
Bug ID: 113469
Summary: RISC-V: Illegal Insn for test case 920501-8.c when
make linux for rv32
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: pan2.li at intel dot com
Target Milestone: ---
The test case will have illegal instruction when `make linux` build of the repo
riscv-gnu-toolchain for rv32.
1. Build.
../__RISC-V_INSTALL___RV32/bin/riscv32-unknown-linux-gnu-gcc
gcc/testsuite/gcc.c-torture/execute/920501-8.c -march=rv32gcv -mabi=ilp32d
-mtune=rocket -mcmodel=medlow -fdiagnostics-plain-output -O2 -w -lm -o
./920501-8.elf -static
2. Run with qemu
../build-qemu/qemu-riscv32 -cpu rv32,vlen=512,v=true,vext_spec=v1.0
920501-8.elf
Illegal instruction (core dumped)
3. When enter function __printf_buffer (comes from libc.a), it will go to insn
like below for the first insn
__printf_buffer:
auipc a5,0x5f => directly jump to the vmv insn and then illegal insn met.
...
vmv.v.i.v1,0
4. After some investigation, the function __printf_buffer should be the
function Xprintf_buffer in glibc/stdio-common/vfprintf-internal.c. You can
use the below command to compile it.
cd glibc/stdio-common/
../../__RISC-V_INSTALL___RV32/bin/riscv32-unknown-linux-gnu-gcc
vfprintf-internal.c \
-c -std=gnu11 -fgnu89-inline -mcmodel=medlow -O2 -Wall -Wwrite-strings
-Wundef \
-fmerge-all-constants -frounding-math -fno-stack-protector -fno-common
-Wstrict-prototypes -Wold-style-definition \
-fmath-errno -fPIE -ftls-model=initial-exec -I../include \
-I/home/pli/gcc/444/riscv-gnu-toolchain/build-glibc-linux-rv32gcv-ilp32d/stdio-common
\
-I/home/pli/gcc/444/riscv-gnu-toolchain/build-glibc-linux-rv32gcv-ilp32d
-I../sysdeps/unix/sysv/linux/riscv/rv32 \
-I../sysdeps/unix/sysv/linux/riscv -I../sysdeps/riscv/nptl
-I../sysdeps/unix/sysv/linux/generic/wordsize-32 \
-I../sysdeps/unix/sysv/linux/generic -I../sysdeps/unix/sysv/linux/include
-I../sysdeps/unix/sysv/linux \
-I../sysdeps/nptl -I../sysdeps/pthread -I../sysdeps/gnu
-I../sysdeps/unix/inet -I../sysdeps/unix/sysv \
-I../sysdeps/unix -I../sysdeps/posix \
-I../sysdeps/riscv/rv32/rvd -I../sysdeps/riscv/rv32/rvf
-I../sysdeps/riscv/rvf \
-I../sysdeps/riscv/rvd -I../sysdeps/riscv/rv32 -I../sysdeps/riscv \
-I../sysdeps/ieee754/ldbl-128 -I../sysdeps/ieee754/dbl-64
-I../sysdeps/ieee754/flt-32 \
-I../sysdeps/wordsize-32 -I../sysdeps/ieee754 -I../sysdeps/generic \
-I.. -I../libio -I. -nostdinc -isystem
/home/pli/gcc/444/riscv-gnu-toolchain/__RISC-V_INSTALL___RV32/lib/gcc/riscv32-unknown-linux-gnu/14.0.1/include
\
-isystem
/home/pli/gcc/444/riscv-gnu-toolchain/__RISC-V_INSTALL___RV32/lib/gcc/riscv32-unknown-linux-gnu/14.0.1/include-fixed
\
-isystem /home/pli/gcc/444/riscv-gnu-toolchain/linux-headers/include \
-D_LIBC_REENTRANT -include
/home/pli/gcc/444/riscv-gnu-toolchain/build-glibc-linux-rv32gcv-ilp32d/libc-modules.h
\
-DMODULE_NAME=libc -include ../include/libc-symbols.h -DPIC \
-DTOP_NAMESPACE=glibc -D_IO_MTSAFE_IO -o test.o
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug target/113469] RISC-V: Illegal Insn for test case 920501-8.c when make linux for rv32
2024-01-18 7:26 [Bug c/113469] New: RISC-V: Illegal Insn for test case 920501-8.c when make linux for rv32 pan2.li at intel dot com
@ 2024-01-26 6:50 ` cvs-commit at gcc dot gnu.org
2024-01-26 7:14 ` pan2.li at intel dot com
1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-26 6:50 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113469
--- Comment #1 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Pan Li <panli@gcc.gnu.org>:
https://gcc.gnu.org/g:d40b3c1e439db05c835b6bd4fd5bba58fda71dd6
commit r14-8442-gd40b3c1e439db05c835b6bd4fd5bba58fda71dd6
Author: Juzhe-Zhong <juzhe.zhong@rivai.ai>
Date: Fri Jan 26 14:46:21 2024 +0800
RISC-V: Fix incorrect LCM delete bug [VSETVL PASS]
This patch fixes the recent noticed bug in RV32 glibc.
We incorrectly deleted a vsetvl:
...
and a4,a4,a3
vmv.v.i v1,0 ---> Missed vsetvl cause illegal
instruction report.
vse8.v v1,0(a5)
The root cause the laterin in LCM is incorrect.
BB 358:
avloc: n_bits = 2, set = {}
kill: n_bits = 2, set = {}
antloc: n_bits = 2, set = {}
transp: n_bits = 2, set = {}
avin: n_bits = 2, set = {}
avout: n_bits = 2, set = {}
del: n_bits = 2, set = {}
cause LCM let BB 360 delete the vsetvl:
BB 360:
avloc: n_bits = 2, set = {}
kill: n_bits = 2, set = {}
antloc: n_bits = 2, set = {}
transp: n_bits = 2, set = {0 1 }
avin: n_bits = 2, set = {}
avout: n_bits = 2, set = {}
del: n_bits = 2, set = {1}
Also, remove unknown vsetvl info into local computation since it is
unnecessary.
Tested on both RV32/RV64 no regression.
PR target/113469
gcc/ChangeLog:
* config/riscv/riscv-vsetvl.cc
(pre_vsetvl::compute_lcm_local_properties): Fix bug.
gcc/testsuite/ChangeLog:
* gcc.target/riscv/rvv/autovec/pr113469.c: New test.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Bug target/113469] RISC-V: Illegal Insn for test case 920501-8.c when make linux for rv32
2024-01-18 7:26 [Bug c/113469] New: RISC-V: Illegal Insn for test case 920501-8.c when make linux for rv32 pan2.li at intel dot com
2024-01-26 6:50 ` [Bug target/113469] " cvs-commit at gcc dot gnu.org
@ 2024-01-26 7:14 ` pan2.li at intel dot com
1 sibling, 0 replies; 3+ messages in thread
From: pan2.li at intel dot com @ 2024-01-26 7:14 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113469
Li Pan <pan2.li at intel dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|UNCONFIRMED |RESOLVED
--- Comment #2 from Li Pan <pan2.li at intel dot com> ---
Fixed.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-01-26 7:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-18 7:26 [Bug c/113469] New: RISC-V: Illegal Insn for test case 920501-8.c when make linux for rv32 pan2.li at intel dot com
2024-01-26 6:50 ` [Bug target/113469] " cvs-commit at gcc dot gnu.org
2024-01-26 7:14 ` pan2.li at intel dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).