public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/17615] New: Internal compiler error using interface procedures
@ 2004-09-22 16:15 matthew dot amos at baesystems dot com
  2004-09-22 18:11 ` [Bug fortran/17615] " pinskia at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: matthew dot amos at baesystems dot com @ 2004-09-22 16:15 UTC (permalink / raw)
  To: gcc-bugs

When compiling the following source files:

------------------- vec3d.f90 --------------------------
! Operations on 3-dimensional vectors

module module_vec3d

  implicit none

! Public procedures
  private
  public :: cross_product, cross_product3_R4_R8

! Module constants
  integer, parameter :: SP = selected_real_kind(6)
  integer, parameter :: DP = selected_real_kind(12)
  real(SP), parameter :: TINY_SP = tiny(0.0_SP)
  real(DP), parameter :: TINY_DP = tiny(0.0_DP)

! Vector cross product interface
  INTERFACE cross_product
     MODULE PROCEDURE cross_product3_R4_R8
  END INTERFACE

CONTAINS

  FUNCTION cross_product3_R4_R8 (x,y) result (z)
    real(DP) :: z(3)
    real(SP), intent(in) :: x(3)
    real(DP), intent(in) :: y(3)
    z(1) = x(2) * y(3) - x(3) * y(2)
    z(2) = x(3) * y(1) - x(1) * y(3)
    z(3) = x(1) * y(2) - x(2) * y(1)
  END FUNCTION cross_product3_R4_R8

END MODULE module_vec3d
-----------------------------------------------------

----------------------- test.f90 --------------------
PROGRAM TEST

! using the vec3d module as a simple test
  use module_vec3d, only: cross_product

  implicit none

  ! parameters for precision control
  integer, parameter :: SP = selected_real_kind(6)
  integer, parameter :: DP = selected_real_kind(12)

  ! locals
  real(SP) :: a(3)
  real(DP) :: b(3), c(3)
  integer :: i

  a = (/ 1.0, 2.0, 3.0 /)
  b = (/ 1.0, -1.0, 2.0 /)
  
  do i = 1, 10000000
     ! do the test many times, so we see it high up in the profiler
     c = cross_product(a, b)
  end do
     
  ! print the answer
  print *, 'c = ', c(1), c(2), c(3)

END PROGRAM TEST
--------------------------------------------------

I get the following error:

> gfortran -v -save-temps -c test.f90
Reading specs from /home/mamod/amos/gcc-3.5/lib/gcc/i686-pc-linux-gnu/4.0.0/specs
Configured with: ../gcc/configure --prefix=/home/mamod/amos/gcc-3.5
--enable-threads --enable-languages=f95 --with-dwarf2
--with-gmp=/home/aeroapp/linux/gmp-4.1.2 --with-mpfr=/home/mamod/amos
Thread model: posix
gcc version 4.0.0 20040922 (experimental)
 /home/mamod/amos/gcc-3.5/libexec/gcc/i686-pc-linux-gnu/4.0.0/f951 test.f90
-quiet -dumpbase test.f90 -mtune=pentiumpro -auxbase test -version -o test.s
GNU F95 version 4.0.0 20040922 (experimental) (i686-pc-linux-gnu)
        compiled by GNU C version 4.0.0 20040922 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
test.f90: In function 'MAIN__':
test.f90:24: internal compiler error: in gfc_trans_arrayfunc_assign, at
fortran/trans-expr.c:2011
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

When cross_product3_R4_R8 is exported and used directly there is no problem, the
code compiles and runs correctly.

-- 
           Summary: Internal compiler error using interface procedures
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: matthew dot amos at baesystems dot com
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17615


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-09-24 17:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-09-22 16:15 [Bug fortran/17615] New: Internal compiler error using interface procedures matthew dot amos at baesystems dot com
2004-09-22 18:11 ` [Bug fortran/17615] " pinskia at gcc dot gnu dot org
2004-09-24 13:47 ` tobi at gcc dot gnu dot org
2004-09-24 14:18 ` tobi at gcc dot gnu dot org
2004-09-24 14:41 ` matthew dot amos at baesystems dot com
2004-09-24 17:07 ` cvs-commit at gcc dot gnu dot org
2004-09-24 17:12 ` tobi at gcc dot gnu dot org
2004-09-24 17:32 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).