optimization/4311: unrolling loops creates non-ending loop
guillaume.lemaitre33@wanadoo.fr
guillaume.lemaitre33@wanadoo.fr
Wed Sep 12 13:16:00 GMT 2001
>Number: 4311
>Category: optimization
>Synopsis: unrolling loops creates non-ending loop
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Wed Sep 12 13:16:01 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Guillaume Lemaître
>Release: gcc-3.0.1
>Organization:
>Environment:
linux mandrake 8, duron 750 MHz
>Description:
see the source code attached.
a simple 'for' structure goes looping ever and ever
for special values of the upper bound
change the value of 'max' from -5 to -6 for example, and the
program will work
>How-To-Repeat:
gcc -O3 -Wall -funroll-all-loops -s comparaison.c -o comparaison
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="comparaison.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="comparaison.c"
aW50Cm1haW4oIHZvaWQgKSB7CiAgY29uc3QgdW5zaWduZWQgaW50IG1heCA9ICh1bnNpZ25lZCBp
bnQpIC01OwoKICB1bnNpZ25lZCBpbnQgaTsKICB2b2xhdGlsZSB1bnNpZ25lZCBpbnQgajsKCiAg
Zm9yKCBpID0gMDsgaSA8IG1heDsgKytpICkKICAgIGogPSBpOwoKICByZXR1cm4gMDsKfQo=
More information about the Gcc-bugs
mailing list