]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/doc/gccint/sizes-and-offsets-as-runtime-invariants/computing-bounds-on-polyints.rst
sphinx: add missing trailing newline
[thirdparty/gcc.git] / gcc / doc / gccint / sizes-and-offsets-as-runtime-invariants / computing-bounds-on-polyints.rst
CommitLineData
c63539ff
ML
1..
2 Copyright 1988-2022 Free Software Foundation, Inc.
3 This is part of the GCC manual.
4 For copying conditions, see the copyright.rst file.
5
6Computing bounds on poly_ints
7*****************************
8
9``poly_int`` also provides routines for calculating lower and upper bounds:
10
11:samp:`constant_lower_bound ({a})`
12 Assert that :samp:`{a}` is nonnegative and return the smallest value it can have.
13
14:samp:`constant_lower_bound_with_limit ({a}, {b})`
15 Return the least value :samp:`{a}` can have, given that the context in
16 which :samp:`{a}` appears guarantees that the answer is no less than :samp:`{b}`.
17 In other words, the caller is asserting that :samp:`{a}` is greater than or
18 equal to :samp:`{b}` even if :samp:`known_ge ({a}, {b})` doesn't hold.
19
20:samp:`constant_upper_bound_with_limit ({a}, {b})`
21 Return the greatest value :samp:`{a}` can have, given that the context in
22 which :samp:`{a}` appears guarantees that the answer is no greater than :samp:`{b}`.
23 In other words, the caller is asserting that :samp:`{a}` is less than or equal
24 to :samp:`{b}` even if :samp:`known_le ({a}, {b})` doesn't hold.
25
26:samp:`lower_bound ({a}, {b})`
27 Return a value that is always less than or equal to both :samp:`{a}` and :samp:`{b}`.
28 It will be the greatest such value for some indeterminate values
29 but necessarily for all.
30
31:samp:`upper_bound ({a}, {b})`
32 Return a value that is always greater than or equal to both :samp:`{a}` and
33 :samp:`{b}`. It will be the least such value for some indeterminate values
3ed1b4ce 34 but necessarily for all.