[PATCH] Additional small changes to support opaque modes

Aaron Sawdey acsawdey@linux.ibm.com
Fri Nov 20 10:57:45 GMT 2020


> On Nov 20, 2020, at 3:55 AM, Richard Sandiford <richard.sandiford@arm.com> wrote:
> 
> acsawdey--- via Gcc-patches <gcc-patches@gcc.gnu.org> writes:
>> diff --git a/gcc/c/c-aux-info.c b/gcc/c/c-aux-info.c
>> index ffc8099856d..41f5598de38 100644
>> --- a/gcc/c/c-aux-info.c
>> +++ b/gcc/c/c-aux-info.c
>> @@ -413,6 +413,10 @@ gen_type (const char *ret_val, tree t, formals_style style)
>> 	  data_type = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (t)));
>> 	  break;
>> 
>> +	case OPAQUE_TYPE:
>> +	  data_type = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (t)));
>> +	  break;
>> +
> 
> Might as well just add this case to the REAL_TYPE one.
> 
>> 	case VOID_TYPE:
>> 	  data_type = "void";
>> 	  break;
>> […]
>> diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
>> index 54eb445665c..d6d12efff34 100644
>> --- a/gcc/dwarf2out.c
>> +++ b/gcc/dwarf2out.c
>> @@ -13037,6 +13037,7 @@ is_base_type (tree type)
>>       return 1;
>> 
>>     case VOID_TYPE:
>> +    case OPAQUE_TYPE:
>>     case ARRAY_TYPE:
>>     case RECORD_TYPE:
>>     case UNION_TYPE:
>> @@ -16767,7 +16768,7 @@ loc_descriptor (rtx rtl, machine_mode mode,
>>       break;
>> 
>>     case CONST_INT:
>> -      if (mode != VOIDmode && mode != BLKmode)
>> +      if (mode != VOIDmode && mode != BLKmode && !OPAQUE_MODE_P (mode))
>> 	{
>> 	  int_mode = as_a <scalar_int_mode> (mode);
>> 	  loc_result = address_of_int_loc_descriptor (GET_MODE_SIZE (int_mode),
> 
> I realise I'm asking this about something that already appears to handle
> BLKmode CONST_INTs (?!), but this is the one change in the patch I
> struggled with.  Why do we see a CONST_INT that allegedly has an
> opaque mode?  It feels like something has gone wrong further up the
> call chain.
> 
> This might still be the expedient fix for whatever is happening,
> but I think it deserves a comment at least.
> 
> The rest looks good to me FWIW.
> 
> Richard

I should look at this again — since I originally put that in, I switched the target
portion of what I’ve been doing to use an UNSPEC to remove all use of an
opaque mode const_int from the rtf. This may not be needed any more. 

Thanks,
   Aaron

Aaron Sawdey, Ph.D. sawdey@linux.ibm.com
IBM Linux on POWER Toolchain
 




More information about the Gcc-patches mailing list