This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Fix Ada bootstrap (was: 16: EH redirection)


> If CSE introduces unreachable basic blocks and cse_main does *not*
> return non-zero, then cse_main is broken.

It's actually intra-CSE this time, at least for c41401a.adb:

int
cse_main (rtx f ATTRIBUTE_UNUSED, int nregs)
{
  struct cse_basic_block_data ebb_data;
  basic_block bb;
  int *rc_order = XNEWVEC (int, last_basic_block);
  int i, n_blocks;

  df_set_flags (DF_LR_RUN_DCE);
  df_analyze ();

[...]

  n_blocks = pre_and_rev_post_order_compute (NULL, rc_order, false);


Before the call to df_analyze ():

(gdb) p debug_bb_n(27)
;; basic block 27, loop depth 0, count 0
;; prev block 26, next block 28
;; pred:       8 (ab,eh)
;; succ:       32 [100.0%]  (fallthru)

After:

(gdb) p debug_bb_n(27)
;; basic block 27, loop depth 0, count 0
;; prev block 26, next block 29
;; pred:
;; succ:       32 [100.0%]  (fallthru)

so pre_and_rev_post_order_compute aborts.


It's a known underlying problem with DCE and -fnon-call-exceptions, the simple 
solution is to avoid deleting CFG-changing insns when DF is being run, like 
already done for calls:

  if (CALL_P (insn)
      /* We cannot delete calls inside of the recursive dce because
	 this may cause basic blocks to be deleted and this messes up
	 the rest of the stack of optimization passes.  */
      && (!df_in_progress)

-- 
Eric Botcazou


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]