public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/101335] wrong code at -O2 and above Date: Mon, 05 Jul 2021 19:25:58 +0000 [thread overview] Message-ID: <bug-101335-4-hZuQaiHFBP@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-101335-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101335 Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2021-07-05 Keywords| |wrong-code Version|unknown |12.0 Summary|wrong code at -Os and above |wrong code at -O2 and above |on x86_64-linux-gnu | Ever confirmed|0 |1 Status|UNCONFIRMED |NEW --- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Also -fwrapv works around the issue, -fsanitize=undefined does not output any undefined behavior either. EVRP has the first difference. Before EVRP we had: a.0_1 = aD.1942; // -1u _2 = ~a.0_1; //0u c_9 = (intD.6) _2; //0 _3 = c_9 + -10; // -10 d_10 = (unsigned intD.9) _3; //-10u if (_2 < d_10) // 0u < -10u which is true But EVRP: Predicate evaluates to: DON'T KNOW folding with relation > Predicate evaluates to: 0 EVRP:hybrid: Second query simplifed stmt Folded into: if (0 != 0) ---- CUT ---- Looks like this value relation is being used but rather it should have just converted to != rather < with the casts happening: Registering value_relation (_3 < c_9) (bb2) at _3 = c_9 + -10;
next prev parent reply other threads:[~2021-07-05 19:25 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-07-05 19:01 [Bug tree-optimization/101335] New: wrong code at -Os and above on x86_64-linux-gnu zhendong.su at inf dot ethz.ch 2021-07-05 19:25 ` pinskia at gcc dot gnu.org [this message] 2021-07-05 19:26 ` [Bug tree-optimization/101335] [12 Regression] wrong code at -O2 and above (casts between signed and unsigned) pinskia at gcc dot gnu.org 2021-07-06 6:42 ` [Bug tree-optimization/101335] [12 Regression] wrong code at -O2 and above (casts between signed and unsigned) by r12-1796 rguenth at gcc dot gnu.org 2021-07-12 15:35 ` amacleod at redhat dot com 2021-07-12 18:37 ` cvs-commit at gcc dot gnu.org 2021-07-12 18:38 ` amacleod at redhat 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-101335-4-hZuQaiHFBP@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).