Bug 8414

Summary: [3.3 regression] [IA64] -funroll-loops -O removes loop termination
Product: gcc Reporter: Tim Prince <tprince>
Component: rtl-optimizationAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs, steven, tprince
Priority: P3 Keywords: wrong-code
Version: 3.3   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed:
Attachments: badunroll.tar

Description Tim Prince 2002-10-31 09:16:01 UTC
for loop termination condition ignored at -O -funroll-loops;
loop runs until SEGV occurs.  This is a regression from 3.2.1 and early 3.3 snapshots.
main(){
    double x[200];
    int ii = 100;
    int k,i,ipntp = 0;
    while (ii > 1) {
      int ipnt = ipntp;
      ipntp += ii;
      ii /= 2;
      i = ipntp;
      for (k = ipnt + 1; k < ipntp; k += 2)
	x[++i] = x[k];
    }
}
Similar problem was observed in g77.

Release:
gcc-3.3 snapshot 20021028

Environment:
ITP "Big Sur" redhat 7.2, binutils 2.12.91, gdbf95 RC2

How-To-Repeat:
gcc -O -funroll-loops -g badunroll.c
gdb a.out
r
Comment 1 Tim Prince 2002-10-31 09:16:01 UTC
Fix:
Use gcc-3.2.x or avoid -funroll-loops
Comment 2 Steven Bosscher 2003-03-22 00:08:58 UTC
State-Changed-From-To: open->feedback
State-Changed-Why: Tim,
    
    Can you verify this problem is still there?
    The PR is against gcc-3.3 snapshot 20021028,
    that's quite some time ago...
Comment 3 tprince 2003-03-22 01:15:16 UTC
From: "Timothy C Prince" <tprince@myrealbox.com>
To: steven@gcc.gnu.org,
	gcc-bugs@gcc.gnu.org,
	gcc-prs@gcc.gnu.org,
	nobody@gcc.gnu.org,
	tprince@computer.org,
	gcc-gnats@gcc.gnu.org
Cc: gcc-bugs@gcc.gnu.org,
	gcc-prs@gcc.gnu.org,
	nobody@gcc.gnu.org,
	tprince@computer.org
Subject: Re: Re: optimization/8414: [3.3 regression] [IA64] -funroll-loops -O removes loop termination 
Date: Sat, 22 Mar 2003 01:15:16 +0000

 -----Original Message-----
 From: steven@gcc.gnu.org
 To: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org, tprince@=
 computer.org
 Date: 22 Mar 2003 00:08:58 -0000
 Subject: Re: optimization/8414: [3.3 regression] [IA64] -funroll-loops -O r=
 emoves loop termination 
 
 Synopsis: [3.3 regression] [IA64] -funroll-loops -O removes loop terminatio=
 n
 
 State-Changed-From-To: open->feedback
 State-Changed-By: steven
 State-Changed-When: Sat Mar 22 00:08:58 2003
 State-Changed-Why:
     Tim,
     
     Can you verify this problem is still there?
     The PR is against gcc-3.3 snapshot 20021028,
     that's quite some time ago...
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=3Dview%20audit-trail&database=3D=
 gcc&pr=3D8414
 
 
 This was fixed.  I tried to post notification of that, but I don't know the=
  correct procedure.
 
 Thanks.
 
 Tim Prince
Comment 4 Steven Bosscher 2003-03-22 01:28:46 UTC
State-Changed-From-To: feedback->closed
State-Changed-Why: Fixed according to the reporter.
    
    In a private mail I also explained how to notify the gcc bug tracker of changes in the status of a PR.