Linux and aliasing?

mark@codesourcery.com mark@codesourcery.com
Fri Jun 4 07:11:00 GMT 1999


>>>>> "Linus" == Linus Torvalds <torvalds@transmeta.com> writes:

    Linus> On Thu, 3 Jun 1999 mark@codesourcery.com wrote:
    >>  I don't think the cast rule is by any means the right obvious
    >> default.  For one thing, it pessimizes object-oriented C code
    >> that does downcasts through an inheritance hierarchy.  There's
    >> no reason that we shouldn't be able to use type-based alias
    >> analysis in such situations, but your proposal would make it
    >> not happen.

    Linus> But those downcasts are implicit, not explicit, no? I think
    Linus> only explicit casts should break the alias rule.

No, they are often explicit.  In C, you don't have base classes, per
se, so you right them explicitly.

    Linus> Have you actually ever tried? I don't think you realize
    Linus> quite what a rat-hole it is. It's not worth ANYBODYS time.

Yes, I have done similar things.

    Linus> I think it's a damn shame that instead of technical
    Linus> arguments _everything_ revolves around people reading the
    Linus> standard as if it was the bible, and trying to make people
    Linus> feel guilty for not really caring. It's not a sin to just
    Linus> want to get good code without having to do magic
    Linus> contortions, guys.

I implemented the code, and I wouldn't say that I ignored real
programmers.  In fact, my work was paid for by real programmers, who
noticed that GCC would generate markedly better code on some examples
they had if type-based aliasing were in use.  

I've expressed the position that if we come up with a reasonable
localized rule, that does not pessimize conforming code, that I would
have no objection.  In fact, I would be perfectly willing to work on
such a project.

With respect to your comments about prereleases, they're simply not
fair.  I see no reason that I, or anyone else, should volunteer our
time to add features.  Had I introduced a bug, I would feel duty-bound
to fix it.  

I do listen to feedback, and I've heard your point of view.  I respect
your opinion.  That doesn't mean I'm going to sit down and to what you
would like on my own time.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com


More information about the Gcc mailing list