another ICE derived from CP2K (PR 29975) gfortran testcase.cell_types.f90 testcase.cell_types.f90: In function ‘pbc3’: testcase.cell_types.f90:22: internal compiler error: in gfc_trans_assignment_1, at fortran/trans-expr.c:3877 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. vondele@pcihopt1:/scratch/vondele/tmp> cat testcase.cell_types.f90 MODULE cell_types INTEGER, PARAMETER :: dp=KIND(0.0D0) TYPE cell_type !FM to rm REAL(KIND = dp) :: unit_of_length REAL(KIND = dp) :: subcells !FM should stay LOGICAL :: orthorhombic REAL(KIND = dp), DIMENSION(3,3) :: hmat,h_inv END TYPE cell_type CONTAINS FUNCTION pbc3(ra,rb,cell) RESULT(rab_pbc) REAL(KIND=dp), DIMENSION(3), INTENT(IN) :: ra, rb REAL(KIND=dp), DIMENSION(3) :: rab_pbc INTEGER :: icell, jcell, kcell REAL(KIND=dp) :: rab2, rab2_pbc REAL(KIND=dp), DIMENSION(3) :: r, ra_pbc, rab, rb_image, & rb_pbc, s2r rb_pbc(:) = pbc(rb(:),cell) rab2_pbc = HUGE(1.0_dp) DO icell=-periodic(1),periodic(1) DO jcell=-periodic(2),periodic(2) DO kcell=-periodic(3),periodic(3) r = REAL((/icell,jcell,kcell/),dp) END DO END DO END DO END FUNCTION pbc3 END MODULE
This triggers in many places in CP2K, so, for once, I'll mark it as critical
Also breaks 465.tonto in SPEC2006. I'd say it's 2007-06-04 Lee Millward <lee.millward@codesourcery.com> * trans-intrinsic.c (gfc_conv_intrinsic_function_args): Adjust to operate on a stack allocated array for the intrinsic arguments instead of creating a TREE_LIST. Add two new parameters for the array and the number of elements. Update all callers to allocate an array of the correct length to pass in. Update comment. ... what causes it.
(In reply to comment #2) > Also breaks 465.tonto in SPEC2006. > I'd say it's > 2007-06-04 Lee Millward <lee.millward@codesourcery.com> Gentlemen, you will see that this patch was reverted this morning because it caused PRs32222, 38 & 42. The trunk, of a few minutes ago, does not exhibit this bug, so I will close it, if you do not mind:) The problem is the REAL((/icell,jcell,kcell/),dp), where Lee's patch screwed up the optional second argument. Cheers Paul