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]

Re: [PATCH] Fix PR66805 - #pragma pack affecting gcov_info_type layout


On Wed, Jul 08, 2015 at 01:58:38PM +0200, 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?
> 
> Thanks,
> Richard.
> 
> 2015-07-08  Richard Biener  <rguenther@suse.de>
> 
> 	* stor-layout.h (reset_maximum_field_alignment): Declare.
> 	* stor-layout.c (reset_maximum_field_alignment): New function.
> 	* toplev.c: Include stor-layout.h.
> 	(compile_file): Reset maximum_field_alignment after parsing.

toplev.c already sets maximum_field_alignment directly, and to a different
value:
maximum_field_alignment = initial_max_fld_align * BITS_PER_UNIT;
so I'm not sure you need a new function.  And, shouldn't you reset to
maximum_field_alignment = initial_max_fld_align * BITS_PER_UNIT;
?  -fpack-struct= is an ABI changing option, so IMHO it should affect
even gcov_info_type etc.

	Jakub


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