aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2019-07-09 14:31:21 +0200
committerXavier Leroy <xavierleroy@users.noreply.github.com>2019-07-10 10:56:45 +0200
commitfcbd9addf6f8c10822294dc397d13af10b9d52f2 (patch)
tree6da064afba49677dd05dee282e6abb3fa2cf7fe3
parent026d8bf506a0a4afebe4e41ad5ce2e7523c45ffc (diff)
downloadcompcert-fcbd9addf6f8c10822294dc397d13af10b9d52f2.tar.gz
compcert-fcbd9addf6f8c10822294dc397d13af10b9d52f2.zip
Change condition for warning of conditional expr
The warning should only be active if the optimization is active, so the check is only performed when the warning is active and additionally the command line flag -Obranchless is specified.
-rw-r--r--cparser/Checks.ml2
1 files changed, 1 insertions, 1 deletions
diff --git a/cparser/Checks.ml b/cparser/Checks.ml
index a2602a52..ef62edd6 100644
--- a/cparser/Checks.ml
+++ b/cparser/Checks.ml
@@ -365,7 +365,7 @@ let non_linear_cond_stmt vars env s =
iter_over_stmt_loc ~expr:(non_linear_cond_expr false vars env) ~decl:decl s
let non_linear_conditional p =
- if active_warning Non_linear_cond_expr then begin
+ if active_warning Non_linear_cond_expr && !Clflags.option_Obranchless then begin
let fundef env loc fd =
let vars = List.fold_left (add_vars env) IdentSet.empty fd.fd_params in
let vars = non_stack_locals_stmt env vars fd.fd_body in