Hi,

it seems that the 
 if(val>=max) val=max;

statement is on some processors faster than
 if(val>max) val=max;

I will attach a testcase, which shows that the first version seems to be faster
on amd based systems, the second version on intel based systems. Might be
something -O can detect and optimize.
This came up in a discussion on the kernel janitor mailinglist 
http://marc.theaimsgroup.com/?l=kernel-janitor-discuss&m=113942520002963&w=2

Thanks, Eric


-- 
           Summary: optimize if(val>max) val=max;
           Product: gcc
           Version: 3.4.5
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: snakebyte at gmx dot de


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26196

Reply via email to