Closed luismgsilva closed 1 year ago
This error may show a hidden issue with either the compiler or any of the simulators.
At the time of this comment, the test case gcc.dg/lto/pr101868
is passing on both the QEMU and NSIM simulators for the ARCHS processor.
Executing on host: arc-elf32-gcc c_lto_pr101868_0.o c_lto_pr101868_1.o c_lto_pr101868_2.o c_lto_pr101868_3.o -dumpbase "" -fdiagnostics-plain-output -O2 -fno-strict-aliasing -flto --sp
ecs=nsim.specs -Wl,--defsym=__DEFAULT_HEAP_SIZE=256m -Wl,--defsym=__DEFAULT_STACK_SIZE=32m -Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -Wl,gcc_tg.o -o gcc-dg-lto-pr10186
8-01.exe (timeout = 300)
spawn -ignore SIGHUP arc-elf32-gcc c_lto_pr101868_0.o c_lto_pr101868_1.o c_lto_pr101868_2.o c_lto_pr101868_3.o -dumpbase -fdiagnostics-plain-output -O2 -fno-strict-aliasing -flto --specs=nsi
m.specs -Wl,--defsym=__DEFAULT_HEAP_SIZE=256m -Wl,--defsym=__DEFAULT_STACK_SIZE=32m -Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -Wl,gcc_tg.o -o gcc-dg-lto-pr101868-01.exe
PASS: gcc.dg/lto/pr101868 c_lto_pr101868_0.o-c_lto_pr101868_3.o link, -O2 -fno-strict-aliasing -flto
spawn /scratch/luiss/builder/install/qemu/20230508/bin/..//bin/qemu-system-arc -cpu archs -semihosting -M arc-sim -m 2G -nographic -no-reboot -monitor none -kernel ./gcc-dg-lto-pr101868-01.ex
e
*** EXIT code 0 PASS: gcc.dg/lto/pr101868 c_lto_pr101868_0.o-c_lto_pr101868_3.o execute -O2 -fno-strict-aliasing -flto
The execution of the test case on QEMU simulator was successful, resulting in an exit code of 0.
- NSIM Execution:
```sh
Executing on host: arc-elf32-gcc c_lto_pr101868_0.o c_lto_pr101868_1.o c_lto_pr101868_2.o c_lto_pr101868_3.o -dumpbase "" -fdiagnostics-plain-output -O2 -fno-strict-aliasing -flto --sp
ecs=nsim.specs -Wl,--defsym=__DEFAULT_HEAP_SIZE=256m -Wl,--defsym=__DEFAULT_STACK_SIZE=1024m -Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -Wl,gcc_tg.o -o gcc-dg-lto-pr101
868-01.exe (timeout = 300)
spawn -ignore SIGHUP arc-elf32-gcc c_lto_pr101868_0.o c_lto_pr101868_1.o c_lto_pr101868_2.o c_lto_pr101868_3.o -dumpbase -fdiagnostics-plain-output -O2 -fno-strict-aliasing -flto --specs=nsi
m.specs -Wl,--defsym=__DEFAULT_HEAP_SIZE=256m -Wl,--defsym=__DEFAULT_STACK_SIZE=1024m -Wl,-wrap,exit -Wl,-wrap,_exit -Wl,-wrap,main -Wl,-wrap,abort -Wl,gcc_tg.o -o gcc-dg-lto-pr101868-01.exe
PASS: gcc.dg/lto/pr101868 c_lto_pr101868_0.o-c_lto_pr101868_3.o link, -O2 -fno-strict-aliasing -flto
spawn /opt/nsim/2022.06free/bin/nsimdrv -on nsim_isa_enable_timer_0 -on nsim_isa_enable_timer_1 -off invalid_instruction_interrupt -off memory_exception_interrupt -on nsim_download_elf_sectio
ns -prop=nsim_emt=1 -p nsim_isa_family=av2hs -p nsim_isa_core=3 -on nsim_isa_sat -p nsim_isa_atomic_option=1 -p nsim_isa_code_density_option=2 -p nsim_isa_div_rem_option=2 -p nsim_isa_ll64_op
tion=1 -p nsim_isa_mpy_option=2 ./gcc-dg-lto-pr101868-01.exe
*** EXIT code 0
PASS: gcc.dg/lto/pr101868 c_lto_pr101868_0.o-c_lto_pr101868_3.o execute -O2 -fno-strict-aliasing -flto
The execution of the test case on NSIM simulator was successful, resulting in an exit code of 0.
But what changed, the user?
While it is possible that the user could've been the source of the problem, the tests were executed automatically under the same configurations and environments. The only variance lies in the versions of the tools used.
However, in this particular scenario, it is the alteration made to the test itself that accounts for the disparate outcome.
The following instance reflects when the test was modified.
commit b1d0d3520e96802dee37e8fc1c56e19c13d598b1
Author: Dimitar Dimitrov <dimitar@dinux.eu>
Date: Sun May 15 17:30:52 2022 +0300
testsuite: Remove reliance on argc in lto/pr101868_0.c
Some embedded targets do not pass any argv arguments. When argc is
zero, this causes spurious failures for lto/pr101868_0.c. Fix by
following the strategy in r0-114701-g2c49569ecea56d. Use a volatile
variable instead of argc to inject a runtime value into the test.
I validated the following:
- No changes in testresults for x86_64-pc-linux-gnu.
- The spurious failures are fixed for PRU target.
- lto/pr101868_0.c still fails on x86_64-pc-linux-gnu, if
the PR/101868 fix (r12-2254-gfedcf3c476aff7) is reverted.
PR tree-optimization/101868
gcc/testsuite/ChangeLog:
* gcc.dg/lto/pr101868_0.c (zero): New volatile variable.
(main): Use it instead of argc.
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
When making the comparison of ARCHS baremetal between QEMU and NSIM there is a test that is passing in QEMU but failing in NSIM.
gcc.dg/lto/pr101868 c_lto_pr101868_0.o-c_lto_pr101868_3.o execute -O2 -fno-strict-aliasing -flto
The information bellow is all the repositories and versions used in this test between both simulators.