diff options
Diffstat (limited to 'gcc/targhooks.c')
-rw-r--r-- | gcc/targhooks.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 8df0de421f8..2c0a65dc926 100644 --- a/gcc/targhooks.c +++ b/gcc/targhooks.c @@ -499,6 +499,8 @@ default_stack_protect_guard (void) if (t == NULL) { + rtx x; + t = build_decl (UNKNOWN_LOCATION, VAR_DECL, get_identifier ("__stack_chk_guard"), ptr_type_node); @@ -510,6 +512,11 @@ default_stack_protect_guard (void) DECL_ARTIFICIAL (t) = 1; DECL_IGNORED_P (t) = 1; + /* Do not share RTL as the declaration is visible outside of + current function. */ + x = DECL_RTL (t); + RTX_FLAG (x, used) = 1; + stack_chk_guard_decl = t; } |