public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc(refs/users/aoliva/heads/testme)] enable control flow redundancy hardening unconditionally
@ 2023-06-08  4:48 Alexandre Oliva
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Oliva @ 2023-06-08  4:48 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:c281c090fe0289888265ae181499574394b5bc95

commit c281c090fe0289888265ae181499574394b5bc95
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Wed Aug 24 13:36:58 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 feea4920c9d..b2091642855 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1802,7 +1802,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.
 
 fhardcfr-skip-leaf
diff --git a/gcc/gimple-harden-control-flow.cc b/gcc/gimple-harden-control-flow.cc
index 3998fd0d293..56ad6045b5e 100644
--- a/gcc/gimple-harden-control-flow.cc
+++ b/gcc/gimple-harden-control-flow.cc
@@ -90,6 +90,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",
@@ -103,6 +105,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",
@@ -114,6 +118,8 @@ public:
 	&& (n_basic_blocks_for_fn (fun) - NUM_FIXED_BLOCKS
 	    > 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 bd0679bdcd3..2db693838dc 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -175,7 +175,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] 14+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] enable control flow redundancy hardening unconditionally
@ 2023-10-10  4:14 Alexandre Oliva
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Oliva @ 2023-10-10  4:14 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:3a10b677396864b6227ac77cb2f3720c9637ef4d

commit 3a10b677396864b6227ac77cb2f3720c9637ef4d
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Mon Jul 3 18:09:38 2023 -0300

    enable control flow redundancy hardening unconditionally

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

diff --git a/gcc/common.opt b/gcc/common.opt
index 5d318b4290c..90a8cc6cab6 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1828,7 +1828,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.
 
 fhardcfr-skip-leaf
diff --git a/gcc/gimple-harden-control-flow.cc b/gcc/gimple-harden-control-flow.cc
index 5c28fd07f33..60f4976d5f8 100644
--- a/gcc/gimple-harden-control-flow.cc
+++ b/gcc/gimple-harden-control-flow.cc
@@ -91,6 +91,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",
@@ -104,6 +106,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",
@@ -115,6 +119,8 @@ public:
 	&& (n_basic_blocks_for_fn (fun) - NUM_FIXED_BLOCKS
 	    > 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 f1202abc00d..45cf6f885d0 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -175,7 +175,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=
diff --git a/libgcc/hardcfr.c b/libgcc/hardcfr.c
index 7496095b866..549eaa9b4a5 100644
--- a/libgcc/hardcfr.c
+++ b/libgcc/hardcfr.c
@@ -29,6 +29,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include <stddef.h>
 #include <stdbool.h>
 
+#define HARDCFR_VERBOSE_FAIL 1
+
 /* This should be kept in sync with gcc/gimple-harden-control-flow.cc.  */
 #if __CHAR_BIT__ >= 28
 # define VWORDmode __QI__

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

* [gcc(refs/users/aoliva/heads/testme)] enable control flow redundancy hardening unconditionally
@ 2023-10-06  5:25 Alexandre Oliva
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Oliva @ 2023-10-06  5:25 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:8ee134c81c666d6d360a45733838849a5a029757

commit 8ee134c81c666d6d360a45733838849a5a029757
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Mon Jul 3 18:09:38 2023 -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 5d318b4290c..90a8cc6cab6 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1828,7 +1828,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.
 
 fhardcfr-skip-leaf
diff --git a/gcc/gimple-harden-control-flow.cc b/gcc/gimple-harden-control-flow.cc
index 05878c97843..16c72d26e56 100644
--- a/gcc/gimple-harden-control-flow.cc
+++ b/gcc/gimple-harden-control-flow.cc
@@ -91,6 +91,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",
@@ -104,6 +106,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",
@@ -115,6 +119,8 @@ public:
 	&& (n_basic_blocks_for_fn (fun) - NUM_FIXED_BLOCKS
 	    > 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 f1202abc00d..45cf6f885d0 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -175,7 +175,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] 14+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] enable control flow redundancy hardening unconditionally
@ 2023-06-29 18:42 Alexandre Oliva
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Oliva @ 2023-06-29 18:42 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:e4d622e5c377b29e3a6a62f0febea1ee9e037c7e

commit e4d622e5c377b29e3a6a62f0febea1ee9e037c7e
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Wed Aug 24 13:36:58 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 fe40fcd504b..a635a9c47a7 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1824,7 +1824,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.
 
 fhardcfr-skip-leaf
diff --git a/gcc/gimple-harden-control-flow.cc b/gcc/gimple-harden-control-flow.cc
index 546837a450b..941ab0e4c51 100644
--- a/gcc/gimple-harden-control-flow.cc
+++ b/gcc/gimple-harden-control-flow.cc
@@ -91,6 +91,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",
@@ -104,6 +106,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",
@@ -115,6 +119,8 @@ public:
 	&& (n_basic_blocks_for_fn (fun) - NUM_FIXED_BLOCKS
 	    > 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 bd0679bdcd3..2db693838dc 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -175,7 +175,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] 14+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] enable control flow redundancy hardening unconditionally
