public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <richard.guenther@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: Ian Lance Taylor <iant@google.com>,
	Uros Bizjak <ubizjak@gmail.com>,
	gcc-patches@gcc.gnu.org,  	Jakub Jelinek <jakub@redhat.com>
Subject: Re: PATCH: PR target/40838: gcc shouldn't assume that the stack is  	aligned
Date: Sat, 17 Oct 2009 19:29:00 -0000	[thread overview]
Message-ID: <84fc9c000910171220l1bb7668q7d597061ea9a5eb5@mail.gmail.com> (raw)
In-Reply-To: <6dc9ffc80910171202n34b6403fm9fe90fe1af3480d5@mail.gmail.com>

On Sat, Oct 17, 2009 at 9:02 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Sat, Oct 17, 2009 at 11:51 AM, Richard Guenther
> <richard.guenther@gmail.com> wrote:
>> On Sat, Oct 17, 2009 at 8:14 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>> On Fri, Oct 16, 2009 at 5:59 PM, Ian Lance Taylor <iant@google.com> wrote:
>>>> "H.J. Lu" <hjl.tools@gmail.com> writes:
>>>>
>>>>> @@ -947,6 +949,12 @@ vect_verify_datarefs_alignment (loop_vec_info loop_vinfo, bb_vec_info bb_vinfo)
>>>>>              }
>>>>>            return false;
>>>>>          }
>>>>> +
>>>>> +      mode = TYPE_MODE (STMT_VINFO_VECTYPE (stmt_info));
>>>>> +      align = GET_MODE_ALIGNMENT (mode);
>>>>> +      if (cfun->hard_stack_alignment < align)
>>>>> +     cfun->hard_stack_alignment = align;
>>>>> +
>>>>>        if (supportable_dr_alignment != dr_aligned
>>>>>            && vect_print_dump_info (REPORT_ALIGNMENT))
>>>>>          fprintf (vect_dump, "Vectorizing an unaligned access.");
>>>>
>>>> I do not understand why this is the right place to set your new cfun
>>>> field.  Your patch is about a misaligned stack.  The code you are
>>>> changing here does not appear to have anything to do with a misaligned
>>>> stack.  This code is about the correct alignment of data.  The data
>>>> may be on the stack but it need not be.  If the data is on the stack,
>>>> then the compiler should be able to determine the alignment available
>>>> on the stack.
>>>
>>> The issue here is to set proper incoming stack alignment. We have
>>> to do it before RTL expansion which uses this information to check
>>> if stack alignment is needed. To do that, we need to know what the
>>> minimum stack alignment required by hardware. We collect hard
>>> stack alignment when we put variables on stack and check the alignment
>>> generated by vectorizer.
>>
>> It's surely not the right function to do this.  Nor is it a proper
>> interface IMHO.
>> Why don't you need to check whether the access is to stack memory at all?
>>
>> I think you want to instead see if any user-alignment on automatic
>> variables requires stack realignment.  Thus, wherever the vectorizer
>> sets DECL_USER_ALIGN on automatic storage.
>>
>
> RTL expansion may generate automatic variables from vectorizer
> statements while vectorizer doesn't generate any automatic variables
> at all. How should I handle this case?

The same way you would handle spills or you would handle user code
using intrinsics.  I don't see how the vectorizer is special.

Richard.

>
> --
> H.J.
>

  reply	other threads:[~2009-10-17 19:21 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-06 21:42 H.J. Lu
2009-08-06 22:26 ` Jakub Jelinek
2009-08-06 22:52   ` H.J. Lu
2009-10-15 15:58 ` H.J. Lu
2009-10-15 18:45   ` Uros Bizjak
2009-10-15 19:22     ` H.J. Lu
2009-10-15 19:32       ` Uros Bizjak
2009-10-15 19:43         ` H.J. Lu
2009-10-15 19:48           ` Jakub Jelinek
2009-10-15 20:11             ` H.J. Lu
2009-10-15 19:53           ` Uros Bizjak
2009-10-15 21:01             ` H.J. Lu
2009-10-15 21:41               ` Uros Bizjak
2009-10-16 20:27     ` H.J. Lu
2009-10-17  1:03       ` Ian Lance Taylor
2009-10-17 18:22         ` H.J. Lu
2009-10-17 19:02           ` Richard Guenther
2009-10-17 19:21             ` H.J. Lu
2009-10-17 19:29               ` Richard Guenther [this message]
2009-10-17 19:35                 ` H.J. Lu
2009-10-17 19:46                   ` Richard Guenther
2009-10-17 20:01                     ` H.J. Lu
2009-10-17 20:59                       ` Richard Guenther
2009-10-18 19:21                         ` Michael Matz
2009-10-18 19:45                           ` Richard Guenther
2009-10-19 16:36                             ` H.J. Lu
2009-10-20  1:12                               ` Michael Matz
2009-10-20 19:10                                 ` H.J. Lu
2009-10-19 16:38                           ` H.J. Lu
2009-10-19 17:08                             ` Ian Lance Taylor
2009-10-19 17:26                               ` H.J. Lu
2009-10-19 17:33                                 ` Ian Lance Taylor
2009-10-19 17:46                                   ` H.J. Lu
2009-10-19 17:55                                     ` Ian Lance Taylor
2009-10-19 19:16                                       ` H.J. Lu
2009-10-19 21:15                                         ` Ian Lance Taylor
2009-10-20 19:00                                           ` H.J. Lu
2009-10-20  1:23                                         ` Michael Matz
2009-10-20 19:12                                           ` H.J. Lu
2009-10-20  1:53                             ` Michael Matz
2009-10-20 21:15                               ` H.J. Lu
2009-10-21  1:10                                 ` H.J. Lu
2009-10-21  9:54                                   ` Michael Matz
2009-10-21 16:56                                     ` H.J. Lu
2009-10-30 10:08                                       ` Richard Guenther
2009-10-17  7:09       ` Uros Bizjak
2009-08-07  0:54 Mikulas Patocka
2009-08-07  7:13 ` Jakub Jelinek
2009-08-07 12:53   ` H.J. Lu
2009-08-07 22:30     ` H.J. Lu
2009-08-08 17:35       ` Mikulas Patocka
2009-08-16 21:25         ` H.J. Lu
2009-08-24 17:39       ` H.J. Lu
2009-09-12 23:32         ` Mikulas Patocka
2009-09-12 23:42           ` Mikulas Patocka
2009-09-13  1:55           ` H.J. Lu
2009-09-13 14:10             ` Mikulas Patocka
2009-08-07 21:08   ` Mikulas Patocka
2009-08-07 21:25     ` Richard Guenther

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=84fc9c000910171220l1bb7668q7d597061ea9a5eb5@mail.gmail.com \
    --to=richard.guenther@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=iant@google.com \
    --cc=jakub@redhat.com \
    --cc=ubizjak@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).