re PR debug/81155 (Debug make check regressions in GCC 8.0)
authorJakub Jelinek <jakub@redhat.com>
Fri, 12 Jan 2018 18:20:49 +0000 (19:20 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 12 Jan 2018 18:20:49 +0000 (19:20 +0100)
PR debug/81155
* bb-reorder.c (pass_partition_blocks::gate): In lto don't partition
main to workaround a bug in GDB.

From-SVN: r256592

gcc/ChangeLog
gcc/bb-reorder.c

index c21c464e8ecad13a60cc613d502c49bb32af940e..4b4b57783be1792018ae8c2bc8e084de3c8b371d 100644 (file)
@@ -1,3 +1,9 @@
+2018-01-12  Jakub Jelinek  <jakub@redhat.com>
+
+       PR debug/81155
+       * bb-reorder.c (pass_partition_blocks::gate): In lto don't partition
+       main to workaround a bug in GDB.
+
 2018-01-12  Tom de Vries  <tom@codesourcery.com>
 
        PR target/83737
index 9d18fcc495f3b2b3517a7bc4b566fa2c8ee4d16c..8a65d6b3938c12969b94a7c7d4e392c1e4c90dc5 100644 (file)
@@ -2873,7 +2873,10 @@ pass_partition_blocks::gate (function *fun)
             we are going to omit the reordering.  */
          && optimize_function_for_speed_p (fun)
          && !DECL_COMDAT_GROUP (current_function_decl)
-         && !lookup_attribute ("section", DECL_ATTRIBUTES (fun->decl)));
+         && !lookup_attribute ("section", DECL_ATTRIBUTES (fun->decl))
+         /* Workaround a bug in GDB where read_partial_die doesn't cope
+            with DIEs with DW_AT_ranges, see PR81115.  */
+         && !(in_lto_p && MAIN_NAME_P (DECL_NAME (fun->decl))));
 }
 
 unsigned