I get this ICE with the Debian gcc revision 4.7.0-8. g++ -I../Engine -I../Common -I../Common/libinclude -mcmodel=large -DTHIS_IS_THE_ENGINE -DLINUX_VERSION -c -o ac.o ac.cpp ac.cpp:29287:1: error: unrecognizable insn: (call_insn/j 3 2 4 (call (mem:QI (symbol_ref:DI ("*.LTHUNK0") [flags 0x3] <function_decl 0x7ffff4dd8100 *.LTHUNK0>) [0 S1 A8]) (const_int 0 [0])) -1 (nil) (nil)) ac.cpp:29287:1: internal compiler error: in insn_default_length, at config/i386/i386.md:529 Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.7/README.Bugs> for instructions. Preprocessed source stored into /tmp/ccpP8zhz.out file, please attach this to your bugreport.
Created attachment 27718 [details] preprocessed source
Can you please test following patch: --cut here-- Index: config/i386/i386.c =================================================================== --- config/i386/i386.c (revision 189101) +++ config/i386/i386.c (working copy) @@ -33056,6 +33056,13 @@ x86_output_mi_thunk (FILE *file, emit_jump_insn (gen_indirect_jump (fnaddr)); else { + if (!sibcall_insn_operand (fnaddr, Pmode)) + { + tmp = gen_rtx_REG (Pmode, R10_REG); + emit_move_insn (tmp, fnaddr); + fnaddr = tmp; + } + tmp = gen_rtx_MEM (QImode, fnaddr); tmp = gen_rtx_CALL (VOIDmode, tmp, const0_rtx); tmp = emit_call_insn (tmp); --cut here--
Patch at [1]. [1] http://gcc.gnu.org/ml/gcc-patches/2012-07/msg00084.html
Sorry, I won't get around to compile gcc (never done that yet) and test it.
Author: uros Date: Tue Jul 3 11:58:12 2012 New Revision: 189218 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189218 Log: PR target/53811 * config/i386/i386.c (x86_output_mi_thunk): Check if fnaddr satisfies sibcall_insn_operand. Move it to a temporary register if not. testsuite/ChangLog: PR target/53811 * g++.dg/other/pr53811.C: New test. Added: trunk/gcc/testsuite/g++.dg/other/pr53811.C Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/i386.c trunk/gcc/testsuite/ChangeLog
g++.dg/other/pr53811.C fails on x86_64-apple-darwin10 with -m64: FAIL: g++.dg/other/pr53811.C -std=gnu++98 (internal compiler error) FAIL: g++.dg/other/pr53811.C -std=gnu++98 (test for excess errors) FAIL: g++.dg/other/pr53811.C -std=gnu++11 (internal compiler error) FAIL: g++.dg/other/pr53811.C -std=gnu++11 (test for excess errors) The ICE is Excess errors: /opt/gcc/work/gcc/testsuite/g++.dg/other/pr53811.C:29:1: error: insn does not satisfy its constraints: (insn 3 2 4 (set (reg:DI 59) (const:DI (unspec:DI [ (symbol_ref:DI ("_ZN12ScriptString12CreateStringEPKc") [flags 0x403] <function_decl 0x142987100 CreateString>) ] UNSPEC_GOTOFF))) 62 {*movdi_internal_rex64} (nil)) Should I open a new PR? Note that ' -mcmodel=large' seems to have issues on x86_64-apple-darwin10: see pr50077.
(In reply to comment #6) > Should I open a new PR? Yes, please. I will wait with the 4.7 backport until new PR resolves. > Note that ' -mcmodel=large' seems to have issues on x86_64-apple-darwin10: see > pr50077. TBH, -mcmodel=large is currently an overkill, but fixes are fairly trivial (pushing address to temporary reg).
Author: uros Date: Fri Jul 6 10:00:11 2012 New Revision: 189315 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189315 Log: PR target/53811 * config/i386/i386.c (x86_output_mi_thunk): For CM_LARGE_PIC model, emit PIC sequence for fnaddr symbol reference in advance. Modified: trunk/gcc/ChangeLog trunk/gcc/config/i386/i386.c
Author: uros Date: Tue Jul 10 17:53:48 2012 New Revision: 189412 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=189412 Log: Backport from mainline 2012-07-03 Uros Bizjak <ubizjak@gmail.com> PR target/53811 * config/i386/i386.c (x86_output_mi_thunk): Check if fnaddr satisfies sibcall_insn_operand. Move it to a temporary register if not. 2012-07-06 Uros Bizjak <ubizjak@gmail.com> PR target/53853 * config/i386/i386.c (x86_output_mi_thunk): For CM_LARGE_PIC model, emit PIC sequence for fnaddr symbol reference in advance. testsuite/ChangeLog: Backport from mainline 2012-07-03 Uros Bizjak <ubizjak@gmail.com> PR target/53811 * g++.dg/other/pr53811.C: New test. Added: branches/gcc-4_7-branch/gcc/testsuite/g++.dg/other/pr53811.C Modified: branches/gcc-4_7-branch/gcc/ChangeLog branches/gcc-4_7-branch/gcc/config/i386/i386.c branches/gcc-4_7-branch/gcc/testsuite/ChangeLog
Fixed.