public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/27337]  New: OpenMP ICE in expand_expr_real_1 at expr.c:6814
@ 2006-04-27 12:10 Klaas dot Vantournhout at UGent dot be
  2006-04-27 12:19 ` [Bug libgomp/27337] " Klaas dot Vantournhout at UGent dot be
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Klaas dot Vantournhout at UGent dot be @ 2006-04-27 12:10 UTC (permalink / raw)
  To: gcc-bugs

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

Hi,

I have obtained an ICE in expand_expr_real_1, at expr.c:6814 when trying to
build my code using OpenMP.  I am using gcc version "4.2.0 20060422
(experimental)" on target x86_64-unknown-linux-gnu.

The problem appears also in the FC5 gcc4.1.0 version "gcc (GCC) 4.1.0 20060304
(Red Hat 4.1.0-3)".

Below you find to pieces of code which produce the problem, as well as the
output of gcc -v -save-temps.

The ICE disapears when removing all openmp directives and headerfiles.  The ICE
disapears also when the function is a void instead of T1, and also if T1 is a
normal 'old' type.

If you need more info, just contact me.
With kind regards,
Klaas

<BEGIN code.cpp>
#include "t1.h"
#include <omp.h>

T1 function (void) {
  int ii,N;
  T1 temp(N);

#pragma omp parallel for
  for (ii = 0; ii < N; ii++) {
    temp(ii,ii) = ii;
  }

  return temp;
}
<END code.cpp>

<BEGIN t1.h>
#ifndef LINALG_H
#define T1_H

class T1 {
 public :
  T1(int);
  ~T1(void);
  double &operator()(int, int) const;
 private :
  double *a;
};

#endif
<END t1.h>

[klaas@node13 src]$ /usr/local/gcc4.2/bin/x86_64-unknown-linux-gnu-g++ -v
-save-temps -fopenmp -c code.cpp
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: /usr/local/src/gcc-4.2-20060422/configure
--prefix=/usr/local/gcc4.2 --enable-languages=c,c++
Thread model: posix
gcc version 4.2.0 20060422 (experimental)
 /usr/local/gcc4.2/libexec/gcc/x86_64-unknown-linux-gnu/4.2.0/cc1plus -E -quiet
-v -D_GNU_SOURCE -D_REENTRANT code.cpp -mtune=generic -fopenmp -fpch-preprocess
-o code.ii
ignoring nonexistent directory
"/usr/local/gcc4.2/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/../../../../x86_64-unknown-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:

/usr/local/gcc4.2/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/../../../../include/c++/4.2.0

/usr/local/gcc4.2/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/../../../../include/c++/4.2.0/x86_64-unknown-linux-gnu

/usr/local/gcc4.2/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/../../../../include/c++/4.2.0/backward
 /usr/local/include
 /usr/local/gcc4.2/include
 /usr/local/gcc4.2/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/include
 /usr/include
End of search list.
 /usr/local/gcc4.2/libexec/gcc/x86_64-unknown-linux-gnu/4.2.0/cc1plus
-fpreprocessed code.ii -quiet -dumpbase code.cpp -mtune=generic -auxbase code
-version -fopenmp -o code.s
GNU C++ version 4.2.0 20060422 (experimental) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.2.0 20060422 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 99a2733c59c8f6d329de89f75af46282
code.cpp: In function âT1 function()â:
code.cpp:6: internal compiler error: in expand_expr_real_1, at expr.c:6814
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions


-- 
           Summary: OpenMP ICE in expand_expr_real_1 at expr.c:6814
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Klaas dot Vantournhout at UGent dot be


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


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

* [Bug libgomp/27337] OpenMP ICE in expand_expr_real_1 at expr.c:6814
  2006-04-27 12:10 [Bug libgomp/27337] New: OpenMP ICE in expand_expr_real_1 at expr.c:6814 Klaas dot Vantournhout at UGent dot be
@ 2006-04-27 12:19 ` Klaas dot Vantournhout at UGent dot be
  2006-04-27 12:22 ` [Bug middle-end/27337] " jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Klaas dot Vantournhout at UGent dot be @ 2006-04-27 12:19 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from Klaas dot Vantournhout at UGent dot be  2006-04-27 12:19 -------
I forgot to state that in the FC5 version gcc (GCC) 4.1.0 20060304
(Red Hat 4.1.0-3) the ICE appears in expand_expr_real_1, at expr.c:6694.

Klaas


-- 


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


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

* [Bug middle-end/27337] OpenMP ICE in expand_expr_real_1 at expr.c:6814
  2006-04-27 12:10 [Bug libgomp/27337] New: OpenMP ICE in expand_expr_real_1 at expr.c:6814 Klaas dot Vantournhout at UGent dot be
  2006-04-27 12:19 ` [Bug libgomp/27337] " Klaas dot Vantournhout at UGent dot be
@ 2006-04-27 12:22 ` jakub at gcc dot gnu dot org
  2006-04-27 13:09 ` Klaas dot Vantournhout at UGent dot be
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-04-27 12:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2006-04-27 12:22 -------
OMP gimplification and lowering needs to handle RESULT_DECLs.
Simplified testcases e.g.:
struct S
{
  S ();
  ~S ();
  double &operator* () const;
};

S
foo ()
{
  int i;
  S ret;

#pragma omp parallel for
  for (i = 0; i < 2; i++)
    *ret += i;

  return ret;
}

or

struct S
{
  S ();
  ~S ();
  int i;
};

