public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ilya Tocar <tocarip.intel@gmail.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>, Ilya Verbin <iverbin@gmail.com>
Subject: Re: [PATCH] Warn about unclosed pragma omp declare target.
Date: Thu, 26 Mar 2015 15:15:00 -0000	[thread overview]
Message-ID: <20150326151514.GA67658@msticlxl7.ims.intel.com> (raw)
In-Reply-To: <20150202120500.GN1746@tucnak.redhat.com>

On 02 Feb 13:05, Jakub Jelinek wrote:
> On Tue, Jul 29, 2014 at 06:45:01PM +0400, Ilya Tocar wrote:
> > Hi,
> > 
> > As discussed here in https://gcc.gnu.org/ml/gcc/2014-01/msg00189.html
> > Gcc should complain about pragma omp declare target without
> > corresponding pragma omp end declare target. This patch adds a warning
> > for those cases.
> > Bootstraps/passes make-check.
> > Ok for trunk?
> > 
> > ChangeLog:
> > 
> > 2014-07-29  Ilya Tocar  <ilya.tocar@intel.com>
> > 
> > 	* c-decl.c (omp_declare_target_location_stack): New.
> > 	* c-lang.h (omp_declare_target_location_stack): Declare.
> > 	* c-parser.c (warn_unclosed_pragma_omp_target): New.
> > 	(c_parser_translation_unit): Call it.
> > 	(c_parser_omp_declare_target): Remeber location.
> > 	(c_parser_omp_end_declare_target): Forget location.
> 
> Sorry for the long delay on this.
> Can you check what will happen if you have unclosed #pragma omp declare target
> in some header you precompile?  If you get the warning during the header
> compilation and then not during compilation using that PCH header,
> supposedly it might be fine and the patch might be ok as is.
>
I've completely forgot about PCH.
With them this patch fails with segfault.
Moreover even if I fix segfault, we will produce strange results for
something like:
#include "a.h"
#pragma omp end declare target
// some code
> 
> If we wanted to warn even on a.c, supposedly the vector would need to be
> marked for GC.
>
I've tried:

static GTY(()) vec<int,va_gc_atomic>
*omp_declare_target_location_stack;

However it fails with:

vec.h:1118: undefined reference to `gt_pch_nx(int&)'

But in ggc.h (included in c-parser.c) i see

gt_pch_nx (unsigned int)
{
}

So I'm not sure how to properly mark vector for PCH.

      reply	other threads:[~2015-03-26 15:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-29 15:14 Ilya Tocar
2014-08-15 12:27 ` Ilya Tocar
2014-10-02 13:38   ` [PING][PATCH] " Ilya Tocar
2014-10-20 15:53     ` Ilya Tocar
2014-10-30 15:40       ` [PING^2][PATCH] " Ilya Tocar
2014-11-06 12:27         ` [PING^3][PATCH] " Ilya Tocar
2014-11-19 13:48           ` [PING^4][PATCH] " Ilya Tocar
2014-12-04 12:19             ` [PING^5][PATCH] " Ilya Tocar
2015-01-11 21:55               ` Ilya Verbin
2015-02-02 12:05 ` [PATCH] " Jakub Jelinek
2015-03-26 15:15   ` Ilya Tocar [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150326151514.GA67658@msticlxl7.ims.intel.com \
    --to=tocarip.intel@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iverbin@gmail.com \
    --cc=jakub@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).