> At least sizetype is for GIMPLE compatible with size_t or unsigned long (or
> whatever unsigned type has the same precision), so this looks wrong to me.

It's for bitsizetype here, as it's a conversion from bits into bytes, so 
larger than DWARF2_ADDR_SIZE.

> For non-strict DWARF or DWARF5 and above, I don't see why we can't use
> typed DWARF ops instead though, see what e.g. mem_loc_descriptor does for
> UDIV.

    case UDIV:
      if ((!dwarf_strict || dwarf_version >= 5)
        && is_a <scalar_int_mode> (mode, &int_mode))
        {
          if (GET_MODE_SIZE (int_mode) > DWARF2_ADDR_SIZE)
            {
              op = DW_OP_div;
              goto do_binop;
            }
          mem_loc_result = typed_binop (DW_OP_div, rtl,
                                base_type_for_mode (int_mode, 1),
                                int_mode, mem_mode);
        }
      break;

This also looks incorrect if the size is larger than DWARF2_ADDR_SIZE then, 
isn't there a typo in the code?

          if (GET_MODE_SIZE (int_mode) < DWARF2_ADDR_SIZE)
            {
              op = DW_OP_div;
              goto do_binop;
            }

-- 
Eric Botcazou


Reply via email to