From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5333 invoked by alias); 19 May 2003 16:38:32 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 5311 invoked from network); 19 May 2003 16:38:32 -0000 Received: from unknown (HELO www.eyesopen.COM) (12.96.199.11) by sources.redhat.com with SMTP; 19 May 2003 16:38:32 -0000 Received: from localhost (roger@localhost) by www.eyesopen.COM (8.11.6/8.11.6) with ESMTP id h4JGKxX21871; Mon, 19 May 2003 10:20:59 -0600 Date: Mon, 19 May 2003 16:49:00 -0000 From: Roger Sayle To: David Edelsohn cc: Andreas Schwab , Zack Weinberg , , Subject: Re: Bootstrap failure on ia64 In-Reply-To: <200305191425.KAA26564@makai.watson.ibm.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2003-05/txt/msg01774.txt.bz2 Hi David, > FYI, I receive the same error on PowerPC in the testsuite, > although the compiler does bootstrap. If not for the G++ bootstrap > failure, you would have received this feedback much earlier. Many thanks. I now understand the cause of the failure and am currently attempting to bootstrap and regression test the following patch. The issue is that in the second hunk, len_rtx is a constant integer that wasn't handled by the first hunk. We'd then end up calling simplify_gen_binary(MINUS, VOIDmode, const_int, const_int) which isn't able to do the constant folding itself. I'll look into a follow-up patch to see if simplify_gen_binary can be improved to handle this case. For the time being, the following patch should fix the powerpc regressions, and probably also the ia64 bootstrap failure. Ok to commit to mainline if bootstrapping and regression testing complete? Once again my sincere apologies. 2003-05-19 Roger Sayle * builtins.c (expand_builtin_memcpy): Be careful to avoid calling simplify_gen_binary with constant arguments. Index: builtins.c =================================================================== RCS file: /cvs/gcc/gcc/gcc/builtins.c,v retrieving revision 1.202 diff -c -3 -p -r1.202 builtins.c *** builtins.c 18 May 2003 22:50:25 -0000 1.202 --- builtins.c 19 May 2003 16:22:01 -0000 *************** expand_builtin_memcpy (arglist, target, *** 2311,2324 **** #endif if (endp) { ! rtx result; ! rtx delta = len_rtx; if (endp == 2) ! delta = GEN_INT (INTVAL (delta) - 1); result = simplify_gen_binary (PLUS, GET_MODE (dest_mem), ! dest_mem, delta); return force_operand (result, NULL_RTX); } else --- 2311,2323 ---- #endif if (endp) { ! rtx result = len_rtx; if (endp == 2) ! result = GEN_INT (INTVAL (result) - 1); result = simplify_gen_binary (PLUS, GET_MODE (dest_mem), ! dest_mem, result); return force_operand (result, NULL_RTX); } else *************** expand_builtin_memcpy (arglist, target, *** 2347,2355 **** if (endp == 2) { ! result = simplify_gen_binary (MINUS, GET_MODE (result), ! result, const1_rtx); ! result = force_operand (result, NULL_RTX); } result = simplify_gen_binary (PLUS, GET_MODE (dest_addr), --- 2346,2359 ---- if (endp == 2) { ! if (GET_CODE (result) != CONST_INT) ! { ! result = simplify_gen_binary (MINUS, GET_MODE (result), ! result, const1_rtx); ! result = force_operand (result, NULL_RTX); ! } ! else ! result = GEN_INT (INTVAL (result) - 1); } result = simplify_gen_binary (PLUS, GET_MODE (dest_addr), Roger -- Roger Sayle, E-mail: roger@eyesopen.com OpenEye Scientific Software, WWW: http://www.eyesopen.com/ Suite 1107, 3600 Cerrillos Road, Tel: (+1) 505-473-7385 Santa Fe, New Mexico, 87507. Fax: (+1) 505-473-0833