This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Avoid reevaluations in expand_builtin_mathfn*
- From: Richard Henderson <rth at redhat dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 25 Jun 2003 12:52:19 -0700
- Subject: Re: [PATCH] Avoid reevaluations in expand_builtin_mathfn*
- References: <Pine.LNX.4.44.0306241726070.18108-100000@www.eyesopen.com>
On Tue, Jun 24, 2003 at 05:36:08PM -0600, Roger Sayle wrote:
> ! /* Always stabilize the argument list. */
> ! switch (TREE_CODE (arg))
> ! {
> ! case VAR_DECL:
> ! case PARM_DECL:
Actually, even *_DECL need to be stabilized when they're volatile.
> ! case SAVE_EXPR:
> ! case REAL_CST:
And since save_expr already special-cases SAVE_EXPR and constants,
I guess you might as well call it all the time. You could note when
save_expr returns its argument and avoid building tree lists, if you
like.
The solution of calling expand_call is good though.
r~