diff options
author | Alexandre Oliva <oliva@adacore.com> | 2021-10-30 06:36:05 -0300 |
---|---|---|
committer | Alexandre Oliva <oliva@gnu.org> | 2021-10-30 06:36:05 -0300 |
commit | 70c947e4dfaa6d63b5efc0d8cd990726a9b6d8ba (patch) | |
tree | 6bc5f0540c374e7ce1d0ad193a4db7677552a31b /gcc | |
parent | 6f449bb93b33d63fa8a1b8d021d8d36f27ffe054 (diff) | |
download | gcc-70c947e4dfaa6d63b5efc0d8cd990726a9b6d8ba.zip gcc-70c947e4dfaa6d63b5efc0d8cd990726a9b6d8ba.tar.gz gcc-70c947e4dfaa6d63b5efc0d8cd990726a9b6d8ba.tar.bz2 |
Implied compares in Ada Harded Conditionals documentation
Improve the wording on optimizations that prevent compare hardening,
so as to also cover cases in which explicit compares get combined into
operations with implied compares.
for gcc/ada/ChangeLog
* doc/gnat_rm/security_hardening_features.rst: Mention
optimization to operations with implied compares.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/doc/gnat_rm/security_hardening_features.rst | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/ada/doc/gnat_rm/security_hardening_features.rst b/gcc/ada/doc/gnat_rm/security_hardening_features.rst index 52240d7..cf76938 100644 --- a/gcc/ada/doc/gnat_rm/security_hardening_features.rst +++ b/gcc/ada/doc/gnat_rm/security_hardening_features.rst @@ -112,14 +112,15 @@ long after boolean expressions are decomposed into separate compares, each one turned into either a conditional branch or a compare whose result is stored in a boolean variable or temporary. Compiler optimizations, if enabled, may also turn conditional branches into -stored compares, and vice-versa. Conditionals may also be optimized +stored compares, and vice-versa, or into operations with implied +conditionals (e.g. MIN and MAX). Conditionals may also be optimized out entirely, if their value can be determined at compile time, and occasionally multiple compares can be combined into one. It is thus difficult to predict which of these two options will affect a specific compare operation expressed in source code. Using both -options ensures that every compare that is not optimized out will be -hardened. +options ensures that every compare that is neither optimized out nor +optimized into implied conditionals will be hardened. The addition of reversed compares can be observed by enabling the dump files of the corresponding passes, through command line options |