This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/1532: -O3 generates (obviously) redundant tests and jumps
- To: gcc-gnats at gcc dot gnu dot org
- Subject: c++/1532: -O3 generates (obviously) redundant tests and jumps
- From: duchier at ps dot uni-sb dot de
- Date: 1 Jan 2001 16:59:28 -0000
- Reply-To: duchier at ps dot uni-sb dot de
>Number: 1532
>Category: c++
>Synopsis: -O3 generates (obviously) redundant tests and jumps
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: pessimizes-code
>Submitter-Id: net
>Arrival-Date: Mon Jan 01 09:06:00 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: duchier@ps.uni-sb.de
>Release: all recent versions, including the development version
>Organization:
>Environment:
GNU/Linux, Intel
>Description:
tests and jumps involving (small) integer constants
are not optimized away (even performed redundantly).
>How-To-Repeat:
compile the attached file with all optimizations turned
on (in particular -O3) and inspect the assembly code
generated.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="foo.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="foo.cc"
aW5saW5lIGludCBjaGVjayhpbnQgaSxpbnQgaikgewogIGlmIChpPT1qKSByZXR1cm4gMDsKICBl
bHNlIGlmIChpPmopIHJldHVybiAxOwogIGVsc2UgcmV0dXJuIDI7Cn0KCmludCBmb28oaW50IGks
aW50IGopIHsKICBzd2l0Y2ggKGNoZWNrKGksaikpIHsKICBjYXNlIDA6IHJldHVybiBpK2o7CiAg
Y2FzZSAxOiByZXR1cm4gaTsKICBjYXNlIDI6IHJldHVybiBqOwogIH0KfQo=