public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "zsojka at seznam dot cz" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/116229] New: wrong code at -Ofast aarch64 due to missing fneg to generate 0x8000000000000000
Date: Sun, 04 Aug 2024 18:09:01 +0000	[thread overview]
Message-ID: <bug-116229-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 116229
           Summary: wrong code at -Ofast aarch64 due to missing fneg to
                    generate 0x8000000000000000
           Product: gcc
           Version: 15.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: aarch64-unknown-linux-gnu

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

Output:
$ aarch64-unknown-linux-gnu-gcc -Ofast testcase.c -static
$ qemu-aarch64 -- ./a.out 
qemu: uncaught target signal 6 (Aborted) - core dumped
Aborted

Diff from -O3 to -Ofast shows the 0x8000000000000000 constant is not generated
(as -0.0):

$ diff -u a-testcase.s-O3 a-testcase.s-Ofast 
--- a-testcase.s-O3     2024-08-04 20:07:06.417271286 +0200
+++ a-testcase.s-Ofast  2024-08-04 20:07:11.877241325 +0200
@@ -24,7 +24,7 @@
 main:
 .LFB1:
        .cfi_startproc
-       movi    v0.4s, 0
+       movi    v0.2d, 0
        stp     x29, x30, [sp, -48]!
        .cfi_def_cfa_offset 48
        .cfi_offset 29, -48
@@ -35,7 +35,6 @@
        .cfi_offset 20, -24
        adrp    x20, .LC0
        add     x19, sp, 40
-       fneg    v0.2d, v0.2d
        add     x20, x20, :lo12:.LC0
        bl      foo
        str     d0, [sp, 40]

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

             reply	other threads:[~2024-08-04 18:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-04 18:09 zsojka at seznam dot cz [this message]
2024-08-04 22:27 ` [Bug target/116229] [15 Regression] " pinskia at gcc dot gnu.org
2024-08-04 22:38 ` pinskia at gcc dot gnu.org
2024-08-06  6:23 ` tnfchris at gcc dot gnu.org
2024-08-08 17:52 ` cvs-commit at gcc dot gnu.org
2024-08-08 17:55 ` tnfchris at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-116229-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).