From 59931fb066cc0526c103dfd5a97c6d0f2797e554 Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Sat, 6 Jan 2018 08:48:31 +0100 Subject: [PATCH] re PR debug/83480 (ICE in create_block_for_bookkeeping, at sel-sched.c:4557) PR debug/83480 * toplev.c (process_options): Don't enable debug_nonbind_markers_p by default if flag_selective_schedling{,2}. Formatting fixes. * gcc.dg/pr83480.c: New test. From-SVN: r256309 --- gcc/ChangeLog | 4 ++++ gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/gcc.dg/pr83480.c | 32 ++++++++++++++++++++++++++++++++ gcc/toplev.c | 13 +++++++++---- 4 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/pr83480.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 283f792dcf7..59f25abe8b5 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2018-01-06 Jakub Jelinek + PR debug/83480 + * toplev.c (process_options): Don't enable debug_nonbind_markers_p + by default if flag_selective_schedling{,2}. Formatting fixes. + PR rtl-optimization/83682 * rtl.h (const_vec_duplicate_p): Only return true for VEC_DUPLICATE if it has non-VECTOR_MODE element mode. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7ebe12992e5..219d0d4865c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2018-01-06 Jakub Jelinek + PR debug/83480 + * gcc.dg/pr83480.c: New test. + PR rtl-optimization/83682 * gcc.target/i386/pr83682.c: New test. diff --git a/gcc/testsuite/gcc.dg/pr83480.c b/gcc/testsuite/gcc.dg/pr83480.c new file mode 100644 index 00000000000..7b57712eaee --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr83480.c @@ -0,0 +1,32 @@ +/* PR debug/83480 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -g -fselective-scheduling2 -ftree-vectorize -freorder-blocks-algorithm=simple -fnon-call-exceptions -fno-guess-branch-probability -fno-peephole2 -fno-tree-sink -fno-tree-scev-cprop" } */ + +signed char a, b; + +void +foo (int x, int y) +{ + for (a = 1; a != 0; ++a) + ; + + for (;;) + { + int c; + + b %= (y != 0 && a != 0) + 1; + if (a != 0) + y = b; + + for (c = 0; c < 50; ++c) + ++x; + + if (a < 1) + { + while (x != 0) + ; + + a /= 0; /* { dg-warning "division by zero" } */ + } + } +} diff --git a/gcc/toplev.c b/gcc/toplev.c index 5faa3649af2..35d79680ab0 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -1535,8 +1535,9 @@ process_options (void) flag_var_tracking_uninit = flag_var_tracking; if (flag_var_tracking_assignments == AUTODETECT_VALUE) - flag_var_tracking_assignments = flag_var_tracking - && !(flag_selective_scheduling || flag_selective_scheduling2); + flag_var_tracking_assignments + = (flag_var_tracking + && !(flag_selective_scheduling || flag_selective_scheduling2)); if (flag_var_tracking_assignments_toggle) flag_var_tracking_assignments = !flag_var_tracking_assignments; @@ -1550,8 +1551,12 @@ process_options (void) "var-tracking-assignments changes selective scheduling"); if (debug_nonbind_markers_p == AUTODETECT_VALUE) - debug_nonbind_markers_p = optimize && debug_info_level >= DINFO_LEVEL_NORMAL - && (write_symbols == DWARF2_DEBUG || write_symbols == VMS_AND_DWARF2_DEBUG); + debug_nonbind_markers_p + = (optimize + && debug_info_level >= DINFO_LEVEL_NORMAL + && (write_symbols == DWARF2_DEBUG + || write_symbols == VMS_AND_DWARF2_DEBUG) + && !(flag_selective_scheduling || flag_selective_scheduling2)); if (flag_tree_cselim == AUTODETECT_VALUE) { -- 2.30.2