This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH][RFC] Fix PR27039, missed folding of pointer comparisons
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 4 Jun 2006 15:01:43 +0200 (CEST)
- Subject: Re: [PATCH][RFC] Fix PR27039, missed folding of pointer comparisons
- References: <Pine.LNX.firstname.lastname@example.org>
On Thu, 11 May 2006, Richard Guenther wrote:
> This tries to fix PR27039, which was caused by fixing PR26763 by disabling
> simplifying of pointer comparisons for comparison codes other than == and
> !=. PR27039 is about us no longer folding p_4 + 4B > p_4 + 8B to false
> which we can do because 6.5.6/8 and /9 sufficiently restrict pointer
> arithmetic to make overflow a non-issue for valid programs here.
> Ok for mainline?
Approved on IRC by Roger, acked by Joseph, re-bootstrapped and tested
on x86_64-unknown-linux-gnu, applied to mainline.
> 2006-05-11 Richard Guenther <email@example.com>
> PR tree-optimization/27039
> * fold-const.c (fold_comparison): Handle pointer comparison
> again for all comparison codes. Compare offsets in signed
> size type.
> (fold_binary): Move code from here.
> * gcc.dg/tree-ssa/loop-17.c: New testcase.