From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12312 invoked by alias); 20 Mar 2009 22:44:17 -0000 Received: (qmail 12285 invoked by uid 48); 20 Mar 2009 22:44:16 -0000 Date: Fri, 20 Mar 2009 22:44:00 -0000 Message-ID: <20090320224416.12284.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug java/18190] [4.2/4.3/4.4 regression] primitive array optimization is gone In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: java-prs@gcc.gnu.org From: "rguenth at gcc dot gnu dot org" Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org X-SW-Source: 2009-q1/txt/msg00085.txt.bz2 ------- Comment #13 from rguenth at gcc dot gnu dot org 2009-03-20 22:44 ------- It at least still happens with 4.3 and I have no belief that it is fixed with 4.4 if comment #3 applies. Code generated is also absymal (-O2): _ZN1t18__U3c_clinit__U3e_EJvv: .LFB2: pushl %ebp .LCFI0: movl %esp, %ebp .LCFI1: subl $8, %esp .LCFI2: movl $4, 4(%esp) movl $_Jv_intClass, (%esp) call _Jv_NewPrimArray movl 4(%eax), %edx testl %edx, %edx je .L8 cmpl $1, %edx movl $5, 8(%eax) jbe .L9 cmpl $2, %edx movl $7, 12(%eax) jbe .L10 cmpl $3, %edx movl $9, 16(%eax) jbe .L11 movl $11, 20(%eax) movl %eax, _ZN1t1xE leave ret .L8: movl $0, (%esp) call _Jv_ThrowBadArrayIndex .L9: movl $1, (%esp) call _Jv_ThrowBadArrayIndex .L10: movl $2, (%esp) call _Jv_ThrowBadArrayIndex .L11: movl $3, (%esp) call _Jv_ThrowBadArrayIndex (4.3 again), we do not seem to be able to CSE the load of the array length on the tree level and we have no way (still) of commoning the calls to _Jv_ThrowBadArrayIndex either: : D.241 = _Jv_NewPrimArray (&_Jv_intClass, 4); D.249 = D.241->length; if (D.249 != 0) goto ; else goto ; : _Jv_ThrowBadArrayIndex (0); : D.241->data[0] = 5; D.263 = D.241->length; if ((unsigned int) D.263 > 1) goto ; else goto ; : _Jv_ThrowBadArrayIndex (1); : D.241->data[1] = 7; D.277 = D.241->length; if ((unsigned int) D.277 > 2) goto ; else goto ; : _Jv_ThrowBadArrayIndex (2); : D.241->data[2] = 9; D.291 = D.241->length; if ((unsigned int) D.291 > 3) goto ; else goto ; : _Jv_ThrowBadArrayIndex (3); : D.241->data[3] = 11; x = D.241; return; -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18190