This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/15963] New: Error when using count in initialization expression


The following code generates a compiler error.
It happens only when a and b are of non-numerical type;
and only in an initialization expression.
When array b wouldn't be used and only 
write(6,*) count(a < 'D') 
was used the compiler accepts it.


troogle> gfortran -c -v n11.f95
Reading specs from /OPT/32/gcc-2004-06-09/lib/gcc/hppa2.0w-hp-hpux11.11/3.5.
0/specs
Configured with: ../configure --enable-languages=c,f95 
--prefix=/opt32/gcc-2004-06-09 --with-gmp=/opt32/gmp --with-gnu-as 
--with-as=/opt32/binutils/bin/as --enable-threads --disable-shared --disable-nls
Thread model: posix
gcc version 3.5.0 20040611 (experimental)
 /OPT/32/gcc-2004-06-09/libexec/gcc/hppa2.0w-hp-hpux11.11/3.5.0/f951 n11.f95 
-quiet -dumpbase n11.f95 -auxbase n11 -version -o /var/tmp//ccCVK5zQ.s
GNU F95 version 3.5.0 20040611 (experimental) (hppa2.0w-hp-hpux11.11)
        compiled by GNU C version 3.5.0 20040611 (experimental).
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096


 In file n11.f95:8

write(6,*) write(6,*) size(b)
                  1
Error: Syntax error in argument list at (1)
 In file n11.f95:5

character(8)              :: b(count(a < 'D'))
                                    1
Error: Numeric operands are required in expression at (1)






subroutine x(a)

implicit none
character(8), intent(in)  :: a(10)
character(8)              :: b(count(a < 'D'))

write(6,*) size(b)

end subroutine x

-- 
           Summary: Error when using count in initialization expression
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Mart dot Rentmeester at nn-online dot org
                CC: gcc-bugs at gcc dot gnu dot org


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]