From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17649 invoked by alias); 30 Aug 2012 14:28:27 -0000 Received: (qmail 17629 invoked by uid 22791); 30 Aug 2012 14:28:26 -0000 X-SWARE-Spam-Status: No, hits=-7.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_GC,TW_IB,TW_TM X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 30 Aug 2012 14:28:08 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7UES7GN023974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 30 Aug 2012 10:28:07 -0400 Received: from anchor.twiddle.home (vpn-224-193.phx2.redhat.com [10.3.224.193]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7UES6w8012614; Thu, 30 Aug 2012 10:28:07 -0400 Message-ID: <503F7876.7030606@redhat.com> Date: Thu, 30 Aug 2012 14:28:00 -0000 From: Richard Henderson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Dehao Chen CC: Jason Merrill , Richard Guenther , gcc-patches@gcc.gnu.org, David Li , java@gcc.gnu.org Subject: Re: [PATCH] Set correct source location for deallocator calls References: <50228C38.5080703@redhat.com> <502294A1.3060800@redhat.com> <50243480.7090803@redhat.com> <50254A50.8070208@redhat.com> <50255B35.9020705@redhat.com> <50258712.4070002@redhat.com> <502E6774.8050609@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact java-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-owner@gcc.gnu.org X-SW-Source: 2012-08/txt/msg00004.txt.bz2 On 08/17/2012 03:02 PM, Dehao Chen wrote: > I spend a whole day working on this, but find it very difficult to add > such a java test because: > > * First, libjava testsuits are all runtime tests, i.e., it compiles > the byte code to native code, execute it, and compares the output to > expected output. There is no way to scan the assembly. > * Though there is a way to derive the line number at runtime in java > (using Exception().getStackTrace()), this method only works on VM, and > the gcj generated native code does not get the lineno. > > Any suggestions on this? Hmm, not from me, unfortunately. Cc'ing the java list for clues. I won't hang up the main patch for this though. >> BTW, for the future, please fix your mailer to not wrap lines. > > Okay, I'll try. The problem is that we have to send mail in plain txt. > And in "plain text mode" gmail wraps each line to 80 characters and > wouldn't allow you change that... In that case use a text/plain attachment (which, not having tried it myself, may require you use a .txt suffix on the patch file). Most mail readers will show those inline. It's certainly better than having actually corrupt data sent to the list. > +// { dg-options "-O2 -fno-exceptions -g -dA" } ... > +// { dg-final { scan-assembler "1 28 0" } } You're still scanning for the .loc line, not the "test.c:28" comment added by -dA. To understand the problem, go back to your build tree, edit auto-host.h and undefine HAVE_AS_DWARF2_DEBUG_LINE. Then rerun the testsuite with RUNTESTFLAGS=dwarf2.exp. > + /* Calls to destructors are generated automatically in FINALL/CATCH > + block. They should have location as UNKNOWN_LOCATION. However, > + gimplify_call_expr will reset these call stmts to input_location > + if it finds stmt's location is unknown. To prevent resetting for > + destructors, we set the input_location to unknown. > + Note that this only affects the destructor calls in FINALL/CATCH > + block, and will automatically reset to its original value by the > + end of gimplify_expr. */ s/FINALL/FINALLY/g r~