]> gcc.gnu.org Git - gcc.git/blame - gcc/rtl.h
* libjava.jacks/jacks.xfail: Updated to reflect reality.
[gcc.git] / gcc / rtl.h
CommitLineData
6f29feb1 1/* Register Transfer Language (RTL) definitions for GNU C-Compiler
af841dbd 2 Copyright (C) 1987, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
a0134312 3 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
6f29feb1 4
1322177d 5This file is part of GCC.
6f29feb1 6
1322177d
LB
7GCC is free software; you can redistribute it and/or modify it under
8the terms of the GNU General Public License as published by the Free
9Software Foundation; either version 2, or (at your option) any later
10version.
6f29feb1 11
1322177d
LB
12GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13WARRANTY; without even the implied warranty of MERCHANTABILITY or
14FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15for more details.
6f29feb1
JW
16
17You should have received a copy of the GNU General Public License
1322177d
LB
18along with GCC; see the file COPYING. If not, write to the Free
19Software Foundation, 59 Temple Place - Suite 330, Boston, MA
2002111-1307, USA. */
6f29feb1 21
88657302
RH
22#ifndef GCC_RTL_H
23#define GCC_RTL_H
6f29feb1 24
36edd3cc
BS
25struct function;
26
6f29feb1
JW
27#include "machmode.h"
28
29#undef FFS /* Some systems predefine this symbol; don't let it interfere. */
1cfc3092 30#undef FLOAT /* Likewise. */
ac889e46 31#undef ABS /* Likewise. */
71ae9cc6 32#undef PC /* Likewise. */
6f29feb1 33
173b24b9 34/* Value used by some passes to "recognize" noop moves as valid
eebedaa5 35 instructions. */
b5832b43
JH
36#define NOOP_MOVE_INSN_CODE INT_MAX
37
6f29feb1
JW
38/* Register Transfer Language EXPRESSIONS CODES */
39
40#define RTX_CODE enum rtx_code
41enum rtx_code {
42
43#define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS) ENUM ,
44#include "rtl.def" /* rtl expressions are documented here */
45#undef DEF_RTL_EXPR
46
6dc42e49 47 LAST_AND_UNUSED_RTX_CODE}; /* A convenient way to get a value for
6f29feb1 48 NUM_RTX_CODE.
6dc42e49 49 Assumes default enum value assignment. */
6f29feb1 50
cf403648 51#define NUM_RTX_CODE ((int) LAST_AND_UNUSED_RTX_CODE)
6f29feb1
JW
52 /* The cast here, saves many elsewhere. */
53
86460bab 54extern const unsigned char rtx_length[NUM_RTX_CODE];
0f41302f 55#define GET_RTX_LENGTH(CODE) (rtx_length[(int) (CODE)])
6f29feb1 56
86460bab 57extern const char * const rtx_name[NUM_RTX_CODE];
0f41302f 58#define GET_RTX_NAME(CODE) (rtx_name[(int) (CODE)])
6f29feb1 59
86460bab 60extern const char * const rtx_format[NUM_RTX_CODE];
0f41302f 61#define GET_RTX_FORMAT(CODE) (rtx_format[(int) (CODE)])
6f29feb1 62
86460bab 63extern const char rtx_class[NUM_RTX_CODE];
0f41302f 64#define GET_RTX_CLASS(CODE) (rtx_class[(int) (CODE)])
36a5eadd
GK
65
66extern const unsigned char rtx_next[NUM_RTX_CODE];
6f29feb1 67\f
33f7f353
JR
68/* The flags and bitfields of an ADDR_DIFF_VEC. BASE is the base label
69 relative to which the offsets are calculated, as explained in rtl.def. */
70typedef struct
71{
72 /* Set at the start of shorten_branches - ONLY WHEN OPTIMIZING - : */
73 unsigned min_align: 8;
74 /* Flags: */
75 unsigned base_after_vec: 1; /* BASE is after the ADDR_DIFF_VEC. */
173b24b9
RK
76 unsigned min_after_vec: 1; /* minimum address target label is
77 after the ADDR_DIFF_VEC. */
78 unsigned max_after_vec: 1; /* maximum address target label is
79 after the ADDR_DIFF_VEC. */
80 unsigned min_after_base: 1; /* minimum address target label is
81 after BASE. */
82 unsigned max_after_base: 1; /* maximum address target label is
83 after BASE. */
33f7f353
JR
84 /* Set by the actual branch shortening process - ONLY WHEN OPTIMIZING - : */
85 unsigned offset_unsigned: 1; /* offsets have to be treated as unsigned. */
86 unsigned : 2;
87 unsigned scale : 8;
88} addr_diff_vec_flags;
89
173b24b9
RK
90/* Structure used to describe the attributes of a MEM. These are hashed
91 so MEMs that the same attributes share a data structure. This means
92 they cannot be modified in place. If any element is nonzero, it means
93 the value of the corresponding attribute is unknown. */
184166b5
R
94/* ALIGN and SIZE are the alignment and size of the MEM itself,
95 while EXPR can describe a larger underlying object, which might have a
96 stricter alignment; OFFSET is the offset of the MEM within that object. */
e2500fed 97typedef struct mem_attrs GTY(())
173b24b9 98{
eebedaa5 99 HOST_WIDE_INT alias; /* Memory alias set. */
998d7deb 100 tree expr; /* expr corresponding to MEM. */
eebedaa5 101 rtx offset; /* Offset from start of DECL, as CONST_INT. */
173b24b9 102 rtx size; /* Size in bytes, as a CONST_INT. */
d022d93e 103 unsigned int align; /* Alignment of MEM in bits. */
173b24b9
RK
104} mem_attrs;
105
a560d4d4
JH
106/* Structure used to describe the attributes of a REG in similar way as
107 mem_attrs does for MEM above. */
108
109typedef struct reg_attrs GTY(())
110{
111 tree decl; /* decl corresponding to REG. */
112 HOST_WIDE_INT offset; /* Offset from start of DECL. */
113} reg_attrs;
114
6f29feb1
JW
115/* Common union for an element of an rtx. */
116
36a5eadd 117union rtunion_def
6f29feb1 118{
5f4f0e22 119 HOST_WIDE_INT rtwint;
6f29feb1 120 int rtint;
770ae6cc 121 unsigned int rtuint;
3cce094d 122 const char *rtstr;
2f78c311
ZW
123 rtx rtx;
124 rtvec rtvec;
6f29feb1 125 enum machine_mode rttype;
33f7f353 126 addr_diff_vec_flags rt_addr_diff_vec_flags;
eab5c70a 127 struct cselib_val_struct *rt_cselib;
0dfa1860 128 struct bitmap_head_def *rtbit;
2f78c311 129 tree rttree;
e881bb1b 130 struct basic_block_def *bb;
173b24b9 131 mem_attrs *rtmem;
a560d4d4 132 reg_attrs *rtreg;
36a5eadd
GK
133};
134typedef union rtunion_def rtunion;
6f29feb1
JW
135
136/* RTL expression ("rtx"). */
137
36a5eadd
GK
138struct rtx_def GTY((chain_next ("RTX_NEXT (&%h)"),
139 chain_prev ("RTX_PREV (&%h)")))
6f29feb1 140{
6f29feb1 141 /* The kind of expression this is. */
c149cc37 142 ENUM_BITFIELD(rtx_code) code: 16;
18def38f 143
6f29feb1 144 /* The kind of value the expression has. */
c149cc37
RL
145 ENUM_BITFIELD(machine_mode) mode : 8;
146
5a63e069
JJ
147 /* 1 in a MEM if we should keep the alias set for this mem unchanged
148 when we access a component.
149 1 in a CALL_INSN if it is a sibling call.
0dc36574
ZW
150 1 in a SET that is for a return.
151 In a CODE_LABEL, part of the two-bit alternate entry field. */
6f29feb1 152 unsigned int jump : 1;
0dc36574 153 /* In a CODE_LABEL, part of the two-bit alternate entry field. */
6f29feb1 154 unsigned int call : 1;
5a63e069
JJ
155 /* 1 in a REG, MEM, or CONCAT if the value is set at most once, anywhere.
156 1 in a SUBREG if it references an unsigned object whose mode has been
157 from a promoted to a wider mode.
6f29feb1
JW
158 1 in a SYMBOL_REF if it addresses something in the per-function
159 constants pool.
5a63e069 160 1 in a CALL_INSN, NOTE, or EXPR_LIST for a const or pure call.
7440af14 161 1 in a JUMP_INSN, CALL_INSN, or INSN of an annulling branch. */
6f29feb1 162 unsigned int unchanging : 1;
5a63e069
JJ
163 /* 1 in a MEM or ASM_OPERANDS expression if the memory reference is volatile.
164 1 in an INSN, CALL_INSN, JUMP_INSN, CODE_LABEL, BARRIER, or NOTE
165 if it has been deleted.
166 1 in a REG expression if corresponds to a variable declared by the user,
6f29feb1 167 0 for an internally generated temporary.
5a63e069
JJ
168 1 in a SUBREG with a negative value.
169 1 in a LABEL_REF or in a REG_LABEL note for a non-local label.
170 In a SYMBOL_REF, this flag is used for machine-specific purposes. */
6f29feb1 171 unsigned int volatil : 1;
8358a974 172 /* 1 in a MEM referring to a field of an aggregate.
6f29feb1
JW
173 0 if the MEM was a variable or the result of a * operator in C;
174 1 if it was the result of a . or -> operator (on a struct) in C.
175 1 in a REG if the register is used only in exit code a loop.
f590cca1 176 1 in a SUBREG expression if was generated from a variable with a
07be3989 177 promoted mode.
6f29feb1
JW
178 1 in a CODE_LABEL if the label is used for nonlocal gotos
179 and must not be deleted even if its count is zero.
180 1 in a LABEL_REF if this is a reference to a label outside the
181 current loop.
be202ec2
FS
182 1 in an INSN, JUMP_INSN or CALL_INSN if this insn must be scheduled
183 together with the preceding insn. Valid only within sched.
6f29feb1
JW
184 1 in an INSN, JUMP_INSN, or CALL_INSN if insn is in a delay slot and
185 from the target of a branch. Valid from reorg until end of compilation;
b53978a3 186 cleared before used.
ecd4a73b
JR
187 1 in an INSN, JUMP_INSN or CALL_INSN or related rtx if this insn is
188 dead code. Valid only during dead-code elimination phase; cleared
189 before use. */
6f29feb1 190 unsigned int in_struct : 1;
5a63e069
JJ
191 /* At the end of RTL generation, 1 if this rtx is used. This is used for
192 copying shared structure. See `unshare_all_rtl'.
f590cca1 193 In a REG, this is not needed for that purpose, and used instead
6f29feb1 194 in `leaf_renumber_regs_insn'.
5a63e069 195 1 in a SYMBOL_REF, means that emit_library_call
6f29feb1
JW
196 has used it as the function. */
197 unsigned int used : 1;
198 /* Nonzero if this rtx came from procedure integration.
084a1106 199 1 in a REG or PARALLEL means this rtx refers to the return value
ff0b6b99
FS
200 of the current function.
201 1 in a SYMBOL_REF if the symbol is weak. */
6f29feb1 202 unsigned integrated : 1;
b664de3a 203 /* 1 in an INSN or a SET if this rtx is related to the call frame,
c6df88cb 204 either changing how we compute the frame address or saving and
f590cca1 205 restoring registers in the prologue and epilogue.
c6df88cb 206 1 in a MEM if the MEM refers to a scalar, rather than a member of
bd7cf17e 207 an aggregate.
3502dc9c 208 1 in a REG if the register is a pointer.
bd7cf17e
JJ
209 1 in a SYMBOL_REF if it addresses something in the per-function
210 constant string pool. */
469ac993 211 unsigned frame_related : 1;
0a25f1f5 212
6f29feb1
JW
213 /* The first element of the operands of this rtx.
214 The number of operands and their types are controlled
215 by the `code' field, according to rtl.def. */
36a5eadd
GK
216 rtunion GTY ((special ("rtx_def"),
217 desc ("GET_CODE (&%0)"))) fld[1];
2f78c311 218};
6f29feb1
JW
219
220#define NULL_RTX (rtx) 0
221
36a5eadd
GK
222/* The "next" and "previous" RTX, relative to this one. */
223
224#define RTX_NEXT(X) (rtx_next[GET_CODE (X)] == 0 ? NULL \
225 : *(rtx *)(((char *)X) + rtx_next[GET_CODE (X)]))
226
227/* FIXME: the "NEXT_INSN (PREV_INSN (X)) == X" condition shouldn't be needed.
228 */
229#define RTX_PREV(X) ((GET_CODE (X) == INSN \
230 || GET_CODE (X) == CALL_INSN \
231 || GET_CODE (X) == JUMP_INSN \
232 || GET_CODE (X) == NOTE \
233 || GET_CODE (X) == BARRIER \
234 || GET_CODE (X) == CODE_LABEL) \
235 && PREV_INSN (X) != NULL \
236 && NEXT_INSN (PREV_INSN (X)) == X \
237 ? PREV_INSN (X) : NULL)
238
6f29feb1
JW
239/* Define macros to access the `code' field of the rtx. */
240
dbbbbf3b
JDA
241#define GET_CODE(RTX) ((enum rtx_code) (RTX)->code)
242#define PUT_CODE(RTX, CODE) ((RTX)->code = (ENUM_BITFIELD(rtx_code)) (CODE))
6f29feb1 243
dbbbbf3b
JDA
244#define GET_MODE(RTX) ((enum machine_mode) (RTX)->mode)
245#define PUT_MODE(RTX, MODE) ((RTX)->mode = (ENUM_BITFIELD(machine_mode)) (MODE))
6f29feb1 246
6f29feb1
JW
247/* RTL vector. These appear inside RTX's when there is a need
248 for a variable number of things. The principle use is inside
249 PARALLEL expressions. */
250
e2500fed 251struct rtvec_def GTY(()) {
e9a25f70 252 int num_elem; /* number of elements */
e2500fed 253 rtx GTY ((length ("%h.num_elem"))) elem[1];
2f78c311 254};
6f29feb1
JW
255
256#define NULL_RTVEC (rtvec) 0
257
258#define GET_NUM_ELEM(RTVEC) ((RTVEC)->num_elem)
e9a25f70 259#define PUT_NUM_ELEM(RTVEC, NUM) ((RTVEC)->num_elem = (NUM))
6f29feb1 260
b53978a3 261/* Predicate yielding nonzero iff X is an rtl for a register. */
6f29feb1
JW
262#define REG_P(X) (GET_CODE (X) == REG)
263
b53978a3
JO
264/* Predicate yielding nonzero iff X is a label insn. */
265#define LABEL_P(X) (GET_CODE (X) == CODE_LABEL)
266
267/* Predicate yielding nonzero iff X is a jump insn. */
268#define JUMP_P(X) (GET_CODE (X) == JUMP_INSN)
269
270/* Predicate yielding nonzero iff X is a note insn. */
271#define NOTE_P(X) (GET_CODE (X) == NOTE)
272
273/* Predicate yielding nonzero iff X is a barrier insn. */
274#define BARRIER_P(X) (GET_CODE (X) == BARRIER)
275
276/* Predicate yielding nonzero iff X is a data for a jump table. */
277#define JUMP_TABLE_DATA_P(INSN) \
278 (JUMP_P (INSN) && (GET_CODE (PATTERN (INSN)) == ADDR_VEC || \
279 GET_CODE (PATTERN (INSN)) == ADDR_DIFF_VEC))
280
6f29feb1
JW
281/* 1 if X is a constant value that is an integer. */
282
283#define CONSTANT_P(X) \
284 (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
285 || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST_DOUBLE \
ee5332b8 286 || GET_CODE (X) == CONST || GET_CODE (X) == HIGH \
69ef87e2 287 || GET_CODE (X) == CONST_VECTOR \
ee5332b8 288 || GET_CODE (X) == CONSTANT_P_RTX)
6f29feb1
JW
289
290/* General accessor macros for accessing the fields of an rtx. */
291
f4524c9e 292#if defined ENABLE_RTL_CHECKING && (GCC_VERSION >= 2007)
ef178af3
ZW
293/* The bit with a star outside the statement expr and an & inside is
294 so that N can be evaluated only once. */
8784fdcd 295#define RTL_CHECK1(RTX, N, C1) __extension__ \
d544bc39
KG
296(*({ rtx const _rtx = (RTX); const int _n = (N); \
297 const enum rtx_code _code = GET_CODE (_rtx); \
ef178af3 298 if (_n < 0 || _n >= GET_RTX_LENGTH (_code)) \
f52eda29
GS
299 rtl_check_failed_bounds (_rtx, _n, __FILE__, __LINE__, \
300 __FUNCTION__); \
ef178af3 301 if (GET_RTX_FORMAT(_code)[_n] != C1) \
f52eda29
GS
302 rtl_check_failed_type1 (_rtx, _n, C1, __FILE__, __LINE__, \
303 __FUNCTION__); \
ef178af3
ZW
304 &_rtx->fld[_n]; }))
305
8784fdcd 306#define RTL_CHECK2(RTX, N, C1, C2) __extension__ \
d544bc39
KG
307(*({ rtx const _rtx = (RTX); const int _n = (N); \
308 const enum rtx_code _code = GET_CODE (_rtx); \
ef178af3 309 if (_n < 0 || _n >= GET_RTX_LENGTH (_code)) \
f52eda29
GS
310 rtl_check_failed_bounds (_rtx, _n, __FILE__, __LINE__, \
311 __FUNCTION__); \
ef178af3
ZW
312 if (GET_RTX_FORMAT(_code)[_n] != C1 \
313 && GET_RTX_FORMAT(_code)[_n] != C2) \
314 rtl_check_failed_type2 (_rtx, _n, C1, C2, __FILE__, __LINE__, \
fbfc1192 315 __FUNCTION__); \
ef178af3
ZW
316 &_rtx->fld[_n]; }))
317
8784fdcd 318#define RTL_CHECKC1(RTX, N, C) __extension__ \
d544bc39 319(*({ rtx const _rtx = (RTX); const int _n = (N); \
f52eda29
GS
320 if (GET_CODE (_rtx) != (C)) \
321 rtl_check_failed_code1 (_rtx, (C), __FILE__, __LINE__, \
322 __FUNCTION__); \
83ab3839
RH
323 &_rtx->fld[_n]; }))
324
8784fdcd 325#define RTL_CHECKC2(RTX, N, C1, C2) __extension__ \
d544bc39
KG
326(*({ rtx const _rtx = (RTX); const int _n = (N); \
327 const enum rtx_code _code = GET_CODE (_rtx); \
f52eda29
GS
328 if (_code != (C1) && _code != (C2)) \
329 rtl_check_failed_code2 (_rtx, (C1), (C2), __FILE__, __LINE__, \
330 __FUNCTION__); \
83ab3839
RH
331 &_rtx->fld[_n]; }))
332
8784fdcd 333#define RTVEC_ELT(RTVEC, I) __extension__ \
d544bc39 334(*({ rtvec const _rtvec = (RTVEC); const int _i = (I); \
ef178af3
ZW
335 if (_i < 0 || _i >= GET_NUM_ELEM (_rtvec)) \
336 rtvec_check_failed_bounds (_rtvec, _i, __FILE__, __LINE__, \
fbfc1192 337 __FUNCTION__); \
ef178af3
ZW
338 &_rtvec->elem[_i]; }))
339
cdadb1dd 340extern void rtl_check_failed_bounds PARAMS ((rtx, int,
ef178af3
ZW
341 const char *, int, const char *))
342 ATTRIBUTE_NORETURN;
cdadb1dd 343extern void rtl_check_failed_type1 PARAMS ((rtx, int, int,
ef178af3
ZW
344 const char *, int, const char *))
345 ATTRIBUTE_NORETURN;
cdadb1dd 346extern void rtl_check_failed_type2 PARAMS ((rtx, int, int, int,
ef178af3
ZW
347 const char *, int, const char *))
348 ATTRIBUTE_NORETURN;
cdadb1dd 349extern void rtl_check_failed_code1 PARAMS ((rtx, enum rtx_code,
83ab3839
RH
350 const char *, int, const char *))
351 ATTRIBUTE_NORETURN;
cdadb1dd 352extern void rtl_check_failed_code2 PARAMS ((rtx, enum rtx_code, enum rtx_code,
83ab3839
RH
353 const char *, int, const char *))
354 ATTRIBUTE_NORETURN;
cdadb1dd 355extern void rtvec_check_failed_bounds PARAMS ((rtvec, int,
ef178af3
ZW
356 const char *, int, const char *))
357 ATTRIBUTE_NORETURN;
358
f4524c9e 359#else /* not ENABLE_RTL_CHECKING */
ef178af3 360
83ab3839
RH
361#define RTL_CHECK1(RTX, N, C1) ((RTX)->fld[N])
362#define RTL_CHECK2(RTX, N, C1, C2) ((RTX)->fld[N])
363#define RTL_CHECKC1(RTX, N, C) ((RTX)->fld[N])
818a3b15 364#define RTL_CHECKC2(RTX, N, C1, C2) ((RTX)->fld[N])
83ab3839 365#define RTVEC_ELT(RTVEC, I) ((RTVEC)->elem[I])
ef178af3
ZW
366
367#endif
368
5a63e069
JJ
369/* General accessor macros for accessing the flags of an rtx. */
370
371/* Access an individual rtx flag, with no checking of any kind. */
372#define RTX_FLAG(RTX, FLAG) ((RTX)->FLAG)
373
65212b66 374#if defined ENABLE_RTL_FLAG_CHECKING && (GCC_VERSION >= 2007)
2d4cc6a7 375#define RTL_FLAG_CHECK1(NAME, RTX, C1) __extension__ \
5a63e069
JJ
376({ rtx const _rtx = (RTX); \
377 if (GET_CODE(_rtx) != C1) \
2d4cc6a7
JJ
378 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
379 __FUNCTION__); \
5a63e069
JJ
380 _rtx; })
381
2d4cc6a7 382#define RTL_FLAG_CHECK2(NAME, RTX, C1, C2) __extension__ \
5a63e069
JJ
383({ rtx const _rtx = (RTX); \
384 if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2) \
2d4cc6a7
JJ
385 rtl_check_failed_flag (NAME,_rtx, __FILE__, __LINE__, \
386 __FUNCTION__); \
5a63e069
JJ
387 _rtx; })
388
2d4cc6a7 389#define RTL_FLAG_CHECK3(NAME, RTX, C1, C2, C3) __extension__ \
5a63e069
JJ
390({ rtx const _rtx = (RTX); \
391 if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
392 && GET_CODE(_rtx) != C3) \
2d4cc6a7
JJ
393 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
394 __FUNCTION__); \
5a63e069
JJ
395 _rtx; })
396
2d4cc6a7 397#define RTL_FLAG_CHECK4(NAME, RTX, C1, C2, C3, C4) __extension__ \
5a63e069
JJ
398({ rtx const _rtx = (RTX); \
399 if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
400 && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4) \
2d4cc6a7
JJ
401 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
402 __FUNCTION__); \
5a63e069
JJ
403 _rtx; })
404
2d4cc6a7 405#define RTL_FLAG_CHECK5(NAME, RTX, C1, C2, C3, C4, C5) __extension__ \
5a63e069
JJ
406({ rtx const _rtx = (RTX); \
407 if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
408 && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
409 && GET_CODE(_rtx) != C5) \
2d4cc6a7
JJ
410 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
411 __FUNCTION__); \
5a63e069
JJ
412 _rtx; })
413
2d4cc6a7
JJ
414#define RTL_FLAG_CHECK6(NAME, RTX, C1, C2, C3, C4, C5, C6) \
415 __extension__ \
5a63e069
JJ
416({ rtx const _rtx = (RTX); \
417 if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
418 && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
419 && GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6) \
2d4cc6a7
JJ
420 rtl_check_failed_flag (NAME,_rtx, __FILE__, __LINE__, \
421 __FUNCTION__); \
5a63e069
JJ
422 _rtx; })
423
2d4cc6a7
JJ
424#define RTL_FLAG_CHECK7(NAME, RTX, C1, C2, C3, C4, C5, C6, C7) \
425 __extension__ \
5a63e069
JJ
426({ rtx const _rtx = (RTX); \
427 if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
428 && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
429 && GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6 \
430 && GET_CODE(_rtx) != C7) \
2d4cc6a7
JJ
431 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
432 __FUNCTION__); \
5a63e069
JJ
433 _rtx; })
434
2d4cc6a7
JJ
435#define RTL_FLAG_CHECK8(NAME, RTX, C1, C2, C3, C4, C5, C6, C7, C8) \
436 __extension__ \
5a63e069
JJ
437({ rtx const _rtx = (RTX); \
438 if (GET_CODE(_rtx) != C1 && GET_CODE(_rtx) != C2 \
439 && GET_CODE(_rtx) != C3 && GET_CODE(_rtx) != C4 \
440 && GET_CODE(_rtx) != C5 && GET_CODE(_rtx) != C6 \
441 && GET_CODE(_rtx) != C7 && GET_CODE(_rtx) != C8) \
2d4cc6a7
JJ
442 rtl_check_failed_flag (NAME, _rtx, __FILE__, __LINE__, \
443 __FUNCTION__); \
5a63e069
JJ
444 _rtx; })
445
2d4cc6a7
JJ
446extern void rtl_check_failed_flag PARAMS ((const char *, rtx, const char *,
447 int, const char *))
5a63e069
JJ
448 ATTRIBUTE_NORETURN
449 ;
450
451#else /* not ENABLE_RTL_FLAG_CHECKING */
452
2d4cc6a7
JJ
453#define RTL_FLAG_CHECK1(NAME, RTX, C1) (RTX)
454#define RTL_FLAG_CHECK2(NAME, RTX, C1, C2) (RTX)
455#define RTL_FLAG_CHECK3(NAME, RTX, C1, C2, C3) (RTX)
456#define RTL_FLAG_CHECK4(NAME, RTX, C1, C2, C3, C4) (RTX)
457#define RTL_FLAG_CHECK5(NAME, RTX, C1, C2, C3, C4, C5) (RTX)
458#define RTL_FLAG_CHECK6(NAME, RTX, C1, C2, C3, C4, C5, C6) (RTX)
459#define RTL_FLAG_CHECK7(NAME, RTX, C1, C2, C3, C4, C5, C6, C7) (RTX)
460#define RTL_FLAG_CHECK8(NAME, RTX, C1, C2, C3, C4, C5, C6, C7, C8) (RTX)
5a63e069
JJ
461#endif
462
463#define CLEAR_RTX_FLAGS(RTX) \
464do { \
465 rtx const _rtx = (RTX); \
466 _rtx->call = 0; \
467 _rtx->frame_related = 0; \
468 _rtx->in_struct = 0; \
469 _rtx->integrated = 0; \
470 _rtx->jump = 0; \
471 _rtx->unchanging = 0; \
472 _rtx->used = 0; \
473 _rtx->volatil = 0; \
474} while (0)
475
f52eda29
GS
476#define XWINT(RTX, N) (RTL_CHECK1 (RTX, N, 'w').rtwint)
477#define XINT(RTX, N) (RTL_CHECK2 (RTX, N, 'i', 'n').rtint)
478#define XSTR(RTX, N) (RTL_CHECK2 (RTX, N, 's', 'S').rtstr)
479#define XEXP(RTX, N) (RTL_CHECK2 (RTX, N, 'e', 'u').rtx)
480#define XVEC(RTX, N) (RTL_CHECK2 (RTX, N, 'E', 'V').rtvec)
481#define XMODE(RTX, N) (RTL_CHECK1 (RTX, N, 'M').rttype)
482#define XBITMAP(RTX, N) (RTL_CHECK1 (RTX, N, 'b').rtbit)
483#define XTREE(RTX, N) (RTL_CHECK1 (RTX, N, 't').rttree)
484#define XBBDEF(RTX, N) (RTL_CHECK1 (RTX, N, 'B').bb)
485#define XTMPL(RTX, N) (RTL_CHECK1 (RTX, N, 'T').rtstr)
ef178af3
ZW
486
487#define XVECEXP(RTX, N, M) RTVEC_ELT (XVEC (RTX, N), M)
488#define XVECLEN(RTX, N) GET_NUM_ELEM (XVEC (RTX, N))
489
490/* These are like XWINT, etc. except that they expect a '0' field instead
491 of the normal type code. */
492
f52eda29
GS
493#define X0WINT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtwint)
494#define X0INT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtint)
495#define X0UINT(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtuint)
496#define X0STR(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtstr)
497#define X0EXP(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtx)
498#define X0VEC(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtvec)
499#define X0MODE(RTX, N) (RTL_CHECK1 (RTX, N, '0').rttype)
500#define X0BITMAP(RTX, N) (RTL_CHECK1 (RTX, N, '0').rtbit)
501#define X0TREE(RTX, N) (RTL_CHECK1 (RTX, N, '0').rttree)
502#define X0BBDEF(RTX, N) (RTL_CHECK1 (RTX, N, '0').bb)
503#define X0ADVFLAGS(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_addr_diff_vec_flags)
504#define X0CSELIB(RTX, N) (RTL_CHECK1 (RTX, N, '0').rt_cselib)
a560d4d4
JH
505#define X0MEMATTR(RTX, N) (RTL_CHECKC1 (RTX, N, MEM).rtmem)
506#define X0REGATTR(RTX, N) (RTL_CHECKC1 (RTX, N, REG).rtreg)
f52eda29
GS
507
508#define XCWINT(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtwint)
509#define XCINT(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtint)
510#define XCUINT(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtuint)
511#define XCSTR(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtstr)
512#define XCEXP(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtx)
513#define XCVEC(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtvec)
514#define XCMODE(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rttype)
515#define XCBITMAP(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rtbit)
516#define XCTREE(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rttree)
517#define XCBBDEF(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).bb)
518#define XCADVFLAGS(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_addr_diff_vec_flags)
519#define XCCSELIB(RTX, N, C) (RTL_CHECKC1 (RTX, N, C).rt_cselib)
83ab3839
RH
520
521#define XCVECEXP(RTX, N, M, C) RTVEC_ELT (XCVEC (RTX, N, C), M)
522#define XCVECLEN(RTX, N, C) GET_NUM_ELEM (XCVEC (RTX, N, C))
523
f52eda29 524#define XC2EXP(RTX, N, C1, C2) (RTL_CHECKC2 (RTX, N, C1, C2).rtx)
6f29feb1
JW
525\f
526/* ACCESS MACROS for particular fields of insns. */
527
4e872036
AS
528/* Determines whether X is an insn. */
529#define INSN_P(X) (GET_RTX_CLASS (GET_CODE(X)) == 'i')
530
6f29feb1
JW
531/* Holds a unique number for each insn.
532 These are not necessarily sequentially increasing. */
f52eda29 533#define INSN_UID(INSN) XINT (INSN, 0)
6f29feb1
JW
534
535/* Chain insns together in sequence. */
f52eda29
GS
536#define PREV_INSN(INSN) XEXP (INSN, 1)
537#define NEXT_INSN(INSN) XEXP (INSN, 2)
6f29feb1 538
ba4f7968
JH
539#define BLOCK_FOR_INSN(INSN) XBBDEF (INSN, 3)
540#define INSN_SCOPE(INSN) XTREE (INSN, 4)
6f29feb1 541/* The body of an insn. */
ba4f7968 542#define PATTERN(INSN) XEXP (INSN, 5)
6f29feb1
JW
543
544/* Code number of instruction, from when it was recognized.
545 -1 means this instruction has not been recognized yet. */
ba4f7968 546#define INSN_CODE(INSN) XINT (INSN, 6)
6f29feb1
JW
547
548/* Set up in flow.c; empty before then.
549 Holds a chain of INSN_LIST rtx's whose first operands point at
550 previous insns with direct data-flow connections to this one.
551 That means that those insns set variables whose next use is in this insn.
552 They are always in the same basic block as this insn. */
ba4f7968 553#define LOG_LINKS(INSN) XEXP(INSN, 7)
6f29feb1 554
2d4cc6a7
JJ
555#define RTX_INTEGRATED_P(RTX) \
556 (RTL_FLAG_CHECK8("RTX_INTEGRATED_P", (RTX), INSN, CALL_INSN, \
557 JUMP_INSN, INSN_LIST, BARRIER, CODE_LABEL, CONST, \
558 NOTE)->integrated)
559#define RTX_UNCHANGING_P(RTX) \
560 (RTL_FLAG_CHECK3("RTX_UNCHANGING_P", (RTX), REG, MEM, CONCAT)->unchanging)
561#define RTX_FRAME_RELATED_P(RTX) \
562 (RTL_FLAG_CHECK5("RTX_FRAME_RELATED_P", (RTX), INSN, CALL_INSN, \
563 JUMP_INSN, BARRIER, SET)->frame_related)
564
565/* 1 if RTX is an insn that has been deleted. */
566#define INSN_DELETED_P(RTX) \
567 (RTL_FLAG_CHECK6("INSN_DELETED_P", (RTX), INSN, CALL_INSN, JUMP_INSN, \
568 CODE_LABEL, BARRIER, NOTE)->volatil)
569
570/* 1 if RTX is a call to a const or pure function. */
571#define CONST_OR_PURE_CALL_P(RTX) \
572 (RTL_FLAG_CHECK3("CONST_OR_PURE_CALL_P", (RTX), CALL_INSN, NOTE, \
573 EXPR_LIST)->unchanging)
574
575/* 1 if RTX is a call_insn for a sibling call. */
576#define SIBLING_CALL_P(RTX) \
577 (RTL_FLAG_CHECK1("SIBLING_CALL_P", (RTX), CALL_INSN)->jump)
578
7440af14 579/* 1 if RTX is a jump_insn, call_insn, or insn that is an annulling branch. */
2d4cc6a7 580#define INSN_ANNULLED_BRANCH_P(RTX) \
7440af14 581 (RTL_FLAG_CHECK3("INSN_ANNULLED_BRANCH_P", (RTX), JUMP_INSN, CALL_INSN, INSN)->unchanging)
2d4cc6a7
JJ
582
583/* 1 if RTX is an insn that is dead code. Valid only for dead-code
584 elimination phase. */
585#define INSN_DEAD_CODE_P(RTX) \
ecd4a73b 586 (RTL_FLAG_CHECK3("INSN_DEAD_CODE_P", (RTX), INSN, CALL_INSN, JUMP_INSN)->in_struct)
2d4cc6a7
JJ
587
588/* 1 if RTX is an insn in a delay slot and is from the target of the branch.
589 If the branch insn has INSN_ANNULLED_BRANCH_P set, this insn should only be
6f29feb1
JW
590 executed if the branch is taken. For annulled branches with this bit
591 clear, the insn should be executed only if the branch is not taken. */
2d4cc6a7 592#define INSN_FROM_TARGET_P(RTX) \
cf40ea15 593 (RTL_FLAG_CHECK3("INSN_FROM_TARGET_P", (RTX), INSN, JUMP_INSN, CALL_INSN)->in_struct)
6f29feb1 594
f590cca1
RH
595#define ADDR_DIFF_VEC_FLAGS(RTX) X0ADVFLAGS(RTX, 4)
596
597#define CSELIB_VAL_PTR(RTX) X0CSELIB(RTX, 0)
598
6f29feb1 599/* Holds a list of notes on what this insn does to various REGs.
f590cca1
RH
600 It is a chain of EXPR_LIST rtx's, where the second operand is the
601 chain pointer and the first operand is the REG being described.
6f29feb1 602 The mode field of the EXPR_LIST contains not a real machine mode
f590cca1 603 but a value from enum reg_note. */
6f29feb1 604
ba4f7968 605#define REG_NOTES(INSN) XEXP(INSN, 8)
6f29feb1
JW
606
607/* Don't forget to change reg_note_name in rtl.c. */
f590cca1
RH
608enum reg_note
609{
610 /* The value in REG dies in this insn (i.e., it is not needed past
611 this insn). If REG is set in this insn, the REG_DEAD note may,
612 but need not, be omitted. */
613 REG_DEAD = 1,
614
615 /* The REG is autoincremented or autodecremented. */
616 REG_INC,
617
618 /* Describes the insn as a whole; it says that the insn sets a register
619 to a constant value or to be equivalent to a memory address. If the
620 register is spilled to the stack then the constant value should be
621 substituted for it. The contents of the REG_EQUIV is the constant
622 value or memory address, which may be different from the source of
623 the SET although it has the same value. A REG_EQUIV note may also
624 appear on an insn which copies a register parameter to a pseudo-register,
625 if there is a memory address which could be used to hold that
626 pseudo-register throughout the function. */
be1bb652 627 REG_EQUIV,
f590cca1
RH
628
629 /* Like REG_EQUIV except that the destination is only momentarily equal
630 to the specified rtx. Therefore, it cannot be used for substitution;
631 but it can be used for cse. */
632 REG_EQUAL,
633
634 /* The register set in this insn held 0 before the insn. The contents of
635 the note is the insn that stored the 0. If that insn is deleted or
636 patched to a NOTE, the REG_WAS_0 is inoperative. The REG_WAS_0 note
637 is actually an INSN_LIST, not an EXPR_LIST. */
638 REG_WAS_0,
639
640 /* This insn copies the return-value of a library call out of the hard reg
641 for return values. This note is actually an INSN_LIST and it points to
642 the first insn involved in setting up arguments for the call. flow.c
643 uses this to delete the entire library call when its result is dead. */
644 REG_RETVAL,
645
646 /* The inverse of REG_RETVAL: it goes on the first insn of the library call
be1bb652
RH
647 and points at the one that has the REG_RETVAL. This note is also an
648 INSN_LIST. */
f590cca1
RH
649 REG_LIBCALL,
650
651 /* The register is always nonnegative during the containing loop. This is
652 used in branches so that decrement and branch instructions terminating
653 on zero can be matched. There must be an insn pattern in the md file
654 named `decrement_and_branch_until_zero' or else this will never be added
655 to any instructions. */
656 REG_NONNEG,
657
658 /* There is no conflict *after this insn* between the register in the note
659 and the destination of this insn. */
660 REG_NO_CONFLICT,
661
662 /* Identifies a register set in this insn and never used. */
663 REG_UNUSED,
664
665 /* REG_CC_SETTER and REG_CC_USER link a pair of insns that set and use CC0,
666 respectively. Normally, these are required to be consecutive insns, but
667 we permit putting a cc0-setting insn in the delay slot of a branch as
668 long as only one copy of the insn exists. In that case, these notes
669 point from one to the other to allow code generation to determine what
be1bb652
RH
670 any require information and to properly update CC_STATUS. These notes
671 are INSN_LISTs. */
f590cca1
RH
672 REG_CC_SETTER, REG_CC_USER,
673
674 /* Points to a CODE_LABEL. Used by non-JUMP_INSNs to say that the
be1bb652
RH
675 CODE_LABEL contained in the REG_LABEL note is used by the insn.
676 This note is an INSN_LIST. */
f590cca1
RH
677 REG_LABEL,
678
679 /* REG_DEP_ANTI and REG_DEP_OUTPUT are used in LOG_LINKS to represent
680 write-after-read and write-after-write dependencies respectively.
681 Data dependencies, which are the only type of LOG_LINK created by
682 flow, are represented by a 0 reg note kind. */
683 REG_DEP_ANTI, REG_DEP_OUTPUT,
684
4db384c9
JH
685 /* REG_BR_PROB is attached to JUMP_INSNs and CALL_INSNs.
686 It has an integer value. For jumps, it is the probability that this is a
687 taken branch. For calls, it is the probability that this call won't
688 return. */
f590cca1
RH
689 REG_BR_PROB,
690
f590cca1
RH
691 /* Attached to a call insn; indicates that the call is malloc-like and
692 that the pointer returned cannot alias anything else. */
693 REG_NOALIAS,
694
695 /* Used to optimize rtl generated by dynamic stack allocations for targets
696 where SETJMP_VIA_SAVE_AREA is true. */
697 REG_SAVE_AREA,
698
4db384c9
JH
699 /* REG_BR_PRED is attached to JUMP_INSNs and CALL_INSNSs. It contains
700 CONCAT of two integer value. First specifies the branch predictor
701 that added the note, second specifies the predicted hitrate of branch
702 in the same format as REG_BR_PROB note uses. */
f590cca1
RH
703 REG_BR_PRED,
704
705 /* Attached to insns that are RTX_FRAME_RELATED_P, but are too complex
706 for DWARF to interpret what they imply. The attached rtx is used
707 instead of intuition. */
708 REG_FRAME_RELATED_EXPR,
709
710 /* Indicates that REG holds the exception context for the function.
711 This context is shared by inline functions, so the code to acquire
712 the real exception context is delayed until after inlining. */
713 REG_EH_CONTEXT,
714
715 /* Indicates what exception region an INSN belongs in. This is used to
716 indicate what region to which a call may throw. REGION 0 indicates
717 that a call cannot throw at all. REGION -1 indicates that it cannot
718 throw, nor will it execute a non-local goto. */
719 REG_EH_REGION,
720
f590cca1 721 /* Used by haifa-sched to save NOTE_INSN notes across scheduling. */
8cd8f856
GK
722 REG_SAVE_NOTE,
723
724 /* Indicates that this insn (which is part of the prologue) computes
725 a value which might not be used later, and if so it's OK to delete
726 the insn. Normally, deleting any insn in the prologue is an error.
727 At present the parameter is unused and set to (const_int 0). */
ca3920ad
JW
728 REG_MAYBE_DEAD,
729
730 /* Indicates that a call does not return. */
4b01bd16
RH
731 REG_NORETURN,
732
733 /* Indicates that an indirect jump is a non-local goto instead of a
734 computed goto. */
570a98eb
JH
735 REG_NON_LOCAL_GOTO,
736
737 /* This kind of note is generated at each to `setjmp',
738 and similar functions that can return twice. */
9d98f8f9
JH
739 REG_SETJMP,
740
741 /* Indicate calls that always returns. */
4a8d0c9c
RH
742 REG_ALWAYS_RETURN,
743
744 /* Indicate that the memory load references a vtable. The expression
745 is of the form (plus (symbol_ref vtable_sym) (const_int offset)). */
746 REG_VTABLE_REF
f590cca1
RH
747};
748
7ae21caf
DE
749/* The base value for branch probability notes. */
750#define REG_BR_PROB_BASE 10000
6f29feb1
JW
751
752/* Define macros to extract and insert the reg-note kind in an EXPR_LIST. */
753#define REG_NOTE_KIND(LINK) ((enum reg_note) GET_MODE (LINK))
f52eda29
GS
754#define PUT_REG_NOTE_KIND(LINK, KIND) \
755 PUT_MODE (LINK, (enum machine_mode) (KIND))
6f29feb1
JW
756
757/* Names for REG_NOTE's in EXPR_LIST insn's. */
758
1f9a015e 759extern const char * const reg_note_name[];
0f41302f 760#define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int) (MODE)])
6f29feb1 761
e51c6661
RK
762/* This field is only present on CALL_INSNs. It holds a chain of EXPR_LIST of
763 USE and CLOBBER expressions.
764 USE expressions list the registers filled with arguments that
765 are passed to the function.
766 CLOBBER expressions document the registers explicitly clobbered
767 by this CALL_INSN.
768 Pseudo registers can not be mentioned in this list. */
ba4f7968 769#define CALL_INSN_FUNCTION_USAGE(INSN) XEXP(INSN, 9)
e51c6661 770
6f29feb1
JW
771/* The label-number of a code-label. The assembler label
772 is made from `L' and the label-number printed in decimal.
773 Label numbers are unique in a compilation. */
ba4f7968 774#define CODE_LABEL_NUMBER(INSN) XINT (INSN, 6)
6f29feb1
JW
775
776#define LINE_NUMBER NOTE
777
0dfa1860
MM
778/* In a NOTE that is a line number, this is a string for the file name that the
779 line is in. We use the same field to record block numbers temporarily in
780 NOTE_INSN_BLOCK_BEG and NOTE_INSN_BLOCK_END notes. (We avoid lots of casts
781 between ints and pointers if we use a different macro for the block number.)
63f4a88e 782 */
6f29feb1 783
ba4f7968
JH
784#define NOTE_SOURCE_FILE(INSN) XCSTR (INSN, 4, NOTE)
785#define NOTE_BLOCK(INSN) XCTREE (INSN, 4, NOTE)
786#define NOTE_EH_HANDLER(INSN) XCINT (INSN, 4, NOTE)
ba4f7968
JH
787#define NOTE_BASIC_BLOCK(INSN) XCBBDEF (INSN, 4, NOTE)
788#define NOTE_EXPECTED_VALUE(INSN) XCEXP (INSN, 4, NOTE)
789#define NOTE_PREDICTION(INSN) XCINT (INSN, 4, NOTE)
dad482e6 790#define NOTE_PRECONDITIONED(INSN) XCINT (INSN, 4, NOTE)
0dfa1860 791
6f29feb1
JW
792/* In a NOTE that is a line number, this is the line number.
793 Other kinds of NOTEs are identified by negative numbers here. */
ba4f7968 794#define NOTE_LINE_NUMBER(INSN) XCINT (INSN, 5, NOTE)
6f29feb1 795
589ca5cb
MM
796/* Nonzero if INSN is a note marking the beginning of a basic block. */
797#define NOTE_INSN_BASIC_BLOCK_P(INSN) \
798 (GET_CODE (INSN) == NOTE \
799 && NOTE_LINE_NUMBER (INSN) == NOTE_INSN_BASIC_BLOCK)
800
969d70ca 801/* Algorithm and flags for prediction. */
ba4f7968
JH
802#define NOTE_PREDICTION_ALG(INSN) (XCINT(INSN, 4, NOTE)>>8)
803#define NOTE_PREDICTION_FLAGS(INSN) (XCINT(INSN, 4, NOTE)&0xff)
969d70ca
JH
804#define NOTE_PREDICT(ALG,FLAGS) ((ALG<<8)+(FLAGS))
805
6f29feb1 806/* Codes that appear in the NOTE_LINE_NUMBER field
a31efb86 807 for kinds of notes that are not line numbers.
6f29feb1 808
a31efb86
DE
809 Notice that we do not try to use zero here for any of
810 the special note codes because sometimes the source line
811 actually can be zero! This happens (for example) when we
812 are generating code for the per-translation-unit constructor
813 and destructor routines for some C++ translation unit.
814
815 If you should change any of the following values, or if you
816 should add a new value here, don't forget to change the
817 note_insn_name array in rtl.c. */
6f29feb1 818
d636c18c
RH
819enum insn_note
820{
821 /* Keep all of these numbers negative. Adjust as needed. */
822 NOTE_INSN_BIAS = -100,
823
824 /* This note is used to get rid of an insn
825 when it isn't safe to patch the insn out of the chain. */
826 NOTE_INSN_DELETED,
827
828 /* These are used to mark the beginning and end of a lexical block.
829 See NOTE_BLOCK, identify_blocks and reorder_blocks. */
830 NOTE_INSN_BLOCK_BEG,
831 NOTE_INSN_BLOCK_END,
832
833 /* These mark the extremes of a loop. */
834 NOTE_INSN_LOOP_BEG,
835 NOTE_INSN_LOOP_END,
836
837 /* Generated at the place in a loop that `continue' jumps to. */
838 NOTE_INSN_LOOP_CONT,
839 /* Generated at the start of a duplicated exit test. */
840 NOTE_INSN_LOOP_VTOP,
841
e803a64b
RH
842 /* Generated at the end of a conditional at the top of the loop.
843 This is used to perform a lame form of loop rotation in lieu
844 of actually understanding the loop structure. The note is
845 discarded after rotation is complete. */
846 NOTE_INSN_LOOP_END_TOP_COND,
847
d636c18c
RH
848 /* This kind of note is generated at the end of the function body,
849 just before the return insn or return label. In an optimizing
850 compilation it is deleted by the first jump optimization, after
851 enabling that optimizer to determine whether control can fall
852 off the end of the function body without a return statement. */
853 NOTE_INSN_FUNCTION_END,
854
d636c18c
RH
855 /* This marks the point immediately after the last prologue insn. */
856 NOTE_INSN_PROLOGUE_END,
857
858 /* This marks the point immediately prior to the first epilogue insn. */
859 NOTE_INSN_EPILOGUE_BEG,
860
861 /* Generated in place of user-declared labels when they are deleted. */
862 NOTE_INSN_DELETED_LABEL,
863
864 /* This note indicates the start of the real body of the function,
865 i.e. the point just after all of the parms have been moved into
866 their homes, etc. */
867 NOTE_INSN_FUNCTION_BEG,
868
869 /* These note where exception handling regions begin and end.
870 Uses NOTE_EH_HANDLER to identify the region in question. */
871 NOTE_INSN_EH_REGION_BEG,
872 NOTE_INSN_EH_REGION_END,
873
874 /* Generated whenever a duplicate line number note is output. For example,
875 one is output after the end of an inline function, in order to prevent
eebedaa5 876 the line containing the inline call from being counted twice in gcov. */
b3b42a4d 877 NOTE_INSN_REPEATED_LINE_NUMBER,
d636c18c 878
eebedaa5 879 /* Record the struct for the following basic block. Uses NOTE_BASIC_BLOCK. */
d636c18c
RH
880 NOTE_INSN_BASIC_BLOCK,
881
994a57cd
RH
882 /* Record the expected value of a register at a location. Uses
883 NOTE_EXPECTED_VALUE; stored as (eq (reg) (const_int)). */
884 NOTE_INSN_EXPECTED_VALUE,
885
4b7e68e7 886 /* Record a prediction. Uses NOTE_PREDICTION. */
969d70ca
JH
887 NOTE_INSN_PREDICTION,
888
d636c18c
RH
889 NOTE_INSN_MAX
890};
10f07067 891
6f29feb1
JW
892/* Names for NOTE insn's other than line numbers. */
893
d636c18c
RH
894extern const char * const note_insn_name[NOTE_INSN_MAX - NOTE_INSN_BIAS];
895#define GET_NOTE_INSN_NAME(NOTE_CODE) \
dbbbbf3b 896 (note_insn_name[(NOTE_CODE) - (int) NOTE_INSN_BIAS])
6f29feb1
JW
897
898/* The name of a label, in case it corresponds to an explicit label
899 in the input source code. */
ba4f7968 900#define LABEL_NAME(RTX) XCSTR (RTX, 7, CODE_LABEL)
6f29feb1
JW
901
902/* In jump.c, each label contains a count of the number
903 of LABEL_REFs that point at it, so unused labels can be deleted. */
ba4f7968 904#define LABEL_NUSES(RTX) XCINT (RTX, 4, CODE_LABEL)
6f29feb1 905
0dc36574
ZW
906/* Labels carry a two-bit field composed of the ->jump and ->call
907 bits. This field indicates whether the label is an alternate
908 entry point, and if so, what kind. */
909enum label_kind
910{
911 LABEL_NORMAL = 0, /* ordinary label */
912 LABEL_STATIC_ENTRY, /* alternate entry point, not exported */
913 LABEL_GLOBAL_ENTRY, /* alternate entry point, exported */
914 LABEL_WEAK_ENTRY /* alternate entry point, exported as weak symbol */
915};
916
917#if defined ENABLE_RTL_FLAG_CHECKING && (GCC_VERSION > 2007)
918
919/* Retrieve the kind of LABEL. */
920#define LABEL_KIND(LABEL) __extension__ \
921({ rtx const _label = (LABEL); \
922 if (GET_CODE (_label) != CODE_LABEL) \
923 rtl_check_failed_flag ("LABEL_KIND", _label, __FILE__, __LINE__, \
924 __FUNCTION__); \
925 (enum label_kind) ((_label->jump << 1) | _label->call); })
926
927/* Set the kind of LABEL. */
928#define SET_LABEL_KIND(LABEL, KIND) do { \
929 rtx _label = (LABEL); \
930 unsigned int _kind = (KIND); \
931 if (GET_CODE (_label) != CODE_LABEL) \
932 rtl_check_failed_flag ("SET_LABEL_KIND", _label, __FILE__, __LINE__, \
933 __FUNCTION__); \
934 _label->jump = ((_kind >> 1) & 1); \
935 _label->call = (_kind & 1); \
936} while (0)
937
938#else
939
940/* Retrieve the kind of LABEL. */
941#define LABEL_KIND(LABEL) \
942 ((enum label_kind) (((LABEL)->jump << 1) | (LABEL)->call))
943
944/* Set the kind of LABEL. */
945#define SET_LABEL_KIND(LABEL, KIND) do { \
946 rtx _label = (LABEL); \
947 unsigned int _kind = (KIND); \
948 _label->jump = ((_kind >> 1) & 1); \
949 _label->call = (_kind & 1); \
950} while (0)
951
952#endif /* rtl flag checking */
953
954#define LABEL_ALT_ENTRY_P(LABEL) (LABEL_KIND (LABEL) != LABEL_NORMAL)
8cd0faaf 955
e9a25f70 956/* The original regno this ADDRESSOF was built for. */
f52eda29 957#define ADDRESSOF_REGNO(RTX) XCUINT (RTX, 1, ADDRESSOF)
e9a25f70
JL
958
959/* The variable in the register we took the address of. */
f52eda29 960#define ADDRESSOF_DECL(RTX) XCTREE (RTX, 2, ADDRESSOF)
e9a25f70 961
6f29feb1
JW
962/* In jump.c, each JUMP_INSN can point to a label that it can jump to,
963 so that if the JUMP_INSN is deleted, the label's LABEL_NUSES can
964 be decremented and possibly the label can be deleted. */
ba4f7968 965#define JUMP_LABEL(INSN) XCEXP (INSN, 9, JUMP_INSN)
6f29feb1
JW
966
967/* Once basic blocks are found in flow.c,
968 each CODE_LABEL starts a chain that goes through
969 all the LABEL_REFs that jump to that label.
be1bb652 970 The chain eventually winds up at the CODE_LABEL: it is circular. */
ba4f7968 971#define LABEL_REFS(LABEL) XCEXP (LABEL, 5, CODE_LABEL)
6f29feb1
JW
972\f
973/* This is the field in the LABEL_REF through which the circular chain
974 of references to a particular label is linked.
975 This chain is set up in flow.c. */
976
f52eda29 977#define LABEL_NEXTREF(REF) XCEXP (REF, 1, LABEL_REF)
6f29feb1
JW
978
979/* Once basic blocks are found in flow.c,
980 Each LABEL_REF points to its containing instruction with this field. */
981
f52eda29 982#define CONTAINING_INSN(RTX) XCEXP (RTX, 2, LABEL_REF)
6f29feb1 983
08394eef
BS
984/* For a REG rtx, REGNO extracts the register number. ORIGINAL_REGNO holds
985 the number the register originally had; for a pseudo register turned into
986 a hard reg this will hold the old pseudo register number. */
6f29feb1 987
f52eda29
GS
988#define REGNO(RTX) XCUINT (RTX, 0, REG)
989#define ORIGINAL_REGNO(RTX) X0UINT (RTX, 1)
6f29feb1 990
084a1106
JDA
991/* 1 if RTX is a reg or parallel that is the current function's return
992 value. */
2d4cc6a7 993#define REG_FUNCTION_VALUE_P(RTX) \
084a1106 994 (RTL_FLAG_CHECK2("REG_FUNCTION_VALUE_P", (RTX), REG, PARALLEL)->integrated)
6f29feb1 995
2d4cc6a7
JJ
996/* 1 if RTX is a reg that corresponds to a variable declared by the user. */
997#define REG_USERVAR_P(RTX) \
998 (RTL_FLAG_CHECK1("REG_USERVAR_P", (RTX), REG)->volatil)
6f29feb1 999
2d4cc6a7
JJ
1000/* 1 if RTX is a reg that holds a pointer value. */
1001#define REG_POINTER(RTX) \
1002 (RTL_FLAG_CHECK1("REG_POINTER", (RTX), REG)->frame_related)
3502dc9c 1003
cdbca172
JO
1004/* 1 if the given register REG corresponds to a hard register. */
1005#define HARD_REGISTER_P(REG) (HARD_REGISTER_NUM_P (REGNO (REG)))
1006
1007/* 1 if the given register number REG_NO corresponds to a hard register. */
f52eda29 1008#define HARD_REGISTER_NUM_P(REG_NO) ((REG_NO) < FIRST_PSEUDO_REGISTER)
cdbca172 1009
6f29feb1
JW
1010/* For a CONST_INT rtx, INTVAL extracts the integer. */
1011
83ab3839 1012#define INTVAL(RTX) XCWINT(RTX, 0, CONST_INT)
6f29feb1 1013
a36556a8 1014/* For a CONST_DOUBLE:
46b33600
RH
1015 For a DImode, there are two integers CONST_DOUBLE_LOW is the
1016 low-order word and ..._HIGH the high-order.
1017 For a float, there is a REAL_VALUE_TYPE structure, and
1018 CONST_DOUBLE_REAL_VALUE(r) is a pointer to it. */
5692c7bc
ZW
1019#define CONST_DOUBLE_LOW(r) XCWINT (r, 0, CONST_DOUBLE)
1020#define CONST_DOUBLE_HIGH(r) XCWINT (r, 1, CONST_DOUBLE)
46b33600 1021#define CONST_DOUBLE_REAL_VALUE(r) ((struct real_value *)&CONST_DOUBLE_LOW(r))
a36556a8 1022
69ef87e2
AH
1023/* For a CONST_VECTOR, return element #n. */
1024#define CONST_VECTOR_ELT(RTX, N) XCVECEXP (RTX, 0, N, CONST_VECTOR)
1025
1026/* For a CONST_VECTOR, return the number of elements in a vector. */
1027#define CONST_VECTOR_NUNITS(RTX) XCVECLEN (RTX, 0, CONST_VECTOR)
1028
6f29feb1 1029/* For a SUBREG rtx, SUBREG_REG extracts the value we want a subreg of.
ddef6bc7 1030 SUBREG_BYTE extracts the byte-number. */
6f29feb1 1031
f52eda29
GS
1032#define SUBREG_REG(RTX) XCEXP (RTX, 0, SUBREG)
1033#define SUBREG_BYTE(RTX) XCUINT (RTX, 1, SUBREG)
ddef6bc7
JJ
1034
1035/* in rtlanal.c */
33aceff2 1036extern unsigned int subreg_lsb PARAMS ((rtx));
ddef6bc7
JJ
1037extern unsigned int subreg_regno_offset PARAMS ((unsigned int,
1038 enum machine_mode,
1039 unsigned int,
1040 enum machine_mode));
1041extern unsigned int subreg_regno PARAMS ((rtx));
6f29feb1 1042
2d4cc6a7
JJ
1043/* 1 if RTX is a subreg containing a reg that is already known to be
1044 sign- or zero-extended from the mode of the subreg to the mode of
07be3989 1045 the reg. SUBREG_PROMOTED_UNSIGNED_P gives the signedness of the
f590cca1 1046 extension.
07be3989
RK
1047
1048 When used as a LHS, is means that this extension must be done
1049 when assigning to SUBREG_REG. */
1050
2d4cc6a7
JJ
1051#define SUBREG_PROMOTED_VAR_P(RTX) \
1052 (RTL_FLAG_CHECK1("SUBREG_PROMOTED", (RTX), SUBREG)->in_struct)
1053
1054#define SUBREG_PROMOTED_UNSIGNED_SET(RTX, VAL) \
1055do { \
b0ad77d5 1056 rtx const _rtx = RTL_FLAG_CHECK1("SUBREG_PROMOTED_UNSIGNED_SET", (RTX), SUBREG); \
2d4cc6a7 1057 if ((VAL) < 0) \
b0ad77d5 1058 _rtx->volatil = 1; \
2d4cc6a7 1059 else { \
b0ad77d5
KG
1060 _rtx->volatil = 0; \
1061 _rtx->unchanging = (VAL); \
2d4cc6a7 1062 } \
7879b81e 1063} while (0)
5a63e069 1064#define SUBREG_PROMOTED_UNSIGNED_P(RTX) \
2d4cc6a7
JJ
1065 ((RTL_FLAG_CHECK1("SUBREG_PROMOTED_UNSIGNED_P", (RTX), SUBREG)->volatil) \
1066 ? -1 : (RTX)->unchanging)
07be3989 1067
6f29feb1
JW
1068/* Access various components of an ASM_OPERANDS rtx. */
1069
f52eda29
GS
1070#define ASM_OPERANDS_TEMPLATE(RTX) XCSTR (RTX, 0, ASM_OPERANDS)
1071#define ASM_OPERANDS_OUTPUT_CONSTRAINT(RTX) XCSTR (RTX, 1, ASM_OPERANDS)
1072#define ASM_OPERANDS_OUTPUT_IDX(RTX) XCINT (RTX, 2, ASM_OPERANDS)
1073#define ASM_OPERANDS_INPUT_VEC(RTX) XCVEC (RTX, 3, ASM_OPERANDS)
1074#define ASM_OPERANDS_INPUT_CONSTRAINT_VEC(RTX) XCVEC (RTX, 4, ASM_OPERANDS)
1075#define ASM_OPERANDS_INPUT(RTX, N) XCVECEXP (RTX, 3, N, ASM_OPERANDS)
1076#define ASM_OPERANDS_INPUT_LENGTH(RTX) XCVECLEN (RTX, 3, ASM_OPERANDS)
6462bb43 1077#define ASM_OPERANDS_INPUT_CONSTRAINT_EXP(RTX, N) \
f52eda29 1078 XCVECEXP (RTX, 4, N, ASM_OPERANDS)
3bdf5ad1 1079#define ASM_OPERANDS_INPUT_CONSTRAINT(RTX, N) \
f52eda29 1080 XSTR (XCVECEXP (RTX, 4, N, ASM_OPERANDS), 0)
3bdf5ad1 1081#define ASM_OPERANDS_INPUT_MODE(RTX, N) \
f52eda29
GS
1082 GET_MODE (XCVECEXP (RTX, 4, N, ASM_OPERANDS))
1083#define ASM_OPERANDS_SOURCE_FILE(RTX) XCSTR (RTX, 5, ASM_OPERANDS)
1084#define ASM_OPERANDS_SOURCE_LINE(RTX) XCINT (RTX, 6, ASM_OPERANDS)
6f29feb1 1085
2d4cc6a7 1086/* 1 if RTX is a mem and we should keep the alias set for this mem
10b76d73
RK
1087 unchanged when we access a component. Set to 1, or example, when we
1088 are already in a non-addressable component of an aggregate. */
2d4cc6a7
JJ
1089#define MEM_KEEP_ALIAS_SET_P(RTX) \
1090 (RTL_FLAG_CHECK1("MEM_KEEP_ALIAS_SET_P", (RTX), MEM)->jump)
10b76d73 1091
2d4cc6a7
JJ
1092/* 1 if RTX is a mem or asm_operand for a volatile reference. */
1093#define MEM_VOLATILE_P(RTX) \
1094 (RTL_FLAG_CHECK3("MEM_VOLATILE_P", (RTX), MEM, ASM_OPERANDS, \
1095 ASM_INPUT)->volatil)
6f29feb1 1096
2d4cc6a7 1097/* 1 if RTX is a mem that refers to an aggregate, either to the
3bdf5ad1 1098 aggregate itself of to a field of the aggregate. If zero, RTX may
4eb00163 1099 or may not be such a reference. */
2d4cc6a7
JJ
1100#define MEM_IN_STRUCT_P(RTX) \
1101 (RTL_FLAG_CHECK1("MEM_IN_STRUCT_P", (RTX), MEM)->in_struct)
6f29feb1 1102
2d4cc6a7 1103/* 1 if RTX is a mem that refers to a scalar. If zero, RTX may or may
3ef42a0c 1104 not refer to a scalar. */
2d4cc6a7
JJ
1105#define MEM_SCALAR_P(RTX) \
1106 (RTL_FLAG_CHECK1("MEM_SCALAR_P", (RTX), MEM)->frame_related)
c6df88cb 1107
40f03658 1108/* If VAL is nonzero, set MEM_IN_STRUCT_P and clear MEM_SCALAR_P in
c6df88cb
MM
1109 RTX. Otherwise, vice versa. Use this macro only when you are
1110 *sure* that you know that the MEM is in a structure, or is a
1111 scalar. VAL is evaluated only once. */
f52eda29
GS
1112#define MEM_SET_IN_STRUCT_P(RTX, VAL) \
1113do { \
f9e158c3
JM
1114 if (VAL) \
1115 { \
1116 MEM_IN_STRUCT_P (RTX) = 1; \
1117 MEM_SCALAR_P (RTX) = 0; \
1118 } \
1119 else \
1120 { \
1121 MEM_IN_STRUCT_P (RTX) = 0; \
1122 MEM_SCALAR_P (RTX) = 1; \
1123 } \
1124} while (0)
c6df88cb 1125
173b24b9
RK
1126/* The memory attribute block. We provide access macros for each value
1127 in the block and provide defaults if none specified. */
1128#define MEM_ATTRS(RTX) X0MEMATTR (RTX, 1)
1129
a560d4d4
JH
1130/* The register attribute block. We provide access macros for each value
1131 in the block and provide defaults if none specified. */
1132#define REG_ATTRS(RTX) X0REGATTR (RTX, 2)
1133
41472af8
MM
1134/* For a MEM rtx, the alias set. If 0, this MEM is not in any alias
1135 set, and may alias anything. Otherwise, the MEM can only alias
1136 MEMs in the same alias set. This value is set in a
1137 language-dependent manner in the front-end, and should not be
1138 altered in the back-end. These set numbers are tested for zero,
1139 and compared for equality; they have no other significance. In
1140 some front-ends, these numbers may correspond in some way to types,
1141 or other language-level entities, but they need not, and the
1142 back-end makes no such assumptions. */
173b24b9
RK
1143#define MEM_ALIAS_SET(RTX) (MEM_ATTRS (RTX) == 0 ? 0 : MEM_ATTRS (RTX)->alias)
1144
1145/* For a MEM rtx, the decl it is known to refer to, if it is known to
998d7deb
RH
1146 refer to part of a DECL. It may also be a COMPONENT_REF. */
1147#define MEM_EXPR(RTX) (MEM_ATTRS (RTX) == 0 ? 0 : MEM_ATTRS (RTX)->expr)
173b24b9 1148
998d7deb 1149/* For a MEM rtx, the offset from the start of MEM_EXPR, if known, as a
173b24b9
RK
1150 RTX that is always a CONST_INT. */
1151#define MEM_OFFSET(RTX) (MEM_ATTRS (RTX) == 0 ? 0 : MEM_ATTRS (RTX)->offset)
1152
1153/* For a MEM rtx, the size in bytes of the MEM, if known, as an RTX that
1154 is always a CONST_INT. */
10b76d73
RK
1155#define MEM_SIZE(RTX) \
1156(MEM_ATTRS (RTX) != 0 ? MEM_ATTRS (RTX)->size \
1157 : GET_MODE (RTX) != BLKmode ? GEN_INT (GET_MODE_SIZE (GET_MODE (RTX))) \
1158 : 0)
173b24b9 1159
917afb0c
RK
1160/* For a MEM rtx, the alignment in bits. We can use the alignment of the
1161 mode as a default when STRICT_ALIGNMENT, but not if not. */
8ac61af7
RK
1162#define MEM_ALIGN(RTX) \
1163(MEM_ATTRS (RTX) != 0 ? MEM_ATTRS (RTX)->align \
917afb0c
RK
1164 : (STRICT_ALIGNMENT && GET_MODE (RTX) != BLKmode \
1165 ? GET_MODE_ALIGNMENT (GET_MODE (RTX)) : BITS_PER_UNIT))
3bdf5ad1 1166
a560d4d4
JH
1167/* For a REG rtx, the decl it is known to refer to, if it is known to
1168 refer to part of a DECL. */
1169#define REG_EXPR(RTX) (REG_ATTRS (RTX) == 0 ? 0 : REG_ATTRS (RTX)->decl)
1170
1171/* For a MEM rtx, the offset from the start of MEM_DECL, if known, as a
1172 RTX that is always a CONST_INT. */
1173#define REG_OFFSET(RTX) (REG_ATTRS (RTX) == 0 ? 0 : REG_ATTRS (RTX)->offset)
1174
3bdf5ad1 1175/* Copy the attributes that apply to memory locations from RHS to LHS. */
10b76d73
RK
1176#define MEM_COPY_ATTRIBUTES(LHS, RHS) \
1177 (MEM_VOLATILE_P (LHS) = MEM_VOLATILE_P (RHS), \
1178 MEM_IN_STRUCT_P (LHS) = MEM_IN_STRUCT_P (RHS), \
1179 MEM_SCALAR_P (LHS) = MEM_SCALAR_P (RHS), \
1180 RTX_UNCHANGING_P (LHS) = RTX_UNCHANGING_P (RHS), \
1181 MEM_KEEP_ALIAS_SET_P (LHS) = MEM_KEEP_ALIAS_SET_P (RHS), \
173b24b9 1182 MEM_ATTRS (LHS) = MEM_ATTRS (RHS))
41472af8 1183
2d4cc6a7
JJ
1184/* 1 if RTX is a label_ref to a label outside the loop containing the
1185 reference. */
1186#define LABEL_OUTSIDE_LOOP_P(RTX) \
1187 (RTL_FLAG_CHECK1("LABEL_OUTSIDE_LOOP_P", (RTX), LABEL_REF)->in_struct)
6f29feb1 1188
2d4cc6a7
JJ
1189/* 1 if RTX is a label_ref for a nonlocal label. */
1190/* Likewise in an expr_list for a reg_label note. */
1191#define LABEL_REF_NONLOCAL_P(RTX) \
1192 (RTL_FLAG_CHECK2("LABEL_REF_NONLOCAL_P", (RTX), LABEL_REF, \
1193 REG_LABEL)->volatil)
adfaf10a 1194
2d4cc6a7
JJ
1195/* 1 if RTX is a code_label that should always be considered to be needed. */
1196#define LABEL_PRESERVE_P(RTX) \
1197 (RTL_FLAG_CHECK2("LABEL_PRESERVE_P", (RTX), CODE_LABEL, NOTE)->in_struct)
6f29feb1 1198
2d4cc6a7
JJ
1199/* 1 if RTX is a reg that is used only in an exit test of a loop. */
1200#define REG_LOOP_TEST_P(RTX) \
1201 (RTL_FLAG_CHECK1("REG_LOOP_TEST_P", (RTX), REG)->in_struct)
6f29feb1 1202
2d4cc6a7 1203/* During sched, 1 if RTX is an insn that must be scheduled together
d45cf215 1204 with the preceding insn. */
2d4cc6a7 1205#define SCHED_GROUP_P(RTX) \
be202ec2
FS
1206 (RTL_FLAG_CHECK3("SCHED_GROUP_P", (RTX), INSN, JUMP_INSN, CALL_INSN \
1207 )->in_struct)
6f29feb1
JW
1208
1209/* For a SET rtx, SET_DEST is the place that is set
1210 and SET_SRC is the value it is set to. */
83ab3839
RH
1211#define SET_DEST(RTX) XC2EXP(RTX, 0, SET, CLOBBER)
1212#define SET_SRC(RTX) XCEXP(RTX, 1, SET)
2d4cc6a7
JJ
1213#define SET_IS_RETURN_P(RTX) \
1214 (RTL_FLAG_CHECK1("SET_IS_RETURN_P", (RTX), SET)->jump)
6f29feb1
JW
1215
1216/* For a TRAP_IF rtx, TRAP_CONDITION is an expression. */
f52eda29
GS
1217#define TRAP_CONDITION(RTX) XCEXP (RTX, 0, TRAP_IF)
1218#define TRAP_CODE(RTX) XCEXP (RTX, 1, TRAP_IF)
6f29feb1 1219
0c99ec5c
RH
1220/* For a COND_EXEC rtx, COND_EXEC_TEST is the condition to base
1221 conditionally executing the code on, COND_EXEC_CODE is the code
1222 to execute if the condition is true. */
f52eda29
GS
1223#define COND_EXEC_TEST(RTX) XCEXP (RTX, 0, COND_EXEC)
1224#define COND_EXEC_CODE(RTX) XCEXP (RTX, 1, COND_EXEC)
0c99ec5c 1225
2d4cc6a7
JJ
1226/* 1 if RTX is a symbol_ref that addresses this function's constants pool. */
1227#define CONSTANT_POOL_ADDRESS_P(RTX) \
1228 (RTL_FLAG_CHECK1("CONSTANT_POOL_ADDRESS_P", (RTX), SYMBOL_REF)->unchanging)
6f29feb1 1229
2d4cc6a7
JJ
1230/* 1 if RTX is a symbol_ref that addresses this function's string constant
1231 pool */
1232#define STRING_POOL_ADDRESS_P(RTX) \
1233 (RTL_FLAG_CHECK1("STRING_POOL_ADDRESS_P", (RTX), SYMBOL_REF)->frame_related)
bd7cf17e 1234
2d4cc6a7
JJ
1235/* Used if RTX is a symbol_ref, for machine-specific purposes. */
1236#define SYMBOL_REF_FLAG(RTX) \
1237 (RTL_FLAG_CHECK1("SYMBOL_REF_FLAG", (RTX), SYMBOL_REF)->volatil)
6f29feb1 1238
2d4cc6a7
JJ
1239/* 1 if RTX is a symbol_ref that has been the library function in
1240 emit_library_call. */
1241#define SYMBOL_REF_USED(RTX) \
1242 (RTL_FLAG_CHECK1("SYMBOL_REF_USED", (RTX), SYMBOL_REF)->used)
6f29feb1 1243
2d4cc6a7
JJ
1244/* 1 if RTX is a symbol_ref for a weak symbol. */
1245#define SYMBOL_REF_WEAK(RTX) \
1246 (RTL_FLAG_CHECK1("SYMBOL_REF_WEAK", (RTX), SYMBOL_REF)->integrated)
ff0b6b99 1247
6f29feb1
JW
1248/* Define a macro to look for REG_INC notes,
1249 but save time on machines where they never exist. */
1250
58e54c44 1251#if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) || defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT))
f52eda29
GS
1252#define FIND_REG_INC_NOTE(INSN, REG) \
1253 ((REG) != NULL_RTX && REG_P ((REG)) \
1254 ? find_regno_note ((INSN), REG_INC, REGNO (REG)) \
1255 : find_reg_note ((INSN), REG_INC, (REG)))
6f29feb1 1256#else
f52eda29 1257#define FIND_REG_INC_NOTE(INSN, REG) 0
6f29feb1
JW
1258#endif
1259
1260/* Indicate whether the machine has any sort of auto increment addressing.
1261 If not, we can avoid checking for REG_INC notes. */
1262
58e54c44 1263#if (defined (HAVE_PRE_INCREMENT) || defined (HAVE_PRE_DECREMENT) || defined (HAVE_POST_INCREMENT) || defined (HAVE_POST_DECREMENT))
6f29feb1
JW
1264#define AUTO_INC_DEC
1265#endif
0dfa1860 1266
940da324
JL
1267#ifndef HAVE_PRE_INCREMENT
1268#define HAVE_PRE_INCREMENT 0
1269#endif
1270
1271#ifndef HAVE_PRE_DECREMENT
1272#define HAVE_PRE_DECREMENT 0
1273#endif
1274
1275#ifndef HAVE_POST_INCREMENT
1276#define HAVE_POST_INCREMENT 0
1277#endif
1278
1279#ifndef HAVE_POST_DECREMENT
1280#define HAVE_POST_DECREMENT 0
1281#endif
1282
4b983fdc
RH
1283#ifndef HAVE_POST_MODIFY_DISP
1284#define HAVE_POST_MODIFY_DISP 0
1285#endif
1286
1287#ifndef HAVE_POST_MODIFY_REG
1288#define HAVE_POST_MODIFY_REG 0
1289#endif
1290
1291#ifndef HAVE_PRE_MODIFY_DISP
1292#define HAVE_PRE_MODIFY_DISP 0
1293#endif
1294
1295#ifndef HAVE_PRE_MODIFY_REG
1296#define HAVE_PRE_MODIFY_REG 0
1297#endif
1298
6e01bd94
MH
1299
1300/* Some architectures do not have complete pre/post increment/decrement
1301 instruction sets, or only move some modes efficiently. These macros
1302 allow us to tune autoincrement generation. */
1303
1304#ifndef USE_LOAD_POST_INCREMENT
1305#define USE_LOAD_POST_INCREMENT(MODE) HAVE_POST_INCREMENT
1306#endif
1307
1308#ifndef USE_LOAD_POST_DECREMENT
1309#define USE_LOAD_POST_DECREMENT(MODE) HAVE_POST_DECREMENT
1310#endif
1311
1312#ifndef USE_LOAD_PRE_INCREMENT
1313#define USE_LOAD_PRE_INCREMENT(MODE) HAVE_PRE_INCREMENT
1314#endif
1315
1316#ifndef USE_LOAD_PRE_DECREMENT
1317#define USE_LOAD_PRE_DECREMENT(MODE) HAVE_PRE_DECREMENT
1318#endif
1319
1320#ifndef USE_STORE_POST_INCREMENT
1321#define USE_STORE_POST_INCREMENT(MODE) HAVE_POST_INCREMENT
1322#endif
1323
1324#ifndef USE_STORE_POST_DECREMENT
1325#define USE_STORE_POST_DECREMENT(MODE) HAVE_POST_DECREMENT
1326#endif
1327
1328#ifndef USE_STORE_PRE_INCREMENT
1329#define USE_STORE_PRE_INCREMENT(MODE) HAVE_PRE_INCREMENT
1330#endif
1331
1332#ifndef USE_STORE_PRE_DECREMENT
1333#define USE_STORE_PRE_DECREMENT(MODE) HAVE_PRE_DECREMENT
1334#endif
1335
4e872036
AS
1336/* Determine if the insn is a PHI node. */
1337#define PHI_NODE_P(X) \
f52eda29 1338 ((X) && GET_CODE (X) == INSN \
4e872036
AS
1339 && GET_CODE (PATTERN (X)) == SET \
1340 && GET_CODE (SET_SRC (PATTERN (X))) == PHI)
6f29feb1 1341\f
bf6bb899
BS
1342/* Nonzero if we need to distinguish between the return value of this function
1343 and the return value of a function called by this function. This helps
1344 integrate.c.
1345 This is 1 until after the rtl generation pass. */
1346extern int rtx_equal_function_value_matters;
1347
1b3d8f8a
GK
1348/* Nonzero when we are generating CONCATs. */
1349extern int generating_concat_p;
1350
6f29feb1
JW
1351/* Generally useful functions. */
1352
ac957f13 1353/* In expmed.c */
cdadb1dd 1354extern int ceil_log2 PARAMS ((unsigned HOST_WIDE_INT));
5f4f0e22 1355
f52eda29 1356#define plus_constant(X, C) plus_constant_wide ((X), (HOST_WIDE_INT) (C))
5f4f0e22 1357
5f2d6cfa 1358/* In builtins.c */
2f78c311 1359extern rtx expand_builtin_expect_jump PARAMS ((tree, rtx, rtx));
34ee7f82 1360extern void purge_builtin_constant_p PARAMS ((void));
5f2d6cfa 1361
50b2596f 1362/* In explow.c */
c6991660 1363extern void set_stack_check_libfunc PARAMS ((rtx));
cdadb1dd 1364extern HOST_WIDE_INT trunc_int_for_mode PARAMS ((HOST_WIDE_INT,
7e4ce834 1365 enum machine_mode));
cdadb1dd
KG
1366extern rtx plus_constant_wide PARAMS ((rtx, HOST_WIDE_INT));
1367extern rtx plus_constant_for_output_wide PARAMS ((rtx, HOST_WIDE_INT));
1368extern void optimize_save_area_alloca PARAMS ((rtx));
5f4f0e22 1369
4eb00163 1370/* In emit-rtl.c */
cdadb1dd 1371extern rtx gen_rtx PARAMS ((enum rtx_code,
bdea67fa 1372 enum machine_mode, ...));
cdadb1dd 1373extern rtvec gen_rtvec PARAMS ((int, ...));
cdadb1dd
KG
1374extern rtx copy_insn_1 PARAMS ((rtx));
1375extern rtx copy_insn PARAMS ((rtx));
2496c7bd
LB
1376extern rtx gen_int_mode PARAMS ((HOST_WIDE_INT,
1377 enum machine_mode));
969d70ca 1378extern rtx emit_copy_of_insn_after PARAMS ((rtx, rtx));
a560d4d4
JH
1379extern void set_reg_attrs_from_mem PARAMS ((rtx, rtx));
1380extern void set_mem_attrs_from_reg PARAMS ((rtx, rtx));
9d18e06b 1381extern void set_reg_attrs_for_parm PARAMS ((rtx, rtx));
4eb00163
JO
1382
1383/* In rtl.c */
5fe2e41b
GK
1384extern rtx rtx_alloc PARAMS ((RTX_CODE));
1385extern rtvec rtvec_alloc PARAMS ((int));
cdadb1dd 1386extern rtx copy_rtx PARAMS ((rtx));
4eb00163
JO
1387
1388/* In emit-rtl.c */
cdadb1dd 1389extern rtx copy_rtx_if_shared PARAMS ((rtx));
4eb00163
JO
1390
1391/* In rtl.c */
cdadb1dd
KG
1392extern rtx copy_most_rtx PARAMS ((rtx, rtx));
1393extern rtx shallow_copy_rtx PARAMS ((rtx));
1394extern int rtx_equal_p PARAMS ((rtx, rtx));
4eb00163
JO
1395
1396/* In emit-rtl.c */
cdadb1dd
KG
1397extern rtvec gen_rtvec_v PARAMS ((int, rtx *));
1398extern rtx gen_reg_rtx PARAMS ((enum machine_mode));
a560d4d4
JH
1399extern rtx gen_rtx_REG_offset PARAMS ((rtx, enum machine_mode,
1400 unsigned int, int));
cdadb1dd 1401extern rtx gen_label_rtx PARAMS ((void));
ddef6bc7 1402extern int subreg_hard_regno PARAMS ((rtx, int));
cdadb1dd
KG
1403extern rtx gen_lowpart_common PARAMS ((enum machine_mode, rtx));
1404extern rtx gen_lowpart PARAMS ((enum machine_mode, rtx));
4eb00163
JO
1405
1406/* In cse.c */
cdadb1dd 1407extern rtx gen_lowpart_if_possible PARAMS ((enum machine_mode, rtx));
4eb00163
JO
1408
1409/* In emit-rtl.c */
cdadb1dd 1410extern rtx gen_highpart PARAMS ((enum machine_mode, rtx));
5222e470
JH
1411extern rtx gen_highpart_mode PARAMS ((enum machine_mode,
1412 enum machine_mode, rtx));
cdadb1dd
KG
1413extern rtx gen_realpart PARAMS ((enum machine_mode, rtx));
1414extern rtx gen_imagpart PARAMS ((enum machine_mode, rtx));
770ae6cc
RK
1415extern rtx operand_subword PARAMS ((rtx, unsigned int, int,
1416 enum machine_mode));
ddef6bc7
JJ
1417extern rtx constant_subword PARAMS ((rtx, int,
1418 enum machine_mode));
4eb00163
JO
1419
1420/* In emit-rtl.c */
770ae6cc
RK
1421extern rtx operand_subword_force PARAMS ((rtx, unsigned int,
1422 enum machine_mode));
cdadb1dd 1423extern int subreg_lowpart_p PARAMS ((rtx));
e0e08ac2
JH
1424extern unsigned int subreg_lowpart_offset PARAMS ((enum machine_mode,
1425 enum machine_mode));
1426extern unsigned int subreg_highpart_offset PARAMS ((enum machine_mode,
1427 enum machine_mode));
cdadb1dd
KG
1428extern rtx make_safe_from PARAMS ((rtx, rtx));
1429extern rtx convert_memory_address PARAMS ((enum machine_mode, rtx));
cdadb1dd
KG
1430extern rtx get_insns PARAMS ((void));
1431extern const char *get_insn_name PARAMS ((int));
1432extern rtx get_last_insn PARAMS ((void));
1433extern rtx get_last_insn_anywhere PARAMS ((void));
2a496e8b
JDA
1434extern rtx get_first_nonnote_insn PARAMS ((void));
1435extern rtx get_last_nonnote_insn PARAMS ((void));
cdadb1dd
KG
1436extern void start_sequence PARAMS ((void));
1437extern void push_to_sequence PARAMS ((rtx));
1438extern void end_sequence PARAMS ((void));
c14f7160
ML
1439extern void push_to_full_sequence PARAMS ((rtx, rtx));
1440extern void end_full_sequence PARAMS ((rtx*, rtx*));
4eb00163
JO
1441
1442/* In varasm.c */
cdadb1dd 1443extern rtx immed_double_const PARAMS ((HOST_WIDE_INT, HOST_WIDE_INT, enum machine_mode));
03f54026 1444extern rtx mem_for_const_double PARAMS ((rtx));
cdadb1dd 1445extern rtx force_const_mem PARAMS ((enum machine_mode, rtx));
4eb00163 1446
4eb00163 1447/* In varasm.c */
cdadb1dd 1448extern rtx get_pool_constant PARAMS ((rtx));
149d6f9e 1449extern rtx get_pool_constant_mark PARAMS ((rtx, bool *));
cdadb1dd
KG
1450extern enum machine_mode get_pool_mode PARAMS ((rtx));
1451extern rtx get_pool_constant_for_function PARAMS ((struct function *, rtx));
1452extern enum machine_mode get_pool_mode_for_function PARAMS ((struct function *, rtx));
1453extern int get_pool_offset PARAMS ((rtx));
1454extern rtx simplify_subtraction PARAMS ((rtx));
4eb00163
JO
1455
1456/* In function.c */
cdadb1dd 1457extern rtx assign_stack_local PARAMS ((enum machine_mode,
e5e809f4 1458 HOST_WIDE_INT, int));
cdadb1dd 1459extern rtx assign_stack_temp PARAMS ((enum machine_mode,
e5e809f4 1460 HOST_WIDE_INT, int));
a06ef755
RK
1461extern rtx assign_stack_temp_for_type PARAMS ((enum machine_mode,
1462 HOST_WIDE_INT, int, tree));
2f78c311 1463extern rtx assign_temp PARAMS ((tree, int, int, int));
4eb00163 1464/* In emit-rtl.c */
cdadb1dd 1465extern rtx emit_insn_before PARAMS ((rtx, rtx));
0d682900 1466extern rtx emit_insn_before_scope PARAMS ((rtx, rtx, tree));
cdadb1dd 1467extern rtx emit_jump_insn_before PARAMS ((rtx, rtx));
0d682900 1468extern rtx emit_jump_insn_before_scope PARAMS ((rtx, rtx, tree));
cdadb1dd 1469extern rtx emit_call_insn_before PARAMS ((rtx, rtx));
0d682900 1470extern rtx emit_call_insn_before_scope PARAMS ((rtx, rtx, tree));
cdadb1dd
KG
1471extern rtx emit_barrier_before PARAMS ((rtx));
1472extern rtx emit_label_before PARAMS ((rtx, rtx));
1473extern rtx emit_note_before PARAMS ((int, rtx));
1474extern rtx emit_insn_after PARAMS ((rtx, rtx));
0d682900 1475extern rtx emit_insn_after_scope PARAMS ((rtx, rtx, tree));
cdadb1dd 1476extern rtx emit_jump_insn_after PARAMS ((rtx, rtx));
0d682900 1477extern rtx emit_jump_insn_after_scope PARAMS ((rtx, rtx, tree));
969d70ca 1478extern rtx emit_call_insn_after PARAMS ((rtx, rtx));
0d682900 1479extern rtx emit_call_insn_after_scope PARAMS ((rtx, rtx, tree));
cdadb1dd
KG
1480extern rtx emit_barrier_after PARAMS ((rtx));
1481extern rtx emit_label_after PARAMS ((rtx, rtx));
1482extern rtx emit_note_after PARAMS ((int, rtx));
3cce094d 1483extern rtx emit_line_note_after PARAMS ((const char *, int, rtx));
cdadb1dd 1484extern rtx emit_insn PARAMS ((rtx));
cdadb1dd
KG
1485extern rtx emit_jump_insn PARAMS ((rtx));
1486extern rtx emit_call_insn PARAMS ((rtx));
1487extern rtx emit_label PARAMS ((rtx));
1488extern rtx emit_barrier PARAMS ((void));
3cce094d
KG
1489extern rtx emit_line_note PARAMS ((const char *, int));
1490extern rtx emit_note PARAMS ((const char *, int));
1491extern rtx emit_line_note_force PARAMS ((const char *, int));
cdadb1dd
KG
1492extern rtx make_insn_raw PARAMS ((rtx));
1493extern rtx previous_insn PARAMS ((rtx));
1494extern rtx next_insn PARAMS ((rtx));
1495extern rtx prev_nonnote_insn PARAMS ((rtx));
1496extern rtx next_nonnote_insn PARAMS ((rtx));
1497extern rtx prev_real_insn PARAMS ((rtx));
1498extern rtx next_real_insn PARAMS ((rtx));
1499extern rtx prev_active_insn PARAMS ((rtx));
1500extern rtx next_active_insn PARAMS ((rtx));
69732dcb 1501extern int active_insn_p PARAMS ((rtx));
cdadb1dd
KG
1502extern rtx prev_label PARAMS ((rtx));
1503extern rtx next_label PARAMS ((rtx));
1504extern rtx next_cc0_user PARAMS ((rtx));
1505extern rtx prev_cc0_setter PARAMS ((rtx));
4eb00163 1506
1292ec0c
JH
1507/* In cfglayout.c */
1508extern tree choose_inner_scope PARAMS ((tree, tree));
1509
4eb00163 1510/* In jump.c */
cdadb1dd
KG
1511extern rtx next_nondeleted_insn PARAMS ((rtx));
1512extern enum rtx_code reverse_condition PARAMS ((enum rtx_code));
7913f3d0 1513extern enum rtx_code reverse_condition_maybe_unordered PARAMS ((enum rtx_code));
cdadb1dd
KG
1514extern enum rtx_code swap_condition PARAMS ((enum rtx_code));
1515extern enum rtx_code unsigned_condition PARAMS ((enum rtx_code));
1516extern enum rtx_code signed_condition PARAMS ((enum rtx_code));
1e5fd094 1517extern void mark_jump_label PARAMS ((rtx, rtx, int));
01f62f01 1518extern void cleanup_barriers PARAMS ((void));
4eb00163 1519
4eb00163 1520/* In jump.c */
2b7d71b2 1521extern bool squeeze_notes PARAMS ((rtx *, rtx *));
53c17031 1522extern rtx delete_related_insns PARAMS ((rtx));
cdadb1dd
KG
1523extern void delete_jump PARAMS ((rtx));
1524extern void delete_barrier PARAMS ((rtx));
1525extern rtx get_label_before PARAMS ((rtx));
1526extern rtx get_label_after PARAMS ((rtx));
1527extern rtx follow_jumps PARAMS ((rtx));
4eb00163
JO
1528
1529/* In recog.c */
b72f00af 1530extern rtx *find_constant_term_loc PARAMS ((rtx *));
4eb00163
JO
1531
1532/* In emit-rtl.c */
cdadb1dd 1533extern rtx try_split PARAMS ((rtx, rtx, int));
6b24c259 1534extern int split_branch_probability;
4eb00163
JO
1535
1536/* In unknown file */
cdadb1dd 1537extern rtx split_insns PARAMS ((rtx, rtx));
4eb00163
JO
1538
1539/* In simplify-rtx.c */
d9c695ff
RK
1540extern rtx simplify_unary_operation PARAMS ((enum rtx_code,
1541 enum machine_mode, rtx,
1542 enum machine_mode));
1543extern rtx simplify_binary_operation PARAMS ((enum rtx_code,
1544 enum machine_mode, rtx,
1545 rtx));
1546extern rtx simplify_ternary_operation PARAMS ((enum rtx_code,
1547 enum machine_mode,
1548 enum machine_mode, rtx, rtx,
1549 rtx));
1550extern rtx simplify_relational_operation PARAMS ((enum rtx_code,
1551 enum machine_mode, rtx,
1552 rtx));
1553extern rtx simplify_gen_binary PARAMS ((enum rtx_code,
1554 enum machine_mode,
1555 rtx, rtx));
1556extern rtx simplify_gen_unary PARAMS ((enum rtx_code,
1557 enum machine_mode, rtx,
1558 enum machine_mode));
1559extern rtx simplify_gen_ternary PARAMS ((enum rtx_code,
1560 enum machine_mode,
1561 enum machine_mode,
1562 rtx, rtx, rtx));
1563extern rtx simplify_gen_relational PARAMS ((enum rtx_code,
141e454b 1564 enum machine_mode,
d9c695ff
RK
1565 enum machine_mode,
1566 rtx, rtx));
eea50aa0
JH
1567extern rtx simplify_subreg PARAMS ((enum machine_mode,
1568 rtx,
1569 enum machine_mode,
1570 unsigned int));
949c5d62
JH
1571extern rtx simplify_gen_subreg PARAMS ((enum machine_mode,
1572 rtx,
1573 enum machine_mode,
1574 unsigned int));
d9c695ff 1575extern rtx simplify_replace_rtx PARAMS ((rtx, rtx, rtx));
cdadb1dd 1576extern rtx simplify_rtx PARAMS ((rtx));
732910b9 1577extern rtx avoid_constant_pool_reference PARAMS ((rtx));
4eb00163 1578
4eb00163 1579/* In function.c */
2f78c311 1580extern rtx gen_mem_addressof PARAMS ((rtx, tree));
4eb00163 1581
4eb00163 1582/* In regclass.c */
770ae6cc
RK
1583extern enum machine_mode choose_hard_reg_mode PARAMS ((unsigned int,
1584 unsigned int));
4eb00163
JO
1585
1586/* In emit-rtl.c */
3d238248 1587extern rtx set_unique_reg_note PARAMS ((rtx, enum reg_note, rtx));
9ae8ffe7 1588
e9a25f70
JL
1589/* Functions in rtlanal.c */
1590
b1cdafbb
JH
1591/* Single set is implemented as macro for performance reasons. */
1592#define single_set(I) (INSN_P (I) \
1593 ? (GET_CODE (PATTERN (I)) == SET \
1594 ? PATTERN (I) : single_set_1 (I)) \
1595 : NULL_RTX)
2130b7fb 1596#define single_set_1(I) single_set_2 (I, PATTERN (I))
b1cdafbb 1597
e38fe8e0 1598extern int rtx_addr_can_trap_p PARAMS ((rtx));
4977bab6 1599extern bool nonzero_address_p PARAMS ((rtx));
cdadb1dd 1600extern int rtx_unstable_p PARAMS ((rtx));
e38fe8e0
BS
1601extern int rtx_varies_p PARAMS ((rtx, int));
1602extern int rtx_addr_varies_p PARAMS ((rtx, int));
cdadb1dd
KG
1603extern HOST_WIDE_INT get_integer_term PARAMS ((rtx));
1604extern rtx get_related_value PARAMS ((rtx));
d644189f 1605extern rtx get_jump_table_offset PARAMS ((rtx, rtx *));
c14b9960 1606extern int global_reg_mentioned_p PARAMS ((rtx));
cdadb1dd 1607extern int reg_mentioned_p PARAMS ((rtx, rtx));
4b983fdc 1608extern int count_occurrences PARAMS ((rtx, rtx, int));
cdadb1dd
KG
1609extern int reg_referenced_p PARAMS ((rtx, rtx));
1610extern int reg_used_between_p PARAMS ((rtx, rtx, rtx));
1611extern int reg_referenced_between_p PARAMS ((rtx, rtx, rtx));
1612extern int reg_set_between_p PARAMS ((rtx, rtx, rtx));
1613extern int regs_set_between_p PARAMS ((rtx, rtx, rtx));
9b3bd424 1614extern int commutative_operand_precedence PARAMS ((rtx));
e5c56fd9 1615extern int swap_commutative_operands_p PARAMS ((rtx, rtx));
cdadb1dd
KG
1616extern int modified_between_p PARAMS ((rtx, rtx, rtx));
1617extern int no_labels_between_p PARAMS ((rtx, rtx));
1618extern int no_jumps_between_p PARAMS ((rtx, rtx));
1619extern int modified_in_p PARAMS ((rtx, rtx));
4eb00163 1620extern int insn_dependent_p PARAMS ((rtx, rtx));
cdadb1dd 1621extern int reg_set_p PARAMS ((rtx, rtx));
2130b7fb 1622extern rtx single_set_2 PARAMS ((rtx, rtx));
cdadb1dd 1623extern int multiple_sets PARAMS ((rtx));
7142e318 1624extern int set_noop_p PARAMS ((rtx));
0005550b 1625extern int noop_move_p PARAMS ((rtx));
cdadb1dd 1626extern rtx find_last_value PARAMS ((rtx, rtx *, rtx, int));
770ae6cc
RK
1627extern int refers_to_regno_p PARAMS ((unsigned int, unsigned int,
1628 rtx, rtx *));
cdadb1dd 1629extern int reg_overlap_mentioned_p PARAMS ((rtx, rtx));
91b2d119 1630extern rtx set_of PARAMS ((rtx, rtx));
770ae6cc
RK
1631extern void note_stores PARAMS ((rtx,
1632 void (*) (rtx, rtx, void *),
1633 void *));
e2373f95
RK
1634extern void note_uses PARAMS ((rtx *,
1635 void (*) (rtx *, void *),
1636 void *));
cdadb1dd
KG
1637extern rtx reg_set_last PARAMS ((rtx, rtx));
1638extern int dead_or_set_p PARAMS ((rtx, rtx));
770ae6cc 1639extern int dead_or_set_regno_p PARAMS ((rtx, unsigned int));
cdadb1dd 1640extern rtx find_reg_note PARAMS ((rtx, enum reg_note, rtx));
770ae6cc
RK
1641extern rtx find_regno_note PARAMS ((rtx, enum reg_note,
1642 unsigned int));
d9c695ff 1643extern rtx find_reg_equal_equiv_note PARAMS ((rtx));
cdadb1dd 1644extern int find_reg_fusage PARAMS ((rtx, enum rtx_code, rtx));
770ae6cc
RK
1645extern int find_regno_fusage PARAMS ((rtx, enum rtx_code,
1646 unsigned int));
a6a063b8 1647extern int pure_call_p PARAMS ((rtx));
cdadb1dd
KG
1648extern void remove_note PARAMS ((rtx, rtx));
1649extern int side_effects_p PARAMS ((rtx));
1650extern int volatile_refs_p PARAMS ((rtx));
1651extern int volatile_insn_p PARAMS ((rtx));
1652extern int may_trap_p PARAMS ((rtx));
1653extern int inequality_comparisons_p PARAMS ((rtx));
1654extern rtx replace_rtx PARAMS ((rtx, rtx, rtx));
770ae6cc
RK
1655extern rtx replace_regs PARAMS ((rtx, rtx *, unsigned int,
1656 int));
cdadb1dd
KG
1657extern int computed_jump_p PARAMS ((rtx));
1658typedef int (*rtx_function) PARAMS ((rtx *, void *));
1659extern int for_each_rtx PARAMS ((rtx *, rtx_function, void *));
770ae6cc 1660extern rtx regno_use_in PARAMS ((unsigned int, rtx));
cdadb1dd 1661extern int auto_inc_p PARAMS ((rtx));
5f0d2358 1662extern int in_expr_list_p PARAMS ((rtx, rtx));
cdadb1dd
KG
1663extern void remove_node_from_expr_list PARAMS ((rtx, rtx *));
1664extern int insns_safe_to_move_p PARAMS ((rtx, rtx, rtx *));
db7ba742 1665extern int loc_mentioned_in_p PARAMS ((rtx *, rtx));
833366d6 1666extern rtx find_first_parameter_load PARAMS ((rtx, rtx));
3dec4024 1667extern bool keep_with_call_p PARAMS ((rtx));
6f29feb1 1668
ae0b51ef
JL
1669/* flow.c */
1670
cdadb1dd 1671extern rtx find_use_as_address PARAMS ((rtx, rtx, HOST_WIDE_INT));
e2500fed
GK
1672
1673/* lists.c */
1674
cdadb1dd
KG
1675void free_EXPR_LIST_list PARAMS ((rtx *));
1676void free_INSN_LIST_list PARAMS ((rtx *));
1677void free_EXPR_LIST_node PARAMS ((rtx));
1678void free_INSN_LIST_node PARAMS ((rtx));
1679rtx alloc_INSN_LIST PARAMS ((rtx, rtx));
1680rtx alloc_EXPR_LIST PARAMS ((int, rtx, rtx));
ae0b51ef
JL
1681
1682/* regclass.c */
1683
6f29feb1
JW
1684/* Maximum number of parallel sets and clobbers in any insn in this fn.
1685 Always at least 3, since the combiner could put that many togetherm
1686 and we want this to remain correct for all the remaining passes. */
1687
1688extern int max_parallel;
1689
e0c6d139 1690/* Free up register info memory. */
cdadb1dd 1691extern void free_reg_info PARAMS ((void));
e0c6d139 1692
ae0b51ef 1693/* recog.c */
cdadb1dd 1694extern int asm_noperands PARAMS ((rtx));
3cce094d 1695extern const char *decode_asm_operands PARAMS ((rtx, rtx *, rtx **,
9b3142b3
KG
1696 const char **,
1697 enum machine_mode *));
6f29feb1 1698
cdadb1dd
KG
1699extern enum reg_class reg_preferred_class PARAMS ((int));
1700extern enum reg_class reg_alternate_class PARAMS ((int));
6f29feb1 1701
cdadb1dd 1702extern rtx get_first_nonparm_insn PARAMS ((void));
6f29feb1 1703
cdadb1dd 1704extern void split_all_insns PARAMS ((int));
6f862f2f 1705extern void split_all_insns_noflow PARAMS ((void));
6a73406e 1706
68d75312 1707#define MAX_SAVED_CONST_INT 64
e2500fed 1708extern GTY(()) rtx const_int_rtx[MAX_SAVED_CONST_INT * 2 + 1];
68d75312 1709
5da077de
AS
1710#define const0_rtx (const_int_rtx[MAX_SAVED_CONST_INT])
1711#define const1_rtx (const_int_rtx[MAX_SAVED_CONST_INT+1])
1712#define const2_rtx (const_int_rtx[MAX_SAVED_CONST_INT+2])
1713#define constm1_rtx (const_int_rtx[MAX_SAVED_CONST_INT-1])
e2500fed 1714extern GTY(()) rtx const_true_rtx;
a8efe40d 1715
e2500fed 1716extern GTY(()) rtx const_tiny_rtx[3][(int) MAX_MACHINE_MODE];
a8efe40d 1717
f590cca1 1718/* Returns a constant 0 rtx in mode MODE. Integer modes are treated the
a8efe40d
RK
1719 same as VOIDmode. */
1720
1721#define CONST0_RTX(MODE) (const_tiny_rtx[0][(int) (MODE)])
1722
1723/* Likewise, for the constants 1 and 2. */
1724
1725#define CONST1_RTX(MODE) (const_tiny_rtx[1][(int) (MODE)])
1726#define CONST2_RTX(MODE) (const_tiny_rtx[2][(int) (MODE)])
6f29feb1 1727
5da077de
AS
1728/* If HARD_FRAME_POINTER_REGNUM is defined, then a special dummy reg
1729 is used to represent the frame pointer. This is because the
1730 hard frame pointer and the automatic variables are separated by an amount
1731 that cannot be determined until after register allocation. We can assume
1732 that in this case ELIMINABLE_REGS will be defined, one action of which
eebedaa5 1733 will be to eliminate FRAME_POINTER_REGNUM into HARD_FRAME_POINTER_REGNUM. */
5da077de
AS
1734#ifndef HARD_FRAME_POINTER_REGNUM
1735#define HARD_FRAME_POINTER_REGNUM FRAME_POINTER_REGNUM
1736#endif
1737
1738/* Index labels for global_rtl. */
1739enum global_rtl_index
68d75312 1740{
5da077de
AS
1741 GR_PC,
1742 GR_CC0,
1743 GR_STACK_POINTER,
1744 GR_FRAME_POINTER,
1745/* For register elimination to work properly these hard_frame_pointer_rtx,
1746 frame_pointer_rtx, and arg_pointer_rtx must be the same if they refer to
1747 the same register. */
1748#if FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM
1749 GR_ARG_POINTER = GR_FRAME_POINTER,
1750#endif
1751#if HARD_FRAME_POINTER_REGNUM == FRAME_POINTER_REGNUM
1752 GR_HARD_FRAME_POINTER = GR_FRAME_POINTER,
1753#else
1754 GR_HARD_FRAME_POINTER,
1755#endif
1756#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
1757#if HARD_FRAME_POINTER_REGNUM == ARG_POINTER_REGNUM
1758 GR_ARG_POINTER = GR_HARD_FRAME_POINTER,
1759#else
1760 GR_ARG_POINTER,
1761#endif
1762#endif
1763 GR_VIRTUAL_INCOMING_ARGS,
1764 GR_VIRTUAL_STACK_ARGS,
1765 GR_VIRTUAL_STACK_DYNAMIC,
1766 GR_VIRTUAL_OUTGOING_ARGS,
1767 GR_VIRTUAL_CFA,
1768
1769 GR_MAX
1770};
1771
1772/* Pointers to standard pieces of rtx are stored here. */
e2500fed 1773extern GTY(()) rtx global_rtl[GR_MAX];
5da077de
AS
1774
1775/* Standard pieces of rtx, to be substituted directly into things. */
1776#define pc_rtx (global_rtl[GR_PC])
1777#define cc0_rtx (global_rtl[GR_CC0])
68d75312 1778
6f29feb1
JW
1779/* All references to certain hard regs, except those created
1780 by allocating pseudo regs into them (when that's possible),
1781 go through these unique rtx objects. */
5da077de
AS
1782#define stack_pointer_rtx (global_rtl[GR_STACK_POINTER])
1783#define frame_pointer_rtx (global_rtl[GR_FRAME_POINTER])
1784#define hard_frame_pointer_rtx (global_rtl[GR_HARD_FRAME_POINTER])
1785#define arg_pointer_rtx (global_rtl[GR_ARG_POINTER])
68d75312 1786
e2500fed
GK
1787extern GTY(()) rtx pic_offset_table_rtx;
1788extern GTY(()) rtx struct_value_rtx;
1789extern GTY(()) rtx struct_value_incoming_rtx;
1790extern GTY(()) rtx static_chain_rtx;
1791extern GTY(()) rtx static_chain_incoming_rtx;
1792extern GTY(()) rtx return_address_pointer_rtx;
3b80f6ca
RH
1793
1794/* Include the RTL generation functions. */
1795
1796#ifndef NO_GENRTL_H
1797#include "genrtl.h"
1798#endif
1799
41472af8
MM
1800/* There are some RTL codes that require special attention; the
1801 generation functions included above do the raw handling. If you
b4213325
MM
1802 add to this list, modify special_rtx in gengenrtl.c as well. You
1803 should also modify gen_rtx to use the special function. */
3b80f6ca 1804
cdadb1dd 1805extern rtx gen_rtx_CONST_INT PARAMS ((enum machine_mode, HOST_WIDE_INT));
a06e3c40 1806extern rtx gen_rtx_CONST_VECTOR PARAMS ((enum machine_mode, rtvec));
08394eef 1807extern rtx gen_raw_REG PARAMS ((enum machine_mode, int));
5692c7bc 1808extern rtx gen_rtx_REG PARAMS ((enum machine_mode, unsigned));
ddef6bc7 1809extern rtx gen_rtx_SUBREG PARAMS ((enum machine_mode, rtx, int));
cdadb1dd 1810extern rtx gen_rtx_MEM PARAMS ((enum machine_mode, rtx));
3b80f6ca 1811
ddef6bc7
JJ
1812extern rtx gen_lowpart_SUBREG PARAMS ((enum machine_mode, rtx));
1813
aefdd5ab
JL
1814/* We need the cast here to ensure that we get the same result both with
1815 and without prototypes. */
1816#define GEN_INT(N) gen_rtx_CONST_INT (VOIDmode, (HOST_WIDE_INT) (N))
3b80f6ca 1817
6f29feb1
JW
1818/* Virtual registers are used during RTL generation to refer to locations into
1819 the stack frame when the actual location isn't known until RTL generation
1820 is complete. The routine instantiate_virtual_regs replaces these with
1821 the proper value, which is normally {frame,arg,stack}_pointer_rtx plus
1822 a constant. */
1823
1824#define FIRST_VIRTUAL_REGISTER (FIRST_PSEUDO_REGISTER)
1825
1826/* This points to the first word of the incoming arguments passed on the stack,
1827 either by the caller or by the callee when pretending it was passed by the
1828 caller. */
1829
5da077de 1830#define virtual_incoming_args_rtx (global_rtl[GR_VIRTUAL_INCOMING_ARGS])
6f29feb1
JW
1831
1832#define VIRTUAL_INCOMING_ARGS_REGNUM (FIRST_VIRTUAL_REGISTER)
1833
60343c3b 1834/* If FRAME_GROWS_DOWNWARD, this points to immediately above the first
6f29feb1
JW
1835 variable on the stack. Otherwise, it points to the first variable on
1836 the stack. */
1837
5da077de 1838#define virtual_stack_vars_rtx (global_rtl[GR_VIRTUAL_STACK_ARGS])
6f29feb1
JW
1839
1840#define VIRTUAL_STACK_VARS_REGNUM ((FIRST_VIRTUAL_REGISTER) + 1)
1841
1842/* This points to the location of dynamically-allocated memory on the stack
1843 immediately after the stack pointer has been adjusted by the amount
1844 desired. */
1845
5da077de 1846#define virtual_stack_dynamic_rtx (global_rtl[GR_VIRTUAL_STACK_DYNAMIC])
6f29feb1
JW
1847
1848#define VIRTUAL_STACK_DYNAMIC_REGNUM ((FIRST_VIRTUAL_REGISTER) + 2)
1849
1850/* This points to the location in the stack at which outgoing arguments should
1851 be written when the stack is pre-pushed (arguments pushed using push
1852 insns always use sp). */
1853
5da077de 1854#define virtual_outgoing_args_rtx (global_rtl[GR_VIRTUAL_OUTGOING_ARGS])
6f29feb1
JW
1855
1856#define VIRTUAL_OUTGOING_ARGS_REGNUM ((FIRST_VIRTUAL_REGISTER) + 3)
1857
71038426 1858/* This points to the Canonical Frame Address of the function. This
14b493d6 1859 should correspond to the CFA produced by INCOMING_FRAME_SP_OFFSET,
71038426 1860 but is calculated relative to the arg pointer for simplicity; the
f590cca1 1861 frame pointer nor stack pointer are necessarily fixed relative to
71038426
RH
1862 the CFA until after reload. */
1863
5da077de 1864#define virtual_cfa_rtx (global_rtl[GR_VIRTUAL_CFA])
71038426
RH
1865
1866#define VIRTUAL_CFA_REGNUM ((FIRST_VIRTUAL_REGISTER) + 4)
1867
1868#define LAST_VIRTUAL_REGISTER ((FIRST_VIRTUAL_REGISTER) + 4)
6f29feb1 1869
a06ef755
RK
1870/* Nonzero if REGNUM is a pointer into the stack frame. */
1871#define REGNO_PTR_FRAME_P(REGNUM) \
1872 ((REGNUM) == STACK_POINTER_REGNUM \
1873 || (REGNUM) == FRAME_POINTER_REGNUM \
1874 || (REGNUM) == HARD_FRAME_POINTER_REGNUM \
1875 || (REGNUM) == ARG_POINTER_REGNUM \
1876 || ((REGNUM) >= FIRST_VIRTUAL_REGISTER \
1877 && (REGNUM) <= LAST_VIRTUAL_REGISTER))
1878
848e0190 1879/* REGNUM never really appearing in the INSN stream. */
cf403648 1880#define INVALID_REGNUM (~(unsigned int) 0)
848e0190 1881
cdadb1dd 1882extern rtx find_next_ref PARAMS ((rtx, rtx));
f837a861 1883
2f78c311 1884extern rtx output_constant_def PARAMS ((tree, int));
6f29feb1
JW
1885
1886/* Define a default value for STORE_FLAG_VALUE. */
1887
1888#ifndef STORE_FLAG_VALUE
1889#define STORE_FLAG_VALUE 1
1890#endif
1891
0ea0e871
JL
1892/* Nonzero after the second flow pass has completed.
1893 Set to 1 or 0 by toplev.c */
1894extern int flow2_completed;
1895
6f29feb1 1896/* Nonzero after end of reload pass.
0ea0e871 1897 Set to 1 or 0 by reload1.c. */
6f29feb1
JW
1898
1899extern int reload_completed;
1900
1901/* Set to 1 while reload_as_needed is operating.
1902 Required by some machines to handle any generated moves differently. */
1903
1904extern int reload_in_progress;
1905
1906/* If this is nonzero, we do not bother generating VOLATILE
1907 around volatile memory references, and we are willing to
1908 output indirect addresses. If cse is to follow, we reject
1909 indirect addresses so a useful potential cse is generated;
1910 if it is used only once, instruction combination will produce
1911 the same indirect address eventually. */
1912extern int cse_not_expected;
1913
f1db3576
JL
1914/* Set to nonzero before life analysis to indicate that it is unsafe to
1915 generate any new pseudo registers. */
1916extern int no_new_pseudos;
1917
f5118aa5 1918/* Translates rtx code to tree code, for those codes needed by
88efc60a
RK
1919 REAL_ARITHMETIC. The function returns an int because the caller may not
1920 know what `enum tree_code' means. */
1921
cdadb1dd 1922extern int rtx_to_tree_code PARAMS ((enum rtx_code));
9ae8ffe7 1923
ac957f13 1924/* In tree.c */
ac957f13 1925struct obstack;
cdadb1dd 1926extern void gcc_obstack_init PARAMS ((struct obstack *));
1f8f4a0b 1927
ac957f13
JL
1928/* In cse.c */
1929struct cse_basic_block_data;
f1c1dfc3
BS
1930
1931/* Return the right cost to give to an operation
1932 to make the cost of the corresponding register-to-register instruction
1933 N times that of a fast register-to-register instruction. */
1934#define COSTS_N_INSNS(N) ((N) * 4)
1935
1936/* Maximum cost of a rtl expression. This value has the special meaning
1937 not to use an rtx with this cost under any circumstances. */
1938#define MAX_COST INT_MAX
1939
cdadb1dd 1940extern int rtx_cost PARAMS ((rtx, enum rtx_code));
01329426 1941extern int address_cost PARAMS ((rtx, enum machine_mode));
3dec4024 1942extern int delete_trivially_dead_insns PARAMS ((rtx, int));
ac957f13 1943#ifdef BUFSIZ
cdadb1dd 1944extern int cse_main PARAMS ((rtx, int, int, FILE *));
ac957f13 1945#endif
cdadb1dd 1946extern void cse_end_of_basic_block PARAMS ((rtx,
ac957f13
JL
1947 struct cse_basic_block_data *,
1948 int, int, int));
1949
1950/* In jump.c */
cdadb1dd
KG
1951extern int comparison_dominates_p PARAMS ((enum rtx_code, enum rtx_code));
1952extern int condjump_p PARAMS ((rtx));
e4c85816
JH
1953extern int any_condjump_p PARAMS ((rtx));
1954extern int any_uncondjump_p PARAMS ((rtx));
1955extern int safe_to_remove_jump_p PARAMS ((rtx));
1956extern rtx pc_set PARAMS ((rtx));
cdadb1dd
KG
1957extern rtx condjump_label PARAMS ((rtx));
1958extern int simplejump_p PARAMS ((rtx));
1959extern int returnjump_p PARAMS ((rtx));
1960extern int onlyjump_p PARAMS ((rtx));
44ce0063 1961extern int only_sets_cc0_p PARAMS ((rtx));
cdadb1dd 1962extern int sets_cc0_p PARAMS ((rtx));
2ea64f10 1963extern int invert_jump_1 PARAMS ((rtx, rtx));
9ba11d5a 1964extern int invert_jump PARAMS ((rtx, rtx, int));
cdadb1dd
KG
1965extern int rtx_renumbered_equal_p PARAMS ((rtx, rtx));
1966extern int true_regnum PARAMS ((rtx));
344b78b8 1967extern unsigned int reg_or_subregno PARAMS ((rtx));
2ea64f10 1968extern int redirect_jump_1 PARAMS ((rtx, rtx));
9ba11d5a 1969extern int redirect_jump PARAMS ((rtx, rtx, int));
cdadb1dd 1970extern void rebuild_jump_labels PARAMS ((rtx));
ab94bc48
JH
1971extern enum rtx_code reversed_comparison_code PARAMS ((rtx, rtx));
1972extern enum rtx_code reversed_comparison_code_parts PARAMS ((enum rtx_code,
1973 rtx, rtx, rtx));
cdadb1dd
KG
1974extern void delete_for_peephole PARAMS ((rtx, rtx));
1975extern int condjump_in_parallel_p PARAMS ((rtx));
56d44285 1976extern void never_reached_warning PARAMS ((rtx, rtx));
0045d504
JH
1977extern void purge_line_number_notes PARAMS ((rtx));
1978extern void copy_loop_headers PARAMS ((rtx));
14bf4a33 1979
eebedaa5 1980/* In emit-rtl.c. */
cdadb1dd
KG
1981extern int max_reg_num PARAMS ((void));
1982extern int max_label_num PARAMS ((void));
1983extern int get_first_label_num PARAMS ((void));
1984extern void delete_insns_since PARAMS ((rtx));
1985extern void mark_reg_pointer PARAMS ((rtx, int));
1986extern void mark_user_reg PARAMS ((rtx));
1987extern void reset_used_flags PARAMS ((rtx));
1988extern void reorder_insns PARAMS ((rtx, rtx, rtx));
3c030e88 1989extern void reorder_insns_nobb PARAMS ((rtx, rtx, rtx));
cdadb1dd
KG
1990extern int get_max_uid PARAMS ((void));
1991extern int in_sequence_p PARAMS ((void));
1992extern void force_next_line_note PARAMS ((void));
cdadb1dd
KG
1993extern void init_emit PARAMS ((void));
1994extern void init_emit_once PARAMS ((int));
1995extern void push_topmost_sequence PARAMS ((void));
1996extern void pop_topmost_sequence PARAMS ((void));
1997extern int subreg_realpart_p PARAMS ((rtx));
1998extern void reverse_comparison PARAMS ((rtx));
1999extern void set_new_first_and_last_insn PARAMS ((rtx, rtx));
2000extern void set_new_first_and_last_label_num PARAMS ((int, int));
2001extern void set_new_last_label_num PARAMS ((int));
d1b81779 2002extern void unshare_all_rtl_again PARAMS ((rtx));
0010687d 2003extern void set_first_insn PARAMS ((rtx));
cdadb1dd
KG
2004extern void set_last_insn PARAMS ((rtx));
2005extern void link_cc0_insns PARAMS ((rtx));
2006extern void add_insn PARAMS ((rtx));
2007extern void add_insn_before PARAMS ((rtx, rtx));
2008extern void add_insn_after PARAMS ((rtx, rtx));
2009extern void remove_insn PARAMS ((rtx));
2010extern void reorder_insns_with_line_notes PARAMS ((rtx, rtx, rtx));
2011extern void emit_insn_after_with_line_notes PARAMS ((rtx, rtx, rtx));
2012extern enum rtx_code classify_insn PARAMS ((rtx));
2013extern rtx emit PARAMS ((rtx));
a11759a3
JR
2014/* Query and clear/ restore no_line_numbers. This is used by the
2015 switch / case handling in stmt.c to give proper line numbers in
2016 warnings about unreachable code. */
cdadb1dd
KG
2017int force_line_numbers PARAMS ((void));
2018void restore_line_number_status PARAMS ((int old_value));
2019extern void renumber_insns PARAMS ((FILE *));
f8855270 2020extern void remove_unnecessary_notes PARAMS ((void));
53c17031
JH
2021extern rtx delete_insn PARAMS ((rtx));
2022extern void delete_insn_chain PARAMS ((rtx, rtx));
3dec4024
JH
2023extern rtx delete_insn_and_edges PARAMS ((rtx));
2024extern void delete_insn_chain_and_edges PARAMS ((rtx, rtx));
ac957f13 2025
ac957f13 2026/* In combine.c */
770ae6cc
RK
2027extern int combine_instructions PARAMS ((rtx, unsigned int));
2028extern unsigned int extended_count PARAMS ((rtx, enum machine_mode, int));
2029extern rtx remove_death PARAMS ((unsigned int, rtx));
ac957f13 2030#ifdef BUFSIZ
cdadb1dd
KG
2031extern void dump_combine_stats PARAMS ((FILE *));
2032extern void dump_combine_total_stats PARAMS ((FILE *));
ac957f13
JL
2033#endif
2034
eebedaa5 2035/* In sched.c. */
ac957f13 2036#ifdef BUFSIZ
cdadb1dd 2037extern void schedule_insns PARAMS ((FILE *));
18e720b3 2038extern void schedule_ebbs PARAMS ((FILE *));
ac957f13 2039#endif
cdadb1dd 2040extern void fix_sched_param PARAMS ((const char *, const char *));
ac957f13
JL
2041
2042/* In print-rtl.c */
47c10e9b 2043extern const char *print_rtx_head;
cdadb1dd
KG
2044extern void debug_rtx PARAMS ((rtx));
2045extern void debug_rtx_list PARAMS ((rtx, int));
4c85a96d 2046extern void debug_rtx_range PARAMS ((rtx, rtx));
cdadb1dd 2047extern rtx debug_rtx_find PARAMS ((rtx, int));
ac957f13 2048#ifdef BUFSIZ
998d7deb 2049extern void print_mem_expr PARAMS ((FILE *, tree));
cdadb1dd 2050extern void print_rtl PARAMS ((FILE *, rtx));
75b7557d 2051extern void print_simple_rtl PARAMS ((FILE *, rtx));
cdadb1dd
KG
2052extern int print_rtl_single PARAMS ((FILE *, rtx));
2053extern void print_inline_rtx PARAMS ((FILE *, rtx, int));
ac957f13
JL
2054#endif
2055
2056/* In loop.c */
cdadb1dd
KG
2057extern void init_loop PARAMS ((void));
2058extern rtx libcall_other_reg PARAMS ((rtx, rtx));
ac957f13 2059#ifdef BUFSIZ
1bf14ad7 2060extern void loop_optimize PARAMS ((rtx, FILE *, int));
ac957f13 2061#endif
cdadb1dd 2062extern void record_excess_regs PARAMS ((rtx, rtx, rtx *));
ac957f13
JL
2063
2064/* In function.c */
cdadb1dd
KG
2065extern void reposition_prologue_and_epilogue_notes PARAMS ((rtx));
2066extern void thread_prologue_and_epilogue_insns PARAMS ((rtx));
2067extern int prologue_epilogue_contains PARAMS ((rtx));
0a1c58a2 2068extern int sibcall_epilogue_contains PARAMS ((rtx));
591ccf92 2069extern void preserve_rtl_expr_result PARAMS ((rtx));
cdadb1dd
KG
2070extern void mark_temp_addr_taken PARAMS ((rtx));
2071extern void update_temp_slot_address PARAMS ((rtx, rtx));
cdadb1dd 2072extern void purge_addressof PARAMS ((rtx));
659e47fb 2073extern void purge_hard_subreg_sets PARAMS ((rtx));
ac957f13 2074
ac957f13 2075/* In stmt.c */
47ee9bcb 2076extern void set_file_and_line_for_stmt PARAMS ((const char *, int));
cdadb1dd
KG
2077extern void expand_null_return PARAMS ((void));
2078extern void emit_jump PARAMS ((rtx));
2079extern int preserve_subexpressions_p PARAMS ((void));
ac957f13
JL
2080
2081/* In expr.c */
3bdf5ad1
RK
2082extern void move_by_pieces PARAMS ((rtx, rtx,
2083 unsigned HOST_WIDE_INT,
2084 unsigned int));
2e245dac 2085
ac957f13 2086/* In flow.c */
0626ef8a
AM
2087extern void recompute_reg_usage PARAMS ((rtx, int));
2088extern int initialize_uninitialized_subregs PARAMS ((void));
0010687d 2089extern void delete_dead_jumptables PARAMS ((void));
ac957f13 2090#ifdef BUFSIZ
0626ef8a
AM
2091extern void print_rtl_with_bb PARAMS ((FILE *, rtx));
2092extern void dump_flow_info PARAMS ((FILE *));
ac957f13
JL
2093#endif
2094
2095/* In expmed.c */
cdadb1dd
KG
2096extern void init_expmed PARAMS ((void));
2097extern void expand_inc PARAMS ((rtx, rtx));
2098extern void expand_dec PARAMS ((rtx, rtx));
2099extern rtx expand_mult_highpart PARAMS ((enum machine_mode, rtx,
ac957f13
JL
2100 unsigned HOST_WIDE_INT, rtx,
2101 int, int));
2102
50b2596f
KG
2103/* In gcse.c */
2104#ifdef BUFSIZ
cdadb1dd 2105extern int gcse_main PARAMS ((rtx, FILE *));
a0134312 2106extern int bypass_jumps PARAMS ((FILE *));
50b2596f
KG
2107#endif
2108
ac957f13 2109/* In global.c */
cdadb1dd 2110extern void mark_elimination PARAMS ((int, int));
ac957f13 2111#ifdef BUFSIZ
cdadb1dd
KG
2112extern int global_alloc PARAMS ((FILE *));
2113extern void dump_global_regs PARAMS ((FILE *));
ac957f13 2114#endif
cab634f2 2115#ifdef HARD_CONST
cff9f8d5 2116/* Yes, this ifdef is silly, but HARD_REG_SET is not always defined. */
cdadb1dd 2117extern void retry_global_alloc PARAMS ((int, HARD_REG_SET));
cab634f2 2118#endif
d29c259b 2119extern void build_insn_chain PARAMS ((rtx));
ac957f13
JL
2120
2121/* In regclass.c */
cdadb1dd
KG
2122extern int reg_classes_intersect_p PARAMS ((enum reg_class, enum reg_class));
2123extern int reg_class_subset_p PARAMS ((enum reg_class, enum reg_class));
2124extern void globalize_reg PARAMS ((int));
2125extern void init_regs PARAMS ((void));
6cde4876 2126extern void init_fake_stack_mems PARAMS ((void));
cdadb1dd
KG
2127extern void init_reg_sets PARAMS ((void));
2128extern void regset_release_memory PARAMS ((void));
2129extern void regclass_init PARAMS ((void));
2130extern void regclass PARAMS ((rtx, int, FILE *));
770ae6cc
RK
2131extern void reg_scan PARAMS ((rtx, unsigned int, int));
2132extern void reg_scan_update PARAMS ((rtx, rtx, unsigned int));
cdadb1dd 2133extern void fix_register PARAMS ((const char *, int, int));
cff9f8d5
AH
2134#ifdef HARD_CONST
2135extern void cannot_change_mode_set_regs PARAMS ((HARD_REG_SET *,
2136 enum machine_mode,
2137 unsigned int));
2138#endif
2139extern bool invalid_mode_change_p PARAMS ((unsigned int,
2140 enum reg_class,
2141 enum machine_mode));
cdadb1dd 2142
99a15921 2143extern int delete_null_pointer_checks PARAMS ((rtx));
a157febd 2144
50b2596f
KG
2145/* In regmove.c */
2146#ifdef BUFSIZ
cdadb1dd 2147extern void regmove_optimize PARAMS ((rtx, int, FILE *));
50b2596f 2148#endif
1e7f0a48 2149extern void combine_stack_adjustments PARAMS ((void));
50b2596f
KG
2150
2151/* In reorg.c */
2152#ifdef BUFSIZ
cdadb1dd 2153extern void dbr_schedule PARAMS ((rtx, FILE *));
50b2596f
KG
2154#endif
2155
ac957f13
JL
2156/* In local-alloc.c */
2157#ifdef BUFSIZ
cdadb1dd 2158extern void dump_local_alloc PARAMS ((FILE *));
ac957f13 2159#endif
cdadb1dd
KG
2160extern int local_alloc PARAMS ((void));
2161extern int function_invariant_p PARAMS ((rtx));
ac957f13 2162
ac957f13 2163/* In profile.c */
cdadb1dd 2164extern void init_branch_prob PARAMS ((const char *));
51891abe
JH
2165extern void branch_prob PARAMS ((void));
2166extern void end_branch_prob PARAMS ((void));
4977bab6 2167extern void create_profiler PARAMS ((void));
ac957f13
JL
2168
2169/* In reg-stack.c */
2170#ifdef BUFSIZ
b9422b69 2171extern bool reg_to_stack PARAMS ((rtx, FILE *));
ac957f13 2172#endif
ac957f13
JL
2173
2174/* In fold-const.c */
05bccae2
RK
2175extern int add_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
2176 unsigned HOST_WIDE_INT, HOST_WIDE_INT,
2177 unsigned HOST_WIDE_INT *,
2178 HOST_WIDE_INT *));
2179extern int neg_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
2180 unsigned HOST_WIDE_INT *,
2181 HOST_WIDE_INT *));
2182extern int mul_double PARAMS ((unsigned HOST_WIDE_INT,
2183 HOST_WIDE_INT,
2184 unsigned HOST_WIDE_INT, HOST_WIDE_INT,
2185 unsigned HOST_WIDE_INT *,
2186 HOST_WIDE_INT *));
2187extern void lshift_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
2188 HOST_WIDE_INT, unsigned int,
2189 unsigned HOST_WIDE_INT *,
2190 HOST_WIDE_INT *, int));
2191extern void rshift_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
2192 HOST_WIDE_INT, unsigned int,
2193 unsigned HOST_WIDE_INT *,
2194 HOST_WIDE_INT *, int));
2195extern void lrotate_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
2196 HOST_WIDE_INT, unsigned int,
2197 unsigned HOST_WIDE_INT *,
2198 HOST_WIDE_INT *));
2199extern void rrotate_double PARAMS ((unsigned HOST_WIDE_INT, HOST_WIDE_INT,
2200 HOST_WIDE_INT, unsigned int,
2201 unsigned HOST_WIDE_INT *,
2202 HOST_WIDE_INT *));
ac957f13
JL
2203
2204/* In calls.c */
ebb1b59a
BS
2205enum libcall_type
2206{
2207 LCT_NORMAL = 0,
2208 LCT_CONST = 1,
2209 LCT_PURE = 2,
2210 LCT_CONST_MAKE_BLOCK = 3,
695ee791 2211 LCT_PURE_MAKE_BLOCK = 4,
9555a122 2212 LCT_NORETURN = 5,
9d98f8f9 2213 LCT_THROW = 6,
9defc9b7
RH
2214 LCT_ALWAYS_RETURN = 7,
2215 LCT_RETURNS_TWICE = 8
ebb1b59a
BS
2216};
2217
2218extern void emit_library_call PARAMS ((rtx, enum libcall_type,
2219 enum machine_mode, int,
2220 ...));
2221extern rtx emit_library_call_value PARAMS ((rtx, rtx, enum libcall_type,
2222 enum machine_mode, int,
2223 ...));
ac957f13
JL
2224
2225/* In unroll.c */
cdadb1dd 2226extern int set_dominates_use PARAMS ((int, int, int, rtx, rtx));
ac957f13
JL
2227
2228/* In varasm.c */
cdadb1dd 2229extern int in_data_section PARAMS ((void));
cdadb1dd 2230extern void init_varasm_once PARAMS ((void));
ac957f13
JL
2231
2232/* In rtl.c */
cdadb1dd 2233extern void init_rtl PARAMS ((void));
c25c12b8
R
2234extern void traverse_md_constants PARAMS ((int (*) (void **, void *),
2235 void *));
2236struct md_constant { char *name, *value; };
ac957f13 2237
bcdaba58 2238#ifdef BUFSIZ
cdadb1dd
KG
2239extern int read_skip_spaces PARAMS ((FILE *));
2240extern rtx read_rtx PARAMS ((FILE *));
bcdaba58
RH
2241#endif
2242
2243extern const char *read_rtx_filename;
2244extern int read_rtx_lineno;
2245
987009bf
ZW
2246/* Redefine abort to report an internal error w/o coredump, and
2247 reporting the location of the error in the source file. This logic
2248 is duplicated in rtl.h and tree.h because every file that needs the
2249 special abort includes one or both. toplev.h gets too few files,
2250 system.h gets too many. */
2251
cdadb1dd 2252extern void fancy_abort PARAMS ((const char *, int, const char *))
987009bf 2253 ATTRIBUTE_NORETURN;
fbfc1192 2254#define abort() fancy_abort (__FILE__, __LINE__, __FUNCTION__)
987009bf 2255
ac957f13 2256/* In alias.c */
43fe47ca 2257extern void clear_reg_alias_info PARAMS ((rtx));
db048faf 2258extern rtx canon_rtx PARAMS ((rtx));
cdadb1dd 2259extern int true_dependence PARAMS ((rtx, enum machine_mode, rtx,
e38fe8e0 2260 int (*)(rtx, int)));
a13d4ebf
AM
2261extern rtx get_addr PARAMS ((rtx));
2262extern int canon_true_dependence PARAMS ((rtx, enum machine_mode, rtx,
2263 rtx, int (*)(rtx, int)));
cdadb1dd
KG
2264extern int read_dependence PARAMS ((rtx, rtx));
2265extern int anti_dependence PARAMS ((rtx, rtx));
2266extern int output_dependence PARAMS ((rtx, rtx));
2267extern void mark_constant_function PARAMS ((void));
2268extern void init_alias_once PARAMS ((void));
2269extern void init_alias_analysis PARAMS ((void));
2270extern void end_alias_analysis PARAMS ((void));
cdadb1dd 2271extern rtx addr_side_effect_eval PARAMS ((rtx, int, int));
7b52eede 2272extern bool memory_modified_in_insn_p PARAMS ((rtx, rtx));
4c649323 2273
0a1c58a2
JL
2274/* In sibcall.c */
2275typedef enum {
2276 sibcall_use_normal = 1,
2277 sibcall_use_tail_recursion,
2278 sibcall_use_sibcall
2279} sibcall_use_t;
2280
2281extern void optimize_sibling_and_tail_recursive_calls PARAMS ((void));
2282extern void replace_call_placeholder PARAMS ((rtx, sibcall_use_t));
2283
21b2cd73 2284#ifdef STACK_REGS
cdadb1dd 2285extern int stack_regs_mentioned PARAMS ((rtx insn));
21b2cd73
JH
2286#endif
2287
a157febd 2288/* In toplev.c */
e2500fed 2289extern GTY(()) rtx stack_limit_rtx;
dfdb644f 2290
7b82b5da 2291/* In regrename.c */
7b82b5da 2292extern void regrename_optimize PARAMS ((void));
8582c27b 2293extern void copyprop_hardreg_forward PARAMS ((void));
7b82b5da 2294
4db384c9 2295/* In ifcvt.c */
2ea64f10
RH
2296extern void if_convert PARAMS ((int));
2297
4db384c9
JH
2298/* In predict.c */
2299extern void invert_br_probabilities PARAMS ((rtx));
6ab16dd9 2300extern bool expensive_function_p PARAMS ((int));
5c856b23
JH
2301/* In tracer.c */
2302extern void tracer PARAMS ((void));
cff9f8d5 2303
4977bab6
ZW
2304/* In calls.c */
2305
2306/* Nonzero if this is a call to a `const' function. */
2307#define ECF_CONST 1
2308/* Nonzero if this is a call to a `volatile' function. */
2309#define ECF_NORETURN 2
2310/* Nonzero if this is a call to malloc or a related function. */
2311#define ECF_MALLOC 4
2312/* Nonzero if it is plausible that this is a call to alloca. */
2313#define ECF_MAY_BE_ALLOCA 8
2314/* Nonzero if this is a call to a function that won't throw an exception. */
2315#define ECF_NOTHROW 16
2316/* Nonzero if this is a call to setjmp or a related function. */
2317#define ECF_RETURNS_TWICE 32
2318/* Nonzero if this is a call to `longjmp'. */
2319#define ECF_LONGJMP 64
2320/* Nonzero if this is a syscall that makes a new process in the image of
2321 the current one. */
2322#define ECF_FORK_OR_EXEC 128
2323#define ECF_SIBCALL 256
2324/* Nonzero if this is a call to "pure" function (like const function,
2325 but may read memory. */
2326#define ECF_PURE 512
2327/* Nonzero if this is a call to a function that returns with the stack
2328 pointer depressed. */
2329#define ECF_SP_DEPRESSED 1024
2330/* Nonzero if this call is known to always return. */
2331#define ECF_ALWAYS_RETURN 2048
2332/* Create libcall block around the call. */
2333#define ECF_LIBCALL_BLOCK 4096
2334
2335extern int flags_from_decl_or_type PARAMS ((tree));
2336
88657302 2337#endif /* ! GCC_RTL_H */
This page took 3.173793 seconds and 5 git commands to generate.