public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/32362]  New: ICE - gfortran in lookup_decl_in_outer_ctx, at omp-low.c:1508
@ 2007-06-15 21:49 longb at cray dot com
  2007-06-15 23:47 ` [Bug fortran/32362] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: longb at cray dot com @ 2007-06-15 21:49 UTC (permalink / raw)
  To: gcc-bugs

Description:
This test case derived from OpenMP test omp1/F2_2_9h.f90, involves nested
parallel loops.  The gfortran compiler currently aborts with an internal
error for this code.

> gfortran -v
Using built-in specs.
Target: x86_64-suse-linux
Configured with: ../xt-gcc-4.2.0/configure --prefix=/opt/gcc/4.2.0/snos
--disable-nls --libdir=/opt/gcc/4.2.0/snos/lib --enable-languages=c,c++,fortran
--with-gxx-include-dir=/opt/gcc/4.2.0/snos/include/g++
--with-slibdir=/opt/gcc/4.2.0/snos/lib --with-system-zlib --enable-shared
--enable-__cxa_atexit x86_64-suse-linux
Thread model: posix
gcc version 4.2.0 20070514 (rpm:4)


> cat bug2830.f90
! Derived from OpenMP test omp1/F2_2_9h.f90
      use omp_lib
      implicit none
      integer, parameter :: NT = 4
      integer :: nThreads(NT)
      integer :: i, tmp = 1, itmp = 0
!$    call omp_set_dynamic(.false.)
!$    call omp_set_num_threads(NT)
      do i = 1, NT
          nThreads(i) = 0
      enddo
!$omp parallel private(itmp)
      itmp = omp_get_thread_num() + 1
!$omp parallel firstprivate(tmp)
      tmp = tmp + omp_get_thread_num() + 1
!$omp atomic
      nThreads(itmp) = nThreads(itmp)+tmp
!$omp end parallel
!$omp end parallel
      print *, nThreads
      END
> ftn -fopenmp -c bug2830.f90
/opt/xt-pe/2.1/bin/snos64/ftn: INFO: linux target is being used
bug2830.f90: In function 'MAIN__':
bug2830.f90:16: internal compiler error: in lookup_decl_in_outer_ctx, at
omp-low.c:1508
Please submit a full bug report,
with preprocessed source if appropriate.

------
Note: ftn is an alias for:

/opt/gcc/4.2.0/bin/../snos/bin/gfortran -static -v
-I/opt/xt-mpt/2.1/mpich2-64/GP/include -I/opt/xt-mpt/2.1/mpich2-64/GP/include
-L/opt/xt-mpt/2.1/mpich2-64/GP/lib -I/opt/acml/3.6.1/gnu64/include
-I/opt/xt-libsci/10.1.0/gnu/snos64/include
-I/opt/xt-libsci/10.1.0/gnu/snos64/include/superlu
-I/opt/xt-mpt/2.1/sma/P/include -L/opt/acml/3.6.1/gnu64/lib
-L/opt/xt-libsci/10.1.0/gnu/snos64/lib -L/opt/xt-mpt/2.1/sma/P/lib -lmpichf90
-lsci -lacml -lsma -lmpichf90 -lmpich -lrt -D__CRAYXT_COMPUTE_LINUX_TARGET
-D__TARGET_LINUX__ -fno-second-underscore
-I/notbackedup/users/rsrel/rs64.DEV.070604.Mon/install/include
-I/opt/xt-catamount/2.1/catamount/linux/include -I/opt/xt-service/2.1/include
-L/notbackedup/users/rsrel/rs64.DEV.070604.Mon/install/lib/snos64
-L/opt/xt-pe/2.1/cnos/linux/64/lib -L/opt/xt-mpt/2.1/lib/snos64
-L/opt/xt-service/2.1/lib/snos64 -Wl,--start -lpct -lalpslli -lalpsutil
-lportals -lpthread -Wl,--end -lgfortranbegin -lgfortran -lm


-- 
           Summary: ICE - gfortran in lookup_decl_in_outer_ctx, at omp-
                    low.c:1508
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: major
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: longb at cray dot com
 GCC build triplet: x86_64-suse-linux
  GCC host triplet: x86_64-suse-linux
GCC target triplet: x86_64-suse-linux


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


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

* [Bug fortran/32362] ICE - gfortran in lookup_decl_in_outer_ctx, at omp-low.c:1508
  2007-06-15 21:49 [Bug fortran/32362] New: ICE - gfortran in lookup_decl_in_outer_ctx, at omp-low.c:1508 longb at cray dot com
@ 2007-06-15 23:47 ` pinskia at gcc dot gnu dot org
  2007-06-16  7:05 ` [Bug middle-end/32362] ICE: " burnus at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-06-15 23:47 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|major                       |normal
           Keywords|                            |openmp


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


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

* [Bug middle-end/32362] ICE: in lookup_decl_in_outer_ctx, at omp-low.c:1508
  2007-06-15 21:49 [Bug fortran/32362] New: ICE - gfortran in lookup_decl_in_outer_ctx, at omp-low.c:1508 longb at cray dot com
  2007-06-15 23:47 ` [Bug fortran/32362] " pinskia at gcc dot gnu dot org
