RFA: handling of mode attribute

Richard Guenther richard.guenther@gmail.com
Sat Sep 26 14:25:00 GMT 2009


On Sat, Sep 26, 2009 at 3:50 PM, Kai Tietz <ktietz70@googlemail.com> wrote:
> 2009/9/26 Kai Tietz <ktietz70@googlemail.com>:
>> Hello,
>>
>> This patch makes sure, that the attribute mode is getting associated
>> with the base type (as described in documentation, too). So the mode
>> attribute can be used as type-specifier in code, too (eg  'int
>> __attribute__ ((mode(DI))) value[5];' ).
>> The old attribute mode handler has treating of pointer type, but if I
>> read documentation I don't find a single word about this. Also I
>> searched testsuite and couldn't find any example of this. To allow
>> proper association of this attribute, I removed the bogus pointer type
>> handling. If this is necessary for some cases I didn't found, we could
>> add a special attribute (eg. ptrmode) for handling and checking this.
>> The only usecase I found in gcc's source is in vmsdbgout.c:typedef
>> struct fibdef* __fibdef_ptr32 __attribute__ (( mode (SI) ));
>>
>> So my question is, how should we handle this?
>> One idea would be to add for the new behavior an new attribute name,
>> something like 'base_mode'. The other would be to change this pointer
>> type mode, but well it wouldn't be backward compatible any more.
>>
>> I attached current state of patch, plus a testcase for attribute mode used.
>>
>> Cheers,
>> Kai
>>
>> --
>> |  (\_/) This is Bunny. Copy and paste
>> | (='.'=) Bunny into your signature to help
>> | (")_(") him gain world domination
>>
>
> In testcase I missed to replace one use of __int64 by attr_int64, so I
> resent the patch

I don't think we can change the existing behavior in this way.

Richard.



More information about the Gcc-patches mailing list