re PR lto/47274 (ICE in lto_varpool_replace_node, at lto-symtab.c:306)

PR lto/47274
	* lto-streamer-out.c (write_symbol): When writing kind and visibility,
	copy them into a unsigned char variable and pass address of it to
	lto_output_data_stream.

From-SVN: r169785
This commit is contained in:
Jakub Jelinek 2011-02-03 11:49:06 +01:00 committed by Jakub Jelinek
parent 89843f5dfb
commit 7d58701c40
2 changed files with 10 additions and 2 deletions

View File

@ -1,5 +1,10 @@
2011-02-03 Jakub Jelinek <jakub@redhat.com> 2011-02-03 Jakub Jelinek <jakub@redhat.com>
PR lto/47274
* lto-streamer-out.c (write_symbol): When writing kind and visibility,
copy them into a unsigned char variable and pass address of it to
lto_output_data_stream.
PR target/47564 PR target/47564
* toplev.c (target_reinit): Save and restore *crtl and regno_reg_rtx * toplev.c (target_reinit): Save and restore *crtl and regno_reg_rtx
around backend_init_target and lang_dependent_init_target calls. around backend_init_target and lang_dependent_init_target calls.

View File

@ -2410,6 +2410,7 @@ write_symbol (struct lto_streamer_cache_d *cache,
int slot_num; int slot_num;
uint64_t size; uint64_t size;
const char *comdat; const char *comdat;
unsigned char c;
/* None of the following kinds of symbols are needed in the /* None of the following kinds of symbols are needed in the
symbol table. */ symbol table. */
@ -2505,8 +2506,10 @@ write_symbol (struct lto_streamer_cache_d *cache,
lto_output_data_stream (stream, name, strlen (name) + 1); lto_output_data_stream (stream, name, strlen (name) + 1);
lto_output_data_stream (stream, comdat, strlen (comdat) + 1); lto_output_data_stream (stream, comdat, strlen (comdat) + 1);
lto_output_data_stream (stream, &kind, 1); c = (unsigned char) kind;
lto_output_data_stream (stream, &visibility, 1); lto_output_data_stream (stream, &c, 1);
c = (unsigned char) visibility;
lto_output_data_stream (stream, &c, 1);
lto_output_data_stream (stream, &size, 8); lto_output_data_stream (stream, &size, 8);
lto_output_data_stream (stream, &slot_num, 4); lto_output_data_stream (stream, &slot_num, 4);
} }