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: [PATCH] Fix PR27116, rework negate_expr_p/negate_expr

On Fri, 9 Jun 2006, Richard Guenther wrote:

> This patch fixes PR27116 for real by rewoking negate_expr_p to avoid
> introducing undefined overflow.  It splits a generic fold_negate_expr
> from negate_expr that can be used in fold_unary, fixing a latent problem
> with RSHIFT_EXPR folding which didn't get noticed because fold_unary
> passed a tree with stripped types to negate_expr (this problem is latent
> on the branches).  With this patch I also revert the folding parts of
> the first fix for PR27116, as these are not necessary.
> The patch is big enough as is, but as a followup I will try to remove
> the second argument to fold_negate_expr and put the burden of stripping
> type conversions and re-applying them afterwards to the caller as other
> fold_* variants do.  But I think this is not appropriate for 4.2 and has
> to wait for stage1.

The more I think about the type stripping in the original negate_expr and
the way its now in fold_negate_expr the less I like it.  I'll rework the
patch next week.


Richard Guenther <>
Novell / SUSE Labs

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