public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/hardcfr)] enable control flow redundancy hardening unconditionally
@ 2022-01-21 20:25 Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2022-01-21 20:25 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:5c07f1f408ec72a437ededc2ee8fe054a7745e5e

commit 5c07f1f408ec72a437ededc2ee8fe054a7745e5e
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Wed Jan 19 05:51:13 2022 -0300

    enable control flow redundancy hardening unconditionally

Diff:
---
 gcc/common.opt                    | 2 +-
 gcc/gimple-harden-control-flow.cc | 4 ++++
 gcc/params.opt                    | 2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index 1ebcf307963..474085595bb 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1771,7 +1771,7 @@ Common Var(flag_harden_conditional_branches) Optimization
 Harden conditional branches by checking reversed conditions.
 
 fharden-control-flow-redundancy
-Common Var(flag_harden_control_flow_redundancy) Optimization
+Common Var(flag_harden_control_flow_redundancy) Init(-1) Optimization
 Harden control flow by recording and checking execution paths.
 
 ; Nonzero means ignore `#ident' directives.  0 means handle them.
diff --git a/gcc/gimple-harden-control-flow.cc b/gcc/gimple-harden-control-flow.cc
index 65b0b701744..2d62e8e2f76 100644
--- a/gcc/gimple-harden-control-flow.cc
+++ b/gcc/gimple-harden-control-flow.cc
@@ -84,6 +84,8 @@ public:
        call and restore it if it returns again.  */
     if (fun->calls_setjmp)
       {
+	if (flag_harden_control_flow_redundancy < 0)
+	  return false;
 	warning_at (DECL_SOURCE_LOCATION (fun->decl), 0,
 		    "%qD calls %<setjmp%> or similar,"
 		    " %<-fharden-control-flow-redundancy%> is not supported",
@@ -93,6 +95,8 @@ public:
 
     if (n_basic_blocks_for_fn (fun) - 2 > param_hardcfr_max_blocks)
       {
+	if (flag_harden_control_flow_redundancy < 0)
+	  return false;
 	warning_at (DECL_SOURCE_LOCATION (fun->decl), 0,
 		    "%qD has more than %u blocks, the requested"
 		    " maximum for %<-fharden-control-flow-redundancy%>",
diff --git a/gcc/params.opt b/gcc/params.opt
index 147ecdb684c..de834ac20b7 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -202,7 +202,7 @@ Common Joined UInteger Var(param_graphite_max_nb_scop_params) Init(10) Param Opt
 Maximum number of parameters in a SCoP.
 
 -param=hardcfr-max-blocks=
-Common Joined UInteger Var(param_hardcfr_max_blocks) Init(-1) Param Optimization
+Common Joined UInteger Var(param_hardcfr_max_blocks) Init(32) Param Optimization
 Maximum number of blocks for -fharden-control-flow-redundancy.
 
 -param=hardcfr-max-inline-blocks=


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [gcc(refs/users/aoliva/heads/hardcfr)] enable control flow redundancy hardening unconditionally
@ 2022-05-06  8:09 Alexandre Oliva
  0 siblings, 0 replies; 2+ messages in thread
From: Alexandre Oliva @ 2022-05-06  8:09 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:7c918c80646632651dce3e620ed287652ceb4c34

commit 7c918c80646632651dce3e620ed287652ceb4c34
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Mon Jan 31 16:00:46 2022 -0300

    enable control flow redundancy hardening unconditionally

Diff:
---
 gcc/common.opt                    | 2 +-
 gcc/gimple-harden-control-flow.cc | 6 ++++++
 gcc/params.opt                    | 2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index cb0ce11eee1..a353165ba15 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1771,7 +1771,7 @@ Common Var(flag_harden_conditional_branches) Optimization
 Harden conditional branches by checking reversed conditions.
 
 fharden-control-flow-redundancy
-Common Var(flag_harden_control_flow_redundancy) Optimization
+Common Var(flag_harden_control_flow_redundancy) Init(-1) Optimization
 Harden control flow by recording and checking execution paths.
 
 ; Nonzero means ignore `#ident' directives.  0 means handle them.
diff --git a/gcc/gimple-harden-control-flow.cc b/gcc/gimple-harden-control-flow.cc
index f3538c895fb..72258f65360 100644
--- a/gcc/gimple-harden-control-flow.cc
+++ b/gcc/gimple-harden-control-flow.cc
@@ -97,6 +97,8 @@ public:
        call and restore it if it returns again.  */
     if (fun->calls_setjmp)
       {
+	if (flag_harden_control_flow_redundancy < 0)
+	  return false;
 	warning_at (DECL_SOURCE_LOCATION (fun->decl), 0,
 		    "%qD calls %<setjmp%> or similar,"
 		    " %<-fharden-control-flow-redundancy%> is not supported",
@@ -110,6 +112,8 @@ public:
        enough to make it worthwhile.  */
     if (fun->has_nonlocal_label)
       {
+	if (flag_harden_control_flow_redundancy < 0)
+	  return false;
 	warning_at (DECL_SOURCE_LOCATION (fun->decl), 0,
 		    "%qD receives nonlocal gotos,"
 		    " %<-fharden-control-flow-redundancy%> is not supported",
@@ -120,6 +124,8 @@ public:
     if (param_hardcfr_max_blocks > 0
 	&& n_basic_blocks_for_fn (fun) - 2 > param_hardcfr_max_blocks)
       {
+	if (flag_harden_control_flow_redundancy < 0)
+	  return false;
 	warning_at (DECL_SOURCE_LOCATION (fun->decl), 0,
 		    "%qD has more than %u blocks, the requested"
 		    " maximum for %<-fharden-control-flow-redundancy%>",
diff --git a/gcc/params.opt b/gcc/params.opt
index b5dd3a92d06..b8cd9f7a4ed 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -202,7 +202,7 @@ Common Joined UInteger Var(param_graphite_max_nb_scop_params) Init(10) Param Opt
 Maximum number of parameters in a SCoP.
 
 -param=hardcfr-max-blocks=
-Common Joined UInteger Var(param_hardcfr_max_blocks) Init(0) Param Optimization
+Common Joined UInteger Var(param_hardcfr_max_blocks) Init(32) Param Optimization
 Maximum number of blocks for -fharden-control-flow-redundancy.
 
 -param=hardcfr-max-inline-blocks=


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-06  8:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-21 20:25 [gcc(refs/users/aoliva/heads/hardcfr)] enable control flow redundancy hardening unconditionally Alexandre Oliva
2022-05-06  8:09 Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).