Re: adding destroyable objects into Ggc

2011-10-18 Thread Gabriel Dos Reis
On Wed, Oct 19, 2011 at 1:22 AM, Basile Starynkevitch wrote: > I do think that the fact that some other big free software starts by > explaining how to > manage their memory is significant. Storage management is important. However, I believe it is a mistake to focus only on that or to start th

Re: adding destroyable objects into Ggc

2011-10-18 Thread Basile Starynkevitch
On Wed, 19 Oct 2011 01:16:03 -0500 Gabriel Dos Reis wrote: > On Wed, Oct 19, 2011 at 1:00 AM, Basile Starynkevitch > wrote: > > > However, I don't often see the people arguing against Ggc talking about the > > difficulties > > for GCC newscomers to dive inside GCC and be able to propose code.

adding destroyable objects into Ggc

2011-10-18 Thread Gabriel Dos Reis
On Wed, Oct 19, 2011 at 1:00 AM, Basile Starynkevitch wrote: > However, I don't often see the people arguing against Ggc talking about the > difficulties > for GCC newscomers to dive inside GCC and be able to propose code. From my experience, the difficulty for newcomer to get into GCC source c

Re: adding destroyable objects into Ggc

2011-10-18 Thread Chiheng Xu
On Wed, Oct 19, 2011 at 1:44 PM, Basile Starynkevitch wrote: > > If you want to extend, alter or improve GCC source code in a garbage > collected language, > please consider trying MELT (see http://gcc-melt.org/ for more). MELT is a > domain > specific language (garbage collected, lispy syntax,

Re: adding destroyable objects into Ggc

2011-10-18 Thread Chiheng Xu
On Wed, Oct 19, 2011 at 1:45 PM, Gabriel Dos Reis wrote: > There is no reason to assume or to believe that people who argue for > less GC aren't familiar with GC --  a regrettably  not so uncommon > jugemental mistake. > > In fact, the book you mention has been part of my essential books since > t

Re: adding destroyable objects into Ggc

2011-10-18 Thread Basile Starynkevitch
On Wed, 19 Oct 2011 00:45:58 -0500 Gabriel Dos Reis wrote: > > There is no reason to assume or to believe that people who argue for > less GC aren't familiar with GC -- a regrettably not so uncommon > jugemental mistake. However, I don't often see the people arguing against Ggc talking about

Re: adding destroyable objects into Ggc

2011-10-18 Thread Gabriel Dos Reis
On Wed, Oct 19, 2011 at 12:22 AM, Chiheng Xu wrote: > I recommend people interested in automatic dynamic memory management > to read this book: > Garbage Collection: Algorithms For Automatic Dynamic Memory > Management(Richard Jones,1996) There is no reason to assume or to believe that people wh

Re: adding destroyable objects into Ggc

2011-10-18 Thread Basile Starynkevitch
On Wed, 19 Oct 2011 13:22:41 +0800 Chiheng Xu wrote: > > Basile, I completely agree with you. > > I recommend people interested in automatic dynamic memory management > to read this book: > Garbage Collection: Algorithms For Automatic Dynamic Memory > Management(Richard Jones,1996) > > The impo

Re: adding destroyable objects into Ggc

2011-10-18 Thread Chiheng Xu
On Wed, Oct 19, 2011 at 1:13 AM, Basile Starynkevitch wrote: > > Historically, it was the opposite: I do recognize the importance of garbage > collection, > and because of the importance of Ggc in GCC, I designed MELT garbage > collection above Ggc. > > > My strong belief is that any *big* compi

Re: [4.6 branch] Issue with C++ references.

2011-10-18 Thread Jason Merrill
On 10/18/2011 09:57 AM, Yvan ROUX wrote: int main() { const int Ci = 0; const int&rCi = Ci; if (!(&Ci ==&rCi)) return 1; return 0; } The program has the expected behaviour if you use a 4.5 gcc or the trunk, but if you compile it with a 4.6 one (even with the b

RE: Expanding instructions with condition codes inter-deps

2011-10-18 Thread Paul_Koning
>From: gcc-ow...@gcc.gnu.org [mailto:gcc-ow...@gcc.gnu.org] On Behalf Of >Richard Henderson >On 10/17/2011 03:50 AM, Paulo J. Matos wrote: >>... >> (for example, it would be ok to output negqi2, xorqi3 and >> addc_internal since xorqi3 only sets N and Z, not the Carry bit) > >For that you'd have

Re: Expanding instructions with condition codes inter-deps

2011-10-18 Thread Richard Henderson
On 10/17/2011 03:50 AM, Paulo J. Matos wrote: > Hi, > > To negate a double word (HImode) register, I used to take the instruction all > the way to assembly generation and then expand into three assembly > instructions like so: > xor %t0, # ; invert bits in top word of op0 > nadd %b0, #0

gcc-4.4-20111018 is now available

2011-10-18 Thread gccadmin
Snapshot gcc-4.4-20111018 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/4.4-20111018/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 4.4 SVN branch with the following options: svn://gcc.gnu.org/svn/gcc/branches

Re: adding destroyable objects into Ggc

2011-10-18 Thread Jonathan Wakely
On 18 October 2011 21:52, Basile Starynkevitch wrote: > > I actually meant _ptr template C++ class. > > I don't know them much. Any pointers to a tutorial to these smart or whatever > you call > them _ptr-s? You could try http://www.boost.org/libs/smart_ptr/

Re: adding destroyable objects into Ggc

2011-10-18 Thread Basile Starynkevitch
On Tue, 18 Oct 2011 14:42:34 -0500 Gabriel Dos Reis wrote: > On Tue, Oct 18, 2011 at 12:41 PM, Basile Starynkevitch > wrote: > > > However, I don't know very well auto_ptr. > > why do you believe you have to focus on auto_ptr? I actually meant _ptr template C++ class. I don't know them much.

Re: adding destroyable objects into Ggc

2011-10-18 Thread Gabriel Dos Reis
On Tue, Oct 18, 2011 at 1:48 PM, Basile Starynkevitch wrote: > So I thought that >  delete (p) p; > actually called p->~C() > No. This is one of the reasons why you should not read too much into "manual storage management". Most of the time, you don't have to say delete. And if you do, think

Re: adding destroyable objects into Ggc

2011-10-18 Thread Gabriel Dos Reis
On Tue, Oct 18, 2011 at 1:03 PM, Basile Starynkevitch wrote: > On Tue, 18 Oct 2011 18:53:07 +0100 > Jonathan Wakely wrote: > >> On 18 October 2011 16:12, Basile Starynkevitch wrote: >> > >> > Of course, with C++, the destructor routine is really what C++ calls a >> > destructor, e.g >> > somethi

Re: adding destroyable objects into Ggc

2011-10-18 Thread Gabriel Dos Reis
On Tue, Oct 18, 2011 at 12:50 PM, Ian Lance Taylor wrote: > Before we introduced garbage collection, gcc used pools (well, obstacks), When I started in 1997, obstack was still there and it isn't that long ago, so things do move fast -- for a large software like GCC. > but there were severe > pro

Re: adding destroyable objects into Ggc

2011-10-18 Thread Gabriel Dos Reis
On Tue, Oct 18, 2011 at 12:41 PM, Basile Starynkevitch wrote: > However, I don't know very well auto_ptr. why do you believe you have to focus on auto_ptr?

Re: adding destroyable objects into Ggc

2011-10-18 Thread Gabriel Dos Reis
On Tue, Oct 18, 2011 at 12:13 PM, Basile Starynkevitch wrote: > And in my perception, auto_ptr are a poor man's way of implementing a garbage > collection, > it is not a way to avoid it. I saw several mentions of smart pointers, and no mention -- except in this message I am replying to -- of au

Re: adding destroyable objects into Ggc

2011-10-18 Thread Basile Starynkevitch
On Tue, 18 Oct 2011 19:39:03 +0100 Jonathan Wakely wrote: > 3) the placement delete in is a no-op I thought every delete in C++ calls the destructor, and that the placement delete does only that. I mean that a delete statement does two things: invoke the destructor first, and then does whateve

Re: adding destroyable objects into Ggc

2011-10-18 Thread Jonathan Wakely
On 18 October 2011 19:03, Basile Starynkevitch wrote: > On Tue, 18 Oct 2011 18:53:07 +0100 > Jonathan Wakely wrote: > >> On 18 October 2011 16:12, Basile Starynkevitch wrote: >> > >> > Of course, with C++, the destructor routine is really what C++ calls a >> > destructor, e.g >> > something like

Re: adding destroyable objects into Ggc

2011-10-18 Thread Basile Starynkevitch
On Tue, 18 Oct 2011 10:50:11 -0700 Ian Lance Taylor wrote: > > I think a better approach here is likely to be a reference counted > shared_ptr for the > most general case. It's true that it works poorly with cycles, but > gcc data structures > are only occasionally cyclical. > > Also, I think t

Re: adding destroyable objects into Ggc

2011-10-18 Thread Basile Starynkevitch
On Tue, 18 Oct 2011 18:53:07 +0100 Jonathan Wakely wrote: > On 18 October 2011 16:12, Basile Starynkevitch wrote: > > > > Of course, with C++, the destructor routine is really what C++ calls a > > destructor, e.g > > something like extern "C" void my_destructor_for_class_C (class C* p) > > { del

Re: adding destroyable objects into Ggc

2011-10-18 Thread Jonathan Wakely
On 18 October 2011 16:12, Basile Starynkevitch wrote: > > Of course, with C++, the destructor routine is really what C++ calls a > destructor, e.g > something like extern "C" void my_destructor_for_class_C (class C* p) > { delete (p) p; // call the placement version of operator delete, from > C+

Re: adding destroyable objects into Ggc

2011-10-18 Thread Ian Lance Taylor
On Tue, Oct 18, 2011 at 10:41 AM, Basile Starynkevitch wrote: > On Tue, 18 Oct 2011 10:36:08 -0700 > Ian Lance Taylor wrote: > >> On Tue, Oct 18, 2011 at 10:13 AM, Basile Starynkevitch >> wrote: >> > >> > Still, I find strange that while some very smart & nice GCC guys want to >> > get rid of G

Re: adding destroyable objects into Ggc

2011-10-18 Thread Jonathan Wakely
On 18 October 2011 18:41, Basile Starynkevitch wrote: > > However, I don't know very well auto_ptr.  Could you explain to use how do > they deal with > *circular* memory references (perhaps by taking as examples code inside > GCC). > My feeling is that auto_ptr is not able to deal with them,

Re: adding destroyable objects into Ggc

2011-10-18 Thread Basile Starynkevitch
On Tue, 18 Oct 2011 10:36:08 -0700 Ian Lance Taylor wrote: > On Tue, Oct 18, 2011 at 10:13 AM, Basile Starynkevitch > wrote: > > > > Still, I find strange that while some very smart & nice GCC guys want to > > get rid of Ggc, > > no patch made into the trunk towards that goal (which I Basile di

Re: adding destroyable objects into Ggc

2011-10-18 Thread Ian Lance Taylor
On Tue, Oct 18, 2011 at 10:13 AM, Basile Starynkevitch wrote: > > Still, I find strange that while some very smart & nice GCC guys want to get > rid of Ggc, > no patch made into the trunk towards that goal (which I Basile dislike and > don't share, > so don't expect me Basile to work on this.).

Re: register allocation in gcc

2011-10-18 Thread vikramsp
I got you. Paulo J. Matos-3 wrote: > > On 18/10/11 06:12, vikramsp wrote: >> >> In my .md file there is an insn >> (define_insn abssf2 >> >> >> (clobber (match_scratch 2 "")) >> >> the %2 register is allocated as r0 in the real code. >> My problem is that i want o

Re: adding destroyable objects into Ggc

2011-10-18 Thread Basile Starynkevitch
On Tue, 18 Oct 2011 09:35:16 -0700 Ian Lance Taylor wrote: > [...] I understand that you want to take advantage > of the gcc garbage collector for the MELT plugin. However, in my ideal > world you should be planning for the MELT plugin to take over garbage > collection entirely, rather than rely

Re: adding destroyable objects into Ggc

2011-10-18 Thread Ian Lance Taylor
On Tue, Oct 18, 2011 at 9:52 AM, Basile Starynkevitch wrote: > > But [independently of MELT] I don't believe that GCC will be able to return > to manual > memory management. There have been valid reasons (long time ago) to implement > Ggc, and as > far as I understand GCC, I don't see these reas

Re: adding destroyable objects into Ggc

2011-10-18 Thread Basile Starynkevitch
On Tue, 18 Oct 2011 09:35:16 -0700 Ian Lance Taylor wrote: > Basile Starynkevitch writes: > > > I would like to add destroyable objects into Ggc (the GCC garbage > > collector, see files > > gcc/ggc*.[ch]). > > I think this type of thing is conventionally called a "finalizer". Yes, if you li

Re: adding destroyable objects into Ggc

2011-10-18 Thread Gabriel Dos Reis
On Tue, Oct 18, 2011 at 11:35 AM, Ian Lance Taylor wrote: > I think this type of thing is conventionally called a "finalizer". > > I'm ambivalent leaning to negative to adding this feature to the gcc > garbage collector.  In the long run I would like to use the gcc garbage > collector less and le

Re: adding destroyable objects into Ggc

2011-10-18 Thread Ian Lance Taylor
Basile Starynkevitch writes: > I would like to add destroyable objects into Ggc (the GCC garbage collector, > see files > gcc/ggc*.[ch]). I think this type of thing is conventionally called a "finalizer". I'm ambivalent leaning to negative to adding this feature to the gcc garbage collector.

Re: adding destroyable objects into Ggc

2011-10-18 Thread Basile Starynkevitch
On Tue, 18 Oct 2011 17:19:56 +0200 Duncan Sands wrote: > Hi Basile, > > > I would like to add destroyable objects into Ggc (the GCC garbage > > collector, see files > > gcc/ggc*.[ch]). > > > > The main motivation is to permit C++ objects to be garbage collected (I > > discussed that > > briefl

Re: adding destroyable objects into Ggc

2011-10-18 Thread Duncan Sands
Hi Basile, I would like to add destroyable objects into Ggc (the GCC garbage collector, see files gcc/ggc*.[ch]). The main motivation is to permit C++ objects to be garbage collected (I discussed that briefly in the Gcc meeting at Google in London): adding destroyable object is a prerequisite

adding destroyable objects into Ggc

2011-10-18 Thread Basile Starynkevitch
Hello All, I would like to add destroyable objects into Ggc (the GCC garbage collector, see files gcc/ggc*.[ch]). The main motivation is to permit C++ objects to be garbage collected (I discussed that briefly in the Gcc meeting at Google in London): adding destroyable object is a prerequisite f

Re: AIX library issues

2011-10-18 Thread David Edelsohn
On Mon, Oct 17, 2011 at 10:05 PM, Perry Smith wrote: > dump -H libstdc++.so.6 > > ./powerpc-ibm-aix6.1.0.0/libstdc++-v3/src/.libs/libstdc++.so.6.orig: > >                        ***Loader Section*** >                      Loader Header Information > VERSION#         #SYMtableENT     #RELOCent    

[4.6 branch] Issue with C++ references.

2011-10-18 Thread Yvan ROUX
Hi, I have the small program below, which check the binding of a reference : int main() { const int Ci = 0; const int &rCi = Ci; if (!(&Ci == &rCi)) return 1; return 0; } If my understanding of the standard (8.5.3) is correct, the reference is an lvalue (rCi), the

Re: Function Name from CALL_INSN RTX

2011-10-18 Thread Ian Lance Taylor
"Iyer, Balaji V" writes: > Thanks for the help Ian. The function get_callee_fndecl takes in a tree and > returns a tree. I would like to get the function name from the RTX. Is there > a function for this purpose? Please don't top-post. Thanks. Sorry about that, I overlooked that you wanted

RE: Function Name from CALL_INSN RTX

2011-10-18 Thread Iyer, Balaji V
Thanks for the help Ian. The function get_callee_fndecl takes in a tree and returns a tree. I would like to get the function name from the RTX. Is there a function for this purpose? Thanks, Balaji V. Iyer. From: Ian Lance Taylor [i...@google.com] Sent

Re: Use of FLAGS_REGNUM clashes with generates insn

2011-10-18 Thread amylaar
Quoting Hans-Peter Nilsson : On Fri, 23 Sep 2011, Joern Rennecke wrote: Quoting "Paulo J. Matos" : > My addition instruction sets all the flags. So I have: This is annoying, but can be handled. Been there, done that. dse.c needs a small patch, which I intend to submit sometime in the future

Re: register allocation in gcc

2011-10-18 Thread Paulo J. Matos
On 18/10/11 06:12, vikramsp wrote: In my .md file there is an insn (define_insn abssf2 (clobber (match_scratch 2 "")) the %2 register is allocated as r0 in the real code. My problem is that i want other than r0 to be allocated for operand 2. Please help how to do t

Re: Expanding instructions with condition codes inter-deps

2011-10-18 Thread Paulo J. Matos
On 17/10/11 17:20, Andrew Pinski wrote: On Mon, Oct 17, 2011 at 3:50 AM, Paulo J. Matos wrote: addc_internal looks like: (define_insn "addc_internal" [(set (match_operand:QI 0 "nonimmediate_operand" "=c") (plus:QI (plus:QI (ltu:QI (reg:CC RCC) (const_int 0))

Re: AIX library issues

2011-10-18 Thread Jonathan Wakely
On 18 October 2011 09:21, Jonathan Wakely wrote: > On 18 October 2011 03:05, Perry Smith wrote: >> I've discovered an issue which I can't believe I'm the first to bump >> in to. > > Isn't this covered by these FAQs? > http://gcc.gnu.org/faq.html#rpath > http://gcc.gnu.org/onlinedocs/libstdc++/faq.h

Re: AIX library issues

2011-10-18 Thread Jonathan Wakely
On 18 October 2011 03:05, Perry Smith wrote: > I've discovered an issue which I can't believe I'm the first to bump > in to. Isn't this covered by these FAQs? http://gcc.gnu.org/faq.html#rpath http://gcc.gnu.org/onlinedocs/libstdc++/faq.html#faq.how_to_set_paths