This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Fix PR27116, rework negate_expr_p/negate_expr
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Roger Sayle <roger at eyesopen dot com>
- Date: Fri, 9 Jun 2006 14:44:27 +0200 (CEST)
- Subject: Re: [PATCH] Fix PR27116, rework negate_expr_p/negate_expr
- References: <Pine.LNX.firstname.lastname@example.org>
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 <email@example.com>
Novell / SUSE Labs