all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jindrich Makovicka <makovick@gmail.com>
Subject: [patch] fix for the gcc -O3 miscompilation
Date: Sat, 19 Aug 2006 11:29:28 +0200	[thread overview]
Message-ID: <20060819112928.06011846@holly.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 481 bytes --]

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

[-- Attachment #2: inline.patch --]
[-- Type: text/x-patch, Size: 997 bytes --]

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));
 \f
 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;
 }
 \f
-static Lisp_Object concat ();
+static Lisp_Object concat () __attribute__((noinline));
 
 /* ARGSUSED */
 Lisp_Object

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

             reply	other threads:[~2006-08-19  9:29 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-19  9:29 Jindrich Makovicka [this message]
2006-08-21  8:56 ` [patch] fix for the gcc -O3 miscompilation Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060819112928.06011846@holly.localdomain \
    --to=makovick@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.