Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
28632 Discussions

compiler segfault with nested reshape of an array

wim_van_hoydonck
Beginner
708 Views

Hi,

The following test program segfaults with ifort versions 11.1 20100414 and 10.1 20090203.

Workaround is included.

Kind regards,

Wim

!=======================
[fortran]program reshape_bug implicit none integer , parameter :: dp = selected_real_kind(p=13,r=300) ! this should generate a 4-by-2 array with the elements ordered ! in the way they are shown: ! -> abscissas in the first column and ! -> weights in the second column ! this segfaults ifort version 10.1 and 11.1 real(dp) , parameter :: gl_xw002(4,2) = reshape( reshape( [ & -8.61136311594052575223e-1_dp , 3.47854845137453857373e-1_dp , & -3.39981043584856264802e-1_dp , 6.52145154862546142626e-1_dp , & 3.39981043584856264802e-1_dp , 6.52145154862546142626e-1_dp , & 8.61136311594052575223e-1_dp , 3.47854845137453857373e-1_dp & ] , shape=[2,4] , order=[1,2] ), shape=[4,2], order=[2,1] ) ! workaround: ! store the abscissas and weights in separate arrays and concatenate those real(dp) , parameter :: gl_x001(4) = [ & -8.61136311594052575223e-1_dp , & -3.39981043584856264802e-1_dp , & 3.39981043584856264802e-1_dp , & 8.61136311594052575223e-1_dp & ] real(dp) , parameter :: gl_w001(4) = [ & 3.47854845137453857373e-1_dp , & 6.52145154862546142626e-1_dp , & 6.52145154862546142626e-1_dp , & 3.47854845137453857373e-1_dp & ] real(dp) , parameter :: gl_xw003(4,2) = reshape([gl_x001,gl_w001],shape=[4,2],order=[1,2]) integer :: i do i = 1,size(gl_xw003,dim=1) print *, gl_xw003(i,:) end do end program reshape_bug [/fortran] !===============================


0 Kudos
6 Replies
Kevin_D_Intel
Employee
708 Views
Hi Wim - Thank you for the convenient reproducer. Just to be certain, can you confirmthe error I showed below is the same error you suffered?

The 11.1 and 10.1 compilers I tested suffer an internal compiler error as shown but not a segfault as you reported.

$ ifort -V -c reshape_bug.f90

Intel Fortran Intel 64 Compiler Professional for applications running on Intel 64, Version 11.1 Build 20100414 Package ID: l_cprof_p_11.1.072
Copyright (C) 1985-2010 Intel Corporation. All rights reserved.

Intel Fortran 11.1-2739
reshape_bug.f90(10): internal error: Please visit 'http://www.intel.com/software/products/support' for assistance.
real(dp) , parameter :: gl_xw002(4,2) = reshape( reshape( [ &
^
[ Aborting due to internal error. ]

compilation aborted for reshape_bug.f90 (code 1)

0 Kudos
wim_van_hoydonck
Beginner
708 Views

Hi Kevin,

You're right. It's not a segfault, but an internal error.

Regards,

Wim

0 Kudos
Kevin_D_Intel
Employee
708 Views

Thank you for confirming, Wim. I reported this to development (under the internal tracking id below) and will update asI learn more.

(Internal tracking id: DPD200159382)

(Resolution Update on 10/14/2012): This defect is fixed in the Intel® Fortran Composer XE 2013 Initial Release (2013.0.0.079 - Linux)
0 Kudos
wim_van_hoydonck
Beginner
708 Views
Hi Kevin,

This error has been reportedasissue number 599518 with the support account of
my employer.

Regards,

Wim
0 Kudos
Kevin_D_Intel
Employee
708 Views
Thank you for the note, Wim.We've associated both this forum thread and the Premier issue you note with the same internal tracking id noted earlier in this forum thread. We'll keep both updated regarding a fix as we learn it.
0 Kudos
Kevin_D_Intel
Employee
708 Views
The internal error reported in this thread is fixed in our current Intel® Fortran Composer XE 2013 Initial Release (2013.0.0.079 - Linux).
0 Kudos
Reply