Bug 769 - loop index at for loop exit is wrong
Summary: loop index at for loop exit is wrong
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: rtl-optimization (show other bugs)
Version: 2.95.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2000-11-10 12:26 UTC by eric.pouech
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
aa.c (131 bytes, application/octet-stream)
2003-05-21 15:17 UTC, eric.pouech
Details

Note You need to log in before you can comment on or make changes to this bug.
Description eric.pouech 2000-11-10 12:26:00 UTC
the generated code is not correct
the content of array L should be {1,2,3,4} 
after the instructions, but it's {1,2,2,4}
This appears only when -O2 (and above) is used. 
However using -O2 -fno-strength-reduce does produce a correct output.

Release:
gcc version 2.95.1 19990816 (release)

Environment:
Linux erato 2.2.9-27mdk #1 Mon Jun 14 16:44:05 CEST 1999 i686 unknown
running Mandrake
Comment 1 Richard Henderson 2001-02-14 15:33:27 UTC
State-Changed-From-To: open->closed
State-Changed-Why: Fixed for gcc 3.0.
Comment 2 Richard Henderson 2001-02-14 23:33:27 UTC
From: rth@gcc.gnu.org
To: eric.pouech@wanadoo.fr, gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org
Cc:  
Subject: Re: optimization/769
Date: 14 Feb 2001 23:33:27 -0000

 Synopsis: loop index at for loop exit is wrong
 
 State-Changed-From-To: open->closed
 State-Changed-By: rth
 State-Changed-When: Wed Feb 14 15:33:27 2001
 State-Changed-Why:
     Fixed for gcc 3.0.
 
 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view&pr=769&database=gcc