public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ilya Tocar <tocarip.intel@gmail.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: Mon, 02 Feb 2015 12:05:00 -0000	[thread overview]
Message-ID: <20150202120500.GN1746@tucnak.redhat.com> (raw)
In-Reply-To: <20140729144501.GA102135@msticlxl7.ims.intel.com>

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 mean something like
a.h:
#pragma omp declare target
int i;
a.c:
#include "a.c"

#pragma omp declare target
int j;
#pragma omp declare target
int k;

int
main ()
{
}
gcc -fopenmp -o a.gch a.h
gcc -fopenmp -o a a.c

If we wanted to warn even on a.c, supposedly the vector would need to be
marked for GC.

	Jakub

  parent reply	other threads:[~2015-02-02 12:05 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 ` Jakub Jelinek [this message]
2015-03-26 15:15   ` [PATCH] " Ilya Tocar

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=20150202120500.GN1746@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=iverbin@gmail.com \
    --cc=tocarip.intel@gmail.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).