This code should really be simplified to a single shift before the end of the tree optimization passes. Once we've expanded to RTL this is likely to be too complex to simplify on a 32-bit machine.
unsigned long long int shifttwice(unsigned long long int v) { return v << 31 << 1; } -- Summary: missed tree-fold opportunity (shift of shifted value). Product: gcc Version: 4.1.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: minor Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rearnsha at gcc dot gnu dot org CC: gcc-bugs at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20544