This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c/3376: optimised code wrong in simple for statement
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c/3376: optimised code wrong in simple for statement
- From: alatham at flexsys-group dot com
- Date: 22 Jun 2001 17:49:24 -0000
- Reply-To: alatham at flexsys-group dot com
>Number: 3376
>Category: c
>Synopsis: optimised code wrong in simple for statement
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Fri Jun 22 10:56:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Allan Latham
>Release: 2.96 Red Hat (for info: NOT a problem in 2.95.3 Suse)
>Organization:
>Environment:
Red Hat 7.0.1J on i586
>Description:
cc -o Atest Atest.c works as expected
cc -O2 -o Atest Atest.c fails
The optimised version pass only one time thru the loop and reports the answer (variable se) as -1 when it should be 1.
>How-To-Repeat:
Compile and run the short test program with gcc 2.96
>Fix:
Recode as in the example.
>Release-Note:
>Audit-Trail:
>Unformatted: