error compiling libgcc with ported cross-compiler

2007-09-10 Thread Tomas Svensson
I am porting gcc to a new target architecture, and have come across a problem when the make process tries to compile libgcc. The error I get is included below. It seems that gcc has emitted rtl describing a memory reference (mem (plus (mem (plus (reg ..) (const_int ..))) (const_int ..))), which sh

Re: error compiling libgcc with ported cross-compiler

2007-09-10 Thread Tomas Svensson
On 9/10/07, Rask Ingemann Lambertsen <[EMAIL PROTECTED]> wrote: >It would help a lot if you post your GO_IF_LEGITIMATE_ADDRESS. It's really very basic: # define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \ { if (legitimate_address_p (MODE, X, true)) goto ADDR; } and in the .c-file: bool le

Re: error compiling libgcc with ported cross-compiler

2007-09-10 Thread Tomas Svensson
Thanks a lot for your input, I think I understand some of that code better now. I stumbled upon a solution last night, on realizing that the problem was with the DFmode powidf2 and seeing that I had not defined the movsf or movdf insns (because I thought I shouldn't need them, having no HW floatin

support for float/complex math in libgcc cross-compiled

2007-09-11 Thread Tomas Svensson
(I'm turning this into a thread of it's own, it's really the continuation of "error compiling libgcc with ported cross-compiler" from yesterday.) I am porting GCC to a new target, and got the following error when cross-compiling libgcc towards the end of the make process: /cygdrive/c/home/risc/sr

Re: error compiling libgcc with ported cross-compiler

2007-09-11 Thread Tomas Svensson
On 9/11/07, Rask Ingemann Lambertsen <[EMAIL PROTECTED]> wrote: > On Tue, Sep 11, 2007 at 08:52:38AM +0200, Tomas Svensson wrote: >You shouldn't define them, they'll only hide the problem. You're right, and getting REG_OK_STRICT right solved the problem! That was

porting problem: segfault when compiling programs that call malloc

2007-09-13 Thread Tomas Svensson
I am porting gcc to a new architecture, and have yet another problem that I've been staring at for far too long now. Whenever I compile a program that calls malloc, GCC crashes with: /cygdrive/c/home/risc/src/gcc-4.1.2/gcc/unwind-dw2-fde.c: In function '__register_frame': /cygdrive/c/home/risc/sr

Re: porting problem: segfault when compiling programs that call malloc

2007-09-14 Thread Tomas Svensson
On 13 Sep 2007 13:45:21 -0700, Ian Lance Taylor <[EMAIL PROTECTED]> wrote: > valreg is set around line 2564 of calls.c. It shouldn't be zero at > line 2787. Unless you have an malloc function with a return type of > void, which seems dubious. Ok, do you have any idea about what might cause this

porting problem again: ICE in add_clobbers

2007-09-18 Thread Tomas Svensson
I am still porting gcc v4.1.2 to a new risc architecture, and this time my problem is that when compiling with -O2 turned on, every insn with a (use ..) side effect expression, eg. (define_expand "sibcall" [(parallel [(call (match_operand 0 "" "") (match_operand 1 "" ""))

Re: porting problem again: ICE in add_clobbers

2007-09-18 Thread Tomas Svensson
hedule-insns2 -fsched-interblock -fsched-spec -fregmove -fstrict-aliasing -fdelete-null-pointer-checks -freorder-functions -ftree-vrp -ftree-pre -fomit-frame-pointer -fforce-mem On 9/18/07, Tomas Svensson <[EMAIL PROTECTED]> wrote: > I am still porting gcc v4.1.2 to a new risc architectu

Re: porting problem again: ICE in add_clobbers

2007-09-19 Thread Tomas Svensson
On 9/18/07, Jim Wilson <[EMAIL PROTECTED]> wrote: > Tomas Svensson wrote: > There is no optimization at all without -O, no matter how many -f > options you use. What you want to do is -O -fno-foo -fno-bar etc. > However, we do not have -f options for every optimization, so there

Re: porting problem again: ICE in add_clobbers

2007-09-21 Thread Tomas Svensson
On 19 Sep 2007 07:54:14 -0700, Ian Lance Taylor <[EMAIL PROTECTED]> wrote: > gcse will never convert a recognizable insn into an unrecognizable > insn. Ok. Do you know of any other reasons why this particular optimization switch would cause this problem? > You still haven't showed us the actual i

specifying insn costs from attributes

2007-10-11 Thread Tomas Svensson
In the .md-file of my port, I have set an attribute "size" of every insn, giving its size (obviously), in bytes. Is there any way I can use the value of this attribute to determine the cost (in e.g. TARGET_RTX_COSTS) when optimizing for size? Or is there some other smart way of achieving the same t