public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/33512]  New: Simple bitwise simplification missed
@ 2007-09-20 22:32 pinskia at gcc dot gnu dot org
  2007-09-20 22:36 ` [Bug rtl-optimization/33512] " pinskia at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-09-20 22:32 UTC (permalink / raw)
  To: gcc-bugs

These two functions should produce the same code:
int f(int y, int x)
{
  return x & ((~x) | y);
}
int g(int y, int x)
{
  return y & x;
}

x & ((~x) | y) is the same as (x & ~x) | (x & y) using distribution and that
becomes (x & y) because (x & ~x) is always 0 and 0 | x is x.

This should be done at both the tree level and the RTL level.


-- 
           Summary: Simple bitwise simplification missed
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33512


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-07-02 19:52 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-20 22:32 [Bug rtl-optimization/33512] New: Simple bitwise simplification missed pinskia at gcc dot gnu dot org
2007-09-20 22:36 ` [Bug rtl-optimization/33512] " pinskia at gcc dot gnu dot org
2007-10-02 18:44 ` pinskia at gcc dot gnu dot org
2008-02-23 18:00 ` pinskia at gcc dot gnu dot org
2008-02-23 18:02 ` [Bug tree-optimization/33512] " pinskia at gcc dot gnu dot org
2008-04-04 21:20 ` janis at gcc dot gnu dot org
2008-04-04 21:22 ` pinskia at gcc dot gnu dot org
2008-07-15 14:54 ` pinskia at gcc dot gnu dot org
2008-11-23 18:46 ` pinskia at gcc dot gnu dot org
2010-07-02 19:52 ` bergner at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).