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 middle-end/31029] Fold does not fold C - a == a



------- Comment #9 from rguenth at gcc dot gnu dot org  2009-03-31 14:28 -------
Subject: Bug 31029

Author: rguenth
Date: Tue Mar 31 14:28:16 2009
New Revision: 145345

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=145345
Log:
2009-03-31  Richard Guenther  <rguenther@suse.de>

        PR middle-end/31029
        * fold-const.c (fold_binary): Fold X +- Y CMP X to Y CMP 0 for
        equality comparisons.  Fold C - X CMP X if C % 2 == 1.

        * gcc.dg/fold-compare-4.c: New testcase.
        * gcc.dg/fold-compare-5.c: Likewise.

Added:
    trunk/gcc/testsuite/gcc.dg/fold-compare-4.c
    trunk/gcc/testsuite/gcc.dg/fold-compare-5.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/fold-const.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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