public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110622] New: x86: Miscompilation at O1 level (O0 is working)
@ 2023-07-11  6:28 malat at debian dot org
  2023-07-11  6:29 ` [Bug c++/110622] " malat at debian dot org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: malat at debian dot org @ 2023-07-11  6:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110622
           Summary: x86: Miscompilation at O1 level (O0 is working)
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: malat at debian dot org
  Target Milestone: ---

I can trigger an assertion in highway unit test suite on Debian/i386 when using
-O1 (does not happen at -O0).

Symptoms:

[...]
f32x2: Log1p(5.5968112995194757e-20) expected 5.5968112995194757e-20 actual 0
ulp 5.28754e+08 max ulp 3
[...]

For some reason the code return exactly zero (0) during a math computation of a
log1p function. The code runs fine at O2 on all other Debian arches (amd64,
mipsel, armel, ppc32 ...).

Since the return value is exactly 0, I suspect this is not a case of excess
precision (x87). This is not a hardware issue as I can reproduce it on multiple
hosts (Debian buildds machine, and x86 porterbox).

If I extract the math logic and call it in a `main` function, then the compiler
is able to optimize the code correctly (even at O2) and return appropriate
result (correct tolerance).

I did not observe any suspicious behavior under valgrind and/or -fsanitize.

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

end of thread, other threads:[~2023-09-21 14:29 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-11  6:28 [Bug c++/110622] New: x86: Miscompilation at O1 level (O0 is working) malat at debian dot org
2023-07-11  6:29 ` [Bug c++/110622] " malat at debian dot org
2023-07-11  6:30 ` malat at debian dot org
2023-07-11  6:31 ` pinskia at gcc dot gnu.org
2023-07-11  6:33 ` malat at debian dot org
2023-07-11  6:33 ` malat at debian dot org
2023-07-11  6:38 ` pinskia at gcc dot gnu.org
2023-07-11  6:44 ` [Bug target/110622] " malat at debian dot org
2023-07-11  8:25 ` malat at debian dot org
2023-09-21  9:44 ` malat at debian dot org
2023-09-21  9:48 ` [Bug target/110622] x87: Miscompilation at O2 level (O1 " malat at debian dot org
2023-09-21  9:51 ` malat at debian dot org
2023-09-21  9:56 ` malat at debian dot org
2023-09-21 13:33 ` pinskia at gcc dot gnu.org
2023-09-21 13:42 ` malat at debian dot org
2023-09-21 13:45 ` xry111 at gcc dot gnu.org
2023-09-21 14:29 ` malat at debian dot 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).