From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8812 invoked by alias); 7 Mar 2004 01:34:11 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 8805 invoked by uid 48); 7 Mar 2004 01:34:11 -0000 Date: Sun, 07 Mar 2004 01:34:00 -0000 Message-ID: <20040307013411.8804.qmail@sources.redhat.com> From: "pinskia at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20031025005408.12771.tm@kloo.net> References: <20031025005408.12771.tm@kloo.net> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug optimization/12771] Weak loop optimizer X-Bugzilla-Reason: CC X-SW-Source: 2004-03/txt/msg00855.txt.bz2 List-Id: ------- Additional Comments From pinskia at gcc dot gnu dot org 2004-03-07 01:34 ------- The mainline has changed but still the same number of memory accesses: movl 16(%ebp), %edx flds (%edx,%eax,4) fmul %st(1), %st fadds (%esi,%eax,4) fstps (%esi,%eax,4) incl %eax On the other hand with -freduce-all-givs, it has increased by one: .L15: flds (%ecx) addl $4, %ecx fmul %st(1), %st fadds (%eax) fstps (%eax) addl $4, %eax decl %edx jne .L15 Here is the reduced source: void daxpy(int n, float da, float dx[], int incx, float dy[], int incy) { int i,ix,iy,m,mp1; mp1 = 0; m = 0; if(n <= 0) return; if (da == 0.0 ) return; if(incx != 1 || incy != 1) { ix = 0; iy = 0; if(incx < 0) ix = (-n+1)*incx; if(incy < 0)iy = (-n+1)*incy; for (i = 0;i < n; i++) { dy[iy] = dy[iy] + da*dx[ix]; ix = ix + incx; iy = iy + incy; } return; } for (i = 0;i < n; i++) { dy[i] = dy[i] + da*dx[i]; } return; } -- What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed|2003-10-28 15:38:57 |2004-03-07 01:34:09 date| | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12771