From: Richard Guenther <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Fix PR48846
Date: Tue, 03 May 2011 10:18:00 -0000 [thread overview]
Message-ID: <alpine.LNX.2.00.1105031216240.810@zhemvz.fhfr.qr> (raw)
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
reply other threads:[~2011-05-03 10:18 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.LNX.2.00.1105031216240.810@zhemvz.fhfr.qr \
--to=rguenther@suse.de \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).