This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][RTL-ifcvt] PR rtl-optimization/68506: Fix emitting order of insns in IF-THEN-JOIN case
- From: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- To: Bernd Schmidt <bschmidt at redhat dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 26 Nov 2015 13:52:42 +0000
- Subject: Re: [PATCH][RTL-ifcvt] PR rtl-optimization/68506: Fix emitting order of insns in IF-THEN-JOIN case
- Authentication-results: sourceware.org; auth=none
- References: <5656E924 dot 4030603 at arm dot com> <56570BDB dot 9070804 at redhat dot com>
On 26/11/15 13:40, Bernd Schmidt wrote:
On 11/26/2015 12:12 PM, Kyrill Tkachov wrote:
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index af7a3b9..3e3dc8d 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -2220,7 +2220,7 @@ noce_try_cmove_arith (struct noce_if_info *if_info)
}
}
- if (emit_a && modified_in_a)
+ if (emit_a || modified_in_a)
{
Having stared at it in the debugger for a while, I think I managed to convince myself that this is correct. So, OK.
Thanks.
A few other comments. This whole if block is indented too far, please fix while you're there. Also eliminate the unnecessary blank lines before closing braces (two instances inside this if block). There are other formatting errors in this
function, but those are best left alone for now.
Ok, I'll fix the indentation in that if-else block
modified_in_b = emit_b != NULL_RTX && modified_in_p (orig_a, emit_b);
Can this ever be true? We arrange for emit_b to set a new pseudo, don't we? Are we allowing cases where we copy a pattern that sets more than one register, and is that safe?
You're right, this statement always sets modifieb_in_b to false. We reject anything bug single_set insns
by this point in the code. I'll replace that with modified_in_b = false;
Thanks,
Kyrill
Bernd