public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, MELT] fix useless forcing of GCC garbage collector
@ 2011-05-09 16:25 Pierre Vittet
  2011-05-09 17:54 ` Basile Starynkevitch
  0 siblings, 1 reply; 4+ messages in thread
From: Pierre Vittet @ 2011-05-09 16:25 UTC (permalink / raw)
  To: gcc-patches

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

This patch is for the MELT branch.

My GCC contributor number is 634276.

After speaking with Basile Starynkevitch, we saw that there might be a 
useless forcing of the garbage collector in melt-runtime.c . I tested 
with the patch, and I haven't seen any problem (I could compile GCC, 
using a MELT plugin with the patched version).
I have also measured a small time improvement while compiling the file 
gcc.c (which is more that 8000 lines):

Whithout the modification:
user 	sys
1.563 	0.145s

With  the modification:
user 	sys
1.144  0.106s


Changelog:

2011-05-09  Pierre Vittet  <piervit@pvittet.com>

  	* melt-runtime.c: Remove variable forcing the garbage collector while 
it was not needed.

Thanks

Pierre Vittet

[-- Attachment #2: not_forcing_garbcoll_call.diff --]
[-- Type: text/plain, Size: 1090 bytes --]

Index: melt-runtime.c
===================================================================
--- melt-runtime.c	(revision 173571)
+++ melt-runtime.c	(working copy)
@@ -1159,16 +1159,13 @@
 			melt_nb_garbcoll, melt_startalz, melt_endalz);
   if (needfull)
     {
-      bool wasforced = ggc_force_collect;
       melt_nb_full_garbcoll++;
       debugeprintf ("melt_garbcoll #%ld fullgarbcoll #%ld",
 		    melt_nb_garbcoll, melt_nb_full_garbcoll);
       /* force major collection, with our callback */
-      ggc_force_collect = true;
-      debugeprintf ("melt_garbcoll forcing fullgarbcoll #%ld", melt_nb_full_garbcoll);
+      debugeprintf ("melt_garbcoll calling gcc_collect #%ld", melt_nb_full_garbcoll);
       ggc_collect ();
-      ggc_force_collect = wasforced;
-      debugeprintf ("melt_garbcoll forced fullgarbcoll #%ld", melt_nb_full_garbcoll);
+      debugeprintf ("melt_garbcoll after fullgarbcoll #%ld", melt_nb_full_garbcoll);
       /* Delete the unmarked specials.  */
       prevspecptr = &melt_oldspeclist;
       for (specp = melt_oldspeclist; specp; specp = nextspecp)

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH, MELT] fix useless forcing of GCC garbage collector
  2011-05-09 16:25 [PATCH, MELT] fix useless forcing of GCC garbage collector Pierre Vittet
@ 2011-05-09 17:54 ` Basile Starynkevitch
  2011-05-09 17:59   ` Basile Starynkevitch
  2011-05-09 21:56   ` Pierre Vittet
  0 siblings, 2 replies; 4+ messages in thread
From: Basile Starynkevitch @ 2011-05-09 17:54 UTC (permalink / raw)
  To: Pierre Vittet; +Cc: gcc-patches

On Mon, 09 May 2011 14:15:30 +0200
Pierre Vittet <piervit@pvittet.com> wrote:

> This patch is for the MELT branch.

The diff file was slightly wrong (diff run under gcc/). Pierre, you
should run svn diff -x -p at the top source directory to get a patch
file.

I applied the patch. The gcc/ChangeLog.MELT proposed by Pierre was
wrong, I wrote:

2011-05-09  Pierre Vittet  <piervit@pvittet.com>

	* melt-runtime.c (melt_garbcoll): Don't force collection by
	gcc_collect.

Committed revision 173576.


Folks, what is the procedure to get Pierre an svn+ssh write access to
GCC svn server (mostly for the MELT branch, and write after approval
for the rest). As far as I understood, all legal stuff has been
completed.

> My GCC contributor number is 634276.

This is the copyright assignment legal document reference for Pierre Vittet.

What does he (or me) have to do to get svn+ssh://gcc.melt.org/ write access?

