Bug 52157 - Missing FRE because of sign change
Summary: Missing FRE because of sign change
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.7.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: missed-optimization, TREE
Depends on:
Blocks: 14617
  Show dependency treegraph
 
Reported: 2012-02-07 20:24 UTC by Andrew Pinski
Modified: 2012-02-08 10:40 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2012-02-08 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2012-02-07 20:24:17 UTC
Take:
int f(int a)
{
  unsigned int t = a;
  t-=100;
  if (t <= 200 )
    return a-100;
  else
    return t;
}
--- CUT ---
We should able to simplify this function just to:
int f(int a)
{
  unsigned int t = a;
  t-=100;
  return t;
}
Comment 1 Richard Biener 2012-02-08 10:40:59 UTC
Confirmed.  But it's definitely not that easy.