Commit a0deb992 by Pekka Jääskeläinen Committed by Pekka Jääskeläinen

re PR other/79250 (brig/brigfrontend/brig-to-generic.cc: two small problems)

* 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

From-SVN: r245084
parent 405a7406
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> 2017-01-30 Jakub Jelinek <jakub@redhat.com>
* brigfrontend/brig-code-entry-handler.cc * brigfrontend/brig-code-entry-handler.cc
......
...@@ -456,9 +456,13 @@ brig_code_entry_handler::build_address_operand ...@@ -456,9 +456,13 @@ brig_code_entry_handler::build_address_operand
/* We might have two const offsets in case of group or private arrays /* We might have two const offsets in case of group or private arrays
which have the first offset to the incoming group/private pointer 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); 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); tree const_offset_2 = build_int_cst (size_type_node, offs);
if (addr == NULL_TREE) if (addr == NULL_TREE)
......
...@@ -71,7 +71,8 @@ brig_lane_inst_handler::operator () (const BrigBase *base) ...@@ -71,7 +71,8 @@ brig_lane_inst_handler::operator () (const BrigBase *base)
itself or 'identity' in case use_identity is 1. */ itself or 'identity' in case use_identity is 1. */
tree cmp = build2 (EQ_EXPR, uint32_type_node, 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); expr = build3 (COND_EXPR, TREE_TYPE (src), cmp, identity, src);
} }
......
...@@ -351,7 +351,7 @@ brig_to_generic::add_global_variable (const std::string &name, tree var_decl) ...@@ -351,7 +351,7 @@ brig_to_generic::add_global_variable (const std::string &name, tree var_decl)
std::string host_def_var_name std::string host_def_var_name
= std::string (PHSA_HOST_DEF_PTR_PREFIX) + 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) if (host_def_var == NULL_TREE)
return; return;
...@@ -681,6 +681,7 @@ call_builtin (tree pdecl, int nargs, tree rettype, ...) ...@@ -681,6 +681,7 @@ call_builtin (tree pdecl, int nargs, tree rettype, ...)
{ {
delete[] types; delete[] types;
delete[] args; delete[] args;
va_end (ap);
return error_mark_node; return error_mark_node;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment