diff mbox

[UPC,11/22] documentation

Message ID 20151201060239.GA31195@intrepid.com
State New
Headers show

Commit Message

Gary Funck Dec. 1, 2015, 6:02 a.m. UTC
Background
----------

An overview email, describing the UPC-related changes is here:
  https://gcc.gnu.org/ml/gcc-patches/2015-12/msg00005.html

The GUPC branch is described here:
  http://gcc.gnu.org/projects/gupc.html

The UPC-related source code differences are summarized here:
  http://gccupc.org/gupc-changes

All languages (c, c++, fortran, go, lto, objc, obj-c++) have been
bootstrapped; no test suite regressions were introduced,
relative to the GCC trunk.

If you are on the cc-list, your name was chosen either
because you are listed as a maintainer for the area that
applies to the patches described in this email, or you
were a frequent contributor of patches made to files listed
in this email.

In the change log entries included in each patch, the directory
containing the affected files is listed, followed by the files.
When the patches are applied, the change log entries will be
distributed to the appropriate ChangeLog file.

Overview
--------

For UPC, a new gupc.texi file is introduced to describe the
stand-alone 'gupc' command, which is a driver similar to gfortran
that will invoke 'gcc', asserting the -fupc switch and will
compile any .c files on the command line as if they were .upc files.
In addition, it describes how to run UPC programs, along with details
on the command line switches processed by the UPC runtime.

2015-11-30  Gary Funck  <gary@intrepid.com>

	gcc/doc/
	* gupc.texi: New.
	* install.texi (disable-libgupc, enable-upc-link-script):
	New. Describe UPC-specific configure options.
	* invoke.texi (fupc, fupc-threads, fupc-pthreads-model-tls,
	fupc-inline-lib, fupc-pre-include, fupc-debug, dwarf-2-upc,
	fupc-instrument, fupc-instrument-functions):
	New. Describe UPS-specific compiler options.
	* passes.texi: Describe the UPC lowering pass.
	* sourcebuild.texi (libgupc): Add libgupc to list of libraries.
	Also make note that target support for UPC is enabled via -fupc.
	* tm.texi: Re-generate.
	* tm.texi.in (TARGET_UPC_LINK_SCRIPT_P,
	TARGET_UPC_SHARED_SECTION_NAME, TARGET_UPC_PGM_INFO_SECTION_NAME,
	TARGET_UPC_INIT_ARRAY_SECTION_NAME): Refer to new UPC target hooks.
	libgupc/
	* libgupc.texi: New.
diff mbox

Patch

Index: gcc/doc/gupc.texi
===================================================================
--- gcc/doc/gupc.texi	(.../trunk)	(revision 0)
+++ gcc/doc/gupc.texi	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,394 @@ 
+\input texinfo @c -*-texinfo-*-
+@setfilename gupc
+@settitle GNU project UPC compiler
+
+@c Merge the standard indexes into a single one.
+@syncodeindex fn cp
+@syncodeindex vr cp
+@syncodeindex ky cp
+@syncodeindex pg cp
+@syncodeindex tp cp
+
+@include gcc-common.texi
+
+@c Copyright (C) 2001-2015 Free Software Foundation, Inc.
+@c Contributed by Gary Funck <gary@intrepid.com>
+@c   and Nenad Vukicevic <nenad@intrepid.com>.
+@c Based on original implementation
+@c   by Jesse M. Draper <jdraper@super.org>
+@c   and William W. Carlson <wwc@super.org>.
+
+@copying
+@c man begin COPYRIGHT
+Copyright @copyright{} 2001-2015 Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``GNU General Public License'' and ``Funding
+Free Software'', the Front-Cover texts being (a) (see below), and with
+the Back-Cover Texts being (b) (see below).  A copy of the license is
+included in the
+@c man end
+section entitled ``GNU Free Documentation License''.
+@ignore
+@c man begin COPYRIGHT
+man page gfdl(7).
+@c man end
+@end ignore
+@c man begin COPYRIGHT
+
+(a) The FSF's Front-Cover Text is:
+
+     A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+     You have freedom to copy and modify this GNU Manual, like GNU
+     software.  Copies published by the Free Software Foundation raise
+     funds for GNU development.
+@c man end
+@end copying
+@c Set file name and title for the man page.
+
+@ifinfo
+@dircategory Software development
+@direntry
+* GNU UPC: (gupc).           A GCC-based compiler for the UPC language
+@end direntry
+
+@insertcopying
+@end ifinfo
+
+@titlepage
+@title The GNU UPC Compiler
+@versionsubtitle
+@author Gary Funck and Nenad Vukicevic
+
+@page
+@vskip 0pt plus 1filll
+Published by the Free Software Foundation @*
+51 Franklin Street, Fifth Floor@*
+Boston, MA 02110-1301, USA@*
+@sp 1
+@insertcopying
+@end titlepage
+@contents
+@page
+
+@node Top
+@chapter @command{gupc}--- UPC compiler for parallel computers
+
+@command{gupc} provides a compilation and execution environment for
+programs written in the UPC (Unified Parallel C) language.
+
+@menu
+* GUPC Intro::		Introduction to gupc.
+* Threads::		Number of Execution Threads.
+* Invoking GUPC::	How to use gupc.
+* GUPC Options::	GUPC Options.
+* See also::		References.
+* Contributors::	GUPC Contributors.
+* Index::		Index.
+@end menu
+
+@node GUPC Intro
+@section Introduction to @command{gupc}
+@c man begin DESCRIPTION
+
+@command{gupc} is an extension to the GNU Compiler Collection from the
+Free Software Foundation.  In addition to the options specified here,
+all of the normal options listed in the man pages for @command{gcc}
+are available.
+
+The @command{gupc} compiler is integrated with the @command{gcc} compiler.
+The @command{gupc} compiler processes input files through one or more of
+four stages: pre-processing, compilation, assembly, and linking.
+
+Suffixes of source file names indicate the language and kind of
+processing to be done:
+
+@table @gcctabopt
+@item @file{file}.upc
+UPC source; pre-process, compile, assemble
+
+@item @file{file}.h
+Pre-processor header file; not usually named on command line
+
+@item @file{file}.c
+Files will be compiled as UPC source, unless preceded by @option{-x c}
+
+@item @file{file}.i
+Pre-processed source code; compile, assemble
+
+@item @file{file}.s
+Assembler source files; assemble
+@end table
+
+Files with other suffixes are passed to the linker.  Common cases include:
+
+@table @gcctabopt
+@item @file{file}.o
+Object file
+@item @file{file}.a
+Archive file
+@end table
+
+Linking is always the last stage unless you use one of the @option{-c},
+@option{-S}, or @option{-E} options to avoid linking.  Compilation errors
+also stop the process, and the linker is not invoked.  For the link stage,
+all @file{.o} files correspond to source files, and all @option{-l}
+options correspond to libraries.  Named @file{.o} object files, @file{.a}
+archives, and any file names unrecognized by @command{gupc} are passed
+to the linker in command-line order.
+
+@node Threads
+@section Number of Threads
+
+Within a UPC program, the special symbol @var{THREADS} refers to the number
+of parallel execution threads.  On each thread, the special symbol
+@var{MYTHREAD} refers to the thread number.  The number of threads in a UPC
+application can be specified statically at compile-time or dynamically
+at execution time.  Generally, the number of threads should not exceed
+the number of physical central processing units or cores.
+
+If the number of threads is specified statically at compile-time, the
+special symbol @var{THREADS} is a constant and can be used freely
+in any context where a constant is required by the C language
+specification (for example, in array dimensions in an array
+declaration).  See the @option{-fupc-threads=N} compilation option.
+
+If the number of threads is specified dynamically at execution
+time, the special symbol @var{THREADS} is assigned at run-time,
+and @var{THREADS} can be used in array declarations only if the
+array is qualified as @code{shared} and only if one and only one of
+the shared array's dimensions is specified as an integral multiple
+of @var{THREADS}.  See the @option{-fupc-threads=N} execution option.
+
+@c man end
+
+@node Invoking GUPC
+@section Invoking @command{gupc}
+
+@c man begin SYNOPSIS
+gupc @r{[}@var{options}@r{]} @file{files}
+@c man end
+
+@node GUPC Options
+@section @command{gupc} Options
+
+@c man begin OPTIONS
+@command{gupc} accepts the following UPC-specific options:
+
+@subsection Information Options
+@table @gcctabopt
+@item -v
+@cindex @option{-v}
+Print (on standard error output) the commands executed to run the stages
+of compilation.  Also print the version number of the compiler driver
+program and of the preprocessor and the compiler proper.
+@end table
+
+@subsection Language Options
+
+@table @gcctabopt
+@item -x upc
+@cindex @option{-x}
+All source files ending in @file{.upc} or @file{.c} will
+be compiled by the @command{gupc} compiler.  The @option{-x upc} option
+tells the compiler to process all of the following file names as
+UPC source code, ignoring the default language typically associated
+with filename extensions.
+
+@item -fupc-threads=N
+@cindex @option{-fupc-threads}
+Specify the number of threads at compile-time as @option{N}.  See the
+Number of Threads section, above.
+
+@item -fupc-pthreads-model-tls
+@cindex @option{-fupc-pthreads-model-tls}
+Compile for the POSIX threads (pthreads) environment.  Each UPC thread
+is directly mapped to one pthread.
+
+@item -fupc-inline-lib
+@cindex @option{-fupc-inline-lib}
+Inline UPC run-time library calls.  This option is turned on by default
+when compiled with optimization and the @option{-fno-upc-inline-lib} option
+must be specified to turn it off.  In general, inlining of run-time
+library calls produces larger code.  Turn it off if more
+condensed code is required.
+
+@item -fupc-pre-include
+@cindex @option{-fupc-pre-include}
+Pre-include UPC runtime header files.  This option is turned on by default.
+@end table
+
+@subsection Debugging Options
+
+@table @gcctabopt
+@item -g
+@cindex @option{-g}
+Produce symbolic debugging information
+
+@item -dwarf-2-upc
+@cindex @option{-dwarf-2-upc}
+Generate UPC-specific symbolic DWARF-2 debugging information.  This
+debugging information is processed by UPC-aware debuggers including
+GDB-UPC, a variant of the GDB debugger, and the commercially available
+Totalview debugger.
+
+@item -fupc-debug
+@cindex @option{-fupc-debug}
+Generate calls to the UPC run-time library that include source filename
+and line number information that is used to print more informative
+error messages when errors are detected at run-time.
+@end table
+
+@subsection Instrumentation Options
+
+@table @gcctabopt
+@item -fupc-instrument
+@cindex @option{-fupc-instrument}
+Instrument UPC shared accesses and library calls using GASP tool
+support.  This option implies @option{-fno-upc-inline-lib}.
+
+@item -fupc-instrument-functions
+@cindex @option{-fupc-instrument-functions}
+Instrument functions calls using GASP tool support.  This option implies
+@option{-fupc-instrument} and @option{-fno-upc-inline-lib}.
+@end table
+
+@subsection Optimization Options
+
+@table @gcctabopt
+@item -O0, -O1, -O2, -O3
+Specify the optimization level.  Nearly all GCC supported
+optimizations are performed.
+@end table
+
+@subsection Execution (Run-time) Options
+
+This section describes options that are specified on the command
+line when you invoke a UPC program.  These options are recognized by
+the UPC run-time.  Before calling the @code{main()} function of a UPC
+program, the UPC run-time removes all options that begin with the prefix
+@option{-fupc-} and that immediately follow the UPC program name on the
+command line.
+
+@file{UPC_program}
+@r{[}@option{number of threads}@r{]}
+@r{[}@option{heap size}@r{]}
+@r{[}@option{affinity options}@r{]}
+@r{[}@option{program arguments}@r{]}
+
+@table @gcctabopt
+@item -n N
+@cindex @option{-n}
+@itemx -fupc-threads=N
+@cindex @option{-fupc-threads=}
+Specifies, at run-time, the number of parallel execution threads
+as @option{N}.  If the UPC program was not compiled with the
+@option{-fupc-threads=N} option, either the @option{-fupc-threads=N}
+or @option{-n N} command-line option is required when you invoke the
+UPC program.  The deprecated form, @option{-fupc-threads-N} is also
+accepted.  See the Number of Threads section, above.
+
+@item -fupc-heap=HEAPSIZE
+@cindex @option{-fupc-heap=}
+@itemx -heap HEAPSIZE
+@cindex @option{-heap}
+Specifies the size of the heap available to each thread
+as @option{HEAPSIZE}.  A suffix of @option{K} indicates that
+@option{HEAPSIZE} is expressed in kilobytes (2^10 bytes).  A suffix
+of @option{M} indicates that @option{HEAPSIZE} is expressed in
+megabytes (2^20 bytes).  A suffix of @option{G} indicates that
+@option{HEAPSIZE} is expressed in gigabytes (2^30 bytes).  If a
+suffix is not present, @option{HEAPSIZE} is expressed in bytes.
+The deprecated from, @option{-fupc-heap-HEAPSIZE} is also
+accepted.
+@end table
+
+The following options specify thread scheduling and NUMA policies:
+
+@table @gcctabopt
+@item -sched-policy @r{[}cpu|strict|node|auto@r{]}
+@cindex @option{-sched-policy}
+Specifies the scheduling policy for threads.
+
+@table @gcctabopt
+@item cpu
+specifies that threads are evenly scheduled over available CPUs.
+(A CPU is a processor with a single core or a core unit in a multicore
+processor.)
+@item strict
+is similar to cpu scheduling except that one to one mapping of
+threads and CPUs is required.
+@item node
+specifies that threads are scheduled on nodes if a NUMA-aware kernel
+is available.
+@item auto
+specifies that the UPC run-time should not manage scheduling of UPC threads.
+@end table
+
+@item -sched-cpu-avoid n1,n2,..
+@cindex @option{-sched-cpu-avoid}
+Specifies the availability of CPUs for UPC thread scheduling.  The UPC
+run-time will not schedule any thread on the specified CPUs.
+
+@item -mem-policy @r{[}node,strict,auto@r{]}
+@cindex @option{-mem-policy}
+Specifies the memory allocation policy if a NUMA-aware kernel is available.
+
+@table @gcctabopt
+@item node
+allocates memory first from the node on which a thread is scheduled to run.
+@item strict
+allocates memory only from the node on which a thread is scheduled to run.
+@item  auto
+lets the kernel decide the memory allocation policy.
+@end table
+@end table
+@c man end
+
+@node See also
+@section References
+@c man begin SEEALSO
+gcc(1), cpp(1), as(1), ld(1), gdb(1), adb(1), dbx(1), sdb(1).
+
+
+@w{@uref{http://upc.lbl.gov/publications/UPC-TR-Original99.pdf}}
+Introduction to UPC and Language Specification,
+William W. Carlson et al., LLNL, CCS-TR-99-157, May 13, 1999
+
+
+@w{@uref{http://upc.lbl.gov/publications/upc-spec-1.3.pdf}}
+UPC Language Specifications, Version 1.3
+A publication of the UPC Consortium, November 16, 2013.
+
+@uref{http://www.gccupc.org}
+GNU UPC web site
+@c man end
+
+@node Contributors
+@section Contributors to GUPC
+
+The current developers and maintainers of GUPC are
+Gary Funck @email{gary@@intrepid.com} and
+Nenad Vukicevic @email{nenad@@intrepid.com}.
+
+GUPC was originally implemented by
+Jesse M. Draper @email{jdraper@@super.org} and
+William W. Carlson @email{wwc@@super.org}.
+
+@c man begin AUTHOR
+See the Info entry for @command{gupc}, or
+@uref{http://gcc.gnu.org/onlinedocs/gcc/Contributors.html}
+for contributors to GCC and GUPC.
+@c man end
+
+@node Index
+@section Index
+
+@printindex cp
+
+@bye
Index: gcc/doc/install.texi
===================================================================
--- gcc/doc/install.texi	(.../trunk)	(revision 231059)
+++ gcc/doc/install.texi	(.../branches/gupc)	(revision 231080)
@@ -1602,6 +1602,9 @@  support for @code{libquadmath} on system
 Specify that the GNU Offloading and Multi Processing Runtime Library
 should not be built.
 
+@item --disable-libgupc
+Specify that the run-time libraries used by GNU UPC should not be built.
+
 @item --disable-libvtv
 Specify that the run-time libraries used by vtable verification
 should not be built.
@@ -2094,6 +2097,24 @@  When you use this option, you should ens
 tools.
 @end table
 
+@subheading UPC-Specific Options
+
+The following options apply to the build of the GCC front end;
+they control aspects of UPC code generation.
+
+@table @code
+
+@item --enable-upc-link-script
+Enable UPC's use of a custom linker script; this
+will define the UPC shared section as a no load
+section on targets where this feature is supported.
+The @file{configure} script will by default enable this
+option if the feature is available on the target platform.
+You can use this switch to explicitly enable or disable
+this feature.
+
+@end table
+
 @subheading Java-Specific Options
 
 The following option applies to the build of the Java front end.
Index: gcc/doc/invoke.texi
===================================================================
--- gcc/doc/invoke.texi	(.../trunk)	(revision 231059)
+++ gcc/doc/invoke.texi	(.../branches/gupc)	(revision 231080)
@@ -169,6 +169,9 @@  in the following sections.
 -aux-info @var{filename} -fallow-parameterless-variadic-functions @gol
 -fno-asm  -fno-builtin  -fno-builtin-@var{function} @gol
 -fhosted  -ffreestanding -fopenacc -fopenmp -fopenmp-simd @gol
+-fupc -fupc-threads=@var{N} -fupc-pthreads-model-tls @gol
+-fupc-inline-lib -fupc-pre-include -fupc-debug -dwarf-2-upc @gol
+-fupc-instrument -fupc-instrument-functions @gol
 -fms-extensions -fplan9-extensions -fsso-struct=@var{endianness}
 -fallow-single-precision  -fcond-mismatch -flax-vector-conversions @gol
 -fsigned-bitfields  -fsigned-char @gol
@@ -1955,6 +1958,71 @@  Enable handling of OpenMP's SIMD directi
 in C/C++ and @code{!$omp} in Fortran. Other OpenMP directives
 are ignored.
 
+@item -fupc
+@opindex fupc
+@cindex Enable UPC
+Enable the usage of UPC language extension features for C.
+When @option{-fupc} is specified, enable the UPC language
+extension features for C.  The present implementation conforms
+to version 1.3 of the UPC language and library specifications
+@w{@uref{http://upc.lbl.gov/publications/upc-spec-1.3.pdf}}.
+This is an experimental feature, and the compiler ABI is subject
+to change in future versions of GCC.
+
+@item -fupc-threads=N
+@opindex fupc-threads
+Specify the number of UPC threads at compile-time as @option{N}.  If this
+option is not present or the value of @option{N} is 0, the number of
+threads will be specified dynamically when the program is executed.
+The @option{-fupc} must also be present for this option to take effect.
+
+@item -fupc-pthreads-model-tls
+@opindex fupc-pthreads-model-tls
+Compile for the POSIX threads (pthreads) environment.  Each UPC thread
+is directly mapped to one pthread.
+The @option{-fupc} must also be present for this option to take effect.
+
+@item -fupc-inline-lib
+@opindex fupc-inline-lib
+Inline various UPC run-time library routines.  This option is
+enabled by default when compiled with @option{-O1} or higher.
+The @option{-fno-upc-inline-lib} option will disable inlining
+of the UPC runtime.
+The @option{-fupc} must also be present for this option to take effect.
+
+@item -fupc-pre-include
+@opindex fupc-pre-include
+Pre-include the UPC runtime header files.  This option is enabled
+by default when @option{-fupc} is asserted.
+The @option{-fupc} must also be present for this option to take effect.
+
+@item -dwarf-2-upc
+@opindex dwarf-2-upc
+Generate UPC-specific symbolic DWARF-2 debugging information.  This
+debugging information is processed by UPC-aware debuggers including
+GDB-UPC, a variant of the GDB debugger, and the commercially available
+Rogue Wave Totalview and Allinea DDT debuggers.
+The @option{-fupc} must also be present for this option to take effect.
+
+@item -fupc-debug
+@opindex fupc-debug
+Generate calls to the UPC run-time library that include source filename
+and line number information; this information is used to print more
+informative error messages when errors are detected at run-time.
+The @option{-fupc} must also be present for this option to take effect.
+
+@item -fupc-instrument
+@opindex fupc-instrument
+Instrument UPC shared accesses and library calls using GASP tool
+support API.  This option implies @option{-fno-upc-inline-lib}.
+The @option{-fupc} must also be present for this option to take effect.
+
+@item -fupc-instrument-functions
+@opindex fupc-instrument-functions
+Instrument functions calls using GASP tool support.  This option implies
+@option{-fupc-instrument} and @option{-fno-upc-inline-lib}.
+The @option{-fupc} must also be present for this option to take effect.
+
 @item -fcilkplus
 @opindex fcilkplus
 @cindex Enable Cilk Plus
Index: gcc/doc/passes.texi
===================================================================
--- gcc/doc/passes.texi	(.../trunk)	(revision 231059)
+++ gcc/doc/passes.texi	(.../branches/gupc)	(revision 231080)
@@ -18,6 +18,7 @@  where near complete.
 
 @menu
 * Parsing pass::         The language front end turns text into bits.
+* UPC Transformation::   Transform UPC constructs into equivalent C.
 * Cilk Plus Transformation:: Transform Cilk Plus Code to equivalent C/C++.
 * Gimplification pass::  The bits are turned into something we can optimize.
 * Pass manager::         Sequencing the optimization passes.
@@ -104,6 +105,100 @@  that is more descriptive than "rest_of".
 The middle-end will, at its option, emit the function and data
 definitions immediately or queue them for later processing.
 
+@node UPC Transformation
+@section UPC Transformation
+@cindex UPC
+
+If UPC compilation is enabled via the flag @option{-fupc},
+all UPC constructs are transformed into equivalent C operations
+and/or calls to the UPC runtime library (@file{libgupc}).
+The majority of this transformation occurs near the end of the parsing pass
+and before the gimplification pass.  This transformation
+pass is implemented in the file @file{c-family/c-upc-low.c}.
+
+UPC constructs are handled in the @code{C} parser when the
+@option{-fupc} option is asserted.  The UPC language is specified as
+a series of extensions to ISO C99.  GNU UPC conforms to version 1.3
+of the UPC Language Specification
+@w{(@uref{http://upc.lbl.gov/publications/upc-spec-1.3.pdf}).}
+
+UPC introduces three type qualifiers: ``shared'', ``strict'',
+and ``relaxed''.  `shared'' qualified memory may be remote to
+the currently executing UPC thread.  The ``strict'' and ``relaxed''
+qualifiers further modify accesses to UPC shared memory.  A ``strict''
+UPC shared access has more stronger memory consistency properties
+than a ``relaxed'' access.  UPC introduces an additional ``layout qualifier''
+(also known as the blocking factor) which controls the layout of
+UPC shared arrays.  The following example illustrates the use of
+UPC-specific type qualifiers:
+@smallexample
+  shared strict int x;
+  shared relaxed int y;
+  /* Below, ``[100]'' is the layout qualifier.  */
+  shared [100] float A[100*THREADS*10];
+@end smallexample
+
+UPC also defines several synchronization statements
+which are specified as reserved words: ``upc_barrier'', ``upc_fence'',
+``upc_notify'', and ``upc_wait''.  Additionally, an
+iterator statement, ``upc_forall'' is defined; it is similar
+to the ``for'' statement, but has an additional (fourth)
+``affinity clause'' which constrains UPC shared accesses for
+each iteration of the loop.
+
+UPC introduces two reserved identifiers:
+@table @code
+@item MYTHREAD
+The thread number (in the range @code{0..THREADS-1})
+of the currently executing UPC thread.
+@item THREADS
+The number of UPC threads specified for the current
+program execution.
+@end table
+
+The major components of the UPC language extension transform passes are:
+@itemize @bullet
+@item UPC shared memory accesses:
+Read accesses to UPC shared memory are translated into calls
+to various ``get'' functions implemented in the UPC runtime library.
+Write accesses to UPC shared memory are translated into calls
+to various ``put'' routines implemented in the UPC runtime library.
+@item UPC shared variable allocation and references:
+Variables qualified by the UPC ``shared'' qualifier must be allocated
+in UPC shared memory which can be accessed by all UPC threads.
+It is common for a UPC thread to be implemented as an operating
+system process and for UPC threads to execute on different computing
+nodes often connected by specialized high speed networks.
+Therefore, UPC shared variable declarations must be consolidated
+and allocated separately from regular @code{C} global variables.
+
+@item UPC pointer-to-shared arithmetic:
+UPC pointers-to-shared have three components: ``thread'',
+``phase'', and ``offset''.  The ``thread'' gives the thread number
+of the thread that has affinity to the globally shared data.  The ``offset''
+gives the offset of the data within shared data allocated on the
+target thread.  The ``phase'' is used to implement the properties
+defined by the UPC ``layout qualifier''.  UPC pointer-to-shared
+arithmetic requires several multiplications and modulo operations
+to implement the more general cases.  The UPC transformation pass
+translates UPC pointer-to-shared arithmetic into an equivalent
+series of @code{C} arithmetic operations.
+
+@item UPC pointer-to-shared conversions:
+UPC pointers-to-shared can be converted into @code{C}
+pointers if the current UPC has affinity to the referenced
+UPC shared memory.  The UPC transformation pass translates
+conversions from UPC pointers-to-shared into a call to
+the UPC runtime which will implement the conversion if it
+it meets the affinity constraint.
+
+@item UPC synchronization statements:
+The UPC language defined synchronization statements
+(for example, ``upc_barrier'') are translated into
+calls to the UPC runtime.
+
+@end itemize
+
 @node Cilk Plus Transformation
 @section Cilk Plus Transformation
 @cindex CILK_PLUS
Index: gcc/doc/sourcebuild.texi
===================================================================
--- gcc/doc/sourcebuild.texi	(.../trunk)	(revision 231059)
+++ gcc/doc/sourcebuild.texi	(.../branches/gupc)	(revision 231080)
@@ -91,6 +91,9 @@  The Go runtime library.  The bulk of thi
 @item libgomp
 The GNU Offloading and Multi Processing Runtime Library.
 
+@item libgupc
+The GNU UPC runtime library.
+
 @item libiberty
 The @code{libiberty} library, used for portability and for some
 generally useful data structures and algorithms.  @xref{Top, ,
@@ -1884,6 +1887,9 @@  Target supports @option{-freorder-blocks
 @item fstack_protector
 Target supports @option{-fstack-protector}.
 
+@item fupc
+Target supports UPC via @option{-fupc}.
+
 @item gas
 Target uses GNU @command{as}.
 
Index: gcc/doc/tm.texi.in
===================================================================
--- gcc/doc/tm.texi.in	(.../trunk)	(revision 231059)
+++ gcc/doc/tm.texi.in	(.../branches/gupc)	(revision 231080)
@@ -53,6 +53,7 @@  through the macros defined in the @file{
 * PCH Target::          Validity checking for precompiled headers.
 * C++ ABI::             Controlling C++ ABI changes.
 * Named Address Spaces:: Adding support for named address spaces
+* UPC Language::	Defining UPC-related configuration items
 * Misc::                Everything else.
 @end menu
 
@@ -7468,6 +7469,18 @@  c_register_addr_space ("__ea", ADDR_SPAC
 
 @hook TARGET_ADDR_SPACE_DEBUG
 
+@node UPC Language
+@section UPC Language Support
+@cindex UPC, pointer-to-shared, libgupc
+
+@hook TARGET_UPC_LINK_SCRIPT_P
+
+@hook TARGET_UPC_SHARED_SECTION_NAME
+
+@hook TARGET_UPC_PGM_INFO_SECTION_NAME
+
+@hook TARGET_UPC_INIT_ARRAY_SECTION_NAME
+
 @node Misc
 @section Miscellaneous Parameters
 @cindex parameters, miscellaneous
Index: libgupc/libgupc.texi
===================================================================
--- libgupc/libgupc.texi	(.../trunk)	(revision 0)
+++ libgupc/libgupc.texi	(.../branches/gupc)	(revision 231080)
@@ -0,0 +1,215 @@ 
+\input texinfo @c -*-texinfo-*-
+
+@c %**start of header
+@setfilename libgupc.info
+@settitle GNU libgupc
+@c %**end of header
+
+
+@copying
+Copyright @copyright{} 2006-2015 Free Software Foundation, Inc.
+
+Permission is granted to copy, distribute and/or modify this document
+under the terms of the GNU Free Documentation License, Version 1.3 or
+any later version published by the Free Software Foundation; with the
+Invariant Sections being ``Funding Free Software'', the Front-Cover
+texts being (a) (see below), and with the Back-Cover Texts being (b)
+(see below).  A copy of the license is included in the section entitled
+``GNU Free Documentation License''.
+
+(a) The FSF's Front-Cover Text is:
+
+     A GNU Manual
+
+(b) The FSF's Back-Cover Text is:
+
+     You have freedom to copy and modify this GNU Manual, like GNU
+     software.  Copies published by the Free Software Foundation raise
+     funds for GNU development.
+@end copying
+
+@ifinfo
+@dircategory GNU Libraries
+@direntry
+* libgupc: (libgupc).                    GNU UPC runtime library
+@end direntry
+
+This manual documents the GNU implementation of the UPC runtime.
+multi-platform shared-memory parallel programming in C/C++ and Fortran.
+
+Published by the Free Software Foundation
+51 Franklin Street, Fifth Floor
+Boston, MA 02110-1301 USA
+
+@insertcopying
+@end ifinfo
+
+
+@setchapternewpage odd
+
+@titlepage
+@title The GNU UPC Implementation
+@page
+@vskip 0pt plus 1filll
+@comment For the @value{version-GCC} Version*
+@sp 1
+Published by the Free Software Foundation @*
+51 Franklin Street, Fifth Floor@*
+Boston, MA 02110-1301, USA@*
+@sp 1
+@insertcopying
+@end titlepage
+
+@summarycontents
+@contents
+@page
+
+
+@node Top
+@top Introduction
+@cindex Introduction
+
+This manual documents the usage of libgupc, the GNU runtime library
+implementation of the 
+@w{@uref{http://upc.lbl.gov/publications/upc-spec-1.3.pdf, UPC}}
+language extensions for shared-memory parallel programming in C.
+
+@comment
+@comment  When you add a new menu item, please keep the right hand
+@comment  aligned to the same column.  Do not use tabs.  This provides
+@comment  better formatting.
+@comment
+@menu
+* Enabling UPC::               How to enable UPC for your applications.
+* Configuring Libgupc::        How to configure the UPC runtime library.
+* Runtime Library Routines::   The UPC runtime application programming 
+                               interface.
+* The libgupc ABI::            Notes on the external ABI presented by libgupc.
+* Environment Variables::      Influencing runtime behavior with environment 
+                               variables.
+* Reporting Bugs::             How to report bugs in GNU UPC.
+* Copying::                    GNU general public license says
+                               how you can copy and share libgupc.
+* GNU Free Documentation License::
+                               How you can copy and share this manual.
+* Funding::                    How to help assure continued work for free 
+                               software.
+* Library Index::              Index of this documentation.
+@end menu
+
+@c ---------------------------------------------------------------------
+@c Enabling UPC
+@c ---------------------------------------------------------------------
+
+@node Enabling UPC
+@chapter Enabling UPC
+
+To activate the UPC extensions for C, the compile-time 
+flag @command{-fupc} must be specified.  This enables the UPC language
+extensions which include the @code{shared} type qualifier
+and various synchronization statements such as @code{upc_barrier}.
+The flag also arranges for automatic linking of the UPC runtime library 
+(@ref{Runtime Library Routines}).
+
+Alternatively, two command line drivers can be invoked: @command{upc}
+and @command{gupc}.  These drivers are wrappers around the @command{gcc}
+and will automatically supply the @option{-fupc} option and
+will default the compilation of @file{*.c} files as UPC language source.
+
+The @samp{libgomp} runtime library supports both a single-node
+Symmetric Memory Processor (@samp{smp}) and a multi-node distributed
+(@samp{portals4}) target configurations.  The target configuration
+is selected via the @command{configure} command when the library is
+built.  See @ref{Configuring Libgupc} for details.
+
+@c ---------------------------------------------------------------------
+@c Configuring Libgupc
+@c ---------------------------------------------------------------------
+
+@node Configuring Libgupc
+@chapter Configuring Libgupc
+
+@menu
+* SMP Configuration::        How to configure libgupc for SMP single-node
+                             operation.
+* Portals4 Configuration::   How to configure libgupc for multi-node
+                             operation using the Portals4 communication
+			     library.
+@end menu
+
+@node SMP Configuration
+@section SMP Configuration
+@cindex Configuration
+@cindex SMP Configuration
+
+@node Portals4 Configuration
+@section Portals4 Configuration
+@cindex Configuration
+@cindex Portals4 Configuration
+
+@c ---------------------------------------------------------------------
+@c Runtime Library Routines
+@c ---------------------------------------------------------------------
+
+@node Runtime Library Routines
+@chapter Runtime Library Routines
+
+@c ---------------------------------------------------------------------
+@c The libgupc ABI
+@c ---------------------------------------------------------------------
+
+@node The libgupc ABI
+@chapter The libgupc ABI
+
+@c ---------------------------------------------------------------------
+@c Environment Variables
+@c ---------------------------------------------------------------------
+
+@node Environment Variables
+@chapter Environment Variables
+
+@c ---------------------------------------------------------------------
+@c 
+@c ---------------------------------------------------------------------
+
+@node Reporting Bugs
+@chapter Reporting Bugs
+
+Bugs in the GNU UPC implementation should be reported via 
+@uref{http://gcc.gnu.org/bugzilla/, Bugzilla}.  For all cases, please add 
+"UPC" to the keywords field in the bug report.
+
+
+
+@c ---------------------------------------------------------------------
+@c GNU General Public License
+@c ---------------------------------------------------------------------
+
+@include gpl_v3.texi
+
+
+
+@c ---------------------------------------------------------------------
+@c GNU Free Documentation License
+@c ---------------------------------------------------------------------
+
+@include fdl.texi
+
+
+
+@c ---------------------------------------------------------------------
+@c Funding Free Software
+@c ---------------------------------------------------------------------
+
+@include funding.texi
+
+@c ---------------------------------------------------------------------
+@c Index
+@c ---------------------------------------------------------------------
+
+@node Library Index
+@unnumbered Library Index
+
+@printindex cp
+
+@bye