Testcase: unsigned int f(void) { return 0x80000001UL; } This should be able to done in three instructions: .f: li 3,1 oris 3,3,0x8000 blr
Right now it is done as: .L.f: li 3,0 ori 3,3,32768 sldi 3,3,16 ori 3,3,1 blr Which is (0x8000 << 16) | 1 but (0x8000 << 16) is what is done for oris. -- Summary: return 0x80000000UL code gen can be improved Product: gcc Version: 4.3.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: target AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org GCC target triplet: powerpc64-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31557