public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/67986] New: OpenMP collapse - invalid code generated.
@ 2015-10-16 13:13 lbukata at gmail dot com
  2015-10-16 13:19 ` [Bug libgomp/67986] " jakub at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: lbukata at gmail dot com @ 2015-10-16 13:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67986
           Summary: OpenMP collapse - invalid code generated.
           Product: gcc
           Version: 4.9.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lbukata at gmail dot com
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

Created attachment 36525
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36525&action=edit
Simple demonstration of the bug.

Invalid code for the following code:

#pragma omp parallel for collapse(2)
for (int32_t i = 0; i < N-1; ++i)       {
        for (int32_t j = i+1; j < N; ++j)       {
             #pragma omp critical
             cout<<"(i,j): ("<<i<<","<<j<<")"<<endl;
        }
}

Sequential code generates valid pairs of indices, however, the parallel code
neglects the dependency of inner loop range on outer loop variable. The full
source is attached.

Tested on both GCC 4.8.5 and GCC 4.9.3 with the same result. The distro is
Gentoo Linux 2015.


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

end of thread, other threads:[~2015-10-16 13:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-16 13:13 [Bug libgomp/67986] New: OpenMP collapse - invalid code generated lbukata at gmail dot com
2015-10-16 13:19 ` [Bug libgomp/67986] " jakub at gcc dot gnu.org
2015-10-16 13:40 ` lbukata at gmail dot com
2015-10-16 13:49 ` jakub 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).