Hi Jan-Benedict!

On 2025-06-05T10:24:35+0200, Jan-Benedict Glaw <jbg...@lug-owl.de> wrote:
> On Tue, 2025-04-15 00:22:26 +0200, Thomas Schwinge <tschwi...@baylibre.com> 
> wrote:
>> diff --git a/gcc/except.cc b/gcc/except.cc
>> index d5eb9274a62..205811c6567 100644
>> --- a/gcc/except.cc
>> +++ b/gcc/except.cc
>> @@ -970,12 +970,26 @@ expand_dw2_landing_pad_for_region (eh_region region)
>>      { /* Nothing */ }
>>  
>>    if (region->exc_ptr_reg)
>> -    emit_move_insn (region->exc_ptr_reg,
>> -                gen_rtx_REG (ptr_mode, EH_RETURN_DATA_REGNO (0)));
>> +    {
>> +      rtx exc_ptr_reg;
>> +      if (EH_RETURN_DATA_REGNO (0) != INVALID_REGNUM)
>
> This ...
>
>> +    exc_ptr_reg = gen_rtx_REG (ptr_mode, EH_RETURN_DATA_REGNO (0));
>> +      else
>> +    /* The target must be doing something special.  Submit a dummy.  */
>> +    exc_ptr_reg = constm1_rtx;
>> +      emit_move_insn (region->exc_ptr_reg, exc_ptr_reg);
>> +    }
>>    if (region->filter_reg)
>> -    emit_move_insn (region->filter_reg,
>> -                gen_rtx_REG (targetm.eh_return_filter_mode (),
>> -                             EH_RETURN_DATA_REGNO (1)));
>> +    {
>> +      rtx filter_reg;
>> +      if (EH_RETURN_DATA_REGNO (1) != INVALID_REGNUM)
>
> ...and this result in an signed <-> unsigned warning for targets
> that implement EH_RETURN_DATA_REGNO as a function (which usually
> returns just int), affecting at least m32c and mmix.

So shouldn't these signed 'int's get fixed up?  Per my understanding,
GCC register numbers explicitly are 'unsigned int':

    gcc/rtl.h:extern rtx gen_rtx_REG (machine_mode, unsigned int);

    gcc/rtl.h:#define INVALID_REGNUM                    (~(unsigned int) 0)


Grüße
 Thomas

Reply via email to