From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18627 invoked by alias); 1 Dec 2004 21:18:20 -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 18610 invoked by uid 48); 1 Dec 2004 21:18:17 -0000 Date: Wed, 01 Dec 2004 21:18:00 -0000 From: "pthaugen at us dot ibm dot com" To: gcc-bugs@gcc.gnu.org Message-ID: <20041201211816.18768.pthaugen@us.ibm.com> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/18768] New: Missed ivopts opportunity X-Bugzilla-Reason: CC X-SW-Source: 2004-12/txt/msg00201.txt.bz2 List-Id: Opening bug report per Zdeneck's request, snippets of email exchange follows: ========= void f1 (void * coefPtr, double * dd) { int i,j; /* Cast of "coefPtr" results in poor code for this loop (missed strength reduction). */ for (i = 0; i < 16; i++) { *(((double *) coefPtr) + i) = +0.0; } for (j = 0; j < 16; j++) { *(dd + j) = +0.0; } } ========= > this seems to be a problem with the cost function: > > Cost of strength reduction of the access = > Cost for incrementing the new induction variable: 8 > Cost for increased register pressure: 4 > Cost for the memory reference: 1 > > Cost for expressing the access using i = > Cost for multiplication by 8: 12 > Cost for the memory reference: 1 (addition of the result of > multiplications takes place in the address). > > The result is that it is not worthwhile to perform strength reduction. > I will try to do something with the code that estimates cost of memory > references, since it is quite wrong here. could you please create a bugreport for this? The things are a bit more complicated than what I expected; there is actually no way how the target could let ivopts know that DFmode address for (reg + reg) is more expensive than just reg, in the current state. -- Summary: Missed ivopts opportunity Product: gcc Version: 4.0.0 Status: UNCONFIRMED Severity: normal Priority: P2 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pthaugen at us dot ibm dot com CC: gcc-bugs at gcc dot gnu dot org GCC build triplet: powerpc64-linux GCC host triplet: powerpc64-linux GCC target triplet: powerpc64-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18768