From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alexander Shukaev Newsgroups: gmane.emacs.bugs Subject: bug#18995: Error: Could not reserve dynamic heap area. Date: Sun, 9 Nov 2014 17:30:38 +0100 Message-ID: References: <834mu9r47v.fsf@gnu.org> <83y4rlpmsr.fsf@gnu.org> <83wq75plkm.fsf@gnu.org> <83vbmppj4a.fsf@gnu.org> <83r3xdpiex.fsf@gnu.org> <545E81BD.8070904@dancol.org> <83egtcpd3z.fsf@gnu.org> <545F94E4.5060102@dancol.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=089e0158b9c6f8c29305076f9054 X-Trace: ger.gmane.org 1415550689 485 80.91.229.3 (9 Nov 2014 16:31:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 9 Nov 2014 16:31:29 +0000 (UTC) Cc: 18995-done@debbugs.gnu.org To: Daniel Colascione Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Nov 09 17:31:20 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XnVOZ-00015E-NA for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Nov 2014 17:31:19 +0100 Original-Received: from localhost ([::1]:39218 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnVOZ-0004Zt-9u for geb-bug-gnu-emacs@m.gmane.org; Sun, 09 Nov 2014 11:31:19 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47490) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnVOO-0004Vy-Rj for bug-gnu-emacs@gnu.org; Sun, 09 Nov 2014 11:31:14 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XnVOI-0008Lb-N3 for bug-gnu-emacs@gnu.org; Sun, 09 Nov 2014 11:31:08 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:57729) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XnVOI-0008LX-Kl for bug-gnu-emacs@gnu.org; Sun, 09 Nov 2014 11:31:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XnVOI-0002d2-FI for bug-gnu-emacs@gnu.org; Sun, 09 Nov 2014 11:31:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alexander Shukaev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Nov 2014 16:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 18995 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 18995-done@debbugs.gnu.org id=D18995.141555064310068 (code D ref 18995); Sun, 09 Nov 2014 16:31:02 +0000 Original-Received: (at 18995-done) by debbugs.gnu.org; 9 Nov 2014 16:30:43 +0000 Original-Received: from localhost ([127.0.0.1]:54941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XnVNy-0002cK-Af for submit@debbugs.gnu.org; Sun, 09 Nov 2014 11:30:42 -0500 Original-Received: from mail-lb0-f169.google.com ([209.85.217.169]:63436) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XnVNv-0002cA-Ph for 18995-done@debbugs.gnu.org; Sun, 09 Nov 2014 11:30:40 -0500 Original-Received: by mail-lb0-f169.google.com with SMTP id 10so4835610lbg.28 for <18995-done@debbugs.gnu.org>; Sun, 09 Nov 2014 08:30:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=yr8No7vTr75acK/TRZ0TBJuWU7zH6FZhtHzYdAPE7Pk=; b=JEsCluW3mZjMh2iGjgySzepYvszjkdIkhrpFEK7EDMSuObyTvlWBCRopggOh+GXkEh 5JRX7ws6EIJSHZ2HpJI3j0t1weqTHJbwB5wWBbzZGtM/Ck9s9YTyJvM6m6ZtY/U7KgqF o6hBpU8ddSxB3gZQBPWS0KzYvYxWx9ahwjaJMVNJKhHnhE/bqIeY5xDhvr6TQO8zXOn4 6OHyueks9fH5TMFnwVg9ZhpFxNl1fMliTYv4aS4CqmRYzuNDiRxuB9rttxr/DddaPP99 2UOdhfvfF3aUIzFihFQmQoeBUC5ITLHSZrsMTSc6UHNRSRPi7AgWQP4+LxZNSrrG6eTK fhHw== X-Received: by 10.152.22.135 with SMTP id d7mr24271156laf.46.1415550638537; Sun, 09 Nov 2014 08:30:38 -0800 (PST) Original-Received: by 10.112.202.106 with HTTP; Sun, 9 Nov 2014 08:30:38 -0800 (PST) In-Reply-To: <545F94E4.5060102@dancol.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:95773 --089e0158b9c6f8c29305076f9054 Content-Type: text/plain; charset=UTF-8 > > How can this be a bug in our code? Wraparound of unsigned values is > well-defined. True, it is well-defined, but it was not intended for sure, hence it's a 100% bug. Eli's term of "undefined behavior" was an exaggeration I think. I don't think the compiler is justified in making this optimization. > Since when is an infinite loop undefined behavior? GCC has no right to > alter program semantics in this case, loop unrolling or no. I would agree here, throwing out wrapped loop is just too much even though such loop was unintended. GCC should have either left it alone since it is infinite or make a warning. I think this case is still worth showing to GCC developers. --089e0158b9c6f8c29305076f9054 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
How can this be a bug in our code? Wrapar= ound of unsigned values is
well-defined.

True, it is well-defined, but it was not intended for sure, hence it's= a 100% bug. Eli's term of "undefined behavior" was an exagge= ration I think.

I don't think the compiler is justified in m= aking this optimization.
Since when is an infinite loop undefined behavi= or? GCC has no right to
alter program semantics in this case, loop unrol= ling or no.

I would agree here, throwing out wrapped loop is just too much= even though such loop was unintended. GCC should have either left it alone= since it is infinite or make a warning. I think this case is still worth s= howing to GCC developers.
--089e0158b9c6f8c29305076f9054--