This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Oddity in gcj output


I was looking at Bill Bland's performance problem and I noticed that
gcj will generate assembly like this:

    .L110:
	    call	_Jv_ThrowNullPointerException
	    .p2align 4,,15
    .L111:
	    movl	%edx, (%esp)
	    call	_Jv_ThrowBadArrayIndex
	    .p2align 4,,15
    .L112:
	    call	_Jv_ThrowNullPointerException
	    .p2align 4,,15
    .L113:
	    movl	%edx, (%esp)
	    call	_Jv_ThrowBadArrayIndex
	    .p2align 4,,15
    .L114:
	    call	_Jv_ThrowNullPointerException
	    .p2align 4,,15
    .L115:
	    movl	%edx, (%esp)
	    call	_Jv_ThrowBadArrayIndex
	    .p2align 4,,15
    .L116:
	    call	_Jv_ThrowNullPointerException
	    .p2align 4,,15
    .L117:
	    movl	%edx, (%esp)
	    call	_Jv_ThrowBadArrayIndex

Surely there's no need for all these calls.  We could just make one of
each per method (or maybe even per compilation unit).

Maybe this is an optimization that the middle end ought to be able to
make?  I really don't know.

In this case I built Bill's source with `-O2 -g0 -S'.

Tom


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]