(gdb) bt
#0 0x0000045c in abort ()
#1 0x00000448 in validate (v=<optimised out>, good=<optimised out>)
at /home/jeremy/gittrees/dolphin/gcc/gcc/testsuite/gcc.target/riscv/cv-helpers.h:12
#2 main ()
at /home/jeremy/gittrees/dolphin/gcc/gcc/testsuite/gcc.target/riscv/cv-bitmanip-exec.c:95
(gdb)
We note that while there should be 2 instances each of extract, extractr, extractu and extractur in the generated output, only 2 instances of extractr appear.
This only happens with -O1. At higher or lower optimization levels it all behaves correctly, with the correct number of generated extract instructions.
This is a stripped down version of a new test program. Attached the pre-processed source and generated assembly code. Compiled with
cv-bitmanip-exec.zip
When executed on FPGA, it fails through
abort ()
We note that while there should be 2 instances each of
extract
,extractr
,extractu
andextractur
in the generated output, only 2 instances ofextractr
appear.This only happens with
-O1
. At higher or lower optimization levels it all behaves correctly, with the correct number of generated extract instructions.