diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-14 19:18:31 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-04-14 19:18:31 +0000 |
commit | e867fa7ff0e28017feba4dd0a9a46d3278a497fc (patch) | |
tree | 5476839d99a5b4e7b501ffa138ec06b5cc5cb144 /gcc/flags.h | |
parent | a4386fd1c9d2d7d9bb0d6222aa56237ef1f3185d (diff) | |
download | gcc-e867fa7ff0e28017feba4dd0a9a46d3278a497fc.tar.gz |
gcc/:
* flags.h (POINTER_TYPE_OVERFLOW_UNDEFINED): Define.
* fold-const.c (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/:
* gcc.dg/strict-overflow-6.c: New.
* gcc.dg/no-strict-overflow-7.c: New.
* gcc.dg/Wstrict-overflow-22.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@134287 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/flags.h')
-rw-r--r-- | gcc/flags.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/flags.h b/gcc/flags.h index 686691c21e0..e7596957d82 100644 --- a/gcc/flags.h +++ b/gcc/flags.h @@ -332,6 +332,9 @@ extern bool flag_instrument_functions_exclude_p (tree fndecl); #define TYPE_OVERFLOW_TRAPS(TYPE) \ (!TYPE_UNSIGNED (TYPE) && flag_trapv) +/* True if pointer types have undefined overflow. */ +#define POINTER_TYPE_OVERFLOW_UNDEFINED (flag_strict_overflow) + /* Names for the different levels of -Wstrict-overflow=N. The numeric values here correspond to N. */ |