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

Albert Cahalan (albert@users.sourceforge.net)
10 Feb 2003 15:13:30 -0500


Momchil Velikov writes:
> "Martin" == Martin J Bligh <mbligh@aracnet.com> 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 majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/