@ 2007-06-16  7:05 ` burnus at gcc dot gnu dot org
  2007-06-20 14:25 ` jakub at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-06-16  7:05 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2007-06-16 07:05 -------
Work around for Fortran:
-       integer :: i, tmp = 1, itmp = 0
+       integer :: i, tmp, itmp
+       tmp = 1; itmp = 0


Reduced C test case below. The problem is that itmp and tmp are static.

#include <omp.h>

int main()
{
  int nthreads[4];
  static int tmp, itmp;
  omp_set_num_threads (4);
  #pragma omp parallel private(itmp)
  {
    itmp = omp_get_thread_num ();
    #pragma omp parallel firstprivate(tmp)
    {
      tmp = (omp_get_thread_num () + tmp) + 1;
    }
  }
}


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
          Component|fortran                     |middle-end
     Ever Confirmed|0                           |1
  GCC build triplet|x86_64-suse-linux           |
   GCC host triplet|x86_64-suse-linux           |
 GCC target triplet|x86_64-suse-linux           |
           Keywords|                            |ice-on-valid-code
      Known to fail|                            |4.2.0 4.3.0
   Last reconfirmed|0000-00-00 00:00:00         |2007-06-16 07:05:39
               date|                            |
            Summary|ICE - gfortran in           |ICE: in
                   |lookup_decl_in_outer_ctx, at|lookup_decl_in_outer_ctx, at
                   |omp-low.c:1508              |omp-low.c:1508


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


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

* [Bug middle-end/32362] ICE: in lookup_decl_in_outer_ctx, at omp-low.c:1508
  2007-06-15 21:49 [Bug fortran/32362] New: ICE - gfortran in lookup_decl_in_outer_ctx, at omp-low.c:1508 longb at cray dot com
  2007-06-15 23:47 ` [Bug fortran/32362] " pinskia at gcc dot gnu dot org
  2007-06-16  7:05 ` [Bug middle-end/32362] ICE: " burnus at gcc dot gnu dot org
@ 2007-06-20 14:25 ` jakub at gcc dot gnu dot org
  2007-06-21 12:11 ` jakub at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-06-20 14:25 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|NEW                         |ASSIGNED
   Last reconfirmed|2007-06-16 07:05:39         |2007-06-20 14:25:06
               date|                            |


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


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

* [Bug middle-end/32362] ICE: in lookup_decl_in_outer_ctx, at omp-low.c:1508
  2007-06-15 21:49 [Bug fortran/32362] New: ICE - gfortran in lookup_decl_in_outer_ctx, at omp-low.c:1508 longb at cray dot com
                   ` (2 preceding siblings ...)
  2007-06-20 14:25 ` jakub at gcc dot gnu dot org
@ 2007-06-21 12:11 ` jakub at gcc dot gnu dot org
  2007-06-21 12:16 ` jakub at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-06-21 12:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jakub at gcc dot gnu dot org  2007-06-21 12:11 -------
Subject: Bug 32362

Author: jakub
Date: Thu Jun 21 12:11:00 2007
New Revision: 125917

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125917
Log:
        PR middle-end/32362
        * omp-low.c (lookup_decl_in_outer_ctx): Don't ICE if t is NULL,
        but decl is a global var, instead return decl.
        * gimplify.c (gimplify_adjust_omp_clauses_1): Add shared clauses
        even for is_global_var decls, if they are private in some outer
        context.

        * testsuite/libgomp.c/pr32362-1.c: New test.
        * testsuite/libgomp.c/pr32362-2.c: New test.
        * testsuite/libgomp.c/pr32362-3.c: New test.

