From d26d508afa21f42ac33b0f10e64d78e961171796 Mon Sep 17 00:00:00 2001 From: Dominik Vogt Date: Thu, 27 Aug 2015 07:38:36 +0000 Subject: [PATCH] S/390: Add emit_barrier() after trap gcc/ChangeLog * config/s390/s390.c (s390_emit_prologue): Add emit_barrier() after trap to fix ICE. gcc/testsuite/ChangeLog * gcc.target/s390/20150826-1.c: New test. From-SVN: r227251 --- gcc/ChangeLog | 5 +++++ gcc/config/s390/s390.c | 1 + gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/s390/20150826-1.c | 12 ++++++++++++ 4 files changed, 22 insertions(+) create mode 100644 gcc/testsuite/gcc.target/s390/20150826-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1cfd8e8e714..e8884c00cee 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2015-08-27 Dominik Vogt + + * config/s390/s390.c (s390_emit_prologue): Add emit_barrier() after + trap to fix ICE. + 2015-08-26 Michael Meissner * config/rs6000/rs6000-protos.h (rs6000_expand_float128_convert): diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index 54b6b7d5859..cbfc80073c9 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -10351,6 +10351,7 @@ s390_emit_prologue (void) current_function_name(), cfun_frame_layout.frame_size, s390_stack_size); emit_insn (gen_trap ()); + emit_barrier (); } else { diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 27be013c3d9..15a2a438b99 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-08-27 Dominik Vogt + + * gcc.target/s390/20150826-1.c: New test. + 2015-08-26 Renlin Li * gcc.target/aarch64/combine_bfi_1.c: New testcase. diff --git a/gcc/testsuite/gcc.target/s390/20150826-1.c b/gcc/testsuite/gcc.target/s390/20150826-1.c new file mode 100644 index 00000000000..1567ced42e1 --- /dev/null +++ b/gcc/testsuite/gcc.target/s390/20150826-1.c @@ -0,0 +1,12 @@ +/* Check that emitting a dynamic stack check for sizes below the + current frame size work. */ + +/* { dg-do compile } */ +/* { dg-options "-O3 -mstack-size=32" } */ + +extern int bar(char *); +int foo(void) +{ + char b[100]; + return bar(b); +} /* { dg-warning "An unconditional trap is added" } */ -- 2.30.2