aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/c-family/c-cppbuiltin.c8
-rw-r--r--gcc/cfgexpand.c7
-rw-r--r--gcc/coretypes.h8
-rw-r--r--gcc/function.c2
4 files changed, 13 insertions, 12 deletions
diff --git a/gcc/c-family/c-cppbuiltin.c b/gcc/c-family/c-cppbuiltin.c
index 74ecca8..e5ebb79 100644
--- a/gcc/c-family/c-cppbuiltin.c
+++ b/gcc/c-family/c-cppbuiltin.c
@@ -1427,13 +1427,13 @@ c_cpp_builtins (cpp_reader *pfile)
/* Make the choice of the stack protector runtime visible to source code.
The macro names and values here were chosen for compatibility with an
earlier implementation, i.e. ProPolice. */
- if (flag_stack_protect == 4)
+ if (flag_stack_protect == SPCT_FLAG_EXPLICIT)
cpp_define (pfile, "__SSP_EXPLICIT__=4");
- if (flag_stack_protect == 3)
+ if (flag_stack_protect == SPCT_FLAG_STRONG)
cpp_define (pfile, "__SSP_STRONG__=3");
- if (flag_stack_protect == 2)
+ if (flag_stack_protect == SPCT_FLAG_ALL)
cpp_define (pfile, "__SSP_ALL__=2");
- else if (flag_stack_protect == 1)
+ else if (flag_stack_protect == SPCT_FLAG_DEFAULT)
cpp_define (pfile, "__SSP__=1");
if (flag_openacc)
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 1eaa1da..2ac9aef 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -1762,13 +1762,6 @@ clear_tree_used (tree block)
clear_tree_used (t);
}
-enum {
- SPCT_FLAG_DEFAULT = 1,
- SPCT_FLAG_ALL = 2,
- SPCT_FLAG_STRONG = 3,
- SPCT_FLAG_EXPLICIT = 4
-};
-
/* Examine TYPE and determine a bit mask of the following features. */
#define SPCT_HAS_LARGE_CHAR_ARRAY 1
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index 6b6cfcd..81a1b59 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -219,6 +219,14 @@ enum profile_reproducibility {
PROFILE_REPRODUCIBILITY_MULTITHREADED
};
+/* Type of -fstack-protector-*. */
+enum stack_protector {
+ SPCT_FLAG_DEFAULT = 1,
+ SPCT_FLAG_ALL = 2,
+ SPCT_FLAG_STRONG = 3,
+ SPCT_FLAG_EXPLICIT = 4
+};
+
/* Types of unwind/exception handling info that can be generated. */
enum unwind_info_type
diff --git a/gcc/function.c b/gcc/function.c
index c612959..f903a1e 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -2846,7 +2846,7 @@ assign_parm_adjust_stack_rtl (struct assign_parm_data_one *data)
/* If stack protection is in effect for this function, don't leave any
pointers in their passed stack slots. */
else if (crtl->stack_protect_guard
- && (flag_stack_protect == 2
+ && (flag_stack_protect == SPCT_FLAG_ALL
|| data->arg.pass_by_reference
|| POINTER_TYPE_P (data->nominal_type)))
stack_parm = NULL;