Mercurial > hg > CbC > CbC_gcc
comparison gcc/expr.h @ 67:f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
author | nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 22 Mar 2011 17:18:12 +0900 |
parents | b7f97abdc517 |
children | 04ced10e8804 |
comparison
equal
deleted
inserted
replaced
65:65488c3d617d | 67:f6334be47118 |
---|---|
31 /* For host_integerp, tree_low_cst, fold_convert, size_binop, ssize_int, | 31 /* For host_integerp, tree_low_cst, fold_convert, size_binop, ssize_int, |
32 TREE_CODE, TYPE_SIZE, int_size_in_bytes, */ | 32 TREE_CODE, TYPE_SIZE, int_size_in_bytes, */ |
33 #include "tree.h" | 33 #include "tree.h" |
34 /* For GET_MODE_BITSIZE, word_mode */ | 34 /* For GET_MODE_BITSIZE, word_mode */ |
35 #include "machmode.h" | 35 #include "machmode.h" |
36 | |
37 /* The default branch cost is 1. */ | |
38 #ifndef BRANCH_COST | |
39 #define BRANCH_COST(speed_p, predictable_p) 1 | |
40 #endif | |
41 | 36 |
42 /* This is the 4th arg to `expand_expr'. | 37 /* This is the 4th arg to `expand_expr'. |
43 EXPAND_STACK_PARM means we are possibly expanding a call param onto | 38 EXPAND_STACK_PARM means we are possibly expanding a call param onto |
44 the stack. | 39 the stack. |
45 EXPAND_SUM means it is ok to return a PLUS rtx or MULT rtx. | 40 EXPAND_SUM means it is ok to return a PLUS rtx or MULT rtx. |
58 #define NO_DEFER_POP (inhibit_defer_pop += 1) | 53 #define NO_DEFER_POP (inhibit_defer_pop += 1) |
59 | 54 |
60 /* Allow the compiler to defer stack pops. See inhibit_defer_pop for | 55 /* Allow the compiler to defer stack pops. See inhibit_defer_pop for |
61 more information. */ | 56 more information. */ |
62 #define OK_DEFER_POP (inhibit_defer_pop -= 1) | 57 #define OK_DEFER_POP (inhibit_defer_pop -= 1) |
63 | |
64 /* If a memory-to-memory move would take MOVE_RATIO or more simple | |
65 move-instruction sequences, we will do a movmem or libcall instead. */ | |
66 | |
67 #ifndef MOVE_RATIO | |
68 #if defined (HAVE_movmemqi) || defined (HAVE_movmemhi) || defined (HAVE_movmemsi) || defined (HAVE_movmemdi) || defined (HAVE_movmemti) | |
69 #define MOVE_RATIO(speed) 2 | |
70 #else | |
71 /* If we are optimizing for space (-Os), cut down the default move ratio. */ | |
72 #define MOVE_RATIO(speed) ((speed) ? 15 : 3) | |
73 #endif | |
74 #endif | |
75 | |
76 /* If a clear memory operation would take CLEAR_RATIO or more simple | |
77 move-instruction sequences, we will do a setmem or libcall instead. */ | |
78 | |
79 #ifndef CLEAR_RATIO | |
80 #if defined (HAVE_setmemqi) || defined (HAVE_setmemhi) || defined (HAVE_setmemsi) || defined (HAVE_setmemdi) || defined (HAVE_setmemti) | |
81 #define CLEAR_RATIO(speed) 2 | |
82 #else | |
83 /* If we are optimizing for space, cut down the default clear ratio. */ | |
84 #define CLEAR_RATIO(speed) ((speed) ? 15 :3) | |
85 #endif | |
86 #endif | |
87 | |
88 /* If a memory set (to value other than zero) operation would take | |
89 SET_RATIO or more simple move-instruction sequences, we will do a movmem | |
90 or libcall instead. */ | |
91 #ifndef SET_RATIO | |
92 #define SET_RATIO(speed) MOVE_RATIO(speed) | |
93 #endif | |
94 | 58 |
95 enum direction {none, upward, downward}; | 59 enum direction {none, upward, downward}; |
96 | 60 |
97 /* Structure to record the size of a sequence of arguments | 61 /* Structure to record the size of a sequence of arguments |
98 as the sum of a tree-expression and a constant. This structure is | 62 as the sum of a tree-expression and a constant. This structure is |
164 /* Convert the implicit sum in a `struct args_size' into an rtx. */ | 128 /* Convert the implicit sum in a `struct args_size' into an rtx. */ |
165 #define ARGS_SIZE_RTX(SIZE) \ | 129 #define ARGS_SIZE_RTX(SIZE) \ |
166 ((SIZE).var == 0 ? GEN_INT ((SIZE).constant) \ | 130 ((SIZE).var == 0 ? GEN_INT ((SIZE).constant) \ |
167 : expand_normal (ARGS_SIZE_TREE (SIZE))) | 131 : expand_normal (ARGS_SIZE_TREE (SIZE))) |
168 | 132 |
169 /* Supply a default definition for FUNCTION_ARG_PADDING: | |
170 usually pad upward, but pad short args downward on | |
171 big-endian machines. */ | |
172 | |
173 #define DEFAULT_FUNCTION_ARG_PADDING(MODE, TYPE) \ | |
174 (! BYTES_BIG_ENDIAN \ | |
175 ? upward \ | |
176 : (((MODE) == BLKmode \ | |
177 ? ((TYPE) && TREE_CODE (TYPE_SIZE (TYPE)) == INTEGER_CST \ | |
178 && int_size_in_bytes (TYPE) < (PARM_BOUNDARY / BITS_PER_UNIT)) \ | |
179 : GET_MODE_BITSIZE (MODE) < PARM_BOUNDARY) \ | |
180 ? downward : upward)) | |
181 | |
182 #ifndef FUNCTION_ARG_PADDING | |
183 #define FUNCTION_ARG_PADDING(MODE, TYPE) \ | |
184 DEFAULT_FUNCTION_ARG_PADDING ((MODE), (TYPE)) | |
185 #endif | |
186 | |
187 /* Supply a default definition for FUNCTION_ARG_BOUNDARY. Normally, we let | |
188 FUNCTION_ARG_PADDING, which also pads the length, handle any needed | |
189 alignment. */ | |
190 | |
191 #ifndef FUNCTION_ARG_BOUNDARY | |
192 #define FUNCTION_ARG_BOUNDARY(MODE, TYPE) PARM_BOUNDARY | |
193 #endif | |
194 | |
195 /* Supply a default definition of STACK_SAVEAREA_MODE for emit_stack_save. | |
196 Normally move_insn, so Pmode stack pointer. */ | |
197 | |
198 #ifndef STACK_SAVEAREA_MODE | |
199 #define STACK_SAVEAREA_MODE(LEVEL) Pmode | |
200 #endif | |
201 | |
202 /* Supply a default definition of STACK_SIZE_MODE for | |
203 allocate_dynamic_stack_space. Normally PLUS/MINUS, so word_mode. */ | |
204 | |
205 #ifndef STACK_SIZE_MODE | |
206 #define STACK_SIZE_MODE word_mode | |
207 #endif | |
208 | |
209 /* Provide default values for the macros controlling stack checking. */ | |
210 | |
211 /* The default is neither full builtin stack checking... */ | |
212 #ifndef STACK_CHECK_BUILTIN | |
213 #define STACK_CHECK_BUILTIN 0 | |
214 #endif | |
215 | |
216 /* ...nor static builtin stack checking. */ | |
217 #ifndef STACK_CHECK_STATIC_BUILTIN | |
218 #define STACK_CHECK_STATIC_BUILTIN 0 | |
219 #endif | |
220 | |
221 /* The default interval is one page (4096 bytes). */ | |
222 #ifndef STACK_CHECK_PROBE_INTERVAL_EXP | |
223 #define STACK_CHECK_PROBE_INTERVAL_EXP 12 | |
224 #endif | |
225 | |
226 /* The default is not to move the stack pointer. */ | |
227 #ifndef STACK_CHECK_MOVING_SP | |
228 #define STACK_CHECK_MOVING_SP 0 | |
229 #endif | |
230 | |
231 /* This is a kludge to try to capture the discrepancy between the old | |
232 mechanism (generic stack checking) and the new mechanism (static | |
233 builtin stack checking). STACK_CHECK_PROTECT needs to be bumped | |
234 for the latter because part of the protection area is effectively | |
235 included in STACK_CHECK_MAX_FRAME_SIZE for the former. */ | |
236 #ifdef STACK_CHECK_PROTECT | |
237 #define STACK_OLD_CHECK_PROTECT STACK_CHECK_PROTECT | |
238 #else | |
239 #define STACK_OLD_CHECK_PROTECT \ | |
240 (USING_SJLJ_EXCEPTIONS ? 75 * UNITS_PER_WORD : 8 * 1024) | |
241 #endif | |
242 | |
243 /* Minimum amount of stack required to recover from an anticipated stack | |
244 overflow detection. The default value conveys an estimate of the amount | |
245 of stack required to propagate an exception. */ | |
246 #ifndef STACK_CHECK_PROTECT | |
247 #define STACK_CHECK_PROTECT \ | |
248 (USING_SJLJ_EXCEPTIONS ? 75 * UNITS_PER_WORD : 12 * 1024) | |
249 #endif | |
250 | |
251 /* Make the maximum frame size be the largest we can and still only need | |
252 one probe per function. */ | |
253 #ifndef STACK_CHECK_MAX_FRAME_SIZE | |
254 #define STACK_CHECK_MAX_FRAME_SIZE \ | |
255 ((1 << STACK_CHECK_PROBE_INTERVAL_EXP) - UNITS_PER_WORD) | |
256 #endif | |
257 | |
258 /* This is arbitrary, but should be large enough everywhere. */ | |
259 #ifndef STACK_CHECK_FIXED_FRAME_SIZE | |
260 #define STACK_CHECK_FIXED_FRAME_SIZE (4 * UNITS_PER_WORD) | |
261 #endif | |
262 | |
263 /* Provide a reasonable default for the maximum size of an object to | |
264 allocate in the fixed frame. We may need to be able to make this | |
265 controllable by the user at some point. */ | |
266 #ifndef STACK_CHECK_MAX_VAR_SIZE | |
267 #define STACK_CHECK_MAX_VAR_SIZE (STACK_CHECK_MAX_FRAME_SIZE / 100) | |
268 #endif | |
269 | 133 |
270 /* This structure is used to pass around information about exploded | 134 /* This structure is used to pass around information about exploded |
271 unary, binary and trinary expressions between expand_expr_real_1 and | 135 unary, binary and trinary expressions between expand_expr_real_1 and |
272 friends. */ | 136 friends. */ |
273 typedef struct separate_ops | 137 typedef struct separate_ops |
274 { | 138 { |
275 enum tree_code code; | 139 enum tree_code code; |
140 location_t location; | |
276 tree type; | 141 tree type; |
277 tree op0, op1, op2; | 142 tree op0, op1, op2; |
278 location_t location; | |
279 } *sepops; | 143 } *sepops; |
280 | 144 |
281 /* Functions from optabs.c, commonly used, and without need for the optabs | 145 /* Functions from optabs.c, commonly used, and without need for the optabs |
282 tables: */ | 146 tables: */ |
283 | 147 |
767 | 631 |
768 /* This enum is used for the following two functions. */ | 632 /* This enum is used for the following two functions. */ |
769 enum save_level {SAVE_BLOCK, SAVE_FUNCTION, SAVE_NONLOCAL}; | 633 enum save_level {SAVE_BLOCK, SAVE_FUNCTION, SAVE_NONLOCAL}; |
770 | 634 |
771 /* Save the stack pointer at the specified level. */ | 635 /* Save the stack pointer at the specified level. */ |
772 extern void emit_stack_save (enum save_level, rtx *, rtx); | 636 extern void emit_stack_save (enum save_level, rtx *); |
773 | 637 |
774 /* Restore the stack pointer from a save area of the specified level. */ | 638 /* Restore the stack pointer from a save area of the specified level. */ |
775 extern void emit_stack_restore (enum save_level, rtx, rtx); | 639 extern void emit_stack_restore (enum save_level, rtx); |
776 | 640 |
777 /* Invoke emit_stack_save for the nonlocal_goto_save_area. */ | 641 /* Invoke emit_stack_save for the nonlocal_goto_save_area. */ |
778 extern void update_nonlocal_goto_save_area (void); | 642 extern void update_nonlocal_goto_save_area (void); |
779 | 643 |
780 /* Allocate some space on the stack dynamically and return its address. An rtx | 644 /* Allocate some space on the stack dynamically and return its address. */ |
781 says how many bytes. */ | 645 extern rtx allocate_dynamic_stack_space (rtx, unsigned, unsigned, bool); |
782 extern rtx allocate_dynamic_stack_space (rtx, rtx, int); | 646 |
647 /* Emit one stack probe at ADDRESS, an address within the stack. */ | |
648 extern void emit_stack_probe (rtx); | |
783 | 649 |
784 /* Probe a range of stack addresses from FIRST to FIRST+SIZE, inclusive. | 650 /* Probe a range of stack addresses from FIRST to FIRST+SIZE, inclusive. |
785 FIRST is a constant and size is a Pmode RTX. These are offsets from | 651 FIRST is a constant and size is a Pmode RTX. These are offsets from |
786 the current stack pointer. STACK_GROWS_DOWNWARD says whether to add | 652 the current stack pointer. STACK_GROWS_DOWNWARD says whether to add |
787 or subtract them from the stack pointer. */ | 653 or subtract them from the stack pointer. */ |
800 mode_for_extraction (enum extraction_pattern, int); | 666 mode_for_extraction (enum extraction_pattern, int); |
801 | 667 |
802 extern void store_bit_field (rtx, unsigned HOST_WIDE_INT, | 668 extern void store_bit_field (rtx, unsigned HOST_WIDE_INT, |
803 unsigned HOST_WIDE_INT, enum machine_mode, rtx); | 669 unsigned HOST_WIDE_INT, enum machine_mode, rtx); |
804 extern rtx extract_bit_field (rtx, unsigned HOST_WIDE_INT, | 670 extern rtx extract_bit_field (rtx, unsigned HOST_WIDE_INT, |
805 unsigned HOST_WIDE_INT, int, rtx, | 671 unsigned HOST_WIDE_INT, int, bool, rtx, |
806 enum machine_mode, enum machine_mode); | 672 enum machine_mode, enum machine_mode); |
807 extern rtx extract_low_bits (enum machine_mode, enum machine_mode, rtx); | 673 extern rtx extract_low_bits (enum machine_mode, enum machine_mode, rtx); |
808 extern rtx expand_mult (enum machine_mode, rtx, rtx, rtx, int); | 674 extern rtx expand_mult (enum machine_mode, rtx, rtx, rtx, int); |
809 extern rtx expand_mult_highpart_adjust (enum machine_mode, rtx, rtx, rtx, rtx, int); | 675 extern rtx expand_mult_highpart_adjust (enum machine_mode, rtx, rtx, rtx, rtx, int); |
810 | 676 |
826 extern tree build_libfunc_function (const char *); | 692 extern tree build_libfunc_function (const char *); |
827 | 693 |
828 /* Get the personality libfunc for a function decl. */ | 694 /* Get the personality libfunc for a function decl. */ |
829 rtx get_personality_function (tree); | 695 rtx get_personality_function (tree); |
830 | 696 |
831 extern int vector_mode_valid_p (enum machine_mode); | |
832 | |
833 #endif /* GCC_EXPR_H */ | 697 #endif /* GCC_EXPR_H */ |