On 09/16/2014 10:56 PM, Joseph S. Myers wrote:
On Tue, 16 Sep 2014, Richard Biener wrote:

Hmm.  How is it with other compositive types like vectors and complex?
It's bad that the middle-end needs to follow a specific frontends need.
Why's the representation tied so closely together?

Complex types aren't derived types in C terms; they don't have an element
type, but a corresponding real type.  Vectors should presumably be treated
like complex types.  So both can have qualifiers.

OTOH that address-spaces are "qualifiers" is an implementation detail
(and maybe not the very best).  So I don't see how the C frontend
needs to view them as qualifiers?

It's not an implementation detail, it's how TR 18037 defines them, and
thus how the C front end should represent them in order to follow the
requirements of TR 18037.

My position is that standards do not mandate how our internal data structures should look like, and we should be striving to make them consistent. That means building array types in such a way that address spaces (and probably things like constness) are identical between the array type and its element type. It would be easy enough to make a c_type_quals wrapper function around TYPE_QUALS that returns zero for array types, but I would not expect there to really be a need for it.


Bernd

Reply via email to