Bug 29474 - [4.2 Regression] reload_cse_simplify_operands, at postreload.c:393 on m68k with -O -fPIC
Summary: [4.2 Regression] reload_cse_simplify_operands, at postreload.c:393 on m68k wi...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.1.2
: P5 normal
Target Milestone: 4.3.0
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2006-10-15 08:32 UTC by Martin Michlmayr
Modified: 2009-03-30 19:40 UTC (History)
5 users (show)

See Also:
Host:
Target: m68k-linux-gnu
Build:
Known to work: 3.4.6 4.0.3 4.3.0
Known to fail: 4.1.1 4.2.5
Last reconfirmed:


Attachments
testcase (741 bytes, text/plain)
2006-10-15 08:34 UTC, Martin Michlmayr
Details
preprocessed source (87.84 KB, application/octet-stream)
2006-10-15 08:37 UTC, Martin Michlmayr
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Michlmayr 2006-10-15 08:32:57 UTC
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: ~]
Comment 1 Martin Michlmayr 2006-10-15 08:34:17 UTC
Created attachment 12434 [details]
testcase
Comment 2 Martin Michlmayr 2006-10-15 08:36:10 UTC
The original preprocessed source shows the problem with 4.2 too.
Comment 3 Martin Michlmayr 2006-10-15 08:37:06 UTC
Created attachment 12435 [details]
preprocessed source
Comment 4 Gabriel Dos Reis 2007-02-03 20:39:29 UTC
won't fix in GCC-4.0.x.  Adjusting milestone.
Comment 5 Steven Bosscher 2007-12-18 20:34:04 UTC
Martin, is this a bug you can still reproduce with the current SVN trunk?  If so, could you provide a backtrace from gdb?
Comment 6 Martin Michlmayr 2007-12-19 02:07:31 UTC
(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)
Comment 7 Martin Michlmayr 2007-12-19 02:34:02 UTC
Works with 4.3.0 20071219.
Comment 8 Joseph S. Myers 2008-07-04 21:40:55 UTC
Closing 4.1 branch.
Comment 9 Joseph S. Myers 2009-03-30 19:40:21 UTC
Closing 4.2 branch, fixed in 4.3.