Bug 33282 - [4.2] ICE in find_array_section when using vector subscripts
Summary: [4.2] ICE in find_array_section when using vector subscripts
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.2.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-02 16:43 UTC by rainy6144
Modified: 2007-09-03 10:42 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rainy6144 2007-09-02 16:43:52 UTC
The following Fortran 90 program crashes gfortran-4.2.1:

program test
     real(kind=8),parameter :: beta0(3) = (/ 1.0, 1.0, 1.0 /)
     integer :: i(3)
     real(kind=8) :: beta(3), beta_coef

     i = (/ 1, 2, 3 /)
     beta_coef = 1.0
     beta = beta0(i) * beta_coef
end program test

(Workaround: "beta = beta0(i) ; beta = beta * beta_coef")

Compiler output:

$ gfortran -g -O2 -march=pentium4 -mfpmath=sse -ffree-form -ffree-line-length-none -Wall -W -Wno-unused -Wimplicit-interface -Wtabs -fimplicit-none -ffpe-trap=invalid,zero,overflow -o arraybug arraybug.f90
arraybug.f90:0: internal compiler error: in find_array_section, at fortran/expr.c:1079
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

$ gfortran -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.2.1/configure --prefix=/home/r6144/apps/gcc-4.2.1 --enable-languages=c,fortran --with-mpfr=/home/r6144/apps/mpfr-2.3.0 --disable-bootstrap
Thread model: posix
gcc version 4.2.1

$ gfortran --version
GNU Fortran (GCC) 4.2.1
Copyright (C) 2007 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
Comment 1 Tobias Burnus 2007-09-02 18:12:54 UTC
Could you try with GCC gfortran 4.3.0? I can reproduce the problem with gfortran 4.2.x but not with gfortran 4.3.0 which indicates that this has been fixed meanwhile.

If you don't want to build GCC yourself (as you seem to do), you can use the binaries from
http://gcc.gnu.org/wiki/GFortranBinaries
Comment 2 rainy6144 2007-09-02 18:38:30 UTC
Thank you.  The bug appears to have been fixed in the latest 4.3.0 snapshot (r128023).
Comment 3 Francois-Xavier Coudert 2007-09-03 10:42:59 UTC
Unless this is a regression, won't be fixed.