User account creation filtered due to spam.

Bug 6405 - Loop-unrolling related performance regressions
Summary: Loop-unrolling related performance regressions
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: missed-optimization
Depends on:
Blocks:
 
Reported: 2002-04-22 07:56 UTC by roger
Modified: 2003-07-25 17:33 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
loop.c (127 bytes, application/octet-stream)
2003-05-21 15:17 UTC, roger
Details

Note You need to log in before you can comment on or make changes to this bug.
Description roger 2002-04-22 07:56:00 UTC
See http://gcc.gnu.org/ml/gcc/2002-02/msg00307.html

With the command line options "-O3 -funroll-loops", GCC 2.96
generates better code for the attached loop than GCC 3.1
(prerelease) or mainline.  A correctness fix had the side
effect that the compiler can no longer determine that this
loop iterates a fix number of times.

Release:
gcc-3.1 branch and mainline 20020422

Environment:
All platforms, but first observed on i686-pc-linux-gnu.

How-To-Repeat:
Compile the attached loop.c with "-O2 -funroll-all-loops"
and inspect the assembly code generated.
Comment 1 Roger Sayle 2002-09-08 11:47:35 UTC
State-Changed-From-To: open->closed
State-Changed-Why: This has now been fixed on mainline by the following patch:
    
    2002-09-08  Roger Sayle  <roger@eyesopen.com>
    
            PR optimization/6405
            * unroll.c (loop_iterations): last_loop_insn should be the previous
            non-note instruction before loop->end.
            * loop.c (strength_reduce): The conditional jump is the last
            non-note instruction before loop->end (as above).
Comment 2 Roger Sayle 2002-09-08 18:32:32 UTC
From: sayle@gcc.gnu.org
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: optimization/6405
Date: 8 Sep 2002 18:32:32 -0000

 CVSROOT:	/cvs/gcc
 Module name:	gcc
 Changes by:	sayle@gcc.gnu.org	2002-09-08 11:32:32
 
 Modified files:
 	gcc            : ChangeLog unroll.c loop.c 
 
 Log message:
 	PR optimization/6405
 	* unroll.c (loop_iterations): last_loop_insn should be the previous
 	non-note instruction before loop->end.
 	* loop.c (strength_reduce): The conditional jump is the last
 	non-note instruction before loop->end (as above).
 
 Patches:
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&r1=1.15362&r2=1.15363
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/unroll.c.diff?cvsroot=gcc&r1=1.175&r2=1.176
 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/loop.c.diff?cvsroot=gcc&r1=1.420&r2=1.421