This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: More on VIEW_CONVERT_EXPR


    Certainly there's a way around it if the front end cares --
    the two types get put in the same alias set.

The main issue is *alignment*, not aliasing.

As to aliasing, there are basically two uses of V_C_E for Ada.  The least
common one corresponds to an instantiation of Ada Unchecked_Conversion.  In
that case, the programmer specifies the two types.  Since they can be from a
different translation unit than the instantiation of Unchecked_Conversion,
the alias sets used by the two types can't be affected by the presence of the
V_C_E between them.  The precise semantics of how aliasing works in this sort
of scenario is poorly defined, but seems to be OK in practice.

The majority of V_C_E's are generated internally by the front end due to
other language constructs.  The most common of these are conversions between
an Ada type and one of its subtypes.  In that case, the alias sets of the two
GCC types will be the same.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]