This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: [PATCH] Set correct source location for deallocator calls
- From: Richard Henderson <rth at redhat dot com>
- To: Dehao Chen <dehao at google dot com>
- Cc: Jason Merrill <jason at redhat dot com>, Richard Guenther <richard dot guenther at gmail dot com>, gcc-patches at gcc dot gnu dot org, David Li <davidxl at google dot com>, java at gcc dot gnu dot org
- Date: Thu, 30 Aug 2012 07:28:06 -0700
- Subject: Re: [PATCH] Set correct source location for deallocator calls
- References: <CAO2gOZXfnETUe4wqjT7p6fd61hXreu9PDfqKxNz+HxpE0E7K0g@mail.gmail.com> <CAO2gOZX_hZ1m0xKvxUg+6gWTOX4V5ok-vvCEg3Vhfpt=qXj8-g@mail.gmail.com> <CAFiYyc00wud5Oa3k51ntm8KeZHZnfm4rpnBsOJjURZMcoqFdTA@mail.gmail.com> <50228C38.5080703@redhat.com> <CAO2gOZUbkTsnJ2fwgeNhcRmxkzzJEifECeiF=_YRUjeKDeRMdA@mail.gmail.com> <502294A1.3060800@redhat.com> <50243480.7090803@redhat.com> <CAO2gOZURCuWUk2MVwCwmwrijNzWxJt3q=HUpU7=Qv6zB9e-uqA@mail.gmail.com> <50254A50.8070208@redhat.com> <CAO2gOZXhHuFGJ0z=jvkYKZ84EoDaPSYVjxS7QzGore56SyhWyQ@mail.gmail.com> <50255B35.9020705@redhat.com> <CAO2gOZWe+qMrVyvOoo7Ek-di0NKZxxU4Z=pqrDCqqCCAfctZOw@mail.gmail.com> <50258712.4070002@redhat.com> <CAO2gOZUQQjmKtooyXXAfgFoNVbeNwtT+P=E7pQ6jC=e07Nsr2g@mail.gmail.com> <CAO2gOZX-Gn+b6LEzps5zxhgmwQWcJ-zFqG=a7hesW6fbVyxZYQ@mail.gmail.com> <502E6774.8050609@redhat.com> <CAO2gOZWhueDAShNLbNcJpkHA6QqXk1LNZhEMFvfT77aTZTCH9w@mail.gmail.com>
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~