buggy code or buggy compiler?

From: Mike Zulauf (mazulauf_at_met.utah.edu)
Date: 02/25/04


Date: Wed, 25 Feb 2004 13:18:41 -0800

Hi all. . .

I've got a strange problem - one that I don't know if anyone here will
really be able to help me too much with. But maybe somebody can give me
some advice so I can figure it out.

I have a fairly complex f77 fluid dynamics code. I'm doing most of my
development under Mac OS X, and I compile with g77, NAG, and xlf
compilers. After some recent changes, I've been getting some weird
errors with the NAG compiler.

I don't want to post the code here, since it's rather large, and I
haven't been able to reproduce the behavior with simpler/smaller codes.

What is happening is that I am calculating and filling members of a
vector (call it a). When I do this, the first two values of a different
vector become zeros (call it b). This takes place in a subroutine. In
the main program these two arrays are declared consecutively (first a,
then b). By the way, the new values of a are _not_ zero, so it's not as
simple as the new values of a being written to b.

I would suspect that I have an indexing error somewhere, but this
doesn't happen with g77 or xlf. In addition, if I turn on array bounds
checking with NAG, not only do I not get an error, but I also don't get
the problematic results.

Even weirder, if I insert a line printing out the value of a before it
is calculated, then the correct values of b are not zeroed out.

Any thoughts on this? I've got ddd running on my system, but I'm not
very proficient with it yet.

Thanks,
Mike

-- 
Mike Zulauf
mazulauf@met.utah.edu


Relevant Pages

  • problem: namespace not found when switching from Debug to Release
    ... strange problem here - sorry, but i don't know all the english terms ... i've added the namespace of the DLL to the using-clause ... now i can work the classes, compile, debug - no problems ... i can fix this by removing the "reference" ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: backslash-issues
    ... > When I compile this with NAGWare Fortran 95 compiler Release 5.0i get: ... That rather surprises me. ... expect from NAG. ... Makes me wonder whether a stray character got ...
    (comp.lang.fortran)
  • Re: Why is it dangerous?
    ... here's a strange problem I've never seen before. ... there is no problem but when I try to compile it with a linux compiler ... elements which are under strict control and the program/process/function ... Much web based software does not have total control ...
    (comp.lang.c)
  • printf + 128bit long double + %Le conversion char = weird
    ... I'm having a rather strange problem with printf when using 128-bit ... long doubles. ... COMPILE WITH: ...
    (comp.unix.aix)
  • J# java.util.Calendar bug????????
    ... I have a strange problem when adding a year to a 'leap' date. ... When I compile this under Sun's JDK 1.4.2_06 and execute it (I use ... Eclipse platform for Java development), ... which is the same value as the Java compiled output. ...
    (microsoft.public.dotnet.vjsharp)