From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25052 invoked by alias); 26 May 2014 12:46:02 -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 25016 invoked by uid 48); 26 May 2014 12:45:59 -0000 From: "akruppa at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/60641] Converting ushort to offset on x86_64 generates double movzwl Date: Mon, 26 May 2014 12:46:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.7.3 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: akruppa at gmail dot com X-Bugzilla-Status: NEW 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: 2014-05/txt/msg02217.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60641 --- Comment #2 from Alex Kruppa --- With gcc-4.9.0, compiled from the official tarball, the foo() function does NOT produce the double movzwl instruction any more, but the bar() function still does. Dump of assembler code for function foo: 0x0000000000000000 <+0>: movzwl (%rdi),%edx 0x0000000000000003 <+3>: cmpb $0x0,(%rsi,%rdx,1) 0x0000000000000007 <+7>: mov %rdx,%rax 0x000000000000000a <+10>: mov $0x0,%edx 0x000000000000000f <+15>: cmove %edx,%eax 0x0000000000000012 <+18>: retq Dump of assembler code for function bar: 0x0000000000000020 <+0>: movzwl %si,%eax 0x0000000000000023 <+3>: movzwl %si,%esi 0x0000000000000026 <+6>: mov %esi,(%rdi,%rax,4) 0x0000000000000029 <+9>: retq