Re: Porting GCC on a new arch (cross-compilation)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Why is it running emit_move_... while the file is empty and there is
> nothing to compile ?
> 
> I did not include any move pattern in the md, I try to construct a
> minimal md like it is explained in IITB tutorials, should I ?
> 
> Maybe macros in target.h file are not defined well ? Which macros are
> concerned with these calls ?
> 
> 

I am also working on building GCC-4.3.2 for cross compiler for CISC
processor. I also referred the IITB tutorials.

I have also faced the problem as mentioned by you. 

I have debugged the segmentation fault occurred while compiling empty
void function using ddd (data display debugger). Segmentation fault
occured in the method simplify_subreg defined in simplify-rtx.c file. On
backtracing, it was found that the segmentation fault is occuring for
emit_move_instruction() function. It indicates that for GCC 4.3.2, we
need to provide machine description for 'move' instruction as well
for successful compilation of empty void function.

To verify this, I have added the dummy machine description for 'move'
instruction in the .md file as shown below:

(define_expand "movsi"
  [(set (match_operand:SI 0 "general_operand" "")
        (match_operand:SI 1 "general_operand" ""))
  ]
  ""
  ""
)

The above added machine description for 'move' instruction results into
successful building of GCC i.e. cc1 executable is generated. The
generated cc1 executable successfully compiled the empty
void function.

But why the move pattern is required is still not clear to me.

Thanks

Meena


On Wed, 2009-02-25 at 09:41 +0100, Florent DEFAY wrote:
> Hi,
> 
> I have to port GCC on a new arch. I'm working on an i686-pc-linux-gnu
> machine so it is cross-compilation.
> 
> I read tutorials from IIT of Bombay. I read parts of GCC Internals.
> I'm working with gcc-4.3.3 sources. The binutils are already installed
> in /home/me/target/.
> 
> I am now debugging my cc1 with GDB. I try to compile an empty file this way :
> gdb /home/me/target/libexec/gcc/target/4.3.3/cc1 -x command.gdb
> ...
> run -quiet -v a.c -quiet -dumpbase a.c -da -auxbase a -version -o a.s
> 
> where a.c is an empty file.
> 
> The problem is that cc1 comes in an infinite call loop, here is the back trace :
> (gdb) bt
> #0  0x081f473c in simplify_subreg (outermode=HImode, op=0xb7c525d0,
> innermode=HImode, byte=0) at ../../gcc-4.3.3/gcc/simplify-rtx.c:4930
> #1  0x081f5968 in simplify_gen_subreg (outermode=HImode,
> op=0xb7c525d0, innermode=HImode, byte=0) at
> ../../gcc-4.3.3/gcc/simplify-rtx.c:5225
> #2  0x08121405 in emit_move_multi_word (mode=HImode, x=0xb7c525d0,
> y=0xb7c525c0) at ../../gcc-4.3.3/gcc/expr.c:3270
> #3  0x08120eca in emit_move_insn (x=0xb7c525d0, y=0xb7c525c0) at
> ../../gcc-4.3.3/gcc/expr.c:3417
> #4  0x081214b6 in emit_move_multi_word (mode=HImode, x=0xb7c525d0,
> y=0xb7c525c0) at ../../gcc-4.3.3/gcc/expr.c:3295
> #5  0x08120eca in emit_move_insn (x=0xb7c525d0, y=0xb7c525c0) at
> ../../gcc-4.3.3/gcc/expr.c:3417
> #6  0x081214b6 in emit_move_multi_word (mode=HImode, x=0xb7c525d0,
> y=0xb7c525c0) at ../../gcc-4.3.3/gcc/expr.c:3295
> #7  0x08120eca in emit_move_insn (x=0xb7c525d0, y=0xb7c525c0) at
> ../../gcc-4.3.3/gcc/expr.c:3417
> 
> Why is it running emit_move_... while the file is empty and there is
> nothing to compile ?
> 
> I did not include any move pattern in the md, I try to construct a
> minimal md like it is explained in IITB tutorials, should I ?
> 
> Maybe macros in target.h file are not defined well ? Which macros are
> concerned with these calls ?
> 
> Thank you.
> 
> Florent


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux