public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "mital at mitalashok dot co.uk" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114937] [11 regression] -ftree-vrp optimizes out range check before conditional increment Date: Fri, 03 May 2024 14:21:17 +0000 [thread overview] Message-ID: <bug-114937-4-Z3WF3c7eA7@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-114937-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114937 --- Comment #3 from Mital Ashok <mital at mitalashok dot co.uk> --- My real code looks more like: void sat_inc(int& y) { if (y < __INT_MAX__) ++y; } template<typename... F> void f(int& x, F&&... functions) { int copy = x; (functions(copy), ...); if (copy > x) x = copy; } void g(int& x) { f(x, sat_inc); } ... Where `g(x)` became `++x` unconditionally
next prev parent reply other threads:[~2024-05-03 14:21 UTC|newest] Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top 2024-05-03 13:41 [Bug tree-optimization/114937] New: " mital at mitalashok dot co.uk 2024-05-03 13:50 ` [Bug tree-optimization/114937] " rguenth at gcc dot gnu.org 2024-05-03 13:54 ` rguenth at gcc dot gnu.org 2024-05-03 14:21 ` mital at mitalashok dot co.uk [this message] 2024-05-06 10:50 ` rguenth at gcc dot gnu.org 2024-05-12 10:35 ` mikpelinux at gmail dot com
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-114937-4-Z3WF3c7eA7@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).