aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2016-06-28 10:30:01 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2016-06-28 10:30:01 +0200
commit35ca24a2d13feb005610c6d56637fff5d1a19e0b (patch)
treec1bcae6a22da089d1e638781924e52818f71678b /gcc
parent95ef39f4415224f4d98c85c10a9efa9f2f952fe0 (diff)
downloadgcc-35ca24a2d13feb005610c6d56637fff5d1a19e0b.zip
gcc-35ca24a2d13feb005610c6d56637fff5d1a19e0b.tar.gz
gcc-35ca24a2d13feb005610c6d56637fff5d1a19e0b.tar.bz2
extend.texi (__builtin_add_overflow_p): Clarify behavior when last argument is a bit-field.
* doc/extend.texi (__builtin_add_overflow_p): Clarify behavior when last argument is a bit-field. From-SVN: r237816
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog3
-rw-r--r--gcc/doc/extend.texi3
2 files changed, 6 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 338c603..4e833d4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,8 @@
2016-06-28 Jakub Jelinek <jakub@redhat.com>
+ * doc/extend.texi (__builtin_add_overflow_p): Clarify behavior when
+ last argument is a bit-field.
+
PR rtl-optimization/71673
* internal-fn.c (expand_arith_overflow_result_store): Use
OPTAB_LIB_WIDEN instead of OPTAB_DIRECT as last argument to
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 9c8ea83..b5f6e12 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -9888,6 +9888,9 @@ cast to the type of the third argument. If the cast result is equal to the infi
precision result, the built-in functions return false, otherwise they return true.
The value of the third argument is ignored, just the side-effects in the third argument
are evaluated, and no integral argument promotions are performed on the last argument.
+If the third argument is a bit-field, the type used for the result cast has the
+precision and signedness of the given bit-field, rather than precision and signedness
+of the underlying type.
For example, the following macro can be used to portably check, at
compile-time, whether or not adding two constant integers will overflow,