With (ulong a, ulong b) and code like if ( a<b ) { ulong t=a; a=b; b=t; } gcc should (if a and b are in registers already) not emit a conditional jump but code like MOV a, t; CMP a, b; CMOVcc b, a; CMOVcc t, b;
Other such examples are easily found. If I got it correctly, gcc emits CMOVcc in just one situation, the conditional assignment. Machine is AMD64, OS is SuSE Linux 9.3 gcc (GCC) 3.3.5 20050117 (prerelease) (SUSE Linux) -- Summary: Should use cmov in some stituations Product: gcc Version: unknown Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: arndt at jjj dot de CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22568