Bug 23672 - Fold does not fold (a^b)^a to b
Summary: Fold does not fold (a^b)^a to b
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 4.1.0
: P2 enhancement
Target Milestone: 4.2.0
Assignee: Not yet assigned to anyone
URL:
Keywords: missed-optimization, TREE
Depends on:
Blocks: 19986
  Show dependency treegraph
 
Reported: 2005-09-01 02:27 UTC by Andrew Pinski
Modified: 2005-12-13 04:24 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-09-17 02:12:18


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2005-09-01 02:27:05 UTC
These two functions should be the same at the tree level but are not:
int f(int a, int b)
{
  return (a^b)^a;
}
int f1(int a, int b)
{
  return b;
}

---
Another one from LLVM.
Comment 1 Andrew Pinski 2005-09-17 02:12:18 UTC
Confirmed.
Comment 2 Daniel Berlin 2005-09-17 02:44:30 UTC
Subject: Re:  Fold does not fold  (a^b)^a to b

On Sat, 2005-09-17 at 02:12 +0000, pinskia at gcc dot gnu dot org wrote:
> ------- Additional Comments From pinskia at gcc dot gnu dot org  2005-09-17 02:12 -------
> Confirmed.
> 

The new reassoc should take care of this


Comment 3 Andrew Pinski 2005-12-13 04:24:10 UTC
Fixed.