This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rtl-optimization/28173] [4.0/4.1 regression] misses constant folding



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]