From: Jakub Jelinek Date: Wed, 5 Dec 2018 08:26:06 +0000 (+0100) Subject: re PR sanitizer/88333 (ice in asan_emit_stack_protection, at asan.c:1574) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f6fa17afefbef8fe5f5aa689814852efcb5e4b58;p=gcc.git re PR sanitizer/88333 (ice in asan_emit_stack_protection, at asan.c:1574) PR sanitizer/88333 * cfgexpand.c (expand_stack_vars): If asan_vec is empty, start with aligning frame offset to ASAN_RED_ZONE_SIZE bytes. * c-c++-common/asan/pr88333.c: New test. From-SVN: r266817 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a71d88fa9e1..22ca3486419 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-12-05 Jakub Jelinek + + PR sanitizer/88333 + * cfgexpand.c (expand_stack_vars): If asan_vec is empty, start with + aligning frame offset to ASAN_RED_ZONE_SIZE bytes. + 2018-12-05 Xianmiao Qu * config.gcc (csky-*-linux-gnu*): Force .init_array support. diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 5e23bc242b9..9b3259d12ed 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -1124,6 +1124,11 @@ expand_stack_vars (bool (*pred) (size_t), struct stack_vars_data *data) && frame_offset.is_constant (&prev_offset) && stack_vars[i].size.is_constant ()) { + if (data->asan_vec.is_empty ()) + { + alloc_stack_frame_space (0, ASAN_RED_ZONE_SIZE); + prev_offset = frame_offset.to_constant (); + } prev_offset = align_base (prev_offset, MAX (alignb, ASAN_MIN_RED_ZONE_SIZE), !FRAME_GROWS_DOWNWARD); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8b74eb02bfb..1c9008261eb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-12-05 Jakub Jelinek + + PR sanitizer/88333 + * c-c++-common/asan/pr88333.c: New test. + 2018-12-05 Alexandre Oliva PR c++/85569 diff --git a/gcc/testsuite/c-c++-common/asan/pr88333.c b/gcc/testsuite/c-c++-common/asan/pr88333.c new file mode 100644 index 00000000000..0f257a8988c --- /dev/null +++ b/gcc/testsuite/c-c++-common/asan/pr88333.c @@ -0,0 +1,12 @@ +/* PR sanitizer/88333 */ +/* { dg-do compile { target fstack_protector } } */ +/* { dg-options "-fstack-protector-strong -fsanitize=address" } */ + +void bar (int *); + +void +foo (void) +{ + int c; + bar (&c); +}