public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/65467] New: [libgomp] sorry, unimplemented: '_Atomic' with OpenMP
@ 2015-03-19  9:01 sebastian.huber@embedded-brains.de
  2015-03-19 10:19 ` [Bug libgomp/65467] " jakub at gcc dot gnu.org
  2015-03-20  0:00 ` joseph at codesourcery dot com
  0 siblings, 2 replies; 3+ messages in thread
From: sebastian.huber@embedded-brains.de @ 2015-03-19  9:01 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 65467
           Summary: [libgomp] sorry, unimplemented: '_Atomic' with OpenMP
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sebastian.huber@embedded-brains.de
                CC: jakub at gcc dot gnu.org

It seems that <stdatomic.h> is not available with -fopenmp:

stdatomic.h:40:1: sorry, unimplemented: '_Atomic' with OpenMP
 typedef _Atomic _Bool atomic_bool;

Is this a principal problem with the OpenMP standard or libgomp?

The __atomic built-ins seem to work, e.g.

int f(int *a, int b)
{
  return __atomic_fetch_add(a, b, 0);
}


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

* [Bug libgomp/65467] [libgomp] sorry, unimplemented: '_Atomic' with OpenMP
  2015-03-19  9:01 [Bug libgomp/65467] New: [libgomp] sorry, unimplemented: '_Atomic' with OpenMP sebastian.huber@embedded-brains.de
@ 2015-03-19 10:19 ` jakub at gcc dot gnu.org
  2015-03-20  0:00 ` joseph at codesourcery dot com
  1 sibling, 0 replies; 3+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-03-19 10:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This is indeed just a big hammer approach.
The OpenMP standard only supports C up to C99 and C++ up to C++98 at this
point, for _Atomic it is non-trivial to figure out how it should behave with
different clauses etc.  But indeed, it would be better to just complain only if
_Atomic is somehow used in OpenMP regions, but that would require first writing
testcases for all the different possibilities where _Atomic could appear.


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

* [Bug libgomp/65467] [libgomp] sorry, unimplemented: '_Atomic' with OpenMP
  2015-03-19  9:01 [Bug libgomp/65467] New: [libgomp] sorry, unimplemented: '_Atomic' with OpenMP sebastian.huber@embedded-brains.de
  2015-03-19 10:19 ` [Bug libgomp/65467] " jakub at gcc dot gnu.org
@ 2015-03-20  0:00 ` joseph at codesourcery dot com
  1 sibling, 0 replies; 3+ messages in thread
From: joseph at codesourcery dot com @ 2015-03-20  0:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
The issue is that someone needs to go through all the parsing for OpenMP 
constructs, and figure out exactly where to add calls to 
convert_lvalue_to_rvalue (if an OpenMP construct reads the value of an 
object, reading the value of an _Atomic object must be an atomic load) and 
what other special handling might be needed (if an OpenMP construct writes 
to an object, it must be an atomic store; if it both reads and writes, 
some form of compare-and-exchange may be needed).


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

end of thread, other threads:[~2015-03-19 23:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-19  9:01 [Bug libgomp/65467] New: [libgomp] sorry, unimplemented: '_Atomic' with OpenMP sebastian.huber@embedded-brains.de
2015-03-19 10:19 ` [Bug libgomp/65467] " jakub at gcc dot gnu.org
2015-03-20  0:00 ` joseph at codesourcery dot com

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