This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: PR target/40838: gcc shouldn't assume that the stack is aligned


"H.J. Lu" <hjl.tools@gmail.com> writes:

> On Mon, Oct 19, 2009 at 10:05 AM, Ian Lance Taylor <iant@google.com> wrote:
>> "H.J. Lu" <hjl.tools@gmail.com> writes:
>>
>>> Vectorizer may not call assign_*_temp at all. Instead, x86 backend
>>> may call gen_reg_rtx to generate pseudo registers when expanding
>>> vector statement.
>>
>> It simply does not make sense to change the vectorizer, of all things,
>> to set the stack alignment. ÂStack alignment depends upon the
>> types/modes of automatic variables stored on the stack. ÂTherefore,
>> you should set the required stack alignment based on the creation of
>> automatic variables. ÂIdeally you would set the required stack
>> alignment for automatic variables stored on the stack, but apparently
>> you can't change the stack alignment after expand (though I don't see
>> why not). ÂSo if you can't set the stack alignment based on automatic
>> variables stored on the stack, then you should set it based on the
>> creation of automatic variables.
>>
>
> It is about setting the incoming stack alignment, which has to be
> done before RTL expansion. Vectorizer may not use any automatic
> variables. But the RTL expander may generate pseudo vector registers
> based on vector statement, at which time, it is too late to go back to
> change incoming stack alignment.  I only modified vectorizer to
> record what it does. I didn't change any statements generated by
> vectorizer. The x86 backend uses this information to set the
> incoming stack alignment before RTL expansion.

If somebody asked you "where does gcc set the required stack
alignment?" would you expect the answer to be "in the vectorizer
code?"

Is there any way we can fix incoming stack alignment so that it can be
controlled by automatic stack variables?  I don't understand why this
is not done by the prologue and epilogue code.

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]