- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
dear all
the following code is segfaulting.
thanks
v
ifort -v
ifort version 14.0.1
cat ifort_14.0.1_reduction.f90
program test
interface
subroutine sub (a, c, n)
integer :: n
integer, allocatable :: a(:), c(:)
end subroutine
end interface
integer, allocatable :: a(:), c(:)
integer :: i, j
allocate (a(5), c(5))
call sub (a, c, 5)
end program test
subroutine sub (a, c, n)
integer :: n
integer, allocatable :: a(:), c(:)
!$omp parallel do shared(a) reduction(+:c)
do i = 1, n
c(a(i)) = c(a(i)) + 1
end do
end subroutine sub
ifort -openmp ifort_14.0.1_reduction.f90
ifort_14.0.1_reduction.f90: catastrophic error: **Internal compiler error: segmentation violation signal raised** Please report this error along with the circumstances in which it occurred in a Software Problem Report. Note: File and line given may not be explicit cause of this error.
compilation aborted for ifort_14.0.1_reduction.f90 (code 1)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You are using a(i) as and index of c(:)
Although a and c have been allocated, a has not been initialized (i.e. you are using junk indexes from a(i))
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
does that explain the ICE?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, it doesn't. I will report the ICE to the developers. Issue ID is DPD200250515. I assume your complaint is about the internal compiler error and not execution of the code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
As the ICE goes away with -fno-inline-functions, I buy Jim's suggestion that interprocedural optimization on undefined data may be implicated. Of course, it would be desirable for the compiler to give some diagnostic rather than an ICE.
This seems to be a difficult corner of OpenMP. Note that the corresponding C version isn't allowed.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page