[Bug fortran/35951] New: Unexpected erro Expected another dimension in array declaration
The below code produces the error Expected another dimension in array declaration at 1. It only seems to occur when the passed argument that contains the array dimension is a derived type and not an integer. Also, it only occurs when the derived-type declaration is below (not above) the declaration of the array. When the dimension is an integer and not a derived-type component, either order compiles correctly. I tested on g95 and intel and obtained no error. My system is WindowsXP, cygwin, and gcc version 4.3.0 20080212 (experimental) [trunk revision 132252] John !== module test_module implicit none type tt integer :: n end type tt contains !=== !=== subroutine test_sub_1(z,t) implicit none real :: z(t%n) !this order produces compiler error Expected another dimension in array declaration at 1 type (tt) :: t !type (tt) :: t !this order compiles correctly !real :: z(t%n) end subroutine test_sub_1 !=== ! subroutine test_sub_2(z,m) implicit none real:: z(m) !this order compiles correctly integer :: m !integer,intent(in) :: m!this order compiles correctly too !real, intent(out) :: z(m) end subroutine test_sub_2 !=== !=== end module test_module -- Summary: Unexpected erro Expected another dimension in array declaration Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: john dot young at jrc dot co dot jp GCC target triplet: i686-pc-cygwin http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35951
[Bug fortran/35951] Unexpected erro Expected another dimension in array declaration
--- Comment #1 from john dot young at jrc dot co dot jp 2008-04-16 01:51 --- Created an attachment (id=15481) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15481action=view) code to produce error described in bug report -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35951
[Bug fortran/35951] Unexpected erro Expected another dimension in array declaration
--- Comment #2 from john dot young at jrc dot co dot jp 2008-04-16 01:57 --- I take back my comment that intel's compiler produces no error. Intel 8.1 produces an error when the structure declaration is below the array declaration. I do not know the standard well enough to know whether this is a bug or not. G95 still compiles with no error. John -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35951
[Bug fortran/35952] New: Segmentation fault with character strings only when compiling with -funroll-loops and -O3
I attached a short code that produces segmentation faults (or strange cygwin errors). The segmentation faults only occur when compiling with both -funroll-loops and -O3. If one or the other or neither are used, the program runs fine. The code has several examples. I attached a stackdump for the case of the three write statements. System : WinXP, cygwin, gcc version 4.3.0 20080212 (experimental) == subroutine test_sub(label) character(len=*),intent(in) :: label character (len=(len(label)+20)) :: c1 character (len=(len(label)+20)) :: c2 character (len=(len(label)+20)) :: c3 ! the below 3 lines cause a segmentation fault ! print*, len(c1) ! print*, len(c2) ! print*, len(c3) ! the below 2 lines produce strange cygwin errors ! a ### sig_send: wait for sig_complete event failed, signal -34, rc -1, Win32 error 6 ! print*, len(c1) ! print*, len(c2) ! the below 1 lines produces no problem ! print*, len(c3) ! the below 3 lines cause a segmentation fault (I gave the stackdump for this case) write(c1,'(A)') 'a' write(c2,'(A)') 'b' write(c3,'(A)') 'c' ! the below 2 lines produce strange cygwin erros ! a ### sig_send: wait for sig_complete event failed, signal -34, rc -1, Win32 error 6 ! write(c1,'(A)') 'a' ! write(c2,'(A)') 'b' ! the below 1 lines produces no problem ! write(c1,'(A)') 'a' end subroutine test_sub !== program test call test_sub('a') print*, 'done' end program test !== -- Summary: Segmentation fault with character strings only when compiling with -funroll-loops and -O3 Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: john dot young at jrc dot co dot jp GCC target triplet: i686-pc-cywgin http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35952
[Bug fortran/35952] Segmentation fault with character strings only when compiling with -funroll-loops and -O3
--- Comment #1 from john dot young at jrc dot co dot jp 2008-04-16 05:34 --- Created an attachment (id=15482) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15482action=view) Code that exhibits segmentation fault. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35952
[Bug fortran/35952] Segmentation fault with character strings only when compiling with -funroll-loops and -O3
--- Comment #2 from john dot young at jrc dot co dot jp 2008-04-16 05:34 --- Created an attachment (id=15483) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15483action=view) stackdump for the case of three writes -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35952
[Bug fortran/35865] New: Spurious warning for vector-valued functions passed as arguments
In the code below, the following warning is produced Waring: Actual argument contains too few elements for dummy argument 'func' (1/3) at (1) If the function result is changed to a scalar instead of a vector, no warning is produced. I do not know the standard well enough to know if this is a problem, but other compilers (G95,Intel) do not produce a warning. The function arguments do match however. I obtained this from GCC 4.3.0 20080212 (experimental) [trunk revision 132252] using cygwin under WinXP. !=== module vec_func implicit none contains !=== !=== !function vector_func(func,r1) result(res) function vector_func(func) result(res) implicit none interface function func(r) result(res) implicit none real, intent(in) :: r real :: res(3) end function func end interface real :: res(3) res = func(0.) end function vector_func !== function test_func(r) result(res) implicit none real,intent(in) :: r real :: res(3) res = r end function test_func != end module vec_func != program a use vec_func implicit none real :: z(3) z = vector_func(test_func) print*, z end program a != -- Summary: Spurious warning for vector-valued functions passed as arguments Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: minor Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: john dot young at jrc dot co dot jp GCC target triplet: i686-pc-cygwin http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35865
[Bug fortran/35865] Spurious warning for vector-valued functions passed as arguments
--- Comment #1 from john dot young at jrc dot co dot jp 2008-04-08 01:42 --- Created an attachment (id=15444) -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15444action=view) code to produce spurious warning described in bug report -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35865