As ramping up clock speeds becomes harder and we see more parallel cores being used to extend Moore's Law, there is also a growing number of heterogenous systems that have fully programmable cores with different architectures, e.g. Cell, ARCompact / MXP, CPU / GPU combinations.
It is desirable that high-level optimizers can consider characteristics of all the target architectures in a system to make decisions to move and/or clone functions from one architecture to another, and then emit code - including any needed interworking glue code - for all the targeted processors. This requires that more than one backend is linked into the compiler, and rtl optimizers can handle different targets. Some code will intrinsically be driven by different code/data for differet targets, e.g. the code from config/<target> and the insn-* files will be different. Also, where heavy use of target or target-dependent generated macros is made, using different object files for different targets makes sense. To a first order of approximation, we can say trees and their passes are target-independent, while rtl and its passes are target-dependent. This might classify some general rtl handling code as target dependent even if this is not actually true, or if dependencies could sensibly be factored out with new target hooks, but the only practical downside of this that that multi-target configurations will have larger binaries than necessary. Once the basic infrastructure is in place, each module that is marked as target specific can be scrutinized if it actually is - or can be reasonably made - target independent. The interface of our target hooks will need a few changes. 'enum machine_mode' will have to be generated to include modes for all the targets, so that the same value means the same across all targets on which the mode exists. On the other hand, types 'enum reg_class' are intrinsically target-specific. different enums can have different width, so in order to have a well-defined function type that can be safely used for calls, the targetm member declarations have to use an integer type for such argument / return values. This PR depends on PR44433 inasmuch as using namespaces to separate multiple copies of middle end / rtl-optimizer modules requires that at least one language front end can be built using --enable-build-with-cxx, i.e. PRs like PR44512 must be fixed as a prerequisite; if such a configuration doesn't work for ADA that merely means that this one language can't be used for multi-target configurations, thus PR44362 doesn't actually block. -- Summary: configuration with multiple targets / backends is not supported. Product: gcc Version: 4.6.0 Status: UNCONFIRMED Severity: enhancement Priority: P3 Component: middle-end AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: amylaar at gcc dot gnu dot org BugsThisDependsOn: 44433 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44566