Fix debug/49831

Submitted by Richard Henderson on July 25, 2011, 3:39 a.m.

Details

Message ID 4E2CE561.2090103@redhat.com
State New
Headers show

Commit Message

Richard Henderson July 25, 2011, 3:39 a.m.
The ARM failure was due to constant pools being considered
unreachable code.  Ideally, we'd do something to mark these
constant pools as data, not code, but again that's something
for another day.

A full arm-eabi test run is still underway, but at least the
libgcc build failure is fixed.


r~

	PR debug/49831
	* dwarf2cfi.c (connect_traces): Allow unvisited traces.  Skip
	them entirely.

Patch hide | download patch | download mbox

diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
index de19d06..57fe566 100644
--- a/gcc/dwarf2cfi.c
+++ b/gcc/dwarf2cfi.c
@@ -2641,14 +2641,22 @@  connect_traces (void)
 
   prev_ti = VEC_index (dw_trace_info, trace_info, 0);
 
-  for (i = 1; i < n; ++i, prev_ti = ti)
+  for (i = 1; i < n; ++i)
     {
       dw_cfi_row *old_row;
 
       ti = VEC_index (dw_trace_info, trace_info, i);
 
-      /* We must have both queued and processed every trace.  */
-      gcc_assert (ti->beg_row && ti->end_row);
+      /* ??? Ideally, we should have both queued and processed.  However
+	 the current representation of constant pools on various targets
+	 is indistinguishable from unreachable code.  Assume for the 
+	 moment that we can simply skip over such traces.  */
+      /* ??? Consider creating a DATA_INSN rtx code to indicate that
+	 these are not "real" instructions, and should not be considered.
+	 This could be generically useful for tablejump data as well.  */
+      if (ti->beg_row == NULL)
+	continue;
+      gcc_assert (ti->end_row != NULL);
 
       /* In dwarf2out_switch_text_section, we'll begin a new FDE
 	 for the portion of the function in the alternate text
@@ -2677,6 +2685,8 @@  connect_traces (void)
 	    }
 	  while (note != add_cfi_insn);
 	}
+
+      prev_ti = ti;
     }
 }