[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Anyone built Emacs with gcc-3.3?
From: |
Paul Eggert |
Subject: |
Re: Anyone built Emacs with gcc-3.3? |
Date: |
Sun, 13 Jul 2003 22:52:44 -0700 (PDT) |
> From: Simon Leinen <address@hidden>
> Date: Sun, 13 Jul 2003 16:56:09 +0200
>
> Do you think it would be useful for me to test your patches in other
> compilation modes as well?
I am testing 32-bit Solaris sparc (both Solaris 8 and 9) in everyday
use, so you needn't bother with those cases. It'd be nice to test it
on older Solaris releases.
However, I discovered that the zero-initializer changes
<http://mail.gnu.org/archive/html/emacs-devel/2003-07/msg00207.html>
are not needed on Solaris 8 or 9, since unexelf.c does not attempt to
make any of the initialized data read-only.
On further thought, those changes are not urgent: they are only an
optimization, and they help only on hosts where dumping the 'pure'
array into readonly text is a real performance win. This used to be a
big deal (15 years ago, say), but I suspect it's not that important
these days. Certainly small things like scalars are not worth
worrying about now, from a performance viewpoint; only arrays like
'pure' matter.
Since the zero-initializer changes don't fix any real bug that I know
of, I didn't install them into the RC branch. And I omitted the
proposed changes to scalars, leaving only the following small change
that I just installed into the trunk.
2003-07-13 Paul Eggert <address@hidden>
GCC 3.3 (sparc) no longer puts "int foo = 0;" into data; it
puts it into BSS instead, at least on Solaris 8 and 9.
This is a valid optimization, and it may occur on other platforms,
so Emacs should not assume that initializing a static variable to
zero puts it into data.
* alloc.c (pure, staticvec):
Initialize these arrays to nonzero, so that they're not
put into BSS by that optimization.
Index: alloc.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/alloc.c,v
retrieving revision 1.314
retrieving revision 1.315
diff -p -u -r1.314 -r1.315
--- alloc.c 14 Jul 2003 02:51:08 -0000 1.314
+++ alloc.c 14 Jul 2003 05:37:52 -0000 1.315
@@ -185,9 +185,10 @@ Lisp_Object Vmemory_full;
#ifndef HAVE_SHM
-/* Force it into data space! */
+/* Force it into data space! Initialize it to a nonzero value;
+ otherwise some compilers put it into BSS. */
-EMACS_INT pure[PURESIZE / sizeof (EMACS_INT)] = {0,};
+EMACS_INT pure[PURESIZE / sizeof (EMACS_INT)] = {1,};
#define PUREBEG (char *) pure
#else /* HAVE_SHM */
@@ -404,10 +405,11 @@ static void check_gcpros P_ ((void));
struct gcpro *gcprolist;
-/* Addresses of staticpro'd variables. */
+/* Addresses of staticpro'd variables. Initialize it to a nonzero
+ value; otherwise some compilers put it into BSS. */
#define NSTATICS 1280
-Lisp_Object *staticvec[NSTATICS] = {0};
+Lisp_Object *staticvec[NSTATICS] = {&Vpurify_flag};
/* Index of next unused slot in staticvec. */
Re: Anyone built Emacs with gcc-3.3?, Dave Love, 2003/07/08
RE: Anyone built Emacs with gcc-3.3?, Marshall, Simon, 2003/07/08