This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] expr.h: Speed/clean up store_expr.
- From: Jeffrey A Law <law at redhat dot com>
- To: Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 14 Dec 2004 08:40:08 -0700
- Subject: Re: [patch] expr.h: Speed/clean up store_expr.
- Organization: Red Hat, Inc
- References: <20041213.193907.91446072.kazu@cs.umass.edu>
- Reply-to: law at redhat dot com
On Mon, 2004-12-13 at 19:39 -0500, Kazu Hirata wrote:
> Hi,
>
> Attached is a patch to speed/clean up store_expr.
>
> EXPAND_STACK_PARM is defined as 2 (as a micro-optimization) because
> store_expr used to use a construct like so:
>
> want_value & 2 ? EXPAND_STACK_PARM : EXPAND_NORMAL
>
> which was presumably optimized to
>
> want_value & 2
>
> using the fact that EXPAND_NORMAL == 0.
>
> After I cleaned up store_expr recently, the construct above has become
>
> call_param_p ? EXPAND_STACK_PARM : EXPAND_NORMAL
>
> which is really
>
> call_param_p ? 2 : 0
>
> Note that we cannot use STORE_FLAG_VALUE in a straightforward manner
> on a machine where STORE_FLAG_VALUE is 1.
>
> The patch removes this special "2" thing as it causes a
> micro-pessimization and doesn't serve any purpose these days.
>
> Tested on i686-pc-linux-gnu. OK to apply?
>
> Kazu Hirata
>
> 2004-12-13 Kazu Hirata <kazu@cs.umass.edu>
>
> * expr.h (expand_modifier): Define EXPAND_STACK_PARM as 1.
Approved.
jeff