public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/32682]  New: [4.3 Regression] ICE in gfc_trans_array_constructor, at fortran/trans-array.c:1664
@ 2007-07-08 22:41 jaydub66 at gmail dot com
  2007-07-09  6:01 ` [Bug fortran/32682] " burnus at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: jaydub66 at gmail dot com @ 2007-07-08 22:41 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1574 bytes --]

consider the following program:


program matrix

implicit none
real,dimension(2,2),parameter::c=0
real,dimension(2,2)::m

m=f()+c
m=c+f()
call sub(m+f())
call sub(c+m)
call sub(f()+c)
call sub(c+f())

contains

  function f()    
    implicit none
    real, dimension(2,2)::f
    f=0
  end function f

  subroutine sub(a)
    implicit none
    real, dimension(2,2)::a
  end subroutine sub

end program matrix


this gives the error message:

matrix.f90: In function ‘MAIN__’:
matrix.f90:11: internal compiler error: in gfc_trans_array_constructor, at
fortran/trans-array.c:1664

though the message claims an error in line 11, the program only fails in the
presence of line 12:
"call sub(c+f())"
all the lines before (7-11) are ok.

the ICE only appears in exactly this configuration, i.e. c is a parameter, f is
a function, and c+f() is fed as an argument to a subroutine

it happens in trans-array.c(gfc_trans_array_constructor), line 1664:
/* We should have a 1-dimensional, zero-based loop.  */
gcc_assert (loop->dimen == 1);

this fails with loop->dimen==2 in our case

happens only with 4.3 (trunk), but not with 4.1 or 4.2


-- 
           Summary: [4.3 Regression] ICE in gfc_trans_array_constructor, at
                    fortran/trans-array.c:1664
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jaydub66 at gmail dot com


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


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

end of thread, other threads:[~2007-07-29 14:45 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-08 22:41 [Bug fortran/32682] New: [4.3 Regression] ICE in gfc_trans_array_constructor, at fortran/trans-array.c:1664 jaydub66 at gmail dot com
2007-07-09  6:01 ` [Bug fortran/32682] " burnus at gcc dot gnu dot org
2007-07-09  8:15 ` tobias dot burnus at physik dot fu-berlin dot de
2007-07-09 19:17 ` jaydub66 at gmail dot com
2007-07-09 22:40 ` pault at gcc dot gnu dot org
2007-07-11 21:39 ` jaydub66 at gmail dot com
2007-07-24 13:46 ` dfranke at gcc dot gnu dot org
2007-07-27 15:09 ` pault at gcc dot gnu dot org
2007-07-28 20:47 ` fxcoudert at gcc dot gnu dot org
2007-07-29 11:21 ` pault at gcc dot gnu dot org
2007-07-29 14:44 ` pault at gcc dot gnu dot org
2007-07-29 14:45 ` pault 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).