public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Michael Matz <matz@suse.de>
Cc: Richard Guenther <richard.guenther@gmail.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: PATCH: PR middle-end/48608: Alignment adjust of local variables is lost
Date: Thu, 14 Apr 2011 15:48:00 -0000	[thread overview]
Message-ID: <BANLkTi=p4eoyxFxj4JTXNWcfZyONLTnWjA@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.64.1104141721300.1989@wotan.suse.de>

On Thu, Apr 14, 2011 at 8:26 AM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> On Thu, 14 Apr 2011, Richard Guenther wrote:
>
>> > +  if (align > DECL_ALIGN (decl))
>> > +    DECL_ALIGN (decl) = align;
>>
>> Shouldn't this unconditionally set DECL_ALIGN in case
>> LOCAL_DECL_ALINGMENT returns something smaller?
>
> Decreasing alignment of DECLs points to a problem elsewhere, so perhaps an
> assert that this doesn't happen is better.  Decreasing is a problem
> because it's not conservative: there might have been code generated
> already assuming the once larger alignment that then possibly breaks if it
> turns out the alignment is actually smaller.

ia32 may decrease local variable alignment:

  /* Don't do dynamic stack realignment for long long objects with
     -mpreferred-stack-boundary=2.  */
  if (!TARGET_64BIT
      && align == 64
      && ix86_preferred_stack_boundary < 64
      && (mode == DImode || (type && TYPE_MODE (type) == DImode))
      && (!type || !TYPE_USER_ALIGN (type))
      && (!decl || !DECL_USER_ALIGN (decl)))
    align = 32;

I am running bootstrap/test on Linux/x86-64 and Linux/ia32.

-- 
H.J.

  reply	other threads:[~2011-04-14 15:48 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-14 13:34 H.J. Lu
2011-04-14 13:57 ` Richard Guenther
2011-04-14 14:01   ` H.J. Lu
2011-04-14 14:09     ` Richard Guenther
2011-04-14 14:27       ` H.J. Lu
2011-04-14 14:30         ` Richard Guenther
2011-04-14 15:26           ` Michael Matz
2011-04-14 15:48             ` H.J. Lu [this message]
2011-04-14 15:57               ` Richard Guenther
2011-04-15 12:34               ` Michael Matz

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='BANLkTi=p4eoyxFxj4JTXNWcfZyONLTnWjA@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=matz@suse.de \
    --cc=richard.guenther@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).