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: "as-is" rule Date: Wed, 30 Nov 2011 19:02:27 +0200 Message-ID: <837h2h5ysc.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1322672640 12447 80.91.229.12 (30 Nov 2011 17:04:00 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 30 Nov 2011 17:04:00 +0000 (UTC) Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Nov 30 18:03:53 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RVnZW-0006Nr-2l for ged-emacs-devel@m.gmane.org; Wed, 30 Nov 2011 18:03:50 +0100 Original-Received: from localhost ([::1]:40338 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVnZU-00043H-QU for ged-emacs-devel@m.gmane.org; Wed, 30 Nov 2011 12:03:48 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:37378) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVnZR-00042s-AB for emacs-devel@gnu.org; Wed, 30 Nov 2011 12:03:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RVnZM-0007ua-4U for emacs-devel@gnu.org; Wed, 30 Nov 2011 12:03:45 -0500 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:58069) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RVnZL-0007tp-MZ for emacs-devel@gnu.org; Wed, 30 Nov 2011 12:03:40 -0500 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0LVH00300GPT8F00@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Wed, 30 Nov 2011 19:03:36 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([77.126.234.164]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0LVH002KTGPYRI50@a-mtaout22.012.net.il>; Wed, 30 Nov 2011 19:03:36 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 80.179.55.172 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:146367 Archived-At: > From: Stefan Monnier > Date: Wed, 30 Nov 2011 09:20:27 -0500 > Cc: emacs-devel@gnu.org > > > See bug #10164: I've been hit by code re-ordering under the "as-is" rule. > > I asked before, but no one replied: is there a place where I can read > > the description of conditions that _disallow_ such reordering? > > I think you've hit a bug in gcc in this case: "e1 || e2" should not > evaluate e2 if e1 evaluates to non-0. This is what I always knew: that `e1 || e2 || e3' are evaluated left to right. But I understand the "as-is" rule relaxed that. Or maybe I'm confused (which is why I asked the question in the first place). > The as-is rule allows gcc to run > any part of e2 (or any other code for that matter) at any time it feels > like, but only if you can't tell the difference, and in this case we can > definitely tell the difference. How do you mean "we can tell the difference"? In general, if the "left-to-right evaluation" rule is no longer a must, e1, e2, and e3 could have been evaluated in _any_ order, and then if one of them is non-zero, the condition holds. No? Again, I'm utterly confused about this issue. If someone can explain or point me to an existing explanation, I'd be grateful. > BTW, I don't like this "#if XASSERTS" and would hence much prefer > > xassert ((row->enabled_p && !row->mode_line_p) > ? verify_row_hash (row) : 1); If we are dealing with a compiler bug, how can we be sure this expression will not hit the same bug? Anyway, I eventually removed the assertion altogether, so this is a moot point now.