From: Jakub Jelinek Date: Mon, 7 Jan 2019 08:50:57 +0000 (+0100) Subject: re PR sanitizer/88619 (ICE in asan_emit_stack_protection, at asan.c:1574 since r266664) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=76192f9356f1fc5b5e4d251020625d46c48a8dd8;p=gcc.git re PR sanitizer/88619 (ICE in asan_emit_stack_protection, at asan.c:1574 since r266664) PR sanitizer/88619 * cfgexpand.c (expand_stack_vars): Only align prev_offset to ASAN_MIN_RED_ZONE_SIZE, not to maximum of that and alignb. * c-c++-common/asan/pr88619.c: New test. From-SVN: r267633 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 25660bd1c8a..73fd2460724 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2019-01-07 Jakub Jelinek + PR sanitizer/88619 + * cfgexpand.c (expand_stack_vars): Only align prev_offset to + ASAN_MIN_RED_ZONE_SIZE, not to maximum of that and alignb. + PR c++/85052 * tree-vect-generic.c: Include insn-config.h and recog.h. (expand_vector_piecewise): Add defaulted ret_type argument, diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c index 60c1cfb4556..f4786d5da09 100644 --- a/gcc/cfgexpand.c +++ b/gcc/cfgexpand.c @@ -1130,7 +1130,7 @@ expand_stack_vars (bool (*pred) (size_t), struct stack_vars_data *data) prev_offset = frame_offset.to_constant (); } prev_offset = align_base (prev_offset, - MAX (alignb, ASAN_MIN_RED_ZONE_SIZE), + ASAN_MIN_RED_ZONE_SIZE, !FRAME_GROWS_DOWNWARD); tree repr_decl = NULL_TREE; unsigned HOST_WIDE_INT size diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index a0d74152bad..538f7f30062 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2019-01-07 Jakub Jelinek + PR sanitizer/88619 + * c-c++-common/asan/pr88619.c: New test. + PR c++/85052 * c-c++-common/builtin-convertvector-1.c: New test. * c-c++-common/torture/builtin-convertvector-1.c: New test. diff --git a/gcc/testsuite/c-c++-common/asan/pr88619.c b/gcc/testsuite/c-c++-common/asan/pr88619.c new file mode 100644 index 00000000000..aab8a4c4c9c --- /dev/null +++ b/gcc/testsuite/c-c++-common/asan/pr88619.c @@ -0,0 +1,14 @@ +/* PR sanitizer/88619 */ +/* { dg-do compile { target fstack_protector } } */ +/* { dg-options "-fstack-protector-strong -fsanitize=address" } */ + +typedef int A __attribute__((aligned (64))); + +int +main () +{ + A b; + int *p = &b; + *(p - 1) = 123; + __builtin_alloca (b); +}