public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Kyrill Tkachov <kyrylo.tkachov@arm.com>
To: Bernd Schmidt <bschmidt@redhat.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Jeff Law <law@redhat.com>
Subject: Re: [PATCH][RTL-ree] PR rtl-optimization/68194: Restrict copy instruction in presence of conditional moves
Date: Tue, 24 Nov 2015 13:33:00 -0000	[thread overview]
Message-ID: <565462EE.8080905@arm.com> (raw)
In-Reply-To: <56532CE0.9050802@arm.com>


On 23/11/15 15:12, Kyrill Tkachov wrote:
> Hi Bernd,
>
> On 20/11/15 01:41, Bernd Schmidt wrote:
>>>> I1 is def_insn, I3 is cand->insn. tmp_reg is 'ax'. What we want to do
>>>> is reject this transformation
>>>> because the destination of def_insn (aka I1), that is 'ax', is not the
>>>> operand of the extend operation
>>>> in cand->insn (aka I3). As you said, rtx_equal won't work on just
>>>> SET_SRC (PATTERN (cand->insn)) because
>>>> it's an extend operation. So reg_overlap_mentioned should be appropriate.
>>
>> Yeah, so just use the src_reg variable for the comparison. I still don't see why you wouldn't want to use the stronger test. But the whole thing still feels not completely ideal somehow, so after reading through ree.c for a while and 
>> getting a better feeling for how it works, I think the following (which you said is equivalent) would be the most understandable and direct fix.
>>
>> You said that the two tests should be equivalent, and I agree. I've not found cases where the change makes a difference, other than the testcase. Would you mind running this version through the testsuite and committing if it passes?
>>
>> I've shrunk the comment; massive explanations like this for every bug are inappropriate IMO, and the example also duplicates an earlier comment in the same function. And, as I said earlier, the way you placed the comment is confusing 
>> because only one part of the following if statement is related to it.
>>
>
> Thanks for the comments, here is the final patch that I'll be committing.
> It passed testing on arm, aarch64, x86_64.
>

I've committed this as r230795 .
This bug also affects GCC 5 and 4.9. I've confirmed that this patch fixes the miscompilations on those branches.
Bootstrap and test on x86_64 on the GCC 5 branch is successful. Same on 4.9 is ongoing.
The patch applies cleanly to all branches.
So ok to backport to the active branches if 4.9 testing comes back clean?

Thanks,
Kyrill

>
>
> 2015-11-23  Bernd Schmidt <bschmidt@redhat.com>
>             Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>
>     PR rtl-optimization/68194
>     PR rtl-optimization/68328
>     PR rtl-optimization/68185
>     * ree.c (combine_reaching_defs): Reject copy_needed case if
>     copies_list is not empty.
>
> 2015-11-23  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
>
>     PR rtl-optimization/68194
>     * gcc.c-torture/execute/pr68185.c: Likewise.
>     * gcc.c-torture/execute/pr68328.c: Likewise.
>
>
>>
>> Bernd
>

  reply	other threads:[~2015-11-24 13:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 14:08 Kyrill Tkachov
2015-11-16 18:41 ` Bernd Schmidt
2015-11-17  9:08   ` Kyrill Tkachov
2015-11-17  9:49     ` Kyrill Tkachov
2015-11-17 10:17       ` Kyrill Tkachov
2015-11-17 12:10     ` Bernd Schmidt
2015-11-17 13:03       ` Kyrill Tkachov
2015-11-17 23:11         ` Bernd Schmidt
2015-11-18  9:11           ` Kyrill Tkachov
2015-11-19 10:28             ` Kyrill Tkachov
2015-11-20  1:41               ` Bernd Schmidt
2015-11-20  9:16                 ` Kyrill Tkachov
2015-11-23 15:12                 ` Kyrill Tkachov
2015-11-24 13:33                   ` Kyrill Tkachov [this message]
2015-11-24 13:42                     ` Bernd Schmidt

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=565462EE.8080905@arm.com \
    --to=kyrylo.tkachov@arm.com \
    --cc=bschmidt@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=law@redhat.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).