diff mbox

[hsa-branch,9/9] Fix another finalizer type complaint

Message ID E1btd8i-0002KX-Bj@eggs.gnu.org
State New
Headers show

Commit Message

Martin Jambor Oct. 10, 2016, 3:23 p.m. UTC
Hi,

the subsequent patch deals with a finalizer error issued when we ave a
register-register move of an HSAIL vector type.  Apparently, such a move
must obey the same rules as vector loads and stores.

Committed to the branch, queued for merge to trunk soon.
Thanks,

Martin

2016-10-03  Martin Jambor  <mjambor@suse.cz>

	* hsa-gen.c (hsa_build_append_simple_mov): Use mem_type_for_type.
---
 gcc/hsa-gen.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/gcc/hsa-gen.c b/gcc/hsa-gen.c
index fd0dbcd..0b25f66 100644
--- a/gcc/hsa-gen.c
+++ b/gcc/hsa-gen.c
@@ -2227,8 +2227,10 @@  hsa_reg_or_immed_for_gimple_op (tree op, hsa_bb *hbb)
 void
 hsa_build_append_simple_mov (hsa_op_reg *dest, hsa_op_base *src, hsa_bb *hbb)
 {
-  hsa_insn_basic *insn = new hsa_insn_basic (2, BRIG_OPCODE_MOV, dest->m_type,
-					     dest, src);
+  /* Moves of packed data between registers need to adhere to the same type
+     rules like when dealing with memory.  */
+  BrigType16_t tp = mem_type_for_type (dest->m_type);
+  hsa_insn_basic *insn = new hsa_insn_basic (2, BRIG_OPCODE_MOV, tp, dest, src);
   if (hsa_op_reg *sreg = dyn_cast <hsa_op_reg *> (src))
     gcc_assert (hsa_type_bit_size (dest->m_type)
 		== hsa_type_bit_size (sreg->m_type));