This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

c/3376: optimised code wrong in simple for statement



>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:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]