This is the mail archive of the
mailing list for the GCC project.
Re: Fix PR middle-end/17703, c++/17657, c++/17554
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Andrew Pinski <pinskia at physics dot uc dot edu>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 10 Oct 2004 20:40:43 -0700
- Subject: Re: Fix PR middle-end/17703, c++/17657, c++/17554
- References: <E5F67BC8-1A1F-11D9-B778-000A95D692F4@physics.uc.edu>
Andrew Pinski <email@example.com> writes:
> I was asked by Zack to combine both of these patches and post them
> again as they are related and interfere with each other. I also
> tried fixed some of the comments which Zack pointed to have some
> grammar problems.
I have a few more nitpicks, mostly to do with the comments.
> +/* Build an expression for the a clean point containing EXPR with type TYPE.
> + Don't build a cleanup point expression for EXPR which don't have side
> + effects. */
/* If necessary, protect EXPR by wrapping it in a CLEANUP_POINT_EXPR,
with type TYPE. */
> + /* If the expression does not have side effects then we don't have to wrap
> + it with a cleanup point expression. */
/* If the expression doesn't have side effects, no CLEANUP_POINT_EXPR
is necessary. */
> + if (!TREE_SIDE_EFFECTS (expr))
> + return expr;
What should be done in the case where this condition is true, but the
'type' argument is not the same as TREE_TYPE (expr)? Create a
NOP_EXPR instead maybe?
> +/* Like maybe_cleanup_point_expr except have the type of the new expression be
> + void so we don't need to create a temprary variable to hold the inner
> + expression. The reason why we do this is because the orginal type might be
> + an aggregate and we cannot create a temprary variable for that type. */
/* Like maybe_cleanup_point_expr, except the type of the new
expression is void_type_node. This avoids creating a temporary
variable to receive the value of the expression; use when that
value is unneeded. */
[ I don't think it's appropriate to mention here that we can't create
temporary variables of aggregate type. If the temp is needed, it's
needed; if we ever truly need an aggregate temporary, we will have
to fix that in another place. ]
And weren't you going to make except.c use your new function, too?