On Tue, Aug 19, 2014 at 8:46 PM, Wei Mi <w...@google.com> wrote: > Sorry for the late reply. I took some time to make myself more > familiar with NORETURN and related code, and finally I understood what > you mean and saw why only GF_CALL_CTRL_ALTERING was enough and > GF_CALL_NORETURN was unneeded. With your suggestion, the change looks > much briefer! Please check if the new patch attached is ok.
Indeed - much nicer than I originally thought. Thanks for bearing with me. > bootstrap and regression tests pass on x86_64-linux-gnu. Ok! Thanks, Richard. > Thanks, > Wei. > >> +static void >> +update_no_abnormal_goto_attr (basic_block bb) >> +{ >> + gimple_stmt_iterator gsi; >> + for (gsi = gsi_start_bb (bb); !gsi_end_p (gsi); gsi_next (&gsi)) >> + { >> >> it should be enough to check these on last stmts of a basic block, no? > > Yes, that is better. > >> >> That you call update_no_abnormal_goto_attr from two places >> before cleanup_tree_cfg_bb suggests you may want to perform >> this change in cleanup_control_flow_bb which already looks >> at the last stmt only? > > Changed. > >> >> Btw, I originally had this whole idea of moving flags to the gimple >> stmt level because of the "interesting" way we handle the noreturn >> attribute (calls to noreturn functions also end basic-blocks). >> >> Thus would it be possible to turn all these into a single flag, >> GF_CALL_CTRL_ALTERING? That is, cover everything >> that is_ctrl_altering_stmt covers? I suggest we initialize it at >> CFG build time and only ever clear it later. > > Good idea!