Bug 37240

Summary: missed if-conversion opportunity
Product: gcc Reporter: Paolo Bonzini <bonzini>
Component: rtl-optimizationAssignee: Not yet assigned to anyone <unassigned>
Status: RESOLVED DUPLICATE    
Severity: normal CC: bonzini, esigra, gcc-bugs
Priority: P3 Keywords: missed-optimization
Version: 4.4.0   
Target Milestone: ---   
Host: Target: x86_64-pc-linux-gnu
Build: Known to work:
Known to fail: 4.4.0 4.2.3 Last reconfirmed:
Bug Depends on: 37239    
Bug Blocks:    
Attachments: benchmark

Description Paolo Bonzini 2008-08-26 11:37:54 UTC
In the attached code, changing

        if (numbers[maxIdx] < numbers[maxIdx + 1]) maxIdx++; 

to

        maxIdx += numbers[maxIdx] < numbers[maxIdx + 1];

gives a 10% performance speedup at -O3.
Comment 1 Paolo Bonzini 2008-08-26 11:39:38 UTC
Created attachment 16149 [details]
benchmark

this is a modified version of the PR37239 testcase, with the optimization requested there performed manually.
Comment 2 Andrew Pinski 2008-08-26 20:46:52 UTC
I think this is a dup of bug 30521.
Comment 3 Paolo Bonzini 2008-08-27 04:40:03 UTC

*** This bug has been marked as a duplicate of 30521 ***