[tree-ssa] Tail recursion improvement
Diego Novillo
dnovillo@redhat.com
Tue Mar 2 18:48:00 GMT 2004
On Tue, 2004-03-02 at 13:37, law@redhat.com wrote:
> You've moved tail recursion to a point before we've got aliasing information,
> which means that we haven't computed virtual uses/defs. This ultimately lead
> to transforming tail recursive calls that ought to be left alone.
>
Perhaps the operand scanner may offer help here by marking CALL_EXPRs
with has_volatile_ops if aliases haven't been computed yet.
Index: tree-ssa-operands.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-operands.c,v
retrieving revision 1.1.2.13
diff -d -c -p -r1.1.2.13 tree-ssa-operands.c
*** tree-ssa-operands.c 28 Feb 2004 01:06:20 -0000 1.1.2.13
--- tree-ssa-operands.c 2 Mar 2004 18:42:26 -0000
*************** get_expr_operands (tree stmt, tree *expr
*** 1052,1057 ****
--- 1052,1059 ----
else if (!(call_flags & (ECF_CONST | ECF_NORETURN)))
add_call_read_ops (stmt, prev_vops);
}
+ else if (!aliases_computed_p)
+ s_ann->has_volatile_ops = 1;
return;
}
It would be up to tail-rec to heed this, though.
Diego.
More information about the Gcc-patches
mailing list