public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "vries at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/50527] inconsistent vla align
Date: Tue, 27 Sep 2011 09:29:00 -0000	[thread overview]
Message-ID: <bug-50527-4-KAdgMox8Pu@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-50527-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50527

--- Comment #3 from vries at gcc dot gnu.org 2011-09-27 09:21:12 UTC ---
> Or alternatively (given we re-compute alignment together with folding alloca),
> assign the same alignment as folding would.

At the point that we determine the alloca alignment during propagation in
visit_stmt, we cannot predict whether that alloca will be folded (during the
same or later ccp phase).

So the only way to achieve other alignment is to be conservative a bit longer
for vla-allocas with respect to alignment:
- keep align at 1 byte during ccp.
- if we fold during ccp, assign align calculated at folding
- after we are sure there is no more folding (at expand, or f.i. at the end of
  the second ccp phase if we limit folding to the first 2 ccp phases, to take
  advantage of the larger alignment in the middle-end), we assign
  BIGGEST_ALIGNMENT.

> The question is of course what standards say about the alignment of
> alloca (4)

I think alloca is non-standard. But in the context of
fold_builtin_alloca_for_var, alloca is the implementation vehicle of vlas, so
the question is what the standard says about alignment of vlas.


  parent reply	other threads:[~2011-09-27  9:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-26 14:48 [Bug middle-end/50527] New: " vries at gcc dot gnu.org
2011-09-26 15:13 ` [Bug middle-end/50527] " rguenth at gcc dot gnu.org
2011-09-26 15:30 ` rguenth at gcc dot gnu.org
2011-09-27  9:29 ` vries at gcc dot gnu.org [this message]
2011-09-27 10:06 ` vries at gcc dot gnu.org
2011-09-27 10:08 ` rguenther at suse dot de
2011-09-27 11:11 ` vries at gcc dot gnu.org
2011-09-27 11:25 ` rguenther at suse dot de
2011-09-27 13:47 ` vries at gcc dot gnu.org
2011-10-07 12:50 ` vries at gcc dot gnu.org
2011-10-07 12:51 ` vries at gcc dot gnu.org
2011-10-07 13:38 ` vries at gcc dot gnu.org
2011-10-13 11:10 ` vries at gcc dot gnu.org
2011-10-13 11:18 ` vries at gcc dot gnu.org

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=bug-50527-4-KAdgMox8Pu@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).