2003-02-10 20:07:33

by Albert Cahalan

[permalink] [raw]
Subject: Re: [Lse-tech] gcc 2.95 vs 3.21 performance

Momchil Velikov writes:
> "Martin" == Martin J Bligh <[email protected]> writes:

>> But the point is still the same ... even if it is doing
>> more agressive optimisation, it's not actually buying us
>> anything (at least for the kernel)
>
> which might be due in part to ``-fno-strict-aliasing''
> used to compile the Linux kernel.

This is fixable for any gcc implementing __may_alias__.

Linux uses -fno-strict-aliasing because people like
to cast a (foo*) to an (int*) instead of using a
union or (char*) as required by the C language.
When -fno-strict-aliasing was added to the command
line, gcc did not offer the __may_alias__ attribute.

BTW, in case any gcc hacker is paying attention,
the documentation fails to mention the gcc version
required for this or any other attribute. Also it
would be nice to have an option to ditch the (char*)
exception; it's junk when you have __may_alias__.



2003-02-10 20:39:45

by Falk Hueffner

[permalink] [raw]
Subject: Re: [Lse-tech] gcc 2.95 vs 3.21 performance

Albert Cahalan <[email protected]> writes:

> BTW, in case any gcc hacker is paying attention, the documentation
> fails to mention the gcc version required for this or any other
> attribute. Also it would be nice to have an option to ditch the
> (char*) exception; it's junk when you have __may_alias__.

I don't think a switch that makes standard compliant source break in
potentially very subtle ways is a good idea. Just use "restrict".

--
Falk