I get the following ICE with -O -fPIC on m68k with 4.1. 3.4, 4.0 and 4.2 work. (sid)154:tbm@usurper: ~] /home/tbm/tmp/gcc/4.1-m68k/gcc/g++ -B/home/tbm/tmp/gcc/4.1-m68k/gcc -c -O -fPIC vtk-vtkImageMaskBits.cxx vtk-vtkImageMaskBits.cxx: In function 'void vtkImageMaskBitsExecute(vtkImageMaskBits*, vtkImageData*, vtkImageData*, int*, int, T*) [with T = short int]': vtk-vtkImageMaskBits.cxx:96: error: insn does not satisfy its constraints: (insn 86 218 87 11 (set (reg:HI 0 %d0 [59]) (and:HI (mem:HI (reg:SI 11 %a3) [0 S2 A16]) (reg:HI 0 %d0 [orig:58+2 ] [58]))) 170 {andhi3} (insn_list:REG_DEP_TRUE 85 (nil)) (nil)) vtk-vtkImageMaskBits.cxx:96: internal compiler error: in reload_cse_simplify_operands, at postreload.c:393 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. -B/home/tbm/tmp/gcc/4.1-m68k/gcc -c -O (sid)155:tbm@usurper: ~] /home/tbm/tmp/gcc/4.1-m68k/gcc/g++ -B/home/tbm/tmp/gcc/4.1-m68k/gcc -c -O vtk-vtkImageMaskBits.cxx (sid)156:tbm@usurper: ~]
Created attachment 12434 [details] testcase
The original preprocessed source shows the problem with 4.2 too.
Created attachment 12435 [details] preprocessed source
won't fix in GCC-4.0.x. Adjusting milestone.
Martin, is this a bug you can still reproduce with the current SVN trunk? If so, could you provide a backtrace from gdb?
(gdb) run -O -fPIC -quiet ~/vtk-vtkImageMaskBits.ii Starting program: /home/tbm/tmp/gcc/gcc-4.2-m68k-20071218-r131051/gcc/cc1plus -O -fPIC -quiet ~/vtk-vt kImageMaskBits.ii /home/tbm/vtk-vtkImageMaskBits.ii: In function ‘void vtkImageMaskBitsExecute(vtkImageMaskBits*, vtkIma geData*, vtkImageData*, int*, int, T*) [with T = short unsigned int]’: /home/tbm/vtk-vtkImageMaskBits.ii:33352: error: insn does not satisfy its constraints: (insn 207 446 208 26 (set (reg:HI 0 %d0 [88]) (and:HI (mem:HI (reg:SI 11 %a3) [0 S2 A16]) (reg:HI 0 %d0 [orig:87+2 ] [87]))) 238 {andhi3} (insn_list:REG_DEP_TRUE 206 (nil)) (nil)) Breakpoint 1, fancy_abort (file=0x81fc58 "gcc/postreload.c", line=392, function=0x820120 "reload_cse_simplify_operands") at gcc/diagnostic.c:640 640 { (gdb) where #0 fancy_abort (file=0x81fc58 "gcc/postreload.c", line=392, function=0x820120 "reload_cse_simplify_operands") at gcc/diagnostic.c:640 #1 0x000000000066dd82 in _fatal_insn (msgid=<value optimized out>, insn=0x2b7589b46820, file=0x81fc58 "gcc/postreload.c", line=392, function=0x820120 "reload_cse_simplify_operands") at gcc/rtl-error.c:119 #2 0x000000000066ddc7 in _fatal_insn_not_found (insn=0x188, file=0x820120 "reload_cse_simplify_operands", line=10, function=0xffffffff <Address 0xffffffff out of bounds>) at gcc/rtl-error.c:129 #3 0x000000000072c7a7 in reload_cse_simplify_operands (insn=0x2b7589b46820, testreg=0x2b7589b5f360) at gcc/postreload.c:392 #4 0x000000000072c932 in reload_cse_regs_1 (first=0xffffffff) at gcc/postreload.c:171 #5 0x000000000072c9a8 in reload_cse_regs (first=0x81fc58) at gcc/postreload.c:67 #6 0x000000000072d7b1 in rest_of_handle_postreload () at gcc/postreload.c:1578 #7 0x00000000006a0408 in execute_one_pass (pass=0x98c3e0) at gcc/passes.c:881 #8 0x00000000006a056c in execute_pass_list (pass=0x98c3e0) at gcc/passes.c:932 #9 0x00000000006a057e in execute_pass_list (pass=0x98aa60) at gcc/passes.c:933 ---Type <return> to continue, or q <return> to quit--- #10 0x00000000006a057e in execute_pass_list (pass=0x98aa00) at gcc/passes.c:933 #11 0x00000000004d0a1e in tree_rest_of_compilation (fndecl=0x2b758948ee00) at gcc/tree-optimize.c:462 #12 0x0000000000473949 in expand_body (fn=0x2b758948ee00) at gcc/cp/semantics.c:3095 #13 0x00000000006cb374 in cgraph_expand_function (node=0x2b7589596f00) at gcc/cgraphunit.c:1243 #14 0x00000000006cbcb5 in cgraph_optimize () at gcc/cgraphunit.c:1308 #15 0x00000000004414af in cp_finish_file () at gcc/cp/decl2.c:3355 #16 0x00000000004b64ba in c_common_parse_file (set_yydebug=<value optimized out>) at gcc/c-opts.c:1182 #17 0x0000000000682628 in toplev_main (argc=<value optimized out>, argv=<value optimized out>) at gcc/toplev.c:1032 #18 0x00002b758670a4ca in __libc_start_main () from /lib/libc.so.6 #19 0x000000000040273a in _start () at ../sysdeps/x86_64/elf/start.S:113 (gdb)
Works with 4.3.0 20071219.
Closing 4.1 branch.
Closing 4.2 branch, fixed in 4.3.