public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/104493] New: OpenMP offload map cannot handle const
@ 2022-02-10 20:23 xw111luoye at gmail dot com
  2022-05-24  0:50 ` [Bug c++/104493] " xw111luoye at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: xw111luoye at gmail dot com @ 2022-02-10 20:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104493

            Bug ID: 104493
           Summary: OpenMP offload map cannot handle const
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: xw111luoye at gmail dot com
  Target Milestone: ---

See reproducer
https://github.com/ye-luo/openmp-target/blob/master/tests/map/struct_with_const.cpp

$ g++ -fopenmp -foffload=nvptx-none struct_with_const.cpp
struct_with_const.cpp: In constructor ‘with_const::with_const()’:
struct_with_const.cpp:9:42: error: array section does not have mappable type in
‘map’ clause
    9 |     #pragma omp target enter data map(to:this[:1])
      |                                          ^~~~
struct_with_const.cpp:12:24: note: static field ‘with_const::size’ is not
mappable
   12 |   constexpr static int size = 6;
      |                        ^~~~
struct_with_const.cpp:13:20: note: static field ‘with_const::b’ is not mappable
   13 |   static const int b = 12;
      |                    ^
In file included from
/soft/gcc/gcc-12-dev-2022-02-10/include/c++/12.0.1/string:53,
                 from
/soft/gcc/gcc-12-dev-2022-02-10/include/c++/12.0.1/bits/locale_classes.h:40,
                 from
/soft/gcc/gcc-12-dev-2022-02-10/include/c++/12.0.1/bits/ios_base.h:41,
                 from
/soft/gcc/gcc-12-dev-2022-02-10/include/c++/12.0.1/ios:42,
                 from
/soft/gcc/gcc-12-dev-2022-02-10/include/c++/12.0.1/ostream:38,
                 from
/soft/gcc/gcc-12-dev-2022-02-10/include/c++/12.0.1/iostream:39,
                 from struct_with_const.cpp:1:
/soft/gcc/gcc-12-dev-2022-02-10/include/c++/12.0.1/bits/basic_string.h:140:33:
note: static field ‘std::__cxx11::basic_string<char>::npos’ is not mappable
  140 |       static const size_type    npos = static_cast<size_type>(-1);
      |                                 ^~~~
struct_with_const.cpp:9:13: error: ‘#pragma omp target enter data’ must contain
at least one ‘map’ clause
    9 |     #pragma omp target enter data map(to:this[:1])
      |

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/104493] OpenMP offload map cannot handle const
  2022-02-10 20:23 [Bug c++/104493] New: OpenMP offload map cannot handle const xw111luoye at gmail dot com
@ 2022-05-24  0:50 ` xw111luoye at gmail dot com
  2022-05-25  9:09 ` burnus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: xw111luoye at gmail dot com @ 2022-05-24  0:50 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104493

Ye Luo <xw111luoye at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #1 from Ye Luo <xw111luoye at gmail dot com> ---
gcc 12 rejects the code but devel/omp/gcc-11 was happy.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/104493] OpenMP offload map cannot handle const
  2022-02-10 20:23 [Bug c++/104493] New: OpenMP offload map cannot handle const xw111luoye at gmail dot com
  2022-05-24  0:50 ` [Bug c++/104493] " xw111luoye at gmail dot com
