From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8991 invoked by alias); 4 Dec 2012 01:04:12 -0000 Received: (qmail 8895 invoked by uid 48); 4 Dec 2012 01:03:47 -0000 From: "mikko.markus.torni at iki dot fi" To: gcc-bugs@gcc.gnu.org Subject: [Bug rtl-optimization/55583] Extended shift instruction on x86-64 is not used, producing unoptimal code Date: Tue, 04 Dec 2012 01:04: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: enhancement X-Bugzilla-Who: mikko.markus.torni at iki dot fi X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Attachment #28866 is obsolete 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: 2012-12/txt/msg00317.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55583 Mikko Markus Torni changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #28866|0 |1 is obsolete| | --- Comment #3 from Mikko Markus Torni 2012-12-04 01:03:44 UTC --- Created attachment 28868 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=28868 Source code demonstrating code generated (updated) Bug fixes in signed integer testcases. Clang 3.0 seems to produce optimal looking code in the following test cases: test32rn testu64l testu32l testu16l testu64ln testu64rn testu32ln testu32rn Clang 3.0 manages to use shld/shrd, but generates extra moves in the following test cases: test64r test32r test16r test64rn test32rn testu64rn testu32r testu16r Clang 3.0 fails to use shld/shrd in the following test cases: test64l test32l test16l test64ln test32ln test16ln test16rn testu16ln testu16rn Tested with clang: "/usr/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -S -disable-free -disable-llvm-verifier -main-file-name gcc_shld_not_used.c -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.22 -momit-leaf-frame-pointer -v -coverage-file gcc_shld_not_used.s -resource-dir /usr/bin/../lib/clang/3.0 -O2 -Wall -W -ferror-limit 19 -fmessage-length 0 -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fdiagnostics-show-option -o gcc_shld_not_used.s -x cpp-output gcc_shld_not_used.i clang -cc1 version 3.0 based upon llvm 3.0 hosted on x86_64-pc-linux-gnu