RFC: [GUPC] UPC-related front-end changes
Joseph S. Myers
joseph@codesourcery.com
Sat Jul 2 15:21:00 GMT 2011
On Fri, 1 Jul 2011, Gary Funck wrote:
> The reason that so many #ifdef's and #defines remain is that
> I wasn't sure about the best method of parameterizing those values to
> avoid the use of conditional compilation. For example, should
> a small struct be defined that has fields for the configuration-specific
> values?
You need to make a technical judgement among possible approaches - which
may include such a structure, or a structure of function pointers, or
conditionals at various places in the code.
> Although the PTS representation is not target-specific, it has some
> aspects of being target-specific in that the representation and
> layout of the PTS changes the binary representation of the PTS
> in the compiled program (and runtime), and some representations
> will perform better/worse on a specific target (for example,
> on some targets some UPC programs may run faster if vaddr is first.
> Generally, the 'struct PTS' is chosen because it provides the
> maximum range of the various fields (at the expense of using
> more space to represent the PTS).
In general configure options aren't really a good idea in many cases:
* If something is always best on a particular architecture, maybe you want
a target hook (not macro) rather than a configure option, with the target
hook being set appropriately for each target and no option for the person
configuring GCC to override.
* If what's best depends on the particular application, a normal
command-line option for the person using GCC to use is better (and then
any configure option can just control specs in the driver and not directly
affect the rest of the compiler). That might run into problems if there's
a runtime library included with GCC that can only be built compatibly with
one of the possible ABIs at a time, though it may be possible to avoid
this issue in some cases (for example, using different function names for
the different ABIs; cf. how libstdc++ works with both 64-bit and 128-bit
long double on various targets). (Actually multilibbing the library for
each ABI variant - in addition to the existing multilibbing for all GCC's
runtime libraries - would be better in some cases but harder to
implement.)
Even if you need a configure option for the default, the command-line
options may still be useful in some cases for testing and debugging
purposes.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Gcc-patches
mailing list