middle-end/95739 - fix vector condition IFN expansion

Message ID nycvar.YFH.7.76.2006181447030.4397@zhemvz.fhfr.qr
State New
Headers show
Series
  • middle-end/95739 - fix vector condition IFN expansion
Related show

Commit Message

Richard Biener June 18, 2020, 12:47 p.m.
This fixes the omission of moving the expansion result to the
target.

Bootstrapped and tested on x86_64-unknown-linux-gnu, fixes the
observed -m32 FAIL.

2020-06-18  Richard Biener  <rguenther@suse.de>

	PR middle-end/95739
	* internal-fn.c (expand_vect_cond_optab_fn): Move the result
	to the target if necessary.
	(expand_vect_cond_mask_optab_fn): Likewise.
---
 gcc/internal-fn.c | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.26.2

Comments

Martin Liška June 18, 2020, 12:48 p.m. | #1
On 6/18/20 2:47 PM, Richard Biener wrote:
> This fixes the omission of moving the expansion result to the

> target.


Thank you for the fix, it's new for me that this can happen.

Martin

> 

> Bootstrapped and tested on x86_64-unknown-linux-gnu, fixes the

> observed -m32 FAIL.

> 

> 2020-06-18  Richard Biener  <rguenther@suse.de>

> 

> 	PR middle-end/95739

> 	* internal-fn.c (expand_vect_cond_optab_fn): Move the result

> 	to the target if necessary.

> 	(expand_vect_cond_mask_optab_fn): Likewise.

> ---

>   gcc/internal-fn.c | 4 ++++

>   1 file changed, 4 insertions(+)

> 

> diff --git a/gcc/internal-fn.c b/gcc/internal-fn.c

> index 644f234e087..2329e3db22f 100644

> --- a/gcc/internal-fn.c

> +++ b/gcc/internal-fn.c

> @@ -2589,6 +2589,8 @@ expand_vect_cond_optab_fn (internal_fn, gcall *stmt, convert_optab optab)

>     create_fixed_operand (&ops[4], XEXP (comparison, 0));

>     create_fixed_operand (&ops[5], XEXP (comparison, 1));

>     expand_insn (icode, 6, ops);

> +  if (!rtx_equal_p (ops[0].value, target))

> +    emit_move_insn (target, ops[0].value);

>   }

>   

>   #define expand_vec_cond_optab_fn expand_vect_cond_optab_fn

> @@ -2629,6 +2631,8 @@ expand_vect_cond_mask_optab_fn (internal_fn, gcall *stmt, convert_optab optab)

>     create_input_operand (&ops[2], rtx_op2, mode);

>     create_input_operand (&ops[3], mask, mask_mode);

>     expand_insn (icode, 4, ops);

> +  if (!rtx_equal_p (ops[0].value, target))

> +    emit_move_insn (target, ops[0].value);

>   }

>   

>   #define expand_vec_cond_mask_optab_fn expand_vect_cond_mask_optab_fn

>

Patch

diff --git a/gcc/internal-fn.c b/gcc/internal-fn.c
index 644f234e087..2329e3db22f 100644
--- a/gcc/internal-fn.c
+++ b/gcc/internal-fn.c
@@ -2589,6 +2589,8 @@  expand_vect_cond_optab_fn (internal_fn, gcall *stmt, convert_optab optab)
   create_fixed_operand (&ops[4], XEXP (comparison, 0));
   create_fixed_operand (&ops[5], XEXP (comparison, 1));
   expand_insn (icode, 6, ops);
+  if (!rtx_equal_p (ops[0].value, target))
+    emit_move_insn (target, ops[0].value);
 }
 
 #define expand_vec_cond_optab_fn expand_vect_cond_optab_fn
@@ -2629,6 +2631,8 @@  expand_vect_cond_mask_optab_fn (internal_fn, gcall *stmt, convert_optab optab)
   create_input_operand (&ops[2], rtx_op2, mode);
   create_input_operand (&ops[3], mask, mask_mode);
   expand_insn (icode, 4, ops);
+  if (!rtx_equal_p (ops[0].value, target))
+    emit_move_insn (target, ops[0].value);
 }
 
 #define expand_vec_cond_mask_optab_fn expand_vect_cond_mask_optab_fn