mirror of
https://github.com/cc65/cc65.git
synced 2025-03-24 08:29:30 +00:00
Improved codegen for unsigned char type comparison with numeric constants.
This commit is contained in:
parent
6f5ad51816
commit
ea0c634e12
@ -2845,7 +2845,7 @@ static void hie_compare (const GenDesc* Ops, /* List of generators */
|
||||
}
|
||||
|
||||
/* Determine the type of the operation. */
|
||||
if (IsTypeChar (Expr->Type) && rconst && RightSigned) {
|
||||
if (IsTypeChar (Expr->Type) && rconst && (!LeftSigned || RightSigned)) {
|
||||
|
||||
/* Left side is unsigned char, right side is constant.
|
||||
** Determine the minimum and maximum values
|
||||
@ -2923,7 +2923,7 @@ static void hie_compare (const GenDesc* Ops, /* List of generators */
|
||||
** since the right side constant is in a valid range.
|
||||
*/
|
||||
flags |= (CF_CHAR | CF_FORCECHAR);
|
||||
if (!LeftSigned) {
|
||||
if (!LeftSigned || !RightSigned) {
|
||||
flags |= CF_UNSIGNED;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user