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 PR48846


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
 


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