From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2517 invoked by alias); 17 Jun 2014 13:52:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 2506 invoked by uid 89); 17 Jun 2014 13:52:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,UNSUBSCRIBE_BODY autolearn=no version=3.3.2 X-HELO: mga01.intel.com Received: from mga01.intel.com (HELO mga01.intel.com) (192.55.52.88) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 17 Jun 2014 13:52:31 +0000 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga101.fm.intel.com with ESMTP; 17 Jun 2014 06:52:30 -0700 X-ExtLoop1: 1 Received: from kboell-mobl2.ger.corp.intel.com (HELO [172.28.205.55]) ([172.28.205.55]) by fmsmga002.fm.intel.com with ESMTP; 17 Jun 2014 06:48:10 -0700 Message-ID: <53A04719.6080805@linux.intel.com> Date: Tue, 17 Jun 2014 13:52:00 -0000 From: Keven Boell User-Agent: Mozilla/5.0 (Windows NT 6.2; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Jan Kratochvil , Keven Boell CC: gdb-patches@sourceware.org, sanimir.agovic@intel.com Subject: Re: [PATCH 20/23] test: dynamic string evaluations. References: <1401861266-6240-1-git-send-email-keven.boell@intel.com> <1401861266-6240-21-git-send-email-keven.boell@intel.com> <20140616184111.GA20288@host2.jankratochvil.net> In-Reply-To: <20140616184111.GA20288@host2.jankratochvil.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-06/txt/msg00583.txt.bz2 > On Wed, 04 Jun 2014 07:54:23 +0200, Keven Boell wrote: >> --- /dev/null >> +++ b/gdb/testsuite/gdb.fortran/vla-strings.f90 >> @@ -0,0 +1,38 @@ >> +! Copyright 2014 Free Software Foundation, Inc. >> +! >> +! This program is free software; you can redistribute it and/or modify >> +! it under the terms of the GNU General Public License as published by >> +! the Free Software Foundation; either version 2 of the License, or >> +! (at your option) any later version. >> +! >> +! This program is distributed in the hope that it will be useful, >> +! but WITHOUT ANY WARRANTY; without even the implied warranty of >> +! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the >> +! GNU General Public License for more details. >> +! >> +! You should have received a copy of the GNU General Public License >> +! along with this program; if not, write to the Free Software >> +! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. >> + >> +program vla_strings >> + character(len=:), target, allocatable :: var_char >> + character(len=:), pointer :: var_char_p >> + logical :: l >> + >> + allocate(character(len=10) :: var_char) >> + l = allocated(var_char) ! var_char-allocated-1 >> + var_char = 'foo' >> + deallocate(var_char) ! var_char-filled-1 >> + l = allocated(var_char) ! var_char-deallocated >> + allocate(character(len=42) :: var_char) >> + l = allocated(var_char) >> + var_char = 'foobar' >> + var_char = '' ! var_char-filled-2 >> + allocate(character(len=21) :: var_char) ! var_char-empty > > On Fedora Rawhide x86_64 (gcc-4.9.0-8.fc21.x86_64) I get: > $ ./gdb.fortran/vla-strings > At line 31 of file ./gdb.fortran/vla-strings.f90 > Fortran runtime error: Attempting to allocate already allocated variable 'var_char' > > This also causes: > Running ./gdb.fortran/vla-strings.exp ... > FAIL: gdb.fortran/vla-strings.exp: continue to breakpoint: var_char-allocated-3 (the program exited) > FAIL: gdb.fortran/vla-strings.exp: print var_char after allocated third time > FAIL: gdb.fortran/vla-strings.exp: whatis var_char after allocated third time > FAIL: gdb.fortran/vla-strings.exp: ptype var_char after allocated third time > FAIL: gdb.fortran/vla-strings.exp: continue to breakpoint: var_char_p-associated (the program is no longer running) > FAIL: gdb.fortran/vla-strings.exp: print var_char_p after associated > FAIL: gdb.fortran/vla-strings.exp: print *var_char_ after associated > FAIL: gdb.fortran/vla-strings.exp: whatis var_char_p after associated > FAIL: gdb.fortran/vla-strings.exp: ptype var_char_p after associated Thanks for trying out the tests on your system. The test source was incorrect. I tried to allocate a string, which wasn't deallocated before. GFORTRAN 4.8.2, which I have on my system, doesn't complain about this mistake, whereas GFORTRAN 4.9.0 does. I fixed it and it resolves all of the FAIL's reported above. > > >> + l = allocated(var_char) ! var_char-allocated-3 >> + var_char = 'johndoe' >> + var_char_p => var_char >> + l = associated(var_char_p) ! var_char_p-associated >> + var_char_p => null() >> + l = associated(var_char_p) ! var_char_p-not-associated >> +end program vla_strings >> -- >> 1.7.9.5 > > > Thanks, > Jan >