public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/32177]  New: g++ crashes on some valid OpenMP code
@ 2007-06-01 10:21 theodore dot papadopoulo at sophia dot inria dot fr
  2007-06-01 10:22 ` [Bug c++/32177] " theodore dot papadopoulo at sophia dot inria dot fr
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: theodore dot papadopoulo at sophia dot inria dot fr @ 2007-06-01 10:21 UTC (permalink / raw)
  To: gcc-bugs

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

This is with gcc version 4.3.0 20070528 (experimental) and gcc-4.1.1 (redhat
FC5 version). I suspect it is also true for all intermediate versions...
The attached program when compiled with g++ and the flags -fopenmp gives the
following diagnostic and aborts compilation:

futuna-> /usr/local/gcc-4.3/bin/g++ -fopenmp BugOMP1.C
BugOMP1.C: In function ‘void f()’:
BugOMP1.C:14: 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.

There is an obvious workaround in this case: remove the A().s() call from the
loop. This is related to the destructor in class A (suppress it and the problem
disappears). The problem is that lower_stmt is presented with a
WITH_CLEANUP_EXPR node which it is not prepared to handle. I suspect that with
-fopenmp g++ does not create a valid gimple code in this case...

I tried the dubious "make lower_stmt do nothing with this code" and, of course,
something else fails afterwards.


-- 
           Summary: g++ crashes on some valid OpenMP code
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: theodore dot papadopoulo at sophia dot inria dot fr
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

* [Bug c++/32177] g++ crashes on some valid OpenMP code
  2007-06-01 10:21 [Bug c++/32177] New: g++ crashes on some valid OpenMP code theodore dot papadopoulo at sophia dot inria dot fr
@ 2007-06-01 10:22 ` theodore dot papadopoulo at sophia dot inria dot fr
  2007-06-01 11:28 ` rguenth at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: theodore dot papadopoulo at sophia dot inria dot fr @ 2007-06-01 10:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from theodore dot papadopoulo at sophia dot inria dot fr  2007-06-01 10:22 -------
Created an attachment (id=13644)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=13644&action=view)
The source code showing the potential bug....


-- 


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


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

* [Bug c++/32177] g++ crashes on some valid OpenMP code
  2007-06-01 10:21 [Bug c++/32177] New: g++ crashes on some valid OpenMP code theodore dot papadopoulo at sophia dot inria dot fr
  2007-06-01 10:22 ` [Bug c++/32177] " theodore dot papadopoulo at sophia dot inria dot fr
  2007-06-01 11:28 ` rguenth at gcc dot gnu dot org
@ 2007-06-01 11:28 ` rguenth at gcc dot gnu dot org
  2007-06-06 18:03 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-06-01 11:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2007-06-01 11:28 -------
We have a

 <with_cleanup_expr 0x2aadb4071380
    type <void_type 0x2aadb3ecf240 void VOID
        align 8 symtab 0 alias set -1 canonical type 0x2aadb3ecf240
        pointer_to_this <pointer_type 0x2aadb3ecf300>>
    side-effects
    arg 0 <call_expr 0x2aadb3eb0a50 type <void_type 0x2aadb3ecf240 void>
        side-effects nothrow
        fn <addr_expr 0x2aadb4071140 type <pointer_type 0x2aadb406a900>
            constant invariant arg 0 <function_decl 0x2aadb4069000 __comp_dtor
>>
        arg 0 <addr_expr 0x2aadb4071100 type <pointer_type 0x2aadb4061780>
            invariant arg 0 <var_decl 0x2aadb406f160 D.2557>>
        t.ii:8>>

that we don't handle in lower_stmt ().  The complete fn looks like

{
  try
    {
      __comp_ctor  (&D.2557);
      <<< Unknown tree: with_cleanup_expr
  __comp_dtor  (&D.2557) >>>
;
      D.2559 = s (&D.2557);
      D.2565 = D.2559;
      #pragma omp for nowait
      for (i = 1; i <= D.2565; i = i + 1)
      OMP_CONTINUE
    }
  catch
    {
      <<<eh_filter ()>>>
        {
          terminate ();
        }
    }
  OMP_RETURN [nowait]
}


-- 


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


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

* [Bug c++/32177] g++ crashes on some valid OpenMP code
  2007-06-01 10:21 [Bug c++/32177] New: g++ crashes on some valid OpenMP code theodore dot papadopoulo at sophia dot inria dot fr
  2007-06-01 10:22 ` [Bug c++/32177] " theodore dot papadopoulo at sophia dot inria dot fr
@ 2007-06-01 11:28 ` rguenth at gcc dot gnu dot org
  2007-06-01 11:28 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-06-01 11:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from rguenth at gcc dot gnu dot org  2007-06-01 11:28 -------
Confirmed.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-06-01 11:28:27
               date|                            |


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


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

* [Bug c++/32177] g++ crashes on some valid OpenMP code
  2007-06-01 10:21 [Bug c++/32177] New: g++ crashes on some valid OpenMP code theodore dot papadopoulo at sophia dot inria dot fr
                   ` (2 preceding siblings ...)
  2007-06-01 11:28 ` rguenth at gcc dot gnu dot org
@ 2007-06-06 18:03 ` jakub at gcc dot gnu dot org
  2007-06-07 23:11 ` jakub at gcc dot gnu dot org
  2007-06-11 22:00 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-06-06 18:03 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                     |
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2007-
                   |                            |06/msg00367.html
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-06-01 11:28:27         |2007-06-06 18:02:44
               date|                            |


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


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

* [Bug c++/32177] g++ crashes on some valid OpenMP code
  2007-06-01 10:21 [Bug c++/32177] New: g++ crashes on some valid OpenMP code theodore dot papadopoulo at sophia dot inria dot fr
                   ` (3 preceding siblings ...)
  2007-06-06 18:03 ` jakub at gcc dot gnu dot org
@ 2007-06-07 23:11 ` jakub at gcc dot gnu dot org
  2007-06-11 22:00 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-06-07 23:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2007-06-07 23:11 -------
Subject: Bug 32177

Author: jakub
Date: Thu Jun  7 23:11:23 2007
New Revision: 125544

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125544
Log:
        PR c++/32177
        * semantics.c (finish_omp_for): Call fold_build_cleanup_point_expr
        on init, the non-decl cond operand and increment value.

        * g++.dg/gomp/pr32177.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/gomp/pr32177.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/semantics.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug c++/32177] g++ crashes on some valid OpenMP code
  2007-06-01 10:21 [Bug c++/32177] New: g++ crashes on some valid OpenMP code theodore dot papadopoulo at sophia dot inria dot fr
                   ` (4 preceding siblings ...)
  2007-06-07 23:11 ` jakub at gcc dot gnu dot org
@ 2007-06-11 22:00 ` pinskia at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-11 22:00 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2007-06-11 21:59 -------
Fixed.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.3.0


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


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

end of thread, other threads:[~2007-06-11 22:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-01 10:21 [Bug c++/32177] New: g++ crashes on some valid OpenMP code theodore dot papadopoulo at sophia dot inria dot fr
2007-06-01 10:22 ` [Bug c++/32177] " theodore dot papadopoulo at sophia dot inria dot fr
2007-06-01 11:28 ` rguenth at gcc dot gnu dot org
2007-06-01 11:28 ` rguenth at gcc dot gnu dot org
2007-06-06 18:03 ` jakub at gcc dot gnu dot org
2007-06-07 23:11 ` jakub at gcc dot gnu dot org
2007-06-11 22:00 ` 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).