S
foo ()
{
  int i;
  S ret;

#pragma omp parallel for firstprivate (ret) lastprivate (ret)
  for (i = 0; i < 2; i++)
    ret.i += i;

  return ret;
}


-- 

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
          Component|libgomp                     |middle-end
     Ever Confirmed|0                           |1
           Keywords|                            |openmp
   Last reconfirmed|0000-00-00 00:00:00         |2006-04-27 12:22:43
               date|                            |


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


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

* [Bug middle-end/27337] OpenMP ICE in expand_expr_real_1 at expr.c:6814
  2006-04-27 12:10 [Bug libgomp/27337] New: OpenMP ICE in expand_expr_real_1 at expr.c:6814 Klaas dot Vantournhout at UGent dot be
  2006-04-27 12:19 ` [Bug libgomp/27337] " Klaas dot Vantournhout at UGent dot be
  2006-04-27 12:22 ` [Bug middle-end/27337] " jakub at gcc dot gnu dot org
@ 2006-04-27 13:09 ` Klaas dot Vantournhout at UGent dot be
  2006-05-02 10:45 ` jakub at gcc dot gnu dot org
  2006-05-02 10:48 ` jakub at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: Klaas dot Vantournhout at UGent dot be @ 2006-04-27 13:09 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from Klaas dot Vantournhout at UGent dot be  2006-04-27 13:09 -------
The first test case gives me the same error when using the flags -fopenmp -c. 
When I don't use -fopenmp, the code will compile.

The second test case gives me an other ICE.

code2.c: In function S foo():
code2.c:14: internal compiler error: tree check: expected tree that contains
decl common structure, have indirect_ref  in omp_add_variable, at
gimplify.c:4286

I don't know if this comment was usefull, or if these errors were obvious.

Greets
Klaas


-- 


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


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

* [Bug middle-end/27337] OpenMP ICE in expand_expr_real_1 at expr.c:6814
  2006-04-27 12:10 [Bug libgomp/27337] New: OpenMP ICE in expand_expr_real_1 at expr.c:6814 Klaas dot Vantournhout at UGent dot be
                   ` (2 preceding siblings ...)
  2006-04-27 13:09 ` Klaas dot Vantournhout at UGent dot be
@ 2006-05-02 10:45 ` jakub at gcc dot gnu dot org
  2006-05-02 10:48 ` jakub at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-05-02 10:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2006-05-02 10:45 -------
Subject: Bug 27337

Author: jakub
Date: Tue May  2 10:44:55 2006
New Revision: 113456

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=113456
Log:
        PR middle-end/27337
        * gimplify.c (gimplify_scan_omp_clauses): Handle INDIRECT_REF
        around RESULT_DECL for result passed by reference.
        (gimplify_expr): Call omp_notice_variable when RESULT_DECL is seen.
        * omp-low.c (use_pointer_for_field): Don't look at
        DECL_HAS_VALUE_EXPR_P for RESULT_DECLs.
        (scan_omp_1): Call remap_decl on RESULT_DECLs.
        (lower_rec_input_clauses): Don't allocate VLA memory for the second
        time or var for passing by reference for
        OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE clauses.  Allow creation of
        TREE_ADDRESSABLE variables when passing by reference.

        * omp-low.c (dump_omp_region): Fix output formatting.
cp/
        * cp-gimplify.c (cxx_omp_privatize_by_reference): New function.
        * cp-tree.h (cxx_omp_privatize_by_reference): New prototype.
        * cp-objcp-common.h (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Define.
testsuite/
        * g++.dg/gomp/pr27337-1.C: New test.
        * g++.dg/gomp/pr27337-2.C: New test.
libgomp/
        * testsuite/libgomp.c++/pr27337.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/gomp/pr27337-1.C
    trunk/gcc/testsuite/g++.dg/gomp/pr27337-2.C
    trunk/libgomp/testsuite/libgomp.c++/pr27337.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-gimplify.c
    trunk/gcc/cp/cp-objcp-common.h
    trunk/gcc/cp/cp-tree.h
    trunk/gcc/gimplify.c
    trunk/gcc/omp-low.c
    trunk/gcc/testsuite/ChangeLog
    trunk/libgomp/ChangeLog


-- 


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


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

* [Bug middle-end/27337] OpenMP ICE in expand_expr_real_1 at expr.c:6814
  2006-04-27 12:10 [Bug libgomp/27337] New: OpenMP ICE in expand_expr_real_1 at expr.c:6814 Klaas dot Vantournhout at UGent dot be
                   ` (3 preceding siblings ...)
  2006-05-02 10:45 ` jakub at gcc dot gnu dot org
@ 2006-05-02 10:48 ` jakub at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu dot org @ 2006-05-02 10:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2006-05-02 10:48 -------
Fixed in SVN.


-- 

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=27337


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

end of thread, other threads:[~2006-05-02 10:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-27 12:10 [Bug libgomp/27337] New: OpenMP ICE in expand_expr_real_1 at expr.c:6814 Klaas dot Vantournhout at UGent dot be
2006-04-27 12:19 ` [Bug libgomp/27337] " Klaas dot Vantournhout at UGent dot be
2006-04-27 12:22 ` [Bug middle-end/27337] " jakub at gcc dot gnu dot org
2006-04-27 13:09 ` Klaas dot Vantournhout at UGent dot be
2006-05-02 10:45 ` jakub at gcc dot gnu dot org
2006-05-02 10:48 ` jakub 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).