From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10137 invoked by alias); 8 Oct 2012 09:33:14 -0000 Received: (qmail 9971 invoked by uid 48); 8 Oct 2012 09:32:58 -0000 From: "simonb at google dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/51727] Changing module files Date: Mon, 08 Oct 2012 09:33:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: simonb at google dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-10/txt/msg00654.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51727 --- Comment #9 from Simon Baldwin 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.