This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Retry to emit global variables in HSA (PR hsa/70234)
- From: Martin LiÅka <mliska at suse dot cz>
- To: gcc-patches at gcc dot gnu dot org
- Cc: Martin Jambor <mjambor at suse dot cz>
- Date: Mon, 21 Mar 2016 11:28:16 +0100
- Subject: Re: [PATCH] Retry to emit global variables in HSA (PR hsa/70234)
- Authentication-results: sourceware.org; auth=none
- References: <56E7F907 dot 9090309 at suse dot cz> <20160317182140 dot GU9564 at virgil dot suse dot cz>
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