From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4819 invoked by alias); 25 Aug 2005 22:34:18 -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 4792 invoked by uid 22791); 25 Aug 2005 22:34:11 -0000 Received: from w099.z064220152.sjc-ca.dsl.cnc.net (HELO duck.specifix.com) (64.220.152.99) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Thu, 25 Aug 2005 22:34:11 +0000 Received: from [127.0.0.1] (duck.corp.specifix.com [192.168.1.1]) by duck.specifix.com (Postfix) with ESMTP id 16A03497F; Thu, 25 Aug 2005 15:34:13 -0700 (PDT) Message-ID: <430E4760.8070606@specifix.com> Date: Fri, 26 Aug 2005 00:01:00 -0000 From: James E Wilson User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.8) Gecko/20050511 MIME-Version: 1.0 To: Etienne Lorrain Cc: gcc@gcc.gnu.org Subject: Re: ia32: clearing a 7116 bytes struct inserted as "C.171.8759: .zero 7116 ... memcpy()" with gcc-4.0.2 References: <20050824111143.77253.qmail@web26901.mail.ukl.yahoo.com> In-Reply-To: <20050824111143.77253.qmail@web26901.mail.ukl.yahoo.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2005-08/txt/msg00781.txt.bz2 Etienne Lorrain wrote: > Investigated again a big increase of size going from GCC-3.4 to 4.x > (gcc (GCC) 4.0.2 20050811 (prerelease)) on my Gujin-v1.2, quickly way > to reproduce: If you want this fixed, you should file a bug report into our bugzilla database. Here is a quicker way to reproduce the problem. int sub (int i) { int array[1000000] = { 0 }; sub2 (&array[i]); } We are dumping the constructor to memory, and then doing a memcpy, when it would be much better to just do a memset. The culprit is code in expand_expr_real_1, case CONSTRUCTOR, which checks to see if we have a constructor of all constants, in which case we force it to the constant pool. Not a good idea if the constructor is a megabyte in size, and all of the elements are constant zero. I don't have a handy gcc-3.4.3 build tree, but it is apparently a VECTOR_TYPE check that prevents this code from triggering there. -- Jim Wilson, GNU Tools Support, http://www.specifix.com