This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/51727] Changing module files


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51727

--- Comment #9 from Simon Baldwin <simonb at google dot com> 2012-10-08 09:32:55 UTC ---
(In reply to comment #1)
> Also reported here:
> 
> http://gcc.gnu.org/ml/gcc/2012-10/msg00075.html

To add a little more detail, here is one diff seen between two .mod files:

$ diff omp_lib.mod.first omp_lib.mod
2c2
< MD5:39fa3d71e0f92c936ff97e590e8d74cf -- If you edit this, you'll get what you
deserve.
---
> MD5:893e632666abe58013fd14806b18696f -- If you edit this, you'll get what you deserve.
174,175d173
< 20 'lock' '' '' 19 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN 0 0
< DUMMY) (INTEGER 4 0 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)
177a176,177
> 20 'lock' '' '' 19 ((VARIABLE INOUT UNKNOWN-PROC UNKNOWN UNKNOWN 0 0
> DUMMY) (INTEGER 4 0 0 0 INTEGER ()) 0 0 () () 0 () () () 0 0)

This is an ordering difference in the output of write_symbol1, which traverses
a pointer tree whose compare function compares pointers with greaterthan and
lessthan.  The tree is augmented during traversal, so there are repeated calls
to write_symbol1 along with a 'written' marker at each node.  Ordering by
integer 'tag' assigned to each pointer may be problematic because new tags are
assigned during traversals, meaning that the sequence in which tags arrive is
itself partially a function of the pointer ordering.


> I'm wondering if a very naive hack like sorting .mod content (like in cat
> old.mod 1 | sort -s > new.mod) could not paper over this problem sufficiently
> well to make it irrelevant in reality.

Perhaps, but it would have to be less naive than this in practice.  A .mod file
is structured into sections that a simple sort could fragment.  It also
contains an MD5 checksum of its contents, but I'm not sure how important this
is.  If it's not critical, removing it might be an acceptable price to pay for
simpler code elsewhere.


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