Michael Richmond sent in a problem with yesterday's tightening up of various constraints. The access specification for module procedures wasn't being determined correctly. Michael also sent in a problem where g95 would go into an infinite loop that has been broken.
Mike Prager sent in some more set/unused issues that were introduced yesterday while adding various constraints. All fixed now.
Joost Vandevondele sent in a crash on MOD() that has been fixed. Fixed the analogous problem in ATAN2(), INT() and MODULO().
Elliot Chandler found a crash with format tags that has been fixed, along with an embarrassing amount of code that was completely incorrect.
I'm departing for Christmas vacation tomorrow morning. I'll have sporadic access to the net, but the crazed bug-squasher that I've been over the last couple of days is going to vanish for a while. I haven't figured out the exact return date yet, but at least a week from now.
Joost Vandevondele sent in a couple regressions involving LBOUND and SIZE that have been fixed. Joost also sent in constraints involving parameters, equivalence variables, derived type arguments, some public/private issues and some more sophisticated interface checking.
Michael Belisle and Gordon Sande reported a problem under OSX where compiling multiple files wasn't working correctly. Fixed now.
Michael Richmond reported a problem with the corefile resume that has been fixed as well as a problem with unformatted files that has been fixed.
Michael Chan sent in a problem with unformatted files that has been fixed.
Matthew Halfant reported that g95 now correctly runs his raytracing application. Matthew also had an insight into the DLL problem that has been reported lately. We're working on it.
Adrian sent a problem with string concatenation that has been fixed.
Scott Palmtag sent in a case where string reads were slightly too anal compared with existing practice. I've loosened things up a bit. He also sent in error where end of file was not properly detected.
Francois Jacq sent in a problem with unformatted files that has been fixed.
Claude Mounier reported a problem with allocatable return values that has been fixed.
Douglas Cox has updated his windows build script to overwrite old versions of files. This was causing problems for people installing for the second time. New binary is up.
James Van Buskirk sent in a pair of problems with the SELECT CASE that have been fixed.
Matthew Halfant sent in a TR15581 problem with the ALLOCATED() intrinsic that has been fixed.
Mike Prager and John Young sent in more inaccuracies with the whole set/used warning mechanism that have been hopefully fixed. Robert Somerville pointed out a pair of problems with gdb debugging that have been fixed.
Joost Vandevondle sent in some pointer-allocation related regressions that have been fixed. Joost also sent in several miscellaneous constraints which have been implemented, including UBOUND, LBOUND, SIZE, and pointer assignments.
Mark Hesselink sent in a problem with the OSX memory allocation that was fixed a while back when I switch allocation subroutines.
Earl Duque sent in a mystery problem a while back that has become fixed.
Kozma Endre sent in a crash associated with LEN_TRIM() that has been fixed.
Claude Mounier sent in a pair of problems with set/unused variable warnings that have been fixed.
Mimo sent in a problem with set/unused variable warnings that has been fixed.
Alan Greynolds, Michael Richmond and Dale Ranta pointed out that the SIZE argument of the RANDOM_SEED intrinsic suddenly became mandatory. Typo on my part after marking it as INTENT(OUT). Fixed.
James Van Buskirk and Matthew Halfant reported problems with the standalone windows binary, the second time it is installed on a system. Doug is investigating.
James also pointed out a problem with ACHAR() that has been fixed.
Douglas Cox pointed out that the -fPIC flag is unnecessary for cygwin builds, so I've prevented the flag from showing up on cygwin.
Dale Ranta, Michael Richmond, Stephan Schulz, Warner Bruns, Roberto Herrero, Douglas Cox reported a regression dealing with the simplification of intrinsic functions that has been fixed.
Carsten Lemmen reported a regression with assumed character lengths that has been fixed.
Douglas Cox has built g95 for windows again, available for downloads.
Timothy Giese sent in a problem with dynamic allocation that has been fixed.
Joost Vandevondele sent in a truly bizzare array expression that has been fixed. Joost also sent in a regression with the lengths of character substrings that has been fixed.
Daniel Price pointed out a crash in the -Wunused-module-vars option that has been fixed. He also pointed out that it was missing from the docs page. Added.
Karl-Albert Breith reported a permissions problem with implicitly opening a unit, where the file had unexpected permissions. The file is now opened with the permissions of the file.
For the past week, people have mentioned that downloads have sometimes been quite slow. The SourceForge webservers are under such a load that the administration has placed a throttle on large downloads. I've been advised that they will be rolling out some new features for dealing with snapshots like what we have here sometime next week.
James Van Buskirk reported a problem where a real exponentiation wasn't being performed at compile time. It isn't strictly necessary, but it's easy enough to do and saves runtime, so I've added it. James also sent in a pair of problems with specification expressions that have been fixed as well as problems with integer overflows in borderline cases that have been fixed as well.
Dale Ranta sent in another problem with -d8 and the MIN intrinsic that has been fixed.
Lorenzo Pesce pointed out that intrinsic subroutines were fooling the unused-variables warning mechanism. Fixed.
Jim McDonald sent in multiple problems with namelists-- array sections, repeat counts for logical values, null values and null repeat values. All fixed.
Tan Le reported a successful build of g95 on linux ppc-64.
Matthew Halfant sent in a TR15581 issue having to do with correctly saving and restoring allocatable structures that has been fixed.
Lorenzo Pesce sent in a problem with warning about unset variables within FORALL constructs that has been fixed.
Vivek Rao pointed out a discussion on comp.lang.fortran where Richard Maine and James Van Buskirk pointed out that the interfaces of generic names have to be all subroutines or functions. G95 now generates an error for this case.
Dale "d8" Ranta, sent in another problem with -d8 in exponentials that has been fixed.
Douglas Cox sent in a bug where a conversion function was being incorrectly flagged inside a restricted expression.
James Van Buskirk sent in a spurious error about AIMAG() in strict f95 mode that has been fixed. James also sent in a problem with the ENTRY statement as a module procedure that has been fixed. These are not all working yet.
Daniel Price sent in another pair of bugs which had problems with spurious unused/unset warnings.
Fuxin Zhang found some nasty problems with rounding that have been fixed.
Jim McDonald pointed out a common feature of f77 namelists that I've implemented as an extension. If a single array subscript is named, multiple values can now be read into the array, in the usual order.
Dale Ranta sent in a case where an ENTRY statement was causing a crash when -d8 was being used that has been fixed.
Jacques LefrÈre reported a TR15881 issues that has been fixed.
Michael Richmond reported success with the SINDA thermal network code. This code is a multi-language code and Michael was 'testing' some multiple language interfacing documentation that has recently been written and will be posted soon.
Juha Ruokolainen and I have been exchanging some mails on the configuration of g95. At one point, more than one person at his institution tried to install different g95's on the same machine. Very bad. It turns out that g95 does not have to live in a fixed place. With some judicious configuration (done now), it can be put in any directory as long as the hierarchy is preserved.
The main difference now is that the /tmp/g95 symbolic link no longer has to be created. I've updated the docs.
Harald Anlauf pointed out the warning for different character lengths between formal and dummy arguments should only apply for actual lengths less than dummy lengths, since the other case is perfectly legal. Fixed.
Daniel Price sent in a pair of cases about spurious warnings about unused and unset variables that has been fixed.
Michael Richmond sent in a problem with character parameters that has been fixed.
Joaquim Ballabrera sent in a subtle problem with namelist writes that has been fixed.
Joost Vandevondele sent in a problem with the PAUSE and STOP statements that has been fixed. He also sent in a pair of array-related regressions that have been fixed. There was also a regression involving concatentation of array that has been fixed.
Alex Paz sent a regression involving COMMON blocks that has been unregressed.
Udo Grabowski, Roland Schilling and Juha Ruokolainen sent in a crash with character concatenation in an actual argument. Fixed.
Helge Avlesen sent in a pointer association problem. Assumed shaped dummy arguments didn't look like they were associated. Fixed.
Lorenzo Pesce pointed out more shortcomings regarding unused warnings. Module variables are no longer flagged and actual procedure arguments have the formal intents checked to correctly set the used and set flags.
Samuel Key sent in a problem with substring assignment that has been fixed.
Joost Vandevondele sent in a problem with user operations not being functions that has been fixed. He also pointed that character pointer assignments needed an error when the lengths differed. Joost also sent in a problem with the FORALL statement that has been fixed.
Rheinhold Bader sent in a dynamic memory problem on IA64 that is now fixed.
Douglas Cox and Dale Ranta pointed out that error out on a rewind of a non-connected unit is better handled by preconnecting the unit. This means that the statement works instead of giving an error. I've reverted to the old behaviour.
Mart Rentmeester sent in a crash having to do with some tricking assignment interfaces that has been fixed.
Jim McDonald sent in a problem with logical values in namelists that has been fixed.
Bernhard Seiwald sent in a very similar problem that has also been fixed.
Daniel Price sent in a problem where there was a failure to error out when a format was present in unformatted I/O.
Dale Ranta sent in a subtle problem with the BACKSPACE statement that has been fixed.
Martin Dix and Dale Ranta both sent problem where common blocks were being messed up across procedures. This happened depending on whether the block was initialized in a certain way that I never really figured out. Fixed now.
Paul Suckling sent in a problem with character parameters not being resized that has been fixed.
Vivek Rao sent in a regression with calling elemental functions with character arguments that has been fixed.
Warner Bruns sent in a problem with optimizing character substrings under AMD64 that has been fixed.
Michael Richmond sent in a problem with a crash while resolving generic interfaces that has been fixed. He also pointed out a problem with array conformance checking. I've enhanced this a little bit.
John Harper pointed out that actual and formal character arguments weren't being length-checked. This isn't always possible, but I've added some checking. John also pointed out a problem with yesterday's fix to complex constants. Hopefully things are fixed for real now.
Lorenzo Pesce pointed out some spurious warnings for "unused" variables within interfaces that has been fixed. He pointed out the same thing for module variables, but Joost Vandevondle pointed the desirability for making this a separate warning, in order to facilitate building ONLY clauses of USE statements. I've implemented this as -Wunused-module-vars. Juha Ruokolainen and I exchanged some mails about compiling libf95.a with -fPIC in order to get rid of some problems with dynamic linking. My intention is to keep libf95.a static so that binaries will work on machines that do not have a libf95.a installed.
John Harper sent in a problem with complex constants that has been fixed.
Roland Schilling reported a problem with ES formatting that has been fixed.
Hans-Wilhelm Bolloni and Michael Richmond reported another problem with the ampersand failing to continue a character constant that has been fixed.
Juha Ruokolainen sent in an optimization problem under AMD64 that has been fixed.
Dale Ranta and Jérôme Pety reported a problem with BLOCK DATA under OSX. The bug only bit when initializing a common variable to zero. Dale Ranta sent in a problem with -d8 that has been fixed. Dale also sent in a problem with BOZ constants in data statements that it looks like I fixed a week or so ago.
Udo Grabowski sent in a pair of nasty string related bugs that have been fixed. Strings are hard to get right, but the cases are growing ever more esoteric. Udo pointed out that real number conversion was extremely slow for numbers near HUGE(), and I've sped things up by about a factor of 100 in this area. There have been some murmurs about g95 slowing down recently, and I am hoping that this is the cause.
Richard Maine sent in a problem with substrings and array arguments that is fixed as well.
Daniel Price sent in a problem with -d8 and scalarization that has been fixed. Daniel also sent in a problem with rewinding an invalid unit that has been fixed.
William Connolley pointed out that default logicals under -i8 weren't tracking with the integers. Fixed now.
There's a lack of disk space on some of the build servers tonight, so no binaries for certain platforms.
John Dormand reported success with his RKAID code.
Giovanni Bussi sent in a pair of problems, one with the INQUIRE statement, another with the SIZE= parameter in nonadvancing reads. Both fixed.
Joost Vandevondele sent in a regression from the fix to Peter Weinert's problem last night. Fixed.
Roland Schilling sent in a problem with the -r8 option that has been fixed.
Boyd Blackwell sent in a problem with common blocks and -i8 under OSX that has been fixed.
Henk Krus reported a TR15581 issue with passing allocatable dummy arguments that has been fixed.
Roberto Herrero, Dale Ranta and Harald Anlauf reported a spurious bug introduced yesterday regarding passing allocated arrays that has been fixed. This was an utterly incorrect error message introduced as part of ongoing TR15581 enhancements.
Leandre Brault sent in a subtle problem with scalarization that has been fixed.
Peter Weinert sent in a problem with the dimensionality of array expressions that has been fixed.
Joost Vandevondele sent in a specifcation expression regressions that has been fixed.
Stig Andersen sent in a crash on loading modules introduced the other day when fixing a problem regarding statement functions. All fixed now.
Elliot Chandler sent in a problem with binary constants that has been fixed.
Michael Richmond sent in a tricky problem with partially initialized common blocks that has been fixed.
Jan van Oosterwijk sent in a program with a large array constructor generated by RESHAPE() that was taking way too long to compile. Sped things up quite a lot there.
John Dormand sent in a problem with reopening a file in scratch mode that has been fixed.
Tom Crane pointed out that -Wall wasn't setting the warnings for unused variables. Fixed.
Alan Greynolds sent in a problem where some recent fixes to specification expressions uncovered a problem where checking was too strict. Loosened up now.
Lorenzo Pesce sent in a problem with module files under windows that has been fixed.
Joost Vandevondele sent in a problem with CMPLX and optional arguments that has been fixed, as well as a parsing problem of pointer targets. Joost also sent in the same problem as Harald Anlauf a couple days ago regarding complex specifics. I'd forgotten to fix ABS().
Warner Bruns sent in a problem with substrings that has been fixed.
Jim McDonald reported a problem with namelists that has been fixed.
Harald Anlauf pointed out a problem with BOZ constants in DATA statements that has been fixed.
James Van Buskirk, Peter Weinert, Laurent Prevot (and possibly others) have reported problems with carriage returns under windows. I think this problem is fixed now. A new windows binary is up.
James Van Buskirk sent in a problem with a tricky array constructor initialization involving substrings that has been fixed.
Roland Schilling and Giovanni Bussi sent in a problem with passing optional assumed shaped character arrays that has been fixed.
Joost Vandevondele sent in a problem with the MIN/MAX functions that has been fixed.
John Harper and Joost also sent in a problem with array expressions that has also been fixed.
Carsten Lemmen reported a problem with the -ffixed-form flag under OSX that has been fixed.
Paul Stevenson, Daniel Price and Charles Rendleman pointed out a problem with the namelists on OSX that has been fixed.
James Van Buskirk sent in a problem with renaming intrinsics in generic module interfaces that has been fixed.
Joost Vandevondele sent in a problem with specification expressions that has been fixed. This isn't the same one that James Van Buskirk posted to c.l.f. yesterday (and has already sent to me). Joost also sent in a problem with statement functions in PURE procedures that has been fixed.
Wolfgang Killian's WHIZARD code now compiles fine. I'm waiting to hear how it works.
Harald Anlauf sent in a problem with double complex specifics that has been fixed. He also sent in a problem with substrings that has been fixed as well.
Tim Gollnick sent in a problem with array indeces that has been fixed.
Bill McLean succeeded writing a python class that allows g95 to interoperate with Scientific Python distribution.
Roland Schilling sent in a problem with structure constructors nested within array constructors that has been fixed.
Jesús Carnicer sent in a problem with kind=8 integer exponentiation that has been fixed.
Stig Andersen reported a problem with array initialization that has been fixed.
Édouard Canot sent in a problem regarding restricted expressions that has been fixed.
Jean Pierre Heurteau and Willem Schreuder pointed out that the endianness of record lengths in unformatted sequential records weren't correct. A flag meant to signal the reverse of the endianness was being incorrectly used to set the endianness. Willem sent a patch that I've applied. He also sent a request to make the default byte ordering native to the processor instead of the current default big endian.
The original endianness was set to facilitate using these data files in heterogeneous environments where different compilers are writing files on multiple platforms. The problem with this is that of course that this messes up reading files across multiple compilers in a little-endian environment, of which the x86 is a very prominent example.
After a lot of thought, I've agreed with his argument. No matter what this is set to, it will cause problems for someone. I think the native setting will affect the smallest number of people, since it seems to me that people with an environment of homogeneous platforms are going to be more common than a heterogeneous environment. Plus the fact that this make g95 neutral in the ongoing big-little disputes. If the endianness is not what you like, you can always fix it. I am currently working on a system for an easier way of configurating these sorts of runtime variables besides just OS environment variables.
Lots today. I'm taking off to see the Clumsy Lovers tonight.
Vivek Rao pointed out a typo on the docs page which has been fixed.
Lorenzo Pesce reported success with his code. A further problem with arrays turned out to be an error in the program, not g95.
James Van Buskirk pointed out a regression involving the fact that the smallest default integer is actually -HUGE(0)-1, instead of just -HUGE(0). This used to work, but was broken during a recent shakeup. Fixed now.
Roberto Herrero, Roland Schilling and Michael Richmond sent in a problem dealing with my fix of the continuation of string constants a couple days ago. Also fixed.
Joost Vandevondele pointed out a nasty problem where output being redirected to a file in append mode would truncate the file. This is the correct behaviour for files that are opened by the program (usually), but not for a descriptor inherited from the operating system. Fixed.
Francois Bissey sent in a segfault that was only exercised on codes that used a lot of dimensions in an array. The fragment came from a QCD code, so it had enough dimensions. Fixed now.
Dale Ranta reported success with his SAGE code. He also sent in a problem with the IBSET() intrinsic and another with BOZ constants that has also been fixed. I've also fixed the analogous problem in IBCLR().
Jan van Oosterwijk pointed out a problem with the PAUSE statement when the strict-f95 flag was in force. This generated an error and some utterly incorrect wording. After a discussion with Harald Anlauf last week, he pointed out and I agree that compatibility issues like this should be warnings, not errors. So I've changed the PAUSE error to a warning. I've also made the analogous change to the ASSIGN statement.
I wasn't going make an exhaustive search myself (other fish to fry, at the moment), but please mail me if you see something along these lines that should be fixed.
Doug Cox sent in a problem where statement functions were incorrectly conflicting with common block names. Fixed. Doug has also continued to work on the g95 windows installer. The new version will have an uninstaller, better installation instructions and even the g95 logo. Development seems to be stabilizing, and we should have a new version soon.
James Van Buskirk found a longstanding problem with mixed real and complex arithmetic that has been fixed.
Dale Ranta sent in a problem with equivalences in common blocks that has been partially fixed.
Jose Canals-cerda reported success with his code, and execution times faster than a commercial compiler.
Walt Brainerd sent in a pair of problems, one with overloading the equals operator and another with array constructors that have been fixed.
Vivek Rao sent in a problem with the SPREAD intrinsic operating on zero-sized arrays that has been fixed. Also fixed the analogous problem in CSHIFT, EOSHIFT, MINLOC, MAXLOC, MINVAL, MAXVAL, PRODUCT, SUM and UNPACK.
Joost Vandevondele and Giovanni Bussi reported a problem passing assumed size character arrays to assumed length subroutines that has been fixed. Joost also pointed out some problems with zero sized arrays that have been fixed.
James Van Buskirk pointed out a problem where g95 failed to generate an error for improperly continued character constants.
Charles Rendleman, Lorenzo Pesce and Haralf Anlauf pointed out that g95 was suddenly very slow. The phrase "two orders of magnitude" was even mentioned. The problem was some internal debugging checks that were left on, and g95 is much speedier now.
Lorenzo Pesce sent in a crash on FORALL statements with array bounds-checking turned on that has been fixed.
Antonio Cervellino sent in a problem passing explicit-shape arrays that has been fixed.
Jack Berkery reported success with his codes: "G95 just cruised through a small subset ~250K LOC of this spaghetti slop without skipping a beat. Some of it goes back 30 years". Very cool.
Joost Vandevondele sent in a problem with redefining module variables that has been fixed.
Haralf Anlauf sent in a problem with modules introduced in the fix to Joost's problem above. Works all the way around now. Harald also pointed out that square brackets in array constructors should trigger a warning in strict f95 mode. Got that now.
James Van Buskirk pointed out that the windows port was not outputting a carriage return on windows platforms. I've fixed this and make it configurable through the environment variable G95_CR. The default is true on windows, false elsewhere.
James also pointed out the screwy math for G95_MEM_SEGMENTS which controls the number of segments of unfreed memory printed after a program run. Zero was being used for don't-print-anything and less than zero was for printing everything. I've switched it to the much more intuitive interpretation in which zero prints nothing and less than zero prints everything. He also found a problem with ascii-to-floating point conversion that has been fixed.
Charles Rendleman, Joost Vandevondele and Roberto Herrero sent in a regression involving arrays of derived types that has been fixed.
Vivek Rao pointed out that the unused variable warning wasn't working any longer. Fixed.
Doug Cox, with help from Michael Richmond, Vivek Rao, Elliot P. Chandler, Volkmar Klatt and John Dormand have a new port windows without cygwin. G95 now runs on windows natively, hooray!
François-Xavier Coudert sent in a problem with the atexit() function in mixed code that has been fixed.
Dale Ranta sent in a problem with EQUIVALENCE that has been fixed.
Harald Anlauf, Pasquale Panuzzo (and others whose mails I haven't found yet) reported some problems with arrays that have been fixed.
John Dormand reported a problem reading MS-DOS style files. As you might imagine, the problem was the carriage returns. Fixed.
Mark Hesselink sent in a nasty problem dealing with backspacing after a nonadvancing read that has been fixed. Joost Vandevondele sent in multiple problems with NULL pointers that have been fixed.
Alex Paz sent in a problem with COMMON blocks in modules that has been fixed.
Andrew Beddall sent in a mystery crash that mysteriously vanished.
Harald Anlauf sent in a problem with a NULL character pointer in a structure constructor that has been fixed.
Joaquim Ballabrera pointed out a crash on integer division by zero. I've made this more consistent with how floating point division by zero is handled, which is to say a warning.
Michael Richmond sent in a pair of problems with common block names that has been fixed. He also sent a problem with the EXTERNAL attribute and a corner case with recursive subroutines that has been fixed.
Jens Bischoff sent in some problems associated with reopening files that have been fixed.
Joost Vandevondele sent in a problem with FORMAT statements that has been fixed. He also sent in a problem with array constructors containing structure constructors that has been fixed.
Petter Strandh sent in a problem with a malformed line causing a core dump that has been fixed.
Daniel Millman and Mark Hesselink both reported success with their (very different) CFD codes.
John Harper sent in a problem with printing structure constructors that has been fixed.
Mark Hesselink pointed out a lousy error message if the configuration process went awry. Better text there now.
Édouard Canot sent in a problem with saving and restoring infinities and not-a-numbers in modules.
Dusan Jovic pointed out that the length headers and trailers for unformatted sequential records were always big endian, preventing interoperability with files written by x86 g77 or any other implementation that uses little endian. The length headers now track with the G95_ENDIAN setting.
Charles Gerlach and Daniel Millman reported a linker problem under OSX that I am putting in a hack fix until I can find a more permanent solution to the problem.
Charles Rendleman sent in a hang that I was unable to reproduce. It crashed for me. Fixed.
I am slowly working down the backlog built up over the last two weeks, but it looks like it is going to be slow going for a while.
Michael Richmond pointed out that the seed argument to the legacy RAND() intrinsic is optional in some implementations. I've made it optional for g95 as well.
Gerardo Ballabio and Joost Vandevondele sent in a problem with a too-zealous check for division by zero that has been fixed.
Clemens Foerst sent in a subtle problem with passing assumed shape character arrays that has been fixed.
Joost Vandevondele sent in a TINY() problem. There was an off-by-one power of two that is now fixed.
Silvio Gori sent in a subtle problem with in which the return length of arrays was being incorrectly set by the size of an incoming parameter. Fixed.
Bill Szkotnicki and Sam Key found a nasty problem with parsing integers on AMD64 that has been fixed.
Dan Stanzione, Wesley Emeneker and Torry Dixon took me out for beer and a burger at Four Peaks. They work on clusters at ASU, and we had a neat talk about all kinds of computing.
Dusan Jovic, Michael Richmond and Charlie Zender sent in a spurious error that had to do with long comment lines, with a comment line following in fixed source mode.
Jean Brillet pointed out a problem using internal subroutines as an actual argument. This isn't allowed, and I've added an appropriate error messages.
Joost Vandevondele sent in a very similar problem of a using a generic name as an actual argument, which is only OK if it is also the name of a specific subroutine.
Édouard Canot sent in a problem with boz constants that has been fixed.
Scott Brozell pointed out that the legacy RAND() and SRAND() functions are not implemented. I've implemented these as a combination quick multiply with carry generator and a multiplicative generator. This generator is independent of the RANDOM_NUMBER() intrinsic.
Tony Simmers pointed out a problem with printing namelists via the PRINT statement. This turned out to be an extension that I've added for g95. Now you can say "PRINT NAMELIST", and it will behave pretty much like you'd expect it to.
Joost Vandevondele sent in a problem with the hexadecimal parser for the G95_MEM_INIT variable. This allows you to specify a default initialization for otherwise initialized memory. In particular, you can set the initialization to be a not-a-number value to detect use of uninitialied memory. The parser was slight broken, but is now fixed.
Vivek Rao pointed out that PAUSE statements were being quietly accepted in strict f95 mode. Fixed.
Marc Truscelli sent in a problem with unformatted reads that has been fixed.
A donor who prefers to remain anonymous has sent me a copy of the "F2003 Explained" book by Cohen, Metcalf and Reid. Mail is stacking up, back soon.
Michael Richmond, sender of many bugs, sent in contribution of US $1000.00. It is much appreciated. He reports that his heat transfer code for spacecraft is working fine.
I've gotten bad about doing updates, and it's going to get worse. I am going on a short vacation and should be back soon. I'll have sporadic access to mail, but bugs are going to have to wait.
Before I go, there is an exciting new feature for g95 that I want to announce, tested by Michael Richmond, Doug Cox, Harald Anlauf, Charles Rendleman and Joost Vandevondele.
It involves resuming program execution from a core file. If you interrupt a program by sending it the QUIT signal, which is usually bound to control-backslash the program will stop just as if it had been sent the interrupt signal usually bound to control-C. The difference is that the QUIT signal causes a core file to be dumped if your ulimit allows it.
G95-compiled programs can now load core files and resume execution of a stopped program. This is available on x86 linux but will be ported to other systems soon. An example would be:
andy@fulcrum:~/g95/g95 % cat tst.f90
The limits are that you must resume from the same binary as you stopped from and any open files must be present and in the same places. If you link against other languages, this may not work.
While the main use is allowing you to preseve the state of a run across a reboot, other possibilities include pushing a long job through a short queue or moving a running process to another machine. If you can think of something else that is neat, let me know and I'll added it to the documentation.
Thanasis Stamos sent in a problem with the letter omega that has been fixed.
Joost Vandevondele sent in a typo in the docs pages that has been fixed.
Jan Nobel and Charles Gerlach sent in a nasty problem with the runtime library on OSX that has been fixed.
Howard Berger reported a subtle problem where implicit types were not being respected.
Doug Cox has prepared a self-extracting installer package for installing g95 on Windows systems without Cygwin. It needs to be tested. Contact Doug at email@example.com. Josh Bertra found a problem with the -ffixed-form option being ignored that has been fixed.
Keith Refson sent in a pair of problems with preprocessing. Trigraph processing got enabled by accident, and I've turned it off again. There was also a problem with using a fortran include during C preprocessing that caused the include paths to be ignored. Also fixed.
Scott Palmtag sent in a problem with reading unformatted files when the record size is was too small that has been fixed.
People have been asking for documentation lately, so I've written some. The link is above here. I've got some ideas for more sections and will write them down soon.
Jon Rotvig sent in a code that caused a crash on interface blocks that has been fixed.
Samuel Key sent in another problem scalarization of derived type structures that has been fixed.
Kay Dewhurst sent in a problem with the INQUIRE statement that has been fixed. He also reports that they're using g95 as a teaching tool at his university as well as for computation.
Thomas Koenig reported a subtle bug in the module procedure disambiguation code that has been fixed (yet again).
Boyd Blackwell sent in a problem with the -d8 option (which implies both -r8 and -i8), which was being ignored. Fixed now. Boyd also requested printing out unit numbers in addition to the file and line number during error printing. I've added this now. He also pointed out a bug that caused namelists to be written in unformatted mode that has been fixed as well.
Jens Bischoff sent in a problem with character parameters in modules and a host-association problem, both of which have been fixed.
Roland Schilling also reported the failure of the -r8 to do the right thing. Joost Vandevondele sent in a code where g95 was not enforcing argument INTENTs which has been fixed.
Bruce O'Neel, Edwin van der Weid and Harald Anlauf reported a regression with the -I option that has been fixed. Harald also sent in a regression regarding the exponent of zero in the D and E formats that has been fixed.
Carsten Lemmen found some serious problems with my new -r8 and -i8, and it looks like I'm going to have to live with evil.
Bamrung Somswasdi, Yiyang Sun, Warner Bruns reported a problem with the errno fixed yesterday. I'm not totally sure why it worked on my system here, but I have a tentative fix in place.
Teruo Yamawaki sent in a problem with CASE statements that has been fixed.
Edwin van der Weide and François-Xavier Coudert both reported another problem with preprocessing on OSX which has been fixed.
Gerardo Ballabio sent in a second problem with preprocessing.
Carsten Lemmen and Stuart Midgley both sent in a regression on OSX dealing with null strings that has been fixed.
Warner Bruns pointed out that there was no way to retrieve errno information from the IOSTAT values. After some research he found out that libf2c handles this problem by having the fortran error codes start at 100, with values less than this being errno values. We've adopted this scheme with the exception that fortran error codes start at 200, since there are 124 errno code in Linux.
Yiyang Sun pointed out that -i8 and -r8 weren't working quite right. In fixing this, I've excised an ancient evil within g95. These used to change the default kinds, but the reality is that you just can't do that without breaking things at a very fundamental level-- that is why there are separate binaries on 64-bit platforms that differ in the size of their default integer.
What -i8 and -r8 really do is to change the kind attached to variable declarations without a specific kind specification, as well as changing the kinds associated with the default implicit types.
Michael Richmond sent in a regression with bad label warnings that has been fixed.
Roland Schilling sent in a problem with passing optional character arguments that has been fixed.
Warner Bruns sent in a pair of string problems on AMD64 that have been fixed.
Joost Vandevondele sent in a code with a spurious error having to do with the intents of pointers that has been fixed. This was similar to a case he sent in recently, but much trickier.
Dean Wadsworth sent in a problem with recursive character functions that has been fixed.
I messed up the build last night and built the wrong sources, which caused some confusion about yesterdays bugs not being fixed.
Ross Lippert reported his module/memory bloat problem wasn't quite gone, but I think I've found the problem. We're continuing to exchange mails.
Eric Kostelich sent in some code that made use of a TR-15581 extension. I've fixed the problem.
Joost Vandevondele found a problem with using the INDEX intrinsics as a dummy procedure argument which has been fixed. Joost also sent in a problem with WHERE that has been fixed.
Warner Bruns and Bamrung Somswasdi sent in a problem with accessing arrays on the 32 bit version of AMD64 that has been fixed. The same problem would have affected IA-64.
Warner also sent in an AMD64 problem with string comparison that has been likewise fixed.
Edwin van der Weide also sent in a report about the problems with the preprocessor under OSX that has been fixed.
Stephane Guilloteau, your first code was illegal and I've suggested a legal alternative. I couldn't repeat the crash in your second mail, I may have fixed it a few days ago. I tried to mail you back but it bounced... Can you supply an alternate return address?
Jean-Luc Vay, Donn Hardy and Charles Gerlach reported a problem with C preprocessing on OSX that has been fixed. This isn't the first time that Apple brokenness has had to be worked around.
Juergen Wieferink sent in a general problem with preprocessing that has been fixed as well.
Volkmar Klatt reported that another fortran 90 class is using g95 as its compiler.
Tom Crane sent in a problem with spurious errors on labels that has been fixed.
Mail has been piling up again and I'm trying to reduce it...
Bob Clark sent in a crash on solaris that I'm amazed didn't crash on linux. Fixed everywhere now.
Joaquim Ballabrera and Joost Vandevondele sent in a problem with the STAT variables in ALLOCATE and DEALLOCATE statements that has been fixed.
Douglas Cox pointed out that the link to the cygwin binary was broken. The script that was supposed to update it on a regular basis ran last night and ended up deleting the existing tarball. Fixed, I hope.
Roland Schilling reported a problem with F formatting that ended up being an off-by-one error that is fixed. Roland also found a subtle problem with FORALL that has been fixed.
Douglas Cox has volunteered to produce a cygwin binary on a semi-regular basis. The binary is up. Thanks Doug!
Roland Schilling sent in a problem with using a character component of a derived type array as an actual argument. Roland also pointed out a problem with keyword arguments that has been fixed.
Stewart Mosso sent in a problem with derived type constructors that has been fixed.
Zhenhua Yao reported a problem with complex constants that has been fixed.
Michael Richmond sent in a regression with sequential files that has been fixed.
Douglas Cox, Joost Vandevondele and Harald Anlauf have been working on getting g95 to compile on cygwin out of the box, and after several iterations we've finally got things to where this is possible. We're currently working out details for posting binaries that other people can use.
Vivek Rao noticed that the build date on the OSX binary hadn't budged. This turned out to be a typo in the build program. Fixed.
Bamrung Somswasdi noticed a bad problem with the AMD64-32 port. This had to do with the start libraries, and has been fixed.
Jeff Whitaker also noted a bug in the OSX build that has been fixed and also pointed out that we're using a particular version of gcc that needs to be noted in the compilation notes page. Updated.
Sam Key sent in a problem with error line numbers being incorrectly reported which has been fixed.
Stewart Mosso sent in a problem with derived type constructors that has been fixed.
Dieter Kraft reported that his code now compiles.
Joost Vandevondele suggested a feature that would report the maximum number of bytes allocated during the execution of the program. I've added this in the form of the G95_MEM_MAXALLOC variable. If this environment variable is true, then this information is printed at the end of a run.
Tim Wood pointed out that the old TIME() intrinsic extension wasn't implemented. I've added it.
Agullo Olivier found a bug on the 64 bit version of CEILING() that has been fixed.
Put all the bugs on hold and revamped the build system a bunch to speed thing up a bit. I've added 32 bit ports for the 64 bit platforms, since the 64 bit default integers sometimes break code. You can still allocate more than 4G of memory with g95, but the default integers are only 32 bits, which keep compatiblity with old programs.
With lots of help from Jeff Whitaker, we've brought the OSX port back to working status. OSX users are going to have to upgrade their cctools the next time the back end is upgraded on OSX.
Michael Richmond, Wolfgang Killian and Joost Vandevondele reported a regression involoving module procedures introduced last night with the memory fix for Ross Lippert. Fixed.
Joost Vandevondele pointed out that I did not correctly fix Eric Kostelich's namelist problem yesterday. I ended up fixing something else and forgot about the original problem. All fixed now.
Balbir Thomas sent in a crash associated with assigned goto statements that has been fixed.
Eric Kostelich and Joost Vandevondele reported a bug dealing with a conflict between namelists and the PRIVATE attribute that has been fixed.
John Bray sent in a problem with pointer arrays that has been fixed. Again.
Jeff Whitaker and I have been corresponding regarding the OSX port. Jeff has tracked the current build problem there to a new version of the assembler which is apparently needed for the gcc build. More on this as it develops.
Bill McLean pointed out that it was impossible to link to module procedures or access module variables from other languages using the current name-mangling scheme, which was just inserting a period between the module name and symbol name. Joost looked at some of the schemes used by other vendors and we've settle on changing the period to '_MP_', imitating the NAG compiler.
Ross Lippert reported a problem with module files using up too much memory that has been fixed.
Rheinhold Bader sent in a portability problem with the SHAPE() intrinsic on IA-64. I've fixed it and a similar problem in MINLOC() and MAXLOC() as well.
Joost Vandevondele also reported a segfault for files larger than 2G which has been fixed.
Ben Barrowes pointed out that the backslash is often treated the dollar sign in a format string. Added.
Joost Vandevondele sent in a pair of problem with arrays in structure constructors similar to the ones sent in by Joachim Geiger yesterday, but slightly different that have been fixed.
Joost also sent in a problem writing array sections that has also been fixed.
Thierry Deutsch sent in a problem with character concatenation that has been fixed.
Wolfgang Kilian sent in a regression involving structure array pointers that has been fixed.
Matthew Halfant sent in a problem passing assumed shape descriptors on the AMD that has been fixed.
Ben Barrowes pointed out a place where g95 was being a little too anal.
Bamrung Somswasdi reported that his codes now work.
Wolfgang Killian and Nicholas Gruel pointed out that my implementation of GET_COMMAND_ARGUMENT() didn't give access to argv. The standard doesn't require it to, but it is a natural extension. Implemented.
Wolfgang requested COMMAND_ARGUMENT_COUNT() to complete the triptych. Also implemented.
John Bray, Juha Ruokolainen, Joost Vandevondele and Wolfgang Kilian sent in a scalarization regression introduced a few days ago fixing a problem that Carsten sent in. Fixed for everyone now.
Luis Jose Maia Amoreira reported a typo on the compilation notes page that has been fixed.
Joachim Geiger found a problem with arrays in structure constructors that has been mostly fixed.
Carsten Lemmen, Joost Vandevondele and others requested support for the assigned goto statement, which has been added.
Fixed a couple small problems that crept into the printing of floating point numbers lately.
Chris Dallimore reported a mystery internal error which has been fixed in the last two months.
Sander Belien found a problem with the SPREAD intrinsic that has been fixed.
Hans-Ulrich Schaefer had a problem namelist input that I suspect is a badly structured namelist, one that does not end with a slash character. I've extended g95 to simply treat end of file as a slash.
Rheinhold Bader also sent in a mystery failure that now mysteriously works.
Nicolas Gruel pointed out the f2003 command line intrinsics GET_COMMAND() and GET_COMMAND_ARGUMENT() weren't implemented. I've added them.
Wolfgang Killian sent in a problem with CHARACTER parameters that has been fixed.
Long day, time to go get some beer and cheesebread.
Mike Olsen reported a bug with string concatention specific to AMD64 that has been fixed.
Matthew Halfant and Leoncini Xavier reported a problem with array constructors on AMD64 that has been fixed.
Charlie Zender reported the successful compile and execution of the Numerical Recipes libraryes, the f77 (which I think already worked) and the f90 version. Hooray!
John Bray pointed out a problem printing derived types with pointers in them. The error was kicking in even if it was a non-pointer component of the derived type.
Joost Vandevondele pointed out small nit with DATA statements that has been fixed.
Michael Richmond sent in a problem with the EXIT() extension that has been fixed.
Joost Vandevondele sent in a regression involving some debug code that was still there as well as a problem with specification expressions that has been fixed.
Joost also discovered an old problem regarding intents of pointers that has been fixed.
Carsten Lemmen sent a problem with scalarization that is now fixed.
Simeon Fitch found a problem with simplification of substrings that has been fixed.
Jean-Luc Vay and other folks have requested a long symbol length. I've bumped it up to 63, the length under f2003, but it will go back to 31 under strict f95 mode.
John Bray and David Davies reported a problem with building character array constructors that has been fixed. The surprising thing about this bug was that they are both compiling the same code...
Michael Richmond sent in a nasty regression involving attribute conflicts that has been fixed.
Andrew Grief sent in another regression where ambiguous module symbols weren't being reported. The module code is very delicate and it took a while to find the problem.
Joost Vandevondle sent in a problem about printing derived types that have private components. This is allowed in the module where the type is defined. Fixed.
Charlie Zender reported that his problem from yesterday still didn't quite work. Fixed now.
Bil Kleb reported that his codes now work.
Mimo sent in a problem with the -fstatic option that has been fixed.
Michael Richmond sent in a regression where a parameter variable was being incorrectly accepted as a loop index.
Joost Vandevondele sent in a crash using intrinsics without resolution functions as dummy arguments. Joost pointed out a serious problem with yesterday's build where whole clauses were deleted.
The problem turned out to be yesterday's bugfix for Charlie Zender's bug. I put Charlie's bug back in for today and have just fixed it for real.
Gerardo Ballabio reported missing intrinsics for ALL(), ANY(), COUNT() and MAXVAL() on IA-64. These were actually missing on the 32 bit version of g95. Added.
Gerardo also reported that a library, libunwind was dynamically linked into the IA-64 binary. This library isn't always present on IA-64 systems, and I've worked out a way of overridding the automatic linking of it. This will allow the binary to run on a wider variety of systems.
Michael Richmond found a regression involving IMPLICIT NONE that has been fixed.
Bil Kleb was still having problems with the CHDIR() extension. Like many extensions, it can be a subroutine or a function, and I only had it as a function. It's both now.
Delbert Franz reported some serious speedups in his river simulation codes.
Charlie Zender reported a crash on a corner case where a program unit had contained program unit and no other statements.
Ross Lippert and Joost Vandevondele sent in a spurious warning about line truncation when a comment is being truncated. Comments are now truncated silently.
Harald Anlauf pointed out a problem with the intrinsic bessel functions being single precision only. The library functions being called are all double, so I've switched them.
Mimo pointed out that many fortran compilers allow an option to force variables into static memory. Many old codes depend on this. I've added an -fstatic option to accomplish this.
Vivek Rao sent in a US $250.00 contribution. I'm not rich, and this will help me work on g95. Thanks Vivek!
I've ported g95 to the AMD-64 and IA-64 architectures. These are 64 bit ports, with the default integer being 64 bits long. Rheinhold Bader helped a lot with this one. We've already found bugs in the 32 bit version.
I've also finished ports for all of the existing machines except OSX, and this is because there is some weird assembler problem building gcc for OSX.
Many of the build problem people have reported have been fixed. It's been a wild weekend, but I'll have source tomorrow.
Bugs have built up and now I am headed back in that direction again.
Bruce O'Neel sent another problem with MAXLOC(), again the problem with some internal changes of how intrinsics are called. Fixed.
Bruce O'Neel sent in another problem with SUM() that has been fixed.
Bil Kleb pointed out that chdir() wasn't present. I've added it.
Bernhard Seiwald sent in a problem with the WHERE statement where the assignment statement was a scalar expression.
I've managed to get the solaris port working again, but the machines that I've been using for ports have been very flakely lately and I've been working on making alternate arrangements. The other bad news is that the solaris compiler is old enough to where I wasn't able to address the problems with the newer versions of gcc.
Paolo Giannozzi, Douglas Cox, Keith Refson and Bruce O'Neel sent in a problem with optimisation of arrays in common and equivalence blocks introduced by an array fix last night. The new problem is fixed as well.
Wolfgang Killian pointed out a problem where a READ was not being allowed after a nonadvancing write, even though the file had been positioned to the next record. Fixed.
Joost Vandevondele, Michael Richmond and Anders Ålund reported regressions related to scalarization of intrinsic functions with missing optional arguments that had been fixed. This is a direct result of the fix in scalarization from a few days ago.
Joost and Charles Rendleman also sent in a regression having to do with how the elemental attribute affects the matching of interfaces in two widely different situations.
Wolfgang Kilian and Michael Richmond sent the same, similar problem except that it was a bug in the code that decided how to call subroutines with array parameters.
Laurent Debreu sent in a problem with LBOUND() that has been fixed, some breakage from the upgrade this weekend.
Michael Richmond sent in a bug dealing with illegal access specifications that has been fixed.
Matt Kennel sent in a problem regarding some automatic arrays that were accidentally being declared statically.
Rheinhold Bader sent in a patch for the EOSHIFT() intrinsic which has been applied.
Scott Brozell reported the successful compile and execution of the AMBER program. He had some problems with the FDATE() intrinsic extension missing, which I've added.
Matt Kennel sent in a subtle problem with loops that has been fixed.
Tom Crane and I have been corresponding about a problem with a multiprecision library. The problem turned out to be the fact that the runtime library sets the intermediate precision to 64 bits in intermediate floating point calculations, where this library requires that be turned off.
So although the runtime precision can be set by an environment variable, I've changed things so that the precision is not changed unless the G95_FPU_PRECISION variable is set to something legal.
Roberto Herrero reports that his reactor simulations are working again.
People are still having build problems and I am corresponding with several folks on different platforms to try and get g95 buildable on places besides with the brain-dead compiler I use.
Rheinhold Bader sent in a problem with array accesses that has been fixed.
Ross Lippert sent in a problem with resolving user defined operators that has likewise been fixed.
Joost Vandevondele sent in a problem with assumed length character functions that has been fixed.
Wolfgang Kilian sent in a problem with MAXVAL that has been fix. The problem here was a result of fix to how argument lists were represented. As it turned out, there were other part of g95 that depended on this being wrong, and the fix here set off a cascade of other problems that now look like they are under control.
Rheinhold Bader and I have determined that you need the 8/25/04 gcc sources to build g95, not the 8/24. I did a full checkout on 8/24, right after someone had made a change, so the source is slightly out of sync.
Rheinhold Bader and I have exchanged some more mails about building g95. The main problem remaining seems to be differences in the versions we are using.
Charlie Zender sent in a problem with EN formatting that has been fixed. Charlie also pointed out a problem with old f77 spaghetti codes that violate rules about GOTO and enclosing blocks. I've reduced the error to a warning in order to support these old codes.
Thomas Starke sent in a problem with the MODULO intrinsic that has been fixed.
Michael Richmond sent in a problem with the IOLENGTH of derived types in separate module procedures that has been fixed.
Joost Vandevondele sent in a subtle problem with CHAR() that has been fixed. More breakage from the recent port.
Keith Refson sent in a problem with the optimizer. While reducing his test case too far, g95 failed to produce an error for a function with no type. I ended up tracking the problem to an optimizer bug within the C compiler. Arghh. Working around the problem for now. Still working on the optimizer problem.
Dieter Kraft and Reinhold Bader reported problems building g95. My version of gcc is so old, it was ignoring a #pragma that caused (intentional) problems later on. Fixed now.
And of course, happy birthday to Meghan.
Andrew Buckeridge: I tried to mail you back, but your ISP doesn't like my ISP... If you have an alternate address, please let me know what it is.
Hermann Deppe reported that his codes are working.
Christian Pfaffel reported that his codes are working.
John Pau reported that his codes are working.
Douglas Cox found some serious typos on the compilation notes pages. I needed some exercise last night and ended up pretty tired by time I got around to updating it.
Joost Vandevondele found a rounding bug in F-formatting originally reported by Harald Anlauf last week. I fixed the original problem with some baling wire, which promptly broke, so I wound more around it. The bug reappeared because the fix was made on a branch and I never ported the fix back. But I've had a chance to do thing right and the problem is hopefully gone for good this time.
Joost also sent in a small problem with the STOP statement that has been fixed.
Harald Anlauf suggested removing the W from the language level options. Originally, the W was necessary to make sure that the driver passed the option to the back end. With the new option parser, you can name options however you want.
Claus Flensburg found a problem with the -fbackslash option not working. Another casualty of the recent port.
Ross Lippert sent in one of the bugs that prompted the port to the new backend. You know you've wounded the compiler deeply when it starts spitting out lisp at you. The new version accepts his code fine, so I don't know what was wrong and don't much mind.
More upgrade bug fixes:
Michael Richmond, Christian Pfaffel and Paolo Giannozzi sent in a problem with module variables not being visible in contained procedures that has been fixed.
Hermann Deppe reported the ICHAR() problem. Darn time zones!
Claus Flensburg pointed out some problems in the -fno-underscoring and -fno-second-underscore options. Because the new option parser looks for the "no-" prefix, you have to parse the options in the positive sense, and then negate the sense of the flag. Fixed.
Helge Avlesen pointed out that the version being reported by g95 was incorrect. This was because I was using the old version file copied from the old back end. The new version number is created by mangling gcc's existing version.c, adding the correct bug report URL that everyone is so familiar with by now.
John Pau sent in a problem with scalarization and the GOTO that has been fixed. This one had nothing to do with the recent upgrade.
Volker Eyert, Joost Vandevondele and Claus Flensburg sent in a problem with ICHAR() that went far deeper than just that intrinsic, having to do with how character variables are represented. It took a long time to fix, but I'm learning a lot about the new back end. It's much more picky than the older version we were using.
Joost also sent in a problem with the scalarization that crept in a couple days ago while I was doing the port. Also fixed.
Douglas Cox reported a major speedup in the code that g95 generates, within about 10% of ifort on -O3. All the -fxxx optimizations (f is for funky) should also work as well.
Charles Rendleman sent in a problem with module paths that got munched in the upgrade and has been fixed.
No other ports besides linux yet.
I've finished the port to the current gcc backend. The new version should be vastly faster than the old version. The only port available at the moment is x86 linux, more to follow soon.
I've been working steadily over the last couple days at getting g95 to work with the current gcc back end. I can now get a clean build and can compile and run simple programs. It looks like the code generated is quite tight, at least on x86. There are several bugs that have crept into the new gcc that I've had to work around as well as conventions within the back end that have changed. Current issues are on hold at the moment.
Harald Anlauf sent in a problem with rounding during printing that has been fixed.
Joost Vandevondele found a problem with the fix which has been fixed again.
Joost Vandevondele sent one more problem with substrings of array sections that is now fixed.
At the behest of several folks over the last several days, I've added the build date to the --version string.
Matthew Francis reported the successful compilation of the CAMB cosmology code.
Stuart Midgley reported the successful compilation and execution of his adaptive mesh code.
Carsten Lemmen pointed out a pointless underflow error that I've disabled, pending a rewrite of how these things are handled.
Joost Vandevondele requested a couple of common unix extensions-- getuid(), getpid() and getlog(), which have been implemented.
Matt Kennel and Simeon Fitch both reported a problem with allocatable arrays of derived types with default components that has been fixed.
Michael Richmond sent in a problem regarding endfile processing that has been fixed.
Mimo sent in a problem with scalarization and the TRIM intrinsic that has been fixed.
Keith Refson, Roberto Herrero and Joost Vandevondele sent in a problem passing array sections and substrings to procedures that has been fixed.
Jürgen Wieferink sent in a problem with record sizes that has been fixed.
Michael Richmond sent in a problem with unformatted rewinds that has been fixed.
John Bray sent in a problem with assumed length character arguments that was likely fixed some time ago. John also sent in a problem with character array constructors that has been fixed.
Carsten Lemmen sent in a problem with spaces in a simple WHERE statement in a simple IF that has been fixed.
Keith Refson sent in yet another problem with ICHAR() that has been fixed.
Harald Anlauf found a nasty sign problem in printing list formatted reals.
Jacob Heerikhuisen sent in a subtle problem with opening include files that has been fixed.
Joost Vandevondele mailed a problem with character functions that are also module procedures that has been fixed.
Michael Richmond reported a problem with the FORALL statement that has been fixed.
Douglas Cox sent in a problem, originally from Tobi White that involved implicit character variables that has been fixed.
Mart Rentmeester and I exchanged several emails concerning linking programs on HP-UX.
Andras Szabo pointed out a minor problem with the webpage-- the solaris and hp-ux 11 binaries were mistakenly listed as being x86.
Paolo Giannozzi sent in a problem with PURE character functions that has been fixed.
Roberto Herrero sent in a problem with uninitialized array pointers in structures that have initializations. This was broken by a fix a couple days ago. All cases seem to work now.
Michael Richmond sent in a problem with block labels on CASE statements that segfaulted under certain weird conditions. Fixed. Michael also sent in a problem with empty common blocks, which I've decided to allow as an extension but error in strict (-Wstd=f95) mode. He also sent in a problem with empty CONTAINS blocks that weren't being flagged as errors either.
Michael also sent in a problem with the BLOCK DATA statement that has been fixed.
Bob Clark reported that I really didn't fix his bug from yesterday. This was part of the last minute bugfix. I think I have it fixed for everyone now.
Mart Rentmeester sent in another problem with HP-UX, dealing with rounding that has been resolved.
Bob Clark sent in a problem with intrinsic assignment that has been fixed.
Stuart Midgely found a problem about ten minutes after I uploaded. It was a pretty fundamental problem dealing with the fixed to Bob's problem. Array rank checking was all messed up.
I'm shutting off the computer and going to bed!
Madhusudan Singh noted that the HOSTNM() extension wasn't present. I've added it.
Harald Anlauf reported a problem with the recent upgrade to the SAVE attribute handling that has been fixed.
Mart Rentmeester sent in a problem with the HP-UX 11 port involving the accessibility of an internal global symbol that has been fixed. He also sent in a problem on all platforms involving mutually referential structures that has been fixed.
I've also rewritten my multibuild script from scratch. The old architecture involved describing each build machine in an overly complicated manner in an attempt to save bandwidth. Some of these machines are behind firewalls, some have ssh, some don't, some share a common NFS filesystem and so on. It was all needlessly complicated.
The new method involves a client-server approach. A small python client is placed on each build machine. The server knows how to log into each machine and run the client. Once connected, the server and client talk to each other in order to build g95. The client takes care of the business of unpacking, configuring, building g95, building the final tarball and sending it back to the server, which pipes it up to sourceforge.
The clients also simplify moving files back and forth. Instead of having to know how to transfer files from each machine (which can be a multistep process in some cases), files are actually sent across the login connection, which is usually ssh, but also involves telnet in some situations. The protocol is simply a series of base-64 encoded lines with an endfile marker. The client is less than 150 lines of python and the server is only 350 lines.
About 250 lines of the server are devoted to building g95, while the last 100 run a loop that forks as many children as there are machines, collects and prints their output, as well as gathering the final statistics. The program also has a test mode where g95 is built on a remote system, but not uploaded or deleted in order to facilitate doing some platform dependent development or debugging.
Right now, the whole thing takes about twenty minutes to run. This will no doubt degrade over time as more ports are done.
Two new ports, Solaris and HP-UX 11. Mart Rentmeester helped out a lot with the HP-UX 11 port. Back to bugs.
Stuart Norris sent in a problem with array initialization in nested derived types that has been fixed.
John Bray sent in a problem with ADJUSTL() in an array constructor that was fixed sometime it the recent past.
John Bray sent in a problem involving scalarization of assumed length character variables that has been fixed.
The OSX build setup somehow got trashed, and I have rebuilt it.
After much consideration, I decided to finish the rewrite. As mentioned in the last entry, there is a small flaw in the implementation. The ultimate fix involves adding on to what is there now, so that will wait for later.
But the good news is that not only do things appear to be working again, the netcdf library now compiles and passes all of its tests.
Halfway through rewriting how assumed length character functions are handled, I discovered major flaw in my plan. The flaw is so bad that it require undoing a couple of previous fixes. I was explaining to my mother what I was this project was about the other day and the best I could come up with is that its like a gigantic puzzle. None of the pieces fit together right now.
Douglas Cox and Charlie Zender have been helping out by compiling some code so that I can see how some other implementations implement assumed length character specifications.
David Strozzi sent in a crash in when use-associated symbols were being treated in the wrong way.
Douglas Cox and I sent a bunch of letters back and forth regarding carriage control descriptors during a nonadvancing write. The upshot was that g95 is doing things right and some other compilers don't.
I've introduced a serious problem with the fix two days ago to specification expressions. No upload yet.
Simeon Fitch sent in a problem with the REPEAT intrinsic that has been fixed.
Joost Vandevondele sent in a problem with SHAPE() that has been fixed as well as a problem with the type of the NULL() intrinsic. He also sent in what is hopefully the last problem relating to the change in representation of the null string.
Douglas Cox sent in a regression involving an illegal specification expression. Fixed. He also sent in a longstanding issue about printing not-a-numbers with signs.
Edwin van der Weide and Stefan Hildenbrand both reported a problem with the null string when used in SELECT statements that has been fixed.
Joost Vandevondele sent in a crash dealing with module procedures with alternate returns. Fixed. He also sent in a crash on a SELECT CASE statement that had no possible matches.
John Bray sent in a problem with the SAVE attribute that looked easy, but turned out to be a lot more involved than I thought. G95 doesn't work very well right now, no upload yet.
Roberto Herrero, Michael Richmond and Joost Vandevondele sent in regressions with the ICHAR() fix on the 26th. This has involved an upgrade in how character lengths are handled, thus the many regressions.
Bill McLean reported that his code now works with g95.
Mimo and John Bray sent in a problem with scalarization of the character intrinsic functions that has been fixed.
Claus Flensburg sent in a crash for a call to ETIME() without an argument that has been fixed.
Bill McLean sent in another crash when initializing structures with default types. Fixed.
Joost Vandevondele sent in a problems with ICHAR() and elemental functions that have been fixed.
Michael Richmond and Joost Vandevondele both pointed out a problem where files were not being truncated after writes.
Jon Rotvig sent in a problem with the SHAPE() intrinsic that has been fixed.
Douglas Cox, Joost Vandevondele and Ross Lippert sent in related problems with COMMON blocks within modules that has been fixed.
Stuart Midgley had one final problem with assumed length character variables that has been fixed. His fscript program now compiles and runs. Stuart is testing it further.
Bill McLean sent in a problem with the type of the REAL intrinsic that has been fixed.
Claus Flensburg pointed out a problem in the OSX build where several subroutines were not being compiled. The problem had to do with the -no-cpp-precomp being omitted from the CFLAGS. This let Apple's C preprocessor wreak its usual havoc.
Wolfgang Kilian found a problem with SELECT statements that has been fixed.
Donn Hardy sent in a crash related to derived types in COMMON blocks that has been fixed.
Harald Anlauf sent in a problem where elemental specification functions were being incorrectly rejected. Fixed.
Joost Vandevondele sent in a problem dealing with elemental functions that has been fixed.
The vacation lasted a little longer than planned. Nonrevving is not for weenies.
James Tappin pointed out that erf() and erfc() were unimplemented. I've added them.
Several people have been asking what the options are to force and prevent C preprocessing from taking place regardless of the extension of the file being compiled. They are -cpp and -nocpp respectively.
Henri Calandra pointed out that sometime big endian on unformatted I/O isn't always desirable. I've added an environment variable, G95_ENDIAN that can be set to BIG, LITTLE or NATIVE to control the endianness.
Rheinhold Bader sent in a configure patch for ia64 which I've incorporated. 64 bit support is on the way.
Assic Ma pointed out that an isnan() function extension was missing. Added now.
Off for a long weekend... I will check email sporadically, but otherwise there won't be much progress on pending issues.
Douglas Cox sent in a regression from one of the NIST tests that has been fixed. The problem was the big-endian transformation added to unformatted I/O a while back.
Tom Crane pointed out a correct but pointless warning about comments being truncated in fixed form mode that has been fixed.
Joost Vandevondele sent in another dozen unimplemented constraints that I've made some headway on.
Joost and Doug pointed out that g95 was not behaving like the fortran compilers of yore, which padded input cards to 72 columns with spaces in fixed form mode. No newlines on cards. Some codes expect and need this, fixed now.
Ray Gomez sent in a problem with sequential files being read beyond the record boundary that has been fixed.
Drew McCormack found a pair of bugs in handling COMMON blocks that have been fixed.
Joost Vandevondele sent in a other problem regarding the simplifcation of elemental functions. The problem was caused by an earlier fix to Eiso's problem from a few days ago. The current fix is sort of a hack, but seems to satisfy everyone for the moment.
Stuart Midgley sent in a spurious error having to do with modules that is now fixed. A nasty problem with assumed-length character parameters remains. I tangled with this a while back and need to take this bug out.
Jens Bischoff sent in a pair of off-by one problems that cancelled each other out most of the time, but not with direct access files. Fixed.
Charles Rendleman sent in a problem with arrays inside of derived types. This one was accidentally introduced yesterday during the private/public fixes from yesterday.
Joost Vandevondele sent in another constraint on variables with the PRIVATE attribute, which correctly errors out now. Joost also sent in a problem with NULL() initialization within data statements. These were being incorrectly compared with the types of the variables. Pointers now have their own special comparison.
Joost also sent in a problem with not signalling an error during pointer assignments that has been fixed, nor when ending block-labeled do-loops implicitly. We also fixed multiple problems with SELECT statements. Then we moved onto I/O where we fixed a problem with internal files, and about half a dozen other issues.
We had a merry time. He sent them faster than I could fix them for the most part and the only reason I caught up was the time difference between Arizona and Europe.
Sander Belien sent in a problem with array functions inside array constructors that has been fixed.
Tobi Heinemann, Joost Vandevondle, Roberto Herrero and Charles Rendleman sent in problems with zero length strings in structure constructors and SELECT statements. The fundamental problem was caused by the recent change to how null strings are represented. Fixed.
Tobi also reports that the Pencil code (a hydrodynamical code) compiles fine.
Joost Vandevondele sent in a problem with private components of public types that now correctly errors out. Joost also sent in a problem with kindspecs of character variables, and a problem with accessibility attributes being accepted where they were not allowed.
Roberto Herrero sent in a spurious error during simplification of array functions that has been fixed.
Eiso Ab sent in a problem with the MAX() intrinsic that has been fixed.
James Tappin reported that the configuration patch for linux-powerpc worked fine.
Won Kyu Park reported a successful build of g95 on an Opteron, and sent in a small patch for setting the floating point architecture.
Martien Hulsen sent in a problem with statement functions that I've tried to fix. I remain pretty behind on bugs.
James Tappin reported mostly success on compiling g95 for linux powerpc. We're working on the remaining snags.
Joost Vandevondele sent in a couple problem. The first was in the DO statement and was a regression caused by a recent fix there.
He and Clive Page also sent in problems with vector expressions within specification expressions. These seem to work now.
Harald Anlauf found another goof with the SHAPE() intrinsic.
Ulli Wölfel reported success with the fix for zero-length strings under OSX.
Douglas Cox sent in a problem with user-defined interfaces that originally appeared in comp.lang.fortran post by James van Buskirk.
Stuart Midgley sent in a problem with a small side-case of array simplication that has been fixed.
James Tappin reported success building on powerpc linux.
Harald Anlauf and Jeffrey Whitaker found the problems with the missing library symbols. Turned out to be a very small glitch that is now fixed.
Mart Rentmeester reported success building g95 on HP-UX and solaris. We are working on making these binaries a regular thing.
Joost pointed out that the .exe suffix wasn't being correctly added under cygwin. Got that fixed now. Joost also pointed out that the PROGRAM statement was not being correctly matched. Fixed as well.
Mart Rentmeester has been working hard to get g95 compiled on HP-UX 11, almost pulling an all-nighter. He is very close to success.
Jeffrey Whitaker and I have been mailing about symbols vanishing from the runtime library.
Harald Anlauf is tracking a similar problem under cygwin.
I am going to have to get a semiautomatic system going for producing binary builds. I've used Don Libes' expect program in the past, but have found tcl awkward for anything longer than a hundred lines. I ran across a python library called pexpect that looks like it will do what I need.
Python is an incredibly cool programming language which has one of the same underlying philosophies of fortran-- it lets you write code quickly.
Charles Rendleman reported a problem with the memory allocation checker not working. This turned out to be due to the recent change that made standard error a unit. The problem was that all units were being closed when the program shut down, and the memory allocation checks were printed to a closed unit.
Charles and Frank Muldoon also asked about the lack of --help information. "-v --help" was broken by the new build system but are back now. Frank also reported the success of his parallel CFD code.
Ulli Wölfel tracked down the bug. It had to do with zero length strings, and I've put a fix in place. Haven't had a chance for a new OSX build yet.
The fix to Richard's third problem yesterday introduced a bug that bit when concatenating three or more strings. Reported by Richard Maine, Michael Richmond, Roberto Herrero, Joost Vandevondele, Harald Anlauf Charles Rendleman and Luis Fernando de la Fuente López. You guys are great.
Harald Anlauf reported a successful build of g95 on cygwin. Some tweaking was required, but like other platforms, the gcc build fortuitously craps out after we have what we need.
Jeffrey Whitaker reported a successful build of g95 on OSX, again after some tweaking that needs to be resolved. He sent a patch for the configuration that I've incorporated.
Pieter Buning and I discussed the desirability of having a unformatted I/O operate in a particular endianness regardless of the endianness of the cpu. This allowed unformatted files to be read and written in a heterogeneous environement. I've set the library to read and write these quantites in big endian format.
Ulli Wölfel and I have been corresponding on a weird assembler bug on OSX. It works on the G4 that I have, but not Ulli's for some reason.
Joost Vandevondele pointed out that a program unit can't have a RETURN statement in it. I've added a warning to this effect in strict f95 mode, but otherwise allow it as an extension.
Jack Moffitt pointed out that the common FLUSH() extension wasn't implemented. Taken care of.
Tom Crane sent in a patch for an enhanced version of SYSTEM() that returns the process status as an optional second integer argument. I've made this and FLUSH() true intrinsics, which has changed the calling conventions slightly.
Jeffrey Whitaker reported success compiling fortran programs with the g95 binary under OSX. Hooray!
Joost Vandevondele noted that the results of one of his calculations changed slightly. I think the problem was in the calculation of powers. OSX does not have the pow() function available, so I replaced it with a naive a**b=exp(b*log(a)). On reflection I think it's a mistake not to use pow() if it is there, so we now check for the pow() function and use it if it is present.
Earl Duque reported some success with his 'overflow' program which I suspect is some sort of CFD. He also noted some weirdness in preprocessing which we are corresponding on. I've also added the '$' character in addition to '&' for starting a namelist name.
Charles Rendleman and I have been corresponding regarding some problems linking g95 programs with other programs. I've moved some things around in order to try and prevent the problem from occurring. I've also added some basic auto-initialization to the runtime library in case it is called outside of a main PROGRAM unit.
Richard Maine sent in a couple bugs. The first had to do with ACHAR() not accepting integers of non-default kinds, which has been fixed. The second was an off-by-one error in the VERIFY() intrinsic. His last issue was simply a failure to calculate the length of a concatenation operation.
Several people have reported failure of the fairly old version of gcc to build on non-linux operating systems. I forgot to mention something rather important. GCC does not have to be built all the way. If you get to the point where gcc/gcc/libbackend.a has been created, you're done. The OSX build crashes after this point when gcc is trying to compile itself, but the part needed by g95 is already there.
Jack Moffitt reported a successful build under powerpc-linux, but I suspect this is mostly because of linux. The configuration of the library failed due to the lack of handling powerpc-linux. I've updating the configuration and assumed it is much like powerpc under OSX. Hopefully it will get things working there.
I've also succeeded in getting a freebsd build with a little tweaking.
Earl Duque sent in a problem associated with one of the fixes to Richard's problem. Fixed the fix.
The OSX port is up, hopefully we'll have a few more in the very near future. Several people pointed out that the sources didn't contain the configure scripts. They do now, and you should be able to build them out of the box on any unix system.
I would be very interested in hearing from people who try the OSX port.
The build process is not great yet, the library and compiler have to be built separately at the moment. Integration of the two is planned.
I've succeeded in porting g95 to OSX. I'm not posting the binary just yet, because the OSX port revealed some bugs in the I/O library in some code that I've already decided to get rid of. So instead of debugging something I'm going to throw away anyhow, I'm going to concentrate on doing a minor rewrite that has been planned for some time.
OSX will hopefully be the most difficult unix port. It's a living example of Henry Spencer's famous quote "those who do not understand unix are condemned to reinvent it, poorly".
There were some problems printing negative zero correctly in list output, zero sized common blocks and compiling saved array descriptors in read-only memory. But the best one was a pair of references to library functions used by setjmp(). Instead of just putting these in libc with setjmp() they put them in a libgcc.a in /usr/lib. So as part of the installation processes, a .o is extracted from the "system" libgcc.a and placed in g95's libgcc.a.
Several folks have reported build failures. The current sources have been reorganized and need a little more work yet.
Frank Muldoon pointed out that the common %VAL() and %REF() extensions that allow fortran procedures to call C functions weren't implemented. I've added some basic support for them.
Michael Richmond had a derived type array initialization that looked much the same as the one Joost found yesterday, but it uncovered a new segfault which had to do with the fact that the structures were nested. Works now.
Roberto Herrero reported a segfault that mysteriously vanished as well as the derived type array initialization problem.
Martien Hulsen sent in a problem with -pedantic where g95 was complaing about a variable in a do-loop "not being set". DO-loop variables are now marked as being set.
I've reworked the compilation notes page to include current instructions on building g95.
Charles Rendleman sent in a problem with optional spaces and derived type definitions. G95 was requiring a space where it was optional.
Burkhard Bunk sent in a problem with the simplification of array references (of parameter arrays). His specific example has been fixed, but there is still a ways to go in this area.
Joost Vandevondele sent a problem with an array initialization of structure constructors. The error checking was too zealous and once removed things worked fine.
Martin Dix sent in a problem where a substring was copied back onto itself. The normal spaces weren't being appended.
Charlie Zender and I have been exchanging mails over the last couple days trying to get the netcdf library to pass all of its tests. The problem appears to be in the ABI for character function returns. We are investigating further.
Tom Crane sent a patch for the CPU_TIME intrinsic that includes system time as well as user time that I've applied. He sent another patch for ETIME() that will work only after I update some calling conventions in the back end.
I wanted to update the compile page to reflect the changes to the build system today, but have run into some snags. Look for changes tomorrow.
I also figured out where the 1.5 megs of fat came from-- a program called 'collect2'. My understanding of this program is that it is a special linker needed by C++ to handle constructors. Since fortran constructors must be constants to appear in initialization expressions, there is apparently no need for it and ld will work fine.
Finished tuning the build system so that the distribution is the same as before, plus leaving generality for ports. Something weird happened in the process and the whole package is now 3.5 megs where it was 5 megs before. I'm not sure where the fat went, but it seems to work the same as before.
Continued work on the build system. Almost done.
Vivek Rao and Leonard Bradfield both pointed out that the pupa metaphor was being a bit dated, so I've updated it with another one originally from Joost Vandevondele.
I am currently working on the build system in order to allow an easier build of g95 as well as ports to other platforms and more recent gcc backends. Almost there.
Eric Kostelich sent in a problem with array assignments created during the recent overhaul of these. The problem was dealing with actual arguments that were array pointers. Fixed.
Burkhard Bunk sent in a really tricky problem involving the EXTERNAL declaration. The EXTERNAL wasn't explicitly needed in his program, but leaving it out caused a subtle change of program flow during type resolution that ultimately led to an incorrect parameter list during code generation. Fixed.
Nick Gould sent in spurious error complaining about circular specification expressions. The code that did this wasn't properly recursive. Fixed now.
Joost Vandevondele, Douglas Cox and Charles Rendleman sent in problems related to functions with no arguments. I broke these in a fix last night. The main simplification function was failing without an error message. This caused a nasty cascade of problems leading to a crash. Fixed.
Claus Flensburg sent in a problem with TRANSFER that was actually fixed a couple days ago.
Nick Gould sent in a problem with nonconstant elements of array constructors that were within structure constructors. Fixed now.
Tom Crane reported a crash in DATA statements where a derived type constant was required but not supplied. Fixed.
Charlie Zender pointed out that the NETCDF library mostly works, even if it does have a problem in one of the self tests. Charlie tried to track down the problem and gave up. I don't blame him, I tried to track it a couple weeks ago myself. (Originally reported a while back by Jeff Whitaker.)
It's difficult and it isn't clear that the problem is with g95. Other people have vaguely mentioned success with netcdf in minor ways, but this is the first real success report in this area.
Sander Belien and Tim Giese both reported a problem with pointer assignments where the right side wasn't just a full array variable, but had components, scalar array references and section references. I think I have this working now.
James MacLaren reported that the VASP/VAMP Ab initio molecular dynamics package works with g95 now.
Jürgen Wieferink reported that his codes now work with g95.
Andrew Grief reported a pair of problems with MAXVAL in his CFD code. In one case, the array version was being incorrectly called instead of the scalar version. Fixed this and the analogous problem in MINVAL. The other problem had to do with a scratch array used to communicate things like array sections to and from the library. There was an ordering problem when setting this array where the array could be set twice when some sort of nested operation was going on. I've fixed the ordering so that the array isn't clobbered.
Joost Vandevondele and I have been exchanging some mails on how other compilers handle floating point reads of a string that looks like '.'. F77 seems to require reading this as zero, but the f95 standard requires at least one digit. Other vendors give mixed results of zero and errors, so we've decided to stick with the errors.
Incidentally, I finally figured out why so many DFT packages seem to have found g95. It turns out that the background for this page has the TFDW functional buried subliminally in the background. If you squint, you can make out the integral signs...
Michael Richmond and Wesley Ebisuzaki both sent in a scalarization problem that was uncovered by all the messing around with CHAR() of the passed few days. Scalarization is also a tad more efficient now.
Mike Kennel (aka Dr Chaos) sent in a problem with the standard error units and redirection. I've fixed some strangeness through causing the error stream to be opened on initialization instead of on demand. It wasn't quite clear why this wasn't working, but doing things in a more regular way seems to have cleared things up.
JaSeong Ju reported that g95 has compiled his code and it seems to work fine.
Kosma Endre reported that his parser program (from the net) was so full of legitimate bugs-- things allocated and not freed or freed and not allocated, that it was a wonder the author uploaded it.
Joost sent in another sign problem with ICHAR() that has been fixed.
Helge Avlesen reported a mysterious success with the TRANSFER() statement problem yesterday. Although the code ran, I got the wrong answer originally, but somehow we get the right answer now. I hate these ones...
Mart Rentmeester found a problem with parameter array assignments that has been fixed.
Skip Egdorf found a nasty problem with preprocessor directives that has been fixed. I've also modified g95 to warn of line truncation in free form mode by default (but only once), you can turn it off if you want.
Doug Cox reported a regression with twelve days of christmas code that has been fixed.
Joost Vandevondele sent in a problem with ICHAR() returning a flat wrong result. He also sent in a problem involing a segfault in CHAR()-- g95 was trying to assign four bytes to one. Joost also sent in a problem with character reads that has been fixed.
Helge Avlesen and Roberto Herrero both sent in a problem with the TRANSFER() intrinsic that turned out to be a bad interaction with the scalarization.
JaSeong Ju sent in a problem with scalarization of a vector expression within an array constructor. The expression was a mix of arithmetic operations and a vector function which confused things a bit. Fixed now.
There was also a nasty problem in his test code which was a result of paring it down. There was character variable in a module, the length of which depended on a non-PARAMETER integer within the module. An error wasn't being flagged, but the backend saw a length of 4G, which was a little too large. The problem had to do with a botched fix a couple weeks ago in this same area-- module symbols were being unconditionally accepted as OK for restricted expressions.
With this fixed, the original problem came back to life, which was restricted expresions in argument lists of contained program units. These have to be resolve with respect to the contained unit, not the containing unit. Fixed now.
Jürgen Wieferink sent in a problem reading a null string that has been fixed.
Gavin Salam sent in a problem where the formal argument list wasn't being resolved correctly for procedure arguments. Fixed.
Kozma Endre sent in a problem with the LEN_TRIM() intrinsic that has been fixed.
Anders Ålund found multiple problems with scalarization of vector subexpressions inside of an ALLOCATE statement that have been fixed.
Charles Rendleman reported that the new g95 compiles and runs his code again...
Harald Anlauf sent in a bit of code that caused a crash. I've taken the liberty of reproducing it here:
So just another boring bug in some very dry code. The problem turned out to be in the scalarization of the ACHAR() intrinsic, which wasn't being given a length. I fixed this and the analogous problem in CHAR(). It compiled, and I about fell on the floor when I ran it.
Kozma Endre sent in a problem with nonconstant character lengths in module procedures that appears to have been fixed a day or two ago with the character type node fixes.
Martin Dix found a problem with namelists where an integer array read with not enough values wasn't terminating early enough. This was broken by the analogous fix to character and logical variables. Should work for all other types now too.
Tim Geise also sent in an implementation of the Mersenne Twister in fortran that crashed g95. It turns out that ISHFT() wasn't working quite right for kind 8 integers. Fixed.
I think g95 is back up off the floor now.
The original problem was multiple bugs found by Tim Giese-- passing character array arguments also requires passing the length separately, functions returning character results have to have their lengths hidden from sibling procedures and the full character types in an actual argument list can't be fully built on the first pass through the list of internal procedures.
Several people sent in problems with fallout-- Doug Cox noted problems with adding complex numbers, and a failure in ENTRY also noted by Burkhard Bunk.
Matt Kennel noted an obsolete message when --version was given. It's been updated. He also found a problem that went away with the other breakage.
Anders Ålund sent in a problem with CONJG() that evaporated as well.
Charles Rendleman sent a problem with modules and pointers that did the same thing.
Joost Vandevondele found a separate problem with modules that turned out to be real-- the breakage was from the original fix.
Jürgen Wieferink found a problem where writing to an internal file went to standard error... It turned out that you had write something to stderr in the first place to make this happen. It's fixed now.
Charles Rendleman and I exchanged a bunch of emails trying to track a problem with namelists that ultimately vanished. In the process, I uploaded a very broken g95. I've been busy with other things and simultaneously took on a very nasty problem with the backend. The result is that many things are now broken. I don't recommend downloading g95 right now.
Anders Ålund sent in another pair of scalarization problems. In the first case, the size of a temporary array wasn't being calculated correctly when the expression providing the size involved a vector subscript not in the first dimension. The second problem dealt with properly transforming an array constructor range into loops when the range wasn't in the first dimension either. Both fixed.
Dominique Orban reported the successful compile and execution of his CUTEr package, which is an environment for mathematical programming.
Ingo Thomas found a crash in the case where a PARAMETER variable didn't have an initialization. The problem was a recent rewrite of the code that ended up messing up the error message.
Doug Cox sent in a problem with IOLENGTH where g95 differed with ifort. On closer inspection, the IOLENGTH result is processor dependent result that has to be consistent with the RECL parameter of the OPEN statement.
Vivek Rao pointed out that g95 didn't support allocatable array arguments. This is part of TR 15581, which is an optional extension to f95 that I intend to support. I've added some initial support for allocatable array arguments and allocatable array returns. If the -Wstd=f95 option is given (strict f95), this won't work. The actual TR is much more elaborate than what I've done today.
Jorge D'elia sent in a problem with a WHERE assignment that contained a vector function. The temporary wasn't being correctly created, but it is fixed now.
Anders Ålund and Bálint Aradi sent in similar problems with elemental and array functions within array constructors. Both fixed now. He also sent in some subtle problems with RESHAPE() that are now fixed as well.
Bernt-Ola Sandstr&oumal;m sent in a similar problem with array constructors containing sub-constructors. Also fixed.
Doug Cox sent in a problem with BACKSPACE that looks like it was fixed in the 24th.
Eildert Groeneveld and Michael Richmond sent in a problem with assumed length character arguments in an ENTRY that was also a module procedure. Fixed.
Eildert's code uncovered a problem with ENTRY that is pretty severe and is going to require a bit of thought before deciding on how to fix things. The problem has to do with entries that are also module procedures. The upshot is that ENTRY is now more broken than it was, and I'm taking a little time off of that problem to look at other things.
Yukihiro Harada sent in a scalarization problem where a section reference had multiple vector subscripts. Fixed.
Jim McDonald reported the successful compilation and execution of the GATOR closed-cavity travelling wave tube-- an E&M code.
Jim, Wolfgang Dobler and others have pointed out that the E format and its relatives print zero as "0.00E-01" when a scale factor of one is in force. People expect "0.00E+00", and the standard can be interpreted in a way that gives this result, so I've changed it.
Dominique Orban reported the successful compilation of the BLAS library, which required a small patch to get rid of the ASSIGN-ed GOTO. A lot of software uses BLAS...
Francois Jacq reported the successful compilation and execution of the ASTEC (Accident Source Term Evaluation Code). This is a code that simulates severe accidents in light-water nuclear reactors. The computational runs take a day or so and the results square with the results of other compilers.
Doug Cox sent in a problem from a code that involved overloading an intrinsic in a specification function. This triggered a cascade of many small changes and reorganizations. Things appear to work now.
Francois Jacq sent in a problem with ambiguous interfaces. I went slightly too far in a corner case of my fix last sunday. Fixed.
Wolfgang Dobler sent in a glitch with namelists. When the end of a namelist was detected in the middle of an array, part of the next namelist was being improperly eaten.
Charles Rendleman sent in a problem with the scalarization of print statements when dealing with functions returning pointer arrays. Fixed now.
Michael Richmond sent in a glitch with ENTRY. If ENTRY was the first statement of a program, the current state wasn't "program" and the error message crashed. Fixed.
John Amor sent in a problem with BACKSPACE that has been fixed.
Roberto Herrero sent in a problem with the WHERE statement that has been fixed.
Doug Cox sent in a post to comp.lang.fortran by Christopher Arns. The post had a small program that g95 choked on, complaining about ambiguous interfaces. After some tracking, the problem turned out to be in the standard itself. One of the rules for determining the ambiguity of interfaces was just slightly wrong. I've fixed g95, and am looking into fixing the standard as well-- the problem still exists in f2003.
Joost and Martin Dix sent in problems with WHERE, some of which have been fixed. I forgot to mention that I managed to sneak in a rewrite of WHERE over my recent vacation. There are still some known glitches.
Michael Richmond sent in a problem with trying to read a record from a sequential file following a write. The write leaves you at end of file, and the subsequent read was crashing. Fixed this problem as well as another crash when using list reads.
Michael also sent in a problem where an error was not being raised for dummy parameters that appears in DATA statements. It turned out that there were a lot of unchecked conflicts with DATA statements-- function results, allocatable variables, blank common variables and common variables not in BLOCK DATA subprograms were also unchecked.
Then I checked for the new style initializations and found these were similarly unchecked. And these are named constraints in the standard that a compiler must implement! Initializing common variables is something that people seem to expect, so it only warns in strict mode.
Jeff Candy-- the mail I sent you bounced...
Karl Bandilla sent in a problem with reading complex numbers. This worked fine until the fix the other day to namelist reads of logical arrays. The fix there exposed this problem. I've fixed the analogous problem in character reads
Wesley Metzger sent in a problem with the PRINT statement not being correctly recognized. This was due to going a little too far when tightening things up with respect to spaces between keywords. Fixed now.
Stuart Norris reported that his CFD code now compiles and executes within the normal variability of fortran compilers.
Doug Cox sent in a bug where the function call from an overloaded intrinsic operator wasn't being set to the correct type or rank. Fixed now.
Paolo Giannozzi and Xavier Leoncini reported a problem with FORALL body statements that contained array assignments that has been fixed.
Wolfgang Dobler and Martin Dix both sent in another glitch with namelist reads of character arrays-- a trailing apostrophe was ending up as part of the string.
Joost Vandevondele sent in a problem with parameter definitions involving subobjects of other parameters. These now work for the case of scalar subobjects. Vector objects still remain to be implemented.
Joost also pointed out a problem with SPACING(X) for numbers near TINY(X) which has been fixed.
Charles Rendleman sent in a problem with a function returning a pointer array that was being incorrectly freed.
Stuart Norris sent in a problem with scalarization. When an array is part of a compound reference, a pointer is allocated to the array so that the compound reference isn't recomputed for every element of the array. The problem was bound on the pointer being taken before it was assigned. Fixed.
I am leaving for a vacation tommorrow morning and will be gone until late next week. Access to the net will be sporadic at best.
We got a nice letter from Jeff Candy:
GYRO, the flagship tokamak turbulence code for the US
Wolfgang Dobler sent in another problem with namelists. It seems while reading an array of logical values, you have to peek ahead a bit to see if you have a variable named 'T' or 'F' followed by an equals sign. If you've got this, you can't read the 'T' or 'F' as if it is an array value. Fixed.
Michael Richmond sent in some problems with repeat counts in namelist reads. Separators kept being read even though we were in the repeated values. Fixed. He also sent in a problem with unformatted backspacing that has been fixed. There was also a common extension on the OPEN intrinics that he pointed out.
Michael also sent in a really nasty problem with ENTRY statements inside of module procedures. These work correctly now.
Roberto Herrero sent in a problem with floating point reads. The read was of a string that looks like "10e". The standard says that a digit string has to follow the 'e', but other compilers seem not to require it. I've loosened g95 as well.
Doug Cox sent in a problem with the B edit descriptor and kind one and two integers. The integers were being sign-extended when they should not have been. This fixes analogous problems in the O and Z descriptors as well.
I'm still falling behind on bugs. People are sending in a lots, and I'm working hard to squish them. Be patient, I'll get to them all.
Wesley Ebisuzaki sent in a crash for specification functions that were intrinsics. Fixed now.
Joost Vandevondele and Sander Belian sent in similar problems about parameters being used as part of their definition. You can do this in a limited way under fortran 95. Joost had an easy one and Sander had a nasty example that required a lengthy and subtle rework of how the front end works. Things seems to be back together again.
Charles Rendleman pointed out that the underscoring of global names didn't have the controls that g77 has. I've added -fno-underscoring and -fno-second-underscore options that inhibit adding an underscore altogether and suppressing the double underscore when a name already contains an underscore.
Francois Jacq wrote in with a similar issue.
Wolfgang Dobler sent in a problem with the wrong subroutine from an interface list being chosen. The problem has to do with a subtle point in modern fortran-- formal and actual ranks have to agree exactly when choosing an interface, but can be fudged when the actual argument isn't an assumed shape array. Fixed.
Wolfgang also sent in a pair of problems with namelists. Namelist writes of character values weren't being enclosing with quotes, and weren't being read properly either. Both problems are fixed.
Michael Richmond sent in a hang on some code that had an ENTRY. The problem was a two dimensional array where one of the dummy specification variables appeared twice. In a case like this, a list of dependent variables is created so that a dependent variable is only initialized if its specification variables are present. If the variable appeared twice, a circular link resulted. Fixed now.
Joost Vandevondele reported the first successful run of his CP2K code. The results mirror the NAG compiler, and Joost says that some compilers won't compile cp2k at all. Woo Hoo!
Only small hiccups remain. He found a bug where large numbers that overran an F format also overran the buffer meant to hold the intermediate digits. This is fixed now.
Martien Hulsen sent in a problem with the IBSET() intrinsic for kind 8 integers and constant POS argument. The problem and the analogous problems in IBCLR() and BTEST() are all fixed.
Thierry Deutsch reported that the DFT code ABINIT compiles and runs with the exception of the bug I fixed yesterday (he has an old copy of g95).
Joost sent in a problem with code generation failing when a warning message has been issued. The problem was introduced yesterday in the fix for errors in DATA statements-- code generation was supposed to be suppressed when an error is generated. Fixed.
Joost also pointed out a really nasty problem where array temporaries were not being freed. The problem was that there are certain nodes like IF, SELECT, DO and the like which transfer control. The code to free the temporaries was being allocated in a place that was not necessarily being executed. This is fixed for a wide range of statements now.
Charles Rendleman sent in another problem with nonadvancing reads. After getting an end-of-record, we weren't advancing to the next record. Fixed now. This may be the last straw for Charles' code. There was also a fix to a section of scalarization code that has hopefully gone through its last oscillation.
Michael Richmond sent in a problem with the EXIT() extension-- it wasn't exiting library cleanly, and leaving files open in the wrong state.
Vivek Rao, among others, pointed out that the blank STOP statement was printing line numbers and filename when it didn't really need to. I've removed this for that case.
Claus Flensburg reported a crash in a DATA statement where character strings were initializing an integer array. This is an extension that most compilers allow that will be difficult to implement in g95 (it will be eventually). The crash has been fixed.
Panayotis Papasotiriou reported a crash when transferring the result of an elemental function call that has been fixed.
Kevin Thomas reported the successful compile and execution of a program called ADAS, which does weather predictions. His organization has a larger code named ARPS which I am hopeful will work as well.
Claus Flensburg, Kevin Thomas and Michael Richmond reported multiple problems with the ENTRY statement. The problems were passing arrays through entries, and dealing with arrays with dummy specifications that sometimes weren't present. In regular f95, optional parameters can't be part of specification expressions, but in an ENTRY, parameters that are nonoptional end up changing into parameters that are optional. Fixed now.
Also fixed some problems associated with alternate returns in ENTRY statements and ENTRY statements within functions.
Wolfgang Dobler sent in a problem with an array rank mismatch the fix of which reached back into some of the earliest code in g95, squashing a bug that has lived unnoticed for years.
I've sent Doug some items for a new section in the status page-- "coming soon" items, a fairly broad overview of where I intend to take g95 in the near and long term. The items are listed in no particular order.
Arho Virkki sent in a problem with formatted output for an F descriptor that was insanely wide. Fixed F and the analogous problems for D, E, ES and EN descriptors. He also pointed out that the SLEEP extension was missing, I've added it.
Stuart Norris has donated a bunch of unix subroutines meant to be called from fortran, and I am waiting for his paperwork to arrive. Putting them in will mean some rearrangement as the list of unix subroutines is getting a little long for a single file.
Charles Rendleman sent in a problem with namelists-- the end of the namelist wasn't being correctly signalled. Works now.
Several people have sent in comments over the last couple of days about the size of executables produced by g95. Most of the bloat is due to debugging symbols, both from the programs themselves and from the library. I'm going to start start stripping the debug symbols from the library in the nightly builds. This shaves about 100k off of the "Hello world" program. About another 100k of debug symbols can be stripped from "Hello world" leaving a file that is about 100k. The size of a comparable dynamically linked executable is about 25k. With the wide availability of broadband and the smallest disk drives available being 40G, the simplicity of the mostly static executable seems like the best way to go.
I've also been fiddling around with some code written by Bob Burger for printing real numbers quickly, accurately and with as few digits as possible. This isn't the same as simply deleting trailing zeroes. G95 currently uses glibc's sprintf() to do the dirty work, but this solution is unsatisfactory for a couple of reasons-- First, glibc is not available on all platforms, and some implementations have buggy versions of sprintf() that do not round correctly. My wishlist also has a REAL*10 type for x86 machines, which sprintf() may or may not handle depending on the version installed. I also want an increasing independence from glibc, to avoid these sorts of incompatibilities altogether.
Gerardo Ballabio sent in a nice note reporting the successful compile and execution of his ab initio plane wave electronic structure code PWscf. He reported having to make small changes to his code due to subtle deviations from f95.
There seem to be a lot of density functional theory (DFT) people testing g95 for some reason, and I can't quite figure out what this means... My thesis topic was DFT...
Clive Page pointed out that the dollar format wasn't working correctly. This is a common f77 extension for doing nonadvancing writes. This has been fixed now.
Joost sent in a problem dealing with alternate returns. The default return wasn't being set, so things could go the wrong way if a regular return was used. It also turns out that his cp2k code isn't really a Car-Parrinello code, though it is a DFT code. There was also a potential problem in the two-line download-and-install-g95 script above. The symbolic link needs to encode the full path. Fixed.
Martien pointed out that namelist reads with derived types didn't work. I've gone in and completed the implementation of namelist reads. Derived types should be fully supported now-- you can read components of derived types, full derived types, derived types with arrays, arrays of derived types, arrays of components of derived types... it should all work.
He also sent in a problem with default components. Implicit type conversion between numeric types wasn't happening, and there were no checks against assignment of wrong types over even wrong ranks. These are all in place now.
Joost sent in a subtle problem involving passing derived types. Under some special circumstances, the type was being incorrectly passed as pointer. He says this his Car-Parinello code is extremely close to running. Joost also sent in a problem with INQUIRE where a unit was not being found. This is related to the recent fix of standard error output. All fixed now.
Alex Galakhov sent in a problem with the $ descriptor in formats. There is a check to make sure it is the last item, and the check wasn't quite right. Fixed now.
Stefan Hildenbrand sent in a problem with list reads-- not enough items present wasn't returning an error. Fixed.
Doug Cox sent in a problem with PURE subroutines. It was possible for garbled code to be generated for these. Fixed.
Tobi Schlüter pointed out some dead code that is gone for real now.
Joost pointed out that RRSPACING() was still messed up. I got confused by the formula in the standard. All that RRSPACING() really does is replace the exponent of a real number by a constant that is equal to the largest fractional part of the number. Fixed now.
Not content with success, Joost took our RRSPACING() test program, deleted the 'RR' and discovered a discrepancy with the SPACING() intrinsic. The problem was that the result was not an even power of two. Easy to fix and SPACING() agrees with other implementations now. I have little doubt that he tried a couple of the other inquiry functions as well.
Charles sent another, analogous problem with derived types containing default components-- Assumed shape array arguments of the type that are also INTENT(OUT). Roberto Herrero sent in a crash that I suspect is the same thing.
Tobi Schlüter sent in another cases where required spaces were being ignored in variable declarations. Spaces are now required in free form mode, 'REALLY' is not longer a legal declaration.
Charles sent in a problem with a procedure with an INTENT(OUT) argument of derived type with a default component. The default is now set.
Clive Page pointed out that the -fno-backslash option, which exists in g77 was not in g95. This option prevents backslash escape codes from being interpreted as such. I've added it to g95.
Alex Galakhov sent in mail with a mail with the subject "G95 feedback - it works for me!". Gotta love that. He reported the successful compile and execution of the SIESTA quantum chemistry package. Another package! Martien Hulsen sent in a segfault during bounds checking that has been fixed.
Roberto Herrero reported an infinite loop during namelist reads that has been fixed.
Steve Kargl found a problem with the RRSPACING() intrinsic when the argument is zero. This is completely analogous to the SCALE() problem that Joost found last week. I looked for further analogous bugs, but the zero-case looks like it is all taken care of now.
Michael Richmond sent in a problem with the EXIT subroutine, which is an extension. Without an argument, it crashed. I've fixed it so that leaving out the argument causes the program to return a status code of zero.
Tobi Schlüter pointed out that statement matching was too generous in cases involving spaces between statements. There are places where spaces are required in free form mode. Fixed problems with these in the BLOCK DATA, ENTRY, MODULE PROCEDURE, PRINT, STOP and TYPE statements.
Doug Cox sent in a problem found by John Wright where a nasty declaration led to infinite recursion, which was bad enough, but the loop was during writing of a module.
Joost Vandevondele sent in a problem with a pointer array assignment from an array section that wasn't working. The problem turned out to be creating a temporary array descriptor of the wrong size which caused part of the stack to be trashed. We also exchanged some mails about association of array sections, which looks like it depends on the whole section being associated, and not just this base. Both problems are now fixed. I also found that ranks in pointer assignments were not being checked, and a problem with negative strides in array sections. This is now fixed as well.
Charles Rendleman wrote in looking for an option to place module files in a particular directory. G95 uses the -M option for this, but the C preprocessor uses -M for something else, so I've changed this to -fmod=.
Robert Herrero, Pasquale Panuzzo and Michael Richmond all reported a segfault in the scalarization. This was introduced during the pointer fix this weekend.
Michael also sent in a program that caused a crash on long variable names.
Joost reported a problem with integer powers that slipped in the other day. It had to do with properly computing the result of an exponentiation that had to go on to another calculation.
Charles Rendleman found a corner case where the IBITS() intrinsic failed. Fixed now.
Helge Avlesen sent in a problem with TRANSFER(). I was assuming that mold parameter was an array if an array was being returned, and this isn't necessarily the case.
Clive Page and I have exchanged a few emails trying to figure out why "g95 -v --help" wasn't printing out g95-specific options. The problem was that I strip out the C compiler when doing a nightly build, which was really printing the fortran options. I've tricked the driver into using g95 for this task, you can see the real options now.
Stuart Norris and Joost Vandevondele both reported problems with the SPREAD() intrinsic that have been fixed.
Bill Heagy tested the modifications to RANDOM_SEED() and found that the results from separate random sequences remained correlated for a short time. There is actually a second random generator with RANDOM_SEED() that is used to provide seeds. This is a simple multiply with carry algorithm also invented by Marsaglia.
My initial attempt was to use the current time of day to mangle the output of this generator. It turns out to be much better to use the current time to mangle the seed of the seed generator.
Joost sent in a problem with an array of structures. If the array had a default component, it wasn't being initialized for automatic objects. Fixed. Joost also sent in a problem where a structure constructor had a scalar element and the corresponding structure element was actually an array. The scalar essentially gets copied to all elements of the array. Also fixed.
Michael Richmond sent in a problem with assumed length character parameters, more fallout from a recent shift in how character lengths are stored. Fixed now.
Charles Rendleman sent in a problem with a function that returned a structure pointer. The structure had default components and these were being initialized in the undefined pointer. Fixed now.
Matt Kennel sent in a problem with scalarization. Scalar pointer functions being removed from scalar loops weren't having their pointer attribute copied correctly.
Joost Vandevondele sent in a problem with arrays that are members of structures. A previous test on this had a square array, which worked fine by accident. Nonsquare arrays work now too.
Charles Rendleman sent in a problem with namelists where a namelist comment was confusing the parser. Fixed. He also sent in a problem in the runtime library where the a nonadvancing read was combined with the EOR tag. Also fixed. He sent in another bug in ASSOCIATED() that is fixed.
Martien Hulsen sent in another problem with namelists involving a list of array values that was shorter than the array specifiation. The library now stops reading when it sees the next item or the end of the namelist.
Toby White pointed out that g95's underscore convention was not quite like g77's. After some research, it seems that the convention originated from f2c, which has now propagated into g95. The idea is that a global variable has a trailing underscore. If it contains an underscore, then two underscores are appended. I've also removed the trailing underscores from non-global variables to make debuggers more user-friendly.
Gavin Salam and Stuart Norris both reported problems with writing to standard error, which is traditionally unit zero. Unit zero isn't allowed by the standard but is a common extension. I've also changed the name of the environment variable that allow the overriding of the default unit names to G95_UNIT_x where x is the unit number. Without a variable, the default unit is fort.x except for unit zero which is /dev/stderr. So writing to unit zero now goes to standard error by default.
Lothar Birk reported that his mysterious problem with the imaginary part of a complex calculation has mysteriously vanished. Output is now consistent with ifc. Looking back throught the blog, I think this may have been the problem with complex cosine reported by Bill McLean a couple weeks ago.
Jos Bergervoet had a post on comp.lang.fortran saying that his code works as well. He didn't saw that the output was right, just that it was consistent with ifc.
Clive Page sent in a bug with array array expressions that he later admitted won an 'Obfuscated f90' contest...
Bill Heagy sent in a problem with RANDOM_SEED(). It was setting the seed to a constant value, which was strictly legal, but I agreed that it ought to make the sequence different from run to run.
Øystein Lie-Svendsen sent in a problem with the length of character arrays getting mixed up with length of function returns.
Joost Vandevondele is a daddy... Congradulations Joost!
Jeffrey Whitaker reported the successful compilation of netcdf. The tests fail, but he's going to start narrowing down some test cases.
Michael Richmond found a problem where the source file and line number of a code that failed an array bounds check wasn't always being printed. Fixed that.
Anders Ålund reported a problem with integer exponeniation of kind=8 integers. The partial problem was a lack of a library routine to do this, but the main problem was that the exponentiation code was so convoluted that it was difficult to add. Fixed this with new code that is about 50 lines smaller.
Charles Rendleman, Pasquale Panuzzo, Roberto Herrero, Michael Richmond, Joost Vandevondele and Doug Cox all reported a problem introduced the other day in an attempt to fix a problem with RESHAPE. The new problem messed up initialization expressions involving RESHAPE. I've rewritten how array constructors are implemented, and although it is not optimial, it is much more general. The new rewrite fixes a longstanding problem reported long ago by Martien Hulsen.
Joost Vandevondele found a problem with SCALE(). The implementation I had was just modifying the exponent by adding the scale factor to it. This works for all number except zero. Fixed now.
Toby White found a problem where g95 was complaining about empty interface blocks, which are allowed. Fixed.
Jeffrey Whitaker sent in a problem with an array function inside of an array constructor. He's compiling netcdf, and I'm hoping this is one of the last issues.
Doug reported that the polyhedron codes now compile correctly. He's also taken over maintainance of the status page... He's really the one who has been doing it for a while now.
Bill Heagy sent in a problem with vector subscripts. These worked fine if the vector subscript was in the first dimension, but not anywhere else. Now it works everywhere else.
Matt Kennel sent in a problem with simplification of the INT() intrinsic where the kind parameters was being validated against the real kinds instead of the integer kinds. Fixed now.
Doug sent in a problem with the front-end calculation of ATAN2() that has been fixed. He also sent in a small program involving simplification of an elemental subroutine with a missing optional argument that has been fixed.
Reinhold Bader reported that an earlier problem with memory allocation has disappeared. This discouragingly normal for these sort of problems.
Joachim Geiger sent in a problem with the -r8 option. Although present, there was another problem that prevented it from being recognized. This option is a fairly standard one that forces all reals to double precision.
Charles Rendleman sent in another problem where function resolution was failing on an internal procedure when a generic of the same name was available.
Joost sent in a problem where that MODULO intrinsic was behaving incorrectly. He also sent in a problem involving deallocating an integer pointer variable inside of a loop where it was the iterator. An error is correctly generated now. Also took care of similar cases involving ALLOCATE and NULLIFY.
Vivek Rao pointed out that g95 does not abort the compilation after a fixed number of errors. G95 has some very simple error recovery which involves flushing the current statement and going onto the next. If the statement with a problem was a block opening or closure more errors are inevitable. I've avoided putting a fixed number to abort on mainly because it could hide things like core dumps. These don't happen in the parse phase much more, so I've placed a limit of ten errors before the compile aborts.
Volker Eyert reported a serious speedup on some of his code, from 2240 seconds to 1988 seconds. I'm pretty sure I know what this is due to. The good news is that more of the same is on the way.
A lot of people have been asking about the ETIME() intrinsic which is one of those standard non-standard functions. It has the same characteristics as the standard CPU_TIME() intrinsic, but it's clear that things will be much easier on me if I just put in there.
Joost sent in a problem with RESHAPE and array constructors that has been fixed. He also sent in a problem with the DATA statement and derived types that has also been fixed. He also sent in a code that incorrectly generated an error on a WRITE statement in a PURE procedure. These are allowed as long as the write is to an internal file.
Martien Hulsen sent in a problem with a nonadvancing write that wasn't flushing to the terminal correctly. This has been fixed.
Charles Rendleman sent in another bug very similar to yesterday's. This one had to do with a procedure argument to a PURE function. G95 was incorrectly complaining that it had to be INTENT(IN).
Joost sent in a problem involving scalarization of a one dimensional section of a two dimensional array. The bounds of the array were not being calculated correctly, resulting in valgrind reporting some strangeness to outright segfaults. Fixed now. As part of this, I've added some overlooked front end simplification of the LBOUND() and UBOUND() intrinsics. This causes memory loads to be replaced with constants where possible, meaning a speed increase.
Charles Rendleman sent in a problem with namelists, the underscore character wasn't being recognized as a variable name. I've added the dollar sign as well for when -fdollar-ok is specified. He also sent in a spurious error on a pure function with a procedure argument.
Joost Vandevondele sent in a problem with a variable reference containing more than one array part. There was code to detect this already, but it was missing the corner case that Joost found.
Charles Rendleman sent in a problem with scalarization. For a scalar function call that is itself an argument to an array elemental function, the scalar function needs to be removed from the expression and replaced with a temporary. That wasn't happening but it is now.
Charles also sent in a note about an f2003 extension that most people seem to expect in f95 (maybe it *is* in f95). The expectation is that the 'y' in SUM(array, y) is interpreted as the MASK parameter if it is of type logical. This is now implemented. This also affects the PRODUCT, MINVAL and MAXVAL intrinsics.
Martien Hulsen sent in a pair of namelist problems. The first involved a problem finding the namelist name, when followed by a newline instead of a space. This was really dumb-- I had a macro expanding a function call, which ended up calling the function multiple times instead of comparing the result to the whitespace characters.
Martien also sent in another issue about the namelists in modules. It turns out that namelist information wasn't being saved and restored in modules. This is fixed as well.
Pasquale Panuzzo reported the successful compilation and execution of his code.
Joachim Geiger reported the successful compilation and execution of a code called DIAGNO, which is an MHD/fusion simulation.
Roberto Herrero found a problem with negative real module parameters. These were getting messed up during the write, and when being re-read ended up as zero. Fixed. He also reported the successful compilation and execution of his nuclear reactor code.
Joachim Geiger sent in pair of problems. The first was that -1 was being incorrecly raised to integer powers. The second involved allocating an array inside of a contained procedure. The memory was incorrectly being freed in the contained procedure instead of when the variable went out of scope in the containing procedure. Fixed now.
Charles Rendleman sent in a problem involving a function returning an array of derived types that had a default component. The default components need to be initialized in the result. Now it is. I had considered this possibility a couple weeks ago when I was working on default components, but I never figured anyone would really use this, so I just put in an internal error. Boy was I wrong!
So far I've been using gdb 5.0 to debug the programs produced by g95. This hasn't been entirely satisfactory as g95 seems to produce some dwarf symbols that gdb can't handle. I have a hack which strips out these symbols, but it was a pain to run all the time. The test cases people have been sending in are growing steadily larger, and I couldn't find segfaults within the fortran program. I tried upgrading to gdb 6.1, and am happy to report that it has no problem with the dwarf symbols and also correctly prints file and position information from programs compiled with g95 -g.
B. Thomas sent in a case where a format list had an empty element. The standard isn't clear about this, but I've decided to interpret it as nothing instead of an error. He also had a really bizzare segfault-- it seems that the stock memcpy() (and now memmove()) can't handle situations where the source and destination blocks are the same. I actually check for this now. Never thought I'd have to do that!
Doug Cox sent in a problem with the P edit descriptor where there was no comma between the P and the next format item. This no longer generates an error.
Joost sent in a problem with the STAT variable of an ALLOCATE statement. G95 did not complain if the stat variable was a parameter. Fixed. An analogous problem existed with the DEALLOCATE statement that has been fixed as well.
I've added some initial support for namelist reads of arrays. The whole array can be specified as well as sections. Derived types aren't supported just yet, coming soon.
Michael Richmond sent in a problem with some code involving an illegal character length specification that wasn't being caught. This is fixed now. Michael also sent in a segfault on illegal symbols within DATA statements.
Doug Cox has started testing some of the Polyhedron codes. One of these codes defined an ABORT() subprogram which conflicted with the intrinsic extension defined by g95. I've changed these symbols so that they are now weak, letting user-defined subroutines of the same name take precedence. Doug also sent in a problem with intrinsic subroutine with missing optional character arguments (DATE_AND_TIME()) that has been fixed.
Martien Hulsen has been testing some of the examples in Stephen Chapman's book. He pointed out that list writes were not correctly using the delimiter specified in the OPEN statement, both for list writes and namelist writes. Fixed as well.
Helge Avlesen sent in a problem way back that I spent half the afternoon on. I fixed one crash, two problems with FORALL, and one problem with WHERE statements inside of FORALLs. This brain teaser messes up several commerical compilers. G95 now agrees with the majority.
Joost sent in a couple of problems uncovered by valgrind. The first problem was using memcpy() to copy strings, when memmove() should be used in the case of overlapping memory blocks.
Joost sent in a problem with the scalarization of an expression involving an elemental function with an argument involving more than one dimension. Fixed now.
Pasquale Panuzzo sent in a problem with passing a noncontiguous array section to a procedure with an implicit interface. A flag was being set too early and getting trashed. Fixed now.
Joost sent in a problem with nullifying an array pointer component of a derived type. Fixed now. He also sent in a problem where the check for do loop iterators being modified was failing. Also fixed.
Joost sent in a problem with the TRANSFER() intrinsic that caused yet another chunk of it to be rewritten. The way I had it was pretty silly, but it works now. Helge Avlesen and Édouard Canot have both noted problems with using TRANSFER() in initialization expressions, which is going to cause a major rewrite in expression handling down the road.
Michael Richmond sent in a problem with ENTRY statements in module subprograms that has been fixed.
Bill McLean sent in a problem with namelists-- Regular formatted transfers require a sort of jump-start that was accidentally happening for namelists as well. Fixed now.
Bill McLean sent in a sign problem with the imaginary part of the double precision complex cosine intrinsic that has been fixed. He also sent in a program in which nonadvancing writes were failing-- this was more a consequence of writing records at the wrong time. Doug Cox sent in a similar problem with nonadvancing writes that was fixed by this change.
Volker Eyert reported the successful compile and execution of his spherical wave DFT code. The executable is slower than other compilers, but speed is not a priority yet.
Doug sent in a several problems that have been fixed-- complex input, correct handling of direct access record numbers and multiple fixes to the INQUIRE statement.
Doug sent in a problem with entering a null string during list input that has been fixed. There was also a problem with record numbers not being correctly calculated that has been fixed as well. Another problem was a Meissner example where a derived type contained an array of another derived type-- the size of the inner type wasn't being passed correcctly. There was also a fix involving reading namelists.
Joost sent in a problem with the TRIM intrinsic, which was incorrectly accepting array arguments. Fixed too.
Martien Hulsen sent in a problem with sequential unformatted I/O where there were a number of write/rewind/read/rewind/writes.
Édouard Canot sent in a problem with the logical NOT intrinsic that has been fixed.
Teruo Yamawaki sent in a problem reading hexadecimal integers that has been fixed.
Fixed another subtle problem with module arrays appearing in EQUIVALENCE statements. The difficulty was creating a public instead of external symbol in modules that use-associated the variable in question.
Kevin Thomas sent in an equally subtle problem with COMMON arrays. When the initialization was being created and did not include the end of the array, the initialization did not include the end of the array, resulting in link error because of different sizes. Fixed.
Jim McDonald sent in a very good summary of how namelists behave on various platforms. I've only used them under g77, so this will be very helpful.
Roberto Herrero sent in a problem with EQUIVALENCE-- module arrays weren't being declared correctly and ended up as local symbols.
Joachim Geiger sent in another problem with a derived type with an array pointer and a default NULL() initialization. There was a code path that prevented the NULL() from coming through correctly. Fixed now.
Adrian from Brazil and Édouard Canot sent in a report on the progress of the Numerical Recipes library. It all compiles except for two codes. I've fixed one of the problems, it had to do with the LOGICAL intrinsic not being marked as an elemental function. The remaining issue is an array constructor assignment problem that has been known for some time.
Added some rudimentary support for namelist reads. Derived types and arrays aren't supported yet.
Doug sent in a quick problem with the S, SP and SN format descriptors, which were being ignored. Fixed the analogous problem with BN and BZ as well.
Michael Richmond sent in a problem with ENTRY, where equivalence information wasn't being completely copied to the new program units. Fixed this and some analogous problems with common blocks.
Roberto Herrero sent in a problem that was ultimately the TRANSFER() intrinsic with a character mold. Fixed now.
Scott Palmtag and Doug Cox sent in an error with list reads-- the forward slash wasn't correctly terminating a read. The code was there to do this, but the right flag wasn't being looked at. Doug's example, which was one of the NIST suites also pointed out a further problem-- the rest of the record was being incorrectly ignored. All fixed now.
Joost tried running the paranoia program and found that 0.0**0 wasn't calculated according to the usual conventions of returning one in this case. Easily fixed. Another problem caused by yesterday's fix of array arguments was also fixed.
Joachim Geiger sent in a problem with a function that returned a derived type. The derived type had some component initialization that wasn't happening. This is fixed now.
Michael Richmond sent in a problem with equivalenced variables. The internal name of the memory for the variables was a public symbol, which caused a conflict if equivalences were present in different files being linked together. Fixed now.
Joachim Geiger, Roberto Herrero and Doug Cox reported a fix from yesterday going awry. The problem with NULL() on the right side was also being diagnosed for pointer initialization. This is fixed now.
Joost reports the successful compilation and full testsuite pass of the FMLIB multiple precision package. Roberto Herrero reported a crash during the compile of the main test routines, which has clearly been fixed in the meantime.
Joost also sent in a problem regarding passing a not-present assumed shape array to another procedure. Because the shapes change, a local descriptor has to be created. The local not-present descriptor was getting passed to the second procedure, which saw the array as present. This is fixed now.
Namelist reads are not complete yet, but the bug situation is getting out of hand, so back to bugs for a while. Namelist writes do work, as does derived type I/O for reads and writes.
Helge Avlesen sent in a problem regarding units 5 and 6. Other compilers allow 5 to be written and 6 to be read. The fix was not hard.
Joachim Geiger sent in a problem regarding structure constructors containing pointer arrays. Fixed this case as well as the case of referring to NULL() in this context. He also sent in a problem where NULL() was appearing on the right side of an assignment statement. This illegal and the front end wasn't catching it, and the back end didn't quite know what to do, and gracefully segfaulted.
Joost Vandevondele sent in a problem with allocation of derived types. These weren't getting assigned any default initialization. They are now. Joost also sent in a problem with the BTEST intrinsic that has been fixed-- the least significant bit is zero, not one.
Joost also sent in a bug gleaned from comp.lang.fortran as well. A long time ago, I removed the array version of the RANDOM_NUMBER() intrinsic subroutine, allowing the scalarizer to expand it like any other elemental subroutine. The only problem was that RANDOM_NUMBER() isn't elemental. I figured no one would ever notice. I've rigged things so RANDOM_NUMBER is no longer elemental, but the scalarizer treats it as if it were.
I've been working on derived type I/O and namelists the last couple of days. Everything is complete except namelist reads, which are a little difficult. No upload yet.
Joost Vandevondele reported a successful compile and execution of a very old cosmological kinematics simulation. I've been familiar with it for many years. It's called "asteroids". This version uses X-windows and can be found here
Jim McDonald pointed out that the common extension DREAL() was missing. It's now an alias for DBLE().
Doug Cox sent in a problem with intrinsics being used as dummy procedures which has been fixed.
Helge Avlesen found a problem with the WHERE statement being part of an IF-clause. This is fixed, as well as the analogous problem with FORALL.
Joost Vandevondle and Michael Richmond both sent in a problem with optional assumed shape arrays. If the array was not present, the program crashed. The crash has been fixed and the PRESENT() intrinsic even works on these kinds of arguments.
Michael Richmond sent a problem with ENTRY. It turns out that ENTRY can be lodged among data declaration statements.
Joost sent in a problem with DINT(), which got lost after fixing the problem with dummy intrinsics.
Doug Cox sent in a secondhand report of data constants with leading plus signs being misinterpreted. Integer constants were fixed about a year ago, but I neglected the analogous problem with real constants.
Michael Richmond and Doug Cox reported that a problem that creaped back into ENTRY statements. Fixed.
Steven Yellowhair reported problems with WHERE statements predicated on array function returns that has been fixed.
Martien Hulsen sent in a front-end problem having to do with variables being host-associated for interface blocks. This is explicitly not allowed. G95 now correctly errors on this sort of thing.
Helge Avlesen and Doug Cox reported a problem with vector subscripts that were array constructors. This is fixed now.
Cleared out several old emails that have since been fixed at unclear points in the past.
Helge Avlesen sent in a bug with scalarization where the right hand side had a scalar reference of the array that appeared on the right. Needed a temporary and one is now used.
Joost, Gavin Salam and Michael Richmond reported some array regressions that were fixed by the time I got to looking at them. I think the problem was an issue with making an exception for the TRANSFER intrinsic within the scalarizer (it gets left alone).
Delbert Franz sent in half a kilogram of dark Belgian chocolate. Dark chocolate is not very good for eating, but is excellent baking chocolate. This is so much that I need to buy a larger pot.
This is not going to be a very good week for g95. I have another ongoing project which has jumped in priority. Things should be back to normal by the weekend.
Fixed a crash associated with the REWIND() statement.
Jason Eckhardt and I have exchanged some mails discussing the functionality of the runtime library being linked with a C program. At his suggestion, I've added a pair of functions, g95_runtime_start() and g95_runtime_stop() that perform the initialization and shutdown of the runtime library. g95_runtime_start() takes an argc/argv pair, while g95_runtime_start() takes void.
Helge Avlesen reported a problem with the array version of TRANSFER long ago. I've fixed this. One can now use g95 to decipher James Van Buskirk's email address from his usenet .sig.
Douglas Cox sent in a really weird one. It turns out that you can have a format string that is a character array. The format is what you get by concatenating all of the elements. Weird. Now implemented.
Pasquale Panuzzo and Joost both found a problem with the new EOF code. The second time around, we hit an EOF right away, because the EOF-detection wasn't being reset. Fixed now.
Roberto Herrero sent in a problem where equivalenced variables in a module weren't being made public. This came about because of the recent rewrite of the common handling. I also noticed that a blank common was being incorrectly created. It was empty, but it was still there... gone now. Roberto's application, a nuclear reactor simulator, compiles and will now hopefully link.
Helmut Michels sent in a code that had the general form of ISHFTC() with the size present. I've added support for this case.
David Johnston sent in a crash on a character length specifcation expression that involved a module procedure. Because of how the symbol table was constructed, the function declaration wasn't being created before the character variable. This one was really delicate, and the slightest change to the source could suddenly make things work. Now it works all the time.
Jason Eckhardt pointed out that libf95's main() function was being set to a strong symbol, preventing libf95 from being linked with another C program that happened to have a main(), which is all of them. After some explanation of weak symbol, I've made libf95's main() a weak symbol.
Jon Wright sent in a problem with internal files-- EOF was not being correctly reported when EOF was hit. This is now fixed.
Someone, I think it was Douglas Cox, reported that internal units that were character arrays didn't work. This was related to the other issue with scalar internal files, so I've added initial support for it.
Roberto sent the derived type that was giving a problem. It turns out that it had a pointer array component with a NULL default initialization. Fixed now.
Shirrell Buhler said there was a problem with getting permission denied errors when opening files without the w bit set under unix. Since the default action is 'READWRITE', this looked like it was working correctly, but it did point out a problem with the INQUIRE statement. I confused 'action' with 'access', and so inquiring about the default mode was messed up. Fixed now.
The library now mimics the behaviour of peeking at the mode bits of the file if the action is not specified.
Reinhold Bader sent in a front end problem regarding the matching of IMPLICIT statements. There are a couple of different ways to interpret an implicit statement and a previous misinterpretation was causing problems later. Fixed.
Milan Hodoscek reported the successful compile and link of the CHARMM program, a 300k line quantum chemistry package. He reported a crash in the getarg() subroutine, which I think I fixed a couple days ago.
Pasquale Panuzzo sent in a problem with the I/O library. When doing list formatted reads without actually transferring any data, the end of file was being reported one record late. The check for logical EOF usually happens during transfers. A new check has been added at the end of reads, so line-counting programs now work correctly.
Roberto Herrero sent in another problem dealing with the intrinsic TRANSFER function, scalar version. String lengths are now correctly propagated from the MOLD parameter. He has another module that crashes on a derived type constructor, which I hope to have the definition of soon.
Michael Richmond reported a bug in common block processing a long time ago that I've finally fixed. The issue had to do with the ordering of BLOCK DATA program units that came before or after program units that used the common blocks. If the BLOCK DATA appeared after the program unit that defined a common, the initialization didn't happen. The fix to this involved some large revision in top level parsing and common block handling. Things are back in one piece now.
Kevin Thomas reported a bug in a similar vein. I thought it was the same originally, but it turned out that the procedures building up an array initialization got the size of the final array too large by one element. This was leading to linker errors. Fixed now.
Doug Cox reported a problem with vector subscripts that has been fixed.
Shirrell Buhler reported the almost-successful compilation of his 3200-program unit commercial code. G95 found a bug that no other compiler found. I recently added restrictions on how things could be equivalenced, which mostly restricts equivalences to default kinds. I've modified this from an error to a warning in strict f95 mode.
Gavin Salam sent in another problem involving a vector subscript, this time where the vector subscript was an actual argument of a function. Fixed as well.
Pasquale Panuzzo sent in a problem with the getarg() extension-- the comparison checking if the request was more than the number of arguments was off. A > needed to be >=.
Gavin Salam sent a small patch to fix the G95_NAME_x environment variables, where x is a decimal number. For implied opens, the library creates a file with the name equal to the value of G95_NAME_x.
Roberto Herrero sent in a problem involving derived types with array components that had a default initialization. This is fixed now.
Joost Vandevondele and Roberto Herrero both found a problem I introduced with the last overhaul-- derived types inside of other derived types weren't being properly created. No big deal, until you tried to use them. Fixed now.
David Johnston reported a problem with a character length specification expression that involved a module procedure. This one was a front end problem that is now fixed.
Helge reports that this his ocean model is working again.
Christophe Guiffaut sent in a weird edge case-- an ELSEWHERE with an empty where-block. This was segfaulting the compiler, but things are now handled correctly.
Pasquale Panuzzo reported a problem with scalarization where a vector subscript needed to be replaced with a temporary array (in all but the simplest cases). The temporary is created and the code now works.
Michael Richmond sent in some more problems with direct access I/O. First of all, the runtime library was trying to free() a memory-mapped file, which didn't work well at all, and there was also a problem with carriage control-- writing spaces isn't necessary when you're reading. All fixed.
Helge Avlesen sent in a code that was very similar to two previous codes. In both those instances, I was able to point out that the code was nonconforming. What he was trying to do was to save array pointers into static memory from dummy arrays. The hitch is that the arrays have to be assumed shape arrays, which wasn't happening in previous versions.
The fix involved changing the representation of array pointers, so it took the last couple days and touched parts of g95 as far away as the scalarizer and a couple of the intrinsics. Not only do things work now, I bet his nonstandard code would work as well.
Bill McLean sent in a similar looking bit of code involving array pointers that were members of structures going wrong. As it turned out, the problem was the scalarizer getting to carried away and it created a temporary that was passed to allocate(), leaving the real array unallocated.
Gavin Salam sent in a problem with a dummy function that returned an array. The error is gone and the code works.
Lothar Birk and Xavier Leoncini sent programs in which the shape of an array result depended on the size of an array parameter. The result was being allocated before the dependent parameter was being created. There is code to to this already, but it was a little buggy. Fixed now.
David Johnston sent in a code with MAXVAL() in a specification expression. This isn't allowed by the standard, but several other compilers allow it, so I've added it. I've added code to select various dialects of fortran (f95, F and f2003). When selected, g95 will issue language-specific warnings about nonstandard constructs. I've also added code that allows specific warnings to be disabled. The upshot of this is that each warning now has a warning number. I also had to write a short script that scans the whole code and makes sure that there are no collisions among these numbers, and it also gives a quick way to figure out the next unused warning number.
Michael Richmond sent in a problem involving the include statement. If the file didn't exist, the error message was correct the first time, but the data structure built for included files made it look like the file was already being included the second time around. Now it just errors correctly every time.
Michael also reported a problem with direct access I/O-- if only a partial record was present, a segfault resulted. Now the usual error processing takes place.
Martien Hulsen reported some successful runs with the Sepran computational fluid dynamics code. This is a commercial f77 code that weighs in at about half a million lines of code. The speed was not great but respectable. There was a small issue of g95 not short-circuiting IF expressions involving the .AND. and .OR. operators. I'm tempted to leave things the way they are, just to smoke out these coding errors.
David Johnston wrote in with a core dump in specification expressions with missing optional arguments. The fix yesterday allowed a core dump in this case.
Joost and Roberto Herrero both sent in a problem involving a crash involving bad line numbers getting sent to the back end. This was a result of the C preprocessor enhancement this weekend.
Joost tried out the C preprocessor enhancement and found an immediate problem. My packaging script deletes cpp. So it worked for me right up to the upload. I've switched things so that it uses the cpp on the local system for now. Long term, cpp will come with g95.
Boyd Blackwell told of success in compiling and running one of his legacy applications. He pointed out that his previous problem code, which merely reads a number from a file, ended up changing the access time of the file. This was due to an unnecessary truncation operation when the file was being closed. Files are now only truncated if strictly necessary.
Martien Hulsen sent in a problem with an array not being saved, even when explicitly marked. The arrays were accidentally ending up on the heap.
Kevin Thomas pointed out that several other compilers allow the intrinsic 'IMAG' as an alias for 'AIMAG'... I've added it to g95 as well.
Roberto Herrero reported a crash involving the WHERE statement. The WHERE statement expands to simpler statements internally, and only two things can appear in WHERE bodies-- assignments and other WHERE statements. A previous scalarization pass left behind a no-operation node, which although unexpected, is easy to process.
David Johnston sent in a problem where the front end was being a little too zealous in complaining about restricted expressions.
Added support for the C preprocessor. This is implemented in the usual way, filenames ending in .F, .F90, .F95, and .FOR are run through the preprocessor before the compiler. The -pipe option also works correctly, avoiding intermediate temporary files.
Resolved the standards question mentioned yesterday. The problem was a code (distilled from the hdf5 library) that looks like:
This is legal code, because the interface is its own scoping unit and does not get the implicit mapping from its host unit. The variable 'n' is therefore default integer, which was causing an error before.
The hdf5 library now builds correctly, but has a problem when linking. I noticed a problem with common blocks contained in modules. The name of the common wasn't being mangled like other global symbols. This happens now.
Boyd Blackwell sent in a problem involving reading from a unit that was not previously opened. The problem was that the existing file was being overwritten. Fixed this so that these implicit files are opened UNKNOWN mode instead of REPLACE.
Kevin Thomas reported a successful compile of one of his weather codes containing ENTRY. Linking was another matter. The master functions were being declared globally when they needed to be declared statically. This is fixed.
Doug Cox sent in a problem involving derived types with default component initialization. This is now supported.
Paul Wagner and I exchanged a couple more messages while working on getting the microwave limb sounding code to compile. A couple of snags have been bypassed and we are now into fortran. The first problem seems to involve a standards issue that I'll probably end up posting on comp.lang.fortran.
Michael Richmond sent in a problem where an undefined label was causing multiple errors, one for each place it was used. Now we only generate a single error.
Helge Avlesen pointed out that g95 allowed a READ statement to have PARAMETER variable. This is fixed now.
Milan Simanek had a code that pointed out multiple shortcomings of my ENTRY implementation. G95 now handles ENTRY statements with array parameters, and arrays that contain specification expressions consisting of other parameters.
Finished the initial implementation of ENTRY. There are still some things it won't do, like alternate returns in ENTRY subroutines, but everything else should work.
Superbowl sunday, so I went skiing. It still hurts in places.
Work on ENTRY has finally shifted toward the back end.
There is a new, alternate address for g95: http://www.g95.org. The DNS changes should have propagated everywhere by now. The g95.sourceforge.net address remains good and is still where the real web page is located.
Still working on ENTRY. The problem has now shifted to ENTRY statements in modules.
Working on the ENTRY statement for the last two days. It works fine with subroutines at the moment, but not functions. The parsing of ENTRY also has some serious problems that are being fixed. No upload yet.
Fixed some problems reported in COMMON initialization reported by Kevin Thomas, Michael Richmond and others.
Doug pointed out that the SIZE= tag in nonadvancing reads was not reporting the number of bytes read. This is fixed now too. He also says there is a thread in comp.lang.fortran regarding mixing linefeeds and nonadvancing I/O, which everyone seems to handle differently. G95 handles this by choking badly. We're not sure exactly what the problem is yet, but it is still being investigating.
Doug also suggested having list output of reals stop at 7 digits after the decimal point instead of 8 to make the output more pleasing. I've done this, and made 15 digits on doubles. The plan for a long time has been to switch to an algorithm that is guaranteed to round correctly and truncate trailing zeroes. The algorithm used by glibc does round correctly, but I can't guarantee that I'll always be linking against glibc. I've implemented this suggestion.
I didn't really fix Martien's problem from the 21st, it just no longer dumps core. Similarly, Joost sent in a problem that the fix to scalarization broke. I've fixed Joost's problem but Marien's has gone back in the queue.
Joost sent in another issue that I've addressed. There are a couple constraints on types of EQUIVALENCEd variables that have been implemented.
Martien did send in a report about a constraint not being enforced-- END SUBROUTINE and END FUNCTION are required for contained procedures. This is implemented now.
Michael Richmond sent in a problem with passing assumed-shape arrays. The lower bound wasn't being set to one if it wasn't present. Fixed now.
Some guys from the Microwave Limb Sounding group at JPL, Paul Wagner, Nathaniel Livesey, Van Snyder and Bob Thurstans gave me access to their code that they use to do their soundings with. The whole package is about 90M in size. These guys have a reputation for pushing fortran compilers beyond the breaking point. Van Snyder is also very active on the J3 committee. Peter and I have started corresponding on the various build problems.
Martien and Joost both sent in very different looking problems dealing with scalarization of arrays that are part of compound references. Fixing the problem amounted to breaking things down into simpler pieces. I think this fixes a wide range of problems.
Don Isgitt sent in a problem with MAXLOC()-- the integer coordinates were being stored incorrectly. Fixed the problem there and the corresponding problem in MINLOC(). He has a small finite element code (about 10k lines) that now prints out numbers. There was also a problem with tab characters in format strings that was fixed.
Toby White wrote in with a problem dealing with statement function inside of contained subroutines. The problem was a bogus assertion. Fixed.
Roberto Herrero wrote in with a problem regarding signs in DATA statements. The standard sort of makes it looks like spaces can optionally be between the minus sign and the number and the digit string. I've added this. He had another issue, calling the SUM intrinsic by SUM(array,mask), where the DIM argument is actually second. It seems some compilers ignore the position and make the mask the third argument based on its type. Doug Cox tried this out on a couple compilers and not all of them do it, so I declined to extend g95 this way.
Andreas Schweitzer reported a couple of bugs, one of which was ENTRY-related. The tricky one had to do with a subroutine argument that was set via INTENT(OUT), but never used otherwise, so it was never defined as far as the back end was concerned, leading to a crash.
Helge Avlesen wrote in to say that LAM (an implementation of MPI) works with g95 as the compiler. He got a simple code to work which has a couple different nodes printing a hello-world message. A small start but a good sign.
Joost Vandevondele sent a similar letter, but dealing with LAPACK. The failures have been whittled down to the pointer where the failed tests of lapack are the same as g95. More good news.
Doug sent in a program that did nonadvancing reads in a pair of different ways. Both sections now work correctly.
Michael sent in a problem where an array was being passed though a dummy procedure. The array was being treated as a full array instead of the f77 style pass the first element. Fixed now.
Made many fixes that allow nonadvancing I/O to work, particularly on reads. Nonadvancing reads and writes appear to work now.
Helge Avlesen and I got to talking about the SYSTEM_CLOCK() intrinsic, which is meant to measure wall time. I implemented the example in the standard, which had a second of granularity and was pretty useless. The new version is configurable. The number of ticks per second can be set through the G95_SYSTEM_CLOCK environment variable and can be set from zero to 1000000 (zero disables the clock). The clock is also rigged so that the first invocation always returns zero. The default is 100000 ticks per second, which gives just under five hours until the time rolls over.
Doug sent in a problem regarding reading DOS-style files (CR's) with list formatting that has been fixed.
Took care of a long standing problem of reporting format errors with FORMAT statements that wasn't pointing to the place where the parse error was actually happening. Doug and Michael had this one.
Doug sent in a Meissner problem, initialization of a derived type array with a (scalar) derived type. Fixed now.
Joost reported a problem with the weird but legal case of empty format lists. Fixed. He said it was the shortest bug report he's sent in:
Katherine Holcomb still has the record with:
Martien sent in a problem with the front end where an array constructor being simplified through an elemental function ended up with the wrong rank. In fortran 95, constructors can only have rank 1, but under the hood, the constructors can have ranks greater than one. Fixed as well.
Doug sent in a code with a constructor that has a loop variable in it. The problem was that the loop variable was affecting the variable by that name when it shouldn't. Constructor expansion now uses temporary variables for this purpose.
Somehow a line got deleted in the common block handler, and symbols weren't actually being made into common symbols. Martien reported this specificially and in a report a little before Christmas. Joost also reported the same problem. Joost says that g95 now compiles his Car-Parinello code and can run simple cases. Martien reports similar progress on some of his finite element codes.
Doug Cox sent in a crash where pointers to array were initialized with NULL(). Fixed now.
Joost sent in a crash having to do with passing an array where the actual argument was an array element. Fixed as well.
Martien and Joost both sent in some problems with COMMON blocks that I was intending to get to, but there was an interesting article on the J3 list regarding branch cuts that I wanted to write a cogent response to.
Martien sent a couple of I/O bugs with had to do with reading and writing records in direct access files that were written out of order or out of range. These problems are fixed now.
Joost sent a problem almost identical to Michael's of yesterday, but dealing with returning a pointer to a character array. This is fixed too.
Added initial support for the WHERE statement and scalarization of elemental subroutines. Helge Avlesen has a pending code that still doesn't quite work.
Michael Richmond sent in a problem with functions returning character pointers that has been fixed.
Reorganized the blog into yearly segments. It was getting too long, and splitting into monthly segments needed too much maintenance. After the recent holiday, I'm pretty far behind on bugs.
I've ended up looking over the last year, and there is so much that has been accomplished. Without several of the distractions of previous years, things are moving faster than ever.