Re: Trace crash in gargabe collector to the code at fault?

2009-08-30 Thread Oliver Kellogg
On Fri, 2009-08-28 at 06:58 -0700, Ian Lance Taylor wrote:
> oliver.kell...@t-online.de (Oliver Kellogg) writes:
> 
> > In multi source compile mode, I ggc_free() the data in dwarf2out.c after
> > code generation for a file is done. (I found that I need this because
> > otherwise the assembly code generated for file_2 to file_N of a compile
> > job will carry leftovers from the code generated for file_1.)
> 
> I believe that as long we have a garbage collector, ggc_free should be
> used very very rarely, only when there is clear evidence that it reduces
> memory usage.  If you just want to stop referring to memory, you should
> simply set the pointer to NULL.  There is no point to having a garbage
> collector if we don't take advantage of it.
> 
> Ian

As mentioned, I'm still struggling with leftovers being carried over
from compilation 1 to N-1 into compilation N of a compile job.
gcc_free'ing things (in combination with "configure
--enable-checking=gc,gcac") helps me track down objects that should have
been reset. When the files of a compile job are disjoint (i.e. they do
not share common declarations) then IMHO freeing really makes sense.
Also I believe that this exercise will help me learn more about GCC
internals.

Once the multi source compilation is working in this mode, with complete
reset of all backend artefacts before compiling a file of a compile job,
then I might look at freeing things more intelligently, e.g. freeing
only the artefacts that correspond to non-inlined functions and
file-local declarations but leaving the trees for globally visible
declarations intact for reuse by the compilation of further files of the
compile job.

A next step after that may be to look at Tom Tromey's incremental-
compiler branch and see whether it is possible to integrate my changes
there. I would be looking at running the incremental compiler in a
serverless mode more similar to the way GCC works now, where trees are
constructed and shared only within a single compile job (i.e. the
backend is called only once but with many files as the argument list,
and the trees are only reused throughout the compilations of these files
but do not continue to exist beyond the backend invocation lifetime.)

Oliver




letter to GCC Steering Committee, Streamnovation Ltd.

2009-08-30 Thread Adam Rak
Dear GCC Steering Committee,

We are a forming company (StreamNovation Ltd.) from Hungary, and we
would like to ask your attitude about our plans. We are intending to
implement a plugin for GCC 4.5 which makes it possible to utilize the
GPU (graphics processing unit) semi-automatically (later
fully-automatically). We are planning to implement it as a free
software according to GPL, but we would also like to sell it in a box,
and get paid for personal support, guarantee and education.

The basic idea is to make the GPU kind of OpenMP (Open
Multi-Processing is an application programming interface (API) that
supports multi-platform shared memory multiprocessing programming in
C, C++). The GCC user marks the loop, and GCC creates a heterogeneous
binary code which runs the kernel on GPU, generated from the original
source code. We expect huge attention for this field in the next few
years. We think our plugin is in harmony with the GCC development
mission statement.

We are ready to follow any of your instructions according to GPL,
source code publicity, and legal compatibility with GPU manufacturers'
software.



Please let us know the conventions we have to follow and do not
hesitate to ask questions.

Best regards,

Ádám Rák

StreamNovation Ltd.

Práter u. 50/a. Budapest, H-1083 Hungary

Phone: +36 20 9677 199

Email: adam@streamnovation.com


Re: Trace crash in gargabe collector to the code at fault?

2009-08-30 Thread Tom Tromey
> "Oliver" == Oliver Kellogg  writes:

Oliver> As mentioned, I'm still struggling with leftovers being carried
Oliver> over from compilation 1 to N-1 into compilation N of a compile
Oliver> job.  gcc_free'ing things (in combination with "configure
Oliver> --enable-checking=gc,gcac") helps me track down objects that
Oliver> should have been reset.

This is ok as an approach to development but probably not ok for a real
patch.

If you look on the incremental branch you can find various places where
I added new functions to clean up modules before a new compilation job
is run.  This fills a similar need, if I understand your problem
correctly.  I did this in an ad hoc way, just resetting the modules I
needed, so I don't know whether or not the particular changes will be of
use to you.

Oliver> A next step after that may be to look at Tom Tromey's
Oliver> incremental- compiler branch and see whether it is possible to
Oliver> integrate my changes there. I would be looking at running the
Oliver> incremental compiler in a serverless mode more similar to the
Oliver> way GCC works now, where trees are constructed and shared only
Oliver> within a single compile job (i.e. the backend is called only
Oliver> once but with many files as the argument list, and the trees are
Oliver> only reused throughout the compilations of these files but do
Oliver> not continue to exist beyond the backend invocation lifetime.)

