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: [PATCH] fix aliasing for chars in global structure


On Sun, 10 Mar 2002, Dan Nicolaescu wrote:

> Sorry, I don't have access to the standard and I don't quite
> understand what you are saying. 
> Are you saying that the MEMs that access the char fields in my example
> need to be in alias set 0? 

I'm not saying anything about the translation to alias sets; I'm saying
that the notion that there's something special about "char *" rather than
other means of access based on an lvalue of character type is based on a
misconception.

C99 says:

       [#7] An object shall have its stored value accessed only  by
       an lvalue expression that has one of the following types:73)

         -- a  type  compatible  with  the  effective  type  of the
            object,

         -- a qualified version  of  a  type  compatible  with  the
            effective type of the object,

         -- a   type   that   is   the   signed  or  unsigned  type
            corresponding to the effective type of the object,

         -- a  type  that  is   the   signed   or   unsigned   type
            corresponding  to  a qualified version of the effective
            type of the object,

         -- an aggregate or union type that  includes  one  of  the
            aforementioned  types  among  its  members  (including,
            recursively, a member of a  subaggregate  or  contained
            union), or

         -- a character type.

       73)The intent of this list is to specify those circumstances
          in which an object may or may not be aliased.

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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