This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

contribution 3


Dear Sir/Madam,

this is a small modification to the patch I sent a week ago.
This .diff will work with the latest snapshot 20020415
I sent all the explanation in previous letters (attached).
Please tell me what do you think.

Sincerely,
Alexey.

----------------------------- OLD --------------------------------------

Dear Sir/Madam,

here is the contribution to the latest gcc snapshot.

This patch represents "GNU_C/C++/Fortran/ObjC to C" converter as
GCC backend. It translates RTL to C code for general compiler.
Most of the tricks are implemented in plain C, but for some of them
GNU extensions was used as well as known pragmas.

For more information check the old letter attached in the end.

The current patch works with the latest GCC snapshot, so I hope
there will be no problems applying it.

Some things I forgot to metion last time:
"label_values" and "trampolines" are not fully supported.
builtin_apply is not fully supported, but all Objective C tests passed.

Here is the latest log of fails from GCC testsuite:
----------------------------------------- GCC ------------------------

gcc.c-torture/compile/951222-1.c   ; bad setjmp() call
gcc.c-torture/compile/labels-2.c   ; not yet supported
gcc.c-torture/compile/labels-3.c   ; not yet supported
gcc.c-torture/execute/20020406-1.c ; not related to this backend
gcc.dg/20020312-2.c   ; due to different mangling
gcc.dg/asm-names.c    ; due to different mangling
gcc.dg/no-builtin-1.c ; due to different mangling
----------------------------------------- G++ ------------------------
g++.dg/abi/mangle1.C  ; due to different mangling
g++.dg/opt/vtgc1.C    ; due to different mangling
g++.dg/special/conpr-2.C ; not related to this backend
g++.dg/special/conpr-3.C ; not related to this backend
g++.dg/special/initp1.C  ; not related to this backend
g++.eh/ia64-1.C  ; ia64 ?!
g++.jason/thunk3.C ; not supported (test should be changed)
g++.pt/instantiate4.C ; repo not supported
----------------------------------------- G77 ------------------------
none
----------------------------------------- OBJC -----------------------
none

And the changes to ChangeLogs:
----------------------------------------------------------------------
Here are the changes to gcc-3.x.x/ChangeLog:

2002-04-17  Alexey Starovoytov  <alexey.starovoytov@sun.com>

        * config.sub: Add C converter support.

Here are the changes to gcc-3.x.x/gcc/ChangeLog:

2002-04-17  Alexey Starovoytov  <alexey.starovoytov@sun.com>

        * config/conv/conv-protos.h: New file.
        * config/conv/conv.c: New file.
        * config/conv/conv.h: New file.
        * config/conv/conv.md: New file.
        * config/conv/libgcc_extra.c: New file.
        * config/conv/sysv4.h: New file.
        * config/conv/t-svr4: New file.
        * config.gcc (conv-*-*): New target.
        * configure (conv-*-*): New target.
        * builtins.c (expand_builtin_apply,expand_builtin): support for
        new call_insn
        * calls.c: support for new call_insn with unique call number
        * cfgcleanup.c (insns_match_p): support for new call_insn
        * collect2.c (main): unset COMPILER_PATH and LIBRARY_PATH
        so the converter may work with target compiler GCC
        * emit-rtl.c: support for new call_insn
        * expr.c: support for new PUSH_ARG RTL
        * expr.h: support for new PUSH_ARG RTL
        * gcc.c: new -Ws option and gcc specs for C converter
        * integrate.c (copy_insn_list): support for new call_insn
        * loop.c (move_movables): support for new call_insn
        * recog.c (push_operand,peephole2_optimize): support for
        PUSH_ARG RTL and call_insn
        * rtl.def: new CALL_INSN and PUSH_ARG
        * rtl.h: support for new call_insn
        * unroll.c (copy_loop_body): support for new call_insn

The full patch generated with "diff -rc3pN" is attached.

Sincerely,
Alexey Starovoytov

--------------------- begin "my old letter" --------------------------
Dear Sir/Madam,

Recently I received the statement from FSF committee that my
contribution is accepted.

I guess now I can send the patch for your verification.

This patch represents "GNU_C/C++/Fortran/ObjC to C" converter as
GCC backend. It translates RTL to C code for general compiler.
Most of the tricks are implemented in plain C, but for some of them
GNU extensions was used as well as known pragmas.

This converter can be used to start GNU C/C++/Fortran development
on architectures where only C compiler is available.
It could be extremely useful in porting GNU-like application
(Linux for example) to new architectures where GNU
compiler collection is not yet available, but the native C compiler is.
This converter can improve GCC performance in some cases.
For example SPECfp benchmark 172.mgrid showed 48% improvement
compiled with "-O2 -Ws,-O2,-fno-strict-aliasing" vs plain GCC with "-O2"

This patch doesn't affect other backends, but some core files
were modified like "rtl.def".

Right now it's configured to support big endian target architecture,
but could be easily modified to support others.

Typical 'configure' run after patch applied:

./configure --prefix=/usr/local/new/bin --with-as=/usr/local/bin/gcc
--with-ld=/usr/local/bin/gcc --host=conv-sparc-sysv4 --target=conv-sparc-sysv4

Generated C code is compiled and linked by target compiler. In this
example the target compiler is "/usr/local/bin/gcc"

The "--host" and "--target" options could be anything of "conv-*-*"

Typical run of patched GCC:

/usr/local/new/bin/gcc -O2 -Ws,-O2,-fno-strict-aliasing file.c

The flag "-Ws," was added to GCC driver to pass arguments to
target C compiler.
The option "-fno-strict-aliasing" is recommended when GCC is used
as target compiler.

This converter doesn't support GNU inline assembler and wasn't tested
for Java.

This patch passed 'bootstrap' test and here is the list of failures in
GCC testsuite:
-----------------------------------------------------------------------


Attachment: gcc_all_apr17.diff.bz2
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]