https://gcc.gnu.org/bugzilla/show_bug.cgi?id=128437

--- Comment #11 from Drea Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Uroš Bizjak from comment #10)
> (In reply to Drea Pinski from comment #9)
> > (In reply to Uroš Bizjak from comment #8)
> > > (In reply to Drea Pinski from comment #7)
> > > > is not being deleting.  I think this is due to this being a call_insn.  
> > > > No
> > > > other target uses call here .... So back to a target specific issue.
> > > 
> > > Please see bug 110606 comment 7. PPC defines it in the same way.
> > 
> > I wonder if we mark the call as being pure/const things will just work.
> It already is marked as const:
> 
>             start_sequence ();
>             rtx_insn *call_insn = emit_call_insn
>               (gen_tls_local_dynamic_base_64 (Pmode, rax, caddr, rdi));
>             CALL_INSN_ABI_ID (call_insn)
>               = ix86_tls_get_addr_abi ().id ();
>             insns = end_sequence ();
> 
>             /* Attach a unique REG_EQUAL, to allow the RTL optimizers to
>                share the LD_BASE result with other LD model accesses.  */
>             eqv = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, const0_rtx),
>                                   UNSPEC_TLS_LD_BASE);
> 
>             RTL_CONST_CALL_P (insns) = 1;
>             emit_libcall_block (insns, base, rax, eqv);


The check in dce.cc is:
```


  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)
      /* We cannot delete pure or const sibling calls because it is
         hard to see the result.  */
      && (!SIBLING_CALL_P (insn))
      /* We can delete dead const or pure calls as long as they do not
         infinite loop.  */
      && (RTL_CONST_OR_PURE_CALL_P (insn)
          && !RTL_LOOPING_CONST_OR_PURE_CALL_P (insn))
      /* Don't delete calls that may throw if we cannot do so.  */
      && can_delete_call (insn))
    return find_call_stack_args (as_a <rtx_call_insn *> (insn), false,
                                 fast, arg_stores);


```

The question is what is failing here on why it is not being deletable too.  Is
it find_call_stack_args or somethign else?

Reply via email to