From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22579 invoked by alias); 17 Sep 2010 23:18:32 -0000 Received: (qmail 22545 invoked by uid 48); 17 Sep 2010 23:18:20 -0000 Date: Fri, 17 Sep 2010 23:18:00 -0000 Subject: [Bug middle-end/45712] New: Segmentation violation when compiling spec source on either x86 or ppc with debugging X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "meissner at gcc dot gnu dot org" 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: 2010-09/txt/msg02037.txt.bz2 The attached file that is derived from the spec 2006 benchmark suite fails if you compile it with minimal optimization and -g. If I remove the -g option, it compiles fine. I initially noticed this on powerpc64-linux-gnu, but it looked like a machine independent bug, so I tried it on a x86_64-unknown-linux-gnu system. The debugger trace is: Current directory is /home/meissner/fsf-build-x86_64/trunk/gcc/ GNU gdb (GDB) Fedora (7.1-34.fc13) Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-redhat-linux-gnu". For bug reporting instructions, please see: ... Reading symbols from /data/meissner/fsf-build-x86_64/trunk/gcc/cc1...done. Breakpoint 1 at 0x5bc070: file /home/meissner/fsf-src/trunk/gcc/diagnostic.c, line 878. Breakpoint 2 at 0x5bce30: file /home/meissner/fsf-src/trunk/gcc/diagnostic.c, line 819. Breakpoint 3 at 0x483bd8 Breakpoint 4 at 0x483568 (gdb) r -O -g -quiet foo2.c Starting program: /data/meissner/fsf-build-x86_64/trunk/gcc/cc1 -O -g -quiet foo2.c Program received signal SIGSEGV, Segmentation fault. 0x0000000000bcbb98 in get_symbol_constant_value (sym=0x7ffff06aa640) at /home/meissner/fsf-src/trunk/gcc/gimple-fold.c:67 Missing separate debuginfos, use: debuginfo-install glibc-2.12-3.x86_64 libgcc-4.4.4-10.fc13.x86_64 libstdc++-4.4.4-10.fc13.x86_64 (gdb) where #0 0x0000000000bcbb98 in get_symbol_constant_value (sym=0x7ffff06aa640) at /home/meissner/fsf-src/trunk/gcc/gimple-fold.c:67 #1 0x0000000000bcbf5f in maybe_fold_reference (expr=0x7ffff05e7a80, is_lhs=0 '\000') at /home/meissner/fsf-src/trunk/gcc/gimple-fold.c:554 #2 0x0000000000bcf428 in fold_stmt_1 (gsi=0x7fffffffc3f0, inplace=) at /home/meissner/fsf-src/trunk/gcc/gimple-fold.c:1559 #3 0x0000000000a00e34 in fold_marked_statements (first=34, statements=0x132ce20) at /home/meissner/fsf-src/trunk/gcc/tree-inline.c:4115 #4 0x0000000000a086c5 in optimize_inline_calls (fn=0x7ffff0557500) at /home/meissner/fsf-src/trunk/gcc/tree-inline.c:4214 #5 0x00000000009dd62f in inline_transform (node=) at /home/meissner/fsf-src/trunk/gcc/ipa-inline.c:2165 #6 inline_transform (node=) at /home/meissner/fsf-src/trunk/gcc/ipa-inline.c:2139 #7 0x000000000073b619 in execute_one_ipa_transform_pass () at /home/meissner/fsf-src/trunk/gcc/passes.c:1473 #8 execute_all_ipa_transforms () at /home/meissner/fsf-src/trunk/gcc/passes.c:1504 #9 0x000000000083454d in tree_rest_of_compilation (fndecl=0x7ffff0557500) at /home/meissner/fsf-src/trunk/gcc/tree-optimize.c:445 #10 0x00000000009d2326 in cgraph_expand_function (node=0x7ffff0757d70) at /home/meissner/fsf-src/trunk/gcc/cgraphunit.c:1469 #11 0x00000000009d4d2a in cgraph_expand_all_functions () at /home/meissner/fsf-src/trunk/gcc/cgraphunit.c:1548 #12 cgraph_optimize () at /home/meissner/fsf-src/trunk/gcc/cgraphunit.c:1804 #13 0x00000000009d528a in cgraph_finalize_compilation_unit () at /home/meissner/fsf-src/trunk/gcc/cgraphunit.c:1012 #14 0x00000000004adfa4 in c_write_global_declarations () at /home/meissner/fsf-src/trunk/gcc/c-decl.c:9732 #15 0x00000000007dbd5c in compile_file (argc=5, argv=0x7fffffffc978) at /home/meissner/fsf-src/trunk/gcc/toplev.c:967 #16 do_compile (argc=5, argv=0x7fffffffc978) at /home/meissner/fsf-src/trunk/gcc/toplev.c:2394 #17 toplev_main (argc=5, argv=0x7fffffffc978) at /home/meissner/fsf-src/trunk/gcc/toplev.c:2435 #18 0x0000003db681ec5d in __libc_start_main () from /lib64/libc.so.6 #19 0x0000000000494f19 in _start () (gdb) print sym $1 = (union tree_node *) 0x7ffff06aa640 (gdb) pt unit size align 64 symtab -260754336 alias set -1 canonical type 0x7ffff0750e70 fields unsigned DI file foo2.c line 98 col 9 size unit size align 64 offset_align 128 offset bit offset context chain > context chain > used public external common BLK file foo2.c line 109 col 3 size unit size align 64 chain > (gdb) print varpool_get_node (sym) $2 = (struct varpool_node *) 0x0 (gdb) quit A debugging session is active. Inferior 1 [process 20829] will be killed. Quit anyway? (y or n) y Debugger finished It fails because get_symbol_constant_value calls varpool_get_node, which in turns returns a NULL pointer. -- Summary: Segmentation violation when compiling spec source on either x86 or ppc with debugging Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: meissner at gcc dot gnu dot org GCC build triplet: x86_64-unknown-linux-gnu GCC host triplet: x86_64-unknown-linux-gnu GCC target triplet: x86_64-unknown-linux-gnu http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45712