public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/103860] [9/10/11/12 Regression] wrong code at -O3 with -fPIC on x86_64-linux-gnu Date: Thu, 30 Dec 2021 13:24:17 +0000 [thread overview] Message-ID: <bug-103860-4-BRRoU6QaqX@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-103860-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103860 --- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:1820137ba624d7eb2004a10f9632498b6bc1696a commit r12-6150-g1820137ba624d7eb2004a10f9632498b6bc1696a Author: Jakub Jelinek <jakub@redhat.com> Date: Thu Dec 30 14:23:18 2021 +0100 shrink-wrapping: Fix up prologue block discovery [PR103860] The following testcase is miscompiled, because a prologue which contains subq $8, %rsp instruction is emitted at the start of a basic block which contains conditional jump that depends on flags register set in an earlier basic block, the prologue instruction then clobbers those flags. Normally this case is checked by can_get_prologue predicate, but this is done only at the start of the loop. If we update pro later in the loop (because some bb shouldn't be duplicated) and then don't push anything further into vec and the vec is already empty (this can happen when the new pro is already in bb_with bitmask and either has no successors (that is the case in the testcase where that bb ends with a trap) or all the successors are already in bb_with, then the loop doesn't iterate further and can_get_prologue will not be checked. The following simple patch makes sure we call can_get_prologue even after the last former iteration when vec is already empty and only break from the loop afterwards (and only if the updating of pro done because of !can_get_prologue didn't push anything into vec again). 2021-12-30 Jakub Jelinek <jakub@redhat.com> PR rtl-optimization/103860 * shrink-wrap.c (try_shrink_wrapping): Make sure can_get_prologue is called on pro even if nothing further is pushed into vec. * gcc.dg/pr103860.c: New test.
next prev parent reply other threads:[~2021-12-30 13:24 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-12-29 16:08 [Bug tree-optimization/103860] New: " zhendong.su at inf dot ethz.ch 2021-12-29 17:17 ` [Bug rtl-optimization/103860] [9/10/11/12 Regression] " jakub at gcc dot gnu.org 2021-12-29 17:32 ` jakub at gcc dot gnu.org 2021-12-29 18:10 ` jakub at gcc dot gnu.org 2021-12-29 18:23 ` jakub at gcc dot gnu.org 2021-12-29 19:43 ` segher at gcc dot gnu.org 2021-12-29 19:58 ` jakub at gcc dot gnu.org 2021-12-29 20:30 ` segher at gcc dot gnu.org 2021-12-30 13:24 ` cvs-commit at gcc dot gnu.org [this message] 2021-12-30 13:39 ` [Bug rtl-optimization/103860] [9/10/11 " jakub at gcc dot gnu.org 2022-01-04 9:13 ` cvs-commit at gcc dot gnu.org 2022-01-04 13:59 ` rguenth at gcc dot gnu.org 2022-01-24 9:20 ` cvs-commit at gcc dot gnu.org 2022-01-24 9:30 ` [Bug rtl-optimization/103860] [9/10 " jakub at gcc dot gnu.org 2022-05-10 8:22 ` cvs-commit at gcc dot gnu.org 2022-05-11 6:23 ` cvs-commit at gcc dot gnu.org 2022-05-11 6:36 ` jakub 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-103860-4-BRRoU6QaqX@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).