From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7168 invoked by alias); 27 Aug 2010 13:44:41 -0000 Received: (qmail 7145 invoked by uid 22791); 27 Aug 2010 13:44:37 -0000 X-SWARE-Spam-Status: No, hits=1.1 required=5.0 tests=BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RCVD_IN_DNSWL_NONE,TW_CX,TW_GC,TW_IB,TW_LG,TW_LR X-Spam-Check-By: sourceware.org Received: from cpoproxy1-pub.bluehost.com (HELO cpoproxy1-pub.bluehost.com) (69.89.21.11) by sourceware.org (qpsmtpd/0.43rc1) with SMTP; Fri, 27 Aug 2010 13:44:30 +0000 Received: (qmail 27285 invoked by uid 0); 27 Aug 2010 13:44:28 -0000 Received: from unknown (HELO box267.bluehost.com) (69.89.31.67) by cpoproxy1.bluehost.com with SMTP; 27 Aug 2010 13:44:28 -0000 Received: from ool-44c4717d.dyn.optonline.net ([68.196.113.125] helo=server02.sensorrealtime.com) by box267.bluehost.com with esmtpa (Exim 4.69) (envelope-from ) id 1OozEK-0000ln-1D for gcc@gcc.gnu.org; Fri, 27 Aug 2010 07:44:28 -0600 Received: from [192.168.1.100] (unknown [192.168.1.100]) (Authenticated sender: corey@materialintelligencellc.com) by server02.sensorrealtime.com (Postfix) with ESMTPSA id E93489F224F for ; Fri, 27 Aug 2010 09:44:26 -0400 (EDT) Subject: Better performance on older version of GCC From: Corey Kasten To: gcc@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Date: Fri, 27 Aug 2010 13:50:00 -0000 Message-ID: <1282916665.2100.39.camel@MILLC-COREY> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Identified-User: {791:box267.bluehost.com:materia7:materialintelligencellc.com} {sentby:smtp auth 68.196.113.125 authed with mailgateway@materialintelligencellc.com} Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2010-08/txt/msg00392.txt.bz2 Hello all, I have two computers with two different versions of GCC. Otherwise the two systems have identical hardware. I have a processor and memory intensive benchmark program which I compile on both systems and I cannot understand why the system with older GCC version compiles faster code. System A has GCC version "4.1.2 20070925 (Red Hat 4.1.2-33)" System B has GCC version "4.3.0 20080428 (Red Hat 4.3.0-8)" I find that the executable compiled on system A runs faster (on both systems) than the executable compiled on system B (on both system), by a factor about approximately 4 times. I have attempted to play with the GCC optimizer flags and have not been able to get System B (with the later GCC version) to compile code with any better performance. Could someone please help figure this out? Below is the GCC command I run on System A followed by the verbose output: gcc -v -Wall -DOFFLINE_WEIGHTS -DDOUBLEP -g bfbenchmark_threaded.c -lm -lrt -lpthread -O3 -o bfbenchmark_threaded ---------------------------BEGIN OUTPUT--------------------------------- Using built-in specs. Target: i386-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,objc,obj-c ++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --with-cpu=generic --host=i386-redhat-linux Thread model: posix gcc version 4.1.2 20070925 (Red Hat 4.1.2-33) /usr/libexec/gcc/i386-redhat-linux/4.1.2/cc1 -quiet -v -DOFFLINE_WEIGHTS -DDOUBLEP bfbenchmark_threaded.c -quiet -dumpbase bfbenchmark_threaded.c -mtune=generic -auxbase bfbenchmark_threaded -g -O3 -Wall -version -o /tmp/ccvxPCd0.s ignoring nonexistent directory "/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../../i386-redhat-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/lib/gcc/i386-redhat-linux/4.1.2/include /usr/include End of search list. GNU C version 4.1.2 20070925 (Red Hat 4.1.2-33) (i386-redhat-linux) compiled by GNU C version 4.1.2 20070925 (Red Hat 4.1.2-33). GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: ab322ce5b87a7c6c23d60970ec7b7b31 as -V -Qy -o /tmp/ccU8kZL1.o /tmp/ccvxPCd0.s GNU assembler version 2.17.50.0.18 (i386-redhat-linux) using BFD version version 2.17.50.0.18-1 20070731 /usr/libexec/gcc/i386-redhat-linux/4.1.2/collect2 --eh-frame-hdr --build-id -m elf_i386 --hash-style=gnu -dynamic-linker /lib/ld-linux.so.2 -o bfbenchmark_threaded /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crt1.o /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crti.o /usr/lib/gcc/i386-redhat-linux/4.1.2/crtbegin.o -L/usr/lib/gcc/i386-redhat-linux/4.1.2 -L/usr/lib/gcc/i386-redhat-linux/4.1.2 -L/usr/lib/gcc/i386-redhat-linux/4.1.2/../../.. /tmp/ccU8kZL1.o -lm -lrt -lpthread -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/i386-redhat-linux/4.1.2/crtend.o /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crtn.o ---------------------------END OUTPUT--------------------------------- Below is the GCC command I run on System A followed by the verbose output: gcc -v -Wall -DOFFLINE_WEIGHTS -DDOUBLEP -g bfbenchmark_threaded.c -lm -lrt -lpthread -O3 -o bfbenchmark_threaded ---------------------------BEGIN OUTPUT--------------------------------- Using built-in specs. Target: i386-redhat-linux Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-languages=c,c++,objc,obj-c++,java,fortran,ada --enable-java-awt=gtk --disable-dssi --enable-plugin --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-1.5.0.0/jre --enable-libgcj-multifile --enable-java-maintainer-mode --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --disable-libjava-multilib --with-cpu=generic --build=i386-redhat-linux Thread model: posix gcc version 4.3.0 20080428 (Red Hat 4.3.0-8) (GCC) COLLECT_GCC_OPTIONS='-v' '-Wall' '-DOFFLINE_WEIGHTS' '-DDOUBLEP' '-g' '-O3' '-o' 'bfbenchmark_threaded' '-mtune=generic' /usr/libexec/gcc/i386-redhat-linux/4.3.0/cc1 -quiet -v -DOFFLINE_WEIGHTS -DDOUBLEP bfbenchmark_threaded.c -quiet -dumpbase bfbenchmark_threaded.c -mtune=generic -auxbase bfbenchmark_threaded -g -O3 -Wall -version -o /tmp/ccB4B5PI.s ignoring nonexistent directory "/usr/lib/gcc/i386-redhat-linux/4.3.0/include-fixed" ignoring nonexistent directory "/usr/lib/gcc/i386-redhat-linux/4.3.0/../../../../i386-redhat-linux/include" #include "..." search starts here: #include <...> search starts here: /usr/local/include /usr/lib/gcc/i386-redhat-linux/4.3.0/include /usr/include End of search list. GNU C (GCC) version 4.3.0 20080428 (Red Hat 4.3.0-8) (i386-redhat-linux) compiled by GNU C version 4.3.0 20080428 (Red Hat 4.3.0-8), GMP version 4.2.2, MPFR version 2.3.0-p2. GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: a6100d27c113f078654b8bcf6e8eb1d2 COLLECT_GCC_OPTIONS='-v' '-Wall' '-DOFFLINE_WEIGHTS' '-DDOUBLEP' '-g' '-O3' '-o' 'bfbenchmark_threaded' '-mtune=generic' as -V -Qy -o /tmp/ccoiU9Dv.o /tmp/ccB4B5PI.s GNU assembler version 2.18.50.0.6 (i386-redhat-linux) using BFD version version 2.18.50.0.6-2 20080403 COMPILER_PATH=/usr/libexec/gcc/i386-redhat-linux/4.3.0/:/usr/libexec/gcc/i386-redhat-linux/4.3.0/:/usr/libexec/gcc/i386-redhat-linux/:/usr/lib/gcc/i386-redhat-linux/4.3.0/:/usr/lib/gcc/i386-redhat-linux/:/usr/libexec/gcc/i386-redhat-linux/4.3.0/:/usr/libexec/gcc/i386-redhat-linux/:/usr/lib/gcc/i386-redhat-linux/4.3.0/:/usr/lib/gcc/i386-redhat-linux/ LIBRARY_PATH=/usr/lib/gcc/i386-redhat-linux/4.3.0/:/usr/lib/gcc/i386-redhat-linux/4.3.0/:/usr/lib/gcc/i386-redhat-linux/4.3.0/../../../:/lib/:/usr/lib/ COLLECT_GCC_OPTIONS='-v' '-Wall' '-DOFFLINE_WEIGHTS' '-DDOUBLEP' '-g' '-O3' '-o' 'bfbenchmark_threaded' '-mtune=generic' /usr/libexec/gcc/i386-redhat-linux/4.3.0/collect2 --eh-frame-hdr --build-id -m elf_i386 --hash-style=gnu -dynamic-linker /lib/ld-linux.so.2 -o bfbenchmark_threaded /usr/lib/gcc/i386-redhat-linux/4.3.0/../../../crt1.o /usr/lib/gcc/i386-redhat-linux/4.3.0/../../../crti.o /usr/lib/gcc/i386-redhat-linux/4.3.0/crtbegin.o -L/usr/lib/gcc/i386-redhat-linux/4.3.0 -L/usr/lib/gcc/i386-redhat-linux/4.3.0 -L/usr/lib/gcc/i386-redhat-linux/4.3.0/../../.. /tmp/ccoiU9Dv.o -lm -lrt -lpthread -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/i386-redhat-linux/4.3.0/crtend.o /usr/lib/gcc/i386-redhat-linux/4.3.0/../../../crtn.o ---------------------------END OUTPUT--------------------------------- Thanks in advance for your help, Corey