scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit 73710f9011f6e6dd2bdc34bacb4bd703af826782
parent 273618dcaa13b6b1933f09c73ff9caeb5ab87bc2
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 29 Aug 2016 08:36:18 +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.

Diffstat:
Mcc1/fold.c | 2+-
Mcc1/tests/test056.c | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git 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 @@ -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 } */