From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 76702 invoked by alias); 30 Sep 2015 10:58:40 -0000 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 Received: (qmail 76666 invoked by uid 48); 30 Sep 2015 10:58:36 -0000 From: "arjen.markus895 at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/67779] New: Strange ordering with strings in extended object Date: Wed, 30 Sep 2015 10:58:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.9.3 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: arjen.markus895 at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-09/txt/msg02362.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67779 Bug ID: 67779 Summary: Strange ordering with strings in extended object Product: gcc Version: 4.9.3 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: arjen.markus895 at gmail dot com Target Milestone: --- Created attachment 36421 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=36421&action=edit Source file demonstrating the problem The attached program constructs a small array of integers and strings and then sorts them. The output is: Sorting ... Result: 1 2 3 4 5 6 7 8 9 10 String = 10 String = 1 String = 2 String = 3 String = 4 String = 5 String = 6 String = 7 String = 8 String = 9 What is unexpected is the fact that "String = 10" comes before "String = 1". I have not been able to reduce the code (other than removing the derived type with integers) and still exhibit the odd ordering. The ten integers show that the quicksort routine does its job, though. When comparing the strings in a small program, "String = 10" definitely comes after "String = 1" as I would expect.