OSDN Git Service

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