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] Tidy up locking for libgomp OpenACC entry points


On Wed, Apr 22, 2015 at 07:42:43PM +0100, Julian Brown wrote:
> @@ -120,25 +116,32 @@ acc_free (void *d)
>  {
>    splay_tree_key k;
>    struct goacc_thread *thr = goacc_thread ();
> +  struct gomp_device_descr *acc_dev = thr->dev;

IMHO you want to move this line after:

>  
>    if (!d)
>      return;
>  
>    assert (thr && thr->dev);

the assert.  Supposedly also the thr = line after the return; line,
no need to do it if returning early.  As gcc now defaults to -std=gnu11
for C, libgomp is written in C11 and you don't need to limit to C89 (and
even back then, it was compiled by gcc and thus you could use GNU
extensions, such as mixed declarations and code).

Otherwise, I have no problem with this going to trunk, if Thomas is ok with
it.

	Jakub


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