Skip to content

Commit

Permalink
Merge pull request #2398 from acqn/OptFix
Browse files Browse the repository at this point in the history
[cc65] Fixed optimization for char-size bitwise XOR/OR/AND when the rhs operand is complicated
  • Loading branch information
mrdudz committed Feb 2, 2024
2 parents a7ac9b7 + 54b423a commit d5c84e7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
6 changes: 3 additions & 3 deletions src/cc65/coptstop.c
Original file line number Diff line number Diff line change
Expand Up @@ -1488,21 +1488,21 @@ 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 },
{ "tosicmp", Opt_a_tosicmp, REG_NONE, OP_NONE },
{ "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]))
Expand Down
7 changes: 0 additions & 7 deletions test/todo/bug2395.c → test/val/bug2395.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,5 @@ int main(void) {
}
printf("%d errors\n", fails);

#ifdef __OPT__
return fails;
#else
/* Force exit failure on non-optimised version, which works,
* otherwise it breaks the build
*/
return 1;
#endif
}

0 comments on commit d5c84e7

Please sign in to comment.