This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: Fix other/44566


On Sun, 27 Jun 2010, Joern Rennecke wrote:

> I don't think it is merely a workaround; I think it is a proper
> implementation.

I think a proper implementation has the totality of the definition of the 
interface for targets to define in just one place, i.e. the definition of 
the target structure and its associated documentation.  Targets providing 
headers that target-independent code includes involves a hole in this 
interface definition that makes it hard to tell quite what the interface 
is (enumerating target macros is hard when any identifier could be a 
macro).  Clarity and clear definition of internal interfaces is good in 
itself, and avoiding macros where possible generally helps make interfaces 
clearer and easier to analyze.

Certainly I'd consider that the function-like target macros, and others 
that expand to code rather than constants, are the highest priority to 
convert to hooks (and also less likely to have much performance impact; 
the targets with more complicated expansions hopefully already use 
function calls in the definitions of their macros).

This does not prevent tricks to build a file multiple times if that is 
really felt to be necessary (you could build it with your namespaces and 
with targetm defined to be a const target vector for a particular target, 
so that LTO/WHOPR can separately optimize the functions for each target).

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]