From patchwork Sat Feb 13 20:37:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 10850 Received: (qmail 16333 invoked by alias); 13 Feb 2016 20:37:24 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 16318 invoked by uid 89); 13 Feb 2016 20:37:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.8 required=5.0 tests=BAYES_50, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sk:library, UD:library-module.exp, var_i, non-allocated X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Sat, 13 Feb 2016 20:37:21 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id C3FE78F26E; Sat, 13 Feb 2016 20:37:20 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-204-18.brq.redhat.com [10.40.204.18]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1DKbHav022997 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 13 Feb 2016 15:37:19 -0500 Date: Sat, 13 Feb 2016 21:37:16 +0100 From: Jan Kratochvil To: gdb-patches@sourceware.org Cc: Keven Boell Subject: [testsuite patch] Fix false Fortran regressions with recent gcc Message-ID: <20160213203716.GA22912@host1.jankratochvil.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) X-IsSubscribed: yes Hi, gcc-4.9.2-6.fc21.x86_64 -> gcc-5.3.1-2.fc23.x86_64 -PASS: gdb.fortran/vla-ptype.exp: ptype pvla not initialized +FAIL: gdb.fortran/vla-ptype.exp: ptype pvla not initialized -PASS: gdb.fortran/vla-history.exp: print vla1 allocated +FAIL: gdb.fortran/vla-history.exp: print vla1 allocated -PASS: gdb.fortran/vla-history.exp: print $2 +FAIL: gdb.fortran/vla-history.exp: print $2 -PASS: gdb.fortran/vla-value.exp: print undefined pvla +FAIL: gdb.fortran/vla-value.exp: print undefined pvla -PASS: gdb.fortran/vla-value.exp: print non-associated &pvla +FAIL: gdb.fortran/vla-value.exp: print non-associated &pvla -PASS: gdb.fortran/vla-value.exp: print undefined pvla(1,3,8) +FAIL: gdb.fortran/vla-value.exp: print undefined pvla(1,3,8) These issues get fixed (or removed if no longer applicable) by attached patch. It is based on Googled: http://www.cs.rpi.edu/~szymansk/OOF90/bugs.html#5 When a pointer is declared its status is undefined, and cannot be safely queried with the associated intrinsic. -> nullify(VARNAME) + https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux-and-mac-os-x/topic/268786 ALLOCATE is not supposed to initialize the array. -> Remove checks like an initial print is: \\( *0, *0, *0...\\) These regressions remain: -PASS: gdb.fortran/library-module.exp: print var_i in lib +FAIL: gdb.fortran/library-module.exp: print var_i in lib -PASS: gdb.fortran/library-module.exp: print var_i in main +FAIL: gdb.fortran/library-module.exp: print var_i in main I believe it is more a GDB bug (in a code contributed by me), filed: gdb.fortran/library-module.exp false regression on GCC upgrade https://sourceware.org/bugzilla/show_bug.cgi?id=19635 OK for check-in? Thanks, Jan gdb/testsuite/ChangeLog 2016-02-13 Jan Kratochvil Fix compatibility with recent gfortran-5.3.1. * gdb.fortran/vla-history.exp (print vla1 allocated) (print vla2 allocated, print $2, print $3): Remove (print $4): Rename to ... (print $2): ... here. (print $9): Rename to ... (print $5): ... here. (print $10): Rename to ... (print $6): ... here. * gdb.fortran/vla.f90: Add pvla initialization. diff --git a/gdb/testsuite/gdb.fortran/vla-history.exp b/gdb/testsuite/gdb.fortran/vla-history.exp index 315c61a..1478e6b 100644 --- a/gdb/testsuite/gdb.fortran/vla-history.exp +++ b/gdb/testsuite/gdb.fortran/vla-history.exp @@ -32,10 +32,6 @@ gdb_test "print vla1" " = " "print non-allocated vla1" gdb_breakpoint [gdb_get_line_number "vla2-allocated"] gdb_continue_to_breakpoint "vla2-allocated" -gdb_test "print vla1" " = \\( *\\( *\\( *0, *0, *0,\[()0, .\]*\\)" \ - "print vla1 allocated" -gdb_test "print vla2" " = \\( *\\( *\\( *0, *0, *0,\[()0, .\]*\\)" \ - "print vla2 allocated" gdb_breakpoint [gdb_get_line_number "vla1-filled"] gdb_continue_to_breakpoint "vla1-filled" @@ -45,12 +41,8 @@ gdb_test "print vla1" \ # Try to access history values for full vla prints. gdb_test "print \$1" " = " "print \$1" -gdb_test "print \$2" " = \\( *\\( *\\( *0, *0, *0,\[()0, .\]*\\)" \ - "print \$2" -gdb_test "print \$3" " = \\( *\\( *\\( *0, *0, *0,\[()0, .\]*\\)" \ - "print \$3" -gdb_test "print \$4" \ - " = \\( *\\( *\\( *1311, *1311, *1311,\[()1311, .\]*\\)" "print \$4" +gdb_test "print \$2" \ + " = \\( *\\( *\\( *1311, *1311, *1311,\[()1311, .\]*\\)" "print \$2" gdb_breakpoint [gdb_get_line_number "vla2-filled"] gdb_continue_to_breakpoint "vla2-filled" @@ -58,5 +50,5 @@ gdb_test "print vla2(1,43,20)" " = 1311" "print vla2(1,43,20)" gdb_test "print vla1(1,3,8)" " = 1001" "print vla2(1,3,8)" # Try to access history values for vla values. -gdb_test "print \$9" " = 1311" "print \$9" -gdb_test "print \$10" " = 1001" "print \$10" +gdb_test "print \$5" " = 1311" "print \$5" +gdb_test "print \$6" " = 1001" "print \$6" diff --git a/gdb/testsuite/gdb.fortran/vla.f90 b/gdb/testsuite/gdb.fortran/vla.f90 index 6a96635..c76d24c 100644 --- a/gdb/testsuite/gdb.fortran/vla.f90 +++ b/gdb/testsuite/gdb.fortran/vla.f90 @@ -19,6 +19,7 @@ program vla real, target, allocatable :: vla3 (:, :) real, pointer :: pvla (:, :, :) logical :: l + nullify(pvla) allocate (vla1 (10,10,10)) ! vla1-init l = allocated(vla1)