From 7a9df68ec6a8752f2e95e8ca1ca1fc53384c90c6 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Mon, 20 Jun 2016 23:40:02 +0200 Subject: [PATCH] re PR rtl-optimization/71591 (SIGSEGV in test_uncond_jump (rtl-tests.c:90) with -E -fself-test) PR rtl-optimization/71591 * toplev.c (toplev::run_self_tests): If no_backend, complain and don't run any tests. * gcc.dg/cpp/pr71591.c: New test. From-SVN: r237620 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/cpp/pr71591.c | 5 +++++ gcc/toplev.c | 5 +++++ 4 files changed, 21 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/cpp/pr71591.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index c76c39b7343..d4b3aae5d6d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2016-06-20 Jakub Jelinek + + PR rtl-optimization/71591 + * toplev.c (toplev::run_self_tests): If no_backend, complain and + don't run any tests. + 2016-06-20 Hans-Peter Nilsson PR target/71571 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 96b664d39a5..4b966e956bc 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-06-20 Jakub Jelinek + + PR rtl-optimization/71591 + * gcc.dg/cpp/pr71591.c: New test. + 2016-06-20 David B. Robins PR target/71571 diff --git a/gcc/testsuite/gcc.dg/cpp/pr71591.c b/gcc/testsuite/gcc.dg/cpp/pr71591.c new file mode 100644 index 00000000000..e92cb529e60 --- /dev/null +++ b/gcc/testsuite/gcc.dg/cpp/pr71591.c @@ -0,0 +1,5 @@ +/* PR rtl-optimization/71591 */ +/* { dg-do preprocess } */ +/* { dg-options "-fself-test" } */ + +/* { dg-message "self-tests incompatible with -E" "" { target *-*-* } 0 } */ diff --git a/gcc/toplev.c b/gcc/toplev.c index f51d2cb2b77..da80097eb5b 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -2047,6 +2047,11 @@ toplev::start_timevars () void toplev::run_self_tests () { + if (no_backend) + { + error_at (UNKNOWN_LOCATION, "self-tests incompatible with -E"); + return; + } #if CHECKING_P /* Reset some state. */ input_location = UNKNOWN_LOCATION; -- 2.30.2