This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [cxx-abi-dev] A complexity in the mangling ABI
kaih@khms.westfalen.de (Kai Henningsen) writes:
> ian@wasabisystems.com (Ian Lance Taylor) wrote on 23.11.03 in <m3smkeh4kn.fsf@gossamer.airs.com>:
>
> > "Mark Mitchell" <mark@codesourcery.com> writes:
>
> > > The specification doesn't actually say how to deal with mangling
> > > order-sensitive qualifiers.
> >
> > I think you meant to say order-insensitive here. (I know that I'm
> > confused about the difference.)
> >
> > > If there are vendor-extended order-sensitive qualifiers, that would
> > > clearly need to change.
> >
> > Again, I think you mean to say order-insensitive.
>
> That doesn't make sense.
Well, if you read the mangling ABI, it explains precisely how to
handle order-sensitive vendor extended type qualifiers.
When Mark said ``The specification doesn't actually say how to deal
with mangling order-sensitive qualifiers,'' he was wrong.
And when Mark said ``If there are vendor-extended order-sensitive
qualifiers, that would clearly need to change,'' he was referring to a
statement that was incorrect.
So I don't know what you mean when you say ``That doesn't make
sense.''
> Order-sensitive means it matters what order they're in; order-insensitive
> means any order is equivalent. Mark was clearly meaning what he said.
Mark was talking about what the ABI specifies. The ABI explains how
to handle order-sensitive vendor extended type qualifiers. It does
not explain how to handle order-insensitive vendor extended type
qualifiers. In fact, the ABI says ``An appropriate grammar
modification would be necessitated by an order-insensitive vendor
extended type qualifier like const or volatile.''
> > g++ supports one vendor-extended type qualifier, and it handles it in
> > an order-sensitive manner.
>
> Really? const vector is different from vector const?
To the best of my knowledge, there is no way to say ``vector const''
in g++. To the best of my knowledge, the only way to get a vector
type in g++ is to say something like
typedef int __v2si __attribute__ ((__mode__ (__V2SI__)));
In any case, when I say that g++ handles __vector in an
order-sensitive manner, I mean:
1) when g++ is mangling the name, it does not attempt to sort
U8__vector with regard to other CV-qualifers, as the mangling ABI
requires for order-insensitive type qualifiers.
2) when g++ is mangling the name, it adds a substitution candidate for
the vector qualified type without regard to any other
CV-qualifiers, which the ABI does not permit for order-insensitive
type qualifiers.
Examples are available upon request.
My conclusion is that g++ handles __vector in an order-sensitive
manner. I should clarify that here I speak only of name mangling, not
of any other part of g++.
Ian