public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "ibuclaw at gdcproject dot org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/103120] New: [12 Regression] test miscompiled with -O2 on darwin since r12-4790 Date: Sun, 07 Nov 2021 22:03:22 +0000 [thread overview] Message-ID: <bug-103120-4@http.gcc.gnu.org/bugzilla/> (raw) https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103120 Bug ID: 103120 Summary: [12 Regression] test miscompiled with -O2 on darwin since r12-4790 Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: ibuclaw at gdcproject dot org Target Milestone: --- Starting from r12-4790, one of the D library tests started failing on darwin. Distilled it down to following C code. Passes when compiled with -O1 and -O3, but fails with -O2. --- #define radix 10 __INT32_TYPE__ numDigits(__UINT64_TYPE__ value) { __INT32_TYPE__ n = 1; while (value > __UINT32_MAX__) { n += 4; value /= radix * radix * radix * radix; } __UINT32_TYPE__ v = (__UINT32_TYPE__)value; while (1) { if (v < radix) return n; if (v < radix * radix) return n + 1; if (v < radix * radix * radix) return n + 2; if (v < radix * radix * radix * radix) return n + 3; n += 4; v /= radix * radix * radix * radix; } } int main() { if (numDigits(__UINT64_MAX__) != 20) __builtin_abort(); }
next reply other threads:[~2021-11-07 22:03 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-11-07 22:03 ibuclaw at gdcproject dot org [this message] 2021-11-07 22:08 ` [Bug tree-optimization/103120] " pinskia at gcc dot gnu.org 2021-11-07 22:17 ` ibuclaw at gdcproject dot org 2021-11-07 22:29 ` [Bug tree-optimization/103120] [12 Regression] test miscompiled with -O2 " pinskia at gcc dot gnu.org 2021-11-07 22:30 ` pinskia at gcc dot gnu.org 2021-11-08 9:21 ` rguenth at gcc dot gnu.org 2021-11-08 11:12 ` aldyh at gcc dot gnu.org 2021-11-08 15:08 ` cvs-commit at gcc dot gnu.org 2021-11-08 15:09 ` aldyh at gcc dot gnu.org
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-103120-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: linkBe 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).