Bug 26282 - Runtime alignment checks are not optimized
Summary: Runtime alignment checks are not optimized
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.1.0
: P3 enhancement
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: missed-optimization
Depends on:
Blocks: 3713
  Show dependency treegraph
 
Reported: 2006-02-14 13:36 UTC by Richard Biener
Modified: 2007-09-24 19:46 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-02-14 13:41:57


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Biener 2006-02-14 13:36:57 UTC
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).
Comment 1 Andrew Pinski 2006-02-14 13:41:57 UTC
Confirmed.
Comment 2 Andrew Pinski 2007-09-24 19:46:23 UTC
Fixed via http://gcc.gnu.org/ml/gcc-cvs/2007-09/msg00696.html .