This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: error linking lto1 for target avr
Georg-Johann Lay <avr@gjlay.de> writes:
> Suppose avr.c:avr_out_lpm which is used to print insns in final,
> e.g. ADJUST_INSN_LENGTH.
>
> Should avr_out_lpm be moced to avr-c.c? And avr-c.c include all the
> rtl.h, tree.h, output.h etc. which is also needed by the functions
> that like to use c_addr_space_name?
It's fine for avr-c.c to include rtl.h, tree.h, etc. (though including
tree.h is unusual). It's fine for avr-c.c to call functions in avr.c.
The point is that functions that are C/C++ specific need to not be in
avr.c, because they will break for languages other than C/C++. In this
terminology, LTO counts as a language.
> Is is legitimate to use MEM_ADDR_SPACE in avr.c?
Yes.
> Is is legitimate to use TYPE_ADDR_SPACE in avr.c?
Yes.
> Must all this put into avr-c.c?
Not for that reason, no.
To a first approximation, anything that refers to something declared in
c-common.h must be in avr-c.c, not in avr.c.
Ian