public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/109085] New: [13 Regression] Maybe a wrong code in fmt package since r13-6361-g8020c9c42349f51f
@ 2023-03-09 23:22 marxin at gcc dot gnu.org
  2023-03-09 23:23 ` [Bug target/109085] " marxin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-03-09 23:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 109085
           Summary: [13 Regression] Maybe a wrong code in fmt package
                    since r13-6361-g8020c9c42349f51f
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: uros at gcc dot gnu.org
  Target Milestone: ---

Noticed in the fmt package:

[  134s] Expected equality of these values:
[  134s]   "44.000000000000"
[  134s]   fmt::format("{:%S}", std::chrono::duration<float, std::pico>(
1.54213895E+26))
[  134s]     Which is: "16.430007934570"

which I was able to reduce into:

$ cat fmt3.C
static float
__attribute__((noinline, noipa))
foo(float val)
{
  return __builtin_fmodf(val / 1000000000000L, 60);
}

int main()
{
  float rem = foo (1.54213895E+26);
  __builtin_printf ("rem=%f\n", rem);
  if (rem != 44.0)
    __builtin_abort ();

  return 0;
}

$ g++ fmt3.C -O2 -m32 && ./a.out
rem=16.430008
Aborted (core dumped)

while:
$ g++ fmt3.C -m32 && ./a.out
rem=44.000000

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

* [Bug target/109085] [13 Regression] Maybe a wrong code in fmt package since r13-6361-g8020c9c42349f51f
  2023-03-09 23:22 [Bug target/109085] New: [13 Regression] Maybe a wrong code in fmt package since r13-6361-g8020c9c42349f51f marxin at gcc dot gnu.org
@ 2023-03-09 23:23 ` marxin at gcc dot gnu.org
  2023-03-09 23:29 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-03-09 23:23 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0
   Last reconfirmed|                            |2023-03-09
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW

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

* [Bug target/109085] [13 Regression] Maybe a wrong code in fmt package since r13-6361-g8020c9c42349f51f
  2023-03-09 23:22 [Bug target/109085] New: [13 Regression] Maybe a wrong code in fmt package since r13-6361-g8020c9c42349f51f marxin at gcc dot gnu.org
  2023-03-09 23:23 ` [Bug target/109085] " marxin at gcc dot gnu.org
@ 2023-03-09 23:29 ` pinskia at gcc dot gnu.org
  2023-03-09 23:30 ` marxin at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-09 23:29 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |blocker

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
/me runs away and says -fexcess-precision=standard fixes the issue ...

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

* [Bug target/109085] [13 Regression] Maybe a wrong code in fmt package since r13-6361-g8020c9c42349f51f
  2023-03-09 23:22 [Bug target/109085] New: [13 Regression] Maybe a wrong code in fmt package since r13-6361-g8020c9c42349f51f marxin at gcc dot gnu.org
  2023-03-09 23:23 ` [Bug target/109085] " marxin at gcc dot gnu.org
  2023-03-09 23:29 ` pinskia at gcc dot gnu.org
@ 2023-03-09 23:30 ` marxin at gcc dot gnu.org
  2023-03-09 23:30 ` marxin at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-03-09 23:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Can be fixed with -ffloat-store, so likely a better x87 precision that is
triggered since the mentioned revision.

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

* [Bug target/109085] [13 Regression] Maybe a wrong code in fmt package since r13-6361-g8020c9c42349f51f
  2023-03-09 23:22 [Bug target/109085] New: [13 Regression] Maybe a wrong code in fmt package since r13-6361-g8020c9c42349f51f marxin at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-03-09 23:30 ` marxin at gcc dot gnu.org
@ 2023-03-09 23:30 ` marxin at gcc dot gnu.org
  2023-03-09 23:39 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-03-09 23:30 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED

--- Comment #3 from Martin Liška <marxin at gcc dot gnu.org> ---
Yep, it's invalid, sorry for the noise.

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

* [Bug target/109085] [13 Regression] Maybe a wrong code in fmt package since r13-6361-g8020c9c42349f51f
  2023-03-09 23:22 [Bug target/109085] New: [13 Regression] Maybe a wrong code in fmt package since r13-6361-g8020c9c42349f51f marxin at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-03-09 23:30 ` marxin at gcc dot gnu.org
@ 2023-03-09 23:39 ` pinskia at gcc dot gnu.org
  2023-03-09 23:40 ` pinskia at gcc dot gnu.org
  2023-03-10  8:21 ` marxin at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-09 23:39 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |NEW
         Resolution|FIXED                       |---

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The only difference with -fexcess-precision=standard

Is after:
        fdivrs  32(%esp)

We do this:
        fstps   12(%esp)
        flds    12(%esp)

Which is exactly what you expect, that is a truncation to 32bit float from long
double.
The reason why it "worked" before was there is an implict truncation when
passing to a function call ...

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

* [Bug target/109085] [13 Regression] Maybe a wrong code in fmt package since r13-6361-g8020c9c42349f51f
  2023-03-09 23:22 [Bug target/109085] New: [13 Regression] Maybe a wrong code in fmt package since r13-6361-g8020c9c42349f51f marxin at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-03-09 23:39 ` pinskia at gcc dot gnu.org
@ 2023-03-09 23:40 ` pinskia at gcc dot gnu.org
  2023-03-10  8:21 ` marxin at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-03-09 23:40 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|NEW                         |RESOLVED

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
.

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

* [Bug target/109085] [13 Regression] Maybe a wrong code in fmt package since r13-6361-g8020c9c42349f51f
  2023-03-09 23:22 [Bug target/109085] New: [13 Regression] Maybe a wrong code in fmt package since r13-6361-g8020c9c42349f51f marxin at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-03-09 23:40 ` pinskia at gcc dot gnu.org
@ 2023-03-10  8:21 ` marxin at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2023-03-10  8:21 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://github.com/fmtlib/f
                   |                            |mt/issues/3337

--- Comment #6 from Martin Liška <marxin at gcc dot gnu.org> ---
I've just filled an upstream issue: https://github.com/fmtlib/fmt/issues/3337.

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

end of thread, other threads:[~2023-03-10  8:21 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-09 23:22 [Bug target/109085] New: [13 Regression] Maybe a wrong code in fmt package since r13-6361-g8020c9c42349f51f marxin at gcc dot gnu.org
2023-03-09 23:23 ` [Bug target/109085] " marxin at gcc dot gnu.org
2023-03-09 23:29 ` pinskia at gcc dot gnu.org
2023-03-09 23:30 ` marxin at gcc dot gnu.org
2023-03-09 23:30 ` marxin at gcc dot gnu.org
2023-03-09 23:39 ` pinskia at gcc dot gnu.org
2023-03-09 23:40 ` pinskia at gcc dot gnu.org
2023-03-10  8:21 ` marxin 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).