This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch i386]: Fix PR 56807
- From: Kai Tietz <ktietz70 at googlemail dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 16 Dec 2013 20:16:43 +0100
- Subject: Re: [patch i386]: Fix PR 56807
- Authentication-results: sourceware.org; auth=none
- References: <CAEwic4YRnyDhML9GYvM1+OyrTdX+-F4HagKJWyfjDnNhLkM4wQ at mail dot gmail dot com> <20131216181354 dot GS892 at tucnak dot redhat dot com>
2013/12/16 Jakub Jelinek <jakub@redhat.com>:
> On Fri, Dec 06, 2013 at 06:06:14PM +0100, Kai Tietz wrote:
>> --- config/i386/i386.c (Revision 205719)
>> +++ config/i386/i386.c (Arbeitskopie)
>> @@ -10934,18 +10937,21 @@ ix86_expand_prologue (void)
>> }
>> m->fs.sp_offset += allocate;
>>
>> + /* Use stack_pointer_rtx for relative addressing so that code
>> + works for realigned stack, too. */
>> if (r10_live && eax_live)
>> {
>> - t = choose_baseaddr (m->fs.sp_offset - allocate);
>> + t = plus_constant (Pmode, stack_pointer_rtx, allocate);
>> emit_move_insn (gen_rtx_REG (word_mode, R10_REG),
>> gen_frame_mem (word_mode, t));
>> - t = choose_baseaddr (m->fs.sp_offset - allocate - UNITS_PER_WORD);
>> + t = plus_constant (Pmode, stack_pointer_rtx,
>> + allocate - UNITS_PER_WORD);
>
> Somebody just asked on IRC whether this shouldn't have been
> allocate + UNITS_PER_WORD.
Well, I had over weekend same discussion on irc. AFAIR it was BugMaster ...
and yes, in the case (for x86_64 possible only) that r10_live and
eax_live there seems to be a bug.
The addressing of save-region for r10, which is saved after rax, is
correct. The restore-address of rax is wrong. It should be
t = plus_constant (Pmode, stack_pointer_rtx,
allocate + UNITS_PER_WORD);
instead.
> Dunno when would be eax_live true on x86_64 though (except for uninitialized
> var uses).
>
Kai