aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2016-11-10 18:43:02 +0100
committerSegher Boessenkool <segher@gcc.gnu.org>2016-11-10 18:43:02 +0100
commita1566696653132892d629525644c2c63da8dab87 (patch)
tree255a2bea9a7801a0a94cdf14d4b242a346093e6d /gcc
parent8ebd1b31828a67ad889f894bc82141e1acafb953 (diff)
downloadgcc-a1566696653132892d629525644c2c63da8dab87.zip
gcc-a1566696653132892d629525644c2c63da8dab87.tar.gz
gcc-a1566696653132892d629525644c2c63da8dab87.tar.bz2
dwarf2cfi: Dump row differences before asserting
If maybe_record_trace_start fails because the CFI is inconsistent on two paths into a block it currently just ICEs. This changes it to also dump the CFI on those two paths in the dump file; debugging it without that information is hopeless. * dwarf2cfi.c (dump_cfi_row): Add forward declaration. (maybe_record_trace_start): If the CFI is different on the new and old paths, print out both to the dump file before ICEing. From-SVN: r242046
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/dwarf2cfi.c18
2 files changed, 23 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index a87a17f..66586e4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2016-11-10 Segher Boessenkool <segher@kernel.crashing.org>
+
+ * dwarf2cfi.c (dump_cfi_row): Add forward declaration.
+ (maybe_record_trace_start): If the CFI is different on the new and
+ old paths, print out both to the dump file before ICEing.
+
2016-11-10 Vladimir Makarov <vmakarov@redhat.com>
* target.def (additional_allocno_class_p): New.
diff --git a/gcc/dwarf2cfi.c b/gcc/dwarf2cfi.c
index b6e8b4b..b93faa8 100644
--- a/gcc/dwarf2cfi.c
+++ b/gcc/dwarf2cfi.c
@@ -2268,6 +2268,8 @@ add_cfis_to_fde (void)
}
}
+static void dump_cfi_row (FILE *f, dw_cfi_row *row);
+
/* If LABEL is the start of a trace, then initialize the state of that
trace from CUR_TRACE and CUR_ROW. */
@@ -2311,7 +2313,21 @@ maybe_record_trace_start (rtx_insn *start, rtx_insn *origin)
/* We ought to have the same state incoming to a given trace no
matter how we arrive at the trace. Anything else means we've
got some kind of optimization error. */
- gcc_checking_assert (cfi_row_equal_p (cur_row, ti->beg_row));
+#if CHECKING_P
+ if (!cfi_row_equal_p (cur_row, ti->beg_row))
+ {
+ if (dump_file)
+ {
+ fprintf (dump_file, "Inconsistent CFI state!\n");
+ fprintf (dump_file, "SHOULD have:\n");
+ dump_cfi_row (dump_file, ti->beg_row);
+ fprintf (dump_file, "DO have:\n");
+ dump_cfi_row (dump_file, cur_row);
+ }
+
+ gcc_unreachable ();
+ }
+#endif
/* The args_size is allowed to conflict if it isn't actually used. */
if (ti->beg_true_args_size != args_size)