floating-point yet again, fixed debugging bug

This commit is contained in:
eck 1990-03-01 13:02:39 +00:00
parent 2dd3439f90
commit 61b718d716
2 changed files with 12 additions and 3 deletions
lang/cem/cemcom.ansi

View file

@ -379,7 +379,7 @@ type2str(tp)
ops = 0; ops = 0;
break; break;
} }
if (!ops) tp = tp->tp_up; if (ops) tp = tp->tp_up;
} }
return buf; return buf;
} }

View file

@ -547,6 +547,9 @@ EVAL(expr, val, code, true_label, false_label)
} }
case '.': case '.':
case ARROW: case ARROW:
if (tp->tp_fund == FLOAT || tp->tp_fund == DOUBLE
|| tp->tp_fund == LNGDBL)
fp_used = 1;
EVAL(left, oper == '.' ? LVAL : RVAL, gencode, EVAL(left, oper == '.' ? LVAL : RVAL, gencode,
NO_LABEL, NO_LABEL); NO_LABEL, NO_LABEL);
ASSERT(is_cp_cst(right)); ASSERT(is_cp_cst(right));
@ -638,6 +641,10 @@ EVAL(expr, val, code, true_label, false_label)
loaded by the following statements: loaded by the following statements:
*/ */
if (gencode && val == RVAL && expr->ex_lvalue == 1) { if (gencode && val == RVAL && expr->ex_lvalue == 1) {
if (expr->ex_type->tp_fund == FLOAT
|| expr->ex_type->tp_fund == DOUBLE
|| expr->ex_type->tp_fund == LNGDBL)
fp_used = 1;
load_block(expr->ex_type->tp_size, load_block(expr->ex_type->tp_size,
expr->ex_type->tp_align); expr->ex_type->tp_align);
} }
@ -906,6 +913,10 @@ load_val(expr, rlval)
register int inword = 0, indword = 0; register int inword = 0, indword = 0;
register arith val = expr->VL_VALUE; register arith val = expr->VL_VALUE;
if (expr->ex_type->tp_fund == FLOAT
|| expr->ex_type->tp_fund == DOUBLE
|| expr->ex_type->tp_fund == LNGDBL)
fp_used = 1;
if (expr->VL_CLASS == Const) { if (expr->VL_CLASS == Const) {
if (rvalue) { /* absolute addressing */ if (rvalue) { /* absolute addressing */
load_cst(val, pointer_size); load_cst(val, pointer_size);
@ -945,8 +956,6 @@ load_val(expr, rlval)
int fund = df->df_type->tp_fund; int fund = df->df_type->tp_fund;
ASSERT(ISNAME(expr)); ASSERT(ISNAME(expr));
if (fund == FLOAT || fund == DOUBLE || fund == LNGDBL)
fp_used = 1;
if (fund == FUNCTION) { if (fund == FUNCTION) {
/* the previous statement tried to catch a function /* the previous statement tried to catch a function
identifier, which may be cast to a pointer to a identifier, which may be cast to a pointer to a