This is the mail archive of the gcc@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]

Re: missed optimization, would be very helpful


> >What if you call your function like this
> 
> >	f((char *) a, a[17]);
> 
> The compiler is allowed to assume you didn't do that.  char * and int * have
> different base types, therefore aren't allowed to be "aliased"
> (standardese).  Optimizing based on that assumption is enabled by
> -fstrict-aliasing, but I get identical code for Horst's sample function on
> x86 with and without -fstrict-aliasing.  (1.1.1 or Dec 24 CVS, makes no
> difference).

But char * is special in that it is allowed to alias anything but functions.


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