public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/24734]  New: [gomp] "#pragma omp master" doesn't work in templates
@ 2005-11-08 15:29 reichelt at gcc dot gnu dot org
  2005-11-08 15:40 ` [Bug c++/24734] " jakub at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2005-11-08 15:29 UTC (permalink / raw)
  To: gcc-bugs

The following program doesn't work correctly when compiled with -fopenmp:

==============================
#include<cstdio>

template<int> void foo()
{
    #pragma omp parallel
    {
        printf("ALL\n");
        #pragma omp master
        printf("MASTER\n");
    }
}

int main()
{
    foo<0>();
    return 0;
}
==============================

The output (with two threads) is just:
ALL
ALL

If I make foo a non-template function, I get the correct output:
ALL
ALL
MASTER


-- 
           Summary: [gomp] "#pragma omp master" doesn't work in templates
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: wrong-code, openmp
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: reichelt at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24734


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

* [Bug c++/24734] [gomp] "#pragma omp master" doesn't work in templates
  2005-11-08 15:29 [Bug c++/24734] New: [gomp] "#pragma omp master" doesn't work in templates reichelt at gcc dot gnu dot org
@ 2005-11-08 15:40 ` jakub at gcc dot gnu dot org
  2005-11-08 19:22 ` jakub at gcc dot gnu dot org
  2005-11-08 19:26 ` jakub at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-11-08 15:40 UTC (permalink / raw)
  To: gcc-bugs



-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jakub at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2005-11-08 15:40:17
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24734


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

* [Bug c++/24734] [gomp] "#pragma omp master" doesn't work in templates
  2005-11-08 15:29 [Bug c++/24734] New: [gomp] "#pragma omp master" doesn't work in templates reichelt at gcc dot gnu dot org
  2005-11-08 15:40 ` [Bug c++/24734] " jakub at gcc dot gnu dot org
@ 2005-11-08 19:22 ` jakub at gcc dot gnu dot org
  2005-11-08 19:26 ` jakub at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-11-08 19:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from jakub at gcc dot gnu dot org  2005-11-08 19:22 -------
Subject: Bug 24734

Author: jakub
Date: Tue Nov  8 19:22:33 2005
New Revision: 106650

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106650
Log:
        PR c++/24734
        * pt.c (tsubst_expr): Handle OMP_MASTER and OMP_ORDERED.
testsuite/
        * g++.dg/gomp/tpl-master-1.C: New test.
libgomp/
        * testsuite/libgomp.c++/master-1.C: New test.

Added:
    branches/gomp-20050608-branch/gcc/testsuite/g++.dg/gomp/tpl-master-1.C
    branches/gomp-20050608-branch/libgomp/testsuite/libgomp.c++/master-1.C
Modified:
    branches/gomp-20050608-branch/gcc/cp/ChangeLog.gomp
    branches/gomp-20050608-branch/gcc/cp/pt.c
    branches/gomp-20050608-branch/gcc/testsuite/ChangeLog.gomp
    branches/gomp-20050608-branch/libgomp/ChangeLog


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24734


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

* [Bug c++/24734] [gomp] "#pragma omp master" doesn't work in templates
  2005-11-08 15:29 [Bug c++/24734] New: [gomp] "#pragma omp master" doesn't work in templates reichelt at gcc dot gnu dot org
  2005-11-08 15:40 ` [Bug c++/24734] " jakub at gcc dot gnu dot org
  2005-11-08 19:22 ` jakub at gcc dot gnu dot org
@ 2005-11-08 19:26 ` jakub at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at gcc dot gnu dot org @ 2005-11-08 19:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2005-11-08 19:26 -------
Fixed in CVS.


-- 

jakub at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24734


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

end of thread, other threads:[~2005-11-08 19:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-08 15:29 [Bug c++/24734] New: [gomp] "#pragma omp master" doesn't work in templates reichelt at gcc dot gnu dot org
2005-11-08 15:40 ` [Bug c++/24734] " jakub at gcc dot gnu dot org
2005-11-08 19:22 ` jakub at gcc dot gnu dot org
2005-11-08 19:26 ` jakub at gcc dot gnu dot 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).