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

From: Albert Cahalan (
Date: Mon Feb 10 2003 - 15:13:30 EST

Momchil Velikov writes:
> "Martin" == Martin J Bligh <> 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__.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Sat Feb 15 2003 - 22:00:29 EST