*/
CodeValue(ds, tp);
C_zne(true_label);
- C_bra(false_label);
+ c_bra(false_label);
}
}
}
if (true_label != NO_LABEL) {
compare(expr->nd_symb, true_label);
- C_bra(false_label);
+ c_bra(false_label);
break;
}
truthvalue(expr->nd_symb);
INN instruction expects the bit number on top of the
stack
*/
- label l_toolarge = NO_LABEL;
-
- CodePExpr(rightop);
- CodePExpr(leftop);
- C_loc(rightop->nd_type->set_low);
- C_sbu(word_size);
- if (needs_rangecheck(ElementType(rightop->nd_type), leftop->nd_type)) {
- l_toolarge = ++text_label;
- C_dup(word_size);
- C_loc(rightop->nd_type->tp_size*8);
- C_cmu(word_size);
- C_zge(l_toolarge);
+ label l_toolarge = NO_LABEL, l_cont = NO_LABEL;
+ t_type *ltp = leftop->nd_type;
+
+ if (leftop->nd_symb == COERCION) {
+ /* Could be coercion to word_type. */
+ ltp = leftop->nd_RIGHT->nd_type;
+ }
+ if (leftop->nd_class == Value) {
+ if (! in_range(leftop->nd_INT, ElementType(rightop->nd_type))) {
+ if (true_label != NO_LABEL) {
+ c_bra(false_label);
+ }
+ else c_loc(0);
+ break;
+ }
+ CodePExpr(rightop);
+ C_loc(rightop->nd_type->set_low-leftop->nd_INT);
+ }
+ else {
+ CodePExpr(rightop);
+ CodePExpr(leftop);
+ C_loc(rightop->nd_type->set_low);
+ C_sbu(word_size);
+ if (needs_rangecheck(ElementType(rightop->nd_type), ltp)) {
+ l_toolarge = ++text_label;
+ C_dup(word_size);
+ C_loc(rightop->nd_type->tp_size*8);
+ C_cmu(word_size);
+ C_zge(l_toolarge);
+ }
}
C_inn(rightop->nd_type->tp_size);
if (true_label != NO_LABEL) {
C_zne(true_label);
- C_bra(false_label);
+ c_bra(false_label);
+ }
+ else {
+ l_cont = ++text_label;
+ c_bra(l_cont);
}
if (l_toolarge != NO_LABEL) {
+ def_ilb(l_toolarge);
C_asp(word_size+rightop->nd_type->tp_size);
if (true_label != NO_LABEL) {
- C_bra(false_label);
+ c_bra(false_label);
}
- c_loc(0);
+ else c_loc(0);
+ }
+ if (l_cont != NO_LABEL) {
+ def_ilb(l_cont);
}
break;
}
if (l_end != NO_LABEL) {
def_ilb(true_label);
c_loc(1);
- C_bra(l_end);
+ c_bra(l_end);
def_ilb(false_label);
c_loc(0);
def_ilb(l_end);
if (eltype->tp_fund == T_SUBRANGE) {
C_loc(eltype->sub_ub);
}
- else C_loc((arith) (eltype->enm_ncst - 1));
+ else C_loc(eltype->enm_ncst - 1);
Operands(nd);
CAL("LtoUset", 5 * (int) word_size);
/* library routine to fill set */
}
#ifdef SQUEEZE
+c_bra(l)
+ label l;
+{
+ C_bra((label) l);
+}
+
c_loc(n)
{
C_loc((arith) n);
#else
cd_init = ++text_label;
cd_body = ++text_label;
- C_bra(cd_init);
+ c_bra(cd_init);
def_ilb(cd_body);
#endif
C_asp(-func_res_size);
}
#ifndef USE_INSERT
- C_bra(RETURN_LABEL);
+ c_bra(RETURN_LABEL);
#endif
}
#ifdef USE_INSERT
C_endpart(partno);
#else
- C_bra(cd_body);
+ c_bra(cd_body);
#endif
DO_DEBUG(options['X'], PrNode(procedure->prc_body, 0));
def_ilb(RETURN_LABEL); /* label at end */
if (right->nd_RIGHT) { /* ELSE part */
label l2 = ++text_label;
- C_bra(l2);
+ c_bra(l2);
end_reached = end_r | LblWalkNode(l1, right->nd_RIGHT, exit_label, end_reached);
l1 = l2;
}
exit = ++text_label,
dummy = ++text_label;
- C_bra(dummy);
+ c_bra(dummy);
end_reached |= LblWalkNode(loop, right, exit_label, end_reached);
def_ilb(dummy);
ExpectBool(&(nd->nd_LEFT), loop, exit);
end_reached &= REACH_FLAG;
}
else end_reached = 0;
- C_bra(loop);
+ c_bra(loop);
def_ilb(exit);
break;
}
end_reached |= WalkNode(right->nd_RIGHT, exit_label, end_reached);
loopid->nd_def->df_flags &= ~D_FORLOOP;
}
- C_bra(l1);
+ c_bra(l1);
def_ilb(l2);
FreeInt(tmp);
}
assert(exit_label != 0);
if (end_reached & REACH_FLAG) end_reached = EXIT_FLAG;
- C_bra(exit_label);
+ c_bra(exit_label);
break;
case RETURN:
}
else CodePExpr(right);
}
- C_bra(RETURN_LABEL);
+ c_bra(RETURN_LABEL);
break;
default: