Re: strange problem in X

Artur Skawina (skawina@geocities.com)
Sun, 27 Jun 1999 23:36:03 +0200


Matti Aarnio wrote:
>
> egcs doesn't per default turn on -fstrict-aliasing processing,
> but gcc 2.9 will (or so we are told).

> For an educative experience, try compiling your kernel with that
> switch, and tell what happens ?

i've been doing that (compiling the kernel w/ the current egcs2.95
snapshots, w/o -fno-strict-aliasing) since a few days and, surprisingly,
I have not seen any problems at all. (why i tried that? - both egcs1.0.2
and egcs1.1.2 produce kernels with broken networking (with strict
aliasing _off_). gcc2.95 seems to do ok)

I've looked over full diffs of identical 2.3.5 kernel images compiled
both with (a) default gcc2.95 prerelease settings, and (b) gcc2.95 w/
-f-no-strict-aliasing -- there was a lot of code moved around, but I
noticed only one case where -no-strict-aliasing generated significantly
worse code (the whole diff was a few 10k asm lines, iirc)

> egcs wizards have tried, and are telling that Linux kernel
> violates so many of C9X aliasing rules, that there will be
> major pain... (This includes e.g. DaveM, who is one of the
> primary Linux network subsystem hackers.)

well, -fno-strict-aliasing doesn't appear to hurt much (if at all),
so that shouldn't be a big problem. With gcc2.95 you'd probably
also want a few other options, like '-mpreferred-stack-boundary=2'
(this reduces the number of stack manipulations - it defaults to
keeping it 16byte aligned otherwise...).

[note: the kernel i did the tests on was not a stock one, and this was
all on ia32 only]

-
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/