[qfcc] Use an alias op for return_operand

This is what using new_ret_expr would result in, but new_ret_expr is no
longer used for referencing .return (except in pascal, but I haven't
gotten around to sorting that out) due to the recent changes for Ruamoko
progs. Fixes an ICE when compiling (with optimization) something like
the following (dir is a vector):

    dir /= sqrt (dir * dir);
    return dir * speed;
This commit is contained in:
Bill Currie 2022-01-27 23:24:43 +09:00
parent 82166406df
commit f57aa82c4b

View file

@ -452,7 +452,11 @@ return_operand (type_t *type, expr_t *expr)
symbol_t *return_symbol;
return_symbol = make_symbol (".return", &type_param, pr.symtab->space,
sc_extern);
return def_operand (return_symbol->s.def, type, expr);
if (!return_symbol->table) {
symtab_addsymbol (pr.symtab, return_symbol);
}
def_t *return_def = return_symbol->s.def;
return def_operand (alias_def (return_def, type, 0), 0, expr);
}
operand_t *