annotate gcc/cilk.h @ 144:8f4e72ab4e11

fix segmentation fault caused by nothing next cur_op to end
author Takahiro SHIMIZU <anatofuz@cr.ie.u-ryukyu.ac.jp>
date Sun, 23 Dec 2018 21:23:56 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* This file is part of the Intel(R) Cilk(TM) Plus support
kono
parents:
diff changeset
2 This file contains Cilk Support files.
kono
parents:
diff changeset
3 Copyright (C) 2013-2017 Free Software Foundation, Inc.
kono
parents:
diff changeset
4 Contributed by Balaji V. Iyer <balaji.v.iyer@intel.com>,
kono
parents:
diff changeset
5 Intel Corporation
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 This file is part of GCC.
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 GCC is free software; you can redistribute it and/or modify it
kono
parents:
diff changeset
10 under the terms of the GNU General Public License as published by
kono
parents:
diff changeset
11 the Free Software Foundation; either version 3, or (at your option)
kono
parents:
diff changeset
12 any later version.
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 GCC is distributed in the hope that it will be useful, but
kono
parents:
diff changeset
15 WITHOUT ANY WARRANTY; without even the implied warranty of
kono
parents:
diff changeset
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
kono
parents:
diff changeset
17 General Public License for more details.
kono
parents:
diff changeset
18
kono
parents:
diff changeset
19 You should have received a copy of the GNU General Public License
kono
parents:
diff changeset
20 along with GCC; see the file COPYING3. If not see
kono
parents:
diff changeset
21 <http://www.gnu.org/licenses/>. */
kono
parents:
diff changeset
22
kono
parents:
diff changeset
23 #ifndef GCC_CILK_H
kono
parents:
diff changeset
24 #define GCC_CILK_H
kono
parents:
diff changeset
25
kono
parents:
diff changeset
26 /* Frame status bits known to compiler. */
kono
parents:
diff changeset
27 #define CILK_FRAME_UNSYNCHED 0x02
kono
parents:
diff changeset
28 #define CILK_FRAME_DETACHED 0x04
kono
parents:
diff changeset
29 #define CILK_FRAME_EXCEPTING 0x10
kono
parents:
diff changeset
30 #define CILK_FRAME_VERSION (1 << 24)
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 enum cilk_tree_index {
kono
parents:
diff changeset
33 /* All the built-in functions for Cilk keywords. */
kono
parents:
diff changeset
34 CILK_TI_F_WORKER = 0, /* __cilkrts_get_worker (). */
kono
parents:
diff changeset
35 CILK_TI_F_SYNC, /* __cilkrts_sync (). */
kono
parents:
diff changeset
36 CILK_TI_F_DETACH, /* __cilkrts_detach (...). */
kono
parents:
diff changeset
37 CILK_TI_F_ENTER, /* __cilkrts_enter_frame (...). */
kono
parents:
diff changeset
38 CILK_TI_F_ENTER_FAST, /* __cilkrts_enter_frame_fast (.). */
kono
parents:
diff changeset
39 CILK_TI_F_LEAVE, /* __cilkrts_leave_frame (...). */
kono
parents:
diff changeset
40 CILK_TI_F_POP, /* __cilkrts_pop_frame (...). */
kono
parents:
diff changeset
41 CILK_TI_F_RETHROW, /* __cilkrts_rethrow (...). */
kono
parents:
diff changeset
42 CILK_TI_F_SAVE_FP, /* __cilkrts_save_fp_ctrl_state (...). */
kono
parents:
diff changeset
43 CILK_TI_F_LOOP_32, /* __cilkrts_cilk_for_32 (...). */
kono
parents:
diff changeset
44 CILK_TI_F_LOOP_64, /* __cilkrts_cilk_for_64 (...). */
kono
parents:
diff changeset
45
kono
parents:
diff changeset
46 /* __cilkrts_stack_frame struct fields. */
kono
parents:
diff changeset
47 CILK_TI_FRAME_FLAGS, /* stack_frame->flags. */
kono
parents:
diff changeset
48 CILK_TI_FRAME_PARENT, /* stack_frame->parent. */
kono
parents:
diff changeset
49 CILK_TI_FRAME_WORKER, /* stack_frame->worker. */
kono
parents:
diff changeset
50 CILK_TI_FRAME_EXCEPTION, /* stack_frame->except_data. */
kono
parents:
diff changeset
51 CILK_TI_FRAME_CONTEXT, /* stack_frame->context[4]. */
kono
parents:
diff changeset
52 CILK_TI_FRAME_PEDIGREE, /* stack_frame->pedigree. */
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 /* __cilkrts_worker struct fields. */
kono
parents:
diff changeset
55 CILK_TI_WORKER_CUR, /* worker->current_stack_frame. */
kono
parents:
diff changeset
56 CILK_TI_WORKER_TAIL, /* worker->tail. */
kono
parents:
diff changeset
57 CILK_TI_WORKER_PEDIGREE, /* worker->pedigree. */
kono
parents:
diff changeset
58
kono
parents:
diff changeset
59 /* __cilkrts_pedigree struct fields. */
kono
parents:
diff changeset
60 CILK_TI_PEDIGREE_RANK, /* pedigree->rank. */
kono
parents:
diff changeset
61 CILK_TI_PEDIGREE_PARENT, /* pedigree->parent. */
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 /* Types. */
kono
parents:
diff changeset
64 CILK_TI_FRAME_TYPE, /* struct __cilkrts_stack_frame. */
kono
parents:
diff changeset
65 CILK_TI_FRAME_PTR, /* __cilkrts_stack_frame *. */
kono
parents:
diff changeset
66 CILK_TI_WORKER_TYPE, /* struct __cilkrts_worker. */
kono
parents:
diff changeset
67 CILK_TI_PEDIGREE_TYPE, /* struct __cilkrts_pedigree. */
kono
parents:
diff changeset
68 CILK_TI_MAX
kono
parents:
diff changeset
69 };
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 extern GTY (()) tree cilk_trees[CILK_TI_MAX];
kono
parents:
diff changeset
72
kono
parents:
diff changeset
73 #define cilk_worker_fndecl cilk_trees[CILK_TI_F_WORKER]
kono
parents:
diff changeset
74 #define cilk_sync_fndecl cilk_trees[CILK_TI_F_SYNC]
kono
parents:
diff changeset
75 #define cilk_synched_fndecl cilk_trees[CILK_TI_F_SYNCED]
kono
parents:
diff changeset
76 #define cilk_detach_fndecl cilk_trees[CILK_TI_F_DETACH]
kono
parents:
diff changeset
77 #define cilk_enter_fndecl cilk_trees[CILK_TI_F_ENTER]
kono
parents:
diff changeset
78 #define cilk_enter_fast_fndecl cilk_trees[CILK_TI_F_ENTER_FAST]
kono
parents:
diff changeset
79 #define cilk_leave_fndecl cilk_trees[CILK_TI_F_LEAVE]
kono
parents:
diff changeset
80 #define cilk_rethrow_fndecl cilk_trees[CILK_TI_F_RETHROW]
kono
parents:
diff changeset
81 #define cilk_pop_fndecl cilk_trees[CILK_TI_F_POP]
kono
parents:
diff changeset
82 #define cilk_save_fp_fndecl cilk_trees[CILK_TI_F_SAVE_FP]
kono
parents:
diff changeset
83 #define cilk_for_32_fndecl cilk_trees[CILK_TI_F_LOOP_32]
kono
parents:
diff changeset
84 #define cilk_for_64_fndecl cilk_trees[CILK_TI_F_LOOP_64]
kono
parents:
diff changeset
85
kono
parents:
diff changeset
86 #define cilk_worker_type_fndecl cilk_trees[CILK_TI_WORKER_TYPE]
kono
parents:
diff changeset
87 #define cilk_frame_type_decl cilk_trees[CILK_TI_FRAME_TYPE]
kono
parents:
diff changeset
88 #define cilk_frame_ptr_type_decl cilk_trees[CILK_TI_FRAME_PTR]
kono
parents:
diff changeset
89 #define cilk_pedigree_type_decl cilk_trees[CILK_TI_PEDIGREE_TYPE]
kono
parents:
diff changeset
90
kono
parents:
diff changeset
91 extern void expand_builtin_cilk_detach (tree);
kono
parents:
diff changeset
92 extern void expand_builtin_cilk_pop_frame (tree);
kono
parents:
diff changeset
93 extern tree cilk_arrow (tree, int, bool);
kono
parents:
diff changeset
94 extern tree cilk_dot (tree, int, bool);
kono
parents:
diff changeset
95 extern void cilk_init_builtins (void);
kono
parents:
diff changeset
96 extern void gimplify_cilk_sync (tree *, gimple_seq *);
kono
parents:
diff changeset
97 extern tree cilk_call_setjmp (tree);
kono
parents:
diff changeset
98
kono
parents:
diff changeset
99 /* Returns true if Cilk Plus is enabled and if F->cilk_frame_decl is not
kono
parents:
diff changeset
100 NULL_TREE. */
kono
parents:
diff changeset
101
kono
parents:
diff changeset
102 inline bool
kono
parents:
diff changeset
103 fn_contains_cilk_spawn_p (function *f)
kono
parents:
diff changeset
104 {
kono
parents:
diff changeset
105 return (flag_cilkplus
kono
parents:
diff changeset
106 && (f->calls_cilk_spawn || f->cilk_frame_decl != NULL_TREE));
kono
parents:
diff changeset
107 }
kono
parents:
diff changeset
108
kono
parents:
diff changeset
109 #endif