public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/103302] New: wrong code with -fharden-compares
@ 2021-11-17 14:13 zsojka at seznam dot cz
  2021-11-19 11:24 ` [Bug target/103302] " aoliva at gcc dot gnu.org
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: zsojka at seznam dot cz @ 2021-11-17 14:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103302

            Bug ID: 103302
           Summary: wrong code with -fharden-compares
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zsojka at seznam dot cz
  Target Milestone: ---
              Host: x86_64-pc-linux-gnu
            Target: riscv64-unknown-linux-gnu

Created attachment 51824
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=51824&action=edit
reduced testcase

Output:
$ riscv64-unknown-linux-gnu-gcc -Og -fharden-compares -fno-tree-dce
-fno-tree-fre testcase.c -static
$ qemu-riscv64 -- ./a.out 
Trace/breakpoint trap

Debugging shows one of the compares on the first statement probably goes wrong:

(gdb) 
0x00000000000106ea      19        u32_0 <= (v512u128) (v512u128_0 != u8_0);
(gdb) 
0x0000000000010a48      24      }

I could find any other target where this testcase is failing.

$ riscv64-unknown-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-trunk/binary-latest-riscv64/bin/riscv64-unknown-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-trunk/binary-trunk-r12-5221-20211113015125-g2f3d43a3515-checking-yes-rtl-df-extra-riscv64/bin/../libexec/gcc/riscv64-unknown-linux-gnu/12.0.0/lto-wrapper
Target: riscv64-unknown-linux-gnu
Configured with: /repo/gcc-trunk//configure --enable-languages=c,c++
--enable-valgrind-annotations --disable-nls --enable-checking=yes,rtl,df,extra
--with-cloog --with-ppl --with-isl
--with-sysroot=/usr/riscv64-unknown-linux-gnu --build=x86_64-pc-linux-gnu
--host=x86_64-pc-linux-gnu --target=riscv64-unknown-linux-gnu
--with-ld=/usr/bin/riscv64-unknown-linux-gnu-ld
--with-as=/usr/bin/riscv64-unknown-linux-gnu-as --disable-multilib
--disable-libstdcxx-pch
--prefix=/repo/gcc-trunk//binary-trunk-r12-5221-20211113015125-g2f3d43a3515-checking-yes-rtl-df-extra-riscv64
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.0.0 20211113 (experimental) (GCC)

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2022-12-07  2:21 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-17 14:13 [Bug target/103302] New: wrong code with -fharden-compares zsojka at seznam dot cz
2021-11-19 11:24 ` [Bug target/103302] " aoliva at gcc dot gnu.org
2021-11-26  0:30 ` wilson at gcc dot gnu.org
2021-11-26  3:28 ` wilson at gcc dot gnu.org
2021-11-26  5:20 ` wilson at gcc dot gnu.org
2021-11-28 21:24 ` aoliva at gcc dot gnu.org
2021-12-02  1:48 ` aoliva at gcc dot gnu.org
2021-12-02  6:18 ` zsojka at seznam dot cz
2021-12-02  6:25 ` zsojka at seznam dot cz
2021-12-03  9:29 ` aoliva at gcc dot gnu.org
2021-12-08  3:42 ` aoliva at gcc dot gnu.org
2021-12-08 18:19 ` wilson at gcc dot gnu.org
2021-12-09  2:39 ` cvs-commit at gcc dot gnu.org
2021-12-09  2:52 ` aoliva at gcc dot gnu.org
2022-02-23  7:42 ` aoliva at gcc dot gnu.org
2022-02-25  1:20 ` cvs-commit at gcc dot gnu.org
2022-02-25 23:28 ` aoliva at gcc dot gnu.org
2022-03-24 13:14 ` aoliva at gcc dot gnu.org
2022-12-07  2:21 ` pinskia at gcc dot gnu.org

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).