This is the mail archive of the gcc-patches@gcc.gnu.org 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][RFC] Fix PR27039, missed folding of pointer comparisons


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.

Richard.

> 2006-05-11  Richard Guenther  <rguenther@suse.de>
> 
> 	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.


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