Re: 5.1b cc optimizer problem?

From: Andrew Duane USG (duane_at_wasted.zk3.dec.com)
Date: 08/21/03


Date: Thu, 21 Aug 2003 12:55:23 GMT

I'll let someone from the compiler group jump in with more details, but
the compiler hasn't changed a whole lot in 5.1B, and I haven't noticed
anything like this from it, now or ever before.

One of my main jobs here is to make sure the Tru64 kernel compiles correctly
with the compiler, so I keep careful tabs on code generation, optimization,
all sorts of issues. In the last 10 years, I have had at least a dozen cases
where I was sure the compiler was doing something wrong.

I was proven wrong every time.

Optimization can uncover some source code issues that lay dormant before.
You would be amazed at what some people think they can get away with.
Even code that has worked for years and many releases can suddenly break
when a "trivial" printf is added, since register allocation now changes,
or an old return value, previously unimportant, is now critical.

Dollars to donuts this is a source code issue, not a compiler issue.

In article <vk829rmd2ioud6@corp.supernews.com> (Tim Mooney) writes:
>I use the Tru64 cc compiler exclusively for building open source
>software, even stuff that isn't performance-sensitive (where cc
>really beats a compiler like gcc, which I'm not knocking at all).
>
>Since upgrading to 5.1b from 5.1, I've noted inexplicable application
>crashes with several locally-compiled apps, and although it would be
>difficult to prove, it seems to be an optimizer problem in the compiler.
>
>Take for example pine, from UW (ftp://ftp.cac.washington.edu/pine). If
>I run version 4.53 compiled under 5.1 on my 5.1b box, it works fine. If
>I recompile 4.53 in the default way (build osf) on my 5.1b box, it segfaults
>in libc's strlen(), called from the pine function format_keymenu(). If I
>modify the necessary makefiles to remove the `-O2' and rebuild, it works
>fine.
>
>Same is true for the latest version of pine, 4.56. I've seen otherwise
>unexplainable crashes from other apps too, but most of them are larger and
>harder to be certain where the problem is.
>
>I realize that turning on optimization in the compiler can in some cases
>trigger subtle bugs in the code of an app you're compiling, but my experience
>and instincts tell me that isn't what's happening here.



Relevant Pages

  • Re: Improving first access to a web service
    ... > This happens for all .NET apps, but we notice it more in Web APps ... Launches the C# compiler to compile that source code. ... These processes aren't known to the JIT compiler. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Brian Kernighan, maybe Im not worthy, maybe Im scum
    ... what experienced programmers do, ... optimization, ... Thugs" ad nauseum fits that a lot more closely than discussing compiler ... be modified outside a loop, and guessing ...
    (comp.programming)
  • long(!) Re: need help on CFLAGS in /etc/make.conf please
    ... For example, MPlayer sets this high on purpose, so GCC will actually ... and the K&R compiler would've known exactly the kind of optimization we wanted. ... >> A msg from Richard Coleman, taken together with the GCC 3.x Known Bugs ...
    (freebsd-questions)
  • Re: SETF and variable issues in Self Similar program.
    ... The way to get a compiler to optimize a tail-call ... call optimization turned on. ... It changes the semantics of the language in a big way. ... In Common Lisp it has to interact with condition handling, ...
    (comp.lang.lisp)
  • Functions abstractly represented by objects and compilers
    ... altering the generated assembler-code for optimization. ... could easily be done by writing a compiler in a script-based language ... layers to the single layer OOP does offer? ... another problem is seperation of error-checking of source-code ...
    (comp.object)