1 2011-05-23 Gary Funck <gary@intrepid.com>
3 * upc-pts-struct.c: Revert to code that aligned the
4 internal pointer-to-shared representation to
5 twice the alignment of a pointer. This fixes
6 an ICE that occurred when building the compiler
9 2011-05-17 Gary Funck <gary@intrepid.com>
11 * upc-pts.h (upc_pts_build_value, upc_pts_build_add_offset,
12 upc_pts_build_cond_expr, upc_pts_build_constant,
13 upc_pts_build_cvt, upc_pts_build_diff, upc_pts_build_sum,
14 upc_pts_build_threadof, upc_pts_init_type): Remove extern
16 (upc_pts_ops_t): New. Define handler table that will
17 implement either the 'packed' or the 'struct' representation
18 of a UPC pointer-to-shared value.
19 (upc_pts_packed_ops, upc_pts_struct_ops): New. Define extern that
20 refers to the packed and the struct UPC pointer-to-shared
21 representation implementation.
22 (upc_pts): New. Define handler table that is set up at initialization
23 to refer to the handlers for the UPC pointer-to-shared
24 representation (packed/struct) that has been configured.
25 Add conditional compilation test for HAVE_UPC_PTS_PACKED_REP
26 and configure the UPC pointer-to-shared definitions that
27 are specific to the configured UPC pointer-to-shared
30 * upc-act.h (upc_pts_is_valid_p): Rename extern definition from
31 is_valid_pts_p to upc_pts_is_valid_p.
33 * lang-specs.h: Reformat the UPC compilation specs.
34 to improve readability.
36 * upc-rts-names.h: New. Define the names of UPC runtime
37 library functions that implement UPC language statement
38 semantics. These definitions were moved from config/upc-conf.h
40 * upc-gimplify.c: Add include of "upc-rts-names.h".
41 Refer to newly defined pointer manipulation routines
42 by indirecting through the newly defined "pts" handler table.
45 * upc-lang.c: Add include of "upc-pts.h". Fix a comment.
47 * config-lang.in: Remove logic that inserted "config/upc-conf.h"
48 into the target include and file path.
50 * upc-pts-struct.c: Add include of "upc-rts-names.h".
51 (upc_pts_struct_ops): Define the pointer manipulation
52 handler table that implements operations on UPC
53 pointers-to-shared, represented as a struct.
54 Re-format and re-indent.
56 * upc-gasp.c: Add include of "upc-rts-names.h".
57 Re-format and re-indent.
59 * upc-pts-packed.c: Add include of "upc-rts-names.h".
60 (upc_pts_packed_ops): Define the pointer manipulation
61 handler table that implements operations on UPC
62 pointers-to-shared, represented as a packed integer.
63 Re-format and re-indent.
65 * Make-lang.in: Compile both "upc-pts-packed.c" and
66 "upc-pts-struct.c". One/other will be selected at
67 compilation time to implement operations on UPC
68 on the UPC pointer-to-shared that has been configured.
69 Add dependencies on "upc-rts-names.h".
71 * upc-cmd.c: Re-format and re-indent.
73 * upc-act.c: Add include of "upc-rts-names.h".
74 (upc_pts): New. Add definition of the handler
75 table that implements representation specific
76 operations on trees that refer to UPC pointer-to-shared
77 objects and types. Re-format and re-indent.
79 2011-05-06 Gary Funck <gary@intrepid.com>
81 Eliminate compilation warnings, by fixing
82 #include's and updating function prototypes.
84 * upc-gimplify.c: Include bitmap.h.
85 (upc_gimplify_real_image_ref): Mark various parameters
86 as unused. This is a stub procedure for now.
88 * upc-lang.c: Include c-family/c-upc.h.
91 * upc-cmd.c (no_start_files): Delete unused variable.
92 The -nostartfiles switch is now handled by the linker spec.
94 * ChangeLog: Spell check.
96 2011-05-06 Gary Funck <gary@intrepid.com>
98 Upgrade c-family source files to conform with modularity
99 improvements. Mainly, remove #include of c-tree.h in files
100 under c-family, and define a new UPC-specific #include file,
103 * upc-act.h (upc_write_global_declarations,
104 upc_check_decl, upc_build_sync_stmt, upc_affinity_test,
105 upc_num_threads, upc_diagnose_deprecated_stmt):
106 Move external definitions to c-family/c-upc.h
107 (upc_blocksizeof_expr, upc_blocksizeof_type,
108 upc_elemsizeof_expr, upc_elemsizeof_type,
109 upc_localsizeof_expr, upc_localsizeof_type):
110 Remove external definitions; these functions
111 were moved from upc-act.c to c-parser.c.
113 * upc-gimplify.c: Add #include of c-family/c-upc.h.
114 upc-pts-packed.c: Ditto.
115 upc-pts-struct.c: Ditto.
117 * config-lang.in: Update gtfiles to refer to c-upc.h
120 * upc-act.c: Add #include of c-family/c-upc.h.
121 (upc_blocksize, upc_elemsizeof, upc_localsizeof):
122 Make external so that it can be called from c-parser.c.
123 (upc_blocksizeof_expr, upc_blocksizeof_type,
124 upc_elemsizeof_expr, upc_elemsizeof_type,
125 upc_localsizeof_expr, upc_localsizeof_type):
126 Move from upc/upc-act.c to c-parser.c.
127 (upc_set_block_factor): Fix typo in error message.
128 (upc_shared_type_p, upc_pts_cvt_op_p): Delete.
129 Move to tree.h and define as a macro.
130 (upc_get_unshared_type): Delete. renamed to
131 build_upc_unshared_type and moved to tree.c.
133 * upc-gimplify.c (upc_gimplify_lval, upc_gimplify_expr):
134 refer to renamed build_upc_unshared_type function.
135 upc-act.c (create_unshared_var): Ditto.
137 2011-05-03 Gary Funck <gary@intrepid.com>
139 * upc-lang.c: Remove extraneous FIXME/TODO comments.
140 * upc-pts-packed.c (upc_pts_build_cvt): Ditto.
141 * upc-act.c (upc_set_block_factor): Ditto.
143 2011-04-29 Gary Funck <gary@intrepid.com>
145 * upc-gimplify.c (upc_expsnd_get): Improve error diagnostics.
146 (upc_expand_put): Ditto.
147 (upc_shared_addr): Ditto.
148 (upc_gimplify_sync_stmt): Ditto.
149 (upc_gimplify_field_ref): Ditto.
151 * upc-pts-struct.c (upc_pts_build_diff): Improve error diagnostics.
152 (upc_pts_build_cvt): Ditto.
154 * upc-act.c (upc_handle_option): Improve error diagnostics.
155 (upc_lang_init): Ditto.
156 (upc_sizeof_type_check): Ditto.
157 (upc_set_block_factor): Ditto.
158 (upc_decl_init): Ditto.
159 (upc_affinity_test): Ditto.
160 (upc_num_threads): Ditto.
161 (upc_diagnose_deprecated_stmt): Ditto.
162 (upc_build_shared_var_addr): Ditto.
163 (upc_pts_int_sum): Ditto.
164 (upc_pts_diff): Ditto.
167 2011-04-28 Gary Funck <gary@intrepid.com>
169 * upc-act.c (create_unshared_var): call upc_get_unshared_type()
170 instead of using TYPE_MAIN_VARIANT() to create an equivalent type
171 that is not a UPC shared type. This is sometimes necessary
172 when the given shared type is derived from a typedef.
174 2011-04-24 Gary Funck <gary@intrepid.com>
176 * upc-act.c (upc_handle_option): Fix incorrect error
177 diagnostic messages when both -fupc-debug and
178 -fupc-inline-lib are asserted.
180 2011-04-24 Gary Funck <gary@intrepid.com>
182 * upc-cmd.c (GCC_WORD_SWITCH_TAKES_ARG): Add "--param"
183 to the list of switches that accept arguments.
184 (main): Check for switches that have a following
185 argument inside the loop that copies arguments and
186 adds '-x upc' or '-x none' as necessary.
187 (main): Misc. clean ups and simplifications.
189 2011-04-22 Gary Funck <gary@intrepid.com>
191 Merge trunk version 172873 into gupc branch.
192 * upc-act.c (upc_build_init_func): assert DECL_PRESERVE_P()
193 on init_func() to prevent it from being removed from
196 2011-04-19 Gary Funck <gary@intrepid.com>
198 Merge trunk version 172359 into gupc branch.
199 * upc-lang.c (upc_init_ts): New.
200 (LANG_HOOKS_INIT_TS): use upc_init_ts.
202 2011-04-19 Gary Funck <gary@intrepid.com>
204 Eliminate warnings when compiling upc-cmd.c.
206 * upc-cmd.c (file_exists): Remove.
207 (arg_copy): Remove const qualifier.
209 2011-04-13 Gary Funck <gary@intrepid.com>
211 * upc-cmd.c (GCC_WORD_SWITCH_TAKES_ARG): Add "dumpbase"
212 to the list, and alphabetize.
214 2011-04-13 Gary Funck <gary@intrepid.com>
216 * upc-gimplify.c (upc_gimplify_real_image_ref): New.
217 Currently, a not-yet-implemented stub.
218 (upc_gimplify_lval): call upc_gimplify_real_image_ref to
219 rewrite UPC shared REALPART_EXPR and IMAGPART_EXPR lvalues.
220 This will avoid an ICE when compiling regular "C"
221 code that refers to those operators.
223 2011-04-13 Gary Funck <gary@intrepid.com>
225 * upc-cmd.c: Do not add "-isystem <libupc_path>" if
226 -fno-upc-pre-include is asserted.
228 2011-03-22 Gary Funck <gary@intrepid.com>
230 * upc-cmd.c: Move linker switches into libupc/libupc.spec.
231 (UPC_LINKER_SCRIPT, LIBNUMA, LIBUPC, LIBUPC_PT) Remove.
232 (find_ld_script) Remove.
234 2011-03-20 Gary Funck <gary@intrepid.com>
236 * upc-act.c: Call error() directly with a format specifier,
237 rather than using sprintf() to format the message.
238 This should make it easier to internationalize UPC's error messages.
240 2011-03-20 Gary Funck <gary@intrepid.com>
242 Move UPC start files, end files, and linker specs.
243 into libupc. This reduces the impact on common GCC
244 configuration files, and ensures that these UPC-specific
245 components are only built when the UPC language dialect is selected.
247 * config-lang.in: Remove setting of 'upc_extra_parts', which
248 was used to specify which upc-crtbegin and upc-crtend files
249 need to built. Remove extraneous (commented out)
250 settings of 'cfiles'. The listed configuration files
251 have been reverted to trunk, and weren't referenced
252 via cfiles in any event.
254 * upc/upc-cmd.c: Remove test for HAVE_UPC_LINK_SCRIPT.
255 Simply test for the presence of the UPC link script
256 in the current directory or the libupc directory.
257 Add -B<path-to-libupc> to the switches passed to 'gcc';
258 this is needed in order to find the upc-crtbegin
259 and upc-crtend object files now built in libupc.
260 Remove test for and inclusion of UPC_LINKER_SWITCHES.
261 if extra switches are needed for a particular target
262 (like SGI/Irix), they will be defined by the custom
263 linker spec. built in libupc. Remove test for
264 HAVE_UPC_NUMA_SUPPORT; if '-lnuma' is needed, it
265 will be added to the custom linker specs. built
268 * upc-crtstuff.c: Move to libupc.
270 2011-02-22 Gary Funck <gary@intrepid.com>
272 * upc-act.c (upc_diagnose_deprecated_stmt): New.
273 upc-act.h (upc_diagnose_deprecated_stmt): Define.
274 Check usage of deprecated keywords and issue
277 2011-02-08 Gary Funck <gary@intrepid.com>
279 * upc-pts-struct.c: Fix bug: (pts + int) fails when int is negative
280 for struct-pts representation
282 Analysis indicated that for something like (+ ptr -80) this was
283 being represented as (+ ptr (- 80)) and further, when the
284 calculations were propagated into the individual operations on the
285 components of the 'struct' pointer, it would end up with something
286 like (+ ptr.vaddr (- 80)), and the type of (- 80) would end up as
287 "long unsigned int" because of the addition to the pointer. This
288 caused the calculations involving the signed 'int' operand to be
289 performed incorrectly. This fix insures that the 'int' operand is
292 2011-02-08 Gary Funck <gary@intrepid.com>
294 * upc/config-lang.in, upc/lang-specs.h, upc/Makefile.in,
295 upc/Make-lang.in, upc/upc.1, upc/upc-act.c, upc/upc-act.h,
296 upc/upc-cmd.c, upc/upc-crtstuff.c, upc/upc-gasp.c,
297 upc/upc-gasp.h, upc/upc-gimplify.c, upc/upc-gimplify.h,
298 upc/upc-lang.c, upc/upc-pts.h, upc/upc-pts-packed.c,
299 upc/upc-pts-struct.c, upc/upc-tree.def, upc/upc-tree.h:
300 Update copyright notices.
302 2011-01-09 Gary Funck <gary@intrepid.com>
304 Fix behavior of upc_localsizeof() when called in a dynamic
305 threads compilation environment. This bug, and the expected
306 behavior is documented in this bug report:
307 https://upc-bugs.lbl.gov/bugzilla/show_bug.cgi?id=2960.
308 * upc_act.c (upc_localsizeof): Re-implement.
310 2010-12-15 Gary Funck <gary@intrepid.com>
312 Merge trunk version 167307 into gupc branch.
313 * upc_act.h: (upc_handle_option) add location and struct
314 cl_option_handlers * parameters.
315 (upc_finish_file) Remove.
316 (upc_write_global_declarations) New, replaces upc_finish_file.
317 * lang-spec.h: Disable multi-file compilation for .upc files.
318 This fixes an issue where file-scoped static variables were
319 diagnosed as multiply-defined. Both "C" and "ObjC" also disable
320 multi-file compilation.
321 * upc-gimplify.c: (upc_expand_put) Check for INDIRECT_REF_P()
322 explicitly when deciding whether a UPC shared object is addressable.
323 is_gimple_addressable() used to do this, but now checks for MEM_REF
324 which does not apply to UPC shared objects.
325 (upc_gimplify_lval, upc_gimplify_expr) Delete references to
326 ALIGN_INDIRECT_REF and MISALIGNED_INDIRECT_REF.
327 These are no longer defined.
328 (upc_genericize) Add call to bitmap_obstack_initialize()
329 and bitmap_obstack_release() around call to gimplify_function_tree().
330 * upc-lang.c: Add #include of "opts.h" and "options.h".
331 (flag_upc_debug, flag_upc_inline_lib, flag_upc_instrument,
332 flag_upc_instrument_functions) Remove. Use definitions
333 generated by the options file.
334 (upc_init_options) Use cl_decoded_option struct.
335 (LANG_HOOKS_WRITE_GLOBALS) Define as upc_write_global_declarations.
336 (finish_file) Delete.
337 (upc_init_options) Call control_warning_option() to specify
338 -Werror=pointer-arith as the default. Remove call to
339 enable_warning_as_error().
340 * upc-pts-struct.c: (upc_pts_init_type) Move test that
341 UPC_PTS_THREAD_SIZE is a multiple of a byte into an "if" statement
342 rather than an #ifdef; this macro now depends upon a
343 target size macro which must be evaluated at runtime.
344 * Make-lang.in: (cc1-dummy) Remove make target.
345 (cc1upc-checksum.c) Generate directly from object files.
346 * upc-cmd.c: (SWITCH_TAKES_ARG, WORD_SWITCH_TAKES_ARG) Delete
347 references to these deprecated macro definitions.
348 (GCC_WORD_SWITCH_TAKES_ARG, GCC_WORD_SWITCH_TAKES_ARG) New.
349 (all_exec_args) Delete variable.
350 (exec_args) Re-define as (const char *).
351 (exec_arg_list) New. Make copy of exec_args to pass to 'exec'.
352 * upc-act.c: (upc_handle_option) Update argument list to accept
353 (cl_option_handlers *) argument.
354 (upc_finish_file) Rename to upc_write_global_declarations.
355 (upc_write_global_declarations) New.
357 2010-10-17 Gary Funck <gary@intrepid.com>
359 * upc-act.c: Issue a compilation error on attempts to perform
360 arithmetic on generic pointer-to-shared values.
362 (The rest of this update is a small code clean up.)
364 2010-10-17 Gary Funck <gary@intrepid.com>
366 * upc-lang.c: For UPC only, issue errors for arithmetic and related
367 operations on void types.
369 This update simulates the effect of -Werror=pointer-arith, thus
370 causing arithmetic on void types, sizeof(void) and so on to be
371 considered compilation errors. This meets the expectations of some
372 harness tests and the RTED/CTED test suites. GCC is more
373 permissive, but since this is for UPC only, we can fairly safely
374 define this new policy.
376 2010-10-16 Gary Funck <gary@intrepid.com>
378 * upc-act.c: Fix bug: Static initialization of shared
379 arrays is unsupported -- issue an error message.
381 Currently, static initialization of a shared array is not
382 implemented correctly.
384 We do not plan to fix this for a while, therefore the compiler will
385 issue an error message indicating that this is an unsupported
388 2010-10-13 Gary Funck <gary@intrepid.com>
390 * upc-act.c: Fix bug: negative layout qualifiers not diagnosed
393 The CTED_UPC test c_A_1_3_b.upc, specified a negative blocksize, but
394 it was not diagnosed as an error. With this fix, negative block
395 sizes will generate a translation error.
397 2010-10-10 Gary Funck <gary@intrepid.com>
399 * upc-act.c: Fix bug: ICE: Attempt to take the difference of
400 shared and non-shared pointers
402 The compiler detected the error, and then tried to return
403 error_mark_node. This apparently is not acceptable, as there is an
404 explicit assertion check to prevent this from happening in
405 build_binary_op. Return the more user-friendly size_one_node
408 2010-10-09 Gary Funck <gary@intrepid.com>
410 * upc-act.c: Fix bug: segfault on incomplete array definition.
412 This turned out to be a bit complicated. The logic in
413 upc_lang_layout_decl had to be re-arranged to avoid trying to lookup
414 the THREADS identifier in the case where the blocking factor has
415 been set to indefinite ([]). This can happen when indefinite array
416 declarations are processed for shared arrays. At that time, the
417 file scope has been closed and THREADS is no longer in scope. Some
418 more work is needed on upc_lang_layout_decl(). It has some
419 duplication, and notably duplicates the two branches of the if
420 having to do with TYPE_SIZE and TYPE_SIZE_UNIT, that appear in the
421 caller of this routine (layout_decl()).
423 The method of forcing a layout qualifier of [] in the indefinite
424 declaration handler is odd a well. The code that just does the
425 setting of the block factor, needs to moved into its own routine
426 that doesn't depend upon a declspec for '[]' to be passed in, just
427 in order to set the blocking factor to some value (in this case, 0).
428 Also, the logic for how that shared type is constructed is strange.
429 First the type with 0 blocking factor is set. Then the shared
430 qualifier is removed from the type, and then added back later. The
431 intermediate type has a blocking factor set, but it has no shared
432 qualifier. Fixing this will require some thought. It is tempting
433 just to make indefinite shared arrays an error, rather than forcing
434 the dimension to be '1'.
436 This likely fixes a serious error in the previous update to
437 upc_lang_layout_decl(), where it didn't have the logic to set
438 TYPE_SIZE_UNIT() in the main part of the 'if' statement. This means
439 the previous update would fail on many tests.
441 See also: gcc/c-common.c gcc/upc/upc-act.c
443 2010-10-01 Gary Funck <gary@intrepid.com>
445 * upc-manpage.html, upc.1: Update manual page, and bug reporting
448 Update "man" page to reflect debugging switches. Also, some general
449 clean up. Change the bug reporting URL to point to gccupc.org.
451 See also: gcc/configure gcc/configure.ac gcc/upc/upc-manpage.html
454 2010-10-01 Gary Funck <gary@intrepid.com>
456 * upc-act.c: Do not zap all qualifier bits when constructing a
457 non-shared result node.
459 This fix was suggested by Paul H. in the following Berkeley Bugzilla
460 report: https://upc-bugs.lbl.gov/bugzilla/show_bug.cgi?id=2061 The
461 use of "!" rather than "~" zapped all the type qualifier bits rather
462 than just those that are related to the "shared" qualifier. This
463 fix clears only the relevant bits.
465 2010-09-26 Gary Funck <gary@intrepid.com>
467 * upc-act.c: Fix bug: upc_forall with empty clauses
468 mis-diagnosed as syntax error.
470 A failure was exhibited by the Berkeley test case,
471 bug873a.upc, which has the code:
473 upc_forall (;;;d) {...} The compiler did not properly handle
474 the empty "condition" clause, and did not recover well when it was
475 determined that the use of a double value, "d" above, was neither a
476 pointer-to-shared nor an integer expression. The update implements a
479 See also: gcc/c-parser.c gcc/upc/upc-act.c
481 2010-09-25 Gary Funck <gary@intrepid.com>
483 * upc-pts-struct.c: Fix an ICE on 32-bit/struct target: failed
484 gimple check when calculating affinity for upc_forall.
486 Intrepid test, test10.upc, failed to compile due a mis-match between
487 the COMPONENT_REF node and the internal 'thread' field. Changed the
488 code to make the types agree, and added a conversion to sizetype if
491 2010-09-23 Gary Funck <gary@intrepid.com>
493 * upc-act.c: Fix bug: ICE: '[*]' layout factor applied to array
494 with static threads and size not a multiple of threads.
496 Add an extra check for an attempt to apply a '[*]' layout qualifier
497 to a shared array that does not specify a size that is a multiple of
498 THREADS, when compiled in a static THREADS compilation environment.
500 2010-09-22 Gary Funck <gary@intrepid.com>
502 * upc-act.c, upc-act.h: Fix bug: Nested upc_forall() semantics
505 The checkforall test in the Berkeley harness test suite indicated
506 that GCC/UPC was not properly implementing nested upc_forall
507 semantics. Nested upc_forall statements (both statically or
508 dynamically nested) must implement their affinity clause as if it
509 were "continue"; thus all steps in the loop must execute without
510 regard for affinity. To implement these semantics a global depth
511 counter, __upc_forall_depth, is maintained by the generated code
512 that implements upc_forall.
514 See also: gcc/c-parser.c gcc/c-tree.h gcc/stub-upc.c
515 gcc/upc/upc-act.c gcc/upc/upc-act.h libupc/include/gcc-upc-lib.in
516 libupc/include/upc.h libupc/smp/upc_main.c
518 2010-09-18 Gary Funck <gary@intrepid.com>
520 * upc-act.c, upc-pts-packed.c, upc-pts-struct.c: Implement
523 2010-07-03 Gary Funck <gary@intrepid.com>
525 Merge trunk version 161517 into gupc branch.
526 * config-lang.in: Update references to files
527 moved into c-family/.
528 * Make-lang.in: Likewise.
529 * upc-act.c: Likewise.
530 * upc-gasp.c: Likewise.
531 * upc-gimplify.c: Likewise.
532 * upc-lang.c: Likewise.
533 * upc-pts-packed.c: Likewise.
534 * upc-pts-struct.c: Likewise.
535 * upc-act.c: (upc_handle_option) add parameters to
536 effect pass through call to c_common_handle_option.
537 * upc-act.h: (upc_handle_option) Likewise.
538 * upc-act.c: (map_unshared_var) used typed ggc allocation.
539 * upc-act.c: (upc_build_init_func) add call to
540 to mark_decl_referenced(), to ensure that UPC shared
541 variable initializer function is not removed from
544 2010-02-28 Gary Funck <gary@intrepid.com>
546 Initial implementation and checkin.