From e30bf737fb94815e5a73e96558aac2617fba2ebd Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Tue, 30 May 2017 10:01:31 +0200 Subject: [PATCH] backport: re PR target/79494 (ICE in maybe_record_trace_start, at dwarf2cfi.c:2330) Backported from mainline 2017-02-21 Jakub Jelinek PR target/79494 * config/i386/i386.c (ix86_expand_split_stack_prologue): Call make_reg_eh_region_note_nothrow_nononlocal on call_insn. * gcc.dg/pr79494.c: New test. From-SVN: r248646 --- gcc/ChangeLog | 6 ++++++ gcc/config/i386/i386.c | 2 ++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr79494.c | 22 ++++++++++++++++++++++ 4 files changed, 35 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr79494.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b4d09b55d8dd..8cc4d3660cae 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,6 +1,12 @@ 2017-05-30 Jakub Jelinek Backported from mainline + 2017-02-21 Jakub Jelinek + + PR target/79494 + * config/i386/i386.c (ix86_expand_split_stack_prologue): Call + make_reg_eh_region_note_nothrow_nononlocal on call_insn. + 2017-02-20 Jakub Jelinek PR target/79568 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index d9268c326737..bdd91dc6d170 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -12698,6 +12698,8 @@ ix86_expand_split_stack_prologue (void) GEN_INT (UNITS_PER_WORD), constm1_rtx, NULL_RTX, false); add_function_usage_to (call_insn, call_fusage); + /* Indicate that this function can't jump to non-local gotos. */ + make_reg_eh_region_note_nothrow_nononlocal (as_a (call_insn)); /* In order to make call/return prediction work right, we now need to execute a return instruction. See diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8a6d56b515c3..8452081abc5b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,6 +1,11 @@ 2017-05-30 Jakub Jelinek Backported from mainline + 2017-02-21 Jakub Jelinek + + PR target/79494 + * gcc.dg/pr79494.c: New test. + 2017-02-20 Jakub Jelinek PR target/79568 diff --git a/gcc/testsuite/gcc.dg/pr79494.c b/gcc/testsuite/gcc.dg/pr79494.c new file mode 100644 index 000000000000..e8543f8c43fb --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr79494.c @@ -0,0 +1,22 @@ +/* PR target/79494 */ +/* { dg-do compile } */ +/* { dg-require-effective-target split_stack } */ +/* { dg-options "-O2 -fsplit-stack -g" } */ + +void +foo (int a) +{ + __label__ lab; + __attribute__((noinline, noclone)) void bar (int b) + { + switch (b) + { + case 1: + goto lab; + case 2: + goto lab; + } + } + bar (a); +lab:; +} -- 2.47.2