This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: (gcc 4.2) how to create an ADDR_EXPR that refers to a linkage name?
- From: "Diego Novillo" <dnovillo at google dot com>
- To: "Gary Funck" <gary at intrepid dot com>
- Cc: "GCC List" <gcc at gcc dot gnu dot org>
- Date: Sat, 1 Sep 2007 13:43:37 -0400
- Subject: Re: (gcc 4.2) how to create an ADDR_EXPR that refers to a linkage name?
- References: <20070901172647.GD23325@intrepid.com>
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.