* [Bug c++/36237] internal compiler error: in lower_stmt, at gimple-low.c:282
2008-05-14 21:06 [Bug c++/36237] New: internal compiler error: in lower_stmt, at gimple-low.c:282 silviug at gmail dot com
@ 2008-05-14 21:07 ` silviug at gmail dot com
2008-05-14 21:12 ` silviug at gmail dot com
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: silviug at gmail dot com @ 2008-05-14 21:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from silviug at gmail dot com 2008-05-14 21:06 -------
Created an attachment (id=15638)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15638&action=view)
Archive containing source code wich generated the bug, makefile and *.ii files.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36237
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/36237] internal compiler error: in lower_stmt, at gimple-low.c:282
2008-05-14 21:06 [Bug c++/36237] New: internal compiler error: in lower_stmt, at gimple-low.c:282 silviug at gmail dot com
2008-05-14 21:07 ` [Bug c++/36237] " silviug at gmail dot com
@ 2008-05-14 21:12 ` silviug at gmail dot com
2008-05-23 9:12 ` [Bug c++/36237] internal compiler error: in lower_stmt, at gimple-low.c:282 erase 'private(localTodoStack)' it compiles successfully jakub at gcc dot gnu dot org
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: silviug at gmail dot com @ 2008-05-14 21:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from silviug at gmail dot com 2008-05-14 21:11 -------
(In reply to comment #1)
> Created an attachment (id=15638)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15638&action=view) [edit]
> Archive containing source code wich generated the bug, makefile and *.ii files.
>
The problem comes from the following lines from 'qsort_openmp_v2.cpp' file:
121: #pragma omp parallel shared(vec, globalTodoStack, \
122: numBusyThreads) private(localTodoStack)
More precisely, if I erase 'private(localTodoStack)' it compiles successfully.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36237
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/36237] internal compiler error: in lower_stmt, at gimple-low.c:282 erase 'private(localTodoStack)' it compiles successfully.
2008-05-14 21:06 [Bug c++/36237] New: internal compiler error: in lower_stmt, at gimple-low.c:282 silviug at gmail dot com
2008-05-14 21:07 ` [Bug c++/36237] " silviug at gmail dot com
2008-05-14 21:12 ` silviug at gmail dot com
@ 2008-05-23 9:12 ` jakub at gcc dot gnu dot org
2008-05-23 12:52 ` silviug at gmail dot com
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-05-23 9:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jakub at gcc dot gnu dot org 2008-05-23 09:12 -------
Reduced testcase:
struct A
{
~A ();
};
struct B
{
explicit B (const A &x = A ()) : a (x) { }
A a;
};
B var;
void bar ();
void
foo ()
{
#pragma omp parallel private (var)
bar ();
}
Note that your example is very buggy. First of all, data sharing clauses on
#pragma omp parallel only affect the uses of the variable within the construct,
they have no effect on variables in other functions. So the private
(localTodoStack) clause really doesn't have the desired effect (a private
variable will be constructed, but nothing will ever use it) - localTodoStack in
quick_sort is still a shared global variable. If you want it to be private,
you should pass it by reference to quick_sort, or use threadprivate var, or
perhaps the easiest just use an automatic variable in quick_sort function.
Second bug is if (true == globalTodoStack.empty()) { outside of critical
region,
as globalTodoStack is shared, calling this is really racy, generally it could
crash, in g++ as it just compares two pointers it could just say
globalTodoStack is empty even when it is not, or vice versa.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36237
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/36237] internal compiler error: in lower_stmt, at gimple-low.c:282 erase 'private(localTodoStack)' it compiles successfully.
2008-05-14 21:06 [Bug c++/36237] New: internal compiler error: in lower_stmt, at gimple-low.c:282 silviug at gmail dot com
` (2 preceding siblings ...)
2008-05-23 9:12 ` [Bug c++/36237] internal compiler error: in lower_stmt, at gimple-low.c:282 erase 'private(localTodoStack)' it compiles successfully jakub at gcc dot gnu dot org
@ 2008-05-23 12:52 ` silviug at gmail dot com
2008-05-23 13:23 ` jakub at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: silviug at gmail dot com @ 2008-05-23 12:52 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from silviug at gmail dot com 2008-05-23 12:51 -------
(In reply to comment #3)
> Note that your example is very buggy.
Yes, I must agree, I'm new to OpenMP :) In the end I solved the issues you are
pointing out.
Still I shouldn't get a compiler internal error for buggy code, right?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36237
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/36237] internal compiler error: in lower_stmt, at gimple-low.c:282 erase 'private(localTodoStack)' it compiles successfully.
2008-05-14 21:06 [Bug c++/36237] New: internal compiler error: in lower_stmt, at gimple-low.c:282 silviug at gmail dot com
` (3 preceding siblings ...)
2008-05-23 12:52 ` silviug at gmail dot com
@ 2008-05-23 13:23 ` jakub at gcc dot gnu dot org
2008-05-23 13:32 ` jakub at gcc dot gnu dot org
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-05-23 13:23 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from jakub at gcc dot gnu dot org 2008-05-23 13:22 -------
Subject: Bug 36237
Author: jakub
Date: Fri May 23 13:21:47 2008
New Revision: 135802
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=135802
Log:
PR c++/36237
* cp-gimplify.c (cxx_omp_clause_apply_fn): Call
fold_build_cleanup_point_expr on build_call_a results.
* g++.dg/gomp/pr36237.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/gomp/pr36237.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-gimplify.c
trunk/gcc/testsuite/ChangeLog
trunk/libgomp/testsuite/libgomp.c++/ctor-12.C
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36237
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/36237] internal compiler error: in lower_stmt, at gimple-low.c:282 erase 'private(localTodoStack)' it compiles successfully.
2008-05-14 21:06 [Bug c++/36237] New: internal compiler error: in lower_stmt, at gimple-low.c:282 silviug at gmail dot com
` (4 preceding siblings ...)
2008-05-23 13:23 ` jakub at gcc dot gnu dot org
@ 2008-05-23 13:32 ` jakub at gcc dot gnu dot org
2008-05-23 13:33 ` jakub at gcc dot gnu dot org
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-05-23 13:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jakub at gcc dot gnu dot org 2008-05-23 13:31 -------
Subject: Bug 36237
Author: jakub
Date: Fri May 23 13:30:51 2008
New Revision: 135807
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=135807
Log:
PR c++/36237
* cp-gimplify.c (cxx_omp_clause_apply_fn): Call
fold_build_cleanup_point_expr on build_call_a results.
* g++.dg/gomp/pr36237.C: New test.
Added:
branches/gcc-4_3-branch/gcc/testsuite/g++.dg/gomp/pr36237.C
- copied unchanged from r135802,
trunk/gcc/testsuite/g++.dg/gomp/pr36237.C
Modified:
branches/gcc-4_3-branch/gcc/cp/ChangeLog
branches/gcc-4_3-branch/gcc/cp/cp-gimplify.c
branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
branches/gcc-4_3-branch/libgomp/testsuite/libgomp.c++/ctor-12.C
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36237
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/36237] internal compiler error: in lower_stmt, at gimple-low.c:282 erase 'private(localTodoStack)' it compiles successfully.
2008-05-14 21:06 [Bug c++/36237] New: internal compiler error: in lower_stmt, at gimple-low.c:282 silviug at gmail dot com
` (5 preceding siblings ...)
2008-05-23 13:32 ` jakub at gcc dot gnu dot org
@ 2008-05-23 13:33 ` jakub at gcc dot gnu dot org
2008-05-23 13:34 ` jakub at gcc dot gnu dot org
2008-12-28 4:17 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-05-23 13:33 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 |2008-05-23 13:32:37
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36237
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/36237] internal compiler error: in lower_stmt, at gimple-low.c:282 erase 'private(localTodoStack)' it compiles successfully.
2008-05-14 21:06 [Bug c++/36237] New: internal compiler error: in lower_stmt, at gimple-low.c:282 silviug at gmail dot com
` (6 preceding siblings ...)
2008-05-23 13:33 ` jakub at gcc dot gnu dot org
@ 2008-05-23 13:34 ` jakub at gcc dot gnu dot org
2008-12-28 4:17 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-05-23 13:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from jakub at gcc dot gnu dot org 2008-05-23 13:33 -------
Fixed in 4.4/4.3.
--
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=36237
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug c++/36237] internal compiler error: in lower_stmt, at gimple-low.c:282 erase 'private(localTodoStack)' it compiles successfully.
2008-05-14 21:06 [Bug c++/36237] New: internal compiler error: in lower_stmt, at gimple-low.c:282 silviug at gmail dot com
` (7 preceding siblings ...)
2008-05-23 13:34 ` jakub at gcc dot gnu dot org
@ 2008-12-28 4:17 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2008-12-28 4:17 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |4.3.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36237
^ permalink raw reply [flat|nested] 10+ messages in thread