From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 97077 invoked by alias); 8 Jul 2015 12:08:43 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 97066 invoked by uid 89); 8 Jul 2015 12:08:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Wed, 08 Jul 2015 12:08:41 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 3A006ABB9; Wed, 8 Jul 2015 12:08:38 +0000 (UTC) Date: Wed, 08 Jul 2015 12:08:00 -0000 From: Richard Biener To: gcc-patches@gcc.gnu.org cc: Jakub Jelinek Subject: Re: [PATCH] Fix PR66805 - #pragma pack affecting gcov_info_type layout In-Reply-To: Message-ID: References: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2015-07/txt/msg00594.txt.bz2 On Wed, 8 Jul 2015, Richard Biener wrote: > > The following fixes #pragma pack effect leaking to all types built > from the middle-end (so possibly even vector types built by the > vectorizer?). The PR in question is about gcov_info_type where > layout is affected and inconsistency between that and the libgcov.a > copy causes libgcov to crash. > > As the way to communicate #pragma pack to stor-layout.c is already > a hack I couldn't think of a better solution like that below. > > Bootstrap and regtest running on x86_64-unknown-linux-gnu. > > Ok? Ok, so I found initial_max_fld_align and instead propose the following simpler. 2015-07-08 Richard Biener * toplev.c (compile_file): Reset maximum_field_alignment after parsing. Index: gcc/toplev.c =================================================================== --- gcc/toplev.c (revision 225534) +++ gcc/toplev.c (working copy) @@ -553,6 +553,11 @@ compile_file (void) if (flag_syntax_only || flag_wpa) return; + + /* Reset maximum_field_alignment, it can be adjusted by #pragma pack + and this shouldn't influence any types built by the middle-end + from now on (like gcov_info_type). */ + maximum_field_alignment = initial_max_fld_align * BITS_PER_UNIT; ggc_protect_identifiers = false;