This is the mail archive of the
mailing list for the GCC project.
[lto] Guard against mismatched LTO_DEBUG_STREAM settings
- From: dnovillo at google dot com (Diego Novillo)
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 21 Oct 2008 11:42:06 -0700
- Subject: [lto] Guard against mismatched LTO_DEBUG_STREAM settings
This patch prevents empty stream debugging sections from
confusing lto1. I was running into this when debugging object
files generated with a cc1/cc1plus binary compiled with stream
Tested on x86.
* lto-section-in.c (lto_debug_in_fun): Guard against empty
stream debug sections.
--- lto-section-in.c (revision 141264)
+++ lto-section-in.c (working copy)
@@ -604,6 +604,13 @@ lto_debug_in_fun (struct lto_debug_conte
stream = (struct lto_input_block *) context->current_data;
+ /* If the writer and reader were compiled with different settings
+ for LTO_STREAM_DEBUGGING, the debugging STREAM may not have any
+ data in it. Do nothing in that case. */
+ if (stream->len == 0 || stream->len == (unsigned) -1)
b = lto_input_1_unsigned (stream);
if (b != c)