* c-parser.c (c_parser_omp_threadprivate): If DECL_RTL_SET_P,
[official-gcc.git] / gcc / ChangeLog.gomp
blob00458aa54d68eef501aa6f704672d085773ffea7
1 2005-10-28  Jakub Jelinek  <jakub@redhat.com>
3         * c-parser.c (c_parser_omp_threadprivate): If DECL_RTL_SET_P,
4         call make_decl_rtl again so that encode_section_info can update
5         SYMBOL_REF's flags.
7 2005-10-26  Jakub Jelinek  <jakub@redhat.com>
9         PR c++/24512
10         * c-common.h (c_finish_omp_for): Add PRE_BODY argument.
11         * c-omp.c (c_finish_omp_for): Likewise.  Set OMP_FOR_PRE_BODY
12         to that argument.
13         * c-parser.c (c_parser_omp_for_loop): Adjust c_finish_omp_for
14         caller.
16 2005-10-25  Diego Novillo  <dnovillo@redhat.com>
18         Mainline merge (gomp-merge-20051025).
19         
20 2005-10-24  Jakub Jelinek  <jakub@redhat.com>
22         * tree-nested.c (convert_nonlocal_reference): Handle OMP_MASTER and
23         OMP_ORDERED.  Merge several OMP_* cases together by using OMP_CLAUSES
24         and OMP_BODY macros.
25         (convert_local_reference): Likewise.
27 2005-10-24  Diego Novillo  <dnovillo@redhat.com>
29         Mainline merge (gomp-merge-20051023).
31 2005-10-23  Richard Henderson  <rth@redhat.com>
33         * gimplify.c (GOVD_SPECIALPRIVATE, GOVD_GLOBAL): Remove.
34         (GOVD_LASTPRIVATE, GOVD_REDUCTION): New.
35         (gimplify_deconstruct_omp_clauses): Use them.
36         (omp_add_variable): Don't elide decls with constructors.
37         (omp_notice_variable): Restrict SEEN propagation block to PRIVATE.
38         (gimplify_reconstruct_omp_clauses_1): Rebuild LASTPRIVATE clauses.
39         * hooks.h, hooks.c (hook_tree_tree_null): New.
40         * langhooks-def.h (lhd_omp_assignment): Declare.
41         (LANG_HOOKS_OMP_CLAUSE_DEFAULT_CTOR): New.
42         (LANG_HOOKS_OMP_CLAUSE_COPY_CTOR): New.
43         (LANG_HOOKS_OMP_CLAUSE_ASSIGN_OP): New.
44         (LANG_HOOKS_OMP_CLAUSE_DTOR): New.
45         (LANG_HOOKS_DECLS): Add them.
46         * langhooks.c (lhd_omp_assignment): New.
47         * langhooks.h (struct lang_hooks_for_decls): Add omp_clause_dtor,
48         omp_clause_default_ctor, omp_clause_assign_op, omp_clause_copy_ctor.
49         * omp-low.c (build_outer_var_ref): Remap the type to the inner context.
50         (scan_sharing_clauses): Use OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE.
51         (build_modify_expr): Remove.
52         (expand_rec_input_clauses): Use new langhooks; return a dtor sequence;
53         avoid copyin sequence for the master.
54         (expand_lastprivate_clauses): Use omp_clause_assign_op.
55         (expand_copyprivate_clauses): Likewise.
56         (expand_send_clauses): USe OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE.
57         (expand_omp_parallel): Emit dtor sequence.
58         (expand_omp_for_1, expand_omp_sections): Likewise.
59         (expand_omp_single_copy): Move expand_rec_input_clauses call ...
60         (expand_omp_single): ... here.  Emit dtor sequence.
61         * tree.h (OMP_CLAUSE_LASTPRIVATE_FIRSTPRIVATE): New.
63 2005-10-21  Richard Henderson  <rth@redhat.com>
65         * gimplify.c (gimplify_case_label_expr): Don't crash if the
66         case_labels vector is in an outer context.
67         * omp-low.c (diagnose_sb_1): Fix paste-o.
69 2005-10-21  Richard Henderson  <rth@redhat.com>
71         * tree.def (OMP_FOR): Increase size.
72         * tree.h (OMP_FOR_PRE_BODY): New.
73         * gimplify.c (gimplify_omp_for): Use OMP_FOR_PRE_BODY for pre-queue
74         for the INIT, COND, or INCR expressions.
75         * omp-low.c (scan_omp_for): Scan OMP_FOR_PRE_BODY.
76         (scan_omp_nested): Likewise.
77         (expand_omp_for_1): Expand OMP_FOR_PRE_BODY.
78         (diagnose_sb_1, diagnose_sb_2): Scan all OMP_FOR fields.
79         * tree-pretty-print.c (dump_generic_node) <OMP_FOR>: Handle
80         printing OMP_FOR_PRE_BODY.
82 2005-10-21  Richard Henderson  <rth@redhat.com>
84         * omp-low.c (scan_omp_nested) <OMP_CLAUSE_PRIVATE>: Replace
85         OMP_CLAUSE_DECL with the new private decl.  Use a tree list
86         for fixing up the variable sized decls.
88 2005-10-22  Jakub Jelinek  <jakub@redhat.com>
90         * dwarf2out.c (loc_descriptor_from_tree_1): Don't set unsignedp
91         before the switch, but just in the 2 places that need it.
93 2005-10-21  Richard Henderson  <rth@redhat.com>
95         * omp-low.c: Include except.h.
96         (create_omp_child_function): Call pushdecl on the new function.
97         (scan_omp_parallel): Make the TYPE_NAME a TYPE_DECL.
98         (scan_omp_single): Likewise.
99         (maybe_catch_exception): New.
100         (expand_omp_parallel, expand_omp_for, expand_omp_sections,
101         expand_omp_single, expand_omp_master, expand_omp_ordered,
102         expand_omp_critical): Call it.
104 2005-10-21  Diego Novillo  <dnovillo@redhat.com>
106         PR 24455
107         * c-tree.h (C_DECL_THREADPRIVATE_P): Define.
108         * c-parser.c (c_parser_omp_threadprivate): Set.
109         Do not error out if C_DECL_THREADPRIVATE_P is set already.
110         * c-decl.c (diagnose_mismatched_decls): Do not check for
111         mismatched thread-local attributes when OLDDECL is marked
112         threadprivate and NEWDECL has no thread-local attributes.
113         (merge_decls): Merge C_DECL_THREADPRIVATE_P.
115 2005-10-21  Jakub Jelinek  <jakub@redhat.com>
117         * omp-low.c (expand_omp_critical): Use splay_tree_new_ggc instead of
118         splay_tree_new to create critical_name_mutexes.
120 2005-10-20  Richard Henderson  <rth@redhat.com>
122         * c-decl.c (c_gimple_diagnostics_recursively): Rename from
123         c_warn_unused_result_recursively.  Invoke
124         diagnose_omp_structured_block_errors.
125         * omp-low.c (scan_omp_1): Don't handle LABEL_EXPR.
126         (expand_omp_1): Don't handle GOTO_EXPR or RETURN_EXPR.
127         (expand_omp): Don't request RETURN_EXPRs.
128         (execute_lower_omp): Don't alloc or destroy all_labels.
129         (diagnose_sb_0, diagnose_sb_1, diagnose_sb_2): New.
130         (diagnose_omp_structured_block_errors): New.
131         * tree-gimple.h (diagnose_omp_structured_block_errors): Declare.
133 2005-10-20  Richard Henderson  <rth@redhat.com>
135         * c-parser.c (c_parser_omp_for_loop): Install the continue label,
136         if one was generated.
137         * c-typeck.c (c_finish_bc_stmt): Diagnose break within omp for.
139 2005-10-20  Jakub Jelinek  <jakub@redhat.com>
141         * tree-pretty-print.c (dump_generic_node): Handle OMP_MASTER and
142         OMP_ORDERED.  Handle printing of OMP_BODY just in one place,
143         goto dump_omp_body in the rest of OMP_* nodes that have OMP_BODY.
145 2005-10-20  Richard Henderson  <rth@redhat.com>
147         * Makefile.in (omp-low.o): Update dependencies.
148         (GTFILES): Add omp-low.c.
149         (s-gtype): Add gt-omp-low.h.
150         * c-common.h (c_finish_omp_master, c_finish_omp_ordered): Update.
151         * c-omp.c (c_finish_omp_master): Use OMP_MASTER, return the stmt.
152         (c_finish_omp_ordered): Similarly with OMP_ORDERED.
153         * c-parser.c (c_parser_omp_critical): Return the stmt.
154         (c_parser_omp_master, c_parser_omp_ordered): Likewise.
155         (c_parser_omp_construct): Set the locus on them.
156         * gimplify.c (gimplify_omp_sections): Remove.
157         (gimplify_omp_workshare): Rename from gimplify_omp_single;
158         handle any clause+body workshare construct.
159         (critical_name_mutexes, gimplify_omp_critical): Move to omp-low.c.
160         (gimplify_expr): Use gimplify_omp_workshare.  Handle OMP_MASTER
161         and OMP_ORDERED.
162         * omp-low.c: Don't include except.h; do include ggc.h.
163         (scan_omp_1): Handle OMP SECTION, MASTER, ORDERED, CRITICAL.
164         (expand_omp_sections): Lookup the context for the OMP_SECTION.
165         (expand_omp_master, expand_omp_ordered): New.
166         (critical_name_mutexes, expand_omp_critical): Move from gimplify.c.
167         (expand_omp_1): Call them.  Handle RETURN_EXPR.
168         (expand_omp): Set want_return_expr.
169         * tree-gimple.c (is_gimple_stmt): True for OMP_MASTER, 
170         OMP_ORDERED, OMP_CRITICAL.
171         * tree-gimple.h (struct walk_stmt_info): Add want_return_expr.
172         * tree-nested.c (walk_stmts): Honor it.
173         * tree.def (OMP_MASTER, OMP_ORDERED): New.
174         * tree.h (OMP_MASTER_BODY, OMP_ORDERED_BODY): New.
176 2005-10-19  Richard Henderson  <rth@redhat.com>
178         * omp-low.c (struct omp_context): Add depth.
179         (new_omp_context): Set it.
180         (all_labels): New.
181         (execute_lower_omp): Allocate and delete it.
182         (scan_omp_1): Fill it in.
183         (expand_omp_1): Check for goto that cross contexts.
184         (expand_omp): Set want_locations.
186 2005-10-19  Richard Henderson  <rth@redhat.com>
188         * omp-low.c (expand_omp_1) <INDIRECT_REF>: Fix thinko in
189         expand_regimplify the operand.
191 2005-10-18  Diego Novillo  <dnovillo@redhat.com>
193         * omp-low.c (use_pointer_for_field): Fix thinko in
194         handling of TREE_ADDRESSABLE decls.
196 2005-10-18  Diego Novillo  <dnovillo@redhat.com>
198         * omp-low.c (use_pointer_for_field): Return true for
199         TREE_ADDRESSABLE decls.
201 2005-10-18  Jakub Jelinek  <jakub@redhat.com>
203         * langhooks.h (struct lang_hooks_for_decls): Add
204         omp_predetermined_sharing hook.
205         * langhooks.c (lhd_omp_predetermined_sharing): New function.
206         * langhooks-def.h (lhd_omp_predetermined_sharing): New prototype.
207         (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Define.
208         (LANG_HOOKS_DECLS): Add LANG_HOOKS_OMP_PREDETERMINED_SHARING.
209         * gimplify.c (omp_notice_variable): Only return immediately
210         if a global var is DECL_THREAD_LOCAL_P.  Use
211         omp_predetermined_sharing langhook.
212         (gimplify_reconstruct_omp_clauses_1): Do not add global vars
213         into OMP_CLAUSE_SHARED clause.
214         * c-common.h (c_omp_predetermined_sharing): New prototype.
215         * c-objc-common.h (LANG_HOOKS_OMP_PREDETERMINED_SHARING): Redefine.
216         * c-omp.c (c_omp_predetermined_sharing): New function.
217         * omp-low.c (scan_sharing_clauses): Handle const shared scalar
218         vars as if they were firstprivate.
220         * langhooks.c (lhd_omp_privatize_by_reference): Remove.
221         * langhooks-def.h (lhd_omp_privatize_by_reference): Remove prototype.
222         (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Use hook_bool_tree_false
223         instead.
225 2005-10-18  Richard Henderson  <rth@redhat.com>
227         * c-omp.c (c_finish_omp_critical): Use make_node and accessors
228         instead of build.
229         * c-parser.c (c_parser_omp_single): Likewise.
230         * tree.c (tree_range_check_failed): New.
231         * tree.def: Update comments around omp codes.
232         * tree.h (TREE_RANGE_CHECK): New.
233         (OMP_BODY, OMP_CLAUSES): New.
234         (OMP_PARALLEL_BODY, OMP_PARALLEL_CLAUSES, OMP_FOR_BODY,
235         OMP_FOR_CLAUSES, OMP_FOR_INIT, OMP_FOR_COND, OMP_FOR_INCR,
236         OMP_SECTIONS_BODY, OMP_SECTIONS_CLAUSES, OMP_SINGLE_BODY,
237         OMP_SINGLE_CLAUSES, OMP_CRITICAL_BODY, OMP_CRITICAL_NAME): Renumber
238         arguments to canonical form.
239         (OMP_CLAUSE_CHAIN, OMP_CLAUSE_DECL): Add checking.
241         * omp-low.c (struct omp_context): Add is_nested.
242         (fixup_variable_sized): Split out of...
243         (scan_sharing_clauses): ... here.  Avoid unnecessary indirection.
244         (omp_copy_decl): Don't remap global variables.
245         (scan_omp_nested): New.
246         (scan_omp_1): Use it.
247         (expand_omp_1): Avoid walking nested contexts.  Regimplify
248         INDIRECT_REF properly.
250 2005-10-18  Jakub Jelinek  <jakub@redhat.com>
252         * langhooks.h (struct lang_hooks_for_decls): Add
253         omp_privatize_by_reference hook.
254         * langhooks-def.h (lhd_omp_privatize_by_reference): New prototype.
255         (LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE): Define.
256         (LANG_HOOKS_DECLS): Add LANG_HOOKS_OMP_PRIVATIZE_BY_REFERENCE.
257         * langhooks.c (lhd_omp_privatize_by_reference): New function.
258         * omp-low.c (is_reference): Call omp_privatize_by_reference
259         langhook.
261 2005-10-17  Richard Henderson  <rth@redhat.com>
263         * gimplify.c (gimplify_omp_for): Canonicalize the operand order
264         wrt PLUS.
266 2005-10-16  Diego Novillo  <dnovillo@redhat.com>
268         Mainline merge (gomp-merge-20051016).
270 2005-10-15  Jakub Jelinek  <jakub@redhat.com>
272         * omp-low.c (build_reduction_init): Use array member type for arrays.
273         Handle NE_EXPR and EQ_EXPR.  Handle floating point MAX_EXPR/MIN_EXPR
274         initialization.
275         (array_reduction_init): New function.
276         (expand_rec_input_clauses): Use it.
277         (array_reduction_op): New function.
278         (expand_reduction_clauses): Use it.
280 2005-10-14  Richard Henderson  <rth@redhat.com>
282         * gimplify.c (enum gimplify_omp_var_data): New.
283         (struct gimplify_omp_ctx, gimplify_omp_ctxp): New.
284         (splay_tree_compare_decl_uid): New.
285         (new_omp_context, delete_omp_context): New.
286         (gimple_add_tmp_var): Call omp_add_variable.
287         (gimplify_bind_expr): Likewise.
288         (omp_firstprivatize_variable, omp_firstprivatize_type_sizes): New.
289         (omp_add_variable, omp_notice_variable, omp_is_private): New.
290         (gimplify_deconstruct_omp_clauses): New.
291         (gimplify_reconstruct_omp_clauses_1): New.
292         (gimplify_reconstruct_omp_clauses): New.
293         (gimplify_omp_parallel): Use them.
294         (gimplify_omp_for): Likewise.
295         (gimplify_omp_sections, gimplify_omp_single): New.
296         (gimplify_expr): Call omp_notice_variable.
297         * omp-low.c (is_variable_sized, is_reference): New.
298         (omp_copy_decl_2): Don't set DECL_ABSTRACT_ORIGIN.
299         (build_outer_var_ref): Handle variable sized and reference types here.
300         (install_var_private): Use is_reference.
301         (omp_copy_decl): Don't handle defaults.  Return error_mark_node for
302         any decl not remapped.
303         (scan_sharing_clauses): Handle variable sized types.
304         (create_omp_child_function): Set DECL_ARTIFICIAL on the argument.
305         (build_modify_expr): New.
306         (expand_rec_input_clauses): Handle variable sized types.
307         (expand_lastprivate_clauses): Use build_modify_expr.
308         (expand_reduction_clauses): Don't explicitly handle references.
309         (expand_copyprivate_clauses): Use is_reference.
310         (expand_send_clauses): Handle variable sized types.
311         (build_parallel_call): Use EQ_EXPR instead of invert_truthvalue.
312         (expand_omp_1): Do nothing for omp forms if no context.
313         * tree-inline.c (remap_decl): Early exit if copy produces a
314         non-decl.
315         * tree-nested.c (walk_body): Split out of walk_function.
316         (convert_nonlocal_omp_clauses, convert_local_omp_clauses): New.
317         (convert_nonlocal_reference): Handle omp statements.
318         (convert_local_reference): Likewise.
319         (unnest_nesting_tree_1): Split out of finalize_nesting_tree_1.
320         (unnest_nesting_tree): New.
321         (lower_nested_functions): Call it.
322         * tree-pretty-print.c (dump_omp_clauses): Don't use dump_decl_name
323         directly.
325 2005-10-12  Richard Henderson  <rth@redhat.com>
327         * c-omp.c (c_finish_omp_critical): Return statement.
328         (c_finish_omp_for): Accept explicit incoming locus.  Be careful
329         with expressions with no locus.
330         * c-common.h: Update.
331         * c-parser.c (c_parser_omp_for_loop): Pass for locus to
332         c_finish_omp_for.  Don't build a compound statement here.
333         * c-omp (fopenmp): Accept for C++ and ObjC/++.
335 2005-10-12  Jakub Jelinek  <jakub@redhat.com>
337         * omp-low.c (expand_omp_for_1): Default to chunk size 1 unless
338         static or runtime schedule.
340         * omp-low.c (omp_copy_decl_2): New function.
341         (omp_copy_decl_1): Use it.
342         (install_var_private): Handle REFERENCE_TYPE private variables.
343         (build_reduction_init): Add type argument.
344         (expand_rec_input_clauses): Expand initializers of context block
345         variables.  Handle REFERENCE_TYPE variables.  Adjust
346         build_reduction_init caller.
347         (expand_reduction_clauses, expand_copyprivate_clauses,
348         expand_send_clauses): Handle REFERENCE_TYPE variables.
350 2005-10-11  Jakub Jelinek  <jakub@redhat.com>
352         * omp-low.c (expand_rec_input_clauses): Fix a typo.
354         * omp-low.c (expand_reduction_clauses): If there is just
355         one reduction clause, expand it as OMP_ATOMIC instead of
356         using a lock.  Use GOMP_atomic_{start,end} instead of
357         GOMP_critical_{start,end}.
359         * tree-pretty-print.c (dump_omp_clauses): Handle OMP_CLAUSE_DEFAULT.
360         (op_symbol_1): Handle MAX_EXPR and MIN_EXPR.
362 2005-10-11  Richard Henderson  <rth@redhat.com>
364         * c-pragma.h (enum pragma_kind): Add PRAGMA_GCC_PCH_PREPROCESS.
365         * c-pragma.c (c_register_pragma_1): Assert id in range of the
366         field used by the c++ front end.
367         (init_pragma): Register GCC pch_preprocess as an internal pragma.
368         * c-pch.c (c_common_pch_pragma): Take name argument.  Don't do the
369         actual lexing of this pragma here.
370         * c-common.h (c_common_pch_pragma): Update.
371         * c-parser.c (c_parser_pragma): Handle PRAGMA_GCC_PCH_PREPROCESS.
372         (c_parser_pragma_pch_preprocess): New.
373         (c_parse_file): Call it.
375 2005-10-11  Richard Henderson  <rth@redhat.com>
377         * c-common.c (enum c_builtin_type): Move to top-level from
378         c_common_nodes_and_builtins enum builtin_type.
379         (builtin_types): Move from c_common_nodes_and_builtins.
380         (def_fn_type): New.
381         (c_common_nodes_and_builtins): Use it.
382         (def_builtin_1): Check for error_mark_node.
384 2005-10-10  Richard Henderson  <rth@redhat.com>
386         * omp-low.c (install_var_field): Set DECL_ABSTRACT_ORIGIN.
387         (delete_omp_context): Clear it again.
388         (expand_send_shared_vars_1): Merge into ...
389         (expand_send_shared_vars): ... here.  Iterate over the record
390         fields, instead of over the splay tree.
392 2005-10-10  Jakub Jelinek  <jakub@redhat.com>
394         * config/i386/i386.h (x86_cmpxchg8b, x86_cmpxchg16b): New decls.
395         (TARGET_CMPXCHG8B, TARGET_CMPXCHG16B): Define.
396         * config/i386/i386.c (x86_cmpxchg8b, x86_cmpxchg16b): New variables.
397         * config/i386/sync.md (CASMODE, DCASMODE): New mode macros.
398         (doublemodesuffix, DCASHMODE): New mode attrs.
399         (sync_compare_and_swap<mode>): Change into expand, use CASMODE
400         instead of IMODE, if mode is wider than a word, expand into
401         sync_double_compare_and_swap*.
402         (*sync_compare_and_swap<mode>): New insn.
403         (sync_double_compare_and_swap<mode>): Likewise.
404         (*sync_double_compare_and_swapdi_pic): Likewise.
405         (sync_compare_and_swap_cc<mode>): Use CASMODE instead of IMODE, if
406         mode is wider than a word, expand into
407         sync_double_compare_and_swap_cc*.
408         (sync_double_compare_and_swap_cc<mode>): New insn.
409         (*sync_double_compare_and_swap_ccdi_pic): Likewise.
410         * sync-builtins.def (BUILT_IN_FETCH_AND_ADD_16,
411         BUILT_IN_FETCH_AND_SUB_16, BUILT_IN_FETCH_AND_OR_16,
412         BUILT_IN_FETCH_AND_AND_16, BUILT_IN_FETCH_AND_XOR_16,
413         BUILT_IN_FETCH_AND_NAND_16, BUILT_IN_ADD_AND_FETCH_16,
414         BUILT_IN_SUB_AND_FETCH_16, BUILT_IN_OR_AND_FETCH_16,
415         BUILT_IN_AND_AND_FETCH_16, BUILT_IN_XOR_AND_FETCH_16,
416         BUILT_IN_NAND_AND_FETCH_16, BUILT_IN_BOOL_COMPARE_AND_SWAP_16,
417         BUILT_IN_VAL_COMPARE_AND_SWAP_16, BUILT_IN_LOCK_TEST_AND_SET_16,
418         BUILT_IN_LOCK_RELEASE_16): New builtins.
419         * builtin-types.def (BT_I16, BT_FN_I16_VPTR_I16,
420         BT_FN_BOOL_VPTR_I16_I16, BT_FN_I16_VPTR_I16_I16): Add.
421         * builtins.c (get_builtin_sync_mode): Use 0 as last argument to
422         mode_for_size.
423         (expand_builtin): Handle sync BUILT_IN_*_16 builtins.
424         * c-common.c (sync_resolve_size): Handle also 128 bit sync builtins.
425         * gimplify.c (gimplify_omp_atomic): Also support 128 bit atomic.
426         Only use __sync_* builtins if memory is sufficiently aligned.
428 2005-10-10  Richard Henderson  <rth@redhat.com>
430         * Makefile.in (GTFILES): Add c-pragma.h.
431         * c-lex.c (pragma_lex): Remove.
432         * c-parser.c (enum pragma_omp_kind): Move to c-pragma.h.
433         (c_parse_init): Move omp pragma registration to init_pragma.
434         (struct c_token): Rename omp_kind to pragma_kind.
435         (the_parser): Move earlier in the file.
436         (c_token_starts_declspecs): False for all pragmas.
437         (c_parser_declaration_or_fndef): Don't allow PRAGMA_OMP_THREADPRIVATE.
438         (enum pragma_context, c_parser_pragma): New.
439         (c_parser_external_declaration): Use it.
440         (c_parser_compound_statement_nostart): Likewise.
441         (c_parser_statement_after_labels): Likewise.
442         (pragma_lex): New.
443         (c_parser_omp_construct): Don't handle BARRIER or FLUSH here.
444         (c_parser_new): Merge into ...
445         (c_parse_file): ... here.  Use c_parser_pragma.
446         * c-pragma.c (registered_pragmas, c_register_pragma_1): New.
447         (c_register_pragma, c_register_pragma_with_expansion): Use it.
448         (c_invoke_pragma_handler): New.
449         (init_pragma): Do omp pragma registration here.
450         * c-pragma.h (enum pragma_kind): Move from c-parser.c.
451         (pragma_handler): New.
452         (c_invoke_pragma_handler): Declare.
454 2005-10-10  Richard Henderson  <rth@redhat.com>
456         * gimplify.c (gimplify_omp_for): Don't pass the entire OMP_FOR_INCR
457         through gimplify_expr, but do normalize autoinc.
459 2005-10-10  Richard Henderson  <rth@redhat.com>
461         * omp-low.c (scan_sharing_clauses): Scan the outer context for
462         copyprivate, if, num_threads, and schedule.
464 2005-10-09  Richard Henderson  <rth@redhat.com>
466         * c-lex.c (pragma_lex): Rename from c_lex.
467         * c-pch.c, c-pragma.c, c-pragma.h, config/darwin-c.c, config/sol2-c.c,
468         config/c4x/c4x-c.c, config/ia64/ia64-c.c, config/m32c/m32c-pragma.c,
469         config/rs6000/rs6000-c.c, config/v850/v850-c.c: Update to match.
471 2005-10-09  Richard Henderson  <rth@redhat.com>
473         * omp-low.c (omp_copy_decl): Use %qs instead of %qE.
475 2005-10-09  Richard Henderson  <rth@redhat.com>
477         * c-parser.c (c_parser_omp_clause_copyin): Verify that the 
478         variables are in fact threadprivate.
480 2005-10-09  Richard Henderson  <rth@redhat.com>
482         * Makefile.in (gimplify.o): Add OPTABS_H.
483         * gimplify.c: Include optabs.h.
484         (gimplify_omp_atomic_fetch_op): Fail if the atomic operation
485         isn't supported on the target.
486         (gimplify_omp_atomic_pipeline): Likewise.
487         (gimplify_omp_atomic_mutex): New.
488         (gimplify_omp_atomic): Use it when all else fails.
489         * omp-builtins.def (BUILT_IN_GOMP_ATOMIC_START): New.
490         (BUILT_IN_GOMP_ATOMIC_END): New.
492 2005-10-09  Richard Henderson  <rth@redhat.com>
494         * omp-low.c (scan_sharing_clauses): Force a remapping to ocurr in
495         the context outer to a non-parallel firstprivate, lastprivate or
496         reduction clause.
497         (build_outer_var_ref): New.
498         (expand_rec_input_clauses): Use it.
499         (expand_lastprivate_clauses): Likewise.
500         (expand_reduction_clauses): Likewise.
502 2005-10-08  Richard Henderson  <rth@redhat.com>
504         * omp-low.c: Rewrite from scratch.
505         * c-common.h (c_finish_omp_bindings): Remove.
506         * c-decl.c (struct c_scope, push_scope, pop_scope,
507         define_label, lookup_name): Revert all changes.
508         (current_omp_parallel_scope, omp_remap_private): Remove.
509         (c_omp_sharing_implicitly_determined): Remove.
510         (c_omp_sharing_predetermined): Remove.
511         (c_omp_remap_decl_1, c_omp_remap_decl): Remove.
512         (maybe_remap_for_omp_parallel): Remove.
513         (lookup_name_no_remap, c_omp_remap_private): Remove.
514         (c_begin_omp_parallel, c_finish_omp_parallel): Remove.
515         * c-omp.c (relookup_decls): Remove.
516         (c_split_parallel_clauses): Don't call it.  Handle DEFAULT.
517         (c_finish_omp_bindings): Remove.
518         * c-parser.c (c_lex_one_token): Revert use of lookup_name_no_remap.
519         (c_parser_declspecs): Likewise.
520         (c_parser_skip_to_pragma_eol): Consume CPP_PRAGMA_EOL properly.
521         (c_parser_omp_clause_default): Emit OMP_CLAUSE_DEFAULT.
522         (c_parser_omp_all_clauses): Don't pass default by enum.
523         (c_parser_omp_for_loop): Don't call c_omp_remap_private.
524         (OMP_FOR_CLAUSE_MASK, OMP_SECTIONS_CLAUSE_MASK): New.
525         (OMP_PARALLEL_CLAUSE_MASK, OMP_SINGLE_CLAUSE_MASK): New.
526         (c_parser_omp_for): Don't use c_finish_omp_bindings.
527         (c_parser_omp_sections): Likewise.
528         (c_parser_omp_parallel): Likewise.
529         * c-tree.h (lookup_name_no_remap, c_omp_remap_private): Remove
530         (c_begin_omp_parallel, c_finish_omp_parallel): Update.
531         * c-typeck.c (c_begin_omp_parallel, c_finish_omp_parallel): New.
532         * cgraphunit.c (cgraph_finalize_pending_functions): Don't
533         gimplify the function.
534         * gimplify.c (struct gimplify_ctx): Add prev_context.  Remove
535         omp_for_istart, omp_for_iend.
536         (push_gimplify_context, pop_gimplify_context): Allow nesting.
537         (gimplify_omp_reduction, gimplify_omp_for_lastprivate,
538         gimplify_omp_for_generic, gimplify_omp_for_static_nochunk,
539         gimplify_omp_for_static_chunk, gimplify_omp_sections,
540         gimplify_omp_section, gimplify_omp_single_simple,
541         gimplify_omp_single_copy, gimplify_omp_single): Remove.
542         (gimplify_omp_parallel): New.
543         (gimplify_omp_for): Only gimplify the body and verify the form.
544         (gimplify_expr): Use gimplify_omp_parallel.  Pass the bodies of
545         OMP_SECTIONS, OMP_SECTION, OMP_SINGLE, through gimplify_to_stmt_list.
546         (gimplify_body): Verify gimplify_ctxp is empty after gimplification.
547         * tree-gimple.c (is_gimple_stmt): Add OMP_SECTIONS, OMP_SECTION, 
548         and OMP_SINGLE.
549         * tree-gimple.h (use_pointer_for_field): Remove.
550         (struct walk_stmt_info): Add want_bind_expr, want_locations.
551         * tree-nested.c (walk_stmts): Honor them.
552         * tree-inline.c (remap_decl, remap_type): Export.
553         * tree-inline.h (remap_decl, remap_type): Declare.
554         * tree-pretty-print.c (dump_omp_clauses): Don't dump
555         OMP_CLAUSE_INNER_DECL.
556         * tree.def (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS): Remove INIT, LAST,
557         REDUC operands.
558         (OMP_CLAUSE_PRIVATE, OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE,
559         OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION, OMP_CLAUSE_COPYIN,
560         OMP_CLAUSE_COPYPRIVATE): Remove INNER operand.
561         (OMP_CLAUSE_DEFAULT): New.
562          * tree.h (OMP_PARALLEL_VAR_INIT, OMP_PARALLEL_VAR_REDUC,
563         OMP_FOR_VAR_INIT, OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC,
564         OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST,
565         OMP_SECTIONS_VAR_REDUC): Remove.
566         (OMP_CLAUSE_DECL): Rename from OMP_CLAUSE_OUTER_DECL. 
567         (OMP_CLAUSE_INNER_DECL): Remove.
568         (OMP_CLAUSE_DEFAULT_KIND): New.
570 2005-10-08  Diego Novillo  <dnovillo@redhat.com>
572         Mainline merge (gomp-merge-20051008).
574 2005-10-07  Diego Novillo  <dnovillo@redhat.com>
576         Mainline merge (gomp-merge-20051006).
578 2005-10-06  Richard Henderson  <rth@redhat.com>
580         * Makefile.in (TREE_INLINE_H): New.  Use it throughout.
581         * tree-inline.c (struct copy_body_data): Move to tree-inline.h.
582         (insert_decl_map): Export.
583         (remap_decl): Use copy_body_data.copy_decl method.  Remove if 0 code.
584         Remove duplicate insert_decl_map.
585         (copy_body_r): Export.
586         (setup_one_parameter): Use copy_decl_to_var.
587         (declare_return_variable): Likewise.
588         (expand_call_inline): Fix some src/dst confusion.  Set src_node
589         before initialize_inlined_parameters.  Don't bother saving and
590         restoring src_node around copy_body.
591         (mark_local_for_remap_r): Use copy_body_data.copy_decl method.
592         (optimize_inline_calls): Set id.copy_decl.
593         (clone_body, save_body, unsave_expr_now): Likewise.
594         (tree_function_versioning): Likewise.
595         (copy_decl_for_dup_finish): Split out of copy_decl_for_dup.
596         (copy_decl_to_var, copy_decl_no_change): Likewise.
597         (copy_decl_maybe_to_var): Likewise.
598         * tree-inline.h: Include splay-tree.h.
599         (struct copy_body_data): Move from tree-inline.c.  Add copy_decl.
600         (copy_body_r, insert_decl_map): Declare.
601         (copy_decl_for_dup): Remove.
603 2005-10-06  Richard Henderson  <rth@redhat.com>
605         * c-parser.c (c_lex_one_token): Fix CPP_AT_NAME translation
606         to CPP_KEYWORD.
608 2005-10-01  Richard Henderson  <rth@redhat.com>
610         * tree-inline.c (struct copy_body_data): Rename from inline_data.
611         Rename callee->src, caller->dst.  Remove ipa_info.  Replace
612         cloning_p, saving_p, versioning_p with transform_parm_to_var,
613         transform_call_graph_edges, transform_new_cfg,
614         transform_return_to_modify, transform_lang_insert_block.  Update
615         all users.
616         (replace_ref_tree, inlining_p): Remove.
618 2005-09-29  Richard Henderson  <rth@redhat.com>
620         * omp-low.c (use_pointer_for_field): True for shared variables
621         with DECL_HAS_VALUE_EXPR_P set.
623 2005-09-29  Richard Henderson  <rth@redhat.com>
625         * c-decl.c (struct c_scope): Add location.
626         (define_label): Use lookup_name_no_remap.
627         (c_omp_remap_decl_1): Add pscope argument.  Use it instead of
628         current_omp_parallel_scope.
629         (c_omp_remap_decl): Pass it current_omp_parallel_scope.
630         (maybe_remap_for_omp_parallel): New.
631         (lookup_name): Use it.
632         (c_begin_omp_parallel): Initialize location field.
634 2005-09-29  Dmitry Kurochkin <dmitry.kurochkin@gmail.com>
635             Richard Henderson  <rth@redhat.com>
637         * c-common.c (c_parse_error): Handle CPP_PRAGMA and CPP_PRAGMA_EOL.
638         * c-common.h (c_begin_omp_parallel, c_finish_omp_parallel): Move ...
639         * c-tree.h: ... here.
640         * c-decl.c (c_finish_omp_parallel): Return the statement created.
641         * c-lex.c (c_lex_with_flags): Smuggle pragma identifier in a tree.
642         * c-parser.c (c_parse_init): Use cpp_register_deferred_pragma.
643         (struct c_token): Remove one bit from omp_kind.
644         (struct c_parser): Add in_pragma.
645         (c_handle_deferred_pragma): Remove.
646         (c_lex_omp_pragma): Remove.
647         (c_lex_one_token): Remove pragma restart hack.  Tidy initialization.
648         Undo pragma identifier smuggling.
649         (c_parser_peek_2nd_token): Don't look past CPP_PRAGMA_EOL.
650         (c_parser_consume_token): Don't allow CPP_PRAGMA unless in error
651         recovery; don't allow CPP_PRAGMA_EOL unless we've escaped in_pragma.
652         (c_parser_consume_pragma): New.
653         (c_parser_skip_until_found): Don't skip CPP_PRAGMA_EOL when in_pragma.
654         (c_parser_skip_to_end_of_parameter): Likewise.
655         (c_parser_skip_to_end_of_block_or_statement): Likewise.
656         (c_parser_skip_to_pragma_eol): New.
657         (curr_clause_set, curr_clause_default): Remove.
658         (c_parser_pragma): Remove.
659         (c_parser_declaration_or_fndef): Update threadprivate test.
660         (c_parser_compound_statement_nostart): Test for EOF last.
661         Update omp parsing calls.
662         (c_parser_omp_clause_name): Rename from c_parser_pragma_omp_clause.
663         (add_new_clause): Remove.
664         (check_no_duplicate_clause): Pass in clause list.
665         (c_parser_omp_variable_list): Rename from
666         c_parser_pragma_omp_variable_list.  Pass in list tail, always
667         return the list head.
668         (c_parser_omp_var_list_parens, c_parser_omp_clause_copyin,
669         c_parser_omp_clause_copyprivate, c_parser_omp_clause_default,
670         c_parser_omp_clause_firstprivate, c_parser_omp_clause_if,
671         c_parser_omp_clause_lastprivate, c_parser_omp_clause_nowait,
672         c_parser_omp_clause_num_threads, c_parser_omp_clause_ordered,
673         c_parser_omp_clause_private, c_parser_omp_clause_reduction,
674         c_parser_omp_clause_schedule, c_parser_omp_clause_shared): Similarly.
675         (c_parser_pragma_omp_no_args): Remove.
676         (c_parser_omp_all_clauses): New.
677         (c_parser_omp_structured_block): New.
678         (c_parser_omp_atomic): Rename from c_parser_omp_atomic_expression;
679         use c_parser_skip_to_pragma_eol.
680         (c_parser_omp_barrier): New.
681         (c_parser_omp_critical): New.
682         (c_parser_omp_flush): Rename from c_parser_pragma_omp_flush;
683         call c_finish_omp_flush here.
684         (c_parser_omp_for_loop): Rename from c_parser_omp_for_statement.
685         (c_parser_omp_for): New.
686         (c_parser_omp_master): New.
687         (c_parser_omp_ordered): New.
688         (c_parser_omp_sections_scope): Rename from c_parser_omp_sections_body.
689         (c_parser_omp_sections): New.
690         (c_parser_omp_parallel): New.
691         (c_parser_omp_single): New.
692         (c_parser_omp_construct): Rename from c_parser_omp_directive; split
693         out all the code into new functions; don't use c_parser_pragma.
694         (c_parser_omp_threadprivate): Rename from
695         c_parser_pragma_omp_threadprivate; update for pragma parsing changes.
696         * c-pragma.c (handle_pragma_weak): Add quotes to warning message.
697         (handle_pragma_redefine_extname): Likewise.
698         (handle_pragma_extern_prefix): Likewise.
700 2005-09-28  Jakub Jelinek  <jakub@redhat.com>
702         * tree.def (OMP_SINGLE): Fix a comment typo.
703         * gimplify.c (gimplify_omp_atomic_pipeline): Fix type of
704         pointer argument to BUILT_IN_VAL_COMPARE_AND_SWAP_x.
705         * omp-low.c (setup_data_fields): Remove unused variable.
707 2005-09-28  Richard Henderson  <rth@redhat.com>
709         * c-decl.c (c_omp_remap_decl_1): Create OMP_CLAUSE_SHARED node here.
710         (c_finish_omp_parallel): And not here.  Chain them in.
711         * c-omp.c (c_split_parallel_clauses): Rewrite to chain directly
712         through the clause nodes.
713         (c_finish_omp_bindings): Similarly.
714         * c-common.h (c_finish_omp_bindings): Update.
715         * c-parser.c (add_new_clause): Chain directly through the clauses.
716         (check_no_duplicate_clause): New.
717         (c_parser_pragma_omp_variable_list): Take a tree_code and create
718         clause nodes directly.
719         (c_parser_pragma_omp_variable_list_parens): New.
720         (c_parser_pragma_omp_clause_copyin): Use it.
721         (c_parser_pragma_omp_clause_copyprivate): Likewise.
722         (c_parser_pragma_omp_clause_firstprivate): Likewise.
723         (c_parser_pragma_omp_clause_lastprivate): Likewise.
724         (c_parser_pragma_omp_clause_private): Likewise.
725         (c_parser_pragma_omp_clause_shared): Likewise.
726         (c_parser_pragma_omp_clause_if): Use check_no_duplicate_clause.
727         (c_parser_pragma_omp_clause_nowait): Likewise.
728         (c_parser_pragma_omp_clause_num_threads): Likewise.
729         (c_parser_pragma_omp_clause_ordered): Likewise.
730         (c_parser_pragma_omp_clause_schedule): Likewise.
731         (c_parser_pragma_omp_clause_reduction): Update for chaining directly
732         through clauses; tidy error message.
733         * gimplify.c (gimplify_omp_for): Update for chaining directly
734         through clauses.  Use find_omp_clause.
735         (gimplify_omp_single_simple): Split out of gimplify_omp_single.
736         (gimplify_omp_single_copy): Likewise.  Update for chaining
737         directly through clauses.  Create BLOCK for stack variable.
738         * omp-low.c (find_omp_clause): New.
739         (compute_num_threads): Use it.
740         (setup_data_fields): Update for chaining directly through clauses.
741         (setup_decl_value_expr_child): Likewise.
742         * tree-gimple.h (find_omp_clause): Declare.
743         * tree-pretty-print.c (op_symbol_1): Split out of op_symbol.
744         (dump_omp_clauses): New.
745         (dump_generic_node): Don't handle clause nodes here.  Update
746         omp statements to use dump_omp_clauses.
747         * tree.def (OMP_CLAUSE_PRIVATE): Use 2 operands.
748         (OMP_CLAUSE_SHARED, OMP_CLAUSE_FIRSTPRIVATE): Likewise.
749         (OMP_CLAUSE_LASTPRIVATE, OMP_CLAUSE_REDUCTION): Likewise.
750         (OMP_CLAUSE_COPYIN, OMP_CLAUSE_COPYPRIVATE): Likewise.
751         * tree.h (OMP_PRIVATE_VARS, OMP_SHARED_VARS, OMP_FIRSTPRIVATE_VARS,
752         OMP_LASTPRIVATE_VARS, OMP_COPYIN_VARS, OMP_COPYPRIVATE_VARS): Remove.
753         (OMP_CLAUSE_CHAIN, OMP_CLAUSE_OUTER_DECL, OMP_CLAUSE_INNER_DECL): New.
754         (OMP_CLAUSE_NUM_THREADS_EXPR): Rename from OMP_NUM_THREADS_EXPR.
755         (OMP_CLAUSE_IF_EXPR): Rename from OMP_IF_EXPR.
756         (OMP_CLAUSE_SCHEDULE_CHUNK_EXPR): Rename from
757         OMP_CLAUSE_SCHEDULE_CHUNK_SIZE.
759 2005-09-28  Diego Novillo  <dnovillo@redhat.com>
761         * gimplify.c (gimplify_omp_single): Handle by emitting calls
762         to GOMP_single_* and GOMP_barrier.
763         * omp-low.c (use_pointer_for_field): Make extern.
764         * tree-gimple.h (use_pointer_for_field): Declare.
766 2005-09-27  Richard Henderson  <rth@redhat.com>
768         * c-parser.c: Include rtl.h.
769         (c_parser_pragma_omp_threadprivate): Update for TREE_PURPOSE change.
770         Diagnose threadprivate after first use.
771         * Makefile.in (c-parser.o): Add RTL_H.
773 2005-09-27  Richard Henderson  <rth@redhat.com>
775         * c-decl.c (lookup_name): Honor omp_remap_private.
777 2005-09-27  Richard Henderson  <rth@redhat.com>
779         * c-omp.c (c_split_parallel_clauses): Add lastprivate to parallel.
780         (c_finish_omp_bindings): Check for firstprivate+lastprivate and
781         do not create two decls.
782         * gimplify.c (gimplify_omp_reduction): New.
783         (gimplify_omp_for_lastprivate): New.
784         (gimplify_omp_for_generic): Use it.
785         (gimplify_omp_for_static_nochunk): Likewise.
786         (gimplify_omp_for_static_chunk): Likewise.
787         (gimplify_omp_for): Emit VAR_INIT and VAR_REDUC.
788         (gimplify_omp_sections): Likewise.
789         * omp-low.c (add_omp_data_field): Don't create duplicate fields.
790         (get_lastprivate_sequence): New.
791         (lower_omp_parallel): Use it.
793 2005-09-27  Richard Henderson  <rth@redhat.com>
795         * c-tree.h (check_for_loop_decls): Update decl.
796         (lookup_name_no_remap, c_omp_remap_private): Declare.
797         (lookup_name): Move decl ...
798         * c-common.h (lookup_name): ... here.
799         (c_begin_omp_parallel, c_finish_omp_parallel): Declare.
800         (c_omp_sharing_predetermined, c_omp_remap_decl): Declare.
801         * c-decl.c (struct c_scope): Add outer_omp_parallel, omp_shared,
802         omp_parallel_body, omp_default_none.
803         (current_omp_parallel_scope, omp_remap_private): New.
804         (push_scope): Clear current_omp_parallel_scope on nested function.
805         (pop_scope): Restore current_omp_parallel_scope.
806         (c_omp_sharing_implicitly_determined): New.
807         (c_omp_sharing_predetermined): New.
808         (c_omp_remap_decl_1, c_omp_remap_decl): New.
809         (lookup_name_no_remap): Rename from lookup_name.
810         (lookup_name): New.
811         (check_for_loop_decls): Return a singular decl found.
812         (c_begin_omp_parallel, c_finish_omp_parallel): New.
813         (c_omp_remap_private): New.
814         * c-omp.c (relookup_decls): New.
815         (c_split_parallel_clauses): Use it.
816         (c_finish_omp_for): Take decl as argument.  Simplify the rest
817         of the checks based on that.  Don't take clauses or process them.
818         (c_finish_omp_bindings): New.
819         * c-parser.c (c_lex_one_token): Use lookup_name_no_remap.
820         (c_parser_declspecs): Likewise.
821         (curr_clause_default): New.
822         (c_parser_for_statement): Revert all changes since mainline.
823         (c_parser_omp_for_statement): New.
824         (c_parser_omp_sections_body): Return the stmt created.
825         (c_parser_omp_directive): Use c_begin_omp_parallel, 
826         c_finish_omp_bindings, c_finish_omp_parallel as necessary.
827         (c_parser_pragma_omp_variable_list): Put parsed expression in
828         the TREE_PURPOSE of the list.
829         (c_parser_pragma_omp_clause_default): Implement.
830         (c_parser_pragma_omp_clause_if): Standardize error text.
831         (c_parser_pragma_omp_clause_nowait): Likewise.
832         (c_parser_pragma_omp_clause_num_threads): Likewise.
833         (c_parser_pragma_omp_clause_ordered): Likewise.
834         (c_parser_pragma_omp_clause_shared): Likewise.  Don't mark
835         variables addressable here.
836         (c_parser_pragma_omp_clause_reduction): Implement.
837         * cgraphunit.c (cgraph_finalize_pending_functions): Gimplify here.
838         * gimple-low.c (lower_stmt_again): New.
839         (lower_stmt): Allow OMP_PARALLEL.
840         * omp-low.c (struct remap_info_d): Remove local_map, omp_fn_list,
841         omp_data_map, ptr_to_omp_data; add copyin, copyout, omp_data_receive;
842         rename omp_data to omp_data_send, remove indirection on tsi.
843         (new_remap_info, delete_remap_info): Update to match.
844         (create_tmp_var_in): Remove.
845         (get_omp_data_field_for, get_omp_private_repl,
846         get_omp_shared_repl, emit_firstprivate_sending_code
847         emit_firstprivate_receiving_code, get_omp_firstprivate_repl,
848         emit_lastprivate_receiving_code, emit_lastprivate_sending_code,
849         get_omp_lastprivate_repl, get_omp_copyin_repl,
850         get_omp_sharing_replacements, remap_locals_in_child_r,
851         create_gomp_parallel_start, create_gomp_parallel_end,
852         convert_to_gimple_val, remap_locals_in_parent_r,
853         lower_omp_parallel_r): Remove.
854         (use_pointer_for_field, create_data_decl, recontext_vars_in_block,
855         split_out_parallel_function, emit_sender_copyin_1, emit_sender_copyin,
856         emit_sender_copyout_1, emit_sender_copyout, emit_parallel_start_end,
857         emit_omp_parallel_parent, setup_decl_value_expr_child,
858         remap_variables_receiver, remap_labels_child_1,
859         remap_labels_child): New.
860         (setup_data_fields): Rename from process_omp_clauses.
861         (create_child_function): Rename from create_omp_fn.
862         (compute_num_threads): Rename from emit_num_threads_setup_code.
863         Don't gimplify here.
864         (lower_omp_parallel): Rewrite.
865         (lower_omp_1): New.
866         (lower_omp): Use it.
867         * tree.def (OMP_PARALLEL): Add var_init and var_reduc operands.
868         (OMP_FOR): Add var_init, var_last, var_reduc operands.
869         (OMP_SECTIONS): Likewise.
870         (OMP_CLAUSE_REDUCTION): Remove second operand.
871         * tree.h (OMP_PARALLEL_VAR_INIT, OMP_PARALLEL_VAR_REDUC,
872         OMP_FOR_VAR_INIT, OMP_FOR_VAR_LAST, OMP_FOR_VAR_REDUC,
873         OMP_SECTIONS_VAR_INIT, OMP_SECTIONS_VAR_LAST, OMP_SECTIONS_VAR_REDUC,
874         OMP_CLAUSE_REDUCTION_CODE): New.
875         (enum omp_clause_default_kind): New.
877 2005-09-27  Diego Novillo  <dnovillo@redhat.com>
879         * omp-low.c (lower_omp_parallel): Initialize wi.tsi.
881 2005-09-27  Diego Novillo  <dnovillo@redhat.com>
883         * omp-low.c (emit_firstprivate_receiving_code): Handle cases
884         where RI_P->OMP_FN consists of a single statement.
886 2005-09-27  Diego Novillo  <dnovillo@redhat.com>
888         * c-parser.c (c_parser_omp_directive): Handle OMP_SINGLE
889         * gcc/gimplify.c (gimplify_omp_single): New.
890         (gimplify_expr): Call it.
891         * tree-pretty-print.c (dump_generic_node): Handle OMP_SINGLE.
892         * tree.def (OMP_SINGLE): Add second operand.
893         * tree.h (OMP_SINGLE_CLAUSES): Define.
894         (OMP_SINGLE_BODY): Define.
896 2005-09-27  Diego Novillo  <dnovillo@redhat.com>
898         * omp-low.c (struct remap_info_d): Rename field 'map' to
899         'local_map'.  Update all users.
900         Remove field 'clauses'.
901         Add fields 'omp_data_map' and 'omp_fn_list'.
902         Update all users.
903         (add_omp_data_field): If VAR was already associated with a
904         field, do nothing.
905         (get_omp_private_repl): Do not set DECL_VALUE_EXPR.  Add a
906         mapping between VAR and its replacement in RI_P->LOCAL_MAP.
907         (get_omp_shared_repl): Likewise.
908         (build_remap_info): Remove all arguments.  Update users.
909         Initialize RI_P->OMP_DATA_MAP and RI_P->LOCAL_MAP.
910         (remap_locals_in_child_r): Do private and shared replacements.
911         (remap_locals_in_child): Remove.  Update all users.
912         (emit_num_threads_setup_code): Remove argument 'clauses'.
913         Update all users.
914         (lower_omp_parallel): Add argument RI_P.
915         Call process_omp_clauses.
916         Do not call gimplify_function_tree.  Add the function to
917         RI_P->OMP_FN_LIST.
918         Delete RI_P->LOCAL_MAP after the remapping all the locals in
919         RI_P->OMP_FN.
920         Do not call delete_remap_info.
921         (lower_omp_in_body): Remove.
922         (lower_omp_parallel_r): New.
923         (lower_omp_parallel): Re-organize to support multiple omp
924         parallel directives.  First lower all directives separately,
925         then remap shared locals in the parent, then layout the
926         structure used for shared data and then gimplify all the
927         functions created by the lowering.
929 2005-09-26  Diego Novillo  <dnovillo@redhat.com>
931         * omp-low.c (pass_lower_omp): Don't claim to destroy
932         PROP_gimple_any.
934 2005-09-26  Diego Novillo  <dnovillo@redhat.com>
936         * Makefile.in (omp-low.o): New.
937         (OBJS-common): Add it.
938         * omp-low.c: New file.
939         Move all the OpenMP lowering code from gimple-low.c.
940         (lower_omp): New.
941         (gate_lower_omp): New.
942         (pass_lower_omp): New.
943         * passes.c (init_optimization_passes): Schedule
944         pass_lower_omp.
945         * tree-pass.h (PROP_gimple_lomp): Define.
946         (pass_lower_omp): Declare.
948 2005-09-26  Jakub Jelinek  <jakub@redhat.com>
950         * varasm.c (assemble_variable): Handle thread-local COMMON data.
951         * defaults.h (ASM_OUTPUT_TLS_COMMON): Define.
953 2005-09-26  Diego Novillo  <dnovillo@redhat.com>
955         * Makefile.in (gimple-low.o): Depend on vec.h
956         * builtins.c (build_string_literal): Make extern.
957         (expand_builtin_copysign):
958         * c-parser.c (c_parser_pragma_omp_threadprivate): Mark
959         threadprivate variables with decl_default_tls_model.
960         * gimple-low.c: Include vec.h.
961         (struct remap_info_d): Remove fields data_arg_dest, private,
962         firstprivate, lastprivate, copyin and copyprivate.
963         Rename field data_arg_orig to omp_data.
964         Add fields tsi, ptr_to_omp_data and syms_with_value_expr.
965         Update all users.
966         (add_decls_to_set): Remove.
967         (get_omp_private_ref): Remove.
968         (get_omp_shared_ref): Remove.
969         (create_tmp_var_in): New.
970         (add_omp_data_field): New.
971         (get_omp_data_field_for): New.
972         (emit_firstprivate_sending_code): New.
973         (emit_firstprivate_receiving_code): New.
974         (get_omp_private_repl): New.
975         (get_omp_firstprivate_repl): New.
976         (get_omp_shared_repl): New.
977         (emit_lastprivate_receiving_code): New.
978         (emit_lastprivate_sending_code): New.
979         (get_omp_lastprivate_repl): New.
980         (get_omp_copyin_repl): New.
981         (get_omp_sharing_replacements): New.
982         (process_omp_clauses): Call it.
983         (remap_locals_in_child_r): Only replace private locals and call
984         process_omp_clauses for every worksharing construct found.
985         (remap_locals_in_child): Use walk_stmts to call
986         remap_locals_in_child_r.
987         (convert_to_gimple_val): New.
988         (remap_locals_in_parent_r): New.
989         (emit_num_threads_setup_code): Remove argument TSI.
990         (lower_omp_parallel): After remapping locals in child
991         function, clear out DECL_VALUE_EXPR from every processed
992         symbol.
993         Call walk_stmts with remap_locals_in_parent_r.
994         * tree-gimple.h (insert_field_into_struct): Declare.
995         (struct walk_stmt_info): Move from tree-nested.c
996         (walk_stmts): Declare.
997         * tree-nested.c (insert_field_into_struct): Make extern.
998         (struct walk_stmt_info): Move to tree-gimple.h.
999         (walk_stmts): Make extern.
1000         * tree.h (build_string_literal): Declare.
1002 2005-09-25  Richard Henderson  <rth@redhat.com>
1004         * gimplify.c (gimplify_omp_for_generic): Tidy commentary.
1005         (gimplify_omp_for_static_nochunk, gimplify_omp_for_static_chunk): New.
1006         (gimplify_omp_for): Use them.
1008 2005-09-25  Richard Henderson  <rth@redhat.com>
1010         * c-common.h (c_split_parallel_clauses): Declare.
1011         * c-omp.c (c_split_parallel_clauses): New.
1012         * c-parser.c (c_parser_omp_directive): Split PRAGMA_OMP_PARALLEL_FOR
1013         and PRAGMA_OMP_PARALLEL_SECTIONS into separate OMP_PARALLEL and
1014         work-sharing constructs.
1016         * tree.h (OMP_SECTION_BODY): New.
1017         * gimplify.c (gimplify_omp_section): Use it.
1018         * tree-pretty-print.c (dump_generic_node): Handle OMP_SECTIONS
1019         and OMP_SECTION.
1021 2005-09-25  Richard Henderson  <rth@redhat.com>
1023         * builtin-types.def (BT_FN_UINT_UINT): New.
1024         (BT_FN_VOID_UINT_UINT): Remove.
1025         * omp-builtins.def (BUILT_IN_GOMP_SECTIONS_START): Use BT_FN_UINT_UINT.
1027         * c-parser.c (c_parser_pragma_omp_section): Remove.
1028         (c_parse_init): Use c_parser_pragma_omp_no_args instead.
1029         (c_parser_section_scope): Remove.
1030         (c_parser_omp_sections_body): New.
1031         (c_parser_omp_directive): Use it.
1032         (c_parser_pragma_omp_parallel_for): Remove inline marker.
1033         (c_parser_pragma_omp_parallel_sections): Likewise.
1034         * gimplify.c (gimplify_omp_sections, gimplify_omp_section): New.
1035         (gimplify_expr): Use them.
1037 2005-09-25  Richard Henderson  <rth@redhat.com>
1039         * c-parser.c (c_parser_pragma_omp_clause_nowait): Check for
1040         duplicates.
1041         (c_parser_pragma_omp_clause_ordered): Implement.
1042         (c_parser_pragma_omp_clause_schedule): Implement.
1043         * tree.def (OMP_CLAUSE_ORDERED, OMP_CLAUSE_SCHEDULE): New.
1044         * gimplify.c (gimplify_omp_for): Handle them.
1045         * tree-pretty-print.c (dump_generic_node): Likewise.
1046         * tree.h (OMP_CLAUSE_SCHEDULE_CHUNK_SIZE): New.
1047         (enum omp_clause_schedule_kind, OMP_CLAUSE_SCHEDULE_KIND): New.
1049 2005-09-24  Richard Henderson  <rth@redhat.com>
1051         * c-parser.c (c_parser_for_statement): Don't emit the init expr
1052         when is_omp_for.
1053         * gimple-low.c (lower_function_body): Clear data.
1054         (emit_num_threads_setup_code): Fix num_threads logic when 
1055         if clause present and num_threads clause absent.
1056         (emit_omp_for_static, lower_omp_for): Remove.
1057         (lower_stmt): Don't call it.
1058         * gimplify.c (struct gimplify_ctx): Add omp_for_istart, omp_for_iend.
1059         (gimplify_omp_for_generic): New.
1060         (gimplify_omp_for): Extract all parameters, and expand the loop.
1061         * omp-builtins.def (BUILT_IN_OMP_GET_NUM_THREADS): New.
1063 2005-09-24  Richard Henderson  <rth@redhat.com>
1065         * Makefile.in (c-omp.o): Remove C_TREE_H.
1066         * c-tree.h (build_indirect_ref, build_modify_expr): Move ...
1067         * c-common.h: ... here.
1068         * c-omp.c: Don't include c-tree.h.
1069         (c_finish_omp_atomic): Create an OMP_ATOMIC node.
1070         * gimplify.c (goa_lhs_expr_p, gimplify_omp_atomic_fetch_op,
1071         goa_stabilize_expr, gimplify_omp_atomic_pipeline): New.
1072         (gimplify_omp_atomic): New.
1073         (gimplify_expr): Call it.
1074         * tree-pretty-print.c (dump_generic_node): Handle OMP_ATOMIC.
1075         * tree.def (OMP_ATOMIC): New.
1077 2005-09-24  Richard Henderson  <rth@redhat.com>
1079         * c-parser.c (c_parser_pragma_omp_clause): Tidy.
1080         (c_parser_pragma_omp_clause_num_threads): Warn for not positive.
1081         * gimple-low.c (emit_num_threads_setup_code): Fix type problems
1082         with num_threads computation.
1084 2005-09-24  Jakub Jelinek  <jakub@redhat.com>
1086         * builtins.def: Update DEF_BUILTIN comment to include COND argument.
1087         Move all DEF_SYNC_BUILTIN () and DEF_GOMP_BUILTIN () builtins
1088         into separate files.
1089         * sync-builtins.def: New file, moved from builtins.def.
1090         * omp-builtins.def: New file, moved from builtins.def.
1091         * builtin-types.def (DEF_FUNCTION_TYPE_6, DEF_FUNCTION_TYPE_7,
1092         DEF_FUNCTION_TYPE_VAR_4): Document.
1093         * Makefile.in (BUILTINS_DEF): New variable.
1094         (TREE_H, c-common.o, builtins.o): Use it instead of builtins.def.
1096 2005-09-23  Richard Henderson  <rth@redhat.com>
1098         * c-omp.c (c_finish_omp_critical): Move implementation ...
1099         * gimplify.c (gimplify_omp_critical): ... here.
1100         (gimplify_expr): Call it.
1101         (critical_name_mutexes): New.
1102         * tree-pretty-print.c (dump_generic_node): Handle OMP_CRITICAL.
1103         * tree.def (OMP_MASTER, OMP_BARRIER, OMP_ORDERED): Remove.
1104         (OMP_PARALLEL, OMP_FOR, OMP_SECTIONS, OMP_SECTION,
1105         OMP_SINGLE, OMP_CRITICAL): Change to tcc_statement; update operand
1106         number comments.
1107         * tree.h (OMP_CRITICAL_NAME, OMP_CRITICAL_BODY): New.
1109 2005-09-23  Diego Novillo  <dnovillo@redhat.com>
1111         * tree.def (OMP_CLAUSE_NOWAIT): Define.
1112         * tree-pretty-print.c (dump_generic_node): Handle.
1113         * c-parser.c (c_parser_pragma_omp_clause_nowait): Generate.
1114         * gimple-low.c (lower_omp_for): If nowait has not been
1115         specified, emit a barrier at the end of the parallel loop.
1117 2005-09-23  Diego Novillo  <dnovillo@redhat.com>
1119         * c-common.h (c_finish_omp_for): Declare
1120         * c-omp.c (c_finish_omp_for): Rename from c_finish_gomp_for
1121         and move from ...
1122         * c-typeck.c (c_finish_gomp_for): ... here.
1123         * c-tree.h (c_finish_gomp_for): Remove.
1124         * gimple-low.c: Rename gomp_* symbols into omp_*.
1125         Update all users.
1126         * gimplify.c: Likewise.
1127         * tree.def: Rename GOMP_* tree codes to OMP_*.
1128         Update all users.
1129         * tree.h: Likewise.
1131 2005-09-23  Diego Novillo  <dnovillo@redhat.com>
1133         Mainline merge (gomp-merge-20050923)
1135 2005-09-23  Diego Novillo  <dnovillo@redhat.com>
1137         * c-parser.c (c_parser_pragma_omp_clause): Fix dangling if().
1138         (c_parser_pragma_omp_clause_if): Remove printf.
1139         Check that only one clause 'if' is specified.
1140         Call add_new_clause.
1141         (c_parser_pragma_omp_clause_num_threads): Remove printf.
1142         Check that only one clause 'num_threads' is specified.
1143         Call add_new_clause.
1144         * gimple-low.c (emit_num_threads_setup_code): New.
1145         (lower_gomp_parallel): Call it.
1146         Add new argument DATA.  Modify all callers.
1147         * tree-pretty-print.c (dump_generic_node): Handle
1148         GOMP_CLAUSE_IF and GOMP_CLAUSE_NUM_THREADS.
1149         * tree.def (GOMP_CLAUSE_IF, GOMP_CLAUSE_NUM_THREADS): Define.
1150         * tree.h (GOMP_IF_EXPR, GOMP_NUM_THREADS_EXPR): Define.
1152 2005-09-22  Richard Henderson  <rth@redhat.com>
1154         * c-parser.c (c_parse_init): Tableize the omp pragmas; register
1155         them with expansion.
1156         (c_handle_deferred_pragma): Split out of ...
1157         (c_parser_pragma): ... here.
1158         (c_lex_omp_pragma): Split out of ...
1159         (c_lex_one_token): ... here.  Consume non-omp pragmas immediately.
1161 2005-09-22  Richard Henderson  <rth@redhat.com>
1163         * Makefile.in (c-omp.o): Depend on C_TREE_H.
1164         * c-parser.c (c_parser_omp_atomic_expression): Handle error_mark
1165         from initial unary expression.  Move conversion code ...
1166         * c-omp.c (c_finish_omp_atomic): ... here.  Handle pointers and
1167         floating-point.
1168         * c-typeck.c (build_unary_op): Return error_mark after reporting
1169         a readonly_error.
1170         (build_modify_expr): Likewise.
1172 2005-09-22  Richard Henderson  <rth@redhat.com>
1174         * c-parser.c (omp_clauses_stack): Remove.
1175         (push_omp_clauses, pop_omp_clauses): Remove.
1176         (c_parser_for_statement): New parameter omp_clauses; pass it on to
1177         the GOMP_FOR instead of pop_omp_clauses.
1178         (c_parser_omp_directive): Save curr_clause_set after parsing the
1179         pragma.  Pass it on as appropriate.
1180         (c_parser_pragma_omp_critical): Don't clear curr_clause_set.
1181         (c_parser_pragma_omp_for): Don't call push_omp_clauses.
1182         (c_parser_pragma_omp_parallel, c_parser_pragma_omp_sections,
1183         c_parser_pragma_omp_single): Likewise.
1185 2005-09-22  Richard Henderson  <rth@redhat.com>
1187         * c-common.c (sync_resolve_return): Convert to the main variant.
1188         * c-tree.h (pushdecl): Move decl ...
1189         * c-common.h (pushdecl): ... here.
1190         (c_finish_omp_atomic): Update decl.
1191         * c-omp.c (c_finish_omp_atomic): Take code, lhs, rhs separately;
1192         delete code to extract them.  Use TYPE_MAIN_VARIANT.  Return early
1193         if lhs is not addressable.  Push new decls into current binding.
1194         Use build_binary_op.
1195         * c-parser.c (c_parser_pragma): Reset parser->error.
1196         (c_parser_compound_statement_nostart): Reinstate special case for
1197         barrier and flush.  Move parsing of these directives here.
1198         (c_parser_section_scope): Fix quoting in error message.
1199         (c_parser_omp_atomic_expression): New.
1200         (c_parser_omp_directive): Use it.  Error on barrier or flush.
1201         (c_parser_pragma_omp_critical): Tighten error corner cases.
1202         (c_parser_pragma_omp_flush): Likewise.
1204 2005-09-22  Diego Novillo  <dnovillo@redhat.com>
1206         * c-typeck.c (c_finish_gomp_for): Update OpenMP spec version.
1208 2005-09-22  Diego Novillo  <dnovillo@redhat.com>
1210         * gimple-low.c (process_gomp_clauses): Extract from ...
1211         (build_remap_info): ... here.
1212         (get_gomp_private_ref): Do not call copy_decl_for_dup.
1213         Set DECL_NAME of replacement to that of the original.
1214         (remap_locals_r): Temporarily treat local variables as private
1215         if they are not in any other clause.
1216         Prevent walking into the expression that replaces a mapped
1217         local.
1218         Call process_gomp_clauses on GOMP_PARALLEL, GOMP_FOR and
1219         GOMP_SECTIONS.
1220         (remap_locals): Remove arguments GOMP_FN and CLAUSEs.
1221         Add arguments BODY_P and RI_P.
1222         Call process_gomp_clauses.
1223         Call walk_tree on BODY_P.
1224         Do not return anything.
1225         Adjust callers.
1226         (lower_gomp_parallel): Call build_remap_info.
1227         (lower_gomp_for): Do not call remap_locals.
1228         Do not call emit_gomp_data_setup_code.
1229         Remove local RI_P.
1230         * tree.h (GOMP_SECTIONS_CLAUSES): Define.
1231         (GOMP_SECTIONS_BODY): Define.
1233 2005-09-22  Diego Novillo  <dnovillo@redhat.com>
1235         * c-tree.h (c_finish_gomp_for): Declare
1236         * c-typeck.c (c_finish_gomp_for): New.
1237         * c-parser.c (c_parser_for_statement): Call it.  If the
1238         parallel loop was malformed, call c_finish_loop to emit a
1239         sequential loop.
1241 2005-09-22  Diego Novillo  <dnovillo@redhat.com>
1243         * version.c: Update last merge date.
1245 2005-09-21  Richard Henderson  <rth@redhat.com>
1247         * c-lex.c (c_lex_with_flags) <CPP_PRAGMA>: Set input_location.
1249 2005-09-21  Richard Henderson  <rth@redhat.com>
1251         * c-omp.c: New file.
1252         * Makefile.in (c-omp.o): New.
1253         * builtin-types.def (BT_PTR_LONG, BT_PTR_PTR, BT_FN_BOOL, BT_FN_INT,
1254         BT_FN_VOID_PTRPTR, BT_PTR_FN_VOID_PTR, BT_FN_VOID_UINT_UINT,
1255         BT_FN_BOOL_LONGPTR_LONGPTR, BT_FN_VOID_OMPFN_PTR_UINT,
1256         BT_FN_VOID_OMPFN_PTR_UINT_UINT,
1257         BT_FN_BOOL_LONG_LONG_LONG_LONGPTR_LONGPTR,
1258         BT_FN_BOOL_LONG_LONG_LONG_LONG_LONGPTR_LONGPTR,
1259         BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG,
1260         BT_FN_VOID_OMPFN_PTR_UINT_LONG_LONG_LONG_LONG): New.
1261         * builtins.def (DEF_GOMP_BUILTIN): New.
1262         (BUILT_IN_OMP_GET_THREAD_NUM, BUILT_IN_GOMP_BARRIER,
1263         BUILT_IN_GOMP_CRITICAL_START, BUILT_IN_GOMP_CRITICAL_END,
1264         BUILT_IN_GOMP_CRITICAL_NAME_START, BUILT_IN_GOMP_CRITICAL_NAME_END,
1265         BUILT_IN_GOMP_LOOP_STATIC_START, BUILT_IN_GOMP_LOOP_DYNAMIC_START,
1266         BUILT_IN_GOMP_LOOP_GUIDED_START, BUILT_IN_GOMP_LOOP_RUNTIME_START,
1267         BUILT_IN_GOMP_LOOP_ORDERED_STATIC_START,
1268         BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_START,
1269         BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_START,
1270         BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_START,
1271         BUILT_IN_GOMP_LOOP_STATIC_NEXT, BUILT_IN_GOMP_LOOP_DYNAMIC_NEXT,
1272         BUILT_IN_GOMP_LOOP_GUIDED_NEXT, BUILT_IN_GOMP_LOOP_RUNTIME_NEXT,
1273         BUILT_IN_GOMP_LOOP_ORDERED_STATIC_NEXT,
1274         BUILT_IN_GOMP_LOOP_ORDERED_DYNAMIC_NEXT,
1275         BUILT_IN_GOMP_LOOP_ORDERED_GUIDED_NEXT,
1276         BUILT_IN_GOMP_LOOP_ORDERED_RUNTIME_NEXT,
1277         BUILT_IN_GOMP_PARALLEL_LOOP_STATIC_START,
1278         BUILT_IN_GOMP_PARALLEL_LOOP_DYNAMIC_START,
1279         BUILT_IN_GOMP_PARALLEL_LOOP_GUIDED_START,
1280         BUILT_IN_GOMP_PARALLEL_LOOP_RUNTIME_START,
1281         BUILT_IN_GOMP_LOOP_END, BUILT_IN_GOMP_LOOP_END_NOWAIT,
1282         BUILT_IN_GOMP_ORDERED_START, BUILT_IN_GOMP_ORDERED_END,
1283         BUILT_IN_GOMP_PARALLEL_START, BUILT_IN_GOMP_PARALLEL_END,
1284         BUILT_IN_GOMP_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_NEXT,
1285         BUILT_IN_GOMP_PARALLEL_SECTIONS_START, BUILT_IN_GOMP_SECTIONS_END,
1286         BUILT_IN_GOMP_SECTIONS_END_NOWAIT, BUILT_IN_GOMP_SINGLE_START,
1287         BUILT_IN_GOMP_SINGLE_COPY_START, BUILT_IN_GOMP_SINGLE_COPY_END): New.
1288         * c-common.c (DEF_FUNCTION_TYPE_7): New.
1289         * c-tree.h (pushdecl_top_level): Move declaration ...
1290         * c-common.h (pushdecl_top_level): ... here.
1291         (c_finish_omp_master, c_finish_omp_critical, c_finish_omp_ordered,
1292         c_finish_omp_barrier, c_finish_omp_atomic, c_finish_omp_flush): Declare.
1293         * c-parser.c (c_parser_compound_statement_nostart): Don't special
1294         case omp barrier or omp flush.
1295         (c_parser_omp_directive): Implement master, critical, orered,
1296         barrier, atomic, flush.
1297         (c_parser_pragma_omp_no_args): New.
1298         (c_parser_pragma_omp_critical): Remove printf debugging.
1299         (c_parser_pragma_omp_flush): Likewise.
1300         (c_parser_pragma_omp_atomic, c_parser_pragma_omp_barrier,
1301         c_parser_pragma_omp_master, c_parser_pragma_omp_ordered): Remove.
1303 2005-09-21  Jakub Jelinek  <jakub@redhat.com>
1305         * c-parser.c (c_parse_init): Don't register OpenMP pragmas
1306         if flag_preprocess_only.
1308 2005-09-21  Richard Henderson  <rth@redhat.com>
1310         * cgraph.c (cgraph_analyze_queue): New.
1311         (cgraph_add_new_function): Do nothing but add the decl to this list.
1312         * cgraph.h (cgraph_analyze_queue): Declare.
1313         (cgraph_lower_function): Remove.
1314         * cgraphunit.c (cgraph_lower_function): Make static.
1315         (cgraph_finalize_pending_functions): New.
1316         (cgraph_finalize_function): Call it.
1317         (cgraph_finalize_compilation_unit): Likewise.
1318         * gimple-low.c (lower_gomp_parallel): Call gimplify_function_tree.
1320 2005-09-20  Diego Novillo  <dnovillo@redhat.com>
1322         * gimple-low.c (lower_gomp_parallel): Use a NULL argument if
1323         there is no shared data to send to the child thread.
1325 2005-09-20  Diego Novillo  <dnovillo@redhat.com>
1327         * Makefile.in (c-parser.o): Depend on vec.h.
1328         (gimple-low.o): Depend on $(SPLAY_TREE_H)
1329         * c-parser.c: Include vec.h.
1330         (curr_clause_set, omp_clauses_stack): New locals.
1331         (omp_clauses): Remove.  Adjust all callers.
1332         (push_omp_clauses, pop_omp_clauses, add_new_clause): New.
1333         (c_parser_for_statement): Add new argument IS_OMP_FOR.
1334         If true, emit a GOMP_FOR tree.
1335         Adjust all callers.
1336         (c_parser_omp_directive): Call pop_omp_clauses.
1337         (c_parser_pragma_omp_clause_copyin): Call add_new_clause.
1338         Don't return anything.  Adjust callers.
1339         (c_parser_pragma_omp_clause_firstprivate): Call add_new_clause.
1340         (c_parser_pragma_omp_clause_lastprivate): Likewise.
1341         (c_parser_pragma_omp_clause_private): Likewise.
1342         (c_parser_pragma_omp_clause_shared): Likewise.
1343         Mark all shared variables addressable.
1344         (c_parser_pragma_omp_for): Call push_omp_clauses.
1345         (c_parser_pragma_omp_parallel_for): Remove printf.
1346         (c_parser_pragma_omp_for): Call push_omp_clauses
1347         (c_parser_pragma_omp_parallel_sections): Remove printf.
1348         (c_parser_pragma_omp_parallel): Call push_omp_clauses.
1349         (c_parser_pragma_omp_sections): Remove printf.
1350         Call push_omp_clauses.
1351         (c_parser_pragma_omp_single): Remove printf.
1352         Call push_omp_clauses.
1353         * cgraph.c (cgraph_add_new_function): Assume that FNDECL
1354         already has a struct function associated.
1355         * gimple-low.c: Include splay-tree.h
1356         (struct remap_info_d, add_decls_to_set, build_remap_info,
1357         remap_locals_r): Move from tree-inline.c.
1358         (delete_remap_info, get_gomp_private_ref, get_gomp_shared_ref,
1359         remap_locals): New.
1360         (create_gomp_fn): Set DECL_ARG_TYPE and TREE_USED on
1361         FN_DATA_ARG.
1362         (emit_gomp_data_setup_code): New.
1363         (lower_gomp_parallel): Rename from lower_gomp_expr.
1364         Allocate the function structure before calling remap_locals.
1365         Call emit_gomp_data_setup_code.
1366         Call delete_remap_info.
1367         (emit_gomp_for_static): New.
1368         (lower_gomp_for): New.
1369         (lower_stmt): Handle GOMP_FOR.
1370         * gimplify.c (gimplify_gomp_for): New.
1371         (gimplify_expr): Handle GOMP_FOR with a call to
1372         gimplify_gomp_for.
1373         * tree-gimple.c (is_gimple_stmt): Handle GOMP_FOR.
1374         * tree-inline.c (remap_locals_d, add_decls_to_set,
1375         build_remap_info, remap_locals_r): Move to gimple-low.c.
1376         (remap_locals_in_gomp_body, move_decl_to): Remove.
1377         * tree-inline.h (remap_locals_in_gomp_body): Remove.
1378         * tree-pretty-print.c (dump_generic_node): Handle GOMP_FOR,
1379         GOMP_CLAUSE_SHARED, GOMP_CLAUSE_FIRSTPRIVATE,
1380         GOMP_CLAUSE_LASTPRIVATE, GOMP_CLAUSE_COPYIN,
1381         GOMP_CLAUSE_COPYPRIVATE.
1382         Adjust output for GOMP_PARALLEL.
1383         * tree.c (build5_stat): New.
1384         * tree.def (GOMP_FOR): Add operand GOMP_FOR_COND.
1385         * tree.h (GOMP_FOR_CLAUSES, GOMP_FOR_INIT, GOMP_FOR_CODN,
1386         GOMP_FOR_INCR, GOMP_FOR_BODY, GOMP_SHARED_VARS,
1387         GOMP_FIRSTPRIVATE_VARS, GOMP_LASTPRIVATE_VARS,
1388         GOMP_COPYIN_VARS, GOMP_COPYPRIVATE_VARS): Define.
1389         (build5_stat, build5): Declare.
1391 2005-09-20  Jakub Jelinek  <jakub@redhat.com>
1393         * c-cppbuiltin.c (c_cpp_builtins): If -fopenmp, #define _OPENMP
1394         to 200505.
1396 2005-09-14  Diego Novillo  <dnovillo@redhat.com>
1398         Mainline merge (gomp-merge-20050914)
1400 2005-09-01  Diego Novillo  <dnovillo@redhat.com>
1402         Mainline merge (gomp-merge-20050901)
1404 2005-08-03  Diego Novillo  <dnovillo@redhat.com>
1406         * cgraph.c (cgraph_add_new_function): When unit at a time is
1407         disabled, just add the new function to the graph and mark it
1408         as needed.
1409         * gimple-low.c (struct remap_locals_d, add_decls_to_set,
1410         build_remap_info, remap_locals_r, remap_locals_in_gomp_body):
1411         Move ...
1412         * tree-inline.c: ... here.
1413         (move_decl_to): New local function.
1414         (remap_locals_r): Call it.
1415         * tree-inline.h (remap_locals_in_gomp_body): Declare.
1417 2005-08-01  Diego Novillo  <dnovillo@redhat.com>
1419         * gimple-low.c (create_gomp_fn): Call create_tmp_var_name to
1420         create a new function name.
1421         (create_gomp_parallel_start): Fix contexts for block vars and
1422         function argument.
1423         (lower_gomp_expr): Fix type of first argument in call to
1424         GOMP_parallel_start.
1426 2005-07-28  Diego Novillo  <dnovillo@redhat.com>
1428         Mainline merge.
1430 2005-07-13  Diego Novillo  <dnovillo@redhat.com>
1432         * gimplify.c (gimplify_gomp_parallel): Really remove.
1434 2005-07-13  Diego Novillo  <dnovillo@redhat.com>
1436         * cgraph.c (cgraph_add_new_function): New.
1437         * cgraph.h (cgraph_add_new_function): Declare.
1438         * gimple-low.c (struct remap_locals_d): Declare.
1439         (add_decls_to_set): New.
1440         (build_remap_info): New.
1441         (remap_locals_r): New.
1442         (remap_locals_in_gomp_body): New.
1443         (create_gomp_fn): New.
1444         (create_gomp_parallel_start): New.
1445         (create_gomp_parallel_end): New.
1446         (lower_gomp_expr): New.
1447         (lower_stmt): Call it.
1448         * gimplify.c (gimplify_gomp_parallel): Remove.
1449         (gimplify_expr): Don't gimplify GOMP_PARALLEL.
1450         * tree-gimple.c (is_gimple_stmt): Consider GOMP_PARALLEL
1451         to be GIMPLE.
1452         * tree.def (GOMP_CLAUSE_SHARED, GOMP_CLAUSE_FIRSTPRIVATE,
1453         GOMP_CLAUSE_LASTPRIVATE, GOMP_CLAUSE_REDUCTION,
1454         GOMP_CLAUSE_COPYPRIVATE,): Define.
1456 2005-06-13  Diego Novillo  <dnovillo@redhat.com>
1458         * c-parser.c: Re-order and re-format OpenMP parsing helpers.
1459         (c_lex_one_token): Fix typo in comment.
1460         (c_parser_omp_directive): Emit GOMP_PARALLEL.
1461         (c_parser_pragma_omp_variable_list): Return TREE_LIST of VAR_DECLs.
1462         (c_parser_pragma_omp_clause_copyin): Return list of copyin variables.
1463         (c_parser_pragma_omp_clause_private): Likewise.
1464         * gimplify.c (gimplify_gomp_parallel): New.
1465         (gimplify_expr): Handle GOMP_PARALLEL.
1466         * tree-pretty-print.c (dumping_stmts): Remove.
1467         Update all users.
1468         (dump_generic_node): Handle GOMP_PARALLEL and GOMP_CLAUSE_PRIVATE.
1469         * tree.def (GOMP_CLAUSE_COPYIN, GOMP_CLAUSE_PRIVATE): Define.
1470         * tree.h (GOMP_PARALLEL_CLAUSES, GOMP_PARALLEL_BODY,
1471         GOMP_PRIVATE_VARS): Define.
1473 2005-06-13  Diego Novillo  <dnovillo@redhat.com>
1475         * tree.def (GOMP_PARALLEL, GOMP_FOR, GOMP_SECTIONS,
1476         GOMP_SECTION, GOMP_SINGLE, GOMP_MASTER, GOMP_CRITICAL,
1477         GOMP_BARRIER, GOMP_ORDERED): Define.
1479 2005-06-13  Dmitry Kurochkin  <dmitry.kurochkin@gmail.com>
1481         * c.opt (fopenmp): New flag.
1482         * c-parser.c (c_parse_init): Initialize OpenMP pragmas.
1483         (pragma_omp_kind, pragma_omp_clause): Declare.
1484         (c_token): Add omp_kind field.
1485         (c_lex_one_token): Handle CPP_PRAGMA.
1486         (c_token_starts_declspecs): Handle PRAGMA_OMP_THREADPRIVATE.
1487         (c_parser_declaration_or_fndef): Update comment, handle
1488         PRAGMA_OMP_THREADPRIVATE.
1489         (c_parser_compound_statement, c_parser_statement): Update comment.
1490         (c_parser_compound_statement_nostart): Handler PRAGMA_OMP_BARRIER
1491         and PRAGMA_OMP_FLUSH.
1492         (c_parser_statement_after_labels): Handle OpenMP pragmas.
1493         (c_parser_section_scope, c_parser_pragma,
1494         c_parser_pragma_omp_atomic, c_parser_pragma_omp_barrier,
1495         c_parser_pragma_omp_critical, c_parser_pragma_omp_flush,
1496         c_parser_pragma_omp_for, c_parser_pragma_omp_master,
1497         c_parser_pragma_omp_master, c_parser_pragma_omp_ordered,
1498         c_parser_pragma_omp_parallel,
1499         c_parser_pragma_omp_parallel_for,
1500         c_parser_pragma_omp_parallel_sections,
1501         c_parser_pragma_omp_section,
1502         c_parser_pragma_omp_sections, c_parser_pragma_omp_single,
1503         c_parser_pragma_omp_threadprivate,
1504         c_parser_pragma_omp_clause,
1505         c_parser_pragma_omp_variable_list,
1506         c_parser_pragma_omp_clause_copyin,
1507         c_parser_pragma_omp_clause_copyprivate,
1508         c_parser_pragma_omp_clause_default,
1509         c_parser_pragma_omp_clause_firstprivate,
1510         c_parser_pragma_omp_clause_if,
1511         c_parser_pragma_omp_clause_lastprivate,
1512         c_parser_pragma_omp_clause_nowait,
1513         c_parser_pragma_omp_clause_num_threads,
1514         c_parser_pragma_omp_clause_ordered,
1515         c_parser_pragma_omp_clause_private,
1516         c_parser_pragma_omp_clause_reduction,
1517         c_parser_pragma_omp_clause_schedule,
1518         c_parser_pragma_omp_clause_shared): New.