optimization/7270: Redundant compares not eliminated on x86.

anamax@earthlink.net anamax@earthlink.net
Wed Jul 10 23:33:00 GMT 2002

>Number:         7270
>Category:       optimization
>Synopsis:       Redundant compares not eliminated on x86.
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          pessimizes-code
>Submitter-Id:   net
>Arrival-Date:   Wed Jul 10 22:46:00 PDT 2002
>Originator:     Andy Freeman
>Release:        gcc 3.1
Redhat 7.3
A <= compare&branch followed by a == test on the same arguments uses a redundant compare for the == on x86.

Using built-in specs.
Configured with: ../gcc-3.1/configure 
Thread model: single
gcc version 3.1
Look at the -O3 -S output for x86.  Notice the two cmpls on either side of the "ja .L4".  I believe that the second cmpl is unnecessary as the flags from the first should survive the "ja .L4".
Better value propagation.
Content-Type: application/octet-stream; name="ii.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="ii.cc"


More information about the Gcc-bugs mailing list