return exp->ex_type->tp_fund;
}
+/* With compile-time constants, we don't set fp_used, since this is done
+ * only when necessary in eval.c.
+ */
int2float(expp, tp)
register struct expr **expp;
struct type *tp;
register struct expr *exp = *expp;
int uns = (*expp)->ex_type->tp_unsigned;
- fp_used = 1;
if (is_cp_cst(exp)) {
*expp = new_expr();
**expp = *exp;
flt_arith2flt(exp->VL_VALUE, &(exp->FL_ARITH), uns);
exp->FL_DATLAB = 0;
}
- else *expp = arith2arith(tp, INT2FLOAT, *expp);
+ else {
+ fp_used = 1;
+ *expp = arith2arith(tp, INT2FLOAT, *expp);
+ }
}
float2int(expp, tp)
*/
register struct expr *ex = *expp;
- fp_used = 1;
if (is_fp_cst(ex)) {
arith ar = flt_flt2arith(&ex->FL_ARITH, tp->tp_unsigned);
ex->VL_CLASS = Const;
ex->VL_VALUE = ar;
cut_size(ex);
- } else *expp = arith2arith(tp, FLOAT2INT, ex);
+ } else {
+ fp_used = 1;
+ *expp = arith2arith(tp, FLOAT2INT, ex);
+ }
}
float2float(expp, tp)
if the expression is a constant.
*/
- fp_used = 1;
if (is_fp_cst(*expp))
(*expp)->ex_type = tp;
- else
+ else {
+ fp_used = 1;
*expp = arith2arith(tp, FLOAT2FLOAT, *expp);
+ }
}
array2pointer(exp)
if (gencode) {
label datlab = data_label();
+ fp_used = 1;
if (!expr->FL_VALUE) {
expr->FL_VALUE = Malloc(FLT_STRLEN);
flt_flt2str(&(expr->FL_ARITH), expr->FL_VALUE, FLT_STRLEN);
else {
register struct idf *id = expr->VL_IDF;
register struct def *df = id->id_def;
+ int fund = df->df_type->tp_fund;
ASSERT(ISNAME(expr));
- if (df->df_type->tp_fund == FUNCTION) {
+ 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
function.