re PR debug/52027 (ICE: SIGSEGV in set_cur_line_info_table (dwarf2out.c:20428) with...
authorJakub Jelinek <jakub@redhat.com>
Mon, 30 Jan 2012 13:49:44 +0000 (14:49 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 30 Jan 2012 13:49:44 +0000 (14:49 +0100)
PR debug/52027
* dwarf2out.c (dwarf2out_switch_text_section): Don't call
set_cur_line_info_table if not emitting debug info.

* gcc.dg/tree-prof/pr52027.c: New test.

From-SVN: r183725

gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-prof/pr52027.c [new file with mode: 0644]

index c819d1d0636a8579050763eb565596836ffac82a..e498f7bdfe0cc64cf58d2d4e19750f2a2ea91b22 100644 (file)
@@ -1,5 +1,9 @@
 2012-01-30  Jakub Jelinek  <jakub@redhat.com>
 
+       PR debug/52027
+       * dwarf2out.c (dwarf2out_switch_text_section): Don't call
+       set_cur_line_info_table if not emitting debug info.
+
        PR tree-optimization/52046
        * tree-vect-patterns.c (check_bool_pattern): Give up if
        a comparison could throw.
index fee5c60e403020cbea20e240ae919a002c9887ab..f710239be9ec7f0741e52cdc7308ceb021f2ce07 100644 (file)
@@ -1177,7 +1177,8 @@ dwarf2out_switch_text_section (void)
 
   var_location_switch_text_section ();
 
-  set_cur_line_info_table (sect);
+  if (cold_text_section != NULL)
+    set_cur_line_info_table (sect);
 }
 \f
 /* And now, the subset of the debugging information support code necessary
index 36dab8f112b126d325ec13ff9674ab91b7a02dd1..d80e3ab7913f2930fcb884856b5a1923af7e7223 100644 (file)
@@ -1,5 +1,8 @@
 2012-01-30  Jakub Jelinek  <jakub@redhat.com>
 
+       PR debug/52027
+       * gcc.dg/tree-prof/pr52027.c: New test.
+
        PR tree-optimization/52046
        * gcc.dg/pr52046.c: New test.
 
diff --git a/gcc/testsuite/gcc.dg/tree-prof/pr52027.c b/gcc/testsuite/gcc.dg/tree-prof/pr52027.c
new file mode 100644 (file)
index 0000000..c12f8b4
--- /dev/null
@@ -0,0 +1,19 @@
+/* PR debug/52027 */
+/* { dg-require-effective-target freorder } */
+/* { dg-options "-O -freorder-blocks-and-partition -fno-reorder-functions" } */
+
+void
+foo (int len)
+{
+  char array[1000];
+  __builtin_memset (array, 0, len);
+}
+
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 1000; i++)
+    foo (8);
+  return 0;
+}