public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/49328] New: Internal compiler error due to explicit array bounds in contained routine argument
@ 2011-06-08 19:57 david.sagan at gmail dot com
  2011-06-08 20:11 ` [Bug fortran/49328] " dominiq at lps dot ens.fr
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: david.sagan at gmail dot com @ 2011-06-08 19:57 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Internal compiler error due to explicit array bounds
                    in contained routine argument
           Product: gcc
           Version: 4.5.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: david.sagan@gmail.com


Consider the following program:

!-----------------------

module test_mod
contains
subroutine twiss3_at_start ()

implicit none

type t_struct
  real beta, alpha, gamma, phi
end type

type (t_struct) b
real g(6,6), tune3

call mode1_calc (g(3:4, 3:4), tune3, b)

contains

subroutine mode1_calc (gg, tune, twiss)

type (t_struct) twiss
real gg(2,2), tune

twiss%beta = gg(2,2)**2

end subroutine
end subroutine
end module


!-----------------------

compiling gives:

lnx4103:~/dcs/bmad_distribution/bmad_dist/test> gfortran --version
GNU Fortran (GCC) 4.5.1
Copyright (C) 2010 Free Software Foundation, Inc.

lnx4103:~/dcs/bmad_distribution/bmad_dist/test> gfortran -c -O2 test.f90
test.f90: In function 'twiss3_at_start':
test.f90:14:0: internal compiler error: in build2_stat, at tree.c:3681
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.


Removing the "-O2" compile option fixes things. Also changing "real gg(2,2)" to
"real gg(:,:)" also fixes things.


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

end of thread, other threads:[~2012-07-02 10:35 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-08 19:57 [Bug fortran/49328] New: Internal compiler error due to explicit array bounds in contained routine argument david.sagan at gmail dot com
2011-06-08 20:11 ` [Bug fortran/49328] " dominiq at lps dot ens.fr
2011-06-08 20:23 ` dominiq at lps dot ens.fr
2011-08-22 16:27 ` [Bug fortran/49328] [4.5 Regression] " tkoenig at gcc dot gnu.org
2011-08-22 16:38 ` burnus at gcc dot gnu.org
2011-08-22 16:52 ` burnus at gcc dot gnu.org
2011-08-30 14:44 ` [Bug middle-end/49328] " burnus at gcc dot gnu.org
2012-06-20 13:01 ` rguenth at gcc dot gnu.org
2012-07-02 10:35 ` rguenth at gcc dot gnu.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).