From 623a6941fa3db376bde6179eb7ca2f3b37b89518 Mon Sep 17 00:00:00 2001 From: Maxim Kuvyrkov Date: Wed, 12 May 2010 11:05:19 +0000 Subject: targhooks.c (default_stack_protect_guard): Avoid sharing RTL for __stack_chk_guard. * targhooks.c (default_stack_protect_guard): Avoid sharing RTL for __stack_chk_guard. * gcc.target/m68k/20100512-1.c: New. From-SVN: r159310 --- gcc/targhooks.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'gcc/targhooks.c') diff --git a/gcc/targhooks.c b/gcc/targhooks.c index 8df0de4..2c0a65d 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; } -- cgit v1.1