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]
Other format: [Raw text]

Re: strict aliasing benefit examples


> Since humans have to do a bit of alias analysis when maintaining
> or writing code, the extra clarity of pulling things into temporary
> variables isn't wasted.

Sorry, I don't follow.  Why should we want to do "a bit of alias analysis"
when maintaining or writing code?  It would seem a far better practice to
leave that to the optimizer and use local variables only when necessary
for clarify.

> BTW, there are more normal programming habits that defeat
> type-based alias analysis. People pick data types by habit.
> Mostly, people will use the same type for nearly everything.

That depends on the language.  What you describe is certainly the norm
for C.  The exact opposite is the norm for Ada.  And Fortran
programmers tend to think more about datatypes than C progammers too.


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