From owner-freebsd-hackers Sat Feb 15 16:03:04 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id QAA26370 for hackers-outgoing; Sat, 15 Feb 1997 16:03:04 -0800 (PST) Received: from aris (aris.jpl.nasa.gov [137.78.161.113]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id QAA26365 for ; Sat, 15 Feb 1997 16:02:58 -0800 (PST) Received: from localhost by aris (SMI-8.6/SMI-SVR4) id QAA18279; Sat, 15 Feb 1997 16:01:19 -0800 Date: Sat, 15 Feb 1997 16:01:19 -0800 (PST) From: Jake Hamby X-Sender: hamby@aris To: "David S. Miller" cc: asami@vader.cs.berkeley.edu, jmb@freefall.freebsd.org, hackers@FreeBSD.ORG Subject: Re: Sun Workshop compiler vs. GCC? In-Reply-To: <199702140448.XAA18687@jenolan.caipgeneral> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Thu, 13 Feb 1997, David S. Miller wrote: > > Also, the various optimizer bugs in GCC in the past have led people > to be wary to use -O2 optimization, much less try additional > optimization flags. > > I know about them, just about all of them are in the strength > reduction pass. I am very familiar with the problematic bugs this > layer has, and I have been actively trying to get people on the GCC > development team to fix them. Almost all of these problems have to do > with when a pointer comparison is converted into an integer invariant > comparison, and vice versa. GCC in certain circumstances does not > notice the change in signed'ness and thus produces incorrect code. In > gcc-2.7.2.1, the strength reduction transformations that were known to > lead to this situation were disabled entirely and in fact this fix was > the entire reason for that release of gcc. Thanks for the insight into GCC. You might find it amusing to know that I've already discovered an optimizer bug in the latest version of Sun's C compiler! It affected the directory listing of XV when I compiled it with -fast (or any combination of -xO2 or higher optimization plus -xtarget=486, pentium, or pentium_pro). Fortunately, the nature of the bug was such that: 1) I was able to track it down within a few minutes (without needing a debugger), and 2) I was able to create a stand-alone program to demonstrate the bug. So I sent it as a bug report to the appropriate E-Mail address at Sun. It will be interesting to see how soon it is patched. In my programming career, I've discovered one other optimizer bug, in Metrowerks Codewarrior (BeOS/PowerPC). It was rather gratifying to see it fixed in the very next patch release, with my example code listed in the README under bugs fixed. :) ------------------------------------------------------------------------------ |Jake Hamby| APT Engineer at JPL, CS student at Cal Poly, and BeOS developer!| ------------------------------------------------------------------------------ "Life is hard..."