From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6517 invoked by alias); 8 May 2003 01:56:01 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 6485 invoked by uid 71); 8 May 2003 01:56:00 -0000 Resent-Date: 8 May 2003 01:56:00 -0000 Resent-Message-ID: <20030508015600.6484.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org Resent-Reply-To: gcc-gnats@gcc.gnu.org, hzoli@hzoli.2y.net Received: (qmail 6381 invoked from network); 8 May 2003 01:49:45 -0000 Received: from unknown (HELO hzoli.austin.ibm.com) (208.180.20.158) by sources.redhat.com with SMTP; 8 May 2003 01:49:45 -0000 Received: from hzoli by hzoli.austin.ibm.com with local (Exim 3.36 #1 (Debian)) id 19DaXZ-0002hC-00; Wed, 07 May 2003 20:49:45 -0500 Message-Id: Date: Thu, 08 May 2003 01:56:00 -0000 From: hzoli@hzoli.2y.net To: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org X-Send-Pr-Version: 3.113 Subject: c/10675: Compile time increases quadratically with struct size X-SW-Source: 2003-05/txt/msg00538.txt.bz2 List-Id: >Number: 10675 >Category: c >Synopsis: Compile time increases quadratically with struct size >Confidential: no >Severity: critical >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Thu May 08 01:56:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Zoltan Hidvegi >Release: 3.2.3 (Debian testing/unstable) >Organization: >Environment: System: Linux hzoli 2.4.21-rc1-ac3 #1 Wed Apr 30 11:10:22 CDT 2003 i686 unknown unknown GNU/Linux Architecture: i686 host: i386-pc-linux-gnu build: i386-pc-linux-gnu target: i386-pc-linux-gnu configured with: ../src/configure -v --enable-languages=c,c++,java,f77,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.2 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-java-gc=boehm --enable-objc-gc i386-linux >Description: The compile time increases quadratically (actually more than quadratically) with the number of members in a struct. >How-To-Repeat: The following is a shell script that will generate a struct with a given number of members and instantiates a global variable of that type: ------- BEGIN biggen.sh ------------- #! /bin/sh let i=0 echo 'struct foo {' while [ "$i" -lt "$1" ] do echo "int i_$((i=i+1));" done echo '};' echo 'struct foo f;' --------- END biggen.sh ------------- Run it like this: ./biggen.sh 10000 > big.c; cc -c big.c Change the number from 10000 and see how the compile time is affected. E.g. on my 1.73GHz Athlon, 5000 members take 1.66s, 10000 takes 8.5s and 20000 takes 35.91s. Unfortunately, I need to compile a generated struct with several hundred thousand members, which is not feasible. >Fix: >Release-Note: >Audit-Trail: >Unformatted: