From: Jakub Jelinek <jakub@redhat.com>
To: Tobias Burnus <tobias@codesourcery.com>
Cc: gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [Patch] OpenMP requires: Fix diagnostic filename corner case
Date: Wed, 17 Aug 2022 15:43:54 +0200 [thread overview]
Message-ID: <YvzwmqBCovvc30nv@tucnak> (raw)
In-Reply-To: <e63fb3d3-50a2-8c31-9648-506fad70499e@codesourcery.com>
On Fri, Jul 22, 2022 at 12:38:31PM +0200, Tobias Burnus wrote:
> OpenMP requires: Fix diagnostic filename corner case
>
> The issue occurs when there is, e.g., main._omp_fn.0 in two files with
> different OpenMP requires clauses. The function entries in the offload
> table ends up having the same decl tree and, hence, the diagnostic showed
> the same filename for both. Solution: Use the .o filename in this case.
>
> Note that the issue does not occur with same-named 'static' functions and
> without the fatal error from the requires diagnostic, there would be
> later a linker error due to having two 'main'.
>
> gcc/
> * lto-cgraph.cc (input_offload_tables): Improve requires diagnostic
> when filenames come out identically.
>
> diff --git a/gcc/lto-cgraph.cc b/gcc/lto-cgraph.cc
> index 062677a32eb..350195d86db 100644
> --- a/gcc/lto-cgraph.cc
> +++ b/gcc/lto-cgraph.cc
> @@ -1893,6 +1893,11 @@ input_offload_tables (bool do_force_output)
> if (tmp_decl != NULL_TREE)
> fn2 = IDENTIFIER_POINTER (DECL_NAME (tmp_decl));
> }
> + if (fn1 == fn2)
> + {
> + fn1 = requires_fn;
> + fn2 = file_data->file_name;
> + }
Ugly but ok.
Jakub
prev parent reply other threads:[~2022-08-17 13:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-22 10:38 Tobias Burnus
2022-08-17 13:43 ` 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=YvzwmqBCovvc30nv@tucnak \
--to=jakub@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=tobias@codesourcery.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).