public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/36237]  New: internal compiler error: in lower_stmt, at gimple-low.c:282
@ 2008-05-14 21:06 silviug at gmail dot com
  2008-05-14 21:07 ` [Bug c++/36237] " silviug at gmail dot com
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: silviug at gmail dot com @ 2008-05-14 21:06 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2036 bytes --]

* the exact version of GCC;
* the system type;
* the options given when GCC was configured/built;

The output of g++ -v is:
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--with-gxx-include-dir=/usr/include/c++/4.2 --program-suffix=-4.2
--enable-clocale=gnu --enable-libstdcxx-debug --enable-objc-gc --enable-mpfr
--enable-targets=all --enable-checking=release --build=i486-linux-gnu
--host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.2.3 (Ubuntu 4.2.3-2ubuntu7)

* the complete command line that triggers the bug;

The command is simply `make' wich will turn into:
    g++ -Wall -O0 -fopenmp qsort_openmp_v2.cpp utils.o -o qsort_openmp_v2

* the compiler output (error messages, warnings, etc.); and

qsort_openmp_v2.cpp: In function ‘int main(int, char**)’:
qsort_openmp_v2.cpp:0: internal compiler error: in lower_stmt, at
gimple-low.c:282
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.2/README.Bugs>.
make: *** [qsort_openmp_v2] Error 1


* the preprocessed file (*.i*) that triggers the bug, generated by adding
-save-temps to the complete compilation command, or, in the case of a bug
report for the GNAT front end, a complete set of source files (see below).

I will attach them.


-- 
           Summary: internal compiler error: in lower_stmt, at gimple-
                    low.c:282
           Product: gcc
           Version: 4.2.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: silviug at gmail dot com


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 ` 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

end of thread, other threads:[~2008-12-28  4:17 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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
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

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).