From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jindrich Makovicka Newsgroups: gmane.emacs.devel Subject: [patch] fix for the gcc -O3 miscompilation Date: Sat, 19 Aug 2006 11:29:28 +0200 Message-ID: <20060819112928.06011846@holly.localdomain> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary=MP_bCzBRVNSPKdrj9msd3kVJsL X-Trace: sea.gmane.org 1156134453 6378 80.91.229.2 (21 Aug 2006 04:27:33 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 21 Aug 2006 04:27:33 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Aug 21 06:27:32 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GF1Nn-0008PP-Jq for ged-emacs-devel@m.gmane.org; Mon, 21 Aug 2006 06:27:31 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GF1Nn-0006pS-11 for ged-emacs-devel@m.gmane.org; Mon, 21 Aug 2006 00:27:27 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GEN97-0005hN-3u for emacs-devel@gnu.org; Sat, 19 Aug 2006 05:29:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GEN93-0005hB-0U for emacs-devel@gnu.org; Sat, 19 Aug 2006 05:29:36 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GEN92-0005h8-TM for emacs-devel@gnu.org; Sat, 19 Aug 2006 05:29:32 -0400 Original-Received: from [82.208.33.2] (helo=www.suchdol.net) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GENFw-0005F3-QX for emacs-devel@gnu.org; Sat, 19 Aug 2006 05:36:41 -0400 Original-Received: from holly (unknown [10.19.252.3]) by www.suchdol.net (Postfix) with ESMTP id 1F8FE1BE0 for ; Sat, 19 Aug 2006 11:29:30 +0200 (CEST) Original-Received: by holly (Postfix, from userid 1000) id 386E2D7F35; Sat, 19 Aug 2006 11:29:29 +0200 (CEST) Original-To: emacs-devel@gnu.org X-Mailer: Sylpheed-Claws 2.4.0 (GTK+ 2.8.20; i486-pc-linux-gnu) X-Mailman-Approved-At: Mon, 21 Aug 2006 00:27:14 -0400 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:58586 Archived-At: --MP_bCzBRVNSPKdrj9msd3kVJsL Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi, the attached patch fixes the long standing breakage when compiling emacs with newer gcc and -O3 flag. The problem is that -O3 enables automatic function inlining, which optimizes out the arguments for the function invocations within eval.c and fns.c, but the functions expect these values on stack. Adding the "noinline" attribute to these functions used within eval.c of fns.c seems to solve the problem. (please Cc:, I am not a subscriber) Regards, -- Jindrich Makovicka --MP_bCzBRVNSPKdrj9msd3kVJsL Content-Type: text/x-patch; name=inline.patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=inline.patch Index: eval.c =================================================================== RCS file: /sources/emacs/emacs/src/eval.c,v retrieving revision 1.271 diff -u -r1.271 eval.c --- eval.c 18 Jul 2006 16:33:45 -0000 1.271 +++ eval.c 19 Aug 2006 09:20:10 -0000 @@ -199,6 +202,9 @@ static Lisp_Object funcall_lambda P_ ((Lisp_Object, int, Lisp_Object*)); static void unwind_to_catch P_ ((struct catchtag *, Lisp_Object)) NO_RETURN; + +Lisp_Object apply1 () __attribute__((noinline)); +Lisp_Object call2 () __attribute__((noinline)); void init_eval_once () Index: fns.c =================================================================== RCS file: /sources/emacs/emacs/src/fns.c,v retrieving revision 1.413 diff -u -r1.413 fns.c --- fns.c 26 Jul 2006 18:16:14 -0000 1.413 +++ fns.c 19 Aug 2006 09:20:11 -0000 @@ -387,7 +387,7 @@ return i1 < SCHARS (s2) ? Qt : Qnil; } -static Lisp_Object concat (); +static Lisp_Object concat () __attribute__((noinline)); /* ARGSUSED */ Lisp_Object --MP_bCzBRVNSPKdrj9msd3kVJsL Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-devel mailing list Emacs-devel@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-devel --MP_bCzBRVNSPKdrj9msd3kVJsL--