From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8336 invoked by alias); 14 Sep 2004 13:23:45 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 8317 invoked by uid 48); 14 Sep 2004 13:23:43 -0000 Date: Tue, 14 Sep 2004 13:23:00 -0000 Message-ID: <20040914132343.8316.qmail@sourceware.org> From: "rguenth at tat dot physik dot uni-tuebingen dot de" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20020531030602.6883.rguenth@tat.physik.uni-tuebingen.de> References: <20020531030602.6883.rguenth@tat.physik.uni-tuebingen.de> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug tree-optimization/6883] Fails to optimize temporary objects. X-Bugzilla-Reason: CC X-SW-Source: 2004-09/txt/msg01526.txt.bz2 List-Id: ------- Additional Comments From rguenth at tat dot physik dot uni-tuebingen dot de 2004-09-14 13:23 ------- Mainline as of 4.0.0 20040914 now produces .L13: movl %esi, %ebx movl %eax, %edx movl %ecx, %esi .L2: leal 1(%edx), %eax fldl (%edi,%eax,8) cmpl $255, %eax faddl -8(%edi,%edx,8) movl -16(%ebp), %edx leal 8(%esi), %ecx fmull (%edx,%ebx) movl -20(%ebp), %edx fstpl (%edx,%ebx) jne .L13 and .L14: movl %esi, %ebx movl %edx, %esi .L5: movl %ecx, %eax incl %ecx movl -16(%ebp), %edx fldl -8(%edi,%ecx,8) cmpl $255, %eax faddl -24(%edi,%ecx,8) fmull (%edx,%ebx) movl -20(%ebp), %edx fstpl (%edx,%ebx) leal 8(%esi), %edx jne .L14 which looks nearly identical. The optimized tree dump is pretmp.28 = (unsigned int) 1; pretmp.32 = (double *) (pretmp.28 * 8); prephitmp.33 = pretmp.32; D.1760 = 1; ivtmp.70 = 16B; :; D.1981 = () D.1760; D.1991 = D.1981 + 1; it$m_i = (int) D.1991; *(D.1740 + prephitmp.33) = (*(D.1745 + (double *) D.1981 * 8B - 8B) + *(D.1745 + (double *) () it$m_i * 8B)) * *(D.1750 + prephitmp.33); ivtmp.61 = ivtmp.70 + 8B; if (D.1991 != 255) goto ; else goto ; :; D.1760 = it$m_i; prephitmp.33 = ivtmp.70; ivtmp.70 = ivtmp.61; goto (); and :; prephitmp.39 = pretmp.32; D.1828 = 1; ivtmp.69 = 16B; :; D.1956 = () D.1828; D.1966 = D.1956 + 1; D.1828 = (int) D.1966; *(D.1740 + prephitmp.39) = (*(D.1745 + (double *) D.1956 * 8B - 8B) + *(D.1745 + (double *) () D.1828 * 8B)) * *(D.1750 + prephitmp.39); ivtmp.46 = ivtmp.69 + 8B; if (D.1966 != 255) goto ; else goto ; :; prephitmp.39 = ivtmp.69; ivtmp.69 = ivtmp.46; goto (); where apart from the unnecessary store to D.1760 sra did its work. Nice. -- What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Known to work| |4.0.0 Resolution| |FIXED http://gcc.gnu.org/bugzilla/show_bug.cgi?id=6883