This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [v4] avoid alignment of static variables affecting stack's
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Bernd Schmidt <bschmidt at redhat dot com>
- Cc: Jan Beulich <JBeulich at suse dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 14 Dec 2015 09:35:43 +0100
- Subject: Re: [v4] avoid alignment of static variables affecting stack's
- Authentication-results: sourceware.org; auth=none
- References: <566AE23802000078000BEAE4 at prv-mh dot provo dot novell dot com> <566AD588 dot 2020003 at redhat dot com>
On Fri, Dec 11, 2015 at 2:54 PM, Bernd Schmidt <bschmidt@redhat.com> wrote:
> On 12/11/2015 02:48 PM, Jan Beulich wrote:
>>
>> Function (or more narrow) scope static variables (as well as others not
>> placed on the stack) should also not have any effect on the stack
>> alignment. I noticed the issue first with Linux'es dynamic_pr_debug()
>> construct using an 8-byte aligned sub-file-scope local variable.
>>
>> According to my checking bad behavior started with 4.6.x (4.5.3 was
>> still okay), but generated code got quite a bit worse as of 4.9.0.
>>
>> [v4: Bail early, using is_global_var(), as requested by Bernd.]
>
>
> In case I haven't made it obvious, this is OK.
But I wonder if it makes sense because shortly after the early-out we check
if (TREE_STATIC (var)
|| DECL_EXTERNAL (var)
|| (TREE_CODE (origvar) == SSA_NAME && use_register_for_decl (var)))
so either there are obvious cleanup opportunities left or the patch is broken.
Richard.
>
> Bernd