No more unnecessary jump-over labels generated for logical OR false cases.
This commit is contained in:
@@ -3757,7 +3757,6 @@ static void hieOr (ExprDesc *Expr)
|
|||||||
unsigned Flags = Expr->Flags & E_MASK_KEEP_SUBEXPR;
|
unsigned Flags = Expr->Flags & E_MASK_KEEP_SUBEXPR;
|
||||||
int AndOp; /* Did we have a && operation? */
|
int AndOp; /* Did we have a && operation? */
|
||||||
unsigned TrueLab; /* Jump to this label if true */
|
unsigned TrueLab; /* Jump to this label if true */
|
||||||
unsigned DoneLab;
|
|
||||||
int HasTrueJump = 0;
|
int HasTrueJump = 0;
|
||||||
CodeMark Start;
|
CodeMark Start;
|
||||||
|
|
||||||
@@ -3884,18 +3883,22 @@ static void hieOr (ExprDesc *Expr)
|
|||||||
|
|
||||||
/* If we really had boolean ops, generate the end sequence if necessary */
|
/* If we really had boolean ops, generate the end sequence if necessary */
|
||||||
if (HasTrueJump) {
|
if (HasTrueJump) {
|
||||||
/* False case needs to jump over true case */
|
|
||||||
DoneLab = GetLocalLabel ();
|
|
||||||
if ((Flags & E_EVAL_UNEVAL) != E_EVAL_UNEVAL) {
|
if ((Flags & E_EVAL_UNEVAL) != E_EVAL_UNEVAL) {
|
||||||
|
/* False case needs to jump over true case */
|
||||||
|
unsigned DoneLab = GetLocalLabel ();
|
||||||
/* Load false only if the result is not true */
|
/* Load false only if the result is not true */
|
||||||
g_getimmed (CF_INT | CF_CONST, 0, 0); /* Load FALSE */
|
g_getimmed (CF_INT | CF_CONST, 0, 0); /* Load FALSE */
|
||||||
g_falsejump (CF_NONE, DoneLab);
|
g_falsejump (CF_NONE, DoneLab);
|
||||||
}
|
|
||||||
|
|
||||||
/* Load the true value */
|
/* Load the true value */
|
||||||
g_defcodelabel (TrueLab);
|
g_defcodelabel (TrueLab);
|
||||||
g_getimmed (CF_INT | CF_CONST, 1, 0); /* Load TRUE */
|
g_getimmed (CF_INT | CF_CONST, 1, 0); /* Load TRUE */
|
||||||
g_defcodelabel (DoneLab);
|
g_defcodelabel (DoneLab);
|
||||||
|
} else {
|
||||||
|
/* Load the true value */
|
||||||
|
g_defcodelabel (TrueLab);
|
||||||
|
g_getimmed (CF_INT | CF_CONST, 1, 0); /* Load TRUE */
|
||||||
|
}
|
||||||
|
|
||||||
/* The result is an rvalue in primary */
|
/* The result is an rvalue in primary */
|
||||||
ED_FinalizeRValLoad (Expr);
|
ED_FinalizeRValLoad (Expr);
|
||||||
|
|||||||
Reference in New Issue
Block a user