This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: missed optimization, would be very helpful
- To: zack at rabi dot columbia dot edu (Zack Weinberg)
- Subject: Re: missed optimization, would be very helpful
- From: Joern Rennecke <amylaar at cygnus dot co dot uk>
- Date: Tue, 12 Jan 1999 20:12:44 +0000 (GMT)
- Cc: prumpf at jcsbs dot lanobis dot de, egcs at egcs dot cygnus dot com
> >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.