Added:
    trunk/libgomp/testsuite/libgomp.c/pr32362-1.c
    trunk/libgomp/testsuite/libgomp.c/pr32362-2.c
    trunk/libgomp/testsuite/libgomp.c/pr32362-3.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/gimplify.c
    trunk/gcc/omp-low.c
    trunk/libgomp/ChangeLog


-- 


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


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

* [Bug middle-end/32362] ICE: in lookup_decl_in_outer_ctx, at omp-low.c:1508
  2007-06-15 21:49 [Bug fortran/32362] New: ICE - gfortran in lookup_decl_in_outer_ctx, at omp-low.c:1508 longb at cray dot com
                   ` (3 preceding siblings ...)
  2007-06-21 12:11 ` jakub at gcc dot gnu dot org
@ 2007-06-21 12:16 ` jakub at gcc dot gnu dot org
  2007-06-21 12:24 ` jakub at gcc dot gnu dot org
  2007-07-02 12:04 ` jakub at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-06-21 12:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jakub at gcc dot gnu dot org  2007-06-21 12:16 -------
Subject: Bug 32362

Author: jakub
Date: Thu Jun 21 12:15:53 2007
New Revision: 125918

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125918
Log:
        PR middle-end/32362
        * omp-low.c (lookup_decl_in_outer_ctx): Don't ICE if t is NULL,
        but decl is a global var, instead return decl.
        * gimplify.c (gimplify_adjust_omp_clauses_1): Add shared clauses
        even for is_global_var decls, if they are private in some outer
        context.

        * testsuite/libgomp.c/pr32362-1.c: New test.
        * testsuite/libgomp.c/pr32362-2.c: New test.
        * testsuite/libgomp.c/pr32362-3.c: New test.

Added:
    branches/gcc-4_2-branch/libgomp/testsuite/libgomp.c/pr32362-1.c
    branches/gcc-4_2-branch/libgomp/testsuite/libgomp.c/pr32362-2.c
    branches/gcc-4_2-branch/libgomp/testsuite/libgomp.c/pr32362-3.c
Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/gimplify.c
    branches/gcc-4_2-branch/gcc/omp-low.c
    branches/gcc-4_2-branch/libgomp/ChangeLog


-- 


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


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

* [Bug middle-end/32362] ICE: in lookup_decl_in_outer_ctx, at omp-low.c:1508
  2007-06-15 21:49 [Bug fortran/32362] New: ICE - gfortran in lookup_decl_in_outer_ctx, at omp-low.c:1508 longb at cray dot com
                   ` (4 preceding siblings ...)
  2007-06-21 12:16 ` jakub at gcc dot gnu dot org
@ 2007-06-21 12:24 ` jakub at gcc dot gnu dot org
  2007-07-02 12:04 ` jakub at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-06-21 12:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jakub at gcc dot gnu dot org  2007-06-21 12:24 -------
Fixed.


-- 

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


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

* [Bug middle-end/32362] ICE: in lookup_decl_in_outer_ctx, at omp-low.c:1508
  2007-06-15 21:49 [Bug fortran/32362] New: ICE - gfortran in lookup_decl_in_outer_ctx, at omp-low.c:1508 longb at cray dot com
                   ` (5 preceding siblings ...)
  2007-06-21 12:24 ` jakub at gcc dot gnu dot org
@ 2007-07-02 12:04 ` jakub at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu dot org @ 2007-07-02 12:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from jakub at gcc dot gnu dot org  2007-07-02 12:04 -------
*** Bug 32551 has been marked as a duplicate of this bug. ***


-- 


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


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

end of thread, other threads:[~2007-07-02 12:04 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-06-15 21:49 [Bug fortran/32362] New: ICE - gfortran in lookup_decl_in_outer_ctx, at omp-low.c:1508 longb at cray dot com
2007-06-15 23:47 ` [Bug fortran/32362] " pinskia at gcc dot gnu dot org
2007-06-16  7:05 ` [Bug middle-end/32362] ICE: " burnus at gcc dot gnu dot org
2007-06-20 14:25 ` jakub at gcc dot gnu dot org
2007-06-21 12:11 ` jakub at gcc dot gnu dot org
2007-06-21 12:16 ` jakub at gcc dot gnu dot org
2007-06-21 12:24 ` jakub at gcc dot gnu dot org
2007-07-02 12:04 ` 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).