For addresses of memory objects where we know its alignment we should be able to optimize runtime alignment checks like in
long foo; void bar(void) { if ((intptr_t)&foo & 3) link_error (); } and more cases like for function pointers or pmf (#3713). -- Summary: Runtime alignment checks are not optimized Product: gcc Version: 4.1.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: rguenth at gcc dot gnu dot org OtherBugsDependingO 3713 nThis: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26282