* [patch] fix for the gcc -O3 miscompilation
@ 2006-08-19 9:29 Jindrich Makovicka
2006-08-21 8:56 ` Andreas Schwab
0 siblings, 1 reply; 2+ messages in thread
From: Jindrich Makovicka @ 2006-08-19 9:29 UTC (permalink / 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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [patch] fix for the gcc -O3 miscompilation
2006-08-19 9:29 [patch] fix for the gcc -O3 miscompilation Jindrich Makovicka
@ 2006-08-21 8:56 ` Andreas Schwab
0 siblings, 0 replies; 2+ messages in thread
From: Andreas Schwab @ 2006-08-21 8:56 UTC (permalink / raw)
Cc: emacs-devel
Jindrich Makovicka <makovick@gmail.com> writes:
> 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.
IMHO it would be much cleaner to define NO_ARG_ARRAY for all
configurations (effectively removing the option).
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-08-21 8:56 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-19 9:29 [patch] fix for the gcc -O3 miscompilation Jindrich Makovicka
2006-08-21 8:56 ` Andreas Schwab
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.