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

Reply via email to