Cheers.
-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH, MELT] fix useless forcing of GCC garbage collector
  2011-05-09 17:54 ` Basile Starynkevitch
@ 2011-05-09 17:59   ` Basile Starynkevitch
  2011-05-09 21:56   ` Pierre Vittet
  1 sibling, 0 replies; 4+ messages in thread
From: Basile Starynkevitch @ 2011-05-09 17:59 UTC (permalink / raw)
  To: Pierre Vittet; +Cc: gcc-patches

On Mon, 9 May 2011 19:03:54 +0200
Basile Starynkevitch <basile@starynkevitch.net> wrote:
> I applied the patch. The gcc/ChangeLog.MELT proposed by Pierre was
> wrong, I wrote:
> 
> 2011-05-09  Pierre Vittet  <piervit@pvittet.com>
> 
> 	* melt-runtime.c (melt_garbcoll): Don't force collection by
> 	gcc_collect.
> 
> Committed revision 173576.

Pierre & me forgot to update the comments, and remove the ggc_force_collect extern declaration.
So I added the following patch

Index: gcc/melt-runtime.c
===================================================================
--- gcc/melt-runtime.c	(revision 173576)
+++ gcc/melt-runtime.c	(working copy)
@@ -82,9 +82,6 @@ along with GCC; see the file COPYING3.   If not se
 /* GCC 4.6 has it: */
 #include "gimple-pretty-print.h"
 
-/* Flag ggc_force_collect is defined in ggc-internal.h so is officially not
-   public.  */
-extern bool ggc_force_collect;
 
 #endif /*GCC 4.6*/
 
@@ -1162,8 +1159,8 @@ melt_garbcoll (size_t wanted, enum melt_gckind_en
       melt_nb_full_garbcoll++;
       debugeprintf ("melt_garbcoll #%ld fullgarbcoll #%ld",
 		    melt_nb_garbcoll, melt_nb_full_garbcoll);
-      /* force major collection, with our callback */
       debugeprintf ("melt_garbcoll calling gcc_collect #%ld", melt_nb_full_garbcoll);
+      /* There is no need to force a GGC collection.  */
       ggc_collect ();
       debugeprintf ("melt_garbcoll after fullgarbcoll #%ld", melt_nb_full_garbcoll);
       /* Delete the unmarked specials.  */

with the following gcc/ChangeLog.MELT entry
2011-05-09  Basile Starynkevitch  <basile@starynkevitch.net>

	* melt-runtime.c (ggc_force_collect): Remove extern declaration.
	(melt_garbcoll): Update comment.

Cheers.

-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH, MELT] fix useless forcing of GCC garbage collector
  2011-05-09 17:54 ` Basile Starynkevitch
  2011-05-09 17:59   ` Basile Starynkevitch
@ 2011-05-09 21:56   ` Pierre Vittet
  1 sibling, 0 replies; 4+ messages in thread
From: Pierre Vittet @ 2011-05-09 21:56 UTC (permalink / raw)
  To: gcc-patches

Thanks you for the correction, I will take care next time.

Pierre
On 09/05/2011 19:03, Basile Starynkevitch wrote:
> On Mon, 09 May 2011 14:15:30 +0200
> Pierre Vittet<piervit@pvittet.com>  wrote:
>
>    
>> This patch is for the MELT branch.
>>      
> The diff file was slightly wrong (diff run under gcc/). Pierre, you
> should run svn diff -x -p at the top source directory to get a patch
> file.
>
> I applied the patch. The gcc/ChangeLog.MELT proposed by Pierre was
> wrong, I wrote:
>
> 2011-05-09  Pierre Vittet<piervit@pvittet.com>
>
> 	* melt-runtime.c (melt_garbcoll): Don't force collection by
> 	gcc_collect.
>
> Committed revision 173576.
>
>
> Folks, what is the procedure to get Pierre an svn+ssh write access to
> GCC svn server (mostly for the MELT branch, and write after approval
> for the rest). As far as I understood, all legal stuff has been
> completed.
>
>    
>> My GCC contributor number is 634276.
>>      
> This is the copyright assignment legal document reference for Pierre Vittet.
>
> What does he (or me) have to do to get svn+ssh://gcc.melt.org/ write access?
>
> Cheers.
>    

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-05-09 20:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-09 16:25 [PATCH, MELT] fix useless forcing of GCC garbage collector Pierre Vittet
2011-05-09 17:54 ` Basile Starynkevitch
2011-05-09 17:59   ` Basile Starynkevitch
2011-05-09 21:56   ` Pierre Vittet

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).