This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Semantics of MODIFY_EXPR with CONSTRUCTOR rhs
- From: Richard Henderson <rth at redhat dot com>
- To: Richard Kenner <kenner at vlsi1 dot ultra dot nyu dot edu>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 2 Aug 2004 16:14:51 -0700
- Subject: Re: Semantics of MODIFY_EXPR with CONSTRUCTOR rhs
- References: <10408022258.AA05825@vlsi1.ultra.nyu.edu>
On Mon, Aug 02, 2004 at 06:58:26PM -0400, Richard Kenner wrote:
> /* If the value is invariant, then there's nothing to pre-evaluate.
> But ensure it doesn't have any side-effects since a SAVE_EXPR is
> invariant but has side effects and might contain a reference to
> the object we're initializing. */
> if (TREE_INVARIANT (*expr_p) && !TREE_SIDE_EFFECTS (*expr_p))
Grr. I guess this is ok for now.
I'm thinking it's a big mistake for SAVE_EXPR to have TREE_INVARIANT set.
TREE_INVARIANT should mean "valid anywhere in the current function". But
for SAVE_EXPR that isn't so -- it's only valid in places post-dominated
by its first evaluation. A significant difference in my opinion.
Hum. I suppose the places it's used at present are for ADDR_EXPR,
SAVE_EXPR, and stabilize_reference_1. I'll have to give this some
thought. Perhaps I would be happier with this bit renamed to
TREE_STABLE_P or something.
Please commit the patch with the grammer nit mentioned elsewhere fixed.
r~