From 61b718d71648b7db37e20fec4087991c9b4afc01 Mon Sep 17 00:00:00 2001 From: eck Date: Thu, 1 Mar 1990 13:02:39 +0000 Subject: [PATCH] floating-point yet again, fixed debugging bug --- lang/cem/cemcom.ansi/dumpidf.c | 2 +- lang/cem/cemcom.ansi/eval.c | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lang/cem/cemcom.ansi/dumpidf.c b/lang/cem/cemcom.ansi/dumpidf.c index 965c84818..9c55d202f 100644 --- a/lang/cem/cemcom.ansi/dumpidf.c +++ b/lang/cem/cemcom.ansi/dumpidf.c @@ -379,7 +379,7 @@ type2str(tp) ops = 0; break; } - if (!ops) tp = tp->tp_up; + if (ops) tp = tp->tp_up; } return buf; } diff --git a/lang/cem/cemcom.ansi/eval.c b/lang/cem/cemcom.ansi/eval.c index 3a59b9cc1..4b0c94ff3 100644 --- a/lang/cem/cemcom.ansi/eval.c +++ b/lang/cem/cemcom.ansi/eval.c @@ -547,6 +547,9 @@ EVAL(expr, val, code, true_label, false_label) } case '.': case ARROW: + if (tp->tp_fund == FLOAT || tp->tp_fund == DOUBLE + || tp->tp_fund == LNGDBL) + fp_used = 1; EVAL(left, oper == '.' ? LVAL : RVAL, gencode, NO_LABEL, NO_LABEL); ASSERT(is_cp_cst(right)); @@ -638,6 +641,10 @@ EVAL(expr, val, code, true_label, false_label) loaded by the following statements: */ 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, expr->ex_type->tp_align); } @@ -906,6 +913,10 @@ load_val(expr, rlval) register int inword = 0, indword = 0; 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 (rvalue) { /* absolute addressing */ load_cst(val, pointer_size); @@ -945,8 +956,6 @@ load_val(expr, rlval) int fund = df->df_type->tp_fund; ASSERT(ISNAME(expr)); - if (fund == FLOAT || fund == DOUBLE || fund == LNGDBL) - fp_used = 1; if (fund == FUNCTION) { /* the previous statement tried to catch a function identifier, which may be cast to a pointer to a -- 2.34.1