Bug 32248 - [4.3 Regression] internal compiler error: in gfc_trans_assignment_1, at fortran/trans-expr.c:3877
Summary: [4.3 Regression] internal compiler error: in gfc_trans_assignment_1, at fortr...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P3 critical
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks: 29975
  Show dependency treegraph
 
Reported: 2007-06-07 19:35 UTC by Joost VandeVondele
Modified: 2007-06-08 12:56 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-06-08 12:27:05


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joost VandeVondele 2007-06-07 19:35:16 UTC
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
Comment 1 Joost VandeVondele 2007-06-07 19:38:34 UTC
This triggers in many places in CP2K, so, for once, I'll mark it as critical
Comment 2 Richard Biener 2007-06-08 12:27:05 UTC
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.
Comment 3 Paul Thomas 2007-06-08 12:56:11 UTC
(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