aboutsummaryrefslogtreecommitdiff
path: root/gcc/cfgexpand.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-12-05 09:26:06 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-12-05 09:26:06 +0100
commitf6fa17afefbef8fe5f5aa689814852efcb5e4b58 (patch)
tree7e5f20eaf354eb0ca5b732817f8e94c1e0732ecc /gcc/cfgexpand.c
parent47be95094bc2d5c79320234a35e5049e0514fff1 (diff)
downloadgcc-f6fa17afefbef8fe5f5aa689814852efcb5e4b58.zip
gcc-f6fa17afefbef8fe5f5aa689814852efcb5e4b58.tar.gz
gcc-f6fa17afefbef8fe5f5aa689814852efcb5e4b58.tar.bz2
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
Diffstat (limited to 'gcc/cfgexpand.c')
-rw-r--r--gcc/cfgexpand.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index 5e23bc2..9b3259d 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);