* [Bug c++/48869] OpenMP task construct fails to instantiate copy constructor(same as Bug 36523)
2011-05-04 13:04 [Bug c++/48869] New: OpenMP task construct fails to instantiate copy constructor(same as Bug 36523) bbenin at gmail dot com
@ 2011-05-04 13:07 ` paolo.carlini at oracle dot com
2011-05-04 15:40 ` jakub at gcc dot gnu.org
` (11 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: paolo.carlini at oracle dot com @ 2011-05-04 13:07 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48869
Paolo Carlini <paolo.carlini at oracle dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011.05.04 13:06:58
CC| |jakub at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> 2011-05-04 13:06:58 UTC ---
Confirmed mainline and 4_6-branch.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48869] OpenMP task construct fails to instantiate copy constructor(same as Bug 36523)
2011-05-04 13:04 [Bug c++/48869] New: OpenMP task construct fails to instantiate copy constructor(same as Bug 36523) bbenin at gmail dot com
2011-05-04 13:07 ` [Bug c++/48869] " paolo.carlini at oracle dot com
@ 2011-05-04 15:40 ` jakub at gcc dot gnu.org
2011-05-04 15:57 ` [Bug c++/48869] [4.5/4.6/4.7 Regression] " jakub at gcc dot gnu.org
` (10 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-05-04 15:40 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48869
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org,
| |rguenth at gcc dot gnu.org,
| |rth at gcc dot gnu.org
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-04 15:31:38 UTC ---
Broken by:
http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149750
i.e. gimplification unit-a-time. The problem is we won't know until
gimplification whether some non-POD vars will be firstprivate or not, and when
gimplification has been postponed so late, instantiate_pending_templates won't
be called any longer.
Unfortunately, I think duplicating most of the OpenMP related code from
gimplify.c to find out implicitly firstprivate vars in task constructs earlier
would be very hard and huge amount of code duplication, on the other side if we
wanted to instantiate the missing templates late, we'd have to basically repeat
the whole do { ... } while (reconsider); loop from
cp_write_global_declarations from within some langhook (I don't think we can do
that while in the middle of gimplifying something).
Richard/Richard/Jason, any ideas?
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48869] [4.5/4.6/4.7 Regression] OpenMP task construct fails to instantiate copy constructor(same as Bug 36523)
2011-05-04 13:04 [Bug c++/48869] New: OpenMP task construct fails to instantiate copy constructor(same as Bug 36523) bbenin at gmail dot com
2011-05-04 13:07 ` [Bug c++/48869] " paolo.carlini at oracle dot com
2011-05-04 15:40 ` jakub at gcc dot gnu.org
@ 2011-05-04 15:57 ` jakub at gcc dot gnu.org
2011-05-04 15:58 ` rguenther at suse dot de
` (9 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-05-04 15:57 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48869
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.4.6
Target Milestone|--- |4.5.4
Summary|OpenMP task construct fails |[4.5/4.6/4.7 Regression]
|to instantiate copy |OpenMP task construct fails
|constructor(same as Bug |to instantiate copy
|36523) |constructor(same as Bug
| |36523)
Known to fail| |4.5.3, 4.6.0, 4.7.0
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48869] [4.5/4.6/4.7 Regression] OpenMP task construct fails to instantiate copy constructor(same as Bug 36523)
2011-05-04 13:04 [Bug c++/48869] New: OpenMP task construct fails to instantiate copy constructor(same as Bug 36523) bbenin at gmail dot com
` (2 preceding siblings ...)
2011-05-04 15:57 ` [Bug c++/48869] [4.5/4.6/4.7 Regression] " jakub at gcc dot gnu.org
@ 2011-05-04 15:58 ` rguenther at suse dot de
2011-05-04 16:31 ` jakub at gcc dot gnu.org
` (8 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: rguenther at suse dot de @ 2011-05-04 15:58 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48869
--- Comment #3 from rguenther at suse dot de <rguenther at suse dot de> 2011-05-04 15:46:47 UTC ---
On Wed, 4 May 2011, jakub at gcc dot gnu.org wrote:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48869
>
> Jakub Jelinek <jakub at gcc dot gnu.org> changed:
>
> What |Removed |Added
> ----------------------------------------------------------------------------
> CC| |jason at gcc dot gnu.org,
> | |rguenth at gcc dot gnu.org,
> | |rth at gcc dot gnu.org
>
> --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-04 15:31:38 UTC ---
> Broken by:
> http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=149750
> i.e. gimplification unit-a-time. The problem is we won't know until
> gimplification whether some non-POD vars will be firstprivate or not, and when
> gimplification has been postponed so late, instantiate_pending_templates won't
> be called any longer.
> Unfortunately, I think duplicating most of the OpenMP related code from
> gimplify.c to find out implicitly firstprivate vars in task constructs earlier
> would be very hard and huge amount of code duplication, on the other side if we
> wanted to instantiate the missing templates late, we'd have to basically repeat
> the whole do { ... } while (reconsider); loop from
> cp_write_global_declarations from within some langhook (I don't think we can do
> that while in the middle of gimplifying something).
> Richard/Richard/Jason, any ideas?
Can we just always instantiate the templates (always assuming they will be
firstprivate) or are we strictly bound to only instantiate when we
know they will be used? Thus, how does the OMP spec interact with C++
template instantiation rules?
I don't like the idea of instantiating templates when we started
gimplification ... can we move related analysis to the frontend
somewhere so we know whether things are firstprivate or not there?
Richard.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48869] [4.5/4.6/4.7 Regression] OpenMP task construct fails to instantiate copy constructor(same as Bug 36523)
2011-05-04 13:04 [Bug c++/48869] New: OpenMP task construct fails to instantiate copy constructor(same as Bug 36523) bbenin at gmail dot com
` (3 preceding siblings ...)
2011-05-04 15:58 ` rguenther at suse dot de
@ 2011-05-04 16:31 ` jakub at gcc dot gnu.org
2011-05-04 16:41 ` jakub at gcc dot gnu.org
` (7 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-05-04 16:31 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48869
--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-04 16:25:46 UTC ---
Not sure if it would be ok to request instantiation of say copy ctor when we
are unsure if the var will be firstprivate or not. The copy ctor can be marked
as =delete, or perhaps say the instantiation of the copy ctor could result in
static assertion failures or could use some =delete method...
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48869] [4.5/4.6/4.7 Regression] OpenMP task construct fails to instantiate copy constructor(same as Bug 36523)
2011-05-04 13:04 [Bug c++/48869] New: OpenMP task construct fails to instantiate copy constructor(same as Bug 36523) bbenin at gmail dot com
` (4 preceding siblings ...)
2011-05-04 16:31 ` jakub at gcc dot gnu.org
@ 2011-05-04 16:41 ` jakub at gcc dot gnu.org
2011-05-04 18:00 ` jason at gcc dot gnu.org
` (6 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-05-04 16:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48869
--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-04 16:37:40 UTC ---
Say:
template<typename T>
struct B
{
B () {}
B (const B&) = delete;
~B () {}
};
template<typename T>
struct A
{
A () {}
A (const A&) { B<T> b; B<T> c = b; }
void foo () {}
~A() {}
};
int
main()
{
A<int> a;
#pragma omp task shared(a)
a.foo ();
#pragma omp task default(shared)
a.foo ();
#pragma omp parallel shared(a)
#pragma omp task
a.foo ();
#if 0
#pragma omp task
a.foo ();
#pragma omp parallel private (a)
#pragma omp task
a.foo ();
#endif
return 0;
}
With #if 0 all the a's are shared, even though it isn't immediately obvious in
all cases that it is that way without going through all the gimplify.c rules.
With #if 1 instead of #if 0 those two last tasks have implicit firstprivate(a)
and thus need to instantiate the copy ctor.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48869] [4.5/4.6/4.7 Regression] OpenMP task construct fails to instantiate copy constructor(same as Bug 36523)
2011-05-04 13:04 [Bug c++/48869] New: OpenMP task construct fails to instantiate copy constructor(same as Bug 36523) bbenin at gmail dot com
` (5 preceding siblings ...)
2011-05-04 16:41 ` jakub at gcc dot gnu.org
@ 2011-05-04 18:00 ` jason at gcc dot gnu.org
2011-05-11 8:23 ` jakub at gcc dot gnu.org
` (5 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jason at gcc dot gnu.org @ 2011-05-04 18:00 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48869
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> 2011-05-04 17:46:33 UTC ---
I think it would be fine to mark_used the copy ctor in cases where it might or
might not be used.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48869] [4.5/4.6/4.7 Regression] OpenMP task construct fails to instantiate copy constructor(same as Bug 36523)
2011-05-04 13:04 [Bug c++/48869] New: OpenMP task construct fails to instantiate copy constructor(same as Bug 36523) bbenin at gmail dot com
` (6 preceding siblings ...)
2011-05-04 18:00 ` jason at gcc dot gnu.org
@ 2011-05-11 8:23 ` jakub at gcc dot gnu.org
2011-05-19 8:16 ` jakub at gcc dot gnu.org
` (4 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-05-11 8:23 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48869
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
AssignedTo|unassigned at gcc dot |jakub at gcc dot gnu.org
|gnu.org |
--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-11 08:05:31 UTC ---
Created attachment 24221
--> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24221
gcc46-pr48869.patch
Untested fix.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48869] [4.5/4.6/4.7 Regression] OpenMP task construct fails to instantiate copy constructor(same as Bug 36523)
2011-05-04 13:04 [Bug c++/48869] New: OpenMP task construct fails to instantiate copy constructor(same as Bug 36523) bbenin at gmail dot com
` (7 preceding siblings ...)
2011-05-11 8:23 ` jakub at gcc dot gnu.org
@ 2011-05-19 8:16 ` jakub at gcc dot gnu.org
2011-05-19 8:25 ` [Bug c++/48869] [4.5 " jakub at gcc dot gnu.org
` (3 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-05-19 8:16 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48869
--- Comment #8 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-19 07:44:35 UTC ---
Author: jakub
Date: Thu May 19 07:44:31 2011
New Revision: 173888
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173888
Log:
PR c++/48869
* method.c (get_dtor, get_copy_ctor): Add COMPLAIN argument,
pass it down to locate_fn_flags.
* cp-tree.h (get_dtor, get_copy_ctor): Adjust prototypes.
* semantics.c (cxx_omp_create_clause_info): Adjust callers.
* cp-gimplify.c: Include splay-tree.h.
(splay_tree_compare_decl_uid, omp_var_to_track,
omp_cxx_notice_variable): New functions.
(struct cp_genericize_omp_taskreg): New type.
(struct cp_genericize_data): Add omp_ctx field.
(cp_genericize_r): Attempt to determine implicitly determined
firstprivate class type variables.
(cp_genericize): Clear omp_ctx.
* Make-lang.in (cp/cp-gimplify.o): Depend on $(SPLAY_TREE_H).
* testsuite/libgomp.c++/pr48869.C: New test.
Added:
trunk/libgomp/testsuite/libgomp.c++/pr48869.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/Make-lang.in
trunk/gcc/cp/cp-gimplify.c
trunk/gcc/cp/cp-tree.h
trunk/gcc/cp/method.c
trunk/gcc/cp/semantics.c
trunk/libgomp/ChangeLog
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48869] [4.5 Regression] OpenMP task construct fails to instantiate copy constructor(same as Bug 36523)
2011-05-04 13:04 [Bug c++/48869] New: OpenMP task construct fails to instantiate copy constructor(same as Bug 36523) bbenin at gmail dot com
` (8 preceding siblings ...)
2011-05-19 8:16 ` jakub at gcc dot gnu.org
@ 2011-05-19 8:25 ` jakub at gcc dot gnu.org
2011-05-19 8:48 ` [Bug c++/48869] [4.5/4.6/4.7 " jakub at gcc dot gnu.org
` (2 subsequent siblings)
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-05-19 8:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48869
Jakub Jelinek <jakub at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Known to work| |4.6.1, 4.7.0
Summary|[4.5/4.6/4.7 Regression] |[4.5 Regression] OpenMP
|OpenMP task construct fails |task construct fails to
|to instantiate copy |instantiate copy
|constructor(same as Bug |constructor(same as Bug
|36523) |36523)
Known to fail|4.7.0 |
--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-19 08:03:37 UTC ---
Fixed for 4.6+ so far.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48869] [4.5/4.6/4.7 Regression] OpenMP task construct fails to instantiate copy constructor(same as Bug 36523)
2011-05-04 13:04 [Bug c++/48869] New: OpenMP task construct fails to instantiate copy constructor(same as Bug 36523) bbenin at gmail dot com
` (9 preceding siblings ...)
2011-05-19 8:25 ` [Bug c++/48869] [4.5 " jakub at gcc dot gnu.org
@ 2011-05-19 8:48 ` jakub at gcc dot gnu.org
2011-08-01 13:58 ` [Bug c++/48869] [4.5 " rguenth at gcc dot gnu.org
2012-07-02 10:50 ` rguenth at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: jakub at gcc dot gnu.org @ 2011-05-19 8:48 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48869
--- Comment #9 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-05-19 08:00:56 UTC ---
Author: jakub
Date: Thu May 19 08:00:50 2011
New Revision: 173889
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173889
Log:
PR c++/48869
* method.c (get_dtor, get_copy_ctor): Add COMPLAIN argument,
pass it down to locate_fn_flags.
* cp-tree.h (get_dtor, get_copy_ctor): Adjust prototypes.
* semantics.c (cxx_omp_create_clause_info): Adjust callers.
* cp-gimplify.c: Include splay-tree.h.
(splay_tree_compare_decl_uid, omp_var_to_track,
omp_cxx_notice_variable): New functions.
(struct cp_genericize_omp_taskreg): New type.
(struct cp_genericize_data): Add omp_ctx field.
(cp_genericize_r): Attempt to determine implicitly determined
firstprivate class type variables.
(cp_genericize): Clear omp_ctx.
* Make-lang.in (cp/cp-gimplify.o): Depend on $(SPLAY_TREE_H).
* testsuite/libgomp.c++/pr48869.C: New test.
Added:
branches/gcc-4_6-branch/libgomp/testsuite/libgomp.c++/pr48869.C
Modified:
branches/gcc-4_6-branch/gcc/cp/ChangeLog
branches/gcc-4_6-branch/gcc/cp/Make-lang.in
branches/gcc-4_6-branch/gcc/cp/cp-gimplify.c
branches/gcc-4_6-branch/gcc/cp/cp-tree.h
branches/gcc-4_6-branch/gcc/cp/method.c
branches/gcc-4_6-branch/gcc/cp/semantics.c
branches/gcc-4_6-branch/libgomp/ChangeLog
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48869] [4.5 Regression] OpenMP task construct fails to instantiate copy constructor(same as Bug 36523)
2011-05-04 13:04 [Bug c++/48869] New: OpenMP task construct fails to instantiate copy constructor(same as Bug 36523) bbenin at gmail dot com
` (10 preceding siblings ...)
2011-05-19 8:48 ` [Bug c++/48869] [4.5/4.6/4.7 " jakub at gcc dot gnu.org
@ 2011-08-01 13:58 ` rguenth at gcc dot gnu.org
2012-07-02 10:50 ` rguenth at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2011-08-01 13:58 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48869
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P2
^ permalink raw reply [flat|nested] 14+ messages in thread
* [Bug c++/48869] [4.5 Regression] OpenMP task construct fails to instantiate copy constructor(same as Bug 36523)
2011-05-04 13:04 [Bug c++/48869] New: OpenMP task construct fails to instantiate copy constructor(same as Bug 36523) bbenin at gmail dot com
` (11 preceding siblings ...)
2011-08-01 13:58 ` [Bug c++/48869] [4.5 " rguenth at gcc dot gnu.org
@ 2012-07-02 10:50 ` rguenth at gcc dot gnu.org
12 siblings, 0 replies; 14+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-02 10:50 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48869
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|4.5.4 |4.6.0
--- Comment #11 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-07-02 10:50:06 UTC ---
Fixed in 4.6.0, the 4.5 branch is being closed.
^ permalink raw reply [flat|nested] 14+ messages in thread