Merge pull request #2398 from acqn/OptFix

[cc65] Fixed optimization for char-size bitwise XOR/OR/AND when the rhs operand is complicated
This commit is contained in:
Bob Andrews 2024-02-02 17:20:31 +01:00 committed by GitHub
commit d5c84e7828
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 10 deletions

View File

@ -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]))

View File

@ -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
}