DATA statement bug?

Asher Langton langton2@llnl.gov
Fri Jul 8 17:14:00 GMT 2005


The following seems to reveal a bug in the code generation for the 
DATA statement.  (Perhaps related to an older isssue: 
http://gcc.gnu.org/ml/fortran/2004-01/msg00004.html ?)

         block data nothing
         character*8 foo
         character*8 bar
         common /test/ foo(4),bar(4)
         data foo /"hi123456","12345678",2*" "/
         data bar /"ff123456","12345678",2*" "/
         end

         program test
         character*8 foo
         character*8 bar
         common /test/ foo(4),bar(4)
         write(*,*)  foo(1)
         write(*,*)  bar(1)
         end

Compiling this gives an assembler error ("Warning: .space repeat 
count is zero, ignored"), although replacing the data statements with:

         data foo /"hi123456","12345678","        ","        "/
         data bar /"ff123456","12345678","        ","        "/

works.

The offending line in the x86 assembly file is:

         .zero   4294967282

I spent some time tracing through this in a debugger, and didn't see 
where the offending value (-14?) was being generated.  I can keep 
working at this, but if anyone has any insight into this, please let 
me know.


-Asher



-- 
Asher Langton
Institute for Scientific Computing Research
Lawrence Livermore National Laboratory
P.O. Box 808, L-312
Livermore, CA 94551
langton2@llnl.gov



More information about the Fortran mailing list