From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11664 invoked by alias); 11 May 2003 12:06:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 11644 invoked by uid 71); 11 May 2003 12:06:01 -0000 Date: Sun, 11 May 2003 12:06:00 -0000 Message-ID: <20030511120601.11643.qmail@sources.redhat.com> To: nobody@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org, From: Richard Guenther Subject: Re: optimization/6883: Fails to optimize temporary objects. Reply-To: Richard Guenther X-SW-Source: 2003-05/txt/msg01077.txt.bz2 List-Id: The following reply was made to PR optimization/6883; it has been noted by GNATS. From: Richard Guenther To: Dara Hazeghi Cc: gcc-gnats@gcc.gnu.org, Subject: Re: optimization/6883: Fails to optimize temporary objects. Date: Sun, 11 May 2003 14:00:37 +0200 (CEST) On Sat, 10 May 2003, Dara Hazeghi wrote: > http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit- > trail&database=gcc&pr=6883 > > Hello, > > this bug was reported against gcc 3.1. Would it be possible to test > your testcase against a more current version of gcc (ie 3.2.3 or 3.3 > prerelease) and report back on the results? Thanks, Some more information, based on my last reply - the Intel compiler Intel(R) C++ Compiler for 32-bit applications, Version 7.1 Build 20030424Z produces with -O2 iterators with temporaries ..B1.18: # Preds ..B1.18 ..B1.17 lea 1(%esi), %edi #65.24 cmpl $254, %edi #66.16 fldl -8(%edx,%esi,8) #65.21 faddl 8(%edx,%esi,8) #65.28 fmull (%eax,%esi,8) #65.32 fstpl (%ecx,%esi,8) #65.9 movl %edi, %esi #65.24 jle ..B1.18 # Prob 97% #66.16 iterators without temporaries ..B1.21: # Preds ..B1.21 ..B1.20 # Infreq fldl -8(%edx,%esi,8) #74.17 faddl 8(%edx,%esi,8) #74.25 fmull (%eax,%esi,8) #74.34 fstpl (%ecx,%esi,8) #74.9 incl %esi #75.16 cmpl $254, %esi #75.16 jle ..B1.21 # Prob 97% #75.16 no iterators, just int ..B1.24: # Preds ..B1.24 ..B1.23 # Infreq lea 1(%edi), %esi #83.24 fldl -8(%eax,%edi,8) #83.17 faddl 8(%eax,%edi,8) #83.24 fmull (%edx,%edi,8) #83.32 fstpl (%ecx,%edi,8) #83.9 addl $2, %edi #83.24 cmpl $254, %edi #84.16 fldl -8(%eax,%esi,8) #83.17 faddl 8(%eax,%esi,8) #83.24 fmull (%edx,%esi,8) #83.32 fstpl (%ecx,%esi,8) #83.9 jle ..B1.24 # Prob 97% #84.16 it even detects the loop is run even times and unrolls it 2-times ;) This is what I like the code to get optimized to, at least all three versions look nearly the same. Richard.