public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Jan Beulich <JBeulich@suse.com>, hjl.tools@gmail.com
Cc: gcc-patches@gcc.gnu.org
Subject: Re: avoid alignment of static variables affecting stack's
Date: Thu, 23 Oct 2014 06:54:00 -0000	[thread overview]
Message-ID: <20141023065015.GX10376@tucnak.redhat.com> (raw)
In-Reply-To: <5448BCA30200007800041508@mail.emea.novell.com>

On Thu, Oct 23, 2014 at 07:30:27AM +0100, 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.

If the static/external var has BLKmode, then perhaps it is safe, but I
wonder about other vars, say vectors etc.  Such vars are most likely
loaded from their memory location, and if for some reason that needs to be
spilled again, stack realignment would not be able to do that.
Or do we inspect the IL and for any pseudos with modes needing larger
alignment we adjust the dynamic stack realignment fields?

	Jakub

  reply	other threads:[~2014-10-23  6:50 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23  6:50 Jan Beulich
2014-10-23  6:54 ` Jakub Jelinek [this message]
2014-10-23  7:11   ` Jan Beulich
2014-10-23 18:14     ` Jeff Law
2014-10-24  9:11       ` Jan Beulich
2014-10-24  9:12         ` Richard Biener
2014-10-24  9:18           ` Jan Beulich
2014-10-24  9:19           ` Jakub Jelinek
2014-10-24  9:54             ` Richard Biener
2014-10-24 10:16               ` Jan Beulich
2014-10-24 10:42                 ` Richard Biener
2014-10-24 16:42                 ` Jeff Law

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=20141023065015.GX10376@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=JBeulich@suse.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    /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).