diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f1cd9b897654f871c28694905adde3ca8b1082fd..6f8c8f2b01efad4eb173189ce2f344cc362a57ee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2013-12-05 Marek Polacek <polacek@redhat.com> + + * doc/invoke.texi: Document -fsanitize=signed-integer-overflow. + 2013-12-05 H.J. Lu <hongjiu.lu@intel.com> * config.gcc: Support --with-cpu=ia. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index ed5b60f82a8d9a0efaa812b4456394d536ce5ce6..cfb9b38ed40bfb474eb77604e9e5f8614f3529ae 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -5363,6 +5363,19 @@ built with this option turned on will issue an error message when the end of a non-void function is reached without actually returning a value. This option works in C++ only. +@item -fsanitize=signed-integer-overflow +@opindex fsanitize=signed-integer-overflow + +This option enables signed integer overflow checking. We check that +the result of @code{+}, @code{*}, and both unary and binary @code{-} +does not overflow in the signed arithmetics. Note, integer promotion +rules must be taken into account. That is, the following is not an +overflow: +@smallexample +signed char a = SCHAR_MAX; +a++; +@end smallexample + @end table While @option{-ftrapv} causes traps for signed overflows to be emitted,