public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Fix PR48846
@ 2011-05-03 10:18 Richard Guenther
  0 siblings, 0 replies; only message in thread
From: Richard Guenther @ 2011-05-03 10:18 UTC (permalink / raw)
  To: gcc-patches


We are streaming DECL_OFFSET_ALIGN using 8 bits.  That is bogus, as
DECL_OFFSET_ALIGN is 1 << decl_common.off_align which in turn is
a 8 bit bitfield.  The solution is to stream decl_common.off_align
instead.

Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk
and the 4.6 branch.

Richard.

2011-05-03  Richard Guenther  <rguenther@suse.de>

	PR lto/48846
	* lto-streamer-in.c (unpack_ts_decl_common_value_fields):
	Stream decl_common.off_align instead of the derived DECL_OFFSET_ALIGN.
	* lto-streamer-out.c (pack_ts_decl_common_value_fields): Likewise.

Index: gcc/lto-streamer-in.c
===================================================================
*** gcc/lto-streamer-in.c	(revision 173296)
--- gcc/lto-streamer-in.c	(working copy)
*************** unpack_ts_decl_common_value_fields (stru
*** 1653,1663 ****
  
    if (TREE_CODE (expr) == FIELD_DECL)
      {
-       unsigned HOST_WIDE_INT off_align;
        DECL_PACKED (expr) = (unsigned) bp_unpack_value (bp, 1);
        DECL_NONADDRESSABLE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
!       off_align = (unsigned HOST_WIDE_INT) bp_unpack_value (bp, 8);
!       SET_DECL_OFFSET_ALIGN (expr, off_align);
      }
  
    if (TREE_CODE (expr) == RESULT_DECL
--- 1653,1661 ----
  
    if (TREE_CODE (expr) == FIELD_DECL)
      {
        DECL_PACKED (expr) = (unsigned) bp_unpack_value (bp, 1);
        DECL_NONADDRESSABLE_P (expr) = (unsigned) bp_unpack_value (bp, 1);
!       expr->decl_common.off_align = bp_unpack_value (bp, 8);
      }
  
    if (TREE_CODE (expr) == RESULT_DECL
Index: gcc/lto-streamer-out.c
===================================================================
*** gcc/lto-streamer-out.c	(revision 173296)
--- gcc/lto-streamer-out.c	(working copy)
*************** pack_ts_decl_common_value_fields (struct
*** 401,407 ****
      {
        bp_pack_value (bp, DECL_PACKED (expr), 1);
        bp_pack_value (bp, DECL_NONADDRESSABLE_P (expr), 1);
!       bp_pack_value (bp, DECL_OFFSET_ALIGN (expr), 8);
      }
  
    if (TREE_CODE (expr) == RESULT_DECL
--- 401,407 ----
      {
        bp_pack_value (bp, DECL_PACKED (expr), 1);
        bp_pack_value (bp, DECL_NONADDRESSABLE_P (expr), 1);
!       bp_pack_value (bp, expr->decl_common.off_align, 8);
      }
  
    if (TREE_CODE (expr) == RESULT_DECL
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-03 10:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-03 10:18 [PATCH] Fix PR48846 Richard Guenther

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).