Hello. The problem with the original patch is that I'm forced to produce an empty BB to produce true/false edge needed for the 'index' check:
/home/marxin/Programming/testhsa/run_tests/012-switch/switch-5.c:28:9: error: true/false edge after a non-GIMPLE_COND in bb 4 /home/marxin/Programming/testhsa/run_tests/012-switch/switch-5.c:28:9: internal compiler error: verify_flow_info failed 0x93121a verify_flow_info() ../../gcc/cfghooks.c:260 0xd5ae4e execute_function_todo ../../gcc/passes.c:1971 0xd59ea6 do_per_function ../../gcc/passes.c:1645 0xd5afc2 execute_todo ../../gcc/passes.c:2011 It would nicer to not produce empty block for that purpose, but the question is if the change is acceptable during the stage4? Thanks, Martin
>From 02f574e46565c70e56bcb07f2a5d1b9371e008fc Mon Sep 17 00:00:00 2001 From: marxin <mli...@suse.cz> Date: Tue, 29 Mar 2016 13:33:16 +0200 Subject: [PATCH 1/2] Do not verify CFG if a function is discarded (PR hsa/70402) gcc/ChangeLog: 2016-03-29 Martin Liska <mli...@suse.cz> * passes.c (execute_function_todo): Do not verify CFG if a function is discarded. --- gcc/passes.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/passes.c b/gcc/passes.c index 9d90251..daa0d7f 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -1964,9 +1964,10 @@ execute_function_todo (function *fn, void *data) not verify SSA operands whose verifier will choke on that. */ verify_ssa (true, !from_ipa_pass); /* IPA passes leave basic-blocks unsplit, so make sure to - not trip on that. */ + not trip on that. Do not verify CFG if a function is marked + to be discarded (e.g. by HSA gen pass). */ if ((cfun->curr_properties & PROP_cfg) - && !from_ipa_pass) + && !from_ipa_pass && !(flags & TODO_discard_function)) verify_flow_info (); if (current_loops && loops_state_satisfies_p (LOOP_CLOSED_SSA)) -- 2.7.1