Old Java PRs

Jeff Sturm jsturm@one-point.com
Mon May 12 18:11:00 GMT 2003

On Mon, 12 May 2003, Andrew Haley wrote:
>  > Unless I misunderstand this PR, it is fixed by the new inliner (except for
>  > the bytecode frontend, which still does not emit whole functions as
>  > trees).
> It isn't.  The new inliner still will not inline functions until they
> have been expanded.

Unfortunately the PR doesn't include a test case.  This is what I tried:

$ cat A.java
class A {
    int _y;
    final int x() {
        return y() + 1;
    final int y() {
        return _y;

$ gcj -O3 -S -g0 -fno-exceptions -fomit-frame-pointer A.java

$ more A.s
        subl    $12, %esp
        movl    16(%esp), %eax
        movl    %eax, (%esp)
        call    _ZN1A1yEv
        incl    %eax
        addl    $12, %esp

Reversing the declaration order of x and y, I get:

        movl    4(%esp), %eax
        movl    4(%eax), %eax
        incl    %eax

So it looks as though you're right, though I could swear I've seen this
work before.  My understanding of the tree inliner is that it does not
require expanding the inlined bodies to RTL, but I don't remember the


More information about the Gcc-bugs mailing list