From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 53795 invoked by alias); 18 Sep 2015 15:10:11 -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 53755 invoked by uid 48); 18 Sep 2015 15:10:07 -0000 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/67628] [tree-optimization] (a && b) && c shows better codegen than a && (b && c) Date: Fri, 18 Sep 2015 15:10:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: missed-optimization X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: 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: Message-ID: In-Reply-To: References: 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-09/txt/msg01499.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67628 --- Comment #3 from Andrew Pinski --- (In reply to ktkachov from comment #2) > (In reply to Andrew Pinski from comment #1) > > This is due to the fold-const.c optimization which should not be there any > > more. You need to do benchmarking on x86 also if you remove it. > > > > could you elaborate what optimization is that? > Is it a matter of fold-const.c or match.pd canonicalizing the expression in > some way? The optimization is converting andif into and. Basically ifcombine pass does not recombine them if fold-const does it early on.