Hello,

I am confused by the following code in
ifcvt.c:noce_mem_write_may_trap_or_fault_p():

static bool
noce_mem_write_may_trap_or_fault_p (const_rtx mem)
{
  rtx addr;

  if (MEM_READONLY_P (mem))
    return true;
(...)

  addr = XEXP (mem, 0);

  /* Call target hook to avoid the effects of -fpic etc....  */
  addr = targetm.delegitimize_address (addr);

  while (addr)
    switch (GET_CODE (addr))
      {
(...)      case SYMBOL_REF:
        if (SYMBOL_REF_DECL (addr)
            && decl_readonly_section (SYMBOL_REF_DECL (addr), 0))
          return true;

If decl_readonly_section (SYMBOL_REF_DECL (addr), 0) is true, I would
expect that MEM_READONLY_P is set, and the decl_readonly_section check
is never true.

Is there a difference between "could be read-only"
(decl_readonly_section) and "is read-only" (MEM_READONLY_P)?

Thanks for any help you can give,

Ciao!
Steven

Reply via email to