public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/65282] [5 Regression] wrong code at -Os and above on x86_64-linux-gnu Date: Tue, 03 Mar 2015 12:09:00 -0000 [thread overview] Message-ID: <bug-65282-4-bmcKSD5gND@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-65282-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65282 --- Comment #4 from Martin Liška <marxin at gcc dot gnu.org> --- Author: marxin Date: Tue Mar 3 12:09:13 2015 New Revision: 221146 URL: https://gcc.gnu.org/viewcvs?rev=221146&root=gcc&view=rev Log: Fix PR ipa/65282. * gcc.dg/ipa/PR65282.c: New test. PR ipa/65282 * ipa-icf.c (sem_variable::equals): Fix wrong condition. Added: trunk/gcc/testsuite/gcc.dg/ipa/PR65282.c Modified: trunk/gcc/ChangeLog trunk/gcc/ipa-icf.c trunk/gcc/testsuite/ChangeLog >From gcc-bugs-return-479149-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Mar 03 12:11:19 2015 Return-Path: <gcc-bugs-return-479149-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org> Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 11284 invoked by alias); 3 Mar 2015 12:11:19 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: <gcc-bugs.gcc.gnu.org> List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/> List-Post: <mailto:gcc-bugs@gcc.gnu.org> List-Help: <mailto:gcc-bugs-help@gcc.gnu.org> Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 10910 invoked by uid 48); 3 Mar 2015 12:11:16 -0000 From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug ipa/65282] [5 Regression] wrong code at -Os and above on x86_64-linux-gnu Date: Tue, 03 Mar 2015 12:11:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: ipa X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: marxin at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: marxin at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status resolution Message-ID: <bug-65282-4-o6hZR4ZzZ0@http.gcc.gnu.org/bugzilla/> In-Reply-To: <bug-65282-4@http.gcc.gnu.org/bugzilla/> References: <bug-65282-4@http.gcc.gnu.org/bugzilla/> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg00293.txt.bz2 Content-length: 440 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65282 Martin Liška <marxin at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> --- Fixed in 5.0. >From gcc-bugs-return-479150-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Mar 03 12:30:48 2015 Return-Path: <gcc-bugs-return-479150-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org> Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 83504 invoked by alias); 3 Mar 2015 12:30:48 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: <gcc-bugs.gcc.gnu.org> List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/> List-Post: <mailto:gcc-bugs@gcc.gnu.org> List-Help: <mailto:gcc-bugs-help@gcc.gnu.org> Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 83434 invoked by uid 48); 3 Mar 2015 12:30:44 -0000 From: "law at redhat dot com" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/64317] [5 Regression] Ineffective allocation of PIC base register Date: Tue, 03 Mar 2015 12:30:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: rtl-optimization X-Bugzilla-Version: 5.0 X-Bugzilla-Keywords: missed-optimization, ra X-Bugzilla-Severity: normal X-Bugzilla-Who: law at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 5.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: <bug-64317-4-QX8gCm3oXg@http.gcc.gnu.org/bugzilla/> In-Reply-To: <bug-64317-4@http.gcc.gnu.org/bugzilla/> References: <bug-64317-4@http.gcc.gnu.org/bugzilla/> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg00294.txt.bz2 Content-length: 2160 https://gcc.gnu.org/bugzilla/show_bug.cgi?idd317 --- Comment #17 from Jeffrey A. Law <law at redhat dot com> --- Thanks Vlad, that patch helped. Prior to your patch we had 15 reloads of the PIC register from memory, after your patch we have just 9. However, several of the remaining 9 seem to be redundant. LRA never considers a block starting with a label as participating in an EBB. That's overly conservative. A block can participate in an EBB if all of its predecessors are part of the same EBB. That's particularly useful in CFGs like A /| / | B | \ | \| C [ Flow downward of course. ] If we assume that B is the fallthru path, then LRA will try to make AB into an EBB. But it will not consider C because C will start with a label. That ultimately causes missed inheritances in this example. As an example, we have this in the .reload dump: [ BB 7 ] (insn 848 94 582 7 (set (reg:SI 6 bp [107]) (mem/c:SI (plus:SI (reg/f:SI 7 sp) (const_int 28 [0x1c])) [4 %sfp+-4 S4 A32])) k.c:22 90 {*movsi_internal} (nil)) [ ... ] (jump_insn 99 98 100 7 (set (pc) (if_then_else (geu (reg:CC 17 flags) (const_int 0 [0])) (label_ref 103) (pc))) k.c:18 613 {*jcc_1} (int_list:REG_BR_PROB 5000 (nil)) [ BB 8 ] (insn 584 100 101 8 (set (reg:SI 3 bx [107]) (reg:SI 6 bp [107])) k.c:19 90 {*movsi_internal} (nil)) [ Note we inherited the value in %ebp, this is good. ] [ ... ] [ BB 9 ] (code_label 103 102 104 9 5 "" [1 uses]) [ ... ] (insn 850 105 585 9 (set (reg:SI 6 bp [107]) (mem/c:SI (plus:SI (reg/f:SI 7 sp) (const_int 28 [0x1c])) [4 %sfp+-4 S4 A32])) k.c:22 90 {*movsi_internal} (nil)) Note insn 850 which reloads the value from memory again. We correctly formed an EBB with BB7 and BB8, but we really should have extended that to BB9. It appears that fixing this would improve things further. It's also the case that the post-reload passes aren't doing as good of a job at cleaning things up as they should, so I'll look at that in parallel if you can investigate the LRA side of things.
prev parent reply other threads:[~2015-03-03 12:09 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2015-03-02 20:48 [Bug tree-optimization/65282] New: " su at cs dot ucdavis.edu 2015-03-03 8:43 ` [Bug ipa/65282] [5 Regression] " mpolacek at gcc dot gnu.org 2015-03-03 10:41 ` marxin at gcc dot gnu.org 2015-03-03 12:09 ` marxin at gcc dot gnu.org [this message]
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-65282-4-bmcKSD5gND@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).