floating-point yet again, fixed debugging bug
authoreck <none@none>
Thu, 1 Mar 1990 13:02:39 +0000 (13:02 +0000)
committereck <none@none>
Thu, 1 Mar 1990 13:02:39 +0000 (13:02 +0000)
lang/cem/cemcom.ansi/dumpidf.c
lang/cem/cemcom.ansi/eval.c

index 965c848..9c55d20 100644 (file)
@@ -379,7 +379,7 @@ type2str(tp)
                        ops = 0;
                        break;
                }
-               if (!ops) tp = tp->tp_up;
+               if (ops) tp = tp->tp_up;
        }
        return buf;
 }
index 3a59b9c..4b0c94f 100644 (file)
@@ -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