On Tue, Apr 27, 2021 at 12:18:44AM +0200, Eric Botcazou wrote:
> > 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.

Yes, but even bitsizetype is undistinguishable from other (usually 2 *
pointer size) precision integral types.

> > 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;
>           }

I think you're right.

        Jakub

Reply via email to