From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17638 invoked by alias); 6 Oct 2011 19:01:37 -0000 Received: (qmail 17621 invoked by uid 22791); 6 Oct 2011 19:01:35 -0000 X-SWARE-Spam-Status: No, hits=-2.7 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_DD,TW_OV,TW_VS X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 06 Oct 2011 19:01:21 +0000 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/50603] [x32] Unnecessary lea Date: Thu, 06 Oct 2011 19:01: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-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools 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: 2011-10/txt/msg00365.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50603 --- Comment #3 from H.J. Lu 2011-10-06 19:00:54 UTC --- [hjl@gnu-mic-2 pr50633]$ cat x.i struct s { int val[16]; }; extern double f (struct s pb, double pc); int main () { struct s x; int i; for (i = 0; i < 16; i++) x.val[i] = i + 1; if (f (x, 10000.0L) != 10136.0L) __builtin_abort (); return 0; } [hjl@gnu-mic-2 pr50633]$ make x.s /export/build/gnu/gcc-x32/build-x86_64-linux/gcc/xgcc -B/export/build/gnu/gcc-x32/build-x86_64-linux/gcc/ -mx32 -O -S x.i [hjl@gnu-mic-2 pr50633]$ cat x.s .file "x.i" .text .globl main .type main, @function main: .LFB0: .cfi_startproc subq $136, %rsp .cfi_def_cfa_offset 144 movl $0, %eax movl %esp, %ecx addl $60, %ecx .L2: addl $1, %eax leal (%rcx,%rax,4), %edx movl %eax, (%edx) cmpl $16, %eax jne .L2 movq 64(%rsp), %rax movq %rax, (%rsp) movq 72(%rsp), %rax movq %rax, 8(%rsp) movq 80(%rsp), %rax movq %rax, 16(%rsp) movq 88(%rsp), %rax movq %rax, 24(%rsp) movq 96(%rsp), %rax movq %rax, 32(%rsp) movq 104(%rsp), %rax movq %rax, 40(%rsp) movq 112(%rsp), %rax movq %rax, 48(%rsp) movq 120(%rsp), %rax movq %rax, 56(%rsp) movsd .LC0(%rip), %xmm0 call f ucomisd .LC1(%rip), %xmm0 jp .L5 je .L7 .L5: call abort .L7: movl $0, %eax addq $136, %rsp .cfi_def_cfa_offset 8 ret .cfi_endproc .LFE0: .size main, .-main leal (%rcx,%rax,4), %edx movl %eax, (%edx) can be combined into movl %eax, (%ecx,%eax,4)