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: Linux and aliasing?


David S. Miller wrote:

>    From: mark@codesourcery.com
>    Date: Sat, 05 Jun 1999 10:41:07 -0700

>    Furthermoe, I bet that by now, if all this energy had been spent
>    fixing the code in the kernel, you'd have made good headway on some
>    of the most prominent data structures.  Yes, this will be a tedious
>    chore, but it's an easy one: you enclose things in a union,
>    compile, see what doesn't, fix it, and go on.

> What seems to be ignored are the future maintenance costs incurred by
> this set of changes to the kernel, as if "do it and get it over right
> now" is some triviality.  Effort has been expended already to make
> attempts to do this (mentioned here by Andi Klein who did a run at it
> for the networking), and the findings made there support the
> non-triviality claim, in Andi's case he tossed the work midstream due
> to the non-stop overwhelming accumulation of issues.

If these issues are so pervasive, isn't it easier to use the compiler
flag -fno-strict-aliasing and document *that* ?

I mean, if this sort of trickery permeates the Linux kernel, you won't
get any mileage out of the new optimization anyway, so you could just as
well disable it.

[ Before anyone thinks *I* am a language purist:  I know and have been
  contributing code to our Numerical Weather Prediction programs that
  willfully break Fortran alias assumptions.  We get away by it because
  it is mostly of the form "two arrays overlap completely", which -
  up till now - doesn't seem to be fouled up by optimization passes in
  existing Fortran compilers.  That doesn't mean that I would beat a
  compiler vendor over the head with a blunt object *before* I would
  have checked that our sloppiness is not the cause of our troubles ]

-- 
Toon Moene (toon@moene.indiv.nluug.nl)
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Phone: +31 346 214290; Fax: +31 346 214286
GNU Fortran: http://world.std.com/~burley/g77.html


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