Run src/libgomp/testsuite/libgomp.c/appendix-a/a.29.1.c with '--target_board unix/-O2/-g': ... FAIL: libgomp.c/appendix-a/a.29.1.c (test for excess errors) Excess errors: src/libgomp/testsuite/libgomp.c/appendix-a/a.29.1.c:6:1: error: type mismatch between an SSA_NAME and its symbol UNRESOLVED: libgomp.c/appendix-a/a.29.1.c compilation failed to produce executable ... Without -g, the testcase passes.
Confirmed.
At fnsplit, we split off f.part.0 from f. That introduces a debug_insn and ssa-name that references param B in f: ... # DEBUG D#4ptD.0 => B_3(D) .. And a debug_insn that references param B in f.part.0: ... # DEBUG D#7ptD.0 s=> BD.1846 ... At this point, the type of the ssa name and the param are the same. Then at inline, we decide to inline f.part.0 back into the f. For inlining, we rewrite the body of inlined function f.part.0. While rewriting the debug insn mentioned above, we hit this code for param B: ... if (TREE_CODE (*tp) != OMP_CLAUSE) TREE_TYPE (*tp) = remap_type (TREE_TYPE (*tp), id); ... And since it's a variable-sized type, the type of param is changed. Now the type of the ssa name and the param are no longer the same, and a bit later we hit the ICE.
Created attachment 35783 [details] tentative patch
Testing tentative patch
(In reply to vries from comment #4) > Testing tentative patch Bootstrap and reg-test on x86_64 went ok.
https://gcc.gnu.org/ml/gcc-patches/2015-07/msg00034.html
This has nothing to do with OpenMP actually. Regressed with r202185.
Created attachment 36785 [details] gcc6-pr66432.patch Untested fix. We actually rely on decl_debug_args being the DECL_ORIGIN, not something similar to it, so your second patch will not work.
Author: jakub Date: Sat Nov 21 08:24:13 2015 New Revision: 230702 URL: https://gcc.gnu.org/viewcvs?rev=230702&root=gcc&view=rev Log: PR debug/66432 * tree-inline.c (copy_debug_stmt): If gimple_debug_source_bind_get_value is DECL_ORIGIN of a PARM_DECL in decl_debug_args, don't call remap_gimple_op_r on it. * gcc.dg/debug/pr66432.c: New test. Added: trunk/gcc/testsuite/gcc.dg/debug/pr66432.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-inline.c
Author: jakub Date: Sat Nov 21 08:26:00 2015 New Revision: 230703 URL: https://gcc.gnu.org/viewcvs?rev=230703&root=gcc&view=rev Log: PR debug/66432 * tree-inline.c (copy_debug_stmt): If gimple_debug_source_bind_get_value is DECL_ORIGIN of a PARM_DECL in decl_debug_args, don't call remap_gimple_op_r on it. * gcc.dg/debug/pr66432.c: New test. Added: branches/gcc-5-branch/gcc/testsuite/gcc.dg/debug/pr66432.c Modified: branches/gcc-5-branch/gcc/ChangeLog branches/gcc-5-branch/gcc/testsuite/ChangeLog branches/gcc-5-branch/gcc/tree-inline.c
Fixed for 5.3+ so far.
Author: jakub Date: Thu Feb 11 09:08:03 2016 New Revision: 233320 URL: https://gcc.gnu.org/viewcvs?rev=233320&root=gcc&view=rev Log: Backported from mainline 2015-11-21 Jakub Jelinek <jakub@redhat.com> PR debug/66432 * tree-inline.c (copy_debug_stmt): If gimple_debug_source_bind_get_value is DECL_ORIGIN of a PARM_DECL in decl_debug_args, don't call remap_gimple_op_r on it. * gcc.dg/debug/pr66432.c: New test. Added: branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/debug/pr66432.c Modified: branches/gcc-4_9-branch/gcc/ChangeLog branches/gcc-4_9-branch/gcc/testsuite/ChangeLog branches/gcc-4_9-branch/gcc/tree-inline.c
Fixed.