From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5458 invoked by alias); 5 Mar 2010 23:40:43 -0000 Received: (qmail 5449 invoked by uid 22791); 5 Mar 2010 23:40:41 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40 X-Spam-Check-By: sourceware.org Received: from mail-fx0-f210.google.com (HELO mail-fx0-f210.google.com) (209.85.220.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Mar 2010 23:40:37 +0000 Received: by fxm2 with SMTP id 2so5136263fxm.16 for ; Fri, 05 Mar 2010 15:40:34 -0800 (PST) MIME-Version: 1.0 Received: by 10.239.187.139 with SMTP id l11mr91473hbh.96.1267832434590; Fri, 05 Mar 2010 15:40:34 -0800 (PST) Date: Fri, 05 Mar 2010 23:40:00 -0000 Message-ID: Subject: Problem with GCC 4.3.2 From: Tim Hartley To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2010-03/txt/msg00093.txt.bz2 I'm having trouble with the optimization options on GCC 4.3.2; it causes a segmentation fault. My question is, what is happening in -O1 that I can't see in --help=optimizers? The brief version is that I am using a middleware application to run a distributed application using mvapich 1.1. Due to the complexity, it's unlikely I'd ever be able to file a real bug report, due to the problems of following the bug reporting guidelines. I don't mind just working around the problem and removing the offending compiler optimization switch, but even doing that doesn't work as I expect. More details: $ uname -a Linux ac.ncsa.uiuc.edu 2.6.27.41-170.2.117.fc10.x86_64 #1 SMP Thu Dec 10 10:36:29 EST 2009 x86_64 x86_64 x86_64 GNU/Linux $ cat /etc/redhat-release Fedora release 10 (Cambridge) $ gcc -v Using built-in specs. Target: x86_64-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=x86_64-redhat-linux Thread model: posix gcc version 4.3.2 20081105 (Red Hat 4.3.2-7) (GCC) When I use -O1 to compile my middleware (where the error occurs), I get a segmentation fault. Using -O0 or simply not including any -O option doesn't. When I look at the options as suggested in the manpage: g++ -c -Q -O1 --help=optimizers > O1-opts I can then simply enable all of them by hand. The funny thing is that this passes! So my question is, what is happening in -O1 that I can't see in --help=optimizers? Here's what options are enabled with -O1 $ cat O1-opts The following options control optimizations: -falign-jumps [disabled] -falign-labels [disabled] -falign-loops [enabled] -fargument-alias [enabled] -fargument-noalias [disabled] -fargument-noalias-anything [disabled] -fargument-noalias-global [disabled] -fasynchronous-unwind-tables [enabled] -fbranch-count-reg [enabled] -fbranch-probabilities [disabled] -fbranch-target-load-optimize [disabled] -fbranch-target-load-optimize2 [disabled] -fbtr-bb-exclusive [disabled] -fcaller-saves [disabled] -fcommon [enabled] -fcprop-registers [enabled] -fcrossjumping [disabled] -fcse-follow-jumps [disabled] -fcse-skip-blocks [disabled] -fcx-limited-range [disabled] -fdata-sections [disabled] -fdce [enabled] -fdefer-pop [enabled] -fdelayed-branch [disabled] -fdelete-null-pointer-checks [disabled] -fdse [enabled] -fearly-inlining [enabled] -fexceptions [disabled] -fexpensive-optimizations [disabled] -ffinite-math-only [disabled] -ffloat-store [disabled] -fforward-propagate [disabled] -fgcse [disabled] -fgcse-after-reload [disabled] -fgcse-las [disabled] -fgcse-lm [enabled] -fgcse-sm [disabled] -fguess-branch-probability [enabled] -fhandle-exceptions -fif-conversion [enabled] -fif-conversion2 [enabled] -finline-functions [disabled] -finline-functions-called-once [enabled] -finline-small-functions [disabled] -fipa-cp [disabled] -fipa-matrix-reorg [disabled] -fipa-pta [disabled] -fipa-pure-const [enabled] -fipa-reference [enabled] -fipa-type-escape [disabled] -fivopts [enabled] -fjump-tables [enabled] -fmerge-all-constants [disabled] -fmerge-constants [enabled] -fmodulo-sched [disabled] -fmove-loop-invariants [enabled] -fnon-call-exceptions [disabled] -fomit-frame-pointer [enabled] -foptimize-register-move [disabled] -foptimize-sibling-calls [disabled] -fpack-struct [disabled] -fpack-struct= -fpeel-loops [disabled] -fpeephole [enabled] -fpeephole2 [disabled] -fpredictive-commoning [disabled] -fprefetch-loop-arrays [disabled] -freg-struct-return [disabled] -fregmove [disabled] -frename-registers [enabled] -freorder-blocks [disabled] -freorder-blocks-and-partition [disabled] -freorder-functions [disabled] -frerun-cse-after-loop [enabled] -freschedule-modulo-scheduled-loops [disabled] -frounding-math [disabled] -frtl-abstract-sequences [disabled] -frtti -fsched-interblock [enabled] -fsched-spec [enabled] -fsched-spec-load [disabled] -fsched-spec-load-dangerous [disabled] -fsched-stalled-insns [disabled] -fsched-stalled-insns-dep [enabled] -fsched2-use-superblocks [disabled] -fsched2-use-traces [disabled] -fschedule-insns [disabled] -fschedule-insns2 [disabled] -fsection-anchors [disabled] -fshort-double -fshort-enums -fshort-wchar -fsignaling-nans [disabled] -fsigned-zeros [enabled] -fsingle-precision-constant [disabled] -fsplit-ivs-in-unroller [enabled] -fsplit-wide-types [enabled] -fstrict-aliasing [disabled] -fthread-jumps [disabled] -fno-threadsafe-statics -ftoplevel-reorder [enabled] -ftrapping-math [enabled] -ftrapv [disabled] -ftree-ccp [enabled] -ftree-ch [enabled] -ftree-copy-prop [enabled] -ftree-copyrename [enabled] -ftree-cselim [enabled] -ftree-dce [enabled] -ftree-dominator-opts [enabled] -ftree-dse [enabled] -ftree-fre [enabled] -ftree-loop-im [enabled] -ftree-loop-ivcanon [enabled] -ftree-loop-linear [disabled] -ftree-loop-optimize [enabled] -ftree-lrs [disabled] -ftree-pre [disabled] -ftree-reassoc [enabled] -ftree-salias [enabled] -ftree-scev-cprop [enabled] -ftree-sink [enabled] -ftree-sra [enabled] -ftree-store-ccp [disabled] -ftree-ter [enabled] -ftree-vect-loop-version [enabled] -ftree-vectorize [disabled] -ftree-vrp [disabled] -funit-at-a-time [enabled] -funroll-all-loops [disabled] -funroll-loops [disabled] -funsafe-loop-optimizations [disabled] -funsafe-math-optimizations [disabled] -funswitch-loops [disabled] -funwind-tables [disabled] -fvar-tracking [enabled] -fvar-tracking-uninit [disabled] -fvariable-expansion-in-unroller [disabled] -fvect-cost-model [enabled] -fvpt [disabled] -fweb [enabled] -fwhole-program [disabled] -fwrapv [disabled] I've never had this type of problem before, and I've used the middleware with GCC 4.1.2 and -O3. Please let me know what else I can do to help sort out this problem. Tim