This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fix PR middle-end/17703, c++/17657, c++/17554

Andrew Pinski <> 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?


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]