This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug rtl-optimization/28173] [4.0/4.1 regression] misses constant folding
- From: "sayle at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Feb 2007 17:10:33 -0000
- Subject: [Bug rtl-optimization/28173] [4.0/4.1 regression] misses constant folding
- References: <bug-28173-7674@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #4 from sayle at gcc dot gnu dot org 2007-02-18 17:10 -------
Subject: Bug 28173
Author: sayle
Date: Sun Feb 18 17:10:19 2007
New Revision: 122100
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122100
Log:
Backport from mainline.
PR middle-end/24427
PR rtl-optimization/28173
* fold-const.c (fold_binary) <BIT_IOR_EXPR>: Transform (X&C1)|C2
into (X,C2) if C1 is a subset of the bits of C2. Transform
(X&C1)|C2 into X|C2 if C1|C2 == ~0. Canonicalize (X&C1)|C2 as
(X&(C1&~C2))|C2.
<BIT_AND_EXPR>: Canonicalize (X|C1)&C2 as (X&C2)|(C1&C2).
* gcc.dg/tree-ssa/andor-1.c: New test case.
Added:
branches/gcc-4_1-branch/gcc/testsuite/gcc.dg/tree-ssa/andor-1.c
Modified:
branches/gcc-4_1-branch/gcc/ChangeLog
branches/gcc-4_1-branch/gcc/fold-const.c
branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28173