On 06/19/13 09:26:30, Gary Funck wrote: > The variable declaration tree node looks about right to me. > However, it never makes it into the output assembler file. > > What is the recommended method for making sure that the > static variable created above is associated with the current > translation unit and that its initialization makes it into > the assembler output file?
Adding this call to the upc_create_static_var() routine implemented the necessary binding: pushdecl_top_level (decl); pushdecl_top_level() is defined in c/c-decl.c: /* Record X as belonging to file scope. This is used only internally by the Objective-C front end, and is limited to its needs. duplicate_decls is not called; if there is any preexisting decl for this identifier, it is an ICE. */ tree pushdecl_top_level (tree x) [...] This also required that the temporary variable being created needs to be named (have a non-null DECL_NAME()). This doesn't seem ideal, but does generate the desired code.