------- Comment #2 from joseph at codesourcery dot com  2010-06-17 14:28 -------
Subject: Re:   New: configuration with multiple targets
 / backends is not supported.

On Thu, 17 Jun 2010, amylaar at gcc dot gnu dot org wrote:

> To a first order of approximation, we can say trees and their passes are
> target-independent, while rtl and its passes are target-dependent.

There are many target macros used outside of the RTL passes, including in 
front ends, GIMPLE code, the driver, collect2 and libgcc, and all of these 
would need to become hooks (or in the case of libgcc, target macros in a 
separate set of headers under the toplevel libgcc/ directory so that 
different headers can be used in the libgcc builds for different targets).  
You'll need to figure out how to identify every macro used in those parts 
of the compiler and convert it to a hook [*] (at least to the intermediate 
stage of a default definition in targhooks.c that uses the macro, if you 
build targhooks.c multiple times in your scheme).  I'm not sure there's 
much real benefit in distinguishing target macros by where they are used; 
every one of them should end up being converted to a hook anyway (with 
appropriate LTO work to ensure effective devirtualization is possible in a 
single-target compiler).  If you have a good way to identify target macros 
(including those set at configure time rather than in tm.h headers) and 
macros defined indirectly depending on target macros, then you can work 
out exactly what does use them.

[*] The correct conversion is not always a one-to-one conversion where a 
single hook replaces a single macro.

Work will also be needed outside the compiler, e.g. in the assembler which 
entirely uses macros rather than hook at present, unless you arrange for 
separately built assemblers for different targets to be called for the 
code for each target.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44566

Reply via email to