This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/32323] New: Accepts invalid vector subscript actual argument for intent(out) dummy argument
- From: "terry at chem dot gu dot se" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Jun 2007 16:30:40 -0000
- Subject: [Bug fortran/32323] New: Accepts invalid vector subscript actual argument for intent(out) dummy argument
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
[tjf@fkpc167]$ cat run.f90
module mod
implicit none
contains
subroutine aa(v)
integer,dimension(:),intent(out)::v
write(*,*)size(v)
v=0
end subroutine aa
end module mod
program ff
use mod
implicit none
integer,dimension(10)::w
w=1
call aa(w((/3,2,1/)))
write(*,*)w
end
[tjf@fkpc167]$ gfortran -v -Wall -W --std=f95 --pedantic -O -fbounds-check
run.f90
Driving: gfortran -v -Wall -W -std=f95 -pedantic -O -fbounds-check run.f90
-lgfortranbegin -lgfortran -lm -shared-libgcc
Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --disable-multilib --enable-languages=fortran
Thread model: posix
gcc version 4.2.0 20070501 (prerelease)
/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.2.0/f951 run.f90 -quiet
-dumpbase run.f90 -mtune=generic -auxbase run -O -Wall -W -pedantic -std=f95
-version -fbounds-check -I
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/finclude -o /tmp/ccFuwYwj.s
GNU F95 version 4.2.0 20070501 (prerelease) (x86_64-unknown-linux-gnu)
compiled by GNU C version 4.2.0 20070501 (prerelease).
GGC heuristics: --param ggc-min-expand=89 --param ggc-min-heapsize=112193
as --traditional-format -V -Qy -o /tmp/ccIcA5Sy.o /tmp/ccFuwYwj.s
GNU assembler version 2.17.50 (x86_64-linux-gnu) using BFD version 2.17.50
20070103 Ubuntu
/usr/local/libexec/gcc/x86_64-unknown-linux-gnu/4.2.0/collect2 --eh-frame-hdr
-m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2
/usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/crtbegin.o
-L/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.2.0
-L/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/../../../../lib64
-L/lib/../lib64 -L/usr/lib/../lib64
-L/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/../../.. /tmp/ccIcA5Sy.o
-lgfortranbegin -lgfortran -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.2.0/crtend.o
/usr/lib/../lib64/crtn.o
[tjf@fkpc167]$ ./a.out
3
1 1 1 1 1 1
1 1 1 1
For those that care, both ifort and g95 correctly identify this as invalid
code.
(Maybe I can get one right today! ;-)
--
Summary: Accepts invalid vector subscript actual argument for
intent(out) dummy argument
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: terry at chem dot gu dot se
GCC host triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32323