From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18856 invoked by alias); 2 Feb 2013 12:02:15 -0000 Received: (qmail 18532 invoked by uid 48); 2 Feb 2013 12:01:58 -0000 From: "ubizjak at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/56175] Issue with combine phase on x86. Date: Sat, 02 Feb 2013 12:02: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: ubizjak at gmail 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-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 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 X-SW-Source: 2013-02/txt/msg00117.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56175 --- Comment #2 from Uros Bizjak 2013-02-02 12:01:56 UTC --- (In reply to comment #1) > Created attachment 29330 [details] > testcase > > This test must be compiled with the following options: > "-O2 -ffast-math -msse2 -mfpmath=sse -m32 -march=atom -mtune=atom > -ftree-loop-if-convert" Compiling attached test with above flags, I got: foo: movl 4(%esp), %eax movl 8(%esp), %edx testb %al, %al je .L3 testw %dx, %dx je .L3 shrb %al shrw %dx xorl %edx, %eax andl $1, %eax ret .L3: xorl %eax, %eax ret which looks the same as your optimal assembly in Description - maybe due to the fact that the attached test source is the same as the source in Description. BTW: This is probably the case of missing CSE in tree optimizers. Combine pass is not powerful enough to figure out optimal sequence, it more-or-less blindly combines various patterns. Please provide the test that exposes this missing optimization.