From: Jakub Jelinek <jakub@redhat.com>
To: Lewis Hyatt <lhyatt@gmail.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] preprocessor: Don't register pragmas in directives-only mode [PR108244]
Date: Wed, 11 Jan 2023 20:26:51 +0100 [thread overview]
Message-ID: <Y78Ne8DbBJ77sTUT@tucnak> (raw)
In-Reply-To: <acc46419f69db826cab8742ecd967308584848c3.1672420755.git.lhyatt@gmail.com>
On Fri, Dec 30, 2022 at 12:21:37PM -0500, Lewis Hyatt via Gcc-patches wrote:
> libcpp's directives-only mode does not expect deferred pragmas to be
> registered, but to date the c-family registration process has not checked for
> this case. That issue became more visible since r13-1544, which added the
> commonly used GCC diagnostic pragmas to the set of those registered in
> preprocessing modes. Fix it by checking for directives-only mode in
> c-family/c-pragma.cc.
>
> gcc/c-family/ChangeLog:
>
> PR preprocessor/108244
> * c-pragma.cc (c_register_pragma_1): Don't attempt to register any
> deferred pragmas if -fdirectives-only.
> (init_pragma): Likewise.
>
> gcc/testsuite/ChangeLog:
>
> * c-c++-common/cpp/pr108244-1.c: New test.
> * c-c++-common/cpp/pr108244-2.c: New test.
> * c-c++-common/cpp/pr108244-3.c: New test.
Ok, with a nit:
> --- /dev/null
> +++ b/gcc/testsuite/c-c++-common/cpp/pr108244-3.c
> @@ -0,0 +1,6 @@
> +/* { dg-do preprocess } */
> +/* { dg-additional-options "-fdirectives-only -fopenmp" } */
> +/* { dg-require-effective-target "fopenmp" } */
> +#pragma omp parallel
> +#ifdef t
> +#endif
This test should be in gcc/testsuite/c-c++-common/gomp/
directory instead, without the dg-require-effective-target.
Jakub
prev parent reply other threads:[~2023-01-11 19:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-30 17:21 Lewis Hyatt
2023-01-11 19:26 ` Jakub Jelinek [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=Y78Ne8DbBJ77sTUT@tucnak \
--to=jakub@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=lhyatt@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).