Generate annotations for a binary translator

2011-05-12 Thread 陳韋任
Hi, all I am wondering if there is any possibility that gcc can generate annotations like control flow, or register usage into the executable. The idea comes from the paper below, Techniques to improve dynamic binary optimization http://www-users.cs.umn.edu/~adas/adas-thesis-embed.pdf The

Re: More atomic functions please

2011-05-12 Thread Jakub Jelinek
On Fri, May 13, 2011 at 07:55:44AM +0200, Piotr Wyderski wrote: > Jakub Jelinek wrote: > > >  /* X86_TUNE_USE_INCDEC */ > >  ~(m_PENT4 | m_NOCONA | m_CORE2I7 | m_GENERIC | m_ATOM), > > > > So, if you say -mtune=bdver1 or -mtune=k8, it will generate incl, > > if addl is better (e.g. on Atom incl is

Re: More atomic functions please

2011-05-12 Thread Piotr Wyderski
Jakub Jelinek wrote: >  /* X86_TUNE_USE_INCDEC */ >  ~(m_PENT4 | m_NOCONA | m_CORE2I7 | m_GENERIC | m_ATOM), > > So, if you say -mtune=bdver1 or -mtune=k8, it will generate incl, > if addl is better (e.g. on Atom incl is very bad compared to addl $1), > it will generate it. Why is lock inc/dec wo

Re: Can the size of pointers to data and text be different?

2011-05-12 Thread Ian Lance Taylor
fanqifei writes: > I am using gcc4.3.2. > In our microcontroller, move instruction(mov reg, imm) can accept > 16bits and 32bits immediate operand. > The data memory size is less than 64KB, however, code memory size is > larger than 64KB. > The immediate operand may be addresses of variables in da

gcc-4.5-20110512 is now available

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

Re: More atomic functions please

2011-05-12 Thread Jakub Jelinek
On Thu, May 12, 2011 at 06:11:59PM +0200, Piotr Wyderski wrote: > Unfortunately, onx86/x64 both are compiled in a rather poor way: > > __sync_increment: > > lock addl $x01,(ptr) > > which is longer than: > >lock incl (ptr) GCC actually generates lock incl (ptr) already now, it just dep

Re: More atomic functions please

2011-05-12 Thread Jakub Jelinek
On Thu, May 12, 2011 at 06:11:59PM +0200, Piotr Wyderski wrote: > Hello, > > I'm not sure if it should be better handled as missed optimization, > but there is a certain lack of functionality in the GCC's __sync_* > function family. > > When implementing a reference counting smart pointer, two op

Re: More atomic functions please

2011-05-12 Thread Joseph S. Myers
On Thu, 12 May 2011, Piotr Wyderski wrote: > Hello, > > I'm not sure if it should be better handled as missed optimization, > but there is a certain lack of functionality in the GCC's __sync_* > function family. I don't think we should add new functions to that family; instead the aim should be

More atomic functions please

2011-05-12 Thread Piotr Wyderski
Hello, I'm not sure if it should be better handled as missed optimization, but there is a certain lack of functionality in the GCC's __sync_* function family. When implementing a reference counting smart pointer, two operations are of crucial importance: void __sync_increment(T* p); bool

Can the size of pointers to data and text be different?

2011-05-12 Thread fanqifei
I am using gcc4.3.2. In our microcontroller, move instruction(mov reg, imm) can accept 16bits and 32bits immediate operand. The data memory size is less than 64KB, however, code memory size is larger than 64KB. The immediate operand may be addresses of variables in data sections and function pointe

Re: Non-optimal stack usage with C++ temporaries

2011-05-12 Thread Richard Guenther
On Wed, May 11, 2011 at 10:15 PM, Matt Fischer wrote: > I've noticed some behavior with g++ that seems strange to me.  I don't > know if there's some technicality in the C++ standard that requires > this, or if it's just a limitation to the optimization code, but it > seemed strange so I thought I

Re: basic bloc chaining: using dominance

2011-05-12 Thread Richard Guenther
On Wed, May 11, 2011 at 10:03 PM, Ian Lance Taylor wrote: > Pierre Vittet writes: > >> First, thanks for your help. I have looked at several function using >> calculate_dominance_info(). From what I understand, when you have >> finish to use it, you have to clear the structure by making a >> free

Re: Why is this a problem in the C++ bootstrap and not the normal one ?

2011-05-12 Thread Gabriel Dos Reis
On Thu, May 12, 2011 at 1:32 AM, Toon Moene wrote: > ../../gcc/gcc/objc/objc-next-runtime-abi-02.c: In function 'const char* > newabi_append_ro(const char*)': > ../../gcc/gcc/objc/objc-next-runtime-abi-02.c:1885:29: error: invalid > conversion from 'const char*' to 'char*' [-fpermissive] > > I ha

Re: adding an argument for test execution in testsuite

2011-05-12 Thread Nenad Vukicevic
It is unfortunate that UPC program cannot use dg-additional-sources as we would need to change our run-time to support this option. By the time we reach "main" run-time is already initialized to support specified number of threads. One of the options might be to define a default number of threads