* 5.1b cc optimizer problem?
@ 2003-08-20 23:50 Tim Mooney
2003-08-21 12:55 ` Andrew Duane USG
0 siblings, 1 reply; 4+ messages in thread
From: Tim Mooney @ 2003-08-20 23:50 UTC (permalink / raw)
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.
I'm current with relevant OS patches, and cc says it's:
Compaq C V6.5-011 on Compaq Tru64 UNIX V5.1B (Rev. 2650)
Compiler Driver V6.5-003 (sys) cc Driver
What I'm wondering is if anyone has noticed similar problems with optimization
and the 5.1b C compiler?
Thanks!
Tim
--
Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu
Information Technology Services (701) 231-1076 (Voice)
Room 242-J6, IACC Building (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 5.1b cc optimizer problem?
2003-08-20 23:50 5.1b cc optimizer problem? Tim Mooney
@ 2003-08-21 12:55 ` Andrew Duane USG
2003-08-23 15:02 ` Jerry Feldman
2003-09-02 4:19 ` Tim Mooney
0 siblings, 2 replies; 4+ messages in thread
From: Andrew Duane USG @ 2003-08-21 12:55 UTC (permalink / raw)
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.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 5.1b cc optimizer problem?
2003-08-21 12:55 ` Andrew Duane USG
@ 2003-08-23 15:02 ` Jerry Feldman
2003-09-02 4:19 ` Tim Mooney
1 sibling, 0 replies; 4+ messages in thread
From: Jerry Feldman @ 2003-08-23 15:02 UTC (permalink / raw)
On Thu, 21 Aug 2003 12:55:23 GMT
duane@wasted.zk3.dec.com (Andrew Duane USG) wrote:
> 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.
I'll agree with Andrew as much as it hurts me. Over the years I have
maintained lint(1), written an assembler(with others), and ported Purify
(with others). While I have found bugs in the compiler, they are very
rare. The C compiler and GEM teams have produced some very good results.
--
Jerry Feldman <gaf-nospam-at-blu.org>
Boston Linux and Unix user group
http://www.blu.org PGP key id:C5061EA9
PGP Key fingerprint:053C 73EC 3AC1 5C44 3E14 9245 FB00 3ED5 C506 1EA9
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 5.1b cc optimizer problem?
2003-08-21 12:55 ` Andrew Duane USG
2003-08-23 15:02 ` Jerry Feldman
@ 2003-09-02 4:19 ` Tim Mooney
1 sibling, 0 replies; 4+ messages in thread
From: Tim Mooney @ 2003-09-02 4:19 UTC (permalink / raw)
In article <%i31b.2973$Nt5.165@news.cpqcorp.net>,
Andrew Duane USG <duane@wasted.zk3.dec.com> wrote:
>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.
I agree with all of these things and understand the point you're making.
I hesitated to even bring the issue up for the same reasons -- I think
the Tru64 compiler is high quality and the people that are part of the
developer tools group are doing a great job.
Still, I'm at a loss to explain the problems I mentioned in my original post,
and was looking to see if anyone else had noticed the same types of issues.
Since I didn't receive any positive responses, I'll assume that it's not a
compiler issue, and that the problem lies elsewhere. If I can track the
issue further, I'll be sure to post further information.
Tim
--
Tim Mooney mooney@dogbert.cc.ndsu.NoDak.edu
Information Technology Services (701) 231-1076 (Voice)
Room 242-J6, IACC Building (701) 231-8541 (Fax)
North Dakota State University, Fargo, ND 58105-5164
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-09-02 4:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-08-20 23:50 5.1b cc optimizer problem? Tim Mooney
2003-08-21 12:55 ` Andrew Duane USG
2003-08-23 15:02 ` Jerry Feldman
2003-09-02 4:19 ` Tim Mooney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox