On 03/17/2016 07:21 PM, Martin Jambor wrote: > Hopefully the linear search in m_global_symbols never becomes > prohibitively expensive. But it is only necessary when > is_in_global_vars is true, so at least we could do something like: > > if (is_in_global_vars && !sym->m_emitted_to_brig) > { > for (unsigned i = 0; i < hsa_cfun->m_global_symbols.length (); i++) > if (hsa_cfun->m_global_symbols[i] == sym) > return *slot; > hsa_cfun->m_global_symbols.safe_push (sym); > }
Hi Martin. I like the refactoring you did! > > OK with that change. And even though I have seen the bug only on the > hsa branch, commit the fix to trunk too, I think it can happen there > as well. Yes, it can happen in a situation where a pair of functions utilizes a global variable and HSA emission fails for the first one. Installed as r234362. Martin > > Thanks a lot, > > Martin