This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR47264


This fixes the ICEs due to unaligned accesses in lto-plugin.

Bootstrapped and tested on x86_64-unknown-linux-gnu, committed as
obvious.

Richard.

2011-01-12  Richard Guenther  <rguenther@suse.de>

	PR lto/47264
	* lto-plugin.c (parse_table_entry): Use memcpy to access
	unaligned fields.

Index: lto-plugin/lto-plugin.c
===================================================================
*** lto-plugin/lto-plugin.c	(revision 168664)
--- lto-plugin/lto-plugin.c	(working copy)
*************** parse_table_entry (char *p, struct ld_pl
*** 249,258 ****
    entry->visibility = translate_visibility[t];
    p++;
  
!   entry->size = *(uint64_t *) p;
    p += 8;
  
!   aux->slot = *(uint32_t *) p;
    p += 4;
  
    entry->resolution = LDPR_UNKNOWN;
--- 249,258 ----
    entry->visibility = translate_visibility[t];
    p++;
  
!   memcpy (&entry->size, p, sizeof (uint64_t));
    p += 8;
  
!   memcpy (&aux->slot, p, sizeof (uint32_t));
    p += 4;
  
    entry->resolution = LDPR_UNKNOWN;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]