@ 2023-06-29 13:48 Alexandre Oliva
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Oliva @ 2023-06-29 13:48 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:57344ed9088b66e7d41b48450318d4fd0ed5f64a

commit 57344ed9088b66e7d41b48450318d4fd0ed5f64a
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Wed Aug 24 13:36:58 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 fe40fcd504b..a635a9c47a7 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1824,7 +1824,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.
 
 fhardcfr-skip-leaf
diff --git a/gcc/gimple-harden-control-flow.cc b/gcc/gimple-harden-control-flow.cc
index ac4a329ebad..0fc427a6d7d 100644
--- a/gcc/gimple-harden-control-flow.cc
+++ b/gcc/gimple-harden-control-flow.cc
@@ -91,6 +91,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",
@@ -104,6 +106,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",
@@ -115,6 +119,8 @@ public:
 	&& (n_basic_blocks_for_fn (fun) - NUM_FIXED_BLOCKS
 	    > 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 bd0679bdcd3..2db693838dc 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -175,7 +175,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] 14+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] enable control flow redundancy hardening unconditionally
@ 2023-06-09 11:32 Alexandre Oliva
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Oliva @ 2023-06-09 11:32 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0591d0c06995602bc4f160cfd2dfb0a53c4cda54

commit 0591d0c06995602bc4f160cfd2dfb0a53c4cda54
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Thu Jun 8 01:35:37 2023 -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 846f7043897..b23ffbbac43 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1802,7 +1802,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.
 
 fhardcfr-skip-leaf
diff --git a/gcc/gimple-harden-control-flow.cc b/gcc/gimple-harden-control-flow.cc
index 044671cab79..faafaf7c8a0 100644
--- a/gcc/gimple-harden-control-flow.cc
+++ b/gcc/gimple-harden-control-flow.cc
@@ -91,6 +91,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",
@@ -104,6 +106,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",
@@ -115,6 +119,8 @@ public:
 	&& (n_basic_blocks_for_fn (fun) - NUM_FIXED_BLOCKS
 	    > 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 799ea41cedf..a2b6cefa0cc 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -183,7 +183,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] 14+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] enable control flow redundancy hardening unconditionally
@ 2023-06-09  6:17 Alexandre Oliva
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Oliva @ 2023-06-09  6:17 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:53ddfc84f35372e488988ee8231af2ddf54e2eeb

commit 53ddfc84f35372e488988ee8231af2ddf54e2eeb
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Thu Jun 8 01:35:37 2023 -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 cee34a74245..99c4a9085b1 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1802,7 +1802,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.
 
 fhardcfr-skip-leaf
diff --git a/gcc/gimple-harden-control-flow.cc b/gcc/gimple-harden-control-flow.cc
index 044671cab79..faafaf7c8a0 100644
--- a/gcc/gimple-harden-control-flow.cc
+++ b/gcc/gimple-harden-control-flow.cc
@@ -91,6 +91,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",
@@ -104,6 +106,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",
@@ -115,6 +119,8 @@ public:
 	&& (n_basic_blocks_for_fn (fun) - NUM_FIXED_BLOCKS
 	    > 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 799ea41cedf..a2b6cefa0cc 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -183,7 +183,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] 14+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] enable control flow redundancy hardening unconditionally
@ 2023-06-08 10:59 Alexandre Oliva
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Oliva @ 2023-06-08 10:59 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b9c018be716bde719a4a2306779219d0a871a4a8

commit b9c018be716bde719a4a2306779219d0a871a4a8
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Wed Aug 24 13:36:58 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 feea4920c9d..b2091642855 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1802,7 +1802,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.
 
 fhardcfr-skip-leaf
diff --git a/gcc/gimple-harden-control-flow.cc b/gcc/gimple-harden-control-flow.cc
index 044671cab79..faafaf7c8a0 100644
--- a/gcc/gimple-harden-control-flow.cc
+++ b/gcc/gimple-harden-control-flow.cc
@@ -91,6 +91,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",
@@ -104,6 +106,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",
@@ -115,6 +119,8 @@ public:
 	&& (n_basic_blocks_for_fn (fun) - NUM_FIXED_BLOCKS
 	    > 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 bd0679bdcd3..2db693838dc 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -175,7 +175,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] 14+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] enable control flow redundancy hardening unconditionally
@ 2023-06-08 10:43 Alexandre Oliva
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Oliva @ 2023-06-08 10:43 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:da0eacb29b4aeb8cfac721b2e771ef29d6a64e6b

commit da0eacb29b4aeb8cfac721b2e771ef29d6a64e6b
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Thu Jun 8 01:35:37 2023 -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 feea4920c9d..b2091642855 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1802,7 +1802,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.
 
 fhardcfr-skip-leaf