This sounds like the --combine switch on trunk.

The incremental compiler work is mostly orthogonal to --combine.  The C
front end changes improve --combine performance, and I used --combine as
a testbed, but I didn't touch the --combine infrastructure itself.  (I
think these changes would help with LIPO, too, but I haven't really
looked into it.)

If you wanted your modified compiler to emit separate object files for a
--combine run, then yeah, you would need something like a hybrid between
the compile server from the incremental branch and --combine.  This is
doable, maybe even easy.

Tom


ARM wmmx instructions from gcc ?

2009-08-30 Thread Danny Backx
Hi,

Does anyone know how well gcc-4.4 works with ARM and wmmx instructions ?

I'm working on cegcc. It currently says :
pavilion: {86} arm-mingw32ce-gcc -mcpu=iwmmxt t.c
t.c:1: error: iwmmxt requires an AAPCS compatible ABI for proper
operation
pavilion: {87} 

It's clear to me where in the source this message is generated.

It is not clear whether this is caused by errors in my port, or whether
gcc has some other problem with this.

Has anyone used this ?

Danny
-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info



Re: ARM wmmx instructions from gcc ?

2009-08-30 Thread Dave Korn
Danny Backx wrote:
> Hi,
> 
> Does anyone know how well gcc-4.4 works with ARM and wmmx instructions ?
> 
> I'm working on cegcc. It currently says :
> pavilion: {86} arm-mingw32ce-gcc -mcpu=iwmmxt t.c
> t.c:1: error: iwmmxt requires an AAPCS compatible ABI for proper
> operation
> pavilion: {87} 
> 
> It's clear to me where in the source this message is generated.
> 
> It is not clear whether this is caused by errors in my port, or whether
> gcc has some other problem with this.

  You should mention that long double alignment macro that the guy on the
cegcc list thought it was connected with.  ARM_DOUBLEWORD_ALIGN.  If I was
following that discussion correctly, the ABI requires it, and you have it
#defined to zero to fix the problem you were getting with float double
function argument passing, but maybe what this means is that it there's some
more fundamental problem in the ABI-related MD macros, that fixing it this way
ended up just papering over.

cheers,
  DaveK



gcc-4.3-20090830 is now available

2009-08-30 Thread gccadmin
Snapshot gcc-4.3-20090830 is now available on
  ftp://gcc.gnu.org/pub/gcc/snapshots/4.3-20090830/
and on various mirrors, see http://gcc.gnu.org/mirrors.html for details.

This snapshot has been generated from the GCC 4.3 SVN branch
with the following options: svn://gcc.gnu.org/svn/gcc/branches/gcc-4_3-branch 
revision 151230

You'll find:

gcc-4.3-20090830.tar.bz2  Complete GCC (includes all of below)

gcc-core-4.3-20090830.tar.bz2 C front end and core compiler

gcc-ada-4.3-20090830.tar.bz2  Ada front end and runtime

gcc-fortran-4.3-20090830.tar.bz2  Fortran front end and runtime

gcc-g++-4.3-20090830.tar.bz2  C++ front end and runtime

gcc-java-4.3-20090830.tar.bz2 Java front end and runtime

gcc-objc-4.3-20090830.tar.bz2 Objective-C front end and runtime

gcc-testsuite-4.3-20090830.tar.bz2The GCC testsuite

Diffs from 4.3-20090823 are available in the diffs/ subdirectory.

When a particular snapshot is ready for public consumption the LATEST-4.3
link is updated and a message is sent to the gcc list.  Please do not use
a snapshot before it has been announced that way.


Re: enable-build-with-cxx bootstrap compare broken by r149964

2009-08-30 Thread Jerry Quinn
On Thu, 2009-08-27 at 00:24 -0400, Jason Merrill wrote:
> On 08/15/2009 10:12 AM, Jerry Quinn wrote:
> > Building with --enable-build-with-cxx fails to bootstrap as follows:
> >
> > Comparing stages 2 and 3
> > warning: gcc/cc1plus-checksum.o differs
> > warning: gcc/cc1-checksum.o differs
> > Bootstrap comparison failure!
> > x86_64-unknown-linux-gnu/32/libstdc++-v3/libsupc++/eh_alloc.o differs
>  >...
> 
> Do you know why r149964 makes a difference?  The only objects that are 
> listed as differing here are from libstdc++, and changing 
> needs_fake_anon to abort rather than return true doesn't cause any 
> problems building libstdc++.  We used anonymous namespaces in the 
> library before this...

