Re: -fno-strict-aliasing

From: Giacomo Catenazzi (cate@neper.ethz.ch)
Date: Tue Apr 18 2000 - 09:59:21 EST


On Tue, 18 Apr 2000, Robert Dinse wrote:

> On Tue, 18 Apr 2000, Giacomo Catenazzi wrote:
> >
> > no-strict-aliasing is documented. You should remember that gcc is a GNU
> > program, also with old unmaintened man pages and the documentations put in
> > 'info pages'. (This is due to the GNU manual policy)
> >
> > giacomo
>
> I don't know what the GNU manual policy is but I'm not fond of info.

I don't know why GNU people want to see only info page, but I know that
they don't want to include updated man pages, thus the linux distributions
include some partially updated man pages.

> At any rate, yes, it is documented there but it's inclusion in the
> compilation flags is nonsensical if the documentation is correct.
>
> The documentation states that the option -fstrict-aliasing is not
> invoked for any optimization levels because it is new and relatively
> untested. Since the default is not to invoke it, why include
> -no-strict-aliasing?
>

>From GCC FAQ

: Building Linux kernels
:
: The linux kernel violates certain aliasing rules specified in the
: ANSI/ISO standard. Starting with GCC 2.95, the gcc optimizer by default
: relies on these rules to produce more efficient code and thus will
: produce malfunctioning kernels. To work around this problem, the flag
: -fno-strict-aliasing must be added to the CFLAGS variable in the main
: kernel Makefile.

Thus the info documentation is wrong!

> I've had these Sparc spin-lock from hell problems on all 2.2.x
> kernels running on SMP SS-10's or SS-20's with Ross Hypersparc CPU's.
> I read in a newsgroup recently someone else having the same problem
> and removing the -no-strict-aliasing option helped them. But I built
> a kernel without it and the kernels ended up exactly the same size so
> I don't know if it actually made any difference in the generated code
> or not.

What compiler do you use?

>
> With 2.0.x kernels; they were ineffecient for running a web
> server, a pain (had to hack the file descriptors up, etc), and they'd
> frequently hang during partition mounts or fsck's on SS-10, but once
> you got past those things they'd be stable.
>
>
>

        giacomo

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Apr 23 2000 - 21:00:13 EST