From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86714 invoked by alias); 2 Apr 2015 03:05:13 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 86681 invoked by uid 48); 2 Apr 2015 03:05:05 -0000 From: "law at redhat dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/65658] New: Jump threading too pessimistic when optimizing for size Date: Thu, 02 Apr 2015 03:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: law at redhat dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter attachments.created Message-ID: 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-04/txt/msg00096.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65658 Bug ID: 65658 Summary: Jump threading too pessimistic when optimizing for size Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: law at redhat dot com Created attachment 35209 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35209&action=edit testcase, compile with -O2 -Wall note uninitialized warnings for SRA's variables and trivially threadable block in setup() The jump threader will cancel jump threads when optimizing for size and the block will need to be duplicated. But that heuristic fails for something a block like this: # _36 = PHI <1(2), 1(4), 0(7)> # problem$l3_101 = PHI # problem$l4_100 = PHI amt ={v} {CLOBBER}; if (_36 != 0) goto ; else goto ; All incoming edges are threadable and the block produces no code. It's really just a redirection block that's not recognized as such -- probably due to the clobber statement. The net result is we cancel the jump thread, get worse code and issue false positive warnings for uninitialized variables. All around a lose.