This is the mail archive of the gcc@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: (gcc 4.2) how to create an ADDR_EXPR that refers to a linkage name?


On 9/1/07, Gary Funck <gary@intrepid.com> wrote:

> All suggestions/help appreciated, - Gary

Have you considered using the data sharing machinery in OpenMP?  We
simply create a data structure holding all shared variables, allocate
that in shared memory and re-write all references to shared variables
as dereferences to that structure.

See the implementation of the 'shared' clauses in omp-low.c.  It will
mostly depend on the threading semantics of UPC.  In OpenMP, we
operate on a pthread-like environment, so we can pass around pointers
to the stack in the parent thread which can then be shared with the
children threads.

This trick you are implementing with cloning the VAR_DECLs is
guaranteed not to work, sorry.  We very explicitly assume that if
DECL_UID (x1) == DECL_UID (x2) then x1 == x2.  This is not something
that will change.


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