This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/9805] optimisation of largish array constant containing strings takes forever(?) and consumes very large amounts of memory
- From: "joost at lumatec dot be" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 2 Aug 2003 06:39:36 -0000
- Subject: [Bug optimization/9805] optimisation of largish array constant containing strings takes forever(?) and consumes very large amounts of memory
- References: <20030222190600.9805.tilps@hotmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=9805
------- Additional Comments From joost at lumatec dot be 2003-08-02 06:39 -------
I have a simular problem with my program, both with gcc-3.2 and gcc-3.3.
If I compile with -O0 it works fine.
If I compile with -O1 or higher it takes almost forever.
With -O0 with gcc-3.3 it takes 12 seconds on my PIII 800.
With -O1 with gcc-3.3 it takes 12 minutes!
With -O2 with gcc-3.3 it takes 24 minutes!
I have a large (+-350 entries) array of structs:
struct SCCPreset
{
char* name;
signed char shape[32];
};
which I initialize with generated code like this:
presets[236].name="Random Wave Form";
presets[236].shape[0]=-128;
presets[236].shape[1]=-56;
presets[236].shape[2]=32;
presets[236].shape[3]=127;
presets[236].shape[4]=48;
presets[236].shape[5]=-56;
presets[236].shape[6]=-128;
presets[236].shape[7]=-112;
presets[236].shape[8]=-88;
presets[236].shape[9]=-64;
presets[236].shape[10]=-32;
presets[236].shape[11]=0;
presets[236].shape[12]=32;
presets[236].shape[13]=56;
presets[236].shape[14]=80;
presets[236].shape[15]=96;
presets[236].shape[16]=112;
presets[236].shape[17]=120;
presets[236].shape[18]=124;
presets[236].shape[19]=127;
presets[236].shape[20]=124;
presets[236].shape[21]=120;
presets[236].shape[22]=112;
presets[236].shape[23]=96;
presets[236].shape[24]=80;
presets[236].shape[25]=56;
presets[236].shape[26]=32;
presets[236].shape[27]=0;
presets[236].shape[28]=-32;
presets[236].shape[29]=-64;
presets[236].shape[30]=-88;
presets[236].shape[31]=-112;
gcc specs:
gcc -v
Reading specs from /usr/lib/gcc-lib/i386-linux/3.3.1/specs
Configured with: ../src/configure -v
--enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr
--mandir=/usr/share/man --infodir=/usr/share/info
--with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib
--enable-nls --without-included-gettext --enable-__cxa_atexit
--enable-clocale=gnu --enable-debug --enable-java-gc=boehm
--enable-java-awt=xlib --enable-objc-gc i386-linux
Thread model: posix
gcc version 3.3.1 20030728 (Debian prerelease)
and:
gcc-3.2 -v
Reading specs from /usr/lib/gcc-lib/i386-linux/3.2.3/specs
Configured with: ../src/configure -v --enable-languages=c,c++,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-objc-gc i386-linux
Thread model: posix
gcc version 3.2.3 (Debian)
If needed I can provide you with my sample program.
Thanks, Joost Damad