Bug 8414 - [3.3 regression] [IA64] -funroll-loops -O removes loop termination
Summary: [3.3 regression] [IA64] -funroll-loops -O removes loop termination
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 3.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2002-10-31 09:16 UTC by Tim Prince
Modified: 2003-07-25 17:33 UTC (History)
3 users (show)

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


Attachments
badunroll.tar (2.17 KB, application/octet-stream)
2003-05-21 15:17 UTC, Tim Prince
Details

Note You need to log in before you can comment on or make changes to this bug.
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.