Use an extra temp for v6 float modulo.

It seems the dag creation algorithm doesn't like "a = a op a", so use
"b = a op a" instead. Since I plan on fixing temp leaks anyway, this won't
be a problem (also, few people even use qfcc's v6 float modulo :P).
This commit is contained in:
Bill Currie 2012-07-16 18:26:22 +09:00
parent d9354255a3
commit aa72f263ec

View file

@ -1541,13 +1541,14 @@ binary_expr (int op, expr_t *e1, expr_t *e2)
switch (op) {
case '%':
{
expr_t *tmp1, *tmp2, *tmp3, *t1, *t2;
expr_t *tmp1, *tmp2, *tmp3, *tmp4, *t1, *t2;
e = new_block_expr ();
t1 = new_temp_def_expr (&type_float);
t2 = new_temp_def_expr (&type_float);
tmp1 = new_temp_def_expr (&type_float);
tmp2 = new_temp_def_expr (&type_float);
tmp3 = new_temp_def_expr (&type_float);
tmp4 = new_temp_def_expr (&type_float);
append_expr (e, assign_expr (t1, e1));
e1 = binary_expr ('&', t1, t1);
@ -1561,9 +1562,9 @@ binary_expr (int op, expr_t *e1, expr_t *e2)
append_expr (e, assign_expr (tmp3, e1));
e2 = binary_expr ('&', tmp3, tmp3);
append_expr (e, assign_expr (tmp3, e2));
append_expr (e, assign_expr (tmp4, e2));
e1 = binary_expr ('*', tmp2, tmp3);
e1 = binary_expr ('*', tmp2, tmp4);
e2 = binary_expr ('-', tmp1, e1);
e->e.block.result = e2;
return e;