commit 73710f9011f6e6dd2bdc34bacb4bd703af826782
Author:     Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Mon Aug 29 08:36:18 2016 +0200
Commit:     Roberto E. Vargas Caballero <[email protected]>
CommitDate: Mon Aug 29 08:36:18 2016 +0200

    [cc1] Fix conmutative() with == and !=
    
    Equality operators are full conmutative, so it is
    not needed to negate the operator when we apply
    the conmutative rule.

diff --git a/cc1/fold.c b/cc1/fold.c
index f2e5306..37cca42 100644
--- a/cc1/fold.c
+++ b/cc1/fold.c
@@ -365,9 +365,9 @@ commutative(int *op, Node **lp, Node **rp)
        case OGT:
        case OGE:
        case OLE:
+               *op = negop(*op);
        case OEQ:
        case ONE:
-               *op = negop(*op);
        case OADD:
        case OMUL:
        case OBAND:
diff --git a/cc1/tests/test056.c b/cc1/tests/test056.c
index 5750a08..029f524 100644
--- a/cc1/tests/test056.c
+++ b/cc1/tests/test056.c
@@ -27,7 +27,7 @@ G11   V10     "m      (
 G13    I       F       "main
 {
 \
-       h       G9      M7      .V6     'P      #P2     +P      @K      gI      
gN      #N0     !I
+       h       G9      M7      .V6     'P      #P2     +P      @K      gI      
gN      #N0     =I
 }
 */
 

Reply via email to