aboutsummaryrefslogtreecommitdiff
path: root/gcc/flags.h
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2008-04-14 19:18:31 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2008-04-14 19:18:31 +0000
commit4c9db6e07aba115c21ab02068ccc332ce691775e (patch)
tree5476839d99a5b4e7b501ffa138ec06b5cc5cb144 /gcc/flags.h
parent3a5a8be12000125f4c12efea8bd6a466049a688d (diff)
downloadgcc-4c9db6e07aba115c21ab02068ccc332ce691775e.zip
gcc-4c9db6e07aba115c21ab02068ccc332ce691775e.tar.gz
gcc-4c9db6e07aba115c21ab02068ccc332ce691775e.tar.bz2
flags.h (POINTER_TYPE_OVERFLOW_UNDEFINED): Define.
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. From-SVN: r134287
Diffstat (limited to 'gcc/flags.h')
-rw-r--r--gcc/flags.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/flags.h b/gcc/flags.h
index 686691c..e759695 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. */