From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: My Emacs unicode 2 crash again when I do some *Replace String (M-%)*, I give the debug informations under gdb in the attachments. Date: Mon, 12 Mar 2007 23:50:16 +0200 Message-ID: References: <20070306063056.GA21948@debian-testing-hy.localdomain> <86zm6q5upr.fsf@lola.quinscape.zz> <17902.9556.720278.162036@kahikatea.snap.net.nz> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: sea.gmane.org 1173736220 8606 80.91.229.12 (12 Mar 2007 21:50:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 12 Mar 2007 21:50:20 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 12 22:50:12 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1HQsPE-0005QN-8l for ged-emacs-devel@m.gmane.org; Mon, 12 Mar 2007 22:50:12 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQsPv-00061h-02 for ged-emacs-devel@m.gmane.org; Mon, 12 Mar 2007 16:50:55 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HQsPj-00061Z-Am for emacs-devel@gnu.org; Mon, 12 Mar 2007 17:50:43 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HQsPi-00061N-UT for emacs-devel@gnu.org; Mon, 12 Mar 2007 17:50:43 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HQsPi-00061K-O7 for emacs-devel@gnu.org; Mon, 12 Mar 2007 16:50:42 -0500 Original-Received: from romy.inter.net.il ([213.8.233.24]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1HQsP0-00041f-M9 for emacs-devel@gnu.org; Mon, 12 Mar 2007 17:49:58 -0400 Original-Received: from HOME-C4E4A596F7 (IGLD-84-229-113-116.inter.net.il [84.229.113.116]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id HJJ57151 (AUTH halo1); Mon, 12 Mar 2007 23:49:58 +0200 (IST) In-reply-to: (message from Stefan Monnier on Mon, 12 Mar 2007 10:23:26 -0400) X-detected-kernel: FreeBSD 4.7-5.2 (or MacOS X 10.2-10.4) (2) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:67820 Archived-At: > Cc: emacs-devel@gnu.org > From: Stefan Monnier > Date: Mon, 12 Mar 2007 10:23:26 -0400 > > > I disagree. -O1 selects optimizations based on how expensive they are > > at compile time, not on how badly they disrupt debugging. > > Really? Says who? Says the GCC manual: With `-O', the compiler tries to reduce code size and execution time, without performing any optimizations that take a great deal of compilation time. But you don't need to believe this if you don't want to, just look at the options enabled by -O2 and see how many of them have no relation to debuggability whatsoever. They are related to how expensive (i.e. time-consuming and/or memory-consuming) those optimizations are for the optimizer. > I don't know if there's an official definition of what -O should be, but > AFAICT all it says is "please optimize this" in a very generic sense. > I.e. in a sense which implies that the user doesn't want to waste time > thinking about details such as which specific optimizations to enable and > which to disable. It should "just work", so it should be as good as > possible while staying conservative (i.e. do not enable passes which have > a significant risk of resulting in slower code, or which may alter the > semantics of the code, or which may result in odd behavior in the debugger). Well, you are, of course entitled to your own notions, but FWIW the GCC manual tells a different story: `-O2' Optimize even more. GCC performs nearly all supported optimizations that do not involve a space-speed tradeoff. IOW, -O2 does what you think -O1 should do (which goes a long way toward explaining why so many project use -O2 as default). Optimizations that involve space-speed tradeoff (a PC way of saying you may lose as likely as win) are in -O3, while those that might alter the semantics are (AFAIK) not in any -On option, you must turn them on by hand (at your own risk). The latter fact is not stated in these very words, but is quite evident when one reads the manual. Of course, this is all from reading the manual, so it might be inaccurate and even plain wrong... > I would probably also include a notion of "avoid optimzation passes which > can take too much time (e.g. quadratic complexity or worse)", but it's > definitely not at the top of my list of requirements for the semantics of > "-O". The above seems to show that it's definitely at the top of the GCC developers' list. Which I personally think is somewhat silly with today's fast CPUs, but that's a different matter.