Bug 56655 - [F03] ASSOCIATE construct with OpenMP triggers ICE
Summary: [F03] ASSOCIATE construct with OpenMP triggers ICE
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.8.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: openmp
Depends on:
Blocks:
 
Reported: 2013-03-20 00:55 UTC by Rich Townsend
Modified: 2014-05-02 10:28 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.10.0, 4.9.0
Known to fail: 4.8.2
Last reconfirmed: 2014-01-07 00:00:00


Attachments
Test source file to reproduce the error (652 bytes, text/x-fortran)
2013-03-20 00:55 UTC, Rich Townsend
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rich Townsend 2013-03-20 00:55:47 UTC
Created attachment 29692 [details]
Test source file to reproduce the error

Attempting to compile the attached file with

gfortran -fopenmp -c openmp_ice.f90

...gives the following result:

openmp_ice.f90: In function ‘sub’:
openmp_ice.f90:8:0: internal compiler error: in omp_add_variable, at gimplify.c:5894
   associate(x_a => x)
 ^

openmp_ice.f90:8:0: internal compiler error: Abort trap: 6
gfortran.exec: internal compiler error: Abort trap: 6 (program f951)
/Applications/madsdk/bin/gfortran: line 7: 16428 Abort trap: 6           /Applications/madsdk/bin/gfortran.exec -fopenmp -c openmp_ice.f90

This may be related to PR 56062. My system:

Using built-in specs.
COLLECT_GCC=/Applications/madsdk/bin/gfortran.exec
COLLECT_LTO_WRAPPER=/Applications/madsdk/libexec/gcc/x86_64-apple-darwin11.4.2/4.8.0/lto-wrapper
Target: x86_64-apple-darwin11.4.2
Configured with: ./configure CC='gcc -D_FORTIFY_SOURCE=0' --build=x86_64-apple-darwin11.4.2 --prefix=/Applications/madsdk --with-gmp=/Applications/madsdk --with-mpfr=/Applications/madsdk --with-mpc=/Applications/madsdk --enable-languages=c,c++,fortran --disable-multilib
Thread model: posix
gcc version 4.8.0 20130307 (experimental) (GCC)
Comment 1 janus 2013-03-20 09:47:22 UTC
(In reply to comment #0)
> Created attachment 29692 [details]
> Test source file to reproduce the error
> 
> Attempting to compile the attached file with
> 
> gfortran -fopenmp -c openmp_ice.f90

The file in the attachment is called 'test_h5_attr.f90' and I don't find any ASSOCIATE construct in there. Wrong file attached?
Comment 2 Rich Townsend 2013-03-20 13:25:15 UTC
(In reply to comment #1)
> (In reply to comment #0)
> > Created attachment 29692 [details]
> > Test source file to reproduce the error
> > 
> > Attempting to compile the attached file with
> > 
> > gfortran -fopenmp -c openmp_ice.f90
> 
> The file in the attachment is called 'test_h5_attr.f90' and I don't find any
> ASSOCIATE construct in there. Wrong file attached?

(In reply to comment #1)
> (In reply to comment #0)
> > Created attachment 29692 [details]
> > Test source file to reproduce the error
> > 
> > Attempting to compile the attached file with
> > 
> > gfortran -fopenmp -c openmp_ice.f90
> 
> The file in the attachment is called 'test_h5_attr.f90' and I don't find any
> ASSOCIATE construct in there. Wrong file attached?

Ooops -- wrong test case. Here it is:

subroutine sub (x)

  implicit none

  real, intent(in) :: x

  !$omp single
  associate(x_a => x)
  end associate
  !$omp end single 

end subroutine sub
Comment 3 janus 2013-03-20 14:27:55 UTC
Note: OpenMP 3.1 does not handle any of Fortran 2003.

In the current draft of OpenMP 4.0 (RC2), cf. http://openmp.org/wp/openmp-specifications/, many F03 features are still not supported. However, ASSOCIATE actually seems to be supported.
Comment 4 janus 2013-08-12 12:50:50 UTC
The final specification of OpenMP 4.0 has been published by now and apparently supports the ASSOCIATE construct.
Comment 5 Dominique d'Humieres 2014-01-07 10:00:58 UTC
The test in comment 2 compiles with r206348. I doubt the fix (OpenMP 4.0?) will be back ported to 4.8. Closing as FIXED?
Comment 6 Dominique d'Humieres 2014-05-02 10:28:57 UTC
>The test in comment 2 compiles with r206348. I doubt the fix (OpenMP 4.0?)
> will be back ported to 4.8. Closing as FIXED?

The original test also compiles and runs with 4.9.0 and trunk (4.10, r210000). No answer for more than three months. Closing as FIXED.