This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

segfault in gcc/tree-cfgcleanup.c:156


[please keep me CCed]

Hi,

GNU C version 4.1.0 20051014 (experimental) (i686-linux-gnu)
compiled by GNU C version 4.0.2 20050808 (prerelease) (Ubuntu 4.0.1-4ubuntu9).

I'm seeing this with clean, current head:
1) unit-at-a-time, nocombine nowhole-program:

2) no-unit-at-a-time, -combine, -fwhole-program:
  is apparently the same (num_in_fnames is > 1, gcc doesn't warn that it
  will ignore no-unit-at-a-time.. see attached patch. Please cp it to
  gcc-patches if you think it's sensible)

Thus only looking at 1):
Program received signal SIGSEGV, Segmentation fault.
0x08317abf in cleanup_tree_cfg () at
../../../src/gcc/gcc/tree-cfgcleanup.c:156
156	  FOR_EACH_BB (bb)
(gdb) p bb
No symbol "bb" in current context.
(gdb) p cfun
$1 = (struct function *) 0x0
(gdb) bt
#0  0x08317abf in cleanup_tree_cfg () at
../../../src/gcc/gcc/tree-cfgcleanup.c:156
#1  0x0830b095 in execute_one_pass (pass=0x8491d00) at
../../../src/gcc/gcc/passes.c:827
#2  0x0830b195 in execute_pass_list (pass=0x8491d00) at
../../../src/gcc/gcc/passes.c:859
#3  0x0830b20a in execute_ipa_pass_list (pass=0x8491d40) at
../../../src/gcc/gcc/passes.c:881
#4  0x08343bc4 in cgraph_optimize () at
../../../src/gcc/gcc/cgraphunit.c:1221
#5  0x08056282 in c_write_global_declarations () at
../../../src/gcc/gcc/c-decl.c:7645
#6  0x082eef46 in toplev_main (argc=0, argv=0xbfd16cf4) at
../../../src/gcc/gcc/toplev.c:1003
#7  0xb7de2ea2 in __libc_start_main () from /lib/tls/i686/cmov/libc.so.6
#8  0x08049ae1 in _start () at ../sysdeps/i386/elf/start.S:119
(gdb) bt f
#0  0x08317abf in cleanup_tree_cfg () at
../../../src/gcc/gcc/tree-cfgcleanup.c:156
	retval = 0 '\0'
	changed = 0 '\0'
#1  0x0830b095 in execute_one_pass (pass=0x8491d00) at
../../../src/gcc/gcc/passes.c:827
	todo = 2958257104
#2  0x0830b195 in execute_pass_list (pass=0x8491d00) at
../../../src/gcc/gcc/passes.c:859
No locals.
#3  0x0830b20a in execute_ipa_pass_list (pass=0x8491d40) at
../../../src/gcc/gcc/passes.c:881
	node = (struct cgraph_node *) 0xb79b51a0
#4  0x08343bc4 in cgraph_optimize () at
../../../src/gcc/gcc/cgraphunit.c:1221
No locals.
#5  0x08056282 in c_write_global_declarations () at
../../../src/gcc/gcc/c-decl.c:7645
	tmp = 0xb7ce8000
	flags = -1076773718
	stream = Variable "stream" is not available.



arguments passed to gcc:
-o a.elf  -Os -Wall -Wstrict-prototypes -Wshadow -version -falign-functions=0 -falign-jumps=0 -falign-loops=0 -fomit-frame-pointer -funit-at-a-time -fno-mem-report -fno-time-report source001.c ... sources999.c

I take it that changing FOR_EACH_BB_FN to
(FN)?(FN)->cfg->x_entry_block_ptr->next_bb:NULL etc is not the correct
approach. Looks like we shouldn't get there in the first place.

Ideas?


Attachment: gcc.note_ignored-funit-at-a-time.diff
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]