public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/66571] New: Template substitution causes some OpenMP rejects-valid
@ 2015-06-17 14:41 jakub at gcc dot gnu.org
2015-06-17 14:53 ` [Bug c++/66571] " jakub at gcc dot gnu.org
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-17 14:41 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66571
Bug ID: 66571
Summary: Template substitution causes some OpenMP rejects-valid
Product: gcc
Version: 5.1.1
Status: UNCONFIRMED
Keywords: openmp
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: jakub at gcc dot gnu.org
CC: jason at gcc dot gnu.org
Target Milestone: ---
template <typename T, typename U>
extern void bar (T, T, U);
template <typename T, typename U>
void
foo (T a, T b, U c)
{
#pragma omp parallel for simd shared (a, c) reduction (+:b)
for (int i = 0; i < 10; i++)
bar<T> (a, b, c);
#pragma omp target map(tofrom:a, c[0:5])
;
#pragma omp task depend(inout:c[4:2])
;
T d = a;
T e = b;
U f = c;
#pragma omp parallel for simd shared (d, f) reduction (+:e)
for (int i = 0; i < 10; i++)
bar<T> (d, e, f);
#pragma omp target map(tofrom:d, f[0:5])
;
#pragma omp task depend(inout:f[4:2])
;
}
void
baz ()
{
int a = 0, b = 0, cb[10] = {}, *c = cb;
foo <int, int *> (a, b, c);
foo <int &, int *&> (a, b, c);
}
is rejected with -fopenmp right now, because during tsubst_omp_clauses if
changing a non-REFERENCE_TYPE decl into a REFERENCE_TYPE decl
convert_from_reference is called, while finish_omp_clauses (and later code)
checks if OMP_CLAUSE_DECL is a decl (and later code relies on it).
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/66571] Template substitution causes some OpenMP rejects-valid
2015-06-17 14:41 [Bug c++/66571] New: Template substitution causes some OpenMP rejects-valid jakub at gcc dot gnu.org
@ 2015-06-17 14:53 ` jakub at gcc dot gnu.org
2015-06-17 15:47 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-17 14:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66571
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 35793
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35793&action=edit
gcc6-pr66571.patch
Untested fix.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/66571] Template substitution causes some OpenMP rejects-valid
2015-06-17 14:41 [Bug c++/66571] New: Template substitution causes some OpenMP rejects-valid jakub at gcc dot gnu.org
2015-06-17 14:53 ` [Bug c++/66571] " jakub at gcc dot gnu.org
@ 2015-06-17 15:47 ` jakub at gcc dot gnu.org
2015-06-17 17:06 ` jason at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-17 15:47 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66571
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #35793|0 |1
is obsolete| |
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2015-06-17
Assignee|unassigned at gcc dot gnu.org |jakub at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 35795
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35795&action=edit
gcc6-pr66571.patch
Better patch.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/66571] Template substitution causes some OpenMP rejects-valid
2015-06-17 14:41 [Bug c++/66571] New: Template substitution causes some OpenMP rejects-valid jakub at gcc dot gnu.org
2015-06-17 14:53 ` [Bug c++/66571] " jakub at gcc dot gnu.org
2015-06-17 15:47 ` jakub at gcc dot gnu.org
@ 2015-06-17 17:06 ` jason at gcc dot gnu.org
2015-06-17 18:01 ` jakub at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2015-06-17 17:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66571
--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #2)
> Created attachment 35795 [details]
> gcc6-pr66571.patch
>
> Better patch.
OK.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/66571] Template substitution causes some OpenMP rejects-valid
2015-06-17 14:41 [Bug c++/66571] New: Template substitution causes some OpenMP rejects-valid jakub at gcc dot gnu.org
` (2 preceding siblings ...)
2015-06-17 17:06 ` jason at gcc dot gnu.org
@ 2015-06-17 18:01 ` jakub at gcc dot gnu.org
2015-06-17 18:15 ` jakub at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-17 18:01 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66571
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Jun 17 18:01:05 2015
New Revision: 224569
URL: https://gcc.gnu.org/viewcvs?rev=224569&root=gcc&view=rev
Log:
PR c++/66571
* pt.c (tsubst_omp_clause_decl): New function.
(tsubst_omp_clauses): Use it or tsubst_copy instead of
tsubst_expr on OMP_CLAUSE_DECL.
* g++.dg/gomp/pr66571-1.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/gomp/pr66571-1.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/pt.c
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/66571] Template substitution causes some OpenMP rejects-valid
2015-06-17 14:41 [Bug c++/66571] New: Template substitution causes some OpenMP rejects-valid jakub at gcc dot gnu.org
` (3 preceding siblings ...)
2015-06-17 18:01 ` jakub at gcc dot gnu.org
@ 2015-06-17 18:15 ` jakub at gcc dot gnu.org
2015-06-17 19:04 ` jakub at gcc dot gnu.org
2015-06-18 9:54 ` jakub at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-17 18:15 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66571
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Wed Jun 17 18:14:49 2015
New Revision: 224572
URL: https://gcc.gnu.org/viewcvs?rev=224572&root=gcc&view=rev
Log:
PR c++/66571
* pt.c (tsubst_omp_clause_decl): New function.
(tsubst_omp_clauses): Use it or tsubst_copy instead of
tsubst_expr on OMP_CLAUSE_DECL.
* g++.dg/gomp/pr66571-1.C: New test.
Added:
branches/gcc-5-branch/gcc/testsuite/g++.dg/gomp/pr66571-1.C
Modified:
branches/gcc-5-branch/gcc/cp/ChangeLog
branches/gcc-5-branch/gcc/cp/pt.c
branches/gcc-5-branch/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/66571] Template substitution causes some OpenMP rejects-valid
2015-06-17 14:41 [Bug c++/66571] New: Template substitution causes some OpenMP rejects-valid jakub at gcc dot gnu.org
` (4 preceding siblings ...)
2015-06-17 18:15 ` jakub at gcc dot gnu.org
@ 2015-06-17 19:04 ` jakub at gcc dot gnu.org
2015-06-18 9:54 ` jakub at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-17 19:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66571
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed for 5.2+.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/66571] Template substitution causes some OpenMP rejects-valid
2015-06-17 14:41 [Bug c++/66571] New: Template substitution causes some OpenMP rejects-valid jakub at gcc dot gnu.org
` (5 preceding siblings ...)
2015-06-17 19:04 ` jakub at gcc dot gnu.org
@ 2015-06-18 9:54 ` jakub at gcc dot gnu.org
6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2015-06-18 9:54 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66571
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Author: jakub
Date: Thu Jun 18 09:54:17 2015
New Revision: 224599
URL: https://gcc.gnu.org/viewcvs?rev=224599&root=gcc&view=rev
Log:
PR c++/66571
* pt.c (tsubst_omp_clause_decl): New function.
(tsubst_omp_clauses): Use it or tsubst_copy instead of
tsubst_expr on OMP_CLAUSE_DECL.
* g++.dg/gomp/pr66571-1.C: New test.
Modified:
trunk/gcc/cp/ChangeLog
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2015-06-18 9:54 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-17 14:41 [Bug c++/66571] New: Template substitution causes some OpenMP rejects-valid jakub at gcc dot gnu.org
2015-06-17 14:53 ` [Bug c++/66571] " jakub at gcc dot gnu.org
2015-06-17 15:47 ` jakub at gcc dot gnu.org
2015-06-17 17:06 ` jason at gcc dot gnu.org
2015-06-17 18:01 ` jakub at gcc dot gnu.org
2015-06-17 18:15 ` jakub at gcc dot gnu.org
2015-06-17 19:04 ` jakub at gcc dot gnu.org
2015-06-18 9:54 ` 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).