@ 2022-05-25  9:09 ` burnus at gcc dot gnu.org
  2022-05-25 13:45 ` xw111luoye at gmail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2022-05-25  9:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104493

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> ---
(In reply to Ye Luo from comment #1)
> gcc 12 rejects the code but devel/omp/gcc-11 was happy.

Note: the devel/omp/gcc-* branch contains both patches backported ("git
cherry-picked") from the mainline (curent development) branch but also some
patches which are not yet on mainline for various reasons. – In particular,
this happens for features which are only ready shortly before the next release
("release freeze"). The closer to the release and the more invasive the
patches, the less likely to be included. — See https://gcc.gnu.org/develop.html
for "Schedule" with Stage 1/3/4 for an overview and towards the end of the
page, the timeline (i.e. when did Stage 1/(2/)/3/4 start and when were the GCC
releases).

If a patch is in OG11 then it is almost sure that OG12 will also contain it.
Additionally, there is a high probability that this patch will also be included
in mainline.
For GCC's git, its branches branches in general and the active branches,
including devel/omp/gcc-*, see also https://gcc.gnu.org/git.html (OG12, based
on the GCC 12 branch, will soon be available; at the same time, OG11 will then
be retired).

 * * *

Regarding the issue at hand, I think the issue is fixed by patch:
  https://gcc.gnu.org/pipermail/gcc-patches/2022-March/591449.html
is was reviewed at
  https://gcc.gnu.org/pipermail/gcc-patches/2022-May/594082.html
with some minor comments. Thus, I assume that this patch will soon be committed
to
GCC 13 (current mainline).

 * * *

I concur that it is a bit unfortunate that it missed the GCC 12 deadline, but
that's the  general problem with deadlines and bug fixes and new features:
There will always be features/bug fixes, which are very important for some,
that missed the deadline by a very short time.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/104493] OpenMP offload map cannot handle const
  2022-02-10 20:23 [Bug c++/104493] New: OpenMP offload map cannot handle const xw111luoye at gmail dot com
  2022-05-24  0:50 ` [Bug c++/104493] " xw111luoye at gmail dot com
  2022-05-25  9:09 ` burnus at gcc dot gnu.org
@ 2022-05-25 13:45 ` xw111luoye at gmail dot com
  2022-07-04 21:13 ` xw111luoye at gmail dot com
  2022-08-05  8:03 ` burnus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: xw111luoye at gmail dot com @ 2022-05-25 13:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104493

--- Comment #3 from Ye Luo <xw111luoye at gmail dot com> ---
Thank you for the answer with well explained development procedure of gcc. I
was intended to keep this bug report active. I just adopted OpenMP offload
options adjusted in gcc 12 but OG11 doesn't have them due to using 11 as its
base. So looking forward to updates on gcc 12 mainline or og12 branch.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/104493] OpenMP offload map cannot handle const
  2022-02-10 20:23 [Bug c++/104493] New: OpenMP offload map cannot handle const xw111luoye at gmail dot com
                   ` (2 preceding siblings ...)
  2022-05-25 13:45 ` xw111luoye at gmail dot com
@ 2022-07-04 21:13 ` xw111luoye at gmail dot com
  2022-08-05  8:03 ` burnus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: xw111luoye at gmail dot com @ 2022-07-04 21:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104493

--- Comment #4 from Ye Luo <xw111luoye at gmail dot com> ---
When I tried master and devel/omp/gcc-12, the fix has not been applied.
Just keep a note here. Probably this has been planned.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug c++/104493] OpenMP offload map cannot handle const
  2022-02-10 20:23 [Bug c++/104493] New: OpenMP offload map cannot handle const xw111luoye at gmail dot com
                   ` (3 preceding siblings ...)
  2022-07-04 21:13 ` xw111luoye at gmail dot com
@ 2022-08-05  8:03 ` burnus at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu.org @ 2022-08-05  8:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104493

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-08-05
             Status|UNCONFIRMED                 |ASSIGNED

--- Comment #5 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Submitted mainline patch, (still) pending review:
  https://gcc.gnu.org/pipermail/gcc-patches/2022-July/598918.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-08-05  8:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 20:23 [Bug c++/104493] New: OpenMP offload map cannot handle const xw111luoye at gmail dot com
2022-05-24  0:50 ` [Bug c++/104493] " xw111luoye at gmail dot com
2022-05-25  9:09 ` burnus at gcc dot gnu.org
2022-05-25 13:45 ` xw111luoye at gmail dot com
2022-07-04 21:13 ` xw111luoye at gmail dot com
2022-08-05  8:03 ` burnus at gcc dot gnu.org

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).