Commit 623a6941 by Maxim Kuvyrkov Committed by Maxim Kuvyrkov

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
parent aeecf17c
2010-05-12 Maxim Kuvyrkov <maxim@codesourcery.com>
* targhooks.c (default_stack_protect_guard): Avoid sharing RTL
for __stack_chk_guard.
2010-05-11 Jakub Jelinek <jakub@redhat.com>
* c-opts.c (c_common_parse_file): If start_end_main_source_file,
......
......@@ -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;
}
......
2010-05-12 Maxim Kuvyrkov <maxim@codesourcery.com>
* gcc.target/m68k/20100512-1.c: New.
2010-05-12 Eric Botcazou <ebotcazou@adacore.com>
* gnat.dg/lto8.adb: New test.
......
/* { dg-do compile } */
/* { dg-options "-O2 -fstack-protector" } */
/* { dg-require-effective-target fstack_protector } */
/* There should be 2 references to __stack_chk_guard in every function. */
/* { dg-final { scan-assembler-times "__stack_chk_guard" 4 } } */
#include <stdlib.h>
#include <string.h>
void doTest1(void) {
volatile char foo[10];
memset((void *)foo, 1, 100);
}
void doTest2(void) {
volatile char foo[10];
memset((void *)foo, 1, 100);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment