gcc -O3 test.c --ipa-cp -m64 test.c: ======================================================== #include <stdio.h> int bar (int b, int c) { printf ("%d %d\n", b, c); } int foo (int a) { if (a++ > 0) bar (a, 3); foo (7); } int main () { foo (7); return 0; } ======================================================== test.c: In function âfooâ: test.c:16: error: unrecognizable insn: (call_insn/j 31 30 32 5 (parallel [ (set (reg:DI 3 3) (call (mem:SI (symbol_ref:DI ("T.10")) [0 S4 A8]) (const_int 64 [0x40]))) (use (const_int 0 [0x0])) (use (reg:SI 126)) (return) ]) -1 (nil) (expr_list:REG_EH_REGION (const_int 0 [0x0]) (nil)) (expr_list:REG_DEP_TRUE (use (reg:DI 3 3)) (nil)))
The ICE is due to a call to a versioned function that IPCP triggered. The call instruction is corrupted.
Here is a reduced testcase: int bar (int b, int c) { return 0; } int main () { bar (8, 4); return bar (7, 4); } ----- This is due to tail calls. > The call instruction is corrupted. No, it is not, it is correct. Just the function looks like it is not set to be right. Anyways I think the Function decl is messed up to begin with. With -O1, we get an indirect function call which is just wrong. .main: mflr 0 std 0,16(1) stdu 1,-112(1) li 3,7 li 4,4 ld 9,.LC0@toc(2) ld 0,0(9) mtctr 0 std 2,40(1) ld 2,8(9) ld 11,16(9) bctrl ld 2,40(1) addi 1,1,112 ld 0,16(1) mtlr 0 blr .LC0: .tc T.0[TC],T.0 .section ".text" I might bet this might have an issue on ppc-aix also even not in 64bit mode because that is a TOC based ABI also.
(In reply to comment #0) > gcc -O3 test.c --ipa-cp -m64 > test.c: > ======================================================== > #include <stdio.h> > int > bar (int b, int c) > { > printf ("%d %d\n", b, c); > } > int > foo (int a) > { > if (a++ > 0) > bar (a, 3); > foo (7); > } > int > main () > { > foo (7); > return 0; > } > ======================================================== > test.c: In function âfooâ: > test.c:16: error: unrecognizable insn: > (call_insn/j 31 30 32 5 (parallel [ > (set (reg:DI 3 3) > (call (mem:SI (symbol_ref:DI ("T.10")) [0 S4 A8]) > (const_int 64 [0x40]))) > (use (const_int 0 [0x0])) > (use (reg:SI 126)) > (return) > ]) -1 (nil) > (expr_list:REG_EH_REGION (const_int 0 [0x0]) > (nil)) > (expr_list:REG_DEP_TRUE (use (reg:DI 3 3)) > (nil))) I would like to be assigned to this PR. Razya
Subject: Bug 29122 Author: razya Date: Tue Oct 31 11:36:28 2006 New Revision: 118227 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118227 Log: 2006-10-31 Razya Ladklesky <razya@il.ibm.com> * tree-inline.c (remap_decls): remap all TYPE_DECLs. PR tree-optimization/29122 * tree-inline.c (tree_function_versioning): Update DECL_ASSEMBLER_NAME for the new version. Assign NULL to DECL_RTL of the new version. Modified: branches/ipa-branch/gcc/ChangeLog.ipa branches/ipa-branch/gcc/tree-inline.c
(In reply to comment #4) > Subject: Bug 29122 > Author: razya > Date: Tue Oct 31 11:36:28 2006 > New Revision: 118227 > URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118227 > Log: > 2006-10-31 Razya Ladklesky <razya@il.ibm.com> > * tree-inline.c (remap_decls): remap all TYPE_DECLs. > PR tree-optimization/29122 > * tree-inline.c (tree_function_versioning): Update > DECL_ASSEMBLER_NAME > for the new version. Assign NULL to DECL_RTL of the new version. > Modified: > branches/ipa-branch/gcc/ChangeLog.ipa > branches/ipa-branch/gcc/tree-inline.c (In reply to comment #4) > Subject: Bug 29122 > Author: razya > Date: Tue Oct 31 11:36:28 2006 > New Revision: 118227 > URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118227 > Log: > 2006-10-31 Razya Ladklesky <razya@il.ibm.com> > * tree-inline.c (remap_decls): remap all TYPE_DECLs. > PR tree-optimization/29122 > * tree-inline.c (tree_function_versioning): Update > DECL_ASSEMBLER_NAME > for the new version. Assign NULL to DECL_RTL of the new version. > Modified: > branches/ipa-branch/gcc/ChangeLog.ipa > branches/ipa-branch/gcc/tree-inline.c This was committed only on ipa branch (witth Hubicka's consent). This fix was submitted for GCC4.3 and possibly for GCC4.2 http://gcc.gnu.org/ml/gcc-patches/2006-10/msg01457.html
Subject: Bug number PR29122 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-10/msg01457.html
Subject: Bug number PR29122 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-11/msg00305.html
Subject: Bug number PR29122 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2006-11/msg01140.html
Subject: Bug 29122 Author: razya Date: Sun Nov 26 10:00:18 2006 New Revision: 119220 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=119220 Log: 2006-11-26 Razya Ladklesky <razya@il.ibm.com> PR tree-optimization/29122 * tree-inline.c (tree_function_versioning): Update DECL_ASSEMBLER_NAME for the new version. Assign NULL to DECL_RTL of the new version. Modified: trunk/gcc/ChangeLog trunk/gcc/tree-inline.c
Fixed.