On Fri, Sep 26, 2014 at 2:28 PM, Bernd Schmidt <ber...@codesourcery.com> wrote:
> On 09/26/2014 02:26 PM, Richard Biener wrote:
>>
>> On Fri, Sep 26, 2014 at 2:14 PM, Bernd Schmidt <ber...@codesourcery.com>
>> wrote:
>>>
>>> On 09/26/2014 02:05 PM, Richard Biener wrote:
>>>>
>>>>
>>>> If currently address-space support matches up with the C frontend
>>>> and the C standard then the middle-end has to cope with that.
>>>> In this case, cope with array element types not having address-space
>>>> qualifiers.
>>>
>>>
>>>
>>> That's the opposite of what happens. The C frontend makes array element
>>> types have address-space qualifiers but not the array type.
>>
>>
>> Ah, ok.  Then the opposite way around ;)
>
>
> Ok, so that means that my original patch which updated the element types for
> arrays is in fact the way to go?

It seems to do both, apply the as to the array _and_ the element type, no?

Thus for arrays you'd need to do (in that old patches terms)

  type = build_variant_type_copy (type);
  TREE_TYPE (type) = apply_as_to_type (TREE_TYPE (type), as);

and drop the build_qualified_type call for the array type itself.  Oh,
and instead of unconditionally doing that copy walk the existing
variant list to see if there is aready a properly qualified variant.

(it seems to me the apply_as_to_type function should first check
if 'type' already has the appropriate address-space qualification).

Richard.

>
> Bernd
>
>

Reply via email to