This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: type based aliasing again
- To: amylaar AT cygnus.co.uk
- Subject: Re: type based aliasing again
- From: Mark Mitchell <mark AT codesourcery dot com>
- Date: Thu, 16 Sep 1999 12:23:41 -0700
- Cc: ak AT muc.de, craig AT jcb-sc dot com, gcc AT gcc.gnu dot org
- Organization: CodeSourcery, LLC
- References: <m3aeqmloyj.fsf@fred.muc.de><199909161908.UAA26066@phal.cygnus.co.uk>
>>>>> "Joern" == Joern Rennecke <amylaar@cygnus.co.uk> writes:
Joern> I suppose that means we should get the typealias feature
Joern> into a erlease soon, so that people can use it to make
Joern> their code work with gcc's strict aliasing without large
Joern> code changes.
That's one approach. However, rather than add another extension, we
could just not use the strict-aliasing optimizations with that code.
(Either by turning it off by default, or by having the people
compiling the code use -fno-strict-aliasing.)
I'm not convinced we need to provide a "have your cake and eat it too"
mode where you can get the benefits of the optimization without having
conforming code. Even if you go to the troule of adding some extra
type-qualifiers, attributes, etc., somewhere.
Especially now that people are providing implementations of helpful
warnings, it seems fair to say "use -fno-strict-aliasing (either
because that's the default, or otherwise) or else write conforming
code".
Historically, most of our language extensions have proven
ill-specified, to have slightly odd behavior, to significantly
complicate the compiler, etc.. I'm not commenting on any specific
proposal, but it's very, very hard to get new language features right.
There tends to be a huge maintenance cost.
IMO, the last thing we want to do is to make GNU C a dialect even more
divergent from ANSI/ISO C.
--
Mark Mitchell mark@codesourcery.com
CodeSourcery, LLC http://www.codesourcery.com