From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 72181 invoked by alias); 21 Sep 2015 14:23: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 72152 invoked by uid 48); 21 Sep 2015 14:23:10 -0000 From: "ktkachov 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: Mon, 21 Sep 2015 14:23: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: ktkachov 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/msg01720.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67628 --- Comment #4 from ktkachov at gcc dot gnu.org --- (In reply to Andrew Pinski from comment #3) > (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. Right, seems like the code in fold_truth_andor. I think ifcombine should be doing a better job here though