I don't know.  I didn't try to debug, I only did the bootstraps
narrowing down the offending patch.

> I tried doing the bootstrap myself, but build-with-cxx doesn't currently 
> work with glibc 2.10.  I guess I could try on a box with an older 
> install, but haven't yet.

The following patch solved bootstrapping for Pedro on Fedora 11.  It's
got the new glibc.  Tackling that issue is what got me onto this one to
begin with.  I was holding off on submitting it because I wouldn't be
able to claim that the patch bootstrapped successfully against the head
of the trunk.

Jerry


Index: gcc/configure
===
--- gcc/configure   (revision 149964)
+++ gcc/configure   (working copy)
@@ -10650,8 +10650,9 @@
 
 
 
+
 for ac_func in times clock kill getrlimit setrlimit atoll atoq \
-   sysconf strsignal getrusage nl_langinfo \
+   sysconf strsignal getrusage nl_langinfo basename \
gettimeofday mbstowcs wcswidth mmap mincore setlocale \
clearerr_unlocked feof_unlocked   ferror_unlocked fflush_unlocked
fgetc_unlocked fgets_unlocked   fileno_unlocked fprintf_unlocked
fputc_unlocked fputs_unlocked   fread_unlocked fwrite_unlocked
getchar_unlocked getc_unlocked   putchar_unlocked putc_unlocked
 do
@@ -12673,11 +12674,10 @@
 
 
 
-
 for ac_func in getenv atol asprintf sbrk abort atof getcwd getwd \
strsignal strstr strverscmp \
errno snprintf vsnprintf vasprintf malloc realloc calloc \
-   free basename getopt clock getpagesize clearerr_unlocked feof_unlocked
ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked
fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked
fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked
putchar_unlocked putc_unlocked
+   free getopt clock getpagesize clearerr_unlocked feof_unlocked
ferror_unlocked fflush_unlocked fgetc_unlocked fgets_unlocked
fileno_unlocked fprintf_unlocked fputc_unlocked fputs_unlocked
fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked
putchar_unlocked putc_unlocked
 do
   ac_tr_decl=`echo "HAVE_DECL_$ac_func" | $as_tr_cpp`
 echo "$as_me:$LINENO: checking whether $ac_func is declared" >&5
Index: gcc/config.in
===
--- gcc/config.in   (revision 149964)
+++ gcc/config.in   (working copy)
@@ -321,6 +321,12 @@
 #endif
 
 
+/* Define if your assembler supports LWSYNC instructions. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_AS_LWSYNC
+#endif
+
+
 /* Define if your assembler supports mfcr field. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_AS_MFCRF
@@ -351,23 +357,18 @@
 #endif
 
 
-/* Define if your assembler supports popcntb instruction. */
+/* Define if your assembler supports popcntb field. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_AS_POPCNTB
 #endif
 
 
-/* Define if your assembler supports popcntd instruction. */
+/* Define if your assembler supports POPCNTD instructions. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_AS_POPCNTD
 #endif
 
-/* Define if your assembler supports lwsync instruction. */
-#ifndef USED_FOR_TARGET
-#undef HAVE_AS_LWSYNC
-#endif
 
-
 /* Define if your assembler supports .register. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_AS_REGISTER_PSEUDO_OP
@@ -430,6 +431,12 @@
 #endif
 
 
+/* Define to 1 if you have the `basename' function. */
+#ifndef USED_FOR_TARGET
+#undef HAVE_BASENAME
+#endif
+
+
 /* Define to 1 if you have the `clearerr_unlocked' function. */
 #ifndef USED_FOR_TARGET
 #undef HAVE_CLEARERR_UNLOCKED
@@ -480,13 +487,6 @@
 #endif
 
 
-/* Define to 1 if we found a declaration for 'basename', otherwise
define to
-   0. */
-#ifndef USED_FOR_TARGET
-#undef HAVE_DECL_BASENAME
-#endif
-
-
 /* Define to 1 if we found a declaration for 'calloc', otherwise define
to 0.
*/
 #ifndef USED_FOR_TARGET
Index: gcc/configure.ac
===
--- gcc/configure.ac(revision 149964)
+++ gcc/configure.ac(working copy)
@@ -1016,7 +1016,7 @@
   fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
   putchar_unlocked putc_unlocked)
 AC_CHECK_FUNCS(times clock kill getrlimit setrlimit atoll atoq \
-   sysconf strsignal getrusage nl_langinfo \
+   sysconf strsignal getrusage nl_lang