re PR debug/83480 (ICE in create_block_for_bookkeeping, at sel-sched.c:4557)
authorJakub Jelinek <jakub@redhat.com>
Sat, 6 Jan 2018 07:48:31 +0000 (08:48 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Sat, 6 Jan 2018 07:48:31 +0000 (08:48 +0100)
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
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/pr83480.c [new file with mode: 0644]
gcc/toplev.c

index 283f792dcf7b889076ba468accb6c62cbf9d9651..59f25abe8b54bad776b381565eb734cdecd2d8a4 100644 (file)
@@ -1,5 +1,9 @@
 2018-01-06  Jakub Jelinek  <jakub@redhat.com>
 
+       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.
index 7ebe12992e574b83942f6f8962c873fceadb601e..219d0d4865cc08612ec9f452163d1c6c3a7009d7 100644 (file)
@@ -1,5 +1,8 @@
 2018-01-06  Jakub Jelinek  <jakub@redhat.com>
 
+       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 (file)
index 0000000..7b57712
--- /dev/null
@@ -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" } */
+       }
+    }
+}
index 5faa3649af26e459c094123c3ac4f433ff9bc998..35d79680ab03cb8404686664e65f1b231a523f70 100644 (file)
@@ -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)
     {