This is the mail archive of the gcc-bugs@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]

Re: i960 cross compile broken


I don't care much whether the i960 port works, and would be happy to give up
my maintainership role.

There is no i960-elf target in gcc.  If you configure for i960-elf, you get the
default i960-*-* target which is really an a.out target.  There is i960-elf
support in binutils.  Interesting things can happen when mixing an elf
assembler with an a.out gcc.  If it works, it is working only by accident.
If you want a working i960 compiler, use i960-coff.

My build failed because the register allocator does not provide a default
definition of MEMORY_MOVE_COST.  I copied the one in reload.h into ra.h so
the build would complete.

Unfortunately the snapshots are tracking the gcc-3.1 release tree, and I don't
feel like playing tricks with cvs at the moment, but I believe the problem was
introduced here:

        2002-05-17  Richard Henderson  <rth@redhat.com>
	* expr.c (init_expr_once): Don't use start/end_sequence.
	Use rtx_alloc instead of emit_insn.
	* toplev.c (lang_dependent_init): Run init_expr_once here ...
        (lang_independent_init): ... not here.

lang_independent_init was careful to call init_expr_once inside a dummy
function context because it creates RTL.  lang_dependent_init does not.  Since
there is no function context (cfun == 0), we segfault.   I could add explicit
checks for cfun == 0 in the i960 backend, but that doesn't seem to make any
sense, so it looks like we need to add another dummy function context.

The following patch gets my build past this problem, and it now dies building
libgcc because I didn't bother to build an assembler.

2002-07-15  Jim Wilson  <wilson@redhat.com>

	* toplev.c (lang_dependent_init): Create function context for
	init_expr_once.

Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.657
diff -p -r1.657 toplev.c
*** toplev.c	15 Jul 2002 14:07:05 -0000	1.657
--- toplev.c	16 Jul 2002 00:21:13 -0000
*************** lang_dependent_init (name)
*** 5141,5147 ****
--- 5141,5152 ----
       front end is initialized.  */
    init_eh ();
    init_optabs ();
+ 
+   /* The following initialization functions need to generate rtl, so
+      provide a dummy function context for them.  */
+   init_dummy_function_start ();
    init_expr_once ();
+   expand_dummy_function_end ();
  
    /* Put an entry on the input file stack for the main input file.  */
    push_srcloc (input_filename, 0);


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