On 1/16/19 3:43 PM, Jakub Jelinek wrote: > Hi! > > For normal instructions, deletable_insn_p has: > /* Don't delete insns that may throw if we cannot do so. */ > if (!(cfun->can_delete_dead_exceptions && can_alter_cfg) > && !insn_nothrow_p (insn)) > return false; > > The following patch adds that for the const/pure non-looping calls > that are handled earlier in the function as well (I haven't moved this test > earlier so we don't check insn_nothrow_p on jump insns etc.). > > The other change is just to handle those calls the same as non-const/pure, > if we never consider them to be deletable, there is no point in > find_call_stack_args for them, like we don't do that for normal calls. > > Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? > > 2019-01-16 Jakub Jelinek <ja...@redhat.com> > > PR rtl-optimization/88870 > * dce.c (deletable_insn_p): Never delete const/pure calls that can > throw if we can't alter the cfg or delete dead exceptions. > (mark_insn): Don't call find_call_stack_args for such calls. > > * gcc.dg/pr88870.c: New test. OK. Though I wonder if we want to continue to support -fnon-call-exceptions. With GCJ gone is there any value left in that capability? There's little doubt in my mind other parts of GCC are not -fnon-call-exception safe.
jeff