[PATCH][RTL-ifcvt] PR rtl-optimization/68506: Fix emitting order of insns in IF-THEN-JOIN case

Bernd Schmidt bschmidt@redhat.com
Thu Nov 26 13:50:00 GMT 2015


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.

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.

>   	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?


Bernd



More information about the Gcc-patches mailing list