http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51727
--- Comment #19 from Tobias Schlüter <tobi at gcc dot gnu.org> 2012-10-13 08:31:39 UTC --- Simon, I don't think the 'integer's are functions of the pointers once you process the symbols in a defined order. The non-determinism was caused by traversing the pointer_info tree based on the non-deterministic pointers. With the patch, the tree is copied to a map sorted by the integers. In the first iteration of write_symbol1 these are given by the traversal of the namespace, which is deterministic. Since we now process these symbols in a deterministic order, the integers of the symbols added during each iteration are also deterministic. I might be missing something, of course. Joost, it wouldn't be much work to implement the same thing using GFC_BBT instead of a std::map. It would require a typedef and one would have to cleanup the tree manually, but if fixing old versions of gcc is valuable, I can do it. I might have to do this anyway, as I don't know if gfortran maintainers like C++isms (even though in this particular case it's probably non-controversial).