+2016-02-01 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
+
+ * brigfrontend/brig-code-entry-handler.cc: fix address
+ expressions which refer only to offset 0, but nothing else.
+ * brigfrontend/brig-lane-inst-handler.cc: fix
+ activelanepermute_b64 HSAIL instruction.
+ * brigfrontend/brig-to-generic.cc: remove useless c_str()
+ call. Add missing va_end (). Fix PR79250.
+
2017-01-30 Jakub Jelinek <jakub@redhat.com>
* brigfrontend/brig-code-entry-handler.cc
/* We might have two const offsets in case of group or private arrays
which have the first offset to the incoming group/private pointer
- arg, and the second one an offset to it. */
+ arg, and the second one an offset to it. It's also legal to have
+ a reference with a zero constant offset but no symbol. I've seen
+ codes that reference kernarg segment like this. Thus, if at this
+ point there is no address expression at all we assume it's an
+ access to offset 0. */
uint64_t offs = gccbrig_to_uint64_t (addr_operand.offset);
- if (offs > 0)
+ if (offs > 0 || addr == NULL_TREE)
{
tree const_offset_2 = build_int_cst (size_type_node, offs);
if (addr == NULL_TREE)
itself or 'identity' in case use_identity is 1. */
tree cmp = build2 (EQ_EXPR, uint32_type_node,
- build_int_cstu (uint32_type_node, 1), use_identity);
+ build_int_cstu (TREE_TYPE (use_identity), 1),
+ use_identity);
expr = build3 (COND_EXPR, TREE_TYPE (src), cmp, identity, src);
}
std::string host_def_var_name
= std::string (PHSA_HOST_DEF_PTR_PREFIX) + name;
- tree host_def_var = global_variable (host_def_var_name.c_str ());
+ tree host_def_var = global_variable (host_def_var_name);
if (host_def_var == NULL_TREE)
return;
{
delete[] types;
delete[] args;
+ va_end (ap);
return error_mark_node;
}
}