]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Implied compares in Ada Harded Conditionals documentation
authorAlexandre Oliva <oliva@adacore.com>
Sat, 30 Oct 2021 09:36:05 +0000 (06:36 -0300)
committerAlexandre Oliva <oliva@gnu.org>
Sat, 30 Oct 2021 09:36:05 +0000 (06:36 -0300)
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.

gcc/ada/doc/gnat_rm/security_hardening_features.rst

index 52240d7e3dd541d1af33c92aac43f92f20797dbb..cf76938d91d1300d193a095817ccb1248edd5339 100644 (file)
@@ -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