Bug 32242 - [4.3 Regression] internal compiler error: in gfc_conv_variable, at fortran/trans-expr.c:386
Summary: [4.3 Regression] internal compiler error: in gfc_conv_variable, at fortran/tr...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P5 normal
Target Milestone: 4.3.0
Assignee: Lee Millward
URL:
Keywords:
Depends on:
Blocks: 29975
  Show dependency treegraph
 
Reported: 2007-06-07 10:39 UTC by Joost VandeVondele
Modified: 2007-07-06 12:17 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-06-07 13:04:57


Attachments
testcase (2.35 KB, text/plain)
2007-06-07 10:39 UTC, Joost VandeVondele
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joost VandeVondele 2007-06-07 10:39:00 UTC
current trunk :

gfortran -c -O0 test.f90
test.f90: In function ‘pw_integral_a2b’:
test.f90:251: internal compiler error: in gfc_conv_variable, at fortran/trans-expr.c:386
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Joost VandeVondele 2007-06-07 10:39:55 UTC
Created attachment 13664 [details]
testcase
Comment 2 Joost VandeVondele 2007-06-07 10:40:21 UTC
This blocks CP2K (PR 29975)
Comment 3 Francois-Xavier Coudert 2007-06-07 13:04:57 UTC
Confirmed on i686-darwin. I'll look into it during the week-end if noone beats me to it.
Comment 4 Joost VandeVondele 2007-06-07 14:10:50 UTC
Reduced:

MODULE kahan_sum
  INTEGER, PARAMETER :: dp=KIND(0.0D0)
  INTERFACE accurate_sum
    MODULE PROCEDURE kahan_sum_d1, kahan_sum_z1
  END INTERFACE accurate_sum
  TYPE pw_grid_type
     REAL (KIND=dp), DIMENSION ( : ), POINTER :: gsq
  END TYPE pw_grid_type
  TYPE pw_type
     REAL (KIND=dp), DIMENSION ( : ), POINTER :: cr
     COMPLEX (KIND=dp), DIMENSION ( : ), POINTER :: cc
     TYPE ( pw_grid_type ), POINTER :: pw_grid
  END TYPE pw_type
CONTAINS
 FUNCTION kahan_sum_d1(array,mask) RESULT(ks)
   REAL(KIND=dp), DIMENSION(:), INTENT(IN)  :: array
   LOGICAL, DIMENSION(:), INTENT(IN), &
     OPTIONAL                               :: mask
   REAL(KIND=dp)                            :: ks
 END FUNCTION kahan_sum_d1
  FUNCTION kahan_sum_z1(array,mask) RESULT(ks)
    COMPLEX(KIND=dp), DIMENSION(:), &
      INTENT(IN)                             :: array
    LOGICAL, DIMENSION(:), INTENT(IN), &
      OPTIONAL                               :: mask
    COMPLEX(KIND=dp)                         :: ks
  END FUNCTION kahan_sum_z1

FUNCTION pw_integral_a2b ( pw1, pw2 ) RESULT ( integral_value )
    TYPE(pw_type), INTENT(IN)                :: pw1, pw2
    REAL(KIND=dp)                            :: integral_value
     integral_value = accurate_sum ( REAL ( CONJG ( pw1 % cc ( : ) ) &
          *  pw2 % cc ( : ) ,KIND=dp) * pw1 % pw_grid % gsq ( : ) )
END FUNCTION pw_integral_a2b
END MODULE
Comment 5 Paul Thomas 2007-06-08 04:59:07 UTC
I believe that this is also caused by r125316.

Paul
Comment 6 Francois-Xavier Coudert 2007-06-08 08:06:18 UTC
Patch reverted until Lee comes back, PR assigned to him.
Comment 7 Francois-Xavier Coudert 2007-07-06 12:17:05 UTC
Lee has submitted a new version of his patch, taking into account that testcase (and adding it to the testsuite). Thus, closing the bug.
Comment 8 Lee Millward 2007-07-16 19:13:01 UTC
Subject: Bug 32242

Author: lmillward
Date: Mon Jul 16 19:12:44 2007
New Revision: 126689

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126689
Log:
	PR fortran/32222
	PR fortran/32238
	PR fortran/32242	
	* 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.
	(gfc_intrinsic_argument_list_length): New function.
	(gfc_conv_intrinsic_conversion): Call it.
	(gfc_conv_intrinsic_mnimax): Likewise.
	(gfc_conv_intrinsic_merge): Likewise.
	(gfc_conv_intrinsic_lib_function): Call it. Use new CALL_EXPR
	constructors.
	(gfc_conv_intrinsic_cmplx): Likewise.
	(gfc_conv_intrinsic_ctime): Likewise.
	(gfc_covn_intrinsic_fdate): Likewise.
	(gfc_conv_intrinsic_ttynam): Likewise.
	(gfc_conv_intrinsic_ishftc): Likewise.
	(gfc_conv_intrinsic_index): Likewise.
	(gfc_conv_intrinsic_scan): Likewise.
	(gfc_conv_intrinsic_verify): Likewise.
	(gfc_conv_intrinsic_trim): Likewise.
	(gfc_conv_intrinsic_aint): Use new CALL_EXPR constructors.
	(gfc_conv_intrinsic_exponent): Likewise.
	(gfc_conv_intrinsic_bound): Likewise.
	(gfc_conv_intrinsic_abs): Likewise.
	(gfc_conv_intrinsic_mod): Likewise.
	(gfc_conv_intrinsic_sign): Likewise.
	(gfc_conv_intrinsic_len): Likewise.
	(gfc_conv_intrinsic_adjust): Likewise.
	(gfc_conv_intrinsic_si_kind): Likewise. 

	* gfortran.dg/cmplx_intrinsic_1.f90: New test.

	PR fortran/32238
	* gfortran.dg/pr32238.f90: New test.

	PR fortran/32222
	* gfortran.dg/pr32222.f90: New test.

	PR fortran/32242
	* gfortran.dg/pr32242.f90: New test.


Added:
    trunk/gcc/testsuite/gfortran.dg/cmplx_intrinsic_1.f90
    trunk/gcc/testsuite/gfortran.dg/pr32222.f90
    trunk/gcc/testsuite/gfortran.dg/pr32238.f90
    trunk/gcc/testsuite/gfortran.dg/pr32242.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/trans-intrinsic.c
    trunk/gcc/testsuite/ChangeLog