]> git.ipfire.org Git - thirdparty/gcc.git/commit
OpenMP requires: Fix diagnostic filename corner case
authorTobias Burnus <tobias@codesourcery.com>
Wed, 17 Aug 2022 13:59:06 +0000 (15:59 +0200)
committerTobias Burnus <tobias@codesourcery.com>
Wed, 17 Aug 2022 13:59:06 +0000 (15:59 +0200)
commit30d425854ee3324b391fe1db71fbea6833c8d17c
tree167372f7a1b69f308e189c7a6b2fd359ee339dc2
parentbe32fafdbeed4b8560a7e399298a6b88e59c3091
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.

(cherry picked from commit 027b281f1e8de55d959695c7f1e80572fae6dbe7)
gcc/ChangeLog.omp
gcc/lto-cgraph.cc