diff --git a/gcc/gimple-harden-control-flow.cc b/gcc/gimple-harden-control-flow.cc
index 044671cab79..faafaf7c8a0 100644
--- a/gcc/gimple-harden-control-flow.cc
+++ b/gcc/gimple-harden-control-flow.cc
@@ -91,6 +91,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",
@@ -104,6 +106,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",
@@ -115,6 +119,8 @@ public:
 	&& (n_basic_blocks_for_fn (fun) - NUM_FIXED_BLOCKS
 	    > 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 bd0679bdcd3..2db693838dc 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -175,7 +175,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] 14+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] enable control flow redundancy hardening unconditionally
@ 2023-06-08  9:17 Alexandre Oliva
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Oliva @ 2023-06-08  9:17 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:b9c018be716bde719a4a2306779219d0a871a4a8

commit b9c018be716bde719a4a2306779219d0a871a4a8
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Wed Aug 24 13:36:58 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 feea4920c9d..b2091642855 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1802,7 +1802,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.
 
 fhardcfr-skip-leaf
diff --git a/gcc/gimple-harden-control-flow.cc b/gcc/gimple-harden-control-flow.cc
index 044671cab79..faafaf7c8a0 100644
--- a/gcc/gimple-harden-control-flow.cc
+++ b/gcc/gimple-harden-control-flow.cc
@@ -91,6 +91,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",
@@ -104,6 +106,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",
@@ -115,6 +119,8 @@ public:
 	&& (n_basic_blocks_for_fn (fun) - NUM_FIXED_BLOCKS
 	    > 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 bd0679bdcd3..2db693838dc 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -175,7 +175,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] 14+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] enable control flow redundancy hardening unconditionally
@ 2022-08-24 16:52 Alexandre Oliva
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Oliva @ 2022-08-24 16:52 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:02a199b6b017a22a72e49f0d7ffef9edb7f90e42

commit 02a199b6b017a22a72e49f0d7ffef9edb7f90e42
Author: Alexandre Oliva <oliva@adacore.com>
Date:   Wed Aug 24 13:36:58 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 e347251f713..e0a002e6b16 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1798,7 +1798,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 6b08846dbb1..8932d548a20 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 ae214daa207..09852d65898 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -183,7 +183,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] 14+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] enable control flow redundancy hardening unconditionally
@ 2022-08-10 23:51 Alexandre Oliva
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Oliva @ 2022-08-10 23:51 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6cf8ee00b80b9999c3d2195e7d1b6a1889038456

commit 6cf8ee00b80b9999c3d2195e7d1b6a1889038456
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 54eb30fba64..35df3cbd743 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1798,7 +1798,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 6b08846dbb1..8932d548a20 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 d259fc7af9f..1ac9f53b9ec 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -183,7 +183,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] 14+ messages in thread

* [gcc(refs/users/aoliva/heads/testme)] enable control flow redundancy hardening unconditionally
@ 2022-07-07 15:15 Alexandre Oliva
  0 siblings, 0 replies; 14+ messages in thread
From: Alexandre Oliva @ 2022-07-07 15:15 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:1933a3e081315ed700ed4f53bd65ea9e2a4006a2

commit 1933a3e081315ed700ed4f53bd65ea9e2a4006a2
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 54eb30fba64..35df3cbd743 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1798,7 +1798,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 6b08846dbb1..8932d548a20 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 d259fc7af9f..1ac9f53b9ec 100644
--- a/gcc/params.opt
+++ b/gcc/params.opt
@@ -183,7 +183,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] 14+ messages in thread

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

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

commit 7eeca96058d2affd9c959fd55ab01ff803f9b880
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 +-
 libgcc/Makefile.in                | 2 ++
 4 files changed, 10 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=
diff --git a/libgcc/Makefile.in b/libgcc/Makefile.in
index ff76d29f25b..ce90960de04 100644
--- a/libgcc/Makefile.in
+++ b/libgcc/Makefile.in
@@ -429,6 +429,8 @@ iterator = $(patsubst %,$(srcdir)/static-object.mk,$(iter-items))
 endif
 
 LIB2ADD += enable-execute-stack.c
+
+# Control Flow Redundancy hardening out-of-line checker.
 LIB2ADD += $(srcdir)/hardcfr.c
 
 # While emutls.c has nothing to do with EH, it is in LIB2ADDEH*


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

end of thread, other threads:[~2023-10-10  4:14 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-08  4:48 [gcc(refs/users/aoliva/heads/testme)] enable control flow redundancy hardening unconditionally Alexandre Oliva
  -- strict thread matches above, loose matches on Subject: below --
2023-10-10  4:14 Alexandre Oliva
2023-10-06  5:25 Alexandre Oliva
2023-06-29 18:42 Alexandre Oliva
2023-06-29 13:48 Alexandre Oliva
2023-06-09 11:32 Alexandre Oliva
2023-06-09  6:17 Alexandre Oliva
2023-06-08 10:59 Alexandre Oliva
2023-06-08 10:43 Alexandre Oliva
2023-06-08  9:17 Alexandre Oliva
2022-08-24 16:52 Alexandre Oliva
2022-08-10 23:51 Alexandre Oliva
2022-07-07 15:15 Alexandre Oliva
2022-05-06  7:19 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).