diff options
author | Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com> | 2017-02-01 10:06:13 +0000 |
---|---|---|
committer | Pekka Jääskeläinen <visit0r@gcc.gnu.org> | 2017-02-01 10:06:13 +0000 |
commit | a0deb9925478be3738a87f40902c829d867f8f79 (patch) | |
tree | f25d50266cf54a08e2d280228d14be91fbd045b7 /gcc/brig | |
parent | 405a740640530a3c93ef68089cb185083e4df890 (diff) | |
download | gcc-a0deb9925478be3738a87f40902c829d867f8f79.zip gcc-a0deb9925478be3738a87f40902c829d867f8f79.tar.gz gcc-a0deb9925478be3738a87f40902c829d867f8f79.tar.bz2 |
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
Diffstat (limited to 'gcc/brig')
-rw-r--r-- | gcc/brig/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/brig/brigfrontend/brig-code-entry-handler.cc | 8 | ||||
-rw-r--r-- | gcc/brig/brigfrontend/brig-lane-inst-handler.cc | 3 | ||||
-rw-r--r-- | gcc/brig/brigfrontend/brig-to-generic.cc | 3 |
4 files changed, 19 insertions, 4 deletions
diff --git a/gcc/brig/ChangeLog b/gcc/brig/ChangeLog index 79035a2..9f9a27e 100644 --- a/gcc/brig/ChangeLog +++ b/gcc/brig/ChangeLog @@ -1,3 +1,12 @@ +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 diff --git a/gcc/brig/brigfrontend/brig-code-entry-handler.cc b/gcc/brig/brigfrontend/brig-code-entry-handler.cc index eb32c51..08e49f9 100644 --- a/gcc/brig/brigfrontend/brig-code-entry-handler.cc +++ b/gcc/brig/brigfrontend/brig-code-entry-handler.cc @@ -456,9 +456,13 @@ brig_code_entry_handler::build_address_operand /* 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) diff --git a/gcc/brig/brigfrontend/brig-lane-inst-handler.cc b/gcc/brig/brigfrontend/brig-lane-inst-handler.cc index bc85c03..c81ee6a 100644 --- a/gcc/brig/brigfrontend/brig-lane-inst-handler.cc +++ b/gcc/brig/brigfrontend/brig-lane-inst-handler.cc @@ -71,7 +71,8 @@ brig_lane_inst_handler::operator () (const BrigBase *base) 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); } diff --git a/gcc/brig/brigfrontend/brig-to-generic.cc b/gcc/brig/brigfrontend/brig-to-generic.cc index 1672158..d113bdc 100644 --- a/gcc/brig/brigfrontend/brig-to-generic.cc +++ b/gcc/brig/brigfrontend/brig-to-generic.cc @@ -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 (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; @@ -681,6 +681,7 @@ call_builtin (tree pdecl, int nargs, tree rettype, ...) { delete[] types; delete[] args; + va_end (ap); return error_mark_node; } } |