From 96d55e3703de9a9b079cc7f4da8e6b5ed82fb6e5 Mon Sep 17 00:00:00 2001 From: acqn Date: Fri, 2 Feb 2024 19:00:33 +0800 Subject: [PATCH] Fixed optimization for char-size bitwise XOR/OR/AND when the rhs operand is complicated. --- src/cc65/coptstop.c | 6 +++--- test/{todo => val}/bug2395.c | 0 2 files changed, 3 insertions(+), 3 deletions(-) rename test/{todo => val}/bug2395.c (100%) diff --git a/src/cc65/coptstop.c b/src/cc65/coptstop.c index 7e024ae88..402f16b97 100644 --- a/src/cc65/coptstop.c +++ b/src/cc65/coptstop.c @@ -1488,7 +1488,7 @@ static const OptFuncDesc FuncTable[] = { }; static const OptFuncDesc FuncRegATable[] = { - { "tosandax", Opt_a_tosand, REG_NONE, OP_NONE }, + { "tosandax", Opt_a_tosand, REG_NONE, OP_RHS_REMOVE_DIRECT | OP_RHS_LOAD_DIRECT }, { "toseqax", Opt_a_toseq, REG_NONE, OP_NONE }, { "tosgeax", Opt_a_tosuge, REG_NONE, OP_NONE }, { "tosgtax", Opt_a_tosugt, REG_NONE, OP_NONE }, @@ -1496,13 +1496,13 @@ static const OptFuncDesc FuncRegATable[] = { { "tosleax", Opt_a_tosule, REG_NONE, OP_NONE }, { "tosltax", Opt_a_tosult, REG_NONE, OP_NONE }, { "tosneax", Opt_a_tosne, REG_NONE, OP_NONE }, - { "tosorax", Opt_a_tosor, REG_NONE, OP_NONE }, + { "tosorax", Opt_a_tosor, REG_NONE, OP_RHS_REMOVE_DIRECT | OP_RHS_LOAD_DIRECT }, { "tossubax", Opt_a_tossub, REG_NONE, OP_RHS_REMOVE_DIRECT | OP_RHS_LOAD_DIRECT }, { "tosugeax", Opt_a_tosuge, REG_NONE, OP_NONE }, { "tosugtax", Opt_a_tosugt, REG_NONE, OP_NONE }, { "tosuleax", Opt_a_tosule, REG_NONE, OP_NONE }, { "tosultax", Opt_a_tosult, REG_NONE, OP_NONE }, - { "tosxorax", Opt_a_tosxor, REG_NONE, OP_NONE }, + { "tosxorax", Opt_a_tosxor, REG_NONE, OP_RHS_REMOVE_DIRECT | OP_RHS_LOAD_DIRECT }, }; #define FUNC_COUNT(Table) (sizeof(Table) / sizeof(Table[0])) diff --git a/test/todo/bug2395.c b/test/val/bug2395.c similarity index 100% rename from test/todo/bug2395.c rename to test/val/bug2395.c