Re: Some hints on solving this problem?

2007-02-04 Thread 吴曦

Thanks for the hints, I have already noticed that insn list is match
against the RTL templates to emit assembly code. However,   I found 3 md
files, ia64.md, itanium.md, itanium2.md, each file is very big...
would you mind giving some hints on the differences between them?
Especially, I am working on itanium2 architecture. (I have found many
insn templates in ia64.md, but how about
itanium.md and itanium2.md?)

在 07-2-4,Paul Yuan<[EMAIL PROTECTED]> 写道:

1) Modify the final() in final.c to emit some code before ld and st
before outputting the assembly.
2) Modify the MD file. Find the template which generate ld or st, and
add some code before ld  and st.

On 2/3/07, 吴曦 <[EMAIL PROTECTED]> wrote:
> Hi,
> I am working on gcc 4.1.1 and Itanium2 architecture. I want to use gcc
> to emit some code before each ld and st instruction (I know that using
> dynamic binary translator like PIN may be more suitable for this task,
> but I am on the way of studying gcc and want to use it to achieve this
> goal). But after several days of study, I find that the back-end of
> gcc too complex... :-(
>
> So, what is the best level in back-end to accomplish this task?
>
> I would appreciate any help I can get on this problem!
>
> thx!
>


--
Paul Yuan
www.yingbo.com



Re: The GCC Mission Statement says nothing about conforming to international standards!?

2007-02-04 Thread Robert Dewar

Joe Buck wrote:


The result is that GCC explicitly rejects something that you might have
been taught in compiler class, that the standard is a contract between
the compiler developer and the users and that the compiler can do anything
it wants with any code that does not rigorously meet what is defined in
the standard.  Standard-conforming code should work, but the issue of
what to do with technically incorrect, but commonly occurring code is
something that we'll continue to struggle with.  In some cases, serving
the users might require going beyond the standard, in other cases, the
cost in lost opportunities for optimization might be too high.


Indeed ...

Of course it would be more controversial to depart from the standard
on the basis of making the compiler more useable, and it is hard to
see such a case, though I cam imagine a case where we decide the
standard is plain wrong, and we won't conform to it pending it
being fixed.

The fundamental goal here is to generate an effectively useable
compiler, conforming to the standard is a means to this end, not
an end in itself.

I actually think that in these cases that Joe alludes to above,
concentrating *too* much on standards compliance can be the wrong
emphasis, since it can lead to a position of "if it isn't in the
standard, we are not interested!" which is not quite the right
attitude for dealing on a case by case basis with situations where
expected behavior goes beyond what is required by the standard.

So putting conforming to the standards in the mission statement
is not only unnecessary for me, it is probably a bad idea.



Re: Some hints on solving this problem?

2007-02-04 Thread Paul Yuan

Just care ia64.md.

itanium1.md is for the description of itanium1 processor's pipeline,
and itanium2.md for the description of itanium2 processor's pipeline.
The are both used in the instruction scheduling pass.

On 2/4/07, 吴曦 <[EMAIL PROTECTED]> wrote:

Thanks for the hints, I have already noticed that insn list is match
against the RTL templates to emit assembly code. However,   I found 3 md
files, ia64.md, itanium.md, itanium2.md, each file is very big...
would you mind giving some hints on the differences between them?
Especially, I am working on itanium2 architecture. (I have found many
insn templates in ia64.md, but how about
itanium.md and itanium2.md?)

在 07-2-4,Paul Yuan<[EMAIL PROTECTED]> 写道:
> 1) Modify the final() in final.c to emit some code before ld and st
> before outputting the assembly.
> 2) Modify the MD file. Find the template which generate ld or st, and
> add some code before ld  and st.
>
> On 2/3/07, 吴曦 <[EMAIL PROTECTED]> wrote:
> > Hi,
> > I am working on gcc 4.1.1 and Itanium2 architecture. I want to use gcc
> > to emit some code before each ld and st instruction (I know that using
> > dynamic binary translator like PIN may be more suitable for this task,
> > but I am on the way of studying gcc and want to use it to achieve this
> > goal). But after several days of study, I find that the back-end of
> > gcc too complex... :-(
> >
> > So, what is the best level in back-end to accomplish this task?
> >
> > I would appreciate any help I can get on this problem!
> >
> > thx!
> >
>
>
> --
> Paul Yuan
> www.yingbo.com
>




--
Paul Yuan
www.yingbo.com


build failure? (libgfortran)

2007-02-04 Thread Dorit Nuzman

I'm seeing this bootstrap failure on i686-pc-linux-gnu (revision 121579) -
something I'm doing wrong, or is anyone else seeing this?

/home/dorit/mainline/build/./gcc/gfortran
-B/home/dorit/mainline/build/./gcc/
-B/home/dorit/mainline/i686-pc-linux-gnu/bin/
-B/home/dorit/mainline/i686-pc-linux-gnu/lib/ -isystem
/home/dorit/mainline/i686-pc-linux-gnu/include -isystem
/home/dorit/mainline/i686-pc-linux-gnu/sys-include -DHAVE_CONFIG_H -I.
-I../../../gcc/libgfortran -I. -iquote../../../gcc/libgfortran/io
-I../../../gcc/libgfortran/../gcc -I../../../gcc/libgfortran/../gcc/config
-I../.././gcc -D_GNU_SOURCE -I . -Wall -fno-repack-arrays -fno-underscoring
-fallow-leading-underscore -g -O2 -c
../../../gcc/libgfortran/intrinsics/f2c_specifics.F90 -o f2c_specifics.o
>/dev/null 2>&1
/bin/sh ./libtool --mode=link /home/dorit/mainline/build/./gcc/gfortran
-B/home/dorit/mainline/build/./gcc/
-B/home/dorit/mainline/i686-pc-linux-gnu/bin/
-B/home/dorit/mainline/i686-pc-linux-gnu/lib/ -isystem
/home/dorit/mainline/i686-pc-linux-gnu/include -isystem
/home/dorit/mainline/i686-pc-linux-gnu/sys-include -I . -Wall
-fno-repack-arrays -fno-underscoring -g -O2   -o libgfortran.la -rpath
/home/dorit/mainline/lib -version-info `grep -v '^#'
../../../gcc/libgfortran/libtool-version` -lm  compile_options.lo
environ.lo error.lo fpu.lo main.lo memory.lo pause.lo stop.lo string.lo
select.lo
.

.libs/environ.o: In function
`gnu_dev_major':/home/dorit/mainline/build/./gcc/include/sys/sysmacros.h:56:
 multiple definition of `gnu_dev_major'
.libs/compile_options.o:/home/dorit/mainline/build/./gcc/include/sys/sysmacros.h:56:
 first defined here
.libs/environ.o: In function
`gnu_dev_minor':/home/dorit/mainline/build/./gcc/include/sys/sysmacros.h:66:
 multiple definition of `gnu_dev_minor'
.libs/compile_options.o:/home/dorit/mainline/build/./gcc/include/sys/sysmacros.h:66:
 first defined here
.

.libs/in_unpack_generic.o: In function
`gnu_dev_makedev':/home/dorit/mainline/build/./gcc/include/sys/sysmacros.h:76:
 multiple definition of `gnu_dev_makedev'
.libs/compile_options.o:/home/dorit/mainline/build/./gcc/include/sys/sysmacros.h:76:
 first defined here
collect2: ld returned 1 exit status
make[3]: *** [libgfortran.la] Error 1
make[3]: Leaving directory
`/home/dorit/mainline/build/i686-pc-linux-gnu/libgfortran'
make[2]: *** [all] Error 2
make[2]: Leaving directory
`/home/dorit/mainline/build/i686-pc-linux-gnu/libgfortran'
make[1]: *** [all-target-libgfortran] Error 2
make[1]: Leaving directory `/home/dorit/mainline/build'
make: *** [all] Error 2


No special configure options (just --prefix), the system compiler is:
> gcc -v
Using built-in specs.
Target: i386-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man
--infodir=/usr/share/info --enable-shared --enable-threads=posix
--enable-checking=release --with-system-zlib --enable-__cxa_atexit
--disable-libunwind-exceptions --enable-libgcj-multifile
--enable-languages=c,c++,objc,obj-c++,java,fortran,ada
--enable-java-awt=gtk --disable-dssi
--with-java-home=/usr/lib/jvm/java-1.4.2-gcj-1.4.2.0/jre --with-cpu=generic
--host=i386-redhat-linux
Thread model: posix
gcc version 4.1.0 20060304 (Red Hat 4.1.0-3)

??

thanks,
dorit



Build failure in libgfortran (PR 30678)

2007-02-04 Thread Thomas Koenig
Hello world,

just a heads-up that libgfortran build is currently blocked at
least on i686-pc-linux-gnu with a newer glibc by PR 30678.

I won't be able to do any work on gfortran development until this
is fixed :-(

Thomas


Seeking advice on front ends

2007-02-04 Thread Yannick Gingras

Hi, 
  I'd like to write a small language.  This would be my first language
and I'm faced with several implementation options.  I have a hard time
raking them so I'd like to ask advice from the GCC users and
developers.

The language will feature dynamic typing, lexical closures and garbage
collections.  Most languages falling into this category are
implemented with a bytecode interpreter but there are also a few
notable GCC front ends.  GCC front ends are usually patches to the GCC
tree.  The front end tend to be self contained in a single language
directory with only a few modifications to the build system.  This
architecture is nice and clean but it presents problems for the
distribution of the front end.  Either a fully patched GCC source tree
is distributed or instructions on how to patch GCC must be supplied.
Alternatively a front end can convert its language to C.  GCC support
many annotations and extensions to C that will enable efficient
transfer to machine language of programming constructs common in
languages quite different from C.

My options code generations are more or less:

  1) Code an interpreter

  2) Build the parse tree in GCC's native format and let GCC generate
 the code
 
  3) Generate annotated C and call GCC on that.

I think that option 1 would represent the less work but I doubt that
it can be made efficient without major contortions.  I will probably
go that way for the first prototype but I'm afraid that I will need
something else for a production release.  

Option 2 sounds like a good deal.  The parse tree need to be build
anyway, building it in GCC's native format in the first place makes a
lot of sense.  The only problem seems to be with the distribution of
the resulting front end.  Is it possible to build such a front end by
only linking to libgcc or something like that?

Finally, option 3 solves the distribution problems of option 2 but
generating good C code doesn't sound like a trivial problem.
Compilation under that option is probably slow since each files must
be parsed twice...  Is it possible to produde machine code as
efficient as with option 2 when generating C code?

Did I miss anything?  What are the relative advantages of each
solutions?  Do you think that I overlooked other options?  Would using
an exiting virtual machine be a good option?  Except for Nice, this
option doesn't seem to be popular; there must be a catch.

Regarding parsing, I would like to support Unicode literals and
identifier.  I would not mind if the input encoding was restricted to
UTF-8.  I think that Flex has very limited Unicode support.  Is there
a good lexer out there with good Unicode support?  Would Unicode break
anything if I use GCC as my backed?

Thanks for your time, 

-- 
Yannick Gingras



Re: Seeking advice on front ends

2007-02-04 Thread Paul Brook
> My options code generations are more or less:
>
>   1) Code an interpreter
>
>   2) Build the parse tree in GCC's native format and let GCC generate
>  the code
>
>   3) Generate annotated C and call GCC on that.

3b) Generate ISO C. Compile with $(CC).

4) Convert your internal (parse) trees into GENERIC (aka GCC "native") trees 
as a separate pass. This is how Java, Ada and Fortran work.

I strongly recommend (4) rather than (2).

Whether you choose (1), (3) or (4) is a decision you need to make based on how 
much you care about the quality of generated code, and how much time+effort 
you're willing to invest.

Paul


The GCC Mission Statement says nothing about conforming to international standards!?

2007-02-04 Thread icrashedtheinternet

I guess I could have worded my email a bit better.  Of course I don't
assume that the GCC developers are ignoring standards.  Nor do I think
any of us are unaware of GCC's ability to support a standard and have
extensions to it that go beyond the standard.  So I simply want to
suggest to the proper people (who hopefully are reading this ;)  that
perhaps the mission statement should include something about the GCC
project efforts to encompass programming language standards and then
go beyond them whenever necessary in order to make the compiler even
more useful.

-John


Re: The GCC Mission Statement says nothing about conforming to international standards!?

2007-02-04 Thread Brooks Moses

icrashedtheinternet wrote:

I guess I could have worded my email a bit better.  Of course I don't
assume that the GCC developers are ignoring standards.  Nor do I think
any of us are unaware of GCC's ability to support a standard and have
extensions to it that go beyond the standard.  So I simply want to
suggest to the proper people (who hopefully are reading this ;)  that
perhaps the mission statement should include something about the GCC
project efforts to encompass programming language standards and then
go beyond them whenever necessary in order to make the compiler even
more useful.


Why?

(Or, to be less gnomic: Why do you feel that this should be included in 
the mission statement?  You're proposing the idea, but you're not giving 
any reasons for it at all.  If it were obvious why it should be in 
there, it would already be there, presumably.)


- Brooks



GCC 4.1.2 Status Report

2007-02-04 Thread Mark Mitchell
[Danny, Richard G., please see below.]

Thanks to all who have helped tested GCC 4.1.2 RC1 over the last week.

I've reviewed the list traffic and Bugzilla.  Sadly, there are a fair
number of bugs.  Fortunately, most seem not to be new in 4.1.2, and
therefore I don't consider them showstoppers.

The following issues seem to be the 4.1.1 regressions:

  http://gcc.gnu.org/wiki/GCC_4.1.2_Status

PR 28743 is only an ICE-on-invalid, so I'm not terribly concerned.

Daniel, 30088 is another aliasing problem.  IIIRC, you've in the past
said that these were (a) hard to fix, and (b) uncommon.  Is this the
same problem?  If so, do you still feel that (b) is true?  I'm
suspicious, and I am afraid that we need to look for a conservative hack.

Richard, 30370 has a patch, but David is concerned that we test it on
older GNU/Linux distributions, and suggested SLES9.  Would you be able
to test that?

Richard, 29487 is an issue raised on HP-UX 10.10, but I'm concerned that
it may reflect a bad decision about optimization of C++ functions that
don't throw exceptions.  Would you please comment?

I'm not sure yet as to whether we will do an RC2, or not; I will make
that decision after getting the answers to the issues above.

Thanks,

-- 
Mark Mitchell
CodeSourcery
[EMAIL PROTECTED]
(650) 331-3385 x713


Re: build failure? (libgfortran)

2007-02-04 Thread Grigory Zagorodnev

Dorit Nuzman wrote:

I'm seeing this bootstrap failure on i686-pc-linux-gnu (revision 121579) -
something I'm doing wrong, or is anyone else seeing this?


Yes. I see the same at x86_64-redhat-linux.

- Grigory


Re: Failure to build libjava on 512MB machine

2007-02-04 Thread Gerald Pfeifer
On Sat, 3 Feb 2007, Gerald Pfeifer wrote:
>> I'd be curious to know the effect of removing the "complexity" field of 
>> struct tree_exp.
> Doesn't work:
> 
>   trunk/gcc/cp/pt.c: In function 'tsubst_expr':
>   trunk/gcc/cp/pt.c:8924: error: 'struct tree_exp' has no member named 
> 'complexity'

The updated patch below works, but still runs into the out of memory
situation building gnu/javax/swing/text/html/parser/HTML_401F.lo.

Gerald

Index: gcc/tree.c
===
--- gcc/tree.c  (revision 121572)
+++ gcc/tree.c  (working copy)
@@ -2931,7 +2931,6 @@
 #else
   SET_EXPR_LOCUS (t, NULL);
 #endif
-  TREE_COMPLEXITY (t) = 0;
   TREE_OPERAND (t, 0) = node;
   TREE_BLOCK (t) = NULL_TREE;
   if (node && !TYPE_P (node))
Index: gcc/tree.h
===
--- gcc/tree.h  (revision 121572)
+++ gcc/tree.h  (working copy)
@@ -1498,7 +1498,6 @@
 
 /* In ordinary expression nodes.  */
 #define TREE_OPERAND(NODE, I) TREE_OPERAND_CHECK (NODE, I)
-#define TREE_COMPLEXITY(NODE) (EXPR_CHECK (NODE)->exp.complexity)
 
 /* In gimple statements.  */
 #define GIMPLE_STMT_OPERAND(NODE, I) GIMPLE_STMT_OPERAND_CHECK (NODE, I)
@@ -1724,7 +1723,6 @@
 {
   struct tree_common common;
   source_locus locus;
-  int complexity;
   tree block;
   tree GTY ((special ("tree_exp"),
 desc ("TREE_CODE ((tree) &%0)")))
Index: gcc/cp/pt.c
===
--- gcc/cp/pt.c (revision 121572)
+++ gcc/cp/pt.c (working copy)
@@ -8921,7 +8921,9 @@
tree op0, op1;
op0 = RECUR (TREE_OPERAND (t, 0));
op1 = RECUR (TREE_OPERAND (t, 1));
+/*
finish_omp_atomic (OMP_ATOMIC_CODE (t), op0, op1);
+*/
   }
   break;
 
Index: gcc/cp/semantics.c
===
--- gcc/cp/semantics.c  (revision 121572)
+++ gcc/cp/semantics.c  (working copy)
@@ -3899,7 +3899,9 @@
 {
   stmt = build2 (OMP_ATOMIC, void_type_node, orig_lhs, orig_rhs);
   OMP_ATOMIC_DEPENDENT_P (stmt) = 1;
+/*
   OMP_ATOMIC_CODE (stmt) = code;
+*/
 }
   add_stmt (stmt);
 }