This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Retry to emit global variables in HSA (PR hsa/70234)


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]