This is the mail archive of the
mailing list for the GCC project.
Re: again problems implementing own target
- From: Michael_fogel <mikfogel at uni-koblenz dot de>
- To: Jim Wilson <wilson at specifix dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 08 Oct 2007 22:48:22 +0200
- Subject: Re: again problems implementing own target
- References: <4709524B.firstname.lastname@example.org> <470A7F8F.email@example.com>
Jim Wilson wrote:
Thank you for your help.
The failing instruction is a call. The compiler loads every symbol
reference into a register and calls the function using this. In front
of the error this load is missing. In smaller files the compiler uses
the reference, which is the way i want him to do it.
We need more info in order to determine what is wrong. Some RTL
examples would be nice. Also, a copy of your pattern in your md file
that matches call instructions.
Also, in which pass does the load symbol instruction disappear? If
you compile with -da, you will get RTL dumps after each optimization
pass. You can look at them to see where problem was introduced.
There does appear to be a problem with your port, but there is also a
way to work around it. If you define NO_FUNCTION_CSE, then gcc will
no longer try to optimize function addresses by loading them into
pseudos. See the docs for this macro in the doc/tm.texi file.
After defining the target hook TARGET_ADDRESS_COST with return 2 the
compiler was able to compile it.
I took a closer look at the scheduler and found some interesting macros.
One of them was NO_FUNCTION_CSE. Now I want to define the costs for
every instruction so gcc can make a better optimization.
Sometimes I should read the documentation more carefully.
In my opinion the compiler ran out of registers and was not able to
allocate the pseudo register. In this case the compiler has to spill
these registers. How is this done in GCC? Is there a way to control it?