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: Add pointer overflow warnings to 4.2 branch


Ian Lance Taylor wrote:
Here is my proposed patch to add pointer overflow warnings to the 4.2
branch.  The pointer wraparound code in 4.2 is different from 4.3 and
mainline, and is somewhat simpler.

Any comments on this patch?

gcc/ChangeLog:
2008-05-02  Ian Lance Taylor  <iant@google.com>

	* flags.h (POINTER_TYPE_OVERFLOW_UNDEFINED): Define.
	* fold-const.c (fold_overflow_warning): Remove assertion.
	(pointer_may_wrap_p): New static function.
	(fold_comparison): If appropriate, test
	POINTER_TYPE_OVERFLOW_UNDEFINED, and issue an overflow warning.
	(fold_binary): Test POINTER_TYPE_OVERFLOW_UNDEFINED when
	reassociating a pointer type.
	* doc/invoke.texi (Optimize Options): Document that
	-fstrict-overflow applies to pointer wraparound.

gcc/testsuite/ChangeLog:
2008-05-02  Ian Lance Taylor  <iant@google.com>

	* gcc.dg/strict-overflow-6.c: New.
	* gcc.dg/no-strict-overflow-7.c: New.
	* gcc.dg/Wstrict-overflow-22.c: New.
	* gcc.c-torture/compile/20080419-1.c: New.
	* gcc.dg/tree-ssa/loop-17.c: Use -O2.

OK.


--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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