This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

c/8681: Generates unneeded test


>Number:         8681
>Category:       c
>Synopsis:       Generates unneeded test
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          pessimizes-code
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 22 09:46:03 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     rf13@inf.tu-dresden.de
>Release:        gcc-3.2
>Organization:
>Environment:
Linux 2.4.18-PPP i686,glibc-2.2.4-18.7.0.6
>Description:
The compiler should remove the test for "i<0" in the loop body. Nobody can change i and the range of i is known.
>How-To-Repeat:
gcc -O3 -S foobar.c
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="foobar.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="foobar.c"

CiNkZWZpbmUgTiAxMDAwMAoKaW50IHN1bShpbnQgKnApCnsKICBpbnQgaSwgcmVzdWx0ID0gMDsK
CiAgZm9yIChpID0gMDsgaSA8IE47IGkrKykgewogICAgaWYgKGkgPCAwKSB7CiAgICAgIHJlc3Vs
dCA9IDA7CiAgICB9CiAgICByZXN1bHQgKz0gcFtpXTsKICB9CiAgcmV0dXJuIHJlc3VsdDsKfQo=


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