This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: [gfortran, committed] Fix segfault in PR16336


On Sat, Jul 10, 2004 at 07:59:09PM +0200, Tobias Schl?ter wrote:
> Steve Kargl wrote:
> >>Can you see if the name of the common block appears in the module file?
> >>ifc emits it, but it's a binary file, so I don't really know what that
> >>means. I'm wondering if there's a reason the user may want to know this
> >>(can't think of one). Otherwise I'd just suggest not emitting common
> >>blocks to module files at all.
> >>
> > 
> > kargl[208] more c.mod
> > 
> > V9 0 0 3 0 0
> > MODULE C,0 0
> > FILE 0,a.f90
> > VAR I,5,0,/COM/,: 1,0,3,0,0,80,1,0,0
> > COMMON/COM/,4,0: I
> > END
> > 
> 
> OK, so does the USEing scope need to know about the common block? It
> might be helpful for detecting if a common block has the same size
> through different compilation units, but that's the only reason I can
> think of.
> 

After stripping comments from the C code, here is the
NAG output

   struct {
     Integer i_;
   } com_;

   int main(argc,argv)
     int argc; char *argv[];
   {
      static Integer *const j_ = (Integer *const)((Pointer)&com_ + 0);
      f90_init(argc,argv);
      *j_ = 2;
      com_.i_ = 1;
      __NAGf90_write(6,(char*)0,0,(char*)0,0,0);
      __NAGf90_lwrite_i( *j_);
      __NAGf90_endwrite();
      f90_finish(0);
   }

-- 
Steve


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