public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "gcc at cookiesoft dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/99810] New: Wrong const evaluation of 64-bit division
Date: Mon, 29 Mar 2021 07:52:31 +0000	[thread overview]
Message-ID: <bug-99810-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             reply	other threads:[~2021-03-29  7:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29  7:52 gcc at cookiesoft dot de [this message]
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

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