This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: PR target/59363: [4.9 Regression] r203886 miscompiles git
- From: Michael Zolotukhin <michael dot v dot zolotukhin at gmail dot com>
- To: Uros Bizjak <ubizjak at gmail dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Date: Tue, 3 Dec 2013 12:45:37 +0400
- Subject: Re: PATCH: PR target/59363: [4.9 Regression] r203886 miscompiles git
- Authentication-results: sourceware.org; auth=none
- References: <20131203010536 dot GA10039 at intel dot com> <CAFULd4ZgmC81w-34E4QNW-uCTyunOvBHRF55Dej=TzuawUkAsw at mail dot gmail dot com>
Hi Uros, HJ,
I checked expand_movmem_epilogue - it seemingly doesn't have such a
problem, so the patch is ok.
We might want to add similar adjust_automodify_address_nv call to here as well:
if (TARGET_64BIT)
{
dest = change_address (destmem, DImode, destptr);
emit_insn (gen_strset (destptr, dest, value));
emit_insn (gen_strset (destptr, dest, value));
}
else
{
dest = change_address (destmem, SImode, destptr);
emit_insn (gen_strset (destptr, dest, value));
emit_insn (gen_strset (destptr, dest, value));
emit_insn (gen_strset (destptr, dest, value));
emit_insn (gen_strset (destptr, dest, value));
}
(code snippet from previous HJ's comment in bugzilla).
I think it's needed here, but I didn't manage to exploit the bug in
this code. Maybe Uros or Jan can comment whether it's needed in such
code or not.
Thanks,
Michael
On 3 December 2013 12:11, Uros Bizjak <ubizjak@gmail.com> wrote:
> On Tue, Dec 3, 2013 at 2:05 AM, H.J. Lu <hongjiu.lu@intel.com> wrote:
>
>> emit_memset fails to adjust destination address after gen_strset, which
>> leads to the wrong address in aliasing info. This patch fixes it.
>> Tested on Linux/x86-64. OK to install?
>>
>> 2013-12-03 H.J. Lu <hongjiu.lu@intel.com>
>>
>> PR target/59363
>> * config/i386/i386.c (emit_memset): Adjust destination address
>> after gen_strset.
>>
>> gcc/testsuite/
>>
>> 2013-12-03 H.J. Lu <hongjiu.lu@intel.com>
>>
>> PR target/59363
>> * gcc.target/i386/pr59363.c: New file.
>
> OK, but according to [1], there are other places where similar issues
> should be fixed. I propose to wait for Michael's analysis and eventual
> patch, and fix them all together.
>
> [1] http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59363#c21
>
> Thanks,
> Uros.
--
---
Best regards,
Michael V. Zolotukhin,
Software Engineer
Intel Corporation.