This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH v4] PR middle-end/60281
- From: lin zuojian <manjian2006 at gmail dot com>
- To: Bernd Edlinger <bernd dot edlinger at hotmail dot de>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Ramana Radhakrishnan <ramana dot gcc at googlemail dot com>, Jakub Jelinek <jakub at redhat dot com>
- Date: Sun, 2 Mar 2014 10:24:52 +0800
- Subject: Re: [PATCH v4] PR middle-end/60281
- Authentication-results: sourceware.org; auth=none
- References: <DUB129-W70398F7180A2386B725257E4820 at phx dot gbl> <53104188 dot 2040303 at gmail dot com> <53106F83 dot 30108 at gmail dot com> <DUB129-W7567CB53370333209B55B6E48D0 at phx dot gbl>
Hi Bernd,
set_mem_align is not working like magic.
set_mem_align just set the alignment of a memory rtx.And You must aware
that you do so because you are sure this rtx IS aligned like this.
For arm machines, the base the virtual registers are aligned to 8
bytes.You can't just set_mem_align to get_best_mode(),because this is
not the fact.If you do so,the unalign accessing is still there.My
realignment code make sure the base of virtual registers is aligned to
SImode,and so I can use that fact to set_mem_align.
In a word,set_mem_align does not generate realignment code for
STRICT_ALIGNMENT machines.
As you say that's not the best mode on all machines.But let's fix one
bug at a time.You are focusing too much in that mode.
> So, that is what I mean: this patch makes the stack grow by
> 32 bytes, just because the emit_stack_protection uses SImode,
> with unaligned addresses which is not possible for ARM, and
> not optimal for X86_64.
It's because of the realignment,as my comment said.I have to make room
for virtual registers's realignment,or they(or the spilled registers) will
get damaged by the other subroutine.
--
Regards
lin zuojian