public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/99810] New: Wrong const evaluation of 64-bit division
@ 2021-03-29  7:52 gcc at cookiesoft dot de
  2021-03-29  8:01 ` [Bug c/99810] " jakub at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: gcc at cookiesoft dot de @ 2021-03-29  7:52 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99810
           Summary: Wrong const evaluation of 64-bit division
           Product: gcc
           Version: 10.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gcc at cookiesoft dot de
  Target Milestone: ---
              Host: x86_64
            Target: arm

The following code produces a different result on arm and x86_64:

https://gcc.godbolt.org/z/PPvoscdWa
```
#include <inttypes.h>
#include <stdio.h>

int main() {
    printf("%" PRId64 "\n", -62135769600000000 / 1000000);
}
```

ARM: -2006227456  (FFFF FFFF 886B 6600)
X86: -62135769600 (FFFF FFF1 886B 6600)

No single warning is given and I of course would like to see the x86 output,
because that's the right one ;)

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

end of thread, other threads:[~2021-03-29  8:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-29  7:52 [Bug c/99810] New: Wrong const evaluation of 64-bit division gcc at cookiesoft dot de
2021-03-29  8:01 ` [Bug c/99810] " jakub at gcc dot gnu.org
2021-03-29  8:06 ` rguenth at gcc dot gnu.org
2021-03-29  8:07 ` gcc at cookiesoft dot de
2021-03-29  8:14 ` jakub at gcc dot gnu.org
2021-03-29  8:18 ` gcc at cookiesoft dot de

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