https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93453
Bug ID: 93453 Summary: PPC: rldimi not taken into account to avoid shift+or Product: gcc Version: 8.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: jens.seifert at de dot ibm.com Target Milestone: --- 2 samples: unsigned long long load8r(unsigned long long *in) { return __builtin_bswap64(*in); } unsigned long long rldimi(unsigned int hi, unsigned int lo) { return (((unsigned long long)hi) << 32) | ((unsigned long long)lo); } Command line: gcc -maix64 -mcpu=power6 -save-temps -O2 rldimi.C Even if number range is known to not cause conflicts shift+or does not get replaces by rldimi. Output: ._Z6load8rPy: LFB..0: addi 9,3,4 lwbrx 3,0,3 lwbrx 10,0,9 sldi 10,10,32 or 3,3,10 blr ._Z6rldimijj: LFB..1: sldi 3,3,32 or 3,3,4 blr