]> git.ipfire.org Git - thirdparty/gcc.git/commit
avoid alignment of static variables affecting stack's
authorjbeulich <jbeulich@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Dec 2015 15:53:24 +0000 (15:53 +0000)
committerjbeulich <jbeulich@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 11 Dec 2015 15:53:24 +0000 (15:53 +0000)
commit7c5f556750802b91d68cb7f5e548eb35a82eb224
treed77f563c2a5cfa28caccef30637717356cd82991
parent51b47129f3d83426249266b9e254fec4086fa67f
avoid alignment of static variables affecting stack's

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.

gcc/
2015-12-11  Jan Beulich  <jbeulich@suse.com>

* cfgexpand.c (expand_one_var): Exit early for static and
external variables when adjusting stack alignment related.

gcc/testsuite/
2015-12-11  Jan Beulich  <jbeulich@suse.com>

* gcc.c-torture/execute/stkalign.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231569 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/cfgexpand.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/stkalign.c [new file with mode: 0644]