From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32181 invoked by alias); 12 Jun 2012 04:40:58 -0000 Received: (qmail 31769 invoked by uid 22791); 12 Jun 2012 04:40:51 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KAM_STOCKTIP,TW_CF,TW_CX,TW_MX,TW_TM,TW_XC X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 12 Jun 2012 04:40:36 +0000 From: "satyaprakash.prasad at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53641] New: gcc/config/i386/crtfastmath.c gives internal compiler error: Segmentation fault during make Date: Tue, 12 Jun 2012 04:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: satyaprakash.prasad at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-06/txt/msg00648.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53641 Bug #: 53641 Summary: gcc/config/i386/crtfastmath.c gives internal compiler error: Segmentation fault during make Classification: Unclassified Product: gcc Version: 4.1.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: satyaprakash.prasad@gmail.com I was trying to write a new pass in GCC 4.1.2 version but surprisingly I am getting abort during my GCC build. The new code which I have written has compiled but issues occurs while compiling gcc/config/i386/crtfastmath.c. Below is th output I am trying via command line which is exactly what is run while make. gcc/gcc-4.1.2 1011> /x/home/satprasad/shared_scripts/bin/gcc/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/xgcc -B/x/home/satprasad/shared_scripts/bin/gcc/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/ -B/usr/local/x86_64-unknown-linux-gnu/bin/ -B/usr/local/x86_64-unknown-linux-gnu/lib/ -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include -O2 -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -isystem -g -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -msse -save-temps -v -c gcc/config/i386/crtfastmath.c -o crtfastmath.o Reading specs from /x/home/satprasad/shared_scripts/bin/gcc/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/specs Target: x86_64-unknown-linux-gnu Configured with: ./configure --with-gmp-lib=/usr/lib64 --with-mpfr-lib=/usr/lib64 --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-languages=c,c++ Thread model: posix gcc version 4.1.2 /x/home/satprasad/shared_scripts/bin/gcc/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/cc1 -E -quiet -v -iprefix /x/home/satprasad/shared_scripts/bin/gcc/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../lib/gcc/x86_64-unknown-linux-gnu/4.1.2/ -isystem /x/home/satprasad/shared_scripts/bin/gcc/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/include -DIN_GCC -DHAVE_GTHR_DEFAULT -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED -isystem /usr/local/x86_64-unknown-linux-gnu/include -isystem /usr/local/x86_64-unknown-linux-gnu/sys-include -isystem -g gcc/config/i386/crtfastmath.c -msse -mtune=k8 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -O2 -fpch-preprocess -o crtfastmath.i ignoring nonexistent directory "/usr/local/x86_64-unknown-linux-gnu/include" ignoring nonexistent directory "/usr/local/x86_64-unknown-linux-gnu/sys-include" ignoring nonexistent directory "-g" ignoring nonexistent directory "/x/home/satprasad/shared_scripts/bin/gcc/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../lib/gcc/x86_64-unknown-linux-gnu/4.1.2/include" ignoring nonexistent directory "/x/home/satprasad/shared_scripts/bin/gcc/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/../lib/gcc/x86_64-unknown-linux-gnu/4.1.2/../../../../x86_64-unknown-linux-gnu/include" ignoring nonexistent directory "NONE/include" ignoring nonexistent directory "/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.1.2/include" ignoring nonexistent directory "/usr/local/lib/../x86_64-unknown-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /x/home/satprasad/shared_scripts/bin/gcc/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/include /usr/local/include /usr/include End of search list. /x/home/satprasad/shared_scripts/bin/gcc/gcc-4.1.2/host-x86_64-unknown-linux-gnu/gcc/cc1 -fpreprocessed crtfastmath.i -quiet -dumpbase crtfastmath.c -msse -mtune=k8 -auxbase-strip crtfastmath.o -O2 -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition -version -o crtfastmath.s GNU C version 4.1.2 (x86_64-unknown-linux-gnu) compiled by GNU C version 4.1.2 20080704 (Red Hat 4.1.2-46). GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 9c3542c4e389570e9f26c3f53d3037d2 gcc/config/i386/crtfastmath.c:110: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. gcc/gcc-4.1.2 1014> cat crtfastmath.i # 1 "gcc/config/i386/crtfastmath.c" # 1 "" # 1 "" # 1 "gcc/config/i386/crtfastmath.c" # 40 "gcc/config/i386/crtfastmath.c" static void __attribute__((constructor)) set_fast_math (void) { # 106 "gcc/config/i386/crtfastmath.c" unsigned int mxcsr = __builtin_ia32_stmxcsr (); mxcsr |= (1 << 6) | (1 << 15); __builtin_ia32_ldmxcsr (mxcsr); } gcc/gcc-4.1.2 1015> cat crtfastmath.s .file "crtfastmath.c" gcc/gcc-4.1.2 1016> gcc/gcc-4.1.2 1016> uname -a Linux xxxxxxx 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux gcc/gcc-4.1.2 1017> One thing I am anot sure and would be worth mentioning that when I just have a fprintf("Test"); in my new pass - the error was not reproducable - though I am sure I have no issues with my pass. Below is the code: gcc/gcc-4.1.2 1017> cat gcc/gimple-manipulation.c #include "config.h" #include "system.h" #include "coretypes.h" #include "tm.h" #include "ggc.h" #include "flags.h" #include "tree.h" #include "basic-block.h" #include "tree-flow.h" #include "tree-pass.h" #include "tree-dump.h" #include "timevar.h" #include "diagnostic.h" #include "cfgloop.h" #include "tree-scalar-evolution.h" #include "tree-ssa-propagate.h" #include "tree-chrec.h" static void execute_gimple_manipulation (void); static bool gate_gimple_manipulation (void); static void execute_gimple_manipulation (void) { basic_block bb = ENTRY_BLOCK_PTR; int bbcounter=0, stmtcounter; tree stmt; block_stmt_iterator si; /* traverse each basic block and print all statements */ gcc_assert (cfun != NULL); gcc_assert (cfun && current_function_decl); FOR_EACH_BB (bb){ /* in any order */ bbcounter++; printf("\n-> entering bb # %d (internal #: %d)\n", bbcounter, bb->index); stmtcounter=0; for(si = bsi_start(bb); !bsi_end_p(si); bsi_next(&si)){ stmtcounter++; printf(" encountering statement #%2d: ", stmtcounter); stmt = bsi_stmt(si); print_generic_stmt (stderr, stmt, 0); } } } /* ------------------------------------------ Return true if we should execute our pass. ------------------------------------------*/ static bool gate_gimple_manipulation (void) { return (!(errorcount || sorrycount)); } struct tree_opt_pass pass_gimple_manipulation = { "gm_pass_simple", /* name */ gate_gimple_manipulation, /* gate */ execute_gimple_manipulation, /* execute */ NULL, /* sub */ NULL, /* next */ 0, /* static pass number */ 0, /* tv_id */ PROP_cfg | PROP_ssa | PROP_alias, /* properties required */ 0, /* properties provided */ 0, /* properties destroyed */ 0, /* todo_flags start */ TODO_dump_func, /* todo_flags finish */ 0 /* letter */ }; Please let me know if you require any other info?