1992-03-14 06:04:21 +01:00
|
|
|
|
/* Emit RTL for the GNU C-Compiler expander.
|
1999-01-19 13:08:36 +01:00
|
|
|
|
Copyright (C) 1987, 88, 92-97, 1998, 1999 Free Software Foundation, Inc.
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
This file is part of GNU CC.
|
|
|
|
|
|
|
|
|
|
GNU CC is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
|
|
GNU CC is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with GNU CC; see the file COPYING. If not, write to
|
1995-06-15 13:33:25 +02:00
|
|
|
|
the Free Software Foundation, 59 Temple Place - Suite 330,
|
|
|
|
|
Boston, MA 02111-1307, USA. */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Middle-to-low level generation of rtx code and insns.
|
|
|
|
|
|
|
|
|
|
This file contains the functions `gen_rtx', `gen_reg_rtx'
|
|
|
|
|
and `gen_label_rtx' that are the usual ways of creating rtl
|
|
|
|
|
expressions for most purposes.
|
|
|
|
|
|
|
|
|
|
It also has the functions for creating insns and linking
|
|
|
|
|
them in the doubly-linked chain.
|
|
|
|
|
|
|
|
|
|
The patterns of the insns are created by machine-dependent
|
|
|
|
|
routines in insn-emit.c, which is generated automatically from
|
|
|
|
|
the machine description. These routines use `gen_rtx' to make
|
|
|
|
|
the individual rtx's of the pattern; what is machine dependent
|
|
|
|
|
is the kind of rtx's they make and what arguments they use. */
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
Major cutover to using system.h:
* Makefile.in (alias.o, bitmap.o, c-aux-info.o, c-common.o,
c-decl.o, c-iterate.o, c-lang.o, c-lex.o, c-pragma.o, c-typeck.o,
caller-save.o, calls.o, collect2.o, combine.o, cse.o, dbxout.o,
dwarf2out.o, dwarfout.o, emit-rtl.o, except.o, explow.o, expmed.o,
expr.o, final.o, flow.o, function.o, getpwd.o, global.o,
integrate.o, jump.o, local-alloc.o, loop.o, optabs.o, pexecute.o,
prefix.o, print-rtl.o, print-tree.o, profile.o, real.o, recog.o,
reg-stack.o, regclass.o, regmove.o, reload.o, reload1.o, reorg.o,
rtl.o, rtlanal.o, sdbout.o, stmt.o, stor-layout.o, stupid.o,
tlink.o, toplev.o, tree.o, unroll.o, varasm.o, xcoffout.o): Depend
on system.h.
* alias.c, bitmap.c, c-aux-info.c, c-common.c, c-decl.c,
c-iterate.c, c-lang.c, c-lex.c, c-pragma.c, c-typeck.c,
caller-save.c, calls.c, collect2.c, combine.c, cse.c, dbxout.c,
dwarf2out.c, dwarfout.c, emit-rtl.c, except.c, explow.c, expmed.c,
expr.c, final.c, flow.c, function.c, gcc.c, getpwd.c, global.c,
integrate.c, jump.c, local-alloc.c, loop.c, optabs.c, pexecute.c,
prefix.c, print-rtl.c, print-tree.c, profile.c, real.c, recog.c,
reg-stack.c, regclass.c, regmove.c, reload.c, reload1.c, reorg.c,
rtl.c, rtlanal.c, sched.c, sdbout.c, stmt.c, stor-layout.c,
stupid.c, tlink.c, toplev.c, tree.c, unroll.c, varasm.c,
xcoffout.c: Include system.h. Organize include ordering so
that stdarg/varargs comes before other system headers. Remove
spurious casts of functions assured of a prototype in system.h.
From-SVN: r18726
1998-03-20 15:58:42 +01:00
|
|
|
|
#include "system.h"
|
c-aux-info.c, [...]: Include toplev.h for real declaration of trim_filename.
1999-04-17 20:11 -0400 Zack Weinberg <zack@rabi.columbia.edu>
* c-aux-info.c, emit-rtl.c, explow.c, expmed.c, gcse.c,
haifa-sched.c, optabs.c, reorg.c, resource.c, sched.c: Include
toplev.h for real declaration of trim_filename.
* Makefile.in: Update dependencies.
From-SVN: r26523
1999-04-17 19:14:58 +02:00
|
|
|
|
#include "toplev.h"
|
1992-03-14 06:04:21 +01:00
|
|
|
|
#include "rtl.h"
|
1993-11-26 00:11:29 +01:00
|
|
|
|
#include "tree.h"
|
1999-09-20 12:00:03 +02:00
|
|
|
|
#include "tm_p.h"
|
1992-03-14 06:04:21 +01:00
|
|
|
|
#include "flags.h"
|
|
|
|
|
#include "function.h"
|
|
|
|
|
#include "expr.h"
|
|
|
|
|
#include "regs.h"
|
1998-02-19 01:35:51 +01:00
|
|
|
|
#include "hard-reg-set.h"
|
1992-03-14 06:04:21 +01:00
|
|
|
|
#include "insn-config.h"
|
1997-11-02 22:19:36 +01:00
|
|
|
|
#include "recog.h"
|
1992-03-14 06:04:21 +01:00
|
|
|
|
#include "real.h"
|
1993-09-21 23:25:24 +02:00
|
|
|
|
#include "obstack.h"
|
Makefile.in (HOST_RTL): Add $(HOST_PREFIX)bitmap.o.
* Makefile.in (HOST_RTL): Add $(HOST_PREFIX)bitmap.o.
(rtl.o, emit-rtl.o): Add dependency on bitmap.h.
($(HOST_PREFIX_1)rtl.o): Likewise.
($(HOST_PREFIX_1)bitmap.o): New host object.
* emit-rtl.c (toplevel): Include bitmap.h.
(gen_rtx): Handle 't' and 'b' nodes.
* print-rtl.c (print_rtx): Handle printing NOTE_INSN_LIVE notes.
Print block number for block begin/end notes. Print 't' type
nodes as a pointer. Know that the 3rd argument of live range
start/stop notes is really a range_info rtx. If type is 'b', print
out argument as a bitmap.
* rtl.c: Include bitmap.c.
(copy_rtx): Copy tree nodes as is. Copy bitmaps if type is 'b'.
(note_insn_name): Add NOTE_INSN_RANGE_{START,END}, NOTE_INSN_LIVE.
* rtl.def (RANGE_LIVE): New node to hold live information while we
recalculate the basic blocks.
(RANGE_REG, RANGE_INFO): New rtl types for live range splitting.
(RANGE_VAR): New node, to hold information saved in symbol node for New
communicating live range information to the debug output functions.
* rtl.h (rtunion_def): Add rttree and rtbit fields.
(XBITMAP, XTREE): New accessor macros.
(NOTE_LIVE_INFO): Overload NOTE_SOURCE_FILE for NOTE_INSN_LIVE notes.
(NOTE_RANGE_INFO): Similarly for NOTE_INSN_RANGE_{START,END} notes.
(NOTE_BLOCK_LIVE_RANGE_BLOCK): Define.
(NOTE_INSN_RANGE_START, NOTE_INSN_RANGE_END, NOTE_INSN_LIVE): New notes.
(RANGE_LIVE_{BITMAP,ORIG_BLOCK}): New accessor macros.
(RANGE_REG_{SYMBOL,BLOCK}_NODE, RANGE_VAR_*): New accessor macros.
(RANGE_INFO_*): Likewise.
* sched.c (sched_analyze): Keep live range start/stop notes.
(unlink_other_notes): Likewise.
* haifa-sched.c (sched_analyze): Keep live range start/stop notes.
(unlink_other_notes): Likewise.
* tree.h (BLOCK_LIVE_RANGE_{START,END,VAR_FLAG}): New accessor macros.
(BLOCK_LIVE_RANGE_FLAG): Likewise.
(DECL_LIVE_RANGE_RTL): Likewise.
(struct tree_block): Add live_range_flag, live_range_var_flag,
live_range_start and live_range_end.
(struct tree_decl): Add live_range_rtl field.
* gengenrtl.c (type_from_format): Handle 'b' and 't'.
(accessor_from_format): Likewise.
Co-Authored-By: Jeffrey A Law <law@cygnus.com>
From-SVN: r19727
1998-05-13 23:13:47 +02:00
|
|
|
|
#include "bitmap.h"
|
Makefile.in (tree.o): Depend on ggc.h.
* Makefile.in (tree.o): Depend on ggc.h.
(varasm.o): Likewise.
(function.o): Likewise.
(stmt.o): Likewise.
(except.o): Likewise.
(optabs.o): Likewise.
(emit-rtl.o): Likewise.
* emit-rtl.c: Include ggc.h.
(sequence_element_free_list): Remove, and all references.
(mark_sequence): New functions.
(mark_emit_state): New function.
* except.c: Include ggc.h.
(mark_eh_node, mark_eh_stack, mark_eh_queue): New functions.
(mark_tree_label_node): New functions.
(mark_eh_state): New function.
* function.c: Include ggc.h.
(mark_temp_slot, mark_function_chain): New functions.
(mark_function_state): New function.
(init_function_once): New function.
* function.h (init_function_once): New function.
* ggc-callbacks.c (lang_mark_false_label_stack): New function.
* ggc.h (label_node): Declare.
(eh_status, emit_status, stmt_status, varasm_status): Likewise.
(lang_mark_false_label_stack): New function.
(mark_temp_slot): Remove declaration.
(mark_function_chain): Likewise.
(mark_eh_state): Adjust prototype.
(mark_stmt_state, mark_emit_state, mark_varasm_state, mark_optab):
Likewise.
* optabs.c: Include ggc.h.
(mark_optab): New function.
(init_optabs): Add gc roots.
* stmt.c: Include ggc.h.
(mark_cond_nesting, mark_loop_nesting): New functions.
(mark_block_nesting, mark_case_nesting, mark_goto_fixup): Likewise.
(mark_stmt_state): New function.
* toplev.c (compile_file): Call init_function_once.
* tree.c: Include ggc.h.
(type_hash): Move declaration earlier in file.
(TYPE_HASH_SIZE, type_hash_table): Likewise.
(init_obstacks): Add gc roots.
(mark_type_hash): New function.
* varasm.c: Include ggc.h.
(mark_pool_constant): New function.
(mark_varasm_state): New function.
Co-Authored-By: Bernd Schmidt <bernds@cygnus.co.uk>
Co-Authored-By: Mark Mitchell <mark@codesourcery.com>
From-SVN: r29119
1999-09-05 04:41:35 +02:00
|
|
|
|
#include "ggc.h"
|
1993-09-21 23:25:24 +02:00
|
|
|
|
|
1993-10-07 22:05:34 +01:00
|
|
|
|
/* Commonly used modes. */
|
|
|
|
|
|
1996-07-04 00:07:53 +02:00
|
|
|
|
enum machine_mode byte_mode; /* Mode whose width is BITS_PER_UNIT. */
|
|
|
|
|
enum machine_mode word_mode; /* Mode whose width is BITS_PER_WORD. */
|
1998-06-29 23:40:49 +02:00
|
|
|
|
enum machine_mode double_mode; /* Mode whose width is DOUBLE_TYPE_SIZE. */
|
1996-07-04 00:07:53 +02:00
|
|
|
|
enum machine_mode ptr_mode; /* Mode whose width is POINTER_SIZE. */
|
1993-10-07 22:05:34 +01:00
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
/* This is *not* reset after each function. It gives each CODE_LABEL
|
|
|
|
|
in the entire compilation a unique label number. */
|
|
|
|
|
|
|
|
|
|
static int label_num = 1;
|
|
|
|
|
|
|
|
|
|
/* Highest label number in current function.
|
|
|
|
|
Zero means use the value of label_num instead.
|
|
|
|
|
This is nonzero only when belatedly compiling an inline function. */
|
|
|
|
|
|
|
|
|
|
static int last_label_num;
|
|
|
|
|
|
|
|
|
|
/* Value label_num had when set_new_first_and_last_label_number was called.
|
|
|
|
|
If label_num has not changed since then, last_label_num is valid. */
|
|
|
|
|
|
|
|
|
|
static int base_label_num;
|
|
|
|
|
|
|
|
|
|
/* Nonzero means do not generate NOTEs for source line numbers. */
|
|
|
|
|
|
|
|
|
|
static int no_line_numbers;
|
|
|
|
|
|
|
|
|
|
/* Commonly used rtx's, so that we only need space for one copy.
|
|
|
|
|
These are initialized once for the entire compilation.
|
|
|
|
|
All of these except perhaps the floating-point CONST_DOUBLEs
|
|
|
|
|
are unique; no other rtx-object will be equal to any of these. */
|
|
|
|
|
|
1999-09-18 20:16:44 +02:00
|
|
|
|
rtx global_rtl[GR_MAX];
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
/* We record floating-point CONST_DOUBLEs in each floating-point mode for
|
|
|
|
|
the values of 0, 1, and 2. For the integer entries and VOIDmode, we
|
|
|
|
|
record a copy of const[012]_rtx. */
|
|
|
|
|
|
|
|
|
|
rtx const_tiny_rtx[3][(int) MAX_MACHINE_MODE];
|
|
|
|
|
|
1997-12-12 01:27:40 +01:00
|
|
|
|
rtx const_true_rtx;
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
REAL_VALUE_TYPE dconst0;
|
|
|
|
|
REAL_VALUE_TYPE dconst1;
|
|
|
|
|
REAL_VALUE_TYPE dconst2;
|
|
|
|
|
REAL_VALUE_TYPE dconstm1;
|
|
|
|
|
|
|
|
|
|
/* All references to the following fixed hard registers go through
|
|
|
|
|
these unique rtl objects. On machines where the frame-pointer and
|
|
|
|
|
arg-pointer are the same register, they use the same unique object.
|
|
|
|
|
|
|
|
|
|
After register allocation, other rtl objects which used to be pseudo-regs
|
|
|
|
|
may be clobbered to refer to the frame-pointer register.
|
|
|
|
|
But references that were originally to the frame-pointer can be
|
|
|
|
|
distinguished from the others because they contain frame_pointer_rtx.
|
|
|
|
|
|
1993-09-24 21:39:25 +02:00
|
|
|
|
When to use frame_pointer_rtx and hard_frame_pointer_rtx is a little
|
|
|
|
|
tricky: until register elimination has taken place hard_frame_pointer_rtx
|
|
|
|
|
should be used if it is being set, and frame_pointer_rtx otherwise. After
|
|
|
|
|
register elimination hard_frame_pointer_rtx should always be used.
|
|
|
|
|
On machines where the two registers are same (most) then these are the
|
|
|
|
|
same.
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
In an inline procedure, the stack and frame pointer rtxs may not be
|
|
|
|
|
used for anything else. */
|
|
|
|
|
rtx struct_value_rtx; /* (REG:Pmode STRUCT_VALUE_REGNUM) */
|
|
|
|
|
rtx struct_value_incoming_rtx; /* (REG:Pmode STRUCT_VALUE_INCOMING_REGNUM) */
|
|
|
|
|
rtx static_chain_rtx; /* (REG:Pmode STATIC_CHAIN_REGNUM) */
|
|
|
|
|
rtx static_chain_incoming_rtx; /* (REG:Pmode STATIC_CHAIN_INCOMING_REGNUM) */
|
|
|
|
|
rtx pic_offset_table_rtx; /* (REG:Pmode PIC_OFFSET_TABLE_REGNUM) */
|
|
|
|
|
|
1995-12-20 00:25:43 +01:00
|
|
|
|
/* This is used to implement __builtin_return_address for some machines.
|
|
|
|
|
See for instance the MIPS port. */
|
|
|
|
|
rtx return_address_pointer_rtx; /* (REG:Pmode RETURN_ADDRESS_POINTER_REGNUM) */
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* We make one copy of (const_int C) where C is in
|
|
|
|
|
[- MAX_SAVED_CONST_INT, MAX_SAVED_CONST_INT]
|
|
|
|
|
to save space during the compilation and simplify comparisons of
|
|
|
|
|
integers. */
|
|
|
|
|
|
1999-09-18 20:16:44 +02:00
|
|
|
|
rtx const_int_rtx[MAX_SAVED_CONST_INT * 2 + 1];
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
/* start_sequence and gen_sequence can make a lot of rtx expressions which are
|
|
|
|
|
shortly thrown away. We use two mechanisms to prevent this waste:
|
|
|
|
|
|
1999-09-05 18:08:20 +02:00
|
|
|
|
For sizes up to 5 elements, we keep a SEQUENCE and its associated
|
|
|
|
|
rtvec for use by gen_sequence. One entry for each size is
|
|
|
|
|
sufficient because most cases are calls to gen_sequence followed by
|
|
|
|
|
immediately emitting the SEQUENCE. Reuse is safe since emitting a
|
|
|
|
|
sequence is destructive on the insn in it anyway and hence can't be
|
|
|
|
|
redone.
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
We do not bother to save this cached data over nested function calls.
|
|
|
|
|
Instead, we just reinitialize them. */
|
|
|
|
|
|
|
|
|
|
#define SEQUENCE_RESULT_SIZE 5
|
|
|
|
|
|
|
|
|
|
static rtx sequence_result[SEQUENCE_RESULT_SIZE];
|
|
|
|
|
|
1996-07-04 00:07:53 +02:00
|
|
|
|
/* During RTL generation, we also keep a list of free INSN rtl codes. */
|
1996-03-10 12:23:17 +01:00
|
|
|
|
static rtx free_insn;
|
|
|
|
|
|
1999-08-09 16:00:21 +02:00
|
|
|
|
#define first_insn (current_function->emit->x_first_insn)
|
|
|
|
|
#define last_insn (current_function->emit->x_last_insn)
|
|
|
|
|
#define cur_insn_uid (current_function->emit->x_cur_insn_uid)
|
|
|
|
|
#define last_linenum (current_function->emit->x_last_linenum)
|
|
|
|
|
#define last_filename (current_function->emit->x_last_filename)
|
|
|
|
|
#define first_label_num (current_function->emit->x_first_label_num)
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
1997-12-07 01:31:01 +01:00
|
|
|
|
static rtx make_jump_insn_raw PROTO((rtx));
|
|
|
|
|
static rtx make_call_insn_raw PROTO((rtx));
|
1997-12-20 12:31:54 +01:00
|
|
|
|
static rtx find_line_note PROTO((rtx));
|
Makefile.in (tree.o): Depend on ggc.h.
* Makefile.in (tree.o): Depend on ggc.h.
(varasm.o): Likewise.
(function.o): Likewise.
(stmt.o): Likewise.
(except.o): Likewise.
(optabs.o): Likewise.
(emit-rtl.o): Likewise.
* emit-rtl.c: Include ggc.h.
(sequence_element_free_list): Remove, and all references.
(mark_sequence): New functions.
(mark_emit_state): New function.
* except.c: Include ggc.h.
(mark_eh_node, mark_eh_stack, mark_eh_queue): New functions.
(mark_tree_label_node): New functions.
(mark_eh_state): New function.
* function.c: Include ggc.h.
(mark_temp_slot, mark_function_chain): New functions.
(mark_function_state): New function.
(init_function_once): New function.
* function.h (init_function_once): New function.
* ggc-callbacks.c (lang_mark_false_label_stack): New function.
* ggc.h (label_node): Declare.
(eh_status, emit_status, stmt_status, varasm_status): Likewise.
(lang_mark_false_label_stack): New function.
(mark_temp_slot): Remove declaration.
(mark_function_chain): Likewise.
(mark_eh_state): Adjust prototype.
(mark_stmt_state, mark_emit_state, mark_varasm_state, mark_optab):
Likewise.
* optabs.c: Include ggc.h.
(mark_optab): New function.
(init_optabs): Add gc roots.
* stmt.c: Include ggc.h.
(mark_cond_nesting, mark_loop_nesting): New functions.
(mark_block_nesting, mark_case_nesting, mark_goto_fixup): Likewise.
(mark_stmt_state): New function.
* toplev.c (compile_file): Call init_function_once.
* tree.c: Include ggc.h.
(type_hash): Move declaration earlier in file.
(TYPE_HASH_SIZE, type_hash_table): Likewise.
(init_obstacks): Add gc roots.
(mark_type_hash): New function.
* varasm.c: Include ggc.h.
(mark_pool_constant): New function.
(mark_varasm_state): New function.
Co-Authored-By: Bernd Schmidt <bernds@cygnus.co.uk>
Co-Authored-By: Mark Mitchell <mark@codesourcery.com>
From-SVN: r29119
1999-09-05 04:41:35 +02:00
|
|
|
|
static void mark_sequence_stack PROTO((struct sequence_stack *));
|
1993-09-21 23:25:24 +02:00
|
|
|
|
|
1999-09-07 07:49:18 +02:00
|
|
|
|
/* There are some RTL codes that require special attention; the generation
|
|
|
|
|
functions do the raw handling. If you add to this list, modify
|
|
|
|
|
special_rtx in gengenrtl.c as well. */
|
|
|
|
|
|
1998-01-08 22:17:05 +01:00
|
|
|
|
rtx
|
|
|
|
|
gen_rtx_CONST_INT (mode, arg)
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
HOST_WIDE_INT arg;
|
|
|
|
|
{
|
|
|
|
|
if (arg >= - MAX_SAVED_CONST_INT && arg <= MAX_SAVED_CONST_INT)
|
1999-09-18 20:16:44 +02:00
|
|
|
|
return const_int_rtx[arg + MAX_SAVED_CONST_INT];
|
1998-01-08 22:17:05 +01:00
|
|
|
|
|
|
|
|
|
#if STORE_FLAG_VALUE != 1 && STORE_FLAG_VALUE != -1
|
|
|
|
|
if (const_true_rtx && arg == STORE_FLAG_VALUE)
|
|
|
|
|
return const_true_rtx;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
return gen_rtx_raw_CONST_INT (mode, arg);
|
|
|
|
|
}
|
|
|
|
|
|
1999-04-01 19:06:09 +02:00
|
|
|
|
/* CONST_DOUBLEs needs special handling because its length is known
|
|
|
|
|
only at run-time. */
|
|
|
|
|
rtx
|
|
|
|
|
gen_rtx_CONST_DOUBLE (mode, arg0, arg1, arg2)
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
rtx arg0;
|
|
|
|
|
HOST_WIDE_INT arg1, arg2;
|
|
|
|
|
{
|
|
|
|
|
rtx r = rtx_alloc (CONST_DOUBLE);
|
1999-04-06 17:49:17 +02:00
|
|
|
|
int i;
|
|
|
|
|
|
1999-04-01 19:06:09 +02:00
|
|
|
|
PUT_MODE (r, mode);
|
|
|
|
|
XEXP (r, 0) = arg0;
|
rtl.h (RTL_CHECK1, RTL_CHECK2): New macros which type- and bounds- check RTL accesses if --enable-checking.
1999-08-31 12:20 -0700 Zack Weinberg <zack@bitmover.com>
* rtl.h (RTL_CHECK1, RTL_CHECK2): New macros which type- and
bounds- check RTL accesses if --enable-checking.
(RTVEC_ELT): Bounds check if --enable-checking.
(XWINT, XINT, XSTR, XEXP, XVEC, XMODE, XBITMAP, XTREE,
XBBDEF): Use RTL_CHECK1/RTL_CHECK2 as appropriate.
(XVECEXP, XVECLEN): Define in terms of XVEC, RTVEC_ELT, and
GET_NUM_ELEM.
(X0WINT, X0INT, X0STR, X0EXP, X0VEC, X0MODE, X0BITMAP, X0TREE,
X0BBDEF, X0ADVFLAGS): New macros for accessing '0' slots of RTXes.
(ADDR_DIFF_VEC_FLAGS): Use X0ADVFLAGS.
(NOTE_SOURCE_FILE): Use X0STR.
(NOTE_BLOCK_NUMBER, NOTE_EH_HANDLER, LABEL_NUSES,
MEM_ALIAS_SET): Use X0INT.
(NOTE_RANGE_INFO, NOTE_LIVE_INFO, NOTE_BASIC_BLOCK,
JUMP_LABEL, LABEL_REFS, LABEL_NEXTREF, CONTAINING_INSN):
Use X0EXP.
* real.h (CONST_DOUBLE_CHAIN): Use X0EXP.
* rtl.c (copy_rtx, copy_most_rtx): Copy '0' slots with X0WINT.
(rtl_check_failed_bounds, rtl_check_failed_type1,
rtl_check_failed_type2, rtvec_check_failed_bounds): New
functions.
(fancy_abort): Fix comment.
* cse.c (canon_hash): Read CONST_DOUBLE data slots with XWINT.
(cse_insn): Decrement LABEL_NUSES for jump target before
deleting jump insn.
* emit-rtl.c (gen_rtx_CONST_DOUBLE): Use X0EXP for slot 1.
* final.c (alter_subreg): Compute regno before changing x to
REG; set REGNO(x) after changing it.
* flow.c (count_basic_blocks): Use XWINT to inspect EH_REGION
notes containing CONST_INTs.
(delete_eh_regions): Use NOTE_EH_HANDLER.
* function.c (put_reg_into_stack): Make reg a MEM before
initializing it.
(fixup_var_refs_insns): Save REG_NOTES (insn) in case we
delete insn.
(gen_mem_addressof): Make reg a MEM before initializing it.
* integrate.c (copy_rtx_and_substitute): Copy '0' slots with
X0WINT.
* local-alloc.c (update_equiv_regs): Zap REG_NOTES before
deleting an insn, not after.
(block_alloc): Only look at PATTERN(insn) if we have to, and
only if it's format class 'i'.
* loop.c (check_dbra_loop): Check bl->biv->add_val is a
CONST_INT before using its INTVAL.
* print-rtl.c (print_rtx): Use X0STR.
* regmove.c (fixup_match_1): Don't look at PATTERN of
non-class-'i' insn chain elements.
* reload.c (loc_mentioned_in_p): Take address of
in->fld[1].rtx directly.
* reload1.c (reload): Change reg to a MEM before initializing
it.
* varasm.c (mark_constant_pool): Skip CONST_DOUBLES, which
have no names.
* config/i386/i386.md (decrement_and_branch_if_zero): Fix typo.
From-SVN: r29008
1999-08-31 21:39:10 +02:00
|
|
|
|
X0EXP (r, 1) = NULL_RTX;
|
1999-04-06 17:49:17 +02:00
|
|
|
|
XWINT (r, 2) = arg1;
|
|
|
|
|
XWINT (r, 3) = arg2;
|
|
|
|
|
|
|
|
|
|
for (i = GET_RTX_LENGTH (CONST_DOUBLE) - 1; i > 3; --i)
|
|
|
|
|
XWINT (r, i) = 0;
|
|
|
|
|
|
1999-04-01 19:06:09 +02:00
|
|
|
|
return r;
|
|
|
|
|
}
|
|
|
|
|
|
1998-01-08 22:17:05 +01:00
|
|
|
|
rtx
|
|
|
|
|
gen_rtx_REG (mode, regno)
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
int regno;
|
|
|
|
|
{
|
|
|
|
|
/* In case the MD file explicitly references the frame pointer, have
|
|
|
|
|
all such references point to the same frame pointer. This is
|
|
|
|
|
used during frame pointer elimination to distinguish the explicit
|
|
|
|
|
references to these registers from pseudos that happened to be
|
|
|
|
|
assigned to them.
|
|
|
|
|
|
|
|
|
|
If we have eliminated the frame pointer or arg pointer, we will
|
|
|
|
|
be using it as a normal register, for example as a spill
|
|
|
|
|
register. In such cases, we might be accessing it in a mode that
|
|
|
|
|
is not Pmode and therefore cannot use the pre-allocated rtx.
|
|
|
|
|
|
|
|
|
|
Also don't do this when we are making new REGs in reload, since
|
|
|
|
|
we don't want to get confused with the real pointers. */
|
|
|
|
|
|
|
|
|
|
if (mode == Pmode && !reload_in_progress)
|
|
|
|
|
{
|
1999-09-14 16:37:12 +02:00
|
|
|
|
if (regno == FRAME_POINTER_REGNUM)
|
1998-01-08 22:17:05 +01:00
|
|
|
|
return frame_pointer_rtx;
|
|
|
|
|
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
|
1999-09-14 16:37:12 +02:00
|
|
|
|
if (regno == HARD_FRAME_POINTER_REGNUM)
|
1998-01-08 22:17:05 +01:00
|
|
|
|
return hard_frame_pointer_rtx;
|
|
|
|
|
#endif
|
|
|
|
|
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM && HARD_FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
|
1999-09-14 16:37:12 +02:00
|
|
|
|
if (regno == ARG_POINTER_REGNUM)
|
1998-01-08 22:17:05 +01:00
|
|
|
|
return arg_pointer_rtx;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef RETURN_ADDRESS_POINTER_REGNUM
|
1999-09-14 16:37:12 +02:00
|
|
|
|
if (regno == RETURN_ADDRESS_POINTER_REGNUM)
|
1998-01-08 22:17:05 +01:00
|
|
|
|
return return_address_pointer_rtx;
|
|
|
|
|
#endif
|
1999-09-14 16:37:12 +02:00
|
|
|
|
if (regno == STACK_POINTER_REGNUM)
|
1998-01-08 22:17:05 +01:00
|
|
|
|
return stack_pointer_rtx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return gen_rtx_raw_REG (mode, regno);
|
|
|
|
|
}
|
|
|
|
|
|
1998-06-25 17:14:41 +02:00
|
|
|
|
rtx
|
|
|
|
|
gen_rtx_MEM (mode, addr)
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
rtx addr;
|
|
|
|
|
{
|
|
|
|
|
rtx rt = gen_rtx_raw_MEM (mode, addr);
|
|
|
|
|
|
|
|
|
|
/* This field is not cleared by the mere allocation of the rtx, so
|
|
|
|
|
we clear it here. */
|
|
|
|
|
MEM_ALIAS_SET (rt) = 0;
|
|
|
|
|
|
|
|
|
|
return rt;
|
|
|
|
|
}
|
1999-09-07 07:49:18 +02:00
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* rtx gen_rtx (code, mode, [element1, ..., elementn])
|
|
|
|
|
**
|
|
|
|
|
** This routine generates an RTX of the size specified by
|
|
|
|
|
** <code>, which is an RTX code. The RTX structure is initialized
|
|
|
|
|
** from the arguments <element1> through <elementn>, which are
|
|
|
|
|
** interpreted according to the specific RTX type's format. The
|
|
|
|
|
** special machine mode associated with the rtx (if any) is specified
|
|
|
|
|
** in <mode>.
|
|
|
|
|
**
|
1993-03-31 07:48:38 +02:00
|
|
|
|
** gen_rtx can be invoked in a way which resembles the lisp-like
|
1992-03-14 06:04:21 +01:00
|
|
|
|
** rtx it will generate. For example, the following rtx structure:
|
|
|
|
|
**
|
|
|
|
|
** (plus:QI (mem:QI (reg:SI 1))
|
|
|
|
|
** (mem:QI (plusw:SI (reg:SI 2) (reg:SI 3))))
|
|
|
|
|
**
|
|
|
|
|
** ...would be generated by the following C code:
|
|
|
|
|
**
|
|
|
|
|
** gen_rtx (PLUS, QImode,
|
|
|
|
|
** gen_rtx (MEM, QImode,
|
|
|
|
|
** gen_rtx (REG, SImode, 1)),
|
|
|
|
|
** gen_rtx (MEM, QImode,
|
|
|
|
|
** gen_rtx (PLUS, SImode,
|
|
|
|
|
** gen_rtx (REG, SImode, 2),
|
|
|
|
|
** gen_rtx (REG, SImode, 3)))),
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*VARARGS2*/
|
|
|
|
|
rtx
|
1994-02-10 14:07:10 +01:00
|
|
|
|
gen_rtx VPROTO((enum rtx_code code, enum machine_mode mode, ...))
|
1992-03-14 06:04:21 +01:00
|
|
|
|
{
|
gansidecl.h: Prepend a "G" to the macro wrapping this file (to distinguish it from the macro...
* gansidecl.h: Prepend a "G" to the macro wrapping this file
(to distinguish it from the macro wrapping ansidecl.h.)
Include libiberty's ansidecl.h. Remove all redundant definitions.
Define the PROTO() style macros in terms of the PARAMS() ones.
* calls.c (emit_library_call): Switch on ANSI_PROTOTYPES, not
__STDC__, when deciding whether to use ANSI variable args.
(emit_library_call_value): Likewise.
* cccp.c (error): Likewise.
(warning): Likewise.
(error_with_line): Likewise.
(warning_with_line): Likewise.
(pedwarn): Likewise.
(pedwarn_with_line): Likewise.
(pedwarn_with_file_and_line): Likewise.
(fatal): Likewise.
* cexp.y (error): Likewise.
(pedwarn): Likewise.
(warning): Likewise.
* collect2.c (fatal_perror): Likewise.
(fatal): Likewise.
(error): Likewise.
* combine.c (gen_rtx_combine): Likewise.
* cpperror.c (cpp_message): Likewise.
(cpp_fatal): Likewise.
* cpplib.c (cpp_error): Likewise.
(cpp_warning): Likewise.
(cpp_pedwarn): Likewise.
(cpp_error_with_line): Likewise.
(cpp_warning_with_line): Likewise.
(cpp_pedwarn_with_line): Likewise.
(cpp_pedwarn_with_file_and_line): Likewise.
* cpplib.h: Don't define PARAMS() macro.
* demangle.h: Likewise.
* doprint.c (checkit): Switch on ANSI_PROTOTYPES, not __STDC__,
when deciding whether to use ANSI variable args.
* emit-rtl.c (gen_rtx): Likewise.
(gen_rtvec): Likewise.
* final.c (asm_fprintf): Likewise.
* fix-header.c (cpp_message): Likewise.
(fatal): Likewise.
(cpp_fatal): Likewise.
* gcc.c (concat): Likewise.
(fatal): Likewise.
(error): Likewise.
* genattr.c (fatal): Likewise.
* genattrtab.c (attr_rtx): Likewise.
(attr_printf): Likewise.
(fatal): Likewise.
* gencodes.c (fatal): Likewise.
* genconfig.c (fatal): Likewise.
* genemit.c (fatal): Likewise.
* genextract.c (fatal): Likewise.
* genflags.c (fatal): Likewise.
* genopinit.c (fatal): Likewise.
* genoutput.c (fatal): Likewise.
(error): Likewise.
* genpeep.c (fatal): Likewise.
* genrecog.c (fatal): Likewise.
* halfpic.h: Switch on ANSI_PROTOTYPES, not __STDC__, when
deciding whether to declare `tree_node' and `rtx_def'.
* hash.h: Don't define stuff we get from gansidecl.h.
* mips-tfile.c: Likewise. Define __proto() in terms of PARAMS().
(fatal): Switch on ANSI_PROTOTYPES, not __STDC__, when deciding
whether to use ANSI variable args.
(error): Likewise.
* prefix.c (concat): Likewise.
* scan.h: Likewise.
* system.h: Likewise.
* toplev.c (error_with_file_and_line): Likewise.
(error_with_decl): Likewise.
(error_for_asm): Likewise.
(error): Likewise.
(fatal): Likewise.
(warning_with_file_and_line): Likewise.
(warning_with_decl): Likewise.
(warning_for_asm): Likewise.
(warning): Likewise.
(pedwarn): Likewise.
(pedwarn_with_decl): Likewise.
(pedwarn_with_file_and_line): Likewise.
(sorry): Likewise.
(really_sorry): Likewise.
* toplev.h: Switch on ANSI_PROTOTYPES, not __STDC__, when deciding
whether to declare `tree_node' and `rtx_def'.
* tree.c (build): Switch on ANSI_PROTOTYPES, not __STDC__, when
deciding whether to use ANSI variable args.
(build_nt): Likewise.
(build_parse_node): Likewise.
From-SVN: r23577
1998-11-08 16:10:24 +01:00
|
|
|
|
#ifndef ANSI_PROTOTYPES
|
1992-03-14 06:04:21 +01:00
|
|
|
|
enum rtx_code code;
|
|
|
|
|
enum machine_mode mode;
|
1994-02-10 14:07:10 +01:00
|
|
|
|
#endif
|
|
|
|
|
va_list p;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
register int i; /* Array indices... */
|
rtl.h (rtx_format): Constify a char*.
* rtl.h (rtx_format): Constify a char*.
* rtl.c (rtx_format): Likewise.
(copy_rtx, copy_most_rtx, read_rtx): Likewise.
(init_rtl): Use accessor macro, not `rtx_format'.
* alias.c (rtx_equal_for_memref_p, find_symbolic_term): Constify a
char*.
* caller-save.c (mark_referenced_regs): Likewise.
* combine.c (subst, make_compound_operation, known_cond,
gen_rtx_combine, update_table_tick, get_last_value_validate,
use_crosses_set_p, mark_used_regs_combine, move_deaths): Likewise.
* cse.c (rtx_cost, mention_regs, canon_hash, exp_equiv_p,
refers_to_p, canon_reg, fold_rtx, cse_process_notes,
count_reg_usage): Likewise.
* emit-rtl.c (gen_rtx, copy_rtx_if_shared, reset_used_flags):
Likewise.
* final.c (leaf_renumber_regs_insn): Likewise.
* flow.c (mark_used_regs, find_use_as_address, dump_flow_info,
dump_edge_info, count_reg_references): Likewise.
* function.c (fixup_var_refs_1, walk_fixup_memory_subreg,
fixup_stack_1, purge_addressof_1, instantiate_virtual_regs_1):
Likewise.
* gcse.c (oprs_unchanged_p, hash_expr_1, expr_equiv_p,
oprs_not_set_p, expr_killed_p, compute_transp, find_used_regs,
add_label_notes): Likewise.
* genattrtab.c (attr_rtx, attr_copy_rtx, encode_units_mask,
clear_struct_flag, count_sub_rtxs, count_alternatives,
compares_alternatives_p, contained_in_p, walk_attr_value,
write_expr_attr_cache): Likewise.
* genconfig.c (walk_insn_part): Likewise.
* genemit.c (max_operand_1, gen_exp): Likewise.
* genextract.c (walk_rtx): Likewise.
* genflags.c (num_operands): Likewise.
* genoutput.c (scan_operands): Likewise.
* genpeep.c (match_rtx): Likewise.
* genrecog.c (add_to_sequence): Likewise.
* haifa-sched.c (may_trap_exp, sched_analyze_2, attach_deaths):
Likewise.
* integrate.c (save_constants, copy_for_inline,
copy_rtx_and_substitute, subst_constants, restore_constants):
Likewise.
* jump.c (mark_jump_label, invert_exp, redirect_exp,
rtx_renumbered_equal_p, rtx_equal_for_thread_p): Likewise.
* local-alloc.c (contains_replace_regs, memref_referenced_p):
Likewise.
* loop.c (record_excess_regs, rtx_equal_for_loop_p,
add_label_notes, replace_call_address, count_nonfixed_reads,
invariant_p, find_single_use_in_loop, find_mem_givs,
find_life_end, maybe_eliminate_biv_1, update_reg_last_use):
Likewise.
* print-rtl.c (reg_names, print_rtx): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1): Likewise.
* reg-stack.c (stack_regs_mentioned_p, record_label_references,
record_reg_life_pat, swap_rtx_condition, goto_block_pat,
print_blocks): Likewise.
* regclass.c (fix_register, record_address_regs,
reg_scan_mark_refs): Likewise.
* regmove.c (stable_but_for_p): Likewise.
* reload.c (loc_mentioned_in_p, operands_match_p,
find_reloads_toplevsubst_reg_equivs, find_reloads_address_1,
copy_replacements, refers_to_regno_for_reload_p,
refers_to_mem_for_reload_p, find_inc_amount, regno_clobbered_p,
reload_when_needed_name, reg_class_names, debug_reload_to_stream):
Likewise.
* reload1.c (eliminate_regs, scan_paradoxical_subregs,
delete_address_reloads_1, count_occurrences,
reload_cse_mem_conflict_p, reload_combine_note_use,
add_auto_inc_notes): Likewise.
* resource.c (mark_referenced_resources, mark_set_resources):
Likewise.
* rtlanal.c (rtx_unstable_p, rtx_varies_p, rtx_addr_varies_p,
reg_mentioned_p, regs_set_between_p, modified_between_p,
modified_in_p, refers_to_regno_p, reg_overlap_mentioned_p,
rtx_equal_p, volatile_insn_p, volatile_refs_p, side_effects_p,
may_trap_p, inequality_comparisons_p, replace_rtx, replace_regs,
jmp_uses_reg_or_mem, for_each_rtx, regno_use_in): Likewise.
* sched.c (sched_analyze_2, attach_deaths): Likewise.
* stupid.c (stupid_mark_refs): Likewise.
* unroll.c (remap_split_bivs): Likewise.
* varasm.c (mark_constants): Likewise.
* a29k/a29k.c (uses_local_reg_p): Likewise.
* alpha/alpha.c (summarize_insn): Likewise.
* arm/arm.c (symbol_mentioned_p, label_mentioned_p,
eliminate_lr2ip): Likewise.
* arm/thumb.c (symbol_mentioned_p, label_mentioned_p): Likewise.
* i386/i386.c (symbolic_reference_mentioned_p, copy_all_rtx,
reg_mentioned_in_mem): Likewise.
* ns32k/ns32k.c (global_symbolic_reference_mentioned_p,
symbolic_reference_mentioned_p): Likewise.
* romp/romp.c (unsigned_comparisons_p, hash_rtx): Likewise.
* sh/sh.c (regs_used, mark_use): Likewise.
* vax/vax.c (vax_rtx_cost): Likewise.
From-SVN: r28784
1999-08-21 01:05:25 +02:00
|
|
|
|
register const char *fmt; /* Current rtx's format... */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
register rtx rt_val; /* RTX to return to caller... */
|
|
|
|
|
|
1994-02-10 14:07:10 +01:00
|
|
|
|
VA_START (p, mode);
|
|
|
|
|
|
gansidecl.h: Prepend a "G" to the macro wrapping this file (to distinguish it from the macro...
* gansidecl.h: Prepend a "G" to the macro wrapping this file
(to distinguish it from the macro wrapping ansidecl.h.)
Include libiberty's ansidecl.h. Remove all redundant definitions.
Define the PROTO() style macros in terms of the PARAMS() ones.
* calls.c (emit_library_call): Switch on ANSI_PROTOTYPES, not
__STDC__, when deciding whether to use ANSI variable args.
(emit_library_call_value): Likewise.
* cccp.c (error): Likewise.
(warning): Likewise.
(error_with_line): Likewise.
(warning_with_line): Likewise.
(pedwarn): Likewise.
(pedwarn_with_line): Likewise.
(pedwarn_with_file_and_line): Likewise.
(fatal): Likewise.
* cexp.y (error): Likewise.
(pedwarn): Likewise.
(warning): Likewise.
* collect2.c (fatal_perror): Likewise.
(fatal): Likewise.
(error): Likewise.
* combine.c (gen_rtx_combine): Likewise.
* cpperror.c (cpp_message): Likewise.
(cpp_fatal): Likewise.
* cpplib.c (cpp_error): Likewise.
(cpp_warning): Likewise.
(cpp_pedwarn): Likewise.
(cpp_error_with_line): Likewise.
(cpp_warning_with_line): Likewise.
(cpp_pedwarn_with_line): Likewise.
(cpp_pedwarn_with_file_and_line): Likewise.
* cpplib.h: Don't define PARAMS() macro.
* demangle.h: Likewise.
* doprint.c (checkit): Switch on ANSI_PROTOTYPES, not __STDC__,
when deciding whether to use ANSI variable args.
* emit-rtl.c (gen_rtx): Likewise.
(gen_rtvec): Likewise.
* final.c (asm_fprintf): Likewise.
* fix-header.c (cpp_message): Likewise.
(fatal): Likewise.
(cpp_fatal): Likewise.
* gcc.c (concat): Likewise.
(fatal): Likewise.
(error): Likewise.
* genattr.c (fatal): Likewise.
* genattrtab.c (attr_rtx): Likewise.
(attr_printf): Likewise.
(fatal): Likewise.
* gencodes.c (fatal): Likewise.
* genconfig.c (fatal): Likewise.
* genemit.c (fatal): Likewise.
* genextract.c (fatal): Likewise.
* genflags.c (fatal): Likewise.
* genopinit.c (fatal): Likewise.
* genoutput.c (fatal): Likewise.
(error): Likewise.
* genpeep.c (fatal): Likewise.
* genrecog.c (fatal): Likewise.
* halfpic.h: Switch on ANSI_PROTOTYPES, not __STDC__, when
deciding whether to declare `tree_node' and `rtx_def'.
* hash.h: Don't define stuff we get from gansidecl.h.
* mips-tfile.c: Likewise. Define __proto() in terms of PARAMS().
(fatal): Switch on ANSI_PROTOTYPES, not __STDC__, when deciding
whether to use ANSI variable args.
(error): Likewise.
* prefix.c (concat): Likewise.
* scan.h: Likewise.
* system.h: Likewise.
* toplev.c (error_with_file_and_line): Likewise.
(error_with_decl): Likewise.
(error_for_asm): Likewise.
(error): Likewise.
(fatal): Likewise.
(warning_with_file_and_line): Likewise.
(warning_with_decl): Likewise.
(warning_for_asm): Likewise.
(warning): Likewise.
(pedwarn): Likewise.
(pedwarn_with_decl): Likewise.
(pedwarn_with_file_and_line): Likewise.
(sorry): Likewise.
(really_sorry): Likewise.
* toplev.h: Switch on ANSI_PROTOTYPES, not __STDC__, when deciding
whether to declare `tree_node' and `rtx_def'.
* tree.c (build): Switch on ANSI_PROTOTYPES, not __STDC__, when
deciding whether to use ANSI variable args.
(build_nt): Likewise.
(build_parse_node): Likewise.
From-SVN: r23577
1998-11-08 16:10:24 +01:00
|
|
|
|
#ifndef ANSI_PROTOTYPES
|
1992-03-14 06:04:21 +01:00
|
|
|
|
code = va_arg (p, enum rtx_code);
|
|
|
|
|
mode = va_arg (p, enum machine_mode);
|
1994-02-10 14:07:10 +01:00
|
|
|
|
#endif
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
1999-04-01 19:06:09 +02:00
|
|
|
|
switch (code)
|
1992-03-14 06:04:21 +01:00
|
|
|
|
{
|
1999-04-01 19:06:09 +02:00
|
|
|
|
case CONST_INT:
|
|
|
|
|
rt_val = gen_rtx_CONST_INT (mode, va_arg (p, HOST_WIDE_INT));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CONST_DOUBLE:
|
|
|
|
|
{
|
|
|
|
|
rtx arg0 = va_arg (p, rtx);
|
|
|
|
|
HOST_WIDE_INT arg1 = va_arg (p, HOST_WIDE_INT);
|
|
|
|
|
HOST_WIDE_INT arg2 = va_arg (p, HOST_WIDE_INT);
|
|
|
|
|
rt_val = gen_rtx_CONST_DOUBLE (mode, arg0, arg1, arg2);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case REG:
|
|
|
|
|
rt_val = gen_rtx_REG (mode, va_arg (p, int));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MEM:
|
|
|
|
|
rt_val = gen_rtx_MEM (mode, va_arg (p, rtx));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
1992-03-14 06:04:21 +01:00
|
|
|
|
rt_val = rtx_alloc (code); /* Allocate the storage space. */
|
|
|
|
|
rt_val->mode = mode; /* Store the machine mode... */
|
|
|
|
|
|
|
|
|
|
fmt = GET_RTX_FORMAT (code); /* Find the right format... */
|
|
|
|
|
for (i = 0; i < GET_RTX_LENGTH (code); i++)
|
|
|
|
|
{
|
|
|
|
|
switch (*fmt++)
|
|
|
|
|
{
|
|
|
|
|
case '0': /* Unused field. */
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'i': /* An integer? */
|
|
|
|
|
XINT (rt_val, i) = va_arg (p, int);
|
|
|
|
|
break;
|
|
|
|
|
|
1992-07-06 22:04:13 +02:00
|
|
|
|
case 'w': /* A wide integer? */
|
|
|
|
|
XWINT (rt_val, i) = va_arg (p, HOST_WIDE_INT);
|
|
|
|
|
break;
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
case 's': /* A string? */
|
|
|
|
|
XSTR (rt_val, i) = va_arg (p, char *);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'e': /* An expression? */
|
|
|
|
|
case 'u': /* An insn? Same except when printing. */
|
|
|
|
|
XEXP (rt_val, i) = va_arg (p, rtx);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'E': /* An RTX vector? */
|
|
|
|
|
XVEC (rt_val, i) = va_arg (p, rtvec);
|
|
|
|
|
break;
|
|
|
|
|
|
Makefile.in (HOST_RTL): Add $(HOST_PREFIX)bitmap.o.
* Makefile.in (HOST_RTL): Add $(HOST_PREFIX)bitmap.o.
(rtl.o, emit-rtl.o): Add dependency on bitmap.h.
($(HOST_PREFIX_1)rtl.o): Likewise.
($(HOST_PREFIX_1)bitmap.o): New host object.
* emit-rtl.c (toplevel): Include bitmap.h.
(gen_rtx): Handle 't' and 'b' nodes.
* print-rtl.c (print_rtx): Handle printing NOTE_INSN_LIVE notes.
Print block number for block begin/end notes. Print 't' type
nodes as a pointer. Know that the 3rd argument of live range
start/stop notes is really a range_info rtx. If type is 'b', print
out argument as a bitmap.
* rtl.c: Include bitmap.c.
(copy_rtx): Copy tree nodes as is. Copy bitmaps if type is 'b'.
(note_insn_name): Add NOTE_INSN_RANGE_{START,END}, NOTE_INSN_LIVE.
* rtl.def (RANGE_LIVE): New node to hold live information while we
recalculate the basic blocks.
(RANGE_REG, RANGE_INFO): New rtl types for live range splitting.
(RANGE_VAR): New node, to hold information saved in symbol node for New
communicating live range information to the debug output functions.
* rtl.h (rtunion_def): Add rttree and rtbit fields.
(XBITMAP, XTREE): New accessor macros.
(NOTE_LIVE_INFO): Overload NOTE_SOURCE_FILE for NOTE_INSN_LIVE notes.
(NOTE_RANGE_INFO): Similarly for NOTE_INSN_RANGE_{START,END} notes.
(NOTE_BLOCK_LIVE_RANGE_BLOCK): Define.
(NOTE_INSN_RANGE_START, NOTE_INSN_RANGE_END, NOTE_INSN_LIVE): New notes.
(RANGE_LIVE_{BITMAP,ORIG_BLOCK}): New accessor macros.
(RANGE_REG_{SYMBOL,BLOCK}_NODE, RANGE_VAR_*): New accessor macros.
(RANGE_INFO_*): Likewise.
* sched.c (sched_analyze): Keep live range start/stop notes.
(unlink_other_notes): Likewise.
* haifa-sched.c (sched_analyze): Keep live range start/stop notes.
(unlink_other_notes): Likewise.
* tree.h (BLOCK_LIVE_RANGE_{START,END,VAR_FLAG}): New accessor macros.
(BLOCK_LIVE_RANGE_FLAG): Likewise.
(DECL_LIVE_RANGE_RTL): Likewise.
(struct tree_block): Add live_range_flag, live_range_var_flag,
live_range_start and live_range_end.
(struct tree_decl): Add live_range_rtl field.
* gengenrtl.c (type_from_format): Handle 'b' and 't'.
(accessor_from_format): Likewise.
Co-Authored-By: Jeffrey A Law <law@cygnus.com>
From-SVN: r19727
1998-05-13 23:13:47 +02:00
|
|
|
|
case 'b': /* A bitmap? */
|
|
|
|
|
XBITMAP (rt_val, i) = va_arg (p, bitmap);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 't': /* A tree? */
|
|
|
|
|
XTREE (rt_val, i) = va_arg (p, tree);
|
|
|
|
|
break;
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
default:
|
1993-03-31 07:48:38 +02:00
|
|
|
|
abort ();
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
1999-04-01 19:06:09 +02:00
|
|
|
|
break;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
1999-04-01 19:06:09 +02:00
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
va_end (p);
|
1999-04-01 19:06:09 +02:00
|
|
|
|
return rt_val;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* gen_rtvec (n, [rt1, ..., rtn])
|
|
|
|
|
**
|
|
|
|
|
** This routine creates an rtvec and stores within it the
|
|
|
|
|
** pointers to rtx's which are its arguments.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
/*VARARGS1*/
|
|
|
|
|
rtvec
|
1994-02-10 14:07:10 +01:00
|
|
|
|
gen_rtvec VPROTO((int n, ...))
|
1992-03-14 06:04:21 +01:00
|
|
|
|
{
|
gansidecl.h: Prepend a "G" to the macro wrapping this file (to distinguish it from the macro...
* gansidecl.h: Prepend a "G" to the macro wrapping this file
(to distinguish it from the macro wrapping ansidecl.h.)
Include libiberty's ansidecl.h. Remove all redundant definitions.
Define the PROTO() style macros in terms of the PARAMS() ones.
* calls.c (emit_library_call): Switch on ANSI_PROTOTYPES, not
__STDC__, when deciding whether to use ANSI variable args.
(emit_library_call_value): Likewise.
* cccp.c (error): Likewise.
(warning): Likewise.
(error_with_line): Likewise.
(warning_with_line): Likewise.
(pedwarn): Likewise.
(pedwarn_with_line): Likewise.
(pedwarn_with_file_and_line): Likewise.
(fatal): Likewise.
* cexp.y (error): Likewise.
(pedwarn): Likewise.
(warning): Likewise.
* collect2.c (fatal_perror): Likewise.
(fatal): Likewise.
(error): Likewise.
* combine.c (gen_rtx_combine): Likewise.
* cpperror.c (cpp_message): Likewise.
(cpp_fatal): Likewise.
* cpplib.c (cpp_error): Likewise.
(cpp_warning): Likewise.
(cpp_pedwarn): Likewise.
(cpp_error_with_line): Likewise.
(cpp_warning_with_line): Likewise.
(cpp_pedwarn_with_line): Likewise.
(cpp_pedwarn_with_file_and_line): Likewise.
* cpplib.h: Don't define PARAMS() macro.
* demangle.h: Likewise.
* doprint.c (checkit): Switch on ANSI_PROTOTYPES, not __STDC__,
when deciding whether to use ANSI variable args.
* emit-rtl.c (gen_rtx): Likewise.
(gen_rtvec): Likewise.
* final.c (asm_fprintf): Likewise.
* fix-header.c (cpp_message): Likewise.
(fatal): Likewise.
(cpp_fatal): Likewise.
* gcc.c (concat): Likewise.
(fatal): Likewise.
(error): Likewise.
* genattr.c (fatal): Likewise.
* genattrtab.c (attr_rtx): Likewise.
(attr_printf): Likewise.
(fatal): Likewise.
* gencodes.c (fatal): Likewise.
* genconfig.c (fatal): Likewise.
* genemit.c (fatal): Likewise.
* genextract.c (fatal): Likewise.
* genflags.c (fatal): Likewise.
* genopinit.c (fatal): Likewise.
* genoutput.c (fatal): Likewise.
(error): Likewise.
* genpeep.c (fatal): Likewise.
* genrecog.c (fatal): Likewise.
* halfpic.h: Switch on ANSI_PROTOTYPES, not __STDC__, when
deciding whether to declare `tree_node' and `rtx_def'.
* hash.h: Don't define stuff we get from gansidecl.h.
* mips-tfile.c: Likewise. Define __proto() in terms of PARAMS().
(fatal): Switch on ANSI_PROTOTYPES, not __STDC__, when deciding
whether to use ANSI variable args.
(error): Likewise.
* prefix.c (concat): Likewise.
* scan.h: Likewise.
* system.h: Likewise.
* toplev.c (error_with_file_and_line): Likewise.
(error_with_decl): Likewise.
(error_for_asm): Likewise.
(error): Likewise.
(fatal): Likewise.
(warning_with_file_and_line): Likewise.
(warning_with_decl): Likewise.
(warning_for_asm): Likewise.
(warning): Likewise.
(pedwarn): Likewise.
(pedwarn_with_decl): Likewise.
(pedwarn_with_file_and_line): Likewise.
(sorry): Likewise.
(really_sorry): Likewise.
* toplev.h: Switch on ANSI_PROTOTYPES, not __STDC__, when deciding
whether to declare `tree_node' and `rtx_def'.
* tree.c (build): Switch on ANSI_PROTOTYPES, not __STDC__, when
deciding whether to use ANSI variable args.
(build_nt): Likewise.
(build_parse_node): Likewise.
From-SVN: r23577
1998-11-08 16:10:24 +01:00
|
|
|
|
#ifndef ANSI_PROTOTYPES
|
1994-02-10 14:07:10 +01:00
|
|
|
|
int n;
|
|
|
|
|
#endif
|
|
|
|
|
int i;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
va_list p;
|
|
|
|
|
rtx *vector;
|
|
|
|
|
|
1994-02-10 14:07:10 +01:00
|
|
|
|
VA_START (p, n);
|
|
|
|
|
|
gansidecl.h: Prepend a "G" to the macro wrapping this file (to distinguish it from the macro...
* gansidecl.h: Prepend a "G" to the macro wrapping this file
(to distinguish it from the macro wrapping ansidecl.h.)
Include libiberty's ansidecl.h. Remove all redundant definitions.
Define the PROTO() style macros in terms of the PARAMS() ones.
* calls.c (emit_library_call): Switch on ANSI_PROTOTYPES, not
__STDC__, when deciding whether to use ANSI variable args.
(emit_library_call_value): Likewise.
* cccp.c (error): Likewise.
(warning): Likewise.
(error_with_line): Likewise.
(warning_with_line): Likewise.
(pedwarn): Likewise.
(pedwarn_with_line): Likewise.
(pedwarn_with_file_and_line): Likewise.
(fatal): Likewise.
* cexp.y (error): Likewise.
(pedwarn): Likewise.
(warning): Likewise.
* collect2.c (fatal_perror): Likewise.
(fatal): Likewise.
(error): Likewise.
* combine.c (gen_rtx_combine): Likewise.
* cpperror.c (cpp_message): Likewise.
(cpp_fatal): Likewise.
* cpplib.c (cpp_error): Likewise.
(cpp_warning): Likewise.
(cpp_pedwarn): Likewise.
(cpp_error_with_line): Likewise.
(cpp_warning_with_line): Likewise.
(cpp_pedwarn_with_line): Likewise.
(cpp_pedwarn_with_file_and_line): Likewise.
* cpplib.h: Don't define PARAMS() macro.
* demangle.h: Likewise.
* doprint.c (checkit): Switch on ANSI_PROTOTYPES, not __STDC__,
when deciding whether to use ANSI variable args.
* emit-rtl.c (gen_rtx): Likewise.
(gen_rtvec): Likewise.
* final.c (asm_fprintf): Likewise.
* fix-header.c (cpp_message): Likewise.
(fatal): Likewise.
(cpp_fatal): Likewise.
* gcc.c (concat): Likewise.
(fatal): Likewise.
(error): Likewise.
* genattr.c (fatal): Likewise.
* genattrtab.c (attr_rtx): Likewise.
(attr_printf): Likewise.
(fatal): Likewise.
* gencodes.c (fatal): Likewise.
* genconfig.c (fatal): Likewise.
* genemit.c (fatal): Likewise.
* genextract.c (fatal): Likewise.
* genflags.c (fatal): Likewise.
* genopinit.c (fatal): Likewise.
* genoutput.c (fatal): Likewise.
(error): Likewise.
* genpeep.c (fatal): Likewise.
* genrecog.c (fatal): Likewise.
* halfpic.h: Switch on ANSI_PROTOTYPES, not __STDC__, when
deciding whether to declare `tree_node' and `rtx_def'.
* hash.h: Don't define stuff we get from gansidecl.h.
* mips-tfile.c: Likewise. Define __proto() in terms of PARAMS().
(fatal): Switch on ANSI_PROTOTYPES, not __STDC__, when deciding
whether to use ANSI variable args.
(error): Likewise.
* prefix.c (concat): Likewise.
* scan.h: Likewise.
* system.h: Likewise.
* toplev.c (error_with_file_and_line): Likewise.
(error_with_decl): Likewise.
(error_for_asm): Likewise.
(error): Likewise.
(fatal): Likewise.
(warning_with_file_and_line): Likewise.
(warning_with_decl): Likewise.
(warning_for_asm): Likewise.
(warning): Likewise.
(pedwarn): Likewise.
(pedwarn_with_decl): Likewise.
(pedwarn_with_file_and_line): Likewise.
(sorry): Likewise.
(really_sorry): Likewise.
* toplev.h: Switch on ANSI_PROTOTYPES, not __STDC__, when deciding
whether to declare `tree_node' and `rtx_def'.
* tree.c (build): Switch on ANSI_PROTOTYPES, not __STDC__, when
deciding whether to use ANSI variable args.
(build_nt): Likewise.
(build_parse_node): Likewise.
From-SVN: r23577
1998-11-08 16:10:24 +01:00
|
|
|
|
#ifndef ANSI_PROTOTYPES
|
1992-03-14 06:04:21 +01:00
|
|
|
|
n = va_arg (p, int);
|
1994-02-10 14:07:10 +01:00
|
|
|
|
#endif
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
if (n == 0)
|
|
|
|
|
return NULL_RTVEC; /* Don't allocate an empty rtvec... */
|
|
|
|
|
|
|
|
|
|
vector = (rtx *) alloca (n * sizeof (rtx));
|
1994-02-10 14:07:10 +01:00
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
for (i = 0; i < n; i++)
|
|
|
|
|
vector[i] = va_arg (p, rtx);
|
|
|
|
|
va_end (p);
|
|
|
|
|
|
|
|
|
|
return gen_rtvec_v (n, vector);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
rtvec
|
|
|
|
|
gen_rtvec_v (n, argp)
|
|
|
|
|
int n;
|
|
|
|
|
rtx *argp;
|
|
|
|
|
{
|
|
|
|
|
register int i;
|
|
|
|
|
register rtvec rt_val;
|
|
|
|
|
|
|
|
|
|
if (n == 0)
|
|
|
|
|
return NULL_RTVEC; /* Don't allocate an empty rtvec... */
|
|
|
|
|
|
|
|
|
|
rt_val = rtvec_alloc (n); /* Allocate an rtvec... */
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < n; i++)
|
rtl.def (NOTE): Change format to "iuu0n".
1999-08-19 14:44 -0700 Zack Weinberg <zack@bitmover.com>
* rtl.def (NOTE): Change format to "iuu0n".
(ADDR_DIFF_VEC): Change format to "eEee0".
(ADDRESSOF): Change format to "eit".
* rtl.h (rtvec): Make "elem" an array of rtx, not rtunion.
(RTVEC_ELT): Change to match.
(XVECEXP): Use XVEC and RTVEC_ELT.
(INSN_UID, INSN_CODE, CODE_LABEL_NUMBER, NOTE_LINE_NUMBER,
ADDRESSOF_REGNO, REGNO, SUBREG_WORD): Use XINT.
(PREV_INSN, NEXT_INSN, PATTERN, REG_NOTES,
CALL_INSN_FUNCTION_USAGE, SUBREG_REG, SET_SRC, SET_DEST,
TRAP_CONDITION, TRAP_CODE): Use XEXP.
(INTVAL): Use XWINT.
(ADDRESSOF_DECL): Use XTREE.
(SET_ADDRESSOF_DECL): Delete.
(NOTE_DECL_NAME, NOTE_DECL_CODE, NOTE_DECL_RTL,
NOTE_DECL_IDENTIFIER, NOTE_DECL_TYPE): Kill. These have been
ifdefed out since 2.6 at least.
(gen_rtvec_vv): Delete prototype.
* rtl.h (rtvec_alloc): rt->elem is now an array of rtx,
not rtunion.
(copy_most_rtx): Handle 't' format letter.
* emit-rtl.c (gen_rtvec_v): rt_val->elem is an array of rtx.
(gen_rtvec_vv): Delete function. All callers changed to use
gen_rtvec_v instead.
* print-rtl.c (print_rtx): Move special casing of NOTEs to
the '0' format letter.
* function.c (gen_mem_addressof): Don't use
SET_ADDRESSOF_DECL; provide `decl' to gen_rtx_ADDRESSOF
instead.
* integrate.c (copy_rtx_and_substitute): Likewise.
Copy 't' slots with XTREE.
(subst_constants): Treat 't' slots like '[swi]' slots.
* cse.c (canon_hash, exp_equiv_p): Treat 't' slots like '0' slots.
* jump.c (rtx_equal_for_thread_p): Likewise.
* rtlanal.c (rtx_equal_p): Likewise.
* stmt.c (expand_end_case): gen_rtx_ADDR_DIFF_VEC now takes
only four arguments.
* gengenrtl.c (type_from_format): Provide correct types for
'b' and 't' slots.
* tree.h [ENABLE_CHECKING] (TREE_CHECK, TREE_CLASS_CHECK):
If a recent gcc is in use (always in stage2 and beyond), use
statement expressions, so we don't make a function call unless
the check fails. Evaluate arguments exactly once.
(CHAIN_CHECK, DO_CHECK, DO_CHECK1, TREE_CHECK1,
TREE_CLASS_CHECK1, TYPE_CHECK1, DECL_CHECK1, CST_CHECK1):
Delete.
(CST_OR_CONSTRUCTOR_CHECK, EXPR_CHECK): Redefine such that
they evaluate their arguments exactly once, irrespective of
the compiler in use.
* tree.c [ENABLE_CHECKING]: Define whichever set of functions
is used by the currently-enabled check macros. This is:
(tree_check_failed, tree_class_check_failed): For gcc.
(tree_check, tree_class_check, cst_or_constructor_check,
expr_check): For other compilers.
* gencheck.c: Do not define any *_CHECK1 macros.
From-SVN: r28769
1999-08-20 00:33:38 +02:00
|
|
|
|
rt_val->elem[i] = *argp++;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
return rt_val;
|
|
|
|
|
}
|
1996-11-15 19:39:07 +01:00
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
/* Generate a REG rtx for a new pseudo register of mode MODE.
|
|
|
|
|
This pseudo is assigned the next sequential register number. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
gen_reg_rtx (mode)
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
1999-08-09 16:00:21 +02:00
|
|
|
|
struct function *f = current_function;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
register rtx val;
|
|
|
|
|
|
1998-11-25 11:31:24 +01:00
|
|
|
|
/* Don't let anything called after initial flow analysis create new
|
|
|
|
|
registers. */
|
|
|
|
|
if (no_new_pseudos)
|
1992-03-14 06:04:21 +01:00
|
|
|
|
abort ();
|
|
|
|
|
|
1993-07-15 04:20:05 +02:00
|
|
|
|
if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
|
|
|
|
|
|| GET_MODE_CLASS (mode) == MODE_COMPLEX_INT)
|
|
|
|
|
{
|
|
|
|
|
/* For complex modes, don't make a single pseudo.
|
|
|
|
|
Instead, make a CONCAT of two pseudos.
|
|
|
|
|
This allows noncontiguous allocation of the real and imaginary parts,
|
|
|
|
|
which makes much better code. Besides, allocating DCmode
|
|
|
|
|
pseudos overstrains reload on some machines like the 386. */
|
|
|
|
|
rtx realpart, imagpart;
|
|
|
|
|
int size = GET_MODE_UNIT_SIZE (mode);
|
|
|
|
|
enum machine_mode partmode
|
|
|
|
|
= mode_for_size (size * BITS_PER_UNIT,
|
|
|
|
|
(GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
|
|
|
|
|
? MODE_FLOAT : MODE_INT),
|
|
|
|
|
0);
|
|
|
|
|
|
|
|
|
|
realpart = gen_reg_rtx (partmode);
|
|
|
|
|
imagpart = gen_reg_rtx (partmode);
|
1998-01-08 22:17:05 +01:00
|
|
|
|
return gen_rtx_CONCAT (mode, realpart, imagpart);
|
1993-07-15 04:20:05 +02:00
|
|
|
|
}
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* Make sure regno_pointer_flag and regno_reg_rtx are large
|
|
|
|
|
enough to have an element for this pseudo reg number. */
|
|
|
|
|
|
1999-08-09 16:00:21 +02:00
|
|
|
|
if (reg_rtx_no == f->emit->regno_pointer_flag_length)
|
1992-03-14 06:04:21 +01:00
|
|
|
|
{
|
1999-08-09 16:00:21 +02:00
|
|
|
|
int old_size = f->emit->regno_pointer_flag_length;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
rtx *new1;
|
1999-09-05 03:06:48 +02:00
|
|
|
|
char *new;
|
|
|
|
|
new = xrealloc (f->emit->regno_pointer_flag, old_size * 2);
|
1999-08-09 16:00:21 +02:00
|
|
|
|
memset (new + old_size, 0, old_size);
|
|
|
|
|
f->emit->regno_pointer_flag = new;
|
|
|
|
|
|
1999-09-05 03:06:48 +02:00
|
|
|
|
new = xrealloc (f->emit->regno_pointer_align, old_size * 2);
|
1999-08-09 16:00:21 +02:00
|
|
|
|
memset (new + old_size, 0, old_size);
|
|
|
|
|
f->emit->regno_pointer_align = new;
|
|
|
|
|
|
1999-09-05 03:06:48 +02:00
|
|
|
|
new1 = (rtx *) xrealloc (f->emit->x_regno_reg_rtx,
|
|
|
|
|
old_size * 2 * sizeof (rtx));
|
1999-08-09 16:00:21 +02:00
|
|
|
|
memset (new1 + old_size, 0, old_size * sizeof (rtx));
|
1992-03-14 06:04:21 +01:00
|
|
|
|
regno_reg_rtx = new1;
|
|
|
|
|
|
1999-08-09 16:00:21 +02:00
|
|
|
|
f->emit->regno_pointer_flag_length = old_size * 2;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
1998-01-08 22:17:05 +01:00
|
|
|
|
val = gen_rtx_raw_REG (mode, reg_rtx_no);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
regno_reg_rtx[reg_rtx_no++] = val;
|
|
|
|
|
return val;
|
|
|
|
|
}
|
|
|
|
|
|
1996-09-30 01:05:36 +02:00
|
|
|
|
/* Identify REG (which may be a CONCAT) as a user register. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
mark_user_reg (reg)
|
|
|
|
|
rtx reg;
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (reg) == CONCAT)
|
|
|
|
|
{
|
|
|
|
|
REG_USERVAR_P (XEXP (reg, 0)) = 1;
|
|
|
|
|
REG_USERVAR_P (XEXP (reg, 1)) = 1;
|
|
|
|
|
}
|
|
|
|
|
else if (GET_CODE (reg) == REG)
|
|
|
|
|
REG_USERVAR_P (reg) = 1;
|
|
|
|
|
else
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
|
1995-12-27 21:21:02 +01:00
|
|
|
|
/* Identify REG as a probable pointer register and show its alignment
|
|
|
|
|
as ALIGN, if nonzero. */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
void
|
1995-12-27 21:21:02 +01:00
|
|
|
|
mark_reg_pointer (reg, align)
|
1992-03-14 06:04:21 +01:00
|
|
|
|
rtx reg;
|
1995-12-27 21:21:02 +01:00
|
|
|
|
int align;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
{
|
1999-08-11 09:47:51 +02:00
|
|
|
|
if (! REGNO_POINTER_FLAG (REGNO (reg)))
|
|
|
|
|
{
|
|
|
|
|
REGNO_POINTER_FLAG (REGNO (reg)) = 1;
|
1995-12-27 21:21:02 +01:00
|
|
|
|
|
1999-08-11 09:47:51 +02:00
|
|
|
|
if (align)
|
|
|
|
|
REGNO_POINTER_ALIGN (REGNO (reg)) = align;
|
|
|
|
|
}
|
|
|
|
|
else if (align && align < REGNO_POINTER_ALIGN (REGNO (reg)))
|
|
|
|
|
/* We can no-longer be sure just how aligned this pointer is */
|
1995-12-27 21:21:02 +01:00
|
|
|
|
REGNO_POINTER_ALIGN (REGNO (reg)) = align;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 plus largest pseudo reg number used in the current function. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
max_reg_num ()
|
|
|
|
|
{
|
|
|
|
|
return reg_rtx_no;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 + the largest label number used so far in the current function. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
max_label_num ()
|
|
|
|
|
{
|
|
|
|
|
if (last_label_num && label_num == base_label_num)
|
|
|
|
|
return last_label_num;
|
|
|
|
|
return label_num;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return first label number used in this function (if any were used). */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
get_first_label_num ()
|
|
|
|
|
{
|
|
|
|
|
return first_label_num;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return a value representing some low-order bits of X, where the number
|
|
|
|
|
of low-order bits is given by MODE. Note that no conversion is done
|
|
|
|
|
between floating-point and fixed-point values, rather, the bit
|
|
|
|
|
representation is returned.
|
|
|
|
|
|
|
|
|
|
This function handles the cases in common between gen_lowpart, below,
|
|
|
|
|
and two variants in cse.c and combine.c. These are the cases that can
|
|
|
|
|
be safely handled at all points in the compilation.
|
|
|
|
|
|
|
|
|
|
If this is not a case we can handle, return 0. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
gen_lowpart_common (mode, x)
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
register rtx x;
|
|
|
|
|
{
|
|
|
|
|
int word = 0;
|
|
|
|
|
|
|
|
|
|
if (GET_MODE (x) == mode)
|
|
|
|
|
return x;
|
|
|
|
|
|
|
|
|
|
/* MODE must occupy no more words than the mode of X. */
|
|
|
|
|
if (GET_MODE (x) != VOIDmode
|
|
|
|
|
&& ((GET_MODE_SIZE (mode) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD
|
|
|
|
|
> ((GET_MODE_SIZE (GET_MODE (x)) + (UNITS_PER_WORD - 1))
|
|
|
|
|
/ UNITS_PER_WORD)))
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (WORDS_BIG_ENDIAN && GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD)
|
|
|
|
|
word = ((GET_MODE_SIZE (GET_MODE (x))
|
|
|
|
|
- MAX (GET_MODE_SIZE (mode), UNITS_PER_WORD))
|
|
|
|
|
/ UNITS_PER_WORD);
|
|
|
|
|
|
|
|
|
|
if ((GET_CODE (x) == ZERO_EXTEND || GET_CODE (x) == SIGN_EXTEND)
|
1992-10-12 11:31:07 +01:00
|
|
|
|
&& (GET_MODE_CLASS (mode) == MODE_INT
|
|
|
|
|
|| GET_MODE_CLASS (mode) == MODE_PARTIAL_INT))
|
1992-03-14 06:04:21 +01:00
|
|
|
|
{
|
|
|
|
|
/* If we are getting the low-order part of something that has been
|
|
|
|
|
sign- or zero-extended, we can either just use the object being
|
|
|
|
|
extended or make a narrower extension. If we want an even smaller
|
|
|
|
|
piece than the size of the object being extended, call ourselves
|
|
|
|
|
recursively.
|
|
|
|
|
|
|
|
|
|
This case is used mostly by combine and cse. */
|
|
|
|
|
|
|
|
|
|
if (GET_MODE (XEXP (x, 0)) == mode)
|
|
|
|
|
return XEXP (x, 0);
|
|
|
|
|
else if (GET_MODE_SIZE (mode) < GET_MODE_SIZE (GET_MODE (XEXP (x, 0))))
|
|
|
|
|
return gen_lowpart_common (mode, XEXP (x, 0));
|
|
|
|
|
else if (GET_MODE_SIZE (mode) < GET_MODE_SIZE (GET_MODE (x)))
|
1998-01-08 22:17:05 +01:00
|
|
|
|
return gen_rtx_fmt_e (GET_CODE (x), mode, XEXP (x, 0));
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
else if (GET_CODE (x) == SUBREG
|
|
|
|
|
&& (GET_MODE_SIZE (mode) <= UNITS_PER_WORD
|
|
|
|
|
|| GET_MODE_SIZE (mode) == GET_MODE_UNIT_SIZE (GET_MODE (x))))
|
|
|
|
|
return (GET_MODE (SUBREG_REG (x)) == mode && SUBREG_WORD (x) == 0
|
|
|
|
|
? SUBREG_REG (x)
|
1998-01-08 22:17:05 +01:00
|
|
|
|
: gen_rtx_SUBREG (mode, SUBREG_REG (x), SUBREG_WORD (x) + word));
|
1992-03-14 06:04:21 +01:00
|
|
|
|
else if (GET_CODE (x) == REG)
|
|
|
|
|
{
|
1998-04-02 03:33:22 +02:00
|
|
|
|
/* Let the backend decide how many registers to skip. This is needed
|
|
|
|
|
in particular for Sparc64 where fp regs are smaller than a word. */
|
|
|
|
|
/* ??? Note that subregs are now ambiguous, in that those against
|
|
|
|
|
pseudos are sized by the Word Size, while those against hard
|
|
|
|
|
regs are sized by the underlying register size. Better would be
|
|
|
|
|
to always interpret the subreg offset parameter as bytes or bits. */
|
|
|
|
|
|
|
|
|
|
if (WORDS_BIG_ENDIAN && REGNO (x) < FIRST_PSEUDO_REGISTER)
|
|
|
|
|
word = (HARD_REGNO_NREGS (REGNO (x), GET_MODE (x))
|
|
|
|
|
- HARD_REGNO_NREGS (REGNO (x), mode));
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* If the register is not valid for MODE, return 0. If we don't
|
1993-12-21 01:16:01 +01:00
|
|
|
|
do this, there is no way to fix up the resulting REG later.
|
|
|
|
|
But we do do this if the current REG is not valid for its
|
|
|
|
|
mode. This latter is a kludge, but is required due to the
|
|
|
|
|
way that parameters are passed on some machines, most
|
|
|
|
|
notably Sparc. */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
if (REGNO (x) < FIRST_PSEUDO_REGISTER
|
1993-12-21 01:16:01 +01:00
|
|
|
|
&& ! HARD_REGNO_MODE_OK (REGNO (x) + word, mode)
|
|
|
|
|
&& HARD_REGNO_MODE_OK (REGNO (x), GET_MODE (x)))
|
1992-03-14 06:04:21 +01:00
|
|
|
|
return 0;
|
|
|
|
|
else if (REGNO (x) < FIRST_PSEUDO_REGISTER
|
|
|
|
|
/* integrate.c can't handle parts of a return value register. */
|
|
|
|
|
&& (! REG_FUNCTION_VALUE_P (x)
|
1992-10-09 12:30:07 +01:00
|
|
|
|
|| ! rtx_equal_function_value_matters)
|
1998-02-19 01:35:51 +01:00
|
|
|
|
#ifdef CLASS_CANNOT_CHANGE_SIZE
|
|
|
|
|
&& ! (GET_MODE_SIZE (mode) != GET_MODE_SIZE (GET_MODE (x))
|
|
|
|
|
&& GET_MODE_CLASS (GET_MODE (x)) != MODE_COMPLEX_INT
|
|
|
|
|
&& GET_MODE_CLASS (GET_MODE (x)) != MODE_COMPLEX_FLOAT
|
|
|
|
|
&& (TEST_HARD_REG_BIT
|
|
|
|
|
(reg_class_contents[(int) CLASS_CANNOT_CHANGE_SIZE],
|
|
|
|
|
REGNO (x))))
|
|
|
|
|
#endif
|
1992-10-09 12:30:07 +01:00
|
|
|
|
/* We want to keep the stack, frame, and arg pointers
|
|
|
|
|
special. */
|
1994-03-16 15:01:34 +01:00
|
|
|
|
&& x != frame_pointer_rtx
|
1992-10-09 12:30:07 +01:00
|
|
|
|
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
|
1994-03-16 15:01:34 +01:00
|
|
|
|
&& x != arg_pointer_rtx
|
1992-10-09 12:30:07 +01:00
|
|
|
|
#endif
|
1994-03-16 15:01:34 +01:00
|
|
|
|
&& x != stack_pointer_rtx)
|
1998-01-08 22:17:05 +01:00
|
|
|
|
return gen_rtx_REG (mode, REGNO (x) + word);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
else
|
1998-01-08 22:17:05 +01:00
|
|
|
|
return gen_rtx_SUBREG (mode, x, word);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
/* If X is a CONST_INT or a CONST_DOUBLE, extract the appropriate bits
|
|
|
|
|
from the low-order part of the constant. */
|
1992-10-12 11:31:07 +01:00
|
|
|
|
else if ((GET_MODE_CLASS (mode) == MODE_INT
|
|
|
|
|
|| GET_MODE_CLASS (mode) == MODE_PARTIAL_INT)
|
|
|
|
|
&& GET_MODE (x) == VOIDmode
|
1992-03-14 06:04:21 +01:00
|
|
|
|
&& (GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST_DOUBLE))
|
1992-04-13 13:19:34 +02:00
|
|
|
|
{
|
|
|
|
|
/* If MODE is twice the host word size, X is already the desired
|
|
|
|
|
representation. Otherwise, if MODE is wider than a word, we can't
|
|
|
|
|
do this. If MODE is exactly a word, return just one CONST_INT.
|
|
|
|
|
If MODE is smaller than a word, clear the bits that don't belong
|
|
|
|
|
in our mode, unless they and our sign bit are all one. So we get
|
|
|
|
|
either a reasonable negative value or a reasonable unsigned value
|
|
|
|
|
for this mode. */
|
|
|
|
|
|
1994-11-22 23:41:55 +01:00
|
|
|
|
if (GET_MODE_BITSIZE (mode) >= 2 * HOST_BITS_PER_WIDE_INT)
|
1992-04-13 13:19:34 +02:00
|
|
|
|
return x;
|
1992-07-06 22:04:13 +02:00
|
|
|
|
else if (GET_MODE_BITSIZE (mode) > HOST_BITS_PER_WIDE_INT)
|
1992-04-13 13:19:34 +02:00
|
|
|
|
return 0;
|
1992-07-06 22:04:13 +02:00
|
|
|
|
else if (GET_MODE_BITSIZE (mode) == HOST_BITS_PER_WIDE_INT)
|
1992-04-13 13:19:34 +02:00
|
|
|
|
return (GET_CODE (x) == CONST_INT ? x
|
1992-07-06 22:04:13 +02:00
|
|
|
|
: GEN_INT (CONST_DOUBLE_LOW (x)));
|
1992-04-13 13:19:34 +02:00
|
|
|
|
else
|
|
|
|
|
{
|
1998-04-22 14:57:04 +02:00
|
|
|
|
/* MODE must be narrower than HOST_BITS_PER_WIDE_INT. */
|
1992-04-13 13:19:34 +02:00
|
|
|
|
int width = GET_MODE_BITSIZE (mode);
|
1992-07-06 22:04:13 +02:00
|
|
|
|
HOST_WIDE_INT val = (GET_CODE (x) == CONST_INT ? INTVAL (x)
|
|
|
|
|
: CONST_DOUBLE_LOW (x));
|
1992-04-13 13:19:34 +02:00
|
|
|
|
|
1998-04-22 14:57:04 +02:00
|
|
|
|
/* Sign extend to HOST_WIDE_INT. */
|
|
|
|
|
val = val << (HOST_BITS_PER_WIDE_INT - width) >> (HOST_BITS_PER_WIDE_INT - width);
|
1992-04-13 13:19:34 +02:00
|
|
|
|
|
|
|
|
|
return (GET_CODE (x) == CONST_INT && INTVAL (x) == val ? x
|
1992-07-06 22:04:13 +02:00
|
|
|
|
: GEN_INT (val));
|
1992-04-13 13:19:34 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
1992-04-13 13:47:32 +02:00
|
|
|
|
/* If X is an integral constant but we want it in floating-point, it
|
|
|
|
|
must be the case that we have a union of an integer and a floating-point
|
|
|
|
|
value. If the machine-parameters allow it, simulate that union here
|
1992-05-27 01:25:49 +02:00
|
|
|
|
and return the result. The two-word and single-word cases are
|
|
|
|
|
different. */
|
1992-04-13 13:47:32 +02:00
|
|
|
|
|
1992-05-25 23:21:34 +02:00
|
|
|
|
else if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT
|
1992-07-06 22:04:13 +02:00
|
|
|
|
&& HOST_BITS_PER_WIDE_INT == BITS_PER_WORD)
|
1992-05-25 23:21:34 +02:00
|
|
|
|
|| flag_pretend_float)
|
1992-04-13 13:47:32 +02:00
|
|
|
|
&& GET_MODE_CLASS (mode) == MODE_FLOAT
|
1992-05-27 01:25:49 +02:00
|
|
|
|
&& GET_MODE_SIZE (mode) == UNITS_PER_WORD
|
|
|
|
|
&& GET_CODE (x) == CONST_INT
|
1992-07-06 22:04:13 +02:00
|
|
|
|
&& sizeof (float) * HOST_BITS_PER_CHAR == HOST_BITS_PER_WIDE_INT)
|
1993-06-13 02:25:33 +02:00
|
|
|
|
#ifdef REAL_ARITHMETIC
|
|
|
|
|
{
|
|
|
|
|
REAL_VALUE_TYPE r;
|
|
|
|
|
HOST_WIDE_INT i;
|
|
|
|
|
|
|
|
|
|
i = INTVAL (x);
|
|
|
|
|
r = REAL_VALUE_FROM_TARGET_SINGLE (i);
|
1994-04-21 21:54:06 +02:00
|
|
|
|
return CONST_DOUBLE_FROM_REAL_VALUE (r, mode);
|
1993-06-13 02:25:33 +02:00
|
|
|
|
}
|
|
|
|
|
#else
|
1992-05-27 01:25:49 +02:00
|
|
|
|
{
|
1992-07-06 22:04:13 +02:00
|
|
|
|
union {HOST_WIDE_INT i; float d; } u;
|
1992-05-27 01:25:49 +02:00
|
|
|
|
|
|
|
|
|
u.i = INTVAL (x);
|
1994-04-21 21:54:06 +02:00
|
|
|
|
return CONST_DOUBLE_FROM_REAL_VALUE (u.d, mode);
|
1992-05-27 01:25:49 +02:00
|
|
|
|
}
|
1993-06-13 02:25:33 +02:00
|
|
|
|
#endif
|
1992-05-27 01:25:49 +02:00
|
|
|
|
else if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT
|
1992-07-06 22:04:13 +02:00
|
|
|
|
&& HOST_BITS_PER_WIDE_INT == BITS_PER_WORD)
|
1992-05-27 01:25:49 +02:00
|
|
|
|
|| flag_pretend_float)
|
|
|
|
|
&& GET_MODE_CLASS (mode) == MODE_FLOAT
|
|
|
|
|
&& GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
|
1992-04-13 13:47:32 +02:00
|
|
|
|
&& (GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST_DOUBLE)
|
|
|
|
|
&& GET_MODE (x) == VOIDmode
|
1992-07-06 22:04:13 +02:00
|
|
|
|
&& (sizeof (double) * HOST_BITS_PER_CHAR
|
|
|
|
|
== 2 * HOST_BITS_PER_WIDE_INT))
|
1993-06-13 02:25:33 +02:00
|
|
|
|
#ifdef REAL_ARITHMETIC
|
|
|
|
|
{
|
|
|
|
|
REAL_VALUE_TYPE r;
|
|
|
|
|
HOST_WIDE_INT i[2];
|
|
|
|
|
HOST_WIDE_INT low, high;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (x) == CONST_INT)
|
|
|
|
|
low = INTVAL (x), high = low >> (HOST_BITS_PER_WIDE_INT -1);
|
|
|
|
|
else
|
|
|
|
|
low = CONST_DOUBLE_LOW (x), high = CONST_DOUBLE_HIGH (x);
|
|
|
|
|
|
1994-02-04 14:14:23 +01:00
|
|
|
|
/* REAL_VALUE_TARGET_DOUBLE takes the addressing order of the
|
1996-07-04 00:07:53 +02:00
|
|
|
|
target machine. */
|
1994-02-04 14:14:23 +01:00
|
|
|
|
if (WORDS_BIG_ENDIAN)
|
|
|
|
|
i[0] = high, i[1] = low;
|
|
|
|
|
else
|
|
|
|
|
i[0] = low, i[1] = high;
|
1993-06-13 02:25:33 +02:00
|
|
|
|
|
|
|
|
|
r = REAL_VALUE_FROM_TARGET_DOUBLE (i);
|
1994-04-21 21:54:06 +02:00
|
|
|
|
return CONST_DOUBLE_FROM_REAL_VALUE (r, mode);
|
1993-06-13 02:25:33 +02:00
|
|
|
|
}
|
|
|
|
|
#else
|
1992-04-13 13:47:32 +02:00
|
|
|
|
{
|
1992-07-06 22:04:13 +02:00
|
|
|
|
union {HOST_WIDE_INT i[2]; double d; } u;
|
|
|
|
|
HOST_WIDE_INT low, high;
|
1992-04-13 13:47:32 +02:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (x) == CONST_INT)
|
1992-07-06 22:04:13 +02:00
|
|
|
|
low = INTVAL (x), high = low >> (HOST_BITS_PER_WIDE_INT -1);
|
1992-04-13 13:47:32 +02:00
|
|
|
|
else
|
|
|
|
|
low = CONST_DOUBLE_LOW (x), high = CONST_DOUBLE_HIGH (x);
|
|
|
|
|
|
|
|
|
|
#ifdef HOST_WORDS_BIG_ENDIAN
|
|
|
|
|
u.i[0] = high, u.i[1] = low;
|
|
|
|
|
#else
|
|
|
|
|
u.i[0] = low, u.i[1] = high;
|
|
|
|
|
#endif
|
|
|
|
|
|
1994-04-21 21:54:06 +02:00
|
|
|
|
return CONST_DOUBLE_FROM_REAL_VALUE (u.d, mode);
|
1992-04-13 13:47:32 +02:00
|
|
|
|
}
|
1993-06-13 02:25:33 +02:00
|
|
|
|
#endif
|
1997-09-02 21:37:05 +02:00
|
|
|
|
|
|
|
|
|
/* We need an extra case for machines where HOST_BITS_PER_WIDE_INT is the
|
1998-01-27 00:05:08 +01:00
|
|
|
|
same as sizeof (double) or when sizeof (float) is larger than the
|
|
|
|
|
size of a word on the target machine. */
|
1997-09-02 21:37:05 +02:00
|
|
|
|
#ifdef REAL_ARITHMETIC
|
1998-01-27 00:05:08 +01:00
|
|
|
|
else if (mode == SFmode && GET_CODE (x) == CONST_INT)
|
1997-09-02 21:37:05 +02:00
|
|
|
|
{
|
|
|
|
|
REAL_VALUE_TYPE r;
|
|
|
|
|
HOST_WIDE_INT i;
|
|
|
|
|
|
|
|
|
|
i = INTVAL (x);
|
|
|
|
|
r = REAL_VALUE_FROM_TARGET_SINGLE (i);
|
|
|
|
|
return CONST_DOUBLE_FROM_REAL_VALUE (r, mode);
|
|
|
|
|
}
|
1999-06-21 19:52:47 +02:00
|
|
|
|
else if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT
|
|
|
|
|
&& HOST_BITS_PER_WIDE_INT == BITS_PER_WORD)
|
|
|
|
|
|| flag_pretend_float)
|
|
|
|
|
&& GET_MODE_CLASS (mode) == MODE_FLOAT
|
|
|
|
|
&& GET_MODE_SIZE (mode) == UNITS_PER_WORD
|
|
|
|
|
&& GET_CODE (x) == CONST_INT
|
|
|
|
|
&& (sizeof (double) * HOST_BITS_PER_CHAR
|
|
|
|
|
== HOST_BITS_PER_WIDE_INT))
|
|
|
|
|
{
|
|
|
|
|
REAL_VALUE_TYPE r;
|
|
|
|
|
HOST_WIDE_INT i;
|
|
|
|
|
|
|
|
|
|
i = INTVAL (x);
|
|
|
|
|
r = REAL_VALUE_FROM_TARGET_DOUBLE (&i);
|
|
|
|
|
return CONST_DOUBLE_FROM_REAL_VALUE (r, mode);
|
|
|
|
|
}
|
1997-09-02 21:37:05 +02:00
|
|
|
|
#endif
|
|
|
|
|
|
1992-05-25 23:21:34 +02:00
|
|
|
|
/* Similarly, if this is converting a floating-point value into a
|
|
|
|
|
single-word integer. Only do this is the host and target parameters are
|
|
|
|
|
compatible. */
|
|
|
|
|
|
|
|
|
|
else if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT
|
1992-07-06 22:04:13 +02:00
|
|
|
|
&& HOST_BITS_PER_WIDE_INT == BITS_PER_WORD)
|
1992-05-25 23:21:34 +02:00
|
|
|
|
|| flag_pretend_float)
|
1992-10-12 11:31:07 +01:00
|
|
|
|
&& (GET_MODE_CLASS (mode) == MODE_INT
|
|
|
|
|
|| GET_MODE_CLASS (mode) == MODE_PARTIAL_INT)
|
1992-05-25 23:21:34 +02:00
|
|
|
|
&& GET_CODE (x) == CONST_DOUBLE
|
|
|
|
|
&& GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT
|
|
|
|
|
&& GET_MODE_BITSIZE (mode) == BITS_PER_WORD)
|
1996-10-23 23:15:58 +02:00
|
|
|
|
return operand_subword (x, word, 0, GET_MODE (x));
|
1992-05-25 23:21:34 +02:00
|
|
|
|
|
1992-04-13 13:47:32 +02:00
|
|
|
|
/* Similarly, if this is converting a floating-point value into a
|
|
|
|
|
two-word integer, we can do this one word at a time and make an
|
|
|
|
|
integer. Only do this is the host and target parameters are
|
|
|
|
|
compatible. */
|
|
|
|
|
|
1992-05-25 23:21:34 +02:00
|
|
|
|
else if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT
|
1992-07-06 22:04:13 +02:00
|
|
|
|
&& HOST_BITS_PER_WIDE_INT == BITS_PER_WORD)
|
1992-05-25 23:21:34 +02:00
|
|
|
|
|| flag_pretend_float)
|
1992-10-12 11:31:07 +01:00
|
|
|
|
&& (GET_MODE_CLASS (mode) == MODE_INT
|
1992-10-17 05:33:09 +01:00
|
|
|
|
|| GET_MODE_CLASS (mode) == MODE_PARTIAL_INT)
|
1992-04-13 13:47:32 +02:00
|
|
|
|
&& GET_CODE (x) == CONST_DOUBLE
|
|
|
|
|
&& GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT
|
|
|
|
|
&& GET_MODE_BITSIZE (mode) == 2 * BITS_PER_WORD)
|
|
|
|
|
{
|
1996-10-23 23:15:58 +02:00
|
|
|
|
rtx lowpart
|
|
|
|
|
= operand_subword (x, word + WORDS_BIG_ENDIAN, 0, GET_MODE (x));
|
|
|
|
|
rtx highpart
|
|
|
|
|
= operand_subword (x, word + ! WORDS_BIG_ENDIAN, 0, GET_MODE (x));
|
1992-04-13 13:47:32 +02:00
|
|
|
|
|
|
|
|
|
if (lowpart && GET_CODE (lowpart) == CONST_INT
|
|
|
|
|
&& highpart && GET_CODE (highpart) == CONST_INT)
|
|
|
|
|
return immed_double_const (INTVAL (lowpart), INTVAL (highpart), mode);
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* Otherwise, we can't do this. */
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
1992-10-05 07:34:26 +01:00
|
|
|
|
/* Return the real part (which has mode MODE) of a complex value X.
|
|
|
|
|
This always comes at the low address in memory. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
gen_realpart (mode, x)
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
register rtx x;
|
|
|
|
|
{
|
1994-01-11 01:32:57 +01:00
|
|
|
|
if (GET_CODE (x) == CONCAT && GET_MODE (XEXP (x, 0)) == mode)
|
|
|
|
|
return XEXP (x, 0);
|
1999-07-15 01:04:45 +02:00
|
|
|
|
else if (WORDS_BIG_ENDIAN
|
|
|
|
|
&& GET_MODE_BITSIZE (mode) < BITS_PER_WORD
|
|
|
|
|
&& REG_P (x)
|
|
|
|
|
&& REGNO (x) < FIRST_PSEUDO_REGISTER)
|
|
|
|
|
fatal ("Unable to access real part of complex value in a hard register on this target");
|
1994-01-11 01:32:57 +01:00
|
|
|
|
else if (WORDS_BIG_ENDIAN)
|
1992-10-05 07:34:26 +01:00
|
|
|
|
return gen_highpart (mode, x);
|
|
|
|
|
else
|
|
|
|
|
return gen_lowpart (mode, x);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return the imaginary part (which has mode MODE) of a complex value X.
|
|
|
|
|
This always comes at the high address in memory. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
gen_imagpart (mode, x)
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
register rtx x;
|
|
|
|
|
{
|
1994-01-11 01:32:57 +01:00
|
|
|
|
if (GET_CODE (x) == CONCAT && GET_MODE (XEXP (x, 0)) == mode)
|
|
|
|
|
return XEXP (x, 1);
|
|
|
|
|
else if (WORDS_BIG_ENDIAN)
|
1992-10-05 07:34:26 +01:00
|
|
|
|
return gen_lowpart (mode, x);
|
1999-07-15 01:04:45 +02:00
|
|
|
|
else if (!WORDS_BIG_ENDIAN
|
|
|
|
|
&& GET_MODE_BITSIZE (mode) < BITS_PER_WORD
|
|
|
|
|
&& REG_P (x)
|
|
|
|
|
&& REGNO (x) < FIRST_PSEUDO_REGISTER)
|
|
|
|
|
fatal ("Unable to access imaginary part of complex value in a hard register on this target");
|
1992-10-05 07:34:26 +01:00
|
|
|
|
else
|
|
|
|
|
return gen_highpart (mode, x);
|
|
|
|
|
}
|
1994-02-28 01:52:03 +01:00
|
|
|
|
|
|
|
|
|
/* Return 1 iff X, assumed to be a SUBREG,
|
|
|
|
|
refers to the real part of the complex value in its containing reg.
|
|
|
|
|
Complex values are always stored with the real part in the first word,
|
|
|
|
|
regardless of WORDS_BIG_ENDIAN. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
subreg_realpart_p (x)
|
|
|
|
|
rtx x;
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (x) != SUBREG)
|
|
|
|
|
abort ();
|
|
|
|
|
|
1998-12-15 12:56:36 +01:00
|
|
|
|
return SUBREG_WORD (x) * UNITS_PER_WORD < GET_MODE_UNIT_SIZE (GET_MODE (SUBREG_REG (x)));
|
1994-02-28 01:52:03 +01:00
|
|
|
|
}
|
1992-10-05 07:34:26 +01:00
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* Assuming that X is an rtx (e.g., MEM, REG or SUBREG) for a value,
|
|
|
|
|
return an rtx (MEM, SUBREG, or CONST_INT) that refers to the
|
|
|
|
|
least-significant part of X.
|
|
|
|
|
MODE specifies how big a part of X to return;
|
|
|
|
|
it usually should not be larger than a word.
|
|
|
|
|
If X is a MEM whose address is a QUEUED, the value may be so also. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
gen_lowpart (mode, x)
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
register rtx x;
|
|
|
|
|
{
|
|
|
|
|
rtx result = gen_lowpart_common (mode, x);
|
|
|
|
|
|
|
|
|
|
if (result)
|
|
|
|
|
return result;
|
1995-09-14 22:20:28 +02:00
|
|
|
|
else if (GET_CODE (x) == REG)
|
|
|
|
|
{
|
|
|
|
|
/* Must be a hard reg that's not valid in MODE. */
|
|
|
|
|
result = gen_lowpart_common (mode, copy_to_reg (x));
|
|
|
|
|
if (result == 0)
|
|
|
|
|
abort ();
|
1996-02-13 14:14:58 +01:00
|
|
|
|
return result;
|
1995-09-14 22:20:28 +02:00
|
|
|
|
}
|
1992-03-14 06:04:21 +01:00
|
|
|
|
else if (GET_CODE (x) == MEM)
|
|
|
|
|
{
|
|
|
|
|
/* The only additional case we can do is MEM. */
|
|
|
|
|
register int offset = 0;
|
|
|
|
|
if (WORDS_BIG_ENDIAN)
|
|
|
|
|
offset = (MAX (GET_MODE_SIZE (GET_MODE (x)), UNITS_PER_WORD)
|
|
|
|
|
- MAX (GET_MODE_SIZE (mode), UNITS_PER_WORD));
|
|
|
|
|
|
|
|
|
|
if (BYTES_BIG_ENDIAN)
|
|
|
|
|
/* Adjust the address so that the address-after-the-data
|
|
|
|
|
is unchanged. */
|
|
|
|
|
offset -= (MIN (UNITS_PER_WORD, GET_MODE_SIZE (mode))
|
|
|
|
|
- MIN (UNITS_PER_WORD, GET_MODE_SIZE (GET_MODE (x))));
|
|
|
|
|
|
|
|
|
|
return change_address (x, mode, plus_constant (XEXP (x, 0), offset));
|
|
|
|
|
}
|
1997-11-02 22:19:36 +01:00
|
|
|
|
else if (GET_CODE (x) == ADDRESSOF)
|
|
|
|
|
return gen_lowpart (mode, force_reg (GET_MODE (x), x));
|
1992-03-14 06:04:21 +01:00
|
|
|
|
else
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
|
1992-09-09 08:43:57 +02:00
|
|
|
|
/* Like `gen_lowpart', but refer to the most significant part.
|
|
|
|
|
This is used to access the imaginary part of a complex number. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
gen_highpart (mode, x)
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
register rtx x;
|
|
|
|
|
{
|
|
|
|
|
/* This case loses if X is a subreg. To catch bugs early,
|
|
|
|
|
complain if an invalid MODE is used even in other cases. */
|
|
|
|
|
if (GET_MODE_SIZE (mode) > UNITS_PER_WORD
|
|
|
|
|
&& GET_MODE_SIZE (mode) != GET_MODE_UNIT_SIZE (GET_MODE (x)))
|
|
|
|
|
abort ();
|
|
|
|
|
if (GET_CODE (x) == CONST_DOUBLE
|
1993-03-31 07:48:38 +02:00
|
|
|
|
#if !(TARGET_FLOAT_FORMAT != HOST_FLOAT_FORMAT || defined (REAL_IS_NOT_DOUBLE))
|
1992-09-09 08:43:57 +02:00
|
|
|
|
&& GET_MODE_CLASS (GET_MODE (x)) != MODE_FLOAT
|
|
|
|
|
#endif
|
|
|
|
|
)
|
1998-01-08 22:17:05 +01:00
|
|
|
|
return GEN_INT (CONST_DOUBLE_HIGH (x) & GET_MODE_MASK (mode));
|
1992-09-09 08:43:57 +02:00
|
|
|
|
else if (GET_CODE (x) == CONST_INT)
|
1998-04-22 14:57:04 +02:00
|
|
|
|
{
|
|
|
|
|
if (HOST_BITS_PER_WIDE_INT <= BITS_PER_WORD)
|
|
|
|
|
return const0_rtx;
|
|
|
|
|
return GEN_INT (INTVAL (x) >> (HOST_BITS_PER_WIDE_INT - BITS_PER_WORD));
|
|
|
|
|
}
|
1992-09-09 08:43:57 +02:00
|
|
|
|
else if (GET_CODE (x) == MEM)
|
|
|
|
|
{
|
|
|
|
|
register int offset = 0;
|
1994-02-04 14:14:23 +01:00
|
|
|
|
if (! WORDS_BIG_ENDIAN)
|
|
|
|
|
offset = (MAX (GET_MODE_SIZE (GET_MODE (x)), UNITS_PER_WORD)
|
|
|
|
|
- MAX (GET_MODE_SIZE (mode), UNITS_PER_WORD));
|
|
|
|
|
|
|
|
|
|
if (! BYTES_BIG_ENDIAN
|
|
|
|
|
&& GET_MODE_SIZE (mode) < UNITS_PER_WORD)
|
1992-09-09 08:43:57 +02:00
|
|
|
|
offset -= (GET_MODE_SIZE (mode)
|
|
|
|
|
- MIN (UNITS_PER_WORD,
|
|
|
|
|
GET_MODE_SIZE (GET_MODE (x))));
|
1994-02-04 14:14:23 +01:00
|
|
|
|
|
1992-09-09 08:43:57 +02:00
|
|
|
|
return change_address (x, mode, plus_constant (XEXP (x, 0), offset));
|
|
|
|
|
}
|
|
|
|
|
else if (GET_CODE (x) == SUBREG)
|
|
|
|
|
{
|
|
|
|
|
/* The only time this should occur is when we are looking at a
|
|
|
|
|
multi-word item with a SUBREG whose mode is the same as that of the
|
|
|
|
|
item. It isn't clear what we would do if it wasn't. */
|
|
|
|
|
if (SUBREG_WORD (x) != 0)
|
|
|
|
|
abort ();
|
|
|
|
|
return gen_highpart (mode, SUBREG_REG (x));
|
|
|
|
|
}
|
|
|
|
|
else if (GET_CODE (x) == REG)
|
|
|
|
|
{
|
1998-04-17 18:35:07 +02:00
|
|
|
|
int word;
|
1992-09-09 08:43:57 +02:00
|
|
|
|
|
1998-04-02 03:33:22 +02:00
|
|
|
|
/* Let the backend decide how many registers to skip. This is needed
|
|
|
|
|
in particular for sparc64 where fp regs are smaller than a word. */
|
|
|
|
|
/* ??? Note that subregs are now ambiguous, in that those against
|
1998-04-17 18:35:07 +02:00
|
|
|
|
pseudos are sized by the word size, while those against hard
|
1998-04-02 03:33:22 +02:00
|
|
|
|
regs are sized by the underlying register size. Better would be
|
|
|
|
|
to always interpret the subreg offset parameter as bytes or bits. */
|
|
|
|
|
|
1998-04-17 18:35:07 +02:00
|
|
|
|
if (WORDS_BIG_ENDIAN)
|
|
|
|
|
word = 0;
|
|
|
|
|
else if (REGNO (x) < FIRST_PSEUDO_REGISTER)
|
1998-04-02 03:33:22 +02:00
|
|
|
|
word = (HARD_REGNO_NREGS (REGNO (x), GET_MODE (x))
|
|
|
|
|
- HARD_REGNO_NREGS (REGNO (x), mode));
|
1998-04-17 18:35:07 +02:00
|
|
|
|
else
|
|
|
|
|
word = ((GET_MODE_SIZE (GET_MODE (x))
|
|
|
|
|
- MAX (GET_MODE_SIZE (mode), UNITS_PER_WORD))
|
|
|
|
|
/ UNITS_PER_WORD);
|
1995-04-26 01:09:34 +02:00
|
|
|
|
|
1992-10-09 12:30:07 +01:00
|
|
|
|
if (REGNO (x) < FIRST_PSEUDO_REGISTER
|
1996-07-04 00:07:53 +02:00
|
|
|
|
/* integrate.c can't handle parts of a return value register. */
|
1993-11-05 07:56:12 +01:00
|
|
|
|
&& (! REG_FUNCTION_VALUE_P (x)
|
|
|
|
|
|| ! rtx_equal_function_value_matters)
|
1992-10-09 12:30:07 +01:00
|
|
|
|
/* We want to keep the stack, frame, and arg pointers special. */
|
1994-03-16 15:01:34 +01:00
|
|
|
|
&& x != frame_pointer_rtx
|
1992-10-09 12:30:07 +01:00
|
|
|
|
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
|
1994-03-16 15:01:34 +01:00
|
|
|
|
&& x != arg_pointer_rtx
|
1992-10-09 12:30:07 +01:00
|
|
|
|
#endif
|
1994-03-16 15:01:34 +01:00
|
|
|
|
&& x != stack_pointer_rtx)
|
1998-01-08 22:17:05 +01:00
|
|
|
|
return gen_rtx_REG (mode, REGNO (x) + word);
|
1992-09-09 08:43:57 +02:00
|
|
|
|
else
|
1998-01-08 22:17:05 +01:00
|
|
|
|
return gen_rtx_SUBREG (mode, x, word);
|
1992-09-09 08:43:57 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* Return 1 iff X, assumed to be a SUBREG,
|
|
|
|
|
refers to the least significant part of its containing reg.
|
|
|
|
|
If X is not a SUBREG, always return 1 (it is its own low part!). */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
subreg_lowpart_p (x)
|
|
|
|
|
rtx x;
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (x) != SUBREG)
|
|
|
|
|
return 1;
|
1997-03-10 22:09:55 +01:00
|
|
|
|
else if (GET_MODE (SUBREG_REG (x)) == VOIDmode)
|
|
|
|
|
return 0;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
if (WORDS_BIG_ENDIAN
|
|
|
|
|
&& GET_MODE_SIZE (GET_MODE (SUBREG_REG (x))) > UNITS_PER_WORD)
|
|
|
|
|
return (SUBREG_WORD (x)
|
|
|
|
|
== ((GET_MODE_SIZE (GET_MODE (SUBREG_REG (x)))
|
|
|
|
|
- MAX (GET_MODE_SIZE (GET_MODE (x)), UNITS_PER_WORD))
|
|
|
|
|
/ UNITS_PER_WORD));
|
|
|
|
|
|
|
|
|
|
return SUBREG_WORD (x) == 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return subword I of operand OP.
|
|
|
|
|
The word number, I, is interpreted as the word number starting at the
|
|
|
|
|
low-order address. Word 0 is the low-order word if not WORDS_BIG_ENDIAN,
|
|
|
|
|
otherwise it is the high-order word.
|
|
|
|
|
|
|
|
|
|
If we cannot extract the required word, we return zero. Otherwise, an
|
|
|
|
|
rtx corresponding to the requested word will be returned.
|
|
|
|
|
|
|
|
|
|
VALIDATE_ADDRESS is nonzero if the address should be validated. Before
|
|
|
|
|
reload has completed, a valid address will always be returned. After
|
|
|
|
|
reload, if a valid address cannot be returned, we return zero.
|
|
|
|
|
|
|
|
|
|
If VALIDATE_ADDRESS is zero, we simply form the required address; validating
|
|
|
|
|
it is the responsibility of the caller.
|
|
|
|
|
|
|
|
|
|
MODE is the mode of OP in case it is a CONST_INT. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
operand_subword (op, i, validate_address, mode)
|
|
|
|
|
rtx op;
|
|
|
|
|
int i;
|
|
|
|
|
int validate_address;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
1992-07-06 22:04:13 +02:00
|
|
|
|
HOST_WIDE_INT val;
|
|
|
|
|
int size_ratio = HOST_BITS_PER_WIDE_INT / BITS_PER_WORD;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
if (mode == VOIDmode)
|
|
|
|
|
mode = GET_MODE (op);
|
|
|
|
|
|
|
|
|
|
if (mode == VOIDmode)
|
|
|
|
|
abort ();
|
|
|
|
|
|
1999-01-21 12:20:09 +01:00
|
|
|
|
/* If OP is narrower than a word, fail. */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
if (mode != BLKmode
|
1999-01-21 12:20:09 +01:00
|
|
|
|
&& (GET_MODE_SIZE (mode) < UNITS_PER_WORD))
|
1992-03-14 06:04:21 +01:00
|
|
|
|
return 0;
|
1999-01-21 12:20:09 +01:00
|
|
|
|
|
|
|
|
|
/* If we want a word outside OP, return zero. */
|
|
|
|
|
if (mode != BLKmode
|
|
|
|
|
&& (i + 1) * UNITS_PER_WORD > GET_MODE_SIZE (mode))
|
|
|
|
|
return const0_rtx;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
/* If OP is already an integer word, return it. */
|
|
|
|
|
if (GET_MODE_CLASS (mode) == MODE_INT
|
|
|
|
|
&& GET_MODE_SIZE (mode) == UNITS_PER_WORD)
|
|
|
|
|
return op;
|
|
|
|
|
|
|
|
|
|
/* If OP is a REG or SUBREG, we can handle it very simply. */
|
|
|
|
|
if (GET_CODE (op) == REG)
|
|
|
|
|
{
|
1999-06-17 03:56:31 +02:00
|
|
|
|
/* ??? There is a potential problem with this code. It does not
|
|
|
|
|
properly handle extractions of a subword from a hard register
|
|
|
|
|
that is larger than word_mode. Presumably the check for
|
|
|
|
|
HARD_REGNO_MODE_OK catches these most of these cases. */
|
|
|
|
|
|
|
|
|
|
/* If OP is a hard register, but OP + I is not a hard register,
|
|
|
|
|
then extracting a subword is impossible.
|
|
|
|
|
|
|
|
|
|
For example, consider if OP is the last hard register and it is
|
|
|
|
|
larger than word_mode. If we wanted word N (for N > 0) because a
|
|
|
|
|
part of that hard register was known to contain a useful value,
|
|
|
|
|
then OP + I would refer to a pseudo, not the hard register we
|
|
|
|
|
actually wanted. */
|
|
|
|
|
if (REGNO (op) < FIRST_PSEUDO_REGISTER
|
|
|
|
|
&& REGNO (op) + i >= FIRST_PSEUDO_REGISTER)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
/* If the register is not valid for MODE, return 0. Note we
|
|
|
|
|
have to check both OP and OP + I since they may refer to
|
|
|
|
|
different parts of the register file.
|
|
|
|
|
|
|
|
|
|
Consider if OP refers to the last 96bit FP register and we want
|
|
|
|
|
subword 3 because that subword is known to contain a value we
|
|
|
|
|
needed. */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
if (REGNO (op) < FIRST_PSEUDO_REGISTER
|
1999-06-17 03:56:31 +02:00
|
|
|
|
&& (! HARD_REGNO_MODE_OK (REGNO (op), word_mode)
|
|
|
|
|
|| ! HARD_REGNO_MODE_OK (REGNO (op) + i, word_mode)))
|
1992-03-14 06:04:21 +01:00
|
|
|
|
return 0;
|
|
|
|
|
else if (REGNO (op) >= FIRST_PSEUDO_REGISTER
|
|
|
|
|
|| (REG_FUNCTION_VALUE_P (op)
|
1992-10-09 12:30:07 +01:00
|
|
|
|
&& rtx_equal_function_value_matters)
|
|
|
|
|
/* We want to keep the stack, frame, and arg pointers
|
|
|
|
|
special. */
|
1994-03-16 15:01:34 +01:00
|
|
|
|
|| op == frame_pointer_rtx
|
1992-10-09 12:30:07 +01:00
|
|
|
|
#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
|
1994-03-16 15:01:34 +01:00
|
|
|
|
|| op == arg_pointer_rtx
|
1992-10-09 12:30:07 +01:00
|
|
|
|
#endif
|
1994-03-16 15:01:34 +01:00
|
|
|
|
|| op == stack_pointer_rtx)
|
1998-01-08 22:17:05 +01:00
|
|
|
|
return gen_rtx_SUBREG (word_mode, op, i);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
else
|
1998-01-08 22:17:05 +01:00
|
|
|
|
return gen_rtx_REG (word_mode, REGNO (op) + i);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
else if (GET_CODE (op) == SUBREG)
|
1998-01-08 22:17:05 +01:00
|
|
|
|
return gen_rtx_SUBREG (word_mode, SUBREG_REG (op), i + SUBREG_WORD (op));
|
1993-07-15 04:20:05 +02:00
|
|
|
|
else if (GET_CODE (op) == CONCAT)
|
|
|
|
|
{
|
|
|
|
|
int partwords = GET_MODE_UNIT_SIZE (GET_MODE (op)) / UNITS_PER_WORD;
|
|
|
|
|
if (i < partwords)
|
|
|
|
|
return operand_subword (XEXP (op, 0), i, validate_address, mode);
|
|
|
|
|
return operand_subword (XEXP (op, 1), i - partwords,
|
|
|
|
|
validate_address, mode);
|
|
|
|
|
}
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
/* Form a new MEM at the requested address. */
|
|
|
|
|
if (GET_CODE (op) == MEM)
|
|
|
|
|
{
|
|
|
|
|
rtx addr = plus_constant (XEXP (op, 0), i * UNITS_PER_WORD);
|
|
|
|
|
rtx new;
|
|
|
|
|
|
|
|
|
|
if (validate_address)
|
|
|
|
|
{
|
|
|
|
|
if (reload_completed)
|
|
|
|
|
{
|
|
|
|
|
if (! strict_memory_address_p (word_mode, addr))
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
addr = memory_address (word_mode, addr);
|
|
|
|
|
}
|
|
|
|
|
|
1998-01-08 22:17:05 +01:00
|
|
|
|
new = gen_rtx_MEM (word_mode, addr);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
1999-01-19 11:32:33 +01:00
|
|
|
|
MEM_COPY_ATTRIBUTES (new, op);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (op);
|
builtins.c (expand_builtin_saveregs): Remove static, remove exp and ignore arguments, bail if no EXPAND_BUILTIN_SAVEREGS.
* builtins.c (expand_builtin_saveregs): Remove static, remove exp
and ignore arguments, bail if no EXPAND_BUILTIN_SAVEREGS.
(expand_builtin_next_arg): Accept ARGLIST not EXP.
(stabilize_va_list): New function.
(std_expand_builtin_va_start): New function.
(expand_builtin_va_start): New function.
(get_varargs_alias_set): New function.
(std_expand_builtin_va_arg): New function.
(expand_builtin_va_arg): New function.
(expand_builtin_va_end): New function.
(expand_builtin_va_copy): New function.
(expand_builtin): Call them.
* c-common.c (c_common_nodes_and_builtins): Build __builtin_va_list,
__builtin_{varargs_start,stdarg_start,end,copy}.
(build_va_arg): New function.
* c-common.h (CTI_PTR_TYPE, ptr_type_node): Delete.
(build_va_arg): Declare.
* c-decl.c (ptr_type_node, va_list_type_node): New.
* c-parse.gperf (__builtin_va_arg): New.
* c-parse.in (VA_ARG): New token.
(unary_expr): Recognize it.
* expr.c (expand_expr): Expand VA_ARG_EXPR.
* expr.h (std_expand_builtin_va_start): Declare.
(std_expand_builtin_va_arg): Declare.
(expand_builtin_va_arg): Declare.
(get_varargs_alias_set): Declare.
* tree.def (VA_ARG_EXPR): New.
* tree.h (BUILT_IN_VARARGS_START): New.
(BUILT_IN_STDARG_START, BUILT_IN_VA_END): New.
(ptr_type_node, va_list_type_node): Declare.
* tm.texi (EXPAND_BUILTIN_SAVEREGS): Kill unused ARGLIST argument.
* m32r.h (EXPAND_BUILTIN_SAVEREGS): Likewise.
* m88k.h, m88k.c: Likewise.
* mn10300.h, mn10300.c: Likewise.
* pa.h, pa.c: Likewise.
* rs6000.h, rs6000.c: Likewise.
* sh.h, sh.c: Likewise.
* sparc.h, sparc.c: Likewise.
* emit-rtl.c (operand_subword): Copy alias set.
(change_address): Likewise.
From-SVN: r28243
1999-07-26 03:21:03 +02:00
|
|
|
|
MEM_ALIAS_SET (new) = MEM_ALIAS_SET (op);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
return new;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* The only remaining cases are when OP is a constant. If the host and
|
|
|
|
|
target floating formats are the same, handling two-word floating
|
1993-05-29 20:13:55 +02:00
|
|
|
|
constants are easy. Note that REAL_VALUE_TO_TARGET_{SINGLE,DOUBLE}
|
1994-05-19 22:38:15 +02:00
|
|
|
|
are defined as returning one or two 32 bit values, respectively,
|
|
|
|
|
and not values of BITS_PER_WORD bits. */
|
1993-03-31 07:48:38 +02:00
|
|
|
|
#ifdef REAL_ARITHMETIC
|
1994-05-19 22:38:15 +02:00
|
|
|
|
/* The output is some bits, the width of the target machine's word.
|
|
|
|
|
A wider-word host can surely hold them in a CONST_INT. A narrower-word
|
|
|
|
|
host can't. */
|
|
|
|
|
if (HOST_BITS_PER_WIDE_INT >= BITS_PER_WORD
|
1993-03-31 07:48:38 +02:00
|
|
|
|
&& GET_MODE_CLASS (mode) == MODE_FLOAT
|
1993-05-29 20:13:55 +02:00
|
|
|
|
&& GET_MODE_BITSIZE (mode) == 64
|
1993-03-31 07:48:38 +02:00
|
|
|
|
&& GET_CODE (op) == CONST_DOUBLE)
|
|
|
|
|
{
|
1994-05-19 22:38:15 +02:00
|
|
|
|
long k[2];
|
1993-03-31 07:48:38 +02:00
|
|
|
|
REAL_VALUE_TYPE rv;
|
|
|
|
|
|
|
|
|
|
REAL_VALUE_FROM_CONST_DOUBLE (rv, op);
|
|
|
|
|
REAL_VALUE_TO_TARGET_DOUBLE (rv, k);
|
1993-05-29 20:13:55 +02:00
|
|
|
|
|
1994-05-19 22:38:15 +02:00
|
|
|
|
/* We handle 32-bit and >= 64-bit words here. Note that the order in
|
1993-05-29 20:13:55 +02:00
|
|
|
|
which the words are written depends on the word endianness.
|
|
|
|
|
??? This is a potential portability problem and should
|
1999-04-29 19:24:37 +02:00
|
|
|
|
be fixed at some point.
|
|
|
|
|
|
|
|
|
|
We must excercise caution with the sign bit. By definition there
|
|
|
|
|
are 32 significant bits in K; there may be more in a HOST_WIDE_INT.
|
|
|
|
|
Consider a host with a 32-bit long and a 64-bit HOST_WIDE_INT.
|
|
|
|
|
So we explicitly mask and sign-extend as necessary. */
|
1994-05-19 22:38:15 +02:00
|
|
|
|
if (BITS_PER_WORD == 32)
|
1999-04-29 19:24:37 +02:00
|
|
|
|
{
|
|
|
|
|
val = k[i];
|
|
|
|
|
val = ((val & 0xffffffff) ^ 0x80000000) - 0x80000000;
|
|
|
|
|
return GEN_INT (val);
|
|
|
|
|
}
|
|
|
|
|
#if HOST_BITS_PER_WIDE_INT >= 64
|
1994-05-19 22:38:15 +02:00
|
|
|
|
else if (BITS_PER_WORD >= 64 && i == 0)
|
1999-04-29 19:24:37 +02:00
|
|
|
|
{
|
|
|
|
|
val = k[! WORDS_BIG_ENDIAN];
|
|
|
|
|
val = (((val & 0xffffffff) ^ 0x80000000) - 0x80000000) << 32;
|
|
|
|
|
val |= (HOST_WIDE_INT) k[WORDS_BIG_ENDIAN] & 0xffffffff;
|
|
|
|
|
return GEN_INT (val);
|
|
|
|
|
}
|
1994-05-19 22:38:15 +02:00
|
|
|
|
#endif
|
1994-11-21 20:40:36 +01:00
|
|
|
|
else if (BITS_PER_WORD == 16)
|
|
|
|
|
{
|
1999-04-29 19:24:37 +02:00
|
|
|
|
val = k[i >> 1];
|
|
|
|
|
if ((i & 1) == !WORDS_BIG_ENDIAN)
|
|
|
|
|
val >>= 16;
|
|
|
|
|
val &= 0xffff;
|
|
|
|
|
return GEN_INT (val);
|
1994-11-21 20:40:36 +01:00
|
|
|
|
}
|
1993-05-29 20:13:55 +02:00
|
|
|
|
else
|
|
|
|
|
abort ();
|
1993-03-31 07:48:38 +02:00
|
|
|
|
}
|
1996-02-19 12:57:13 +01:00
|
|
|
|
else if (HOST_BITS_PER_WIDE_INT >= BITS_PER_WORD
|
|
|
|
|
&& GET_MODE_CLASS (mode) == MODE_FLOAT
|
|
|
|
|
&& GET_MODE_BITSIZE (mode) > 64
|
|
|
|
|
&& GET_CODE (op) == CONST_DOUBLE)
|
|
|
|
|
{
|
|
|
|
|
long k[4];
|
|
|
|
|
REAL_VALUE_TYPE rv;
|
|
|
|
|
|
|
|
|
|
REAL_VALUE_FROM_CONST_DOUBLE (rv, op);
|
|
|
|
|
REAL_VALUE_TO_TARGET_LONG_DOUBLE (rv, k);
|
|
|
|
|
|
|
|
|
|
if (BITS_PER_WORD == 32)
|
1999-04-29 19:24:37 +02:00
|
|
|
|
{
|
|
|
|
|
val = k[i];
|
|
|
|
|
val = ((val & 0xffffffff) ^ 0x80000000) - 0x80000000;
|
|
|
|
|
return GEN_INT (val);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
abort ();
|
1996-02-19 12:57:13 +01:00
|
|
|
|
}
|
1993-03-31 07:48:38 +02:00
|
|
|
|
#else /* no REAL_ARITHMETIC */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT
|
1992-07-06 22:04:13 +02:00
|
|
|
|
&& HOST_BITS_PER_WIDE_INT == BITS_PER_WORD)
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|| flag_pretend_float)
|
|
|
|
|
&& GET_MODE_CLASS (mode) == MODE_FLOAT
|
|
|
|
|
&& GET_MODE_SIZE (mode) == 2 * UNITS_PER_WORD
|
|
|
|
|
&& GET_CODE (op) == CONST_DOUBLE)
|
1992-07-07 04:14:24 +02:00
|
|
|
|
{
|
|
|
|
|
/* The constant is stored in the host's word-ordering,
|
|
|
|
|
but we want to access it in the target's word-ordering. Some
|
|
|
|
|
compilers don't like a conditional inside macro args, so we have two
|
|
|
|
|
copies of the return. */
|
1992-04-01 10:03:10 +02:00
|
|
|
|
#ifdef HOST_WORDS_BIG_ENDIAN
|
1992-07-07 04:14:24 +02:00
|
|
|
|
return GEN_INT (i == WORDS_BIG_ENDIAN
|
|
|
|
|
? CONST_DOUBLE_HIGH (op) : CONST_DOUBLE_LOW (op));
|
1992-04-01 10:03:10 +02:00
|
|
|
|
#else
|
1992-07-07 04:14:24 +02:00
|
|
|
|
return GEN_INT (i != WORDS_BIG_ENDIAN
|
|
|
|
|
? CONST_DOUBLE_HIGH (op) : CONST_DOUBLE_LOW (op));
|
1992-04-01 10:03:10 +02:00
|
|
|
|
#endif
|
1992-07-07 04:14:24 +02:00
|
|
|
|
}
|
1993-03-31 07:48:38 +02:00
|
|
|
|
#endif /* no REAL_ARITHMETIC */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
/* Single word float is a little harder, since single- and double-word
|
|
|
|
|
values often do not have the same high-order bits. We have already
|
|
|
|
|
verified that we want the only defined word of the single-word value. */
|
1993-03-31 07:48:38 +02:00
|
|
|
|
#ifdef REAL_ARITHMETIC
|
1994-05-19 22:38:15 +02:00
|
|
|
|
if (GET_MODE_CLASS (mode) == MODE_FLOAT
|
1993-05-29 20:13:55 +02:00
|
|
|
|
&& GET_MODE_BITSIZE (mode) == 32
|
1993-03-31 07:48:38 +02:00
|
|
|
|
&& GET_CODE (op) == CONST_DOUBLE)
|
|
|
|
|
{
|
1994-05-19 22:38:15 +02:00
|
|
|
|
long l;
|
1993-03-31 07:48:38 +02:00
|
|
|
|
REAL_VALUE_TYPE rv;
|
|
|
|
|
|
|
|
|
|
REAL_VALUE_FROM_CONST_DOUBLE (rv, op);
|
|
|
|
|
REAL_VALUE_TO_TARGET_SINGLE (rv, l);
|
1998-01-01 13:55:19 +01:00
|
|
|
|
|
1999-04-29 19:24:37 +02:00
|
|
|
|
/* Sign extend from known 32-bit value to HOST_WIDE_INT. */
|
|
|
|
|
val = l;
|
|
|
|
|
val = ((val & 0xffffffff) ^ 0x80000000) - 0x80000000;
|
1999-02-10 18:28:24 +01:00
|
|
|
|
|
1998-01-01 13:55:19 +01:00
|
|
|
|
if (BITS_PER_WORD == 16)
|
|
|
|
|
{
|
1999-04-29 19:24:37 +02:00
|
|
|
|
if ((i & 1) == !WORDS_BIG_ENDIAN)
|
|
|
|
|
val >>= 16;
|
|
|
|
|
val &= 0xffff;
|
1998-01-01 13:55:19 +01:00
|
|
|
|
}
|
1999-04-29 19:24:37 +02:00
|
|
|
|
|
|
|
|
|
return GEN_INT (val);
|
1993-03-31 07:48:38 +02:00
|
|
|
|
}
|
|
|
|
|
#else
|
1992-03-14 06:04:21 +01:00
|
|
|
|
if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT
|
1992-07-06 22:04:13 +02:00
|
|
|
|
&& HOST_BITS_PER_WIDE_INT == BITS_PER_WORD)
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|| flag_pretend_float)
|
1996-11-16 23:40:22 +01:00
|
|
|
|
&& sizeof (float) * 8 == HOST_BITS_PER_WIDE_INT
|
1992-03-14 06:04:21 +01:00
|
|
|
|
&& GET_MODE_CLASS (mode) == MODE_FLOAT
|
|
|
|
|
&& GET_MODE_SIZE (mode) == UNITS_PER_WORD
|
|
|
|
|
&& GET_CODE (op) == CONST_DOUBLE)
|
|
|
|
|
{
|
|
|
|
|
double d;
|
1992-07-06 22:04:13 +02:00
|
|
|
|
union {float f; HOST_WIDE_INT i; } u;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
REAL_VALUE_FROM_CONST_DOUBLE (d, op);
|
|
|
|
|
|
|
|
|
|
u.f = d;
|
1992-07-06 22:04:13 +02:00
|
|
|
|
return GEN_INT (u.i);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
1996-11-16 23:40:22 +01:00
|
|
|
|
if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT
|
|
|
|
|
&& HOST_BITS_PER_WIDE_INT == BITS_PER_WORD)
|
|
|
|
|
|| flag_pretend_float)
|
|
|
|
|
&& sizeof (double) * 8 == HOST_BITS_PER_WIDE_INT
|
|
|
|
|
&& GET_MODE_CLASS (mode) == MODE_FLOAT
|
|
|
|
|
&& GET_MODE_SIZE (mode) == UNITS_PER_WORD
|
|
|
|
|
&& GET_CODE (op) == CONST_DOUBLE)
|
|
|
|
|
{
|
|
|
|
|
double d;
|
|
|
|
|
union {double d; HOST_WIDE_INT i; } u;
|
|
|
|
|
|
|
|
|
|
REAL_VALUE_FROM_CONST_DOUBLE (d, op);
|
|
|
|
|
|
|
|
|
|
u.d = d;
|
|
|
|
|
return GEN_INT (u.i);
|
|
|
|
|
}
|
1993-03-31 07:48:38 +02:00
|
|
|
|
#endif /* no REAL_ARITHMETIC */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
/* The only remaining cases that we can handle are integers.
|
|
|
|
|
Convert to proper endianness now since these cases need it.
|
|
|
|
|
At this point, i == 0 means the low-order word.
|
|
|
|
|
|
1993-05-19 19:13:32 +02:00
|
|
|
|
We do not want to handle the case when BITS_PER_WORD <= HOST_BITS_PER_INT
|
|
|
|
|
in general. However, if OP is (const_int 0), we can just return
|
|
|
|
|
it for any word. */
|
|
|
|
|
|
|
|
|
|
if (op == const0_rtx)
|
|
|
|
|
return op;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
if (GET_MODE_CLASS (mode) != MODE_INT
|
1993-05-19 19:13:32 +02:00
|
|
|
|
|| (GET_CODE (op) != CONST_INT && GET_CODE (op) != CONST_DOUBLE)
|
1994-10-30 02:16:22 +01:00
|
|
|
|
|| BITS_PER_WORD > HOST_BITS_PER_WIDE_INT)
|
1992-03-14 06:04:21 +01:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (WORDS_BIG_ENDIAN)
|
|
|
|
|
i = GET_MODE_SIZE (mode) / UNITS_PER_WORD - 1 - i;
|
|
|
|
|
|
|
|
|
|
/* Find out which word on the host machine this value is in and get
|
|
|
|
|
it from the constant. */
|
|
|
|
|
val = (i / size_ratio == 0
|
|
|
|
|
? (GET_CODE (op) == CONST_INT ? INTVAL (op) : CONST_DOUBLE_LOW (op))
|
|
|
|
|
: (GET_CODE (op) == CONST_INT
|
|
|
|
|
? (INTVAL (op) < 0 ? ~0 : 0) : CONST_DOUBLE_HIGH (op)));
|
|
|
|
|
|
1998-04-10 11:44:37 +02:00
|
|
|
|
/* Get the value we want into the low bits of val. */
|
1992-07-06 22:04:13 +02:00
|
|
|
|
if (BITS_PER_WORD < HOST_BITS_PER_WIDE_INT)
|
1998-04-10 11:44:37 +02:00
|
|
|
|
val = ((val >> ((i % size_ratio) * BITS_PER_WORD)));
|
|
|
|
|
|
1999-07-23 03:21:31 +02:00
|
|
|
|
val = trunc_int_for_mode (val, word_mode);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
1992-07-06 22:04:13 +02:00
|
|
|
|
return GEN_INT (val);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Similar to `operand_subword', but never return 0. If we can't extract
|
|
|
|
|
the required subword, put OP into a register and try again. If that fails,
|
|
|
|
|
abort. We always validate the address in this case. It is not valid
|
|
|
|
|
to call this function after reload; it is mostly meant for RTL
|
|
|
|
|
generation.
|
|
|
|
|
|
|
|
|
|
MODE is the mode of OP, in case it is CONST_INT. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
operand_subword_force (op, i, mode)
|
|
|
|
|
rtx op;
|
|
|
|
|
int i;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
|
|
|
|
rtx result = operand_subword (op, i, 1, mode);
|
|
|
|
|
|
|
|
|
|
if (result)
|
|
|
|
|
return result;
|
|
|
|
|
|
|
|
|
|
if (mode != BLKmode && mode != VOIDmode)
|
1998-04-17 16:41:49 +02:00
|
|
|
|
{
|
|
|
|
|
/* If this is a register which can not be accessed by words, copy it
|
|
|
|
|
to a pseudo register. */
|
|
|
|
|
if (GET_CODE (op) == REG)
|
|
|
|
|
op = copy_to_reg (op);
|
|
|
|
|
else
|
|
|
|
|
op = force_reg (mode, op);
|
|
|
|
|
}
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
result = operand_subword (op, i, 1, mode);
|
|
|
|
|
if (result == 0)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Given a compare instruction, swap the operands.
|
|
|
|
|
A test instruction is changed into a compare of 0 against the operand. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
reverse_comparison (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
rtx body = PATTERN (insn);
|
|
|
|
|
rtx comp;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (body) == SET)
|
|
|
|
|
comp = SET_SRC (body);
|
|
|
|
|
else
|
|
|
|
|
comp = SET_SRC (XVECEXP (body, 0, 0));
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (comp) == COMPARE)
|
|
|
|
|
{
|
|
|
|
|
rtx op0 = XEXP (comp, 0);
|
|
|
|
|
rtx op1 = XEXP (comp, 1);
|
|
|
|
|
XEXP (comp, 0) = op1;
|
|
|
|
|
XEXP (comp, 1) = op0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
1999-09-07 07:49:18 +02:00
|
|
|
|
rtx new = gen_rtx_COMPARE (VOIDmode,
|
|
|
|
|
CONST0_RTX (GET_MODE (comp)), comp);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
if (GET_CODE (body) == SET)
|
|
|
|
|
SET_SRC (body) = new;
|
|
|
|
|
else
|
|
|
|
|
SET_SRC (XVECEXP (body, 0, 0)) = new;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return a memory reference like MEMREF, but with its mode changed
|
|
|
|
|
to MODE and its address changed to ADDR.
|
|
|
|
|
(VOIDmode means don't change the mode.
|
|
|
|
|
NULL for ADDR means don't change the address.) */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
change_address (memref, mode, addr)
|
|
|
|
|
rtx memref;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
rtx addr;
|
|
|
|
|
{
|
|
|
|
|
rtx new;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (memref) != MEM)
|
|
|
|
|
abort ();
|
|
|
|
|
if (mode == VOIDmode)
|
|
|
|
|
mode = GET_MODE (memref);
|
|
|
|
|
if (addr == 0)
|
|
|
|
|
addr = XEXP (memref, 0);
|
|
|
|
|
|
|
|
|
|
/* If reload is in progress or has completed, ADDR must be valid.
|
|
|
|
|
Otherwise, we can call memory_address to make it valid. */
|
|
|
|
|
if (reload_completed || reload_in_progress)
|
|
|
|
|
{
|
|
|
|
|
if (! memory_address_p (mode, addr))
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
addr = memory_address (mode, addr);
|
|
|
|
|
|
1996-11-09 00:55:41 +01:00
|
|
|
|
if (rtx_equal_p (addr, XEXP (memref, 0)) && mode == GET_MODE (memref))
|
|
|
|
|
return memref;
|
|
|
|
|
|
1998-01-08 22:17:05 +01:00
|
|
|
|
new = gen_rtx_MEM (mode, addr);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
RTX_UNCHANGING_P (new) = RTX_UNCHANGING_P (memref);
|
1999-01-19 11:32:33 +01:00
|
|
|
|
MEM_COPY_ATTRIBUTES (new, memref);
|
builtins.c (expand_builtin_saveregs): Remove static, remove exp and ignore arguments, bail if no EXPAND_BUILTIN_SAVEREGS.
* builtins.c (expand_builtin_saveregs): Remove static, remove exp
and ignore arguments, bail if no EXPAND_BUILTIN_SAVEREGS.
(expand_builtin_next_arg): Accept ARGLIST not EXP.
(stabilize_va_list): New function.
(std_expand_builtin_va_start): New function.
(expand_builtin_va_start): New function.
(get_varargs_alias_set): New function.
(std_expand_builtin_va_arg): New function.
(expand_builtin_va_arg): New function.
(expand_builtin_va_end): New function.
(expand_builtin_va_copy): New function.
(expand_builtin): Call them.
* c-common.c (c_common_nodes_and_builtins): Build __builtin_va_list,
__builtin_{varargs_start,stdarg_start,end,copy}.
(build_va_arg): New function.
* c-common.h (CTI_PTR_TYPE, ptr_type_node): Delete.
(build_va_arg): Declare.
* c-decl.c (ptr_type_node, va_list_type_node): New.
* c-parse.gperf (__builtin_va_arg): New.
* c-parse.in (VA_ARG): New token.
(unary_expr): Recognize it.
* expr.c (expand_expr): Expand VA_ARG_EXPR.
* expr.h (std_expand_builtin_va_start): Declare.
(std_expand_builtin_va_arg): Declare.
(expand_builtin_va_arg): Declare.
(get_varargs_alias_set): Declare.
* tree.def (VA_ARG_EXPR): New.
* tree.h (BUILT_IN_VARARGS_START): New.
(BUILT_IN_STDARG_START, BUILT_IN_VA_END): New.
(ptr_type_node, va_list_type_node): Declare.
* tm.texi (EXPAND_BUILTIN_SAVEREGS): Kill unused ARGLIST argument.
* m32r.h (EXPAND_BUILTIN_SAVEREGS): Likewise.
* m88k.h, m88k.c: Likewise.
* mn10300.h, mn10300.c: Likewise.
* pa.h, pa.c: Likewise.
* rs6000.h, rs6000.c: Likewise.
* sh.h, sh.c: Likewise.
* sparc.h, sparc.c: Likewise.
* emit-rtl.c (operand_subword): Copy alias set.
(change_address): Likewise.
From-SVN: r28243
1999-07-26 03:21:03 +02:00
|
|
|
|
MEM_ALIAS_SET (new) = MEM_ALIAS_SET (memref);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
return new;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return a newly created CODE_LABEL rtx with a unique label number. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
gen_label_rtx ()
|
|
|
|
|
{
|
1993-09-21 23:25:24 +02:00
|
|
|
|
register rtx label;
|
|
|
|
|
|
1998-01-20 09:55:07 +01:00
|
|
|
|
label = gen_rtx_CODE_LABEL (VOIDmode, 0, NULL_RTX,
|
|
|
|
|
NULL_RTX, label_num++, NULL_PTR);
|
1993-09-21 23:25:24 +02:00
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
LABEL_NUSES (label) = 0;
|
|
|
|
|
return label;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* For procedure integration. */
|
|
|
|
|
|
|
|
|
|
/* Install new pointers to the first and last insns in the chain.
|
1995-12-27 21:21:02 +01:00
|
|
|
|
Also, set cur_insn_uid to one higher than the last in use.
|
1992-03-14 06:04:21 +01:00
|
|
|
|
Used for an inline-procedure after copying the insn chain. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
set_new_first_and_last_insn (first, last)
|
|
|
|
|
rtx first, last;
|
|
|
|
|
{
|
1995-12-27 21:21:02 +01:00
|
|
|
|
rtx insn;
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
first_insn = first;
|
|
|
|
|
last_insn = last;
|
1995-12-27 21:21:02 +01:00
|
|
|
|
cur_insn_uid = 0;
|
|
|
|
|
|
|
|
|
|
for (insn = first; insn; insn = NEXT_INSN (insn))
|
|
|
|
|
cur_insn_uid = MAX (cur_insn_uid, INSN_UID (insn));
|
|
|
|
|
|
|
|
|
|
cur_insn_uid++;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Set the range of label numbers found in the current function.
|
|
|
|
|
This is used when belatedly compiling an inline function. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
set_new_first_and_last_label_num (first, last)
|
|
|
|
|
int first, last;
|
|
|
|
|
{
|
|
|
|
|
base_label_num = label_num;
|
|
|
|
|
first_label_num = first;
|
|
|
|
|
last_label_num = last;
|
|
|
|
|
}
|
1999-08-09 16:00:21 +02:00
|
|
|
|
|
|
|
|
|
/* Set the last label number found in the current function.
|
|
|
|
|
This is used when belatedly compiling an inline function. */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
void
|
1999-08-09 16:00:21 +02:00
|
|
|
|
set_new_last_label_num (last)
|
|
|
|
|
int last;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
{
|
1999-08-09 16:00:21 +02:00
|
|
|
|
base_label_num = label_num;
|
|
|
|
|
last_label_num = last;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
1999-08-09 16:00:21 +02:00
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* Restore all variables describing the current status from the structure *P.
|
|
|
|
|
This is used after a nested function. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
restore_emit_status (p)
|
|
|
|
|
struct function *p;
|
|
|
|
|
{
|
1993-06-28 03:10:23 +02:00
|
|
|
|
last_label_num = 0;
|
1999-08-09 16:00:21 +02:00
|
|
|
|
clear_emit_caches ();
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
1999-09-05 03:06:48 +02:00
|
|
|
|
|
1999-09-07 17:20:58 +02:00
|
|
|
|
/* Clear out all parts of the state in F that can safely be discarded
|
1999-09-05 03:06:48 +02:00
|
|
|
|
after the function has been compiled, to let garbage collection
|
1999-09-09 20:55:37 +02:00
|
|
|
|
reclaim the memory. */
|
1999-09-07 17:20:58 +02:00
|
|
|
|
|
1999-09-05 03:06:48 +02:00
|
|
|
|
void
|
1999-09-09 20:55:37 +02:00
|
|
|
|
free_emit_status (f)
|
1999-09-05 03:06:48 +02:00
|
|
|
|
struct function *f;
|
|
|
|
|
{
|
|
|
|
|
free (f->emit->x_regno_reg_rtx);
|
|
|
|
|
free (f->emit->regno_pointer_flag);
|
|
|
|
|
free (f->emit->regno_pointer_align);
|
1999-09-16 03:12:25 +02:00
|
|
|
|
free (f->emit);
|
|
|
|
|
f->emit = NULL;
|
1999-09-05 03:06:48 +02:00
|
|
|
|
}
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
/* Go through all the RTL insn bodies and copy any invalid shared structure.
|
|
|
|
|
It does not work to do this twice, because the mark bits set here
|
|
|
|
|
are not cleared afterwards. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
unshare_all_rtl (insn)
|
|
|
|
|
register rtx insn;
|
|
|
|
|
{
|
|
|
|
|
for (; insn; insn = NEXT_INSN (insn))
|
|
|
|
|
if (GET_CODE (insn) == INSN || GET_CODE (insn) == JUMP_INSN
|
|
|
|
|
|| GET_CODE (insn) == CALL_INSN)
|
|
|
|
|
{
|
|
|
|
|
PATTERN (insn) = copy_rtx_if_shared (PATTERN (insn));
|
|
|
|
|
REG_NOTES (insn) = copy_rtx_if_shared (REG_NOTES (insn));
|
|
|
|
|
LOG_LINKS (insn) = copy_rtx_if_shared (LOG_LINKS (insn));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make sure the addresses of stack slots found outside the insn chain
|
|
|
|
|
(such as, in DECL_RTL of a variable) are not shared
|
|
|
|
|
with the insn chain.
|
|
|
|
|
|
|
|
|
|
This special care is necessary when the stack slot MEM does not
|
|
|
|
|
actually appear in the insn chain. If it does appear, its address
|
|
|
|
|
is unshared from all else at that point. */
|
|
|
|
|
|
|
|
|
|
copy_rtx_if_shared (stack_slot_list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Mark ORIG as in use, and return a copy of it if it was already in use.
|
|
|
|
|
Recursively does the same for subexpressions. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
copy_rtx_if_shared (orig)
|
|
|
|
|
rtx orig;
|
|
|
|
|
{
|
|
|
|
|
register rtx x = orig;
|
|
|
|
|
register int i;
|
|
|
|
|
register enum rtx_code code;
|
rtl.h (rtx_format): Constify a char*.
* rtl.h (rtx_format): Constify a char*.
* rtl.c (rtx_format): Likewise.
(copy_rtx, copy_most_rtx, read_rtx): Likewise.
(init_rtl): Use accessor macro, not `rtx_format'.
* alias.c (rtx_equal_for_memref_p, find_symbolic_term): Constify a
char*.
* caller-save.c (mark_referenced_regs): Likewise.
* combine.c (subst, make_compound_operation, known_cond,
gen_rtx_combine, update_table_tick, get_last_value_validate,
use_crosses_set_p, mark_used_regs_combine, move_deaths): Likewise.
* cse.c (rtx_cost, mention_regs, canon_hash, exp_equiv_p,
refers_to_p, canon_reg, fold_rtx, cse_process_notes,
count_reg_usage): Likewise.
* emit-rtl.c (gen_rtx, copy_rtx_if_shared, reset_used_flags):
Likewise.
* final.c (leaf_renumber_regs_insn): Likewise.
* flow.c (mark_used_regs, find_use_as_address, dump_flow_info,
dump_edge_info, count_reg_references): Likewise.
* function.c (fixup_var_refs_1, walk_fixup_memory_subreg,
fixup_stack_1, purge_addressof_1, instantiate_virtual_regs_1):
Likewise.
* gcse.c (oprs_unchanged_p, hash_expr_1, expr_equiv_p,
oprs_not_set_p, expr_killed_p, compute_transp, find_used_regs,
add_label_notes): Likewise.
* genattrtab.c (attr_rtx, attr_copy_rtx, encode_units_mask,
clear_struct_flag, count_sub_rtxs, count_alternatives,
compares_alternatives_p, contained_in_p, walk_attr_value,
write_expr_attr_cache): Likewise.
* genconfig.c (walk_insn_part): Likewise.
* genemit.c (max_operand_1, gen_exp): Likewise.
* genextract.c (walk_rtx): Likewise.
* genflags.c (num_operands): Likewise.
* genoutput.c (scan_operands): Likewise.
* genpeep.c (match_rtx): Likewise.
* genrecog.c (add_to_sequence): Likewise.
* haifa-sched.c (may_trap_exp, sched_analyze_2, attach_deaths):
Likewise.
* integrate.c (save_constants, copy_for_inline,
copy_rtx_and_substitute, subst_constants, restore_constants):
Likewise.
* jump.c (mark_jump_label, invert_exp, redirect_exp,
rtx_renumbered_equal_p, rtx_equal_for_thread_p): Likewise.
* local-alloc.c (contains_replace_regs, memref_referenced_p):
Likewise.
* loop.c (record_excess_regs, rtx_equal_for_loop_p,
add_label_notes, replace_call_address, count_nonfixed_reads,
invariant_p, find_single_use_in_loop, find_mem_givs,
find_life_end, maybe_eliminate_biv_1, update_reg_last_use):
Likewise.
* print-rtl.c (reg_names, print_rtx): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1): Likewise.
* reg-stack.c (stack_regs_mentioned_p, record_label_references,
record_reg_life_pat, swap_rtx_condition, goto_block_pat,
print_blocks): Likewise.
* regclass.c (fix_register, record_address_regs,
reg_scan_mark_refs): Likewise.
* regmove.c (stable_but_for_p): Likewise.
* reload.c (loc_mentioned_in_p, operands_match_p,
find_reloads_toplevsubst_reg_equivs, find_reloads_address_1,
copy_replacements, refers_to_regno_for_reload_p,
refers_to_mem_for_reload_p, find_inc_amount, regno_clobbered_p,
reload_when_needed_name, reg_class_names, debug_reload_to_stream):
Likewise.
* reload1.c (eliminate_regs, scan_paradoxical_subregs,
delete_address_reloads_1, count_occurrences,
reload_cse_mem_conflict_p, reload_combine_note_use,
add_auto_inc_notes): Likewise.
* resource.c (mark_referenced_resources, mark_set_resources):
Likewise.
* rtlanal.c (rtx_unstable_p, rtx_varies_p, rtx_addr_varies_p,
reg_mentioned_p, regs_set_between_p, modified_between_p,
modified_in_p, refers_to_regno_p, reg_overlap_mentioned_p,
rtx_equal_p, volatile_insn_p, volatile_refs_p, side_effects_p,
may_trap_p, inequality_comparisons_p, replace_rtx, replace_regs,
jmp_uses_reg_or_mem, for_each_rtx, regno_use_in): Likewise.
* sched.c (sched_analyze_2, attach_deaths): Likewise.
* stupid.c (stupid_mark_refs): Likewise.
* unroll.c (remap_split_bivs): Likewise.
* varasm.c (mark_constants): Likewise.
* a29k/a29k.c (uses_local_reg_p): Likewise.
* alpha/alpha.c (summarize_insn): Likewise.
* arm/arm.c (symbol_mentioned_p, label_mentioned_p,
eliminate_lr2ip): Likewise.
* arm/thumb.c (symbol_mentioned_p, label_mentioned_p): Likewise.
* i386/i386.c (symbolic_reference_mentioned_p, copy_all_rtx,
reg_mentioned_in_mem): Likewise.
* ns32k/ns32k.c (global_symbolic_reference_mentioned_p,
symbolic_reference_mentioned_p): Likewise.
* romp/romp.c (unsigned_comparisons_p, hash_rtx): Likewise.
* sh/sh.c (regs_used, mark_use): Likewise.
* vax/vax.c (vax_rtx_cost): Likewise.
From-SVN: r28784
1999-08-21 01:05:25 +02:00
|
|
|
|
register const char *format_ptr;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
int copied = 0;
|
|
|
|
|
|
|
|
|
|
if (x == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
code = GET_CODE (x);
|
|
|
|
|
|
|
|
|
|
/* These types may be freely shared. */
|
|
|
|
|
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case REG:
|
|
|
|
|
case QUEUED:
|
|
|
|
|
case CONST_INT:
|
|
|
|
|
case CONST_DOUBLE:
|
|
|
|
|
case SYMBOL_REF:
|
|
|
|
|
case CODE_LABEL:
|
|
|
|
|
case PC:
|
|
|
|
|
case CC0:
|
|
|
|
|
case SCRATCH:
|
1996-07-04 00:07:53 +02:00
|
|
|
|
/* SCRATCH must be shared because they represent distinct values. */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
return x;
|
|
|
|
|
|
1992-12-27 12:52:59 +01:00
|
|
|
|
case CONST:
|
|
|
|
|
/* CONST can be shared if it contains a SYMBOL_REF. If it contains
|
|
|
|
|
a LABEL_REF, it isn't sharable. */
|
|
|
|
|
if (GET_CODE (XEXP (x, 0)) == PLUS
|
|
|
|
|
&& GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
|
|
|
|
|
&& GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT)
|
|
|
|
|
return x;
|
|
|
|
|
break;
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
case INSN:
|
|
|
|
|
case JUMP_INSN:
|
|
|
|
|
case CALL_INSN:
|
|
|
|
|
case NOTE:
|
|
|
|
|
case BARRIER:
|
|
|
|
|
/* The chain of insns is not being copied. */
|
|
|
|
|
return x;
|
|
|
|
|
|
|
|
|
|
case MEM:
|
1999-08-31 08:28:16 +02:00
|
|
|
|
/* A MEM is allowed to be shared if its address is constant.
|
|
|
|
|
|
|
|
|
|
We used to allow sharing of MEMs which referenced
|
|
|
|
|
virtual_stack_vars_rtx or virtual_incoming_args_rtx, but
|
|
|
|
|
that can lose. instantiate_virtual_regs will not unshare
|
|
|
|
|
the MEMs, and combine may change the structure of the address
|
|
|
|
|
because it looks safe and profitable in one context, but
|
|
|
|
|
in some other context it creates unrecognizable RTL. */
|
|
|
|
|
if (CONSTANT_ADDRESS_P (XEXP (x, 0)))
|
1992-03-14 06:04:21 +01:00
|
|
|
|
return x;
|
|
|
|
|
|
1997-11-02 22:19:36 +01:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* This rtx may not be shared. If it has already been seen,
|
|
|
|
|
replace it with a copy of itself. */
|
|
|
|
|
|
|
|
|
|
if (x->used)
|
|
|
|
|
{
|
|
|
|
|
register rtx copy;
|
|
|
|
|
|
|
|
|
|
copy = rtx_alloc (code);
|
1994-06-15 00:19:28 +02:00
|
|
|
|
bcopy ((char *) x, (char *) copy,
|
|
|
|
|
(sizeof (*copy) - sizeof (copy->fld)
|
|
|
|
|
+ sizeof (copy->fld[0]) * GET_RTX_LENGTH (code)));
|
1992-03-14 06:04:21 +01:00
|
|
|
|
x = copy;
|
|
|
|
|
copied = 1;
|
|
|
|
|
}
|
|
|
|
|
x->used = 1;
|
|
|
|
|
|
|
|
|
|
/* Now scan the subexpressions recursively.
|
|
|
|
|
We can store any replaced subexpressions directly into X
|
|
|
|
|
since we know X is not shared! Any vectors in X
|
|
|
|
|
must be copied if X was copied. */
|
|
|
|
|
|
|
|
|
|
format_ptr = GET_RTX_FORMAT (code);
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < GET_RTX_LENGTH (code); i++)
|
|
|
|
|
{
|
|
|
|
|
switch (*format_ptr++)
|
|
|
|
|
{
|
|
|
|
|
case 'e':
|
|
|
|
|
XEXP (x, i) = copy_rtx_if_shared (XEXP (x, i));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'E':
|
|
|
|
|
if (XVEC (x, i) != NULL)
|
|
|
|
|
{
|
|
|
|
|
register int j;
|
1993-06-28 02:41:41 +02:00
|
|
|
|
int len = XVECLEN (x, i);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
1993-06-28 02:41:41 +02:00
|
|
|
|
if (copied && len > 0)
|
rtl.def (NOTE): Change format to "iuu0n".
1999-08-19 14:44 -0700 Zack Weinberg <zack@bitmover.com>
* rtl.def (NOTE): Change format to "iuu0n".
(ADDR_DIFF_VEC): Change format to "eEee0".
(ADDRESSOF): Change format to "eit".
* rtl.h (rtvec): Make "elem" an array of rtx, not rtunion.
(RTVEC_ELT): Change to match.
(XVECEXP): Use XVEC and RTVEC_ELT.
(INSN_UID, INSN_CODE, CODE_LABEL_NUMBER, NOTE_LINE_NUMBER,
ADDRESSOF_REGNO, REGNO, SUBREG_WORD): Use XINT.
(PREV_INSN, NEXT_INSN, PATTERN, REG_NOTES,
CALL_INSN_FUNCTION_USAGE, SUBREG_REG, SET_SRC, SET_DEST,
TRAP_CONDITION, TRAP_CODE): Use XEXP.
(INTVAL): Use XWINT.
(ADDRESSOF_DECL): Use XTREE.
(SET_ADDRESSOF_DECL): Delete.
(NOTE_DECL_NAME, NOTE_DECL_CODE, NOTE_DECL_RTL,
NOTE_DECL_IDENTIFIER, NOTE_DECL_TYPE): Kill. These have been
ifdefed out since 2.6 at least.
(gen_rtvec_vv): Delete prototype.
* rtl.h (rtvec_alloc): rt->elem is now an array of rtx,
not rtunion.
(copy_most_rtx): Handle 't' format letter.
* emit-rtl.c (gen_rtvec_v): rt_val->elem is an array of rtx.
(gen_rtvec_vv): Delete function. All callers changed to use
gen_rtvec_v instead.
* print-rtl.c (print_rtx): Move special casing of NOTEs to
the '0' format letter.
* function.c (gen_mem_addressof): Don't use
SET_ADDRESSOF_DECL; provide `decl' to gen_rtx_ADDRESSOF
instead.
* integrate.c (copy_rtx_and_substitute): Likewise.
Copy 't' slots with XTREE.
(subst_constants): Treat 't' slots like '[swi]' slots.
* cse.c (canon_hash, exp_equiv_p): Treat 't' slots like '0' slots.
* jump.c (rtx_equal_for_thread_p): Likewise.
* rtlanal.c (rtx_equal_p): Likewise.
* stmt.c (expand_end_case): gen_rtx_ADDR_DIFF_VEC now takes
only four arguments.
* gengenrtl.c (type_from_format): Provide correct types for
'b' and 't' slots.
* tree.h [ENABLE_CHECKING] (TREE_CHECK, TREE_CLASS_CHECK):
If a recent gcc is in use (always in stage2 and beyond), use
statement expressions, so we don't make a function call unless
the check fails. Evaluate arguments exactly once.
(CHAIN_CHECK, DO_CHECK, DO_CHECK1, TREE_CHECK1,
TREE_CLASS_CHECK1, TYPE_CHECK1, DECL_CHECK1, CST_CHECK1):
Delete.
(CST_OR_CONSTRUCTOR_CHECK, EXPR_CHECK): Redefine such that
they evaluate their arguments exactly once, irrespective of
the compiler in use.
* tree.c [ENABLE_CHECKING]: Define whichever set of functions
is used by the currently-enabled check macros. This is:
(tree_check_failed, tree_class_check_failed): For gcc.
(tree_check, tree_class_check, cst_or_constructor_check,
expr_check): For other compilers.
* gencheck.c: Do not define any *_CHECK1 macros.
From-SVN: r28769
1999-08-20 00:33:38 +02:00
|
|
|
|
XVEC (x, i) = gen_rtvec_v (len, XVEC (x, i)->elem);
|
1993-06-28 02:41:41 +02:00
|
|
|
|
for (j = 0; j < len; j++)
|
|
|
|
|
XVECEXP (x, i, j) = copy_rtx_if_shared (XVECEXP (x, i, j));
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return x;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Clear all the USED bits in X to allow copy_rtx_if_shared to be used
|
|
|
|
|
to look for shared sub-parts. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
reset_used_flags (x)
|
|
|
|
|
rtx x;
|
|
|
|
|
{
|
|
|
|
|
register int i, j;
|
|
|
|
|
register enum rtx_code code;
|
rtl.h (rtx_format): Constify a char*.
* rtl.h (rtx_format): Constify a char*.
* rtl.c (rtx_format): Likewise.
(copy_rtx, copy_most_rtx, read_rtx): Likewise.
(init_rtl): Use accessor macro, not `rtx_format'.
* alias.c (rtx_equal_for_memref_p, find_symbolic_term): Constify a
char*.
* caller-save.c (mark_referenced_regs): Likewise.
* combine.c (subst, make_compound_operation, known_cond,
gen_rtx_combine, update_table_tick, get_last_value_validate,
use_crosses_set_p, mark_used_regs_combine, move_deaths): Likewise.
* cse.c (rtx_cost, mention_regs, canon_hash, exp_equiv_p,
refers_to_p, canon_reg, fold_rtx, cse_process_notes,
count_reg_usage): Likewise.
* emit-rtl.c (gen_rtx, copy_rtx_if_shared, reset_used_flags):
Likewise.
* final.c (leaf_renumber_regs_insn): Likewise.
* flow.c (mark_used_regs, find_use_as_address, dump_flow_info,
dump_edge_info, count_reg_references): Likewise.
* function.c (fixup_var_refs_1, walk_fixup_memory_subreg,
fixup_stack_1, purge_addressof_1, instantiate_virtual_regs_1):
Likewise.
* gcse.c (oprs_unchanged_p, hash_expr_1, expr_equiv_p,
oprs_not_set_p, expr_killed_p, compute_transp, find_used_regs,
add_label_notes): Likewise.
* genattrtab.c (attr_rtx, attr_copy_rtx, encode_units_mask,
clear_struct_flag, count_sub_rtxs, count_alternatives,
compares_alternatives_p, contained_in_p, walk_attr_value,
write_expr_attr_cache): Likewise.
* genconfig.c (walk_insn_part): Likewise.
* genemit.c (max_operand_1, gen_exp): Likewise.
* genextract.c (walk_rtx): Likewise.
* genflags.c (num_operands): Likewise.
* genoutput.c (scan_operands): Likewise.
* genpeep.c (match_rtx): Likewise.
* genrecog.c (add_to_sequence): Likewise.
* haifa-sched.c (may_trap_exp, sched_analyze_2, attach_deaths):
Likewise.
* integrate.c (save_constants, copy_for_inline,
copy_rtx_and_substitute, subst_constants, restore_constants):
Likewise.
* jump.c (mark_jump_label, invert_exp, redirect_exp,
rtx_renumbered_equal_p, rtx_equal_for_thread_p): Likewise.
* local-alloc.c (contains_replace_regs, memref_referenced_p):
Likewise.
* loop.c (record_excess_regs, rtx_equal_for_loop_p,
add_label_notes, replace_call_address, count_nonfixed_reads,
invariant_p, find_single_use_in_loop, find_mem_givs,
find_life_end, maybe_eliminate_biv_1, update_reg_last_use):
Likewise.
* print-rtl.c (reg_names, print_rtx): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1): Likewise.
* reg-stack.c (stack_regs_mentioned_p, record_label_references,
record_reg_life_pat, swap_rtx_condition, goto_block_pat,
print_blocks): Likewise.
* regclass.c (fix_register, record_address_regs,
reg_scan_mark_refs): Likewise.
* regmove.c (stable_but_for_p): Likewise.
* reload.c (loc_mentioned_in_p, operands_match_p,
find_reloads_toplevsubst_reg_equivs, find_reloads_address_1,
copy_replacements, refers_to_regno_for_reload_p,
refers_to_mem_for_reload_p, find_inc_amount, regno_clobbered_p,
reload_when_needed_name, reg_class_names, debug_reload_to_stream):
Likewise.
* reload1.c (eliminate_regs, scan_paradoxical_subregs,
delete_address_reloads_1, count_occurrences,
reload_cse_mem_conflict_p, reload_combine_note_use,
add_auto_inc_notes): Likewise.
* resource.c (mark_referenced_resources, mark_set_resources):
Likewise.
* rtlanal.c (rtx_unstable_p, rtx_varies_p, rtx_addr_varies_p,
reg_mentioned_p, regs_set_between_p, modified_between_p,
modified_in_p, refers_to_regno_p, reg_overlap_mentioned_p,
rtx_equal_p, volatile_insn_p, volatile_refs_p, side_effects_p,
may_trap_p, inequality_comparisons_p, replace_rtx, replace_regs,
jmp_uses_reg_or_mem, for_each_rtx, regno_use_in): Likewise.
* sched.c (sched_analyze_2, attach_deaths): Likewise.
* stupid.c (stupid_mark_refs): Likewise.
* unroll.c (remap_split_bivs): Likewise.
* varasm.c (mark_constants): Likewise.
* a29k/a29k.c (uses_local_reg_p): Likewise.
* alpha/alpha.c (summarize_insn): Likewise.
* arm/arm.c (symbol_mentioned_p, label_mentioned_p,
eliminate_lr2ip): Likewise.
* arm/thumb.c (symbol_mentioned_p, label_mentioned_p): Likewise.
* i386/i386.c (symbolic_reference_mentioned_p, copy_all_rtx,
reg_mentioned_in_mem): Likewise.
* ns32k/ns32k.c (global_symbolic_reference_mentioned_p,
symbolic_reference_mentioned_p): Likewise.
* romp/romp.c (unsigned_comparisons_p, hash_rtx): Likewise.
* sh/sh.c (regs_used, mark_use): Likewise.
* vax/vax.c (vax_rtx_cost): Likewise.
From-SVN: r28784
1999-08-21 01:05:25 +02:00
|
|
|
|
register const char *format_ptr;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
if (x == 0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
code = GET_CODE (x);
|
|
|
|
|
|
1995-05-16 14:39:54 +02:00
|
|
|
|
/* These types may be freely shared so we needn't do any resetting
|
1992-03-14 06:04:21 +01:00
|
|
|
|
for them. */
|
|
|
|
|
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case REG:
|
|
|
|
|
case QUEUED:
|
|
|
|
|
case CONST_INT:
|
|
|
|
|
case CONST_DOUBLE:
|
|
|
|
|
case SYMBOL_REF:
|
|
|
|
|
case CODE_LABEL:
|
|
|
|
|
case PC:
|
|
|
|
|
case CC0:
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case INSN:
|
|
|
|
|
case JUMP_INSN:
|
|
|
|
|
case CALL_INSN:
|
|
|
|
|
case NOTE:
|
|
|
|
|
case LABEL_REF:
|
|
|
|
|
case BARRIER:
|
|
|
|
|
/* The chain of insns is not being copied. */
|
|
|
|
|
return;
|
1997-11-02 22:19:36 +01:00
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
x->used = 0;
|
|
|
|
|
|
|
|
|
|
format_ptr = GET_RTX_FORMAT (code);
|
|
|
|
|
for (i = 0; i < GET_RTX_LENGTH (code); i++)
|
|
|
|
|
{
|
|
|
|
|
switch (*format_ptr++)
|
|
|
|
|
{
|
|
|
|
|
case 'e':
|
|
|
|
|
reset_used_flags (XEXP (x, i));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'E':
|
|
|
|
|
for (j = 0; j < XVECLEN (x, i); j++)
|
|
|
|
|
reset_used_flags (XVECEXP (x, i, j));
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Copy X if necessary so that it won't be altered by changes in OTHER.
|
|
|
|
|
Return X or the rtx for the pseudo reg the value of X was copied into.
|
|
|
|
|
OTHER must be valid as a SET_DEST. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
make_safe_from (x, other)
|
|
|
|
|
rtx x, other;
|
|
|
|
|
{
|
|
|
|
|
while (1)
|
|
|
|
|
switch (GET_CODE (other))
|
|
|
|
|
{
|
|
|
|
|
case SUBREG:
|
|
|
|
|
other = SUBREG_REG (other);
|
|
|
|
|
break;
|
|
|
|
|
case STRICT_LOW_PART:
|
|
|
|
|
case SIGN_EXTEND:
|
|
|
|
|
case ZERO_EXTEND:
|
|
|
|
|
other = XEXP (other, 0);
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
goto done;
|
|
|
|
|
}
|
|
|
|
|
done:
|
|
|
|
|
if ((GET_CODE (other) == MEM
|
|
|
|
|
&& ! CONSTANT_P (x)
|
|
|
|
|
&& GET_CODE (x) != REG
|
|
|
|
|
&& GET_CODE (x) != SUBREG)
|
|
|
|
|
|| (GET_CODE (other) == REG
|
|
|
|
|
&& (REGNO (other) < FIRST_PSEUDO_REGISTER
|
|
|
|
|
|| reg_mentioned_p (other, x))))
|
|
|
|
|
{
|
|
|
|
|
rtx temp = gen_reg_rtx (GET_MODE (x));
|
|
|
|
|
emit_move_insn (temp, x);
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
return x;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Emission of insns (adding them to the doubly-linked list). */
|
|
|
|
|
|
|
|
|
|
/* Return the first insn of the current sequence or current function. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
get_insns ()
|
|
|
|
|
{
|
|
|
|
|
return first_insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return the last insn emitted in current sequence or current function. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
get_last_insn ()
|
|
|
|
|
{
|
|
|
|
|
return last_insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Specify a new insn as the last in the chain. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
set_last_insn (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
if (NEXT_INSN (insn) != 0)
|
|
|
|
|
abort ();
|
|
|
|
|
last_insn = insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return the last insn emitted, even if it is in a sequence now pushed. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
get_last_insn_anywhere ()
|
|
|
|
|
{
|
|
|
|
|
struct sequence_stack *stack;
|
|
|
|
|
if (last_insn)
|
|
|
|
|
return last_insn;
|
1999-08-09 16:00:21 +02:00
|
|
|
|
for (stack = seq_stack; stack; stack = stack->next)
|
1992-03-14 06:04:21 +01:00
|
|
|
|
if (stack->last != 0)
|
|
|
|
|
return stack->last;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return a number larger than any instruction's uid in this function. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
get_max_uid ()
|
|
|
|
|
{
|
|
|
|
|
return cur_insn_uid;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return the next insn. If it is a SEQUENCE, return the first insn
|
|
|
|
|
of the sequence. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
next_insn (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
if (insn)
|
|
|
|
|
{
|
|
|
|
|
insn = NEXT_INSN (insn);
|
|
|
|
|
if (insn && GET_CODE (insn) == INSN
|
|
|
|
|
&& GET_CODE (PATTERN (insn)) == SEQUENCE)
|
|
|
|
|
insn = XVECEXP (PATTERN (insn), 0, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return the previous insn. If it is a SEQUENCE, return the last insn
|
|
|
|
|
of the sequence. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
previous_insn (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
if (insn)
|
|
|
|
|
{
|
|
|
|
|
insn = PREV_INSN (insn);
|
|
|
|
|
if (insn && GET_CODE (insn) == INSN
|
|
|
|
|
&& GET_CODE (PATTERN (insn)) == SEQUENCE)
|
|
|
|
|
insn = XVECEXP (PATTERN (insn), 0, XVECLEN (PATTERN (insn), 0) - 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return the next insn after INSN that is not a NOTE. This routine does not
|
|
|
|
|
look inside SEQUENCEs. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
next_nonnote_insn (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
while (insn)
|
|
|
|
|
{
|
|
|
|
|
insn = NEXT_INSN (insn);
|
|
|
|
|
if (insn == 0 || GET_CODE (insn) != NOTE)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return the previous insn before INSN that is not a NOTE. This routine does
|
|
|
|
|
not look inside SEQUENCEs. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
prev_nonnote_insn (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
while (insn)
|
|
|
|
|
{
|
|
|
|
|
insn = PREV_INSN (insn);
|
|
|
|
|
if (insn == 0 || GET_CODE (insn) != NOTE)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return the next INSN, CALL_INSN or JUMP_INSN after INSN;
|
|
|
|
|
or 0, if there is none. This routine does not look inside
|
1996-07-04 00:07:53 +02:00
|
|
|
|
SEQUENCEs. */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
next_real_insn (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
while (insn)
|
|
|
|
|
{
|
|
|
|
|
insn = NEXT_INSN (insn);
|
|
|
|
|
if (insn == 0 || GET_CODE (insn) == INSN
|
|
|
|
|
|| GET_CODE (insn) == CALL_INSN || GET_CODE (insn) == JUMP_INSN)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return the last INSN, CALL_INSN or JUMP_INSN before INSN;
|
|
|
|
|
or 0, if there is none. This routine does not look inside
|
|
|
|
|
SEQUENCEs. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
prev_real_insn (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
while (insn)
|
|
|
|
|
{
|
|
|
|
|
insn = PREV_INSN (insn);
|
|
|
|
|
if (insn == 0 || GET_CODE (insn) == INSN || GET_CODE (insn) == CALL_INSN
|
|
|
|
|
|| GET_CODE (insn) == JUMP_INSN)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Find the next insn after INSN that really does something. This routine
|
|
|
|
|
does not look inside SEQUENCEs. Until reload has completed, this is the
|
|
|
|
|
same as next_real_insn. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
next_active_insn (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
while (insn)
|
|
|
|
|
{
|
|
|
|
|
insn = NEXT_INSN (insn);
|
|
|
|
|
if (insn == 0
|
|
|
|
|
|| GET_CODE (insn) == CALL_INSN || GET_CODE (insn) == JUMP_INSN
|
|
|
|
|
|| (GET_CODE (insn) == INSN
|
|
|
|
|
&& (! reload_completed
|
|
|
|
|
|| (GET_CODE (PATTERN (insn)) != USE
|
|
|
|
|
&& GET_CODE (PATTERN (insn)) != CLOBBER))))
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Find the last insn before INSN that really does something. This routine
|
|
|
|
|
does not look inside SEQUENCEs. Until reload has completed, this is the
|
|
|
|
|
same as prev_real_insn. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
prev_active_insn (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
while (insn)
|
|
|
|
|
{
|
|
|
|
|
insn = PREV_INSN (insn);
|
|
|
|
|
if (insn == 0
|
|
|
|
|
|| GET_CODE (insn) == CALL_INSN || GET_CODE (insn) == JUMP_INSN
|
|
|
|
|
|| (GET_CODE (insn) == INSN
|
|
|
|
|
&& (! reload_completed
|
|
|
|
|
|| (GET_CODE (PATTERN (insn)) != USE
|
|
|
|
|
&& GET_CODE (PATTERN (insn)) != CLOBBER))))
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return the next CODE_LABEL after the insn INSN, or 0 if there is none. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
next_label (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
while (insn)
|
|
|
|
|
{
|
|
|
|
|
insn = NEXT_INSN (insn);
|
|
|
|
|
if (insn == 0 || GET_CODE (insn) == CODE_LABEL)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return the last CODE_LABEL before the insn INSN, or 0 if there is none. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
prev_label (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
while (insn)
|
|
|
|
|
{
|
|
|
|
|
insn = PREV_INSN (insn);
|
|
|
|
|
if (insn == 0 || GET_CODE (insn) == CODE_LABEL)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_cc0
|
1992-04-21 07:40:51 +02:00
|
|
|
|
/* INSN uses CC0 and is being moved into a delay slot. Set up REG_CC_SETTER
|
|
|
|
|
and REG_CC_USER notes so we can find it. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
link_cc0_insns (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
rtx user = next_nonnote_insn (insn);
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (user) == INSN && GET_CODE (PATTERN (user)) == SEQUENCE)
|
|
|
|
|
user = XVECEXP (PATTERN (user), 0, 0);
|
|
|
|
|
|
1999-09-07 07:49:18 +02:00
|
|
|
|
REG_NOTES (user) = gen_rtx_INSN_LIST (REG_CC_SETTER, insn,
|
|
|
|
|
REG_NOTES (user));
|
1998-01-08 22:17:05 +01:00
|
|
|
|
REG_NOTES (insn) = gen_rtx_INSN_LIST (REG_CC_USER, user, REG_NOTES (insn));
|
1992-04-21 07:40:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* Return the next insn that uses CC0 after INSN, which is assumed to
|
|
|
|
|
set it. This is the inverse of prev_cc0_setter (i.e., prev_cc0_setter
|
|
|
|
|
applied to the result of this function should yield INSN).
|
|
|
|
|
|
|
|
|
|
Normally, this is simply the next insn. However, if a REG_CC_USER note
|
|
|
|
|
is present, it contains the insn that uses CC0.
|
|
|
|
|
|
|
|
|
|
Return 0 if we can't find the insn. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
next_cc0_user (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
1992-07-06 22:04:13 +02:00
|
|
|
|
rtx note = find_reg_note (insn, REG_CC_USER, NULL_RTX);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
if (note)
|
|
|
|
|
return XEXP (note, 0);
|
|
|
|
|
|
|
|
|
|
insn = next_nonnote_insn (insn);
|
|
|
|
|
if (insn && GET_CODE (insn) == INSN && GET_CODE (PATTERN (insn)) == SEQUENCE)
|
|
|
|
|
insn = XVECEXP (PATTERN (insn), 0, 0);
|
|
|
|
|
|
|
|
|
|
if (insn && GET_RTX_CLASS (GET_CODE (insn)) == 'i'
|
|
|
|
|
&& reg_mentioned_p (cc0_rtx, PATTERN (insn)))
|
|
|
|
|
return insn;
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Find the insn that set CC0 for INSN. Unless INSN has a REG_CC_SETTER
|
|
|
|
|
note, it is the previous insn. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
prev_cc0_setter (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
1992-07-06 22:04:13 +02:00
|
|
|
|
rtx note = find_reg_note (insn, REG_CC_SETTER, NULL_RTX);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
if (note)
|
|
|
|
|
return XEXP (note, 0);
|
|
|
|
|
|
|
|
|
|
insn = prev_nonnote_insn (insn);
|
|
|
|
|
if (! sets_cc0_p (PATTERN (insn)))
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Try splitting insns that can be split for better scheduling.
|
|
|
|
|
PAT is the pattern which might split.
|
|
|
|
|
TRIAL is the insn providing PAT.
|
1994-03-20 12:50:18 +01:00
|
|
|
|
LAST is non-zero if we should return the last insn of the sequence produced.
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
If this routine succeeds in splitting, it returns the first or last
|
1994-03-20 12:50:18 +01:00
|
|
|
|
replacement insn depending on the value of LAST. Otherwise, it
|
1992-03-14 06:04:21 +01:00
|
|
|
|
returns TRIAL. If the insn to be returned can be split, it will be. */
|
|
|
|
|
|
|
|
|
|
rtx
|
1994-03-20 12:50:18 +01:00
|
|
|
|
try_split (pat, trial, last)
|
1992-03-14 06:04:21 +01:00
|
|
|
|
rtx pat, trial;
|
1994-03-20 12:50:18 +01:00
|
|
|
|
int last;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
{
|
|
|
|
|
rtx before = PREV_INSN (trial);
|
|
|
|
|
rtx after = NEXT_INSN (trial);
|
|
|
|
|
rtx seq = split_insns (pat, trial);
|
|
|
|
|
int has_barrier = 0;
|
|
|
|
|
rtx tem;
|
|
|
|
|
|
|
|
|
|
/* If we are splitting a JUMP_INSN, it might be followed by a BARRIER.
|
|
|
|
|
We may need to handle this specially. */
|
|
|
|
|
if (after && GET_CODE (after) == BARRIER)
|
|
|
|
|
{
|
|
|
|
|
has_barrier = 1;
|
|
|
|
|
after = NEXT_INSN (after);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (seq)
|
|
|
|
|
{
|
|
|
|
|
/* SEQ can either be a SEQUENCE or the pattern of a single insn.
|
|
|
|
|
The latter case will normally arise only when being done so that
|
|
|
|
|
it, in turn, will be split (SFmode on the 29k is an example). */
|
|
|
|
|
if (GET_CODE (seq) == SEQUENCE)
|
|
|
|
|
{
|
|
|
|
|
/* If we are splitting a JUMP_INSN, look for the JUMP_INSN in
|
|
|
|
|
SEQ and copy our JUMP_LABEL to it. If JUMP_LABEL is non-zero,
|
|
|
|
|
increment the usage count so we don't delete the label. */
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (trial) == JUMP_INSN)
|
|
|
|
|
for (i = XVECLEN (seq, 0) - 1; i >= 0; i--)
|
|
|
|
|
if (GET_CODE (XVECEXP (seq, 0, i)) == JUMP_INSN)
|
|
|
|
|
{
|
|
|
|
|
JUMP_LABEL (XVECEXP (seq, 0, i)) = JUMP_LABEL (trial);
|
|
|
|
|
|
|
|
|
|
if (JUMP_LABEL (trial))
|
|
|
|
|
LABEL_NUSES (JUMP_LABEL (trial))++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tem = emit_insn_after (seq, before);
|
|
|
|
|
|
|
|
|
|
delete_insn (trial);
|
|
|
|
|
if (has_barrier)
|
|
|
|
|
emit_barrier_after (tem);
|
1994-03-20 12:50:18 +01:00
|
|
|
|
|
|
|
|
|
/* Recursively call try_split for each new insn created; by the
|
|
|
|
|
time control returns here that insn will be fully split, so
|
|
|
|
|
set LAST and continue from the insn after the one returned.
|
1994-04-24 17:24:57 +02:00
|
|
|
|
We can't use next_active_insn here since AFTER may be a note.
|
1999-01-21 22:54:47 +01:00
|
|
|
|
Ignore deleted insns, which can be occur if not optimizing. */
|
1994-03-20 12:50:18 +01:00
|
|
|
|
for (tem = NEXT_INSN (before); tem != after;
|
|
|
|
|
tem = NEXT_INSN (tem))
|
1999-01-21 22:54:47 +01:00
|
|
|
|
if (! INSN_DELETED_P (tem)
|
|
|
|
|
&& GET_RTX_CLASS (GET_CODE (tem)) == 'i')
|
1994-04-24 17:24:57 +02:00
|
|
|
|
tem = try_split (PATTERN (tem), tem, 1);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
/* Avoid infinite loop if the result matches the original pattern. */
|
|
|
|
|
else if (rtx_equal_p (seq, pat))
|
|
|
|
|
return trial;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
PATTERN (trial) = seq;
|
|
|
|
|
INSN_CODE (trial) = -1;
|
1994-03-20 12:50:18 +01:00
|
|
|
|
try_split (seq, trial, last);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
1994-03-20 12:50:18 +01:00
|
|
|
|
/* Return either the first or the last insn, depending on which was
|
|
|
|
|
requested. */
|
|
|
|
|
return last ? prev_active_insn (after) : next_active_insn (before);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return trial;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make and return an INSN rtx, initializing all its slots.
|
1992-07-29 05:44:08 +02:00
|
|
|
|
Store PATTERN in the pattern slots. */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
rtx
|
1992-07-29 05:44:08 +02:00
|
|
|
|
make_insn_raw (pattern)
|
1992-03-14 06:04:21 +01:00
|
|
|
|
rtx pattern;
|
|
|
|
|
{
|
|
|
|
|
register rtx insn;
|
|
|
|
|
|
1996-03-10 12:23:17 +01:00
|
|
|
|
/* If in RTL generation phase, see if FREE_INSN can be used. */
|
1999-09-05 18:08:20 +02:00
|
|
|
|
if (!ggc_p && free_insn != 0 && rtx_equal_function_value_matters)
|
1996-03-10 12:23:17 +01:00
|
|
|
|
{
|
|
|
|
|
insn = free_insn;
|
|
|
|
|
free_insn = NEXT_INSN (free_insn);
|
|
|
|
|
PUT_CODE (insn, INSN);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
insn = rtx_alloc (INSN);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
1996-03-10 12:23:17 +01:00
|
|
|
|
INSN_UID (insn) = cur_insn_uid++;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
PATTERN (insn) = pattern;
|
|
|
|
|
INSN_CODE (insn) = -1;
|
1993-03-31 07:48:38 +02:00
|
|
|
|
LOG_LINKS (insn) = NULL;
|
|
|
|
|
REG_NOTES (insn) = NULL;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Like `make_insn' but make a JUMP_INSN instead of an insn. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
1992-07-29 05:44:08 +02:00
|
|
|
|
make_jump_insn_raw (pattern)
|
1992-03-14 06:04:21 +01:00
|
|
|
|
rtx pattern;
|
|
|
|
|
{
|
|
|
|
|
register rtx insn;
|
|
|
|
|
|
1992-07-29 05:44:08 +02:00
|
|
|
|
insn = rtx_alloc (JUMP_INSN);
|
1993-03-31 07:48:38 +02:00
|
|
|
|
INSN_UID (insn) = cur_insn_uid++;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
PATTERN (insn) = pattern;
|
|
|
|
|
INSN_CODE (insn) = -1;
|
1993-03-31 07:48:38 +02:00
|
|
|
|
LOG_LINKS (insn) = NULL;
|
|
|
|
|
REG_NOTES (insn) = NULL;
|
|
|
|
|
JUMP_LABEL (insn) = NULL;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
1994-05-06 23:45:57 +02:00
|
|
|
|
|
|
|
|
|
/* Like `make_insn' but make a CALL_INSN instead of an insn. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
|
|
|
|
make_call_insn_raw (pattern)
|
|
|
|
|
rtx pattern;
|
|
|
|
|
{
|
|
|
|
|
register rtx insn;
|
|
|
|
|
|
|
|
|
|
insn = rtx_alloc (CALL_INSN);
|
|
|
|
|
INSN_UID (insn) = cur_insn_uid++;
|
|
|
|
|
|
|
|
|
|
PATTERN (insn) = pattern;
|
|
|
|
|
INSN_CODE (insn) = -1;
|
|
|
|
|
LOG_LINKS (insn) = NULL;
|
|
|
|
|
REG_NOTES (insn) = NULL;
|
|
|
|
|
CALL_INSN_FUNCTION_USAGE (insn) = NULL;
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
/* Add INSN to the end of the doubly-linked list.
|
|
|
|
|
INSN may be an INSN, JUMP_INSN, CALL_INSN, CODE_LABEL, BARRIER or NOTE. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
add_insn (insn)
|
|
|
|
|
register rtx insn;
|
|
|
|
|
{
|
|
|
|
|
PREV_INSN (insn) = last_insn;
|
|
|
|
|
NEXT_INSN (insn) = 0;
|
|
|
|
|
|
|
|
|
|
if (NULL != last_insn)
|
|
|
|
|
NEXT_INSN (last_insn) = insn;
|
|
|
|
|
|
|
|
|
|
if (NULL == first_insn)
|
|
|
|
|
first_insn = insn;
|
|
|
|
|
|
|
|
|
|
last_insn = insn;
|
|
|
|
|
}
|
|
|
|
|
|
1994-09-30 23:26:03 +01:00
|
|
|
|
/* Add INSN into the doubly-linked list after insn AFTER. This and
|
|
|
|
|
the next should be the only functions called to insert an insn once
|
1994-10-02 01:34:45 +01:00
|
|
|
|
delay slots have been filled since only they know how to update a
|
1994-09-30 23:26:03 +01:00
|
|
|
|
SEQUENCE. */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
add_insn_after (insn, after)
|
|
|
|
|
rtx insn, after;
|
|
|
|
|
{
|
|
|
|
|
rtx next = NEXT_INSN (after);
|
|
|
|
|
|
1994-10-16 10:01:26 +01:00
|
|
|
|
if (optimize && INSN_DELETED_P (after))
|
1994-10-02 01:34:45 +01:00
|
|
|
|
abort ();
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
NEXT_INSN (insn) = next;
|
|
|
|
|
PREV_INSN (insn) = after;
|
|
|
|
|
|
|
|
|
|
if (next)
|
|
|
|
|
{
|
|
|
|
|
PREV_INSN (next) = insn;
|
|
|
|
|
if (GET_CODE (next) == INSN && GET_CODE (PATTERN (next)) == SEQUENCE)
|
|
|
|
|
PREV_INSN (XVECEXP (PATTERN (next), 0, 0)) = insn;
|
|
|
|
|
}
|
|
|
|
|
else if (last_insn == after)
|
|
|
|
|
last_insn = insn;
|
|
|
|
|
else
|
|
|
|
|
{
|
1999-08-09 16:00:21 +02:00
|
|
|
|
struct sequence_stack *stack = seq_stack;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* Scan all pending sequences too. */
|
|
|
|
|
for (; stack; stack = stack->next)
|
|
|
|
|
if (after == stack->last)
|
1994-10-07 13:24:36 +01:00
|
|
|
|
{
|
|
|
|
|
stack->last = insn;
|
|
|
|
|
break;
|
|
|
|
|
}
|
1994-09-30 23:26:03 +01:00
|
|
|
|
|
|
|
|
|
if (stack == 0)
|
|
|
|
|
abort ();
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
NEXT_INSN (after) = insn;
|
|
|
|
|
if (GET_CODE (after) == INSN && GET_CODE (PATTERN (after)) == SEQUENCE)
|
|
|
|
|
{
|
|
|
|
|
rtx sequence = PATTERN (after);
|
|
|
|
|
NEXT_INSN (XVECEXP (sequence, 0, XVECLEN (sequence, 0) - 1)) = insn;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1994-09-30 23:26:03 +01:00
|
|
|
|
/* Add INSN into the doubly-linked list before insn BEFORE. This and
|
|
|
|
|
the previous should be the only functions called to insert an insn once
|
1994-10-02 01:34:45 +01:00
|
|
|
|
delay slots have been filled since only they know how to update a
|
1994-09-30 23:26:03 +01:00
|
|
|
|
SEQUENCE. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
add_insn_before (insn, before)
|
|
|
|
|
rtx insn, before;
|
|
|
|
|
{
|
|
|
|
|
rtx prev = PREV_INSN (before);
|
|
|
|
|
|
1994-10-16 10:01:26 +01:00
|
|
|
|
if (optimize && INSN_DELETED_P (before))
|
1994-10-02 01:34:45 +01:00
|
|
|
|
abort ();
|
|
|
|
|
|
1994-09-30 23:26:03 +01:00
|
|
|
|
PREV_INSN (insn) = prev;
|
|
|
|
|
NEXT_INSN (insn) = before;
|
|
|
|
|
|
|
|
|
|
if (prev)
|
|
|
|
|
{
|
|
|
|
|
NEXT_INSN (prev) = insn;
|
|
|
|
|
if (GET_CODE (prev) == INSN && GET_CODE (PATTERN (prev)) == SEQUENCE)
|
|
|
|
|
{
|
|
|
|
|
rtx sequence = PATTERN (prev);
|
|
|
|
|
NEXT_INSN (XVECEXP (sequence, 0, XVECLEN (sequence, 0) - 1)) = insn;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (first_insn == before)
|
|
|
|
|
first_insn = insn;
|
|
|
|
|
else
|
|
|
|
|
{
|
1999-08-09 16:00:21 +02:00
|
|
|
|
struct sequence_stack *stack = seq_stack;
|
1994-09-30 23:26:03 +01:00
|
|
|
|
/* Scan all pending sequences too. */
|
|
|
|
|
for (; stack; stack = stack->next)
|
|
|
|
|
if (before == stack->first)
|
1994-10-07 13:24:36 +01:00
|
|
|
|
{
|
|
|
|
|
stack->first = insn;
|
|
|
|
|
break;
|
|
|
|
|
}
|
1994-09-30 23:26:03 +01:00
|
|
|
|
|
|
|
|
|
if (stack == 0)
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PREV_INSN (before) = insn;
|
|
|
|
|
if (GET_CODE (before) == INSN && GET_CODE (PATTERN (before)) == SEQUENCE)
|
|
|
|
|
PREV_INSN (XVECEXP (PATTERN (before), 0, 0)) = insn;
|
|
|
|
|
}
|
|
|
|
|
|
1999-01-29 16:25:17 +01:00
|
|
|
|
/* Remove an insn from its doubly-linked list. This function knows how
|
|
|
|
|
to handle sequences. */
|
|
|
|
|
void
|
|
|
|
|
remove_insn (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
rtx next = NEXT_INSN (insn);
|
|
|
|
|
rtx prev = PREV_INSN (insn);
|
|
|
|
|
if (prev)
|
|
|
|
|
{
|
|
|
|
|
NEXT_INSN (prev) = next;
|
|
|
|
|
if (GET_CODE (prev) == INSN && GET_CODE (PATTERN (prev)) == SEQUENCE)
|
|
|
|
|
{
|
|
|
|
|
rtx sequence = PATTERN (prev);
|
|
|
|
|
NEXT_INSN (XVECEXP (sequence, 0, XVECLEN (sequence, 0) - 1)) = next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (first_insn == insn)
|
|
|
|
|
first_insn = next;
|
|
|
|
|
else
|
|
|
|
|
{
|
1999-08-09 16:00:21 +02:00
|
|
|
|
struct sequence_stack *stack = seq_stack;
|
1999-01-29 16:25:17 +01:00
|
|
|
|
/* Scan all pending sequences too. */
|
|
|
|
|
for (; stack; stack = stack->next)
|
|
|
|
|
if (insn == stack->first)
|
|
|
|
|
{
|
|
|
|
|
stack->first = next;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stack == 0)
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (next)
|
|
|
|
|
{
|
|
|
|
|
PREV_INSN (next) = prev;
|
|
|
|
|
if (GET_CODE (next) == INSN && GET_CODE (PATTERN (next)) == SEQUENCE)
|
|
|
|
|
PREV_INSN (XVECEXP (PATTERN (next), 0, 0)) = prev;
|
|
|
|
|
}
|
|
|
|
|
else if (last_insn == insn)
|
|
|
|
|
last_insn = prev;
|
|
|
|
|
else
|
|
|
|
|
{
|
1999-08-09 16:00:21 +02:00
|
|
|
|
struct sequence_stack *stack = seq_stack;
|
1999-01-29 16:25:17 +01:00
|
|
|
|
/* Scan all pending sequences too. */
|
|
|
|
|
for (; stack; stack = stack->next)
|
|
|
|
|
if (insn == stack->last)
|
|
|
|
|
{
|
|
|
|
|
stack->last = prev;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (stack == 0)
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* Delete all insns made since FROM.
|
|
|
|
|
FROM becomes the new last instruction. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
delete_insns_since (from)
|
|
|
|
|
rtx from;
|
|
|
|
|
{
|
|
|
|
|
if (from == 0)
|
|
|
|
|
first_insn = 0;
|
|
|
|
|
else
|
|
|
|
|
NEXT_INSN (from) = 0;
|
|
|
|
|
last_insn = from;
|
|
|
|
|
}
|
|
|
|
|
|
1994-05-13 02:19:57 +02:00
|
|
|
|
/* This function is deprecated, please use sequences instead.
|
|
|
|
|
|
|
|
|
|
Move a consecutive bunch of insns to a different place in the chain.
|
1992-03-14 06:04:21 +01:00
|
|
|
|
The insns to be moved are those between FROM and TO.
|
|
|
|
|
They are moved to a new position after the insn AFTER.
|
|
|
|
|
AFTER must not be FROM or TO or any insn in between.
|
|
|
|
|
|
|
|
|
|
This function does not know about SEQUENCEs and hence should not be
|
|
|
|
|
called after delay-slot filling has been done. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
reorder_insns (from, to, after)
|
|
|
|
|
rtx from, to, after;
|
|
|
|
|
{
|
|
|
|
|
/* Splice this bunch out of where it is now. */
|
|
|
|
|
if (PREV_INSN (from))
|
|
|
|
|
NEXT_INSN (PREV_INSN (from)) = NEXT_INSN (to);
|
|
|
|
|
if (NEXT_INSN (to))
|
|
|
|
|
PREV_INSN (NEXT_INSN (to)) = PREV_INSN (from);
|
|
|
|
|
if (last_insn == to)
|
|
|
|
|
last_insn = PREV_INSN (from);
|
|
|
|
|
if (first_insn == from)
|
|
|
|
|
first_insn = NEXT_INSN (to);
|
|
|
|
|
|
|
|
|
|
/* Make the new neighbors point to it and it to them. */
|
|
|
|
|
if (NEXT_INSN (after))
|
|
|
|
|
PREV_INSN (NEXT_INSN (after)) = to;
|
|
|
|
|
|
|
|
|
|
NEXT_INSN (to) = NEXT_INSN (after);
|
|
|
|
|
PREV_INSN (from) = after;
|
|
|
|
|
NEXT_INSN (after) = from;
|
|
|
|
|
if (after == last_insn)
|
|
|
|
|
last_insn = to;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return the line note insn preceding INSN. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
|
|
|
|
find_line_note (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
if (no_line_numbers)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
for (; insn; insn = PREV_INSN (insn))
|
|
|
|
|
if (GET_CODE (insn) == NOTE
|
|
|
|
|
&& NOTE_LINE_NUMBER (insn) >= 0)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Like reorder_insns, but inserts line notes to preserve the line numbers
|
|
|
|
|
of the moved insns when debugging. This may insert a note between AFTER
|
|
|
|
|
and FROM, and another one after TO. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
reorder_insns_with_line_notes (from, to, after)
|
|
|
|
|
rtx from, to, after;
|
|
|
|
|
{
|
|
|
|
|
rtx from_line = find_line_note (from);
|
|
|
|
|
rtx after_line = find_line_note (after);
|
|
|
|
|
|
|
|
|
|
reorder_insns (from, to, after);
|
|
|
|
|
|
|
|
|
|
if (from_line == after_line)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
if (from_line)
|
|
|
|
|
emit_line_note_after (NOTE_SOURCE_FILE (from_line),
|
|
|
|
|
NOTE_LINE_NUMBER (from_line),
|
|
|
|
|
after);
|
|
|
|
|
if (after_line)
|
|
|
|
|
emit_line_note_after (NOTE_SOURCE_FILE (after_line),
|
|
|
|
|
NOTE_LINE_NUMBER (after_line),
|
|
|
|
|
to);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Emit an insn of given code and pattern
|
|
|
|
|
at a specified place within the doubly-linked list. */
|
|
|
|
|
|
|
|
|
|
/* Make an instruction with body PATTERN
|
|
|
|
|
and output it before the instruction BEFORE. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_insn_before (pattern, before)
|
|
|
|
|
register rtx pattern, before;
|
|
|
|
|
{
|
|
|
|
|
register rtx insn = before;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (pattern) == SEQUENCE)
|
|
|
|
|
{
|
|
|
|
|
register int i;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < XVECLEN (pattern, 0); i++)
|
|
|
|
|
{
|
|
|
|
|
insn = XVECEXP (pattern, 0, i);
|
1994-09-30 23:26:03 +01:00
|
|
|
|
add_insn_before (insn, before);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
1999-09-05 18:08:20 +02:00
|
|
|
|
if (!ggc_p && XVECLEN (pattern, 0) < SEQUENCE_RESULT_SIZE)
|
1992-03-14 06:04:21 +01:00
|
|
|
|
sequence_result[XVECLEN (pattern, 0)] = pattern;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
1992-07-29 05:44:08 +02:00
|
|
|
|
insn = make_insn_raw (pattern);
|
1994-09-30 23:26:03 +01:00
|
|
|
|
add_insn_before (insn, before);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make an instruction with body PATTERN and code JUMP_INSN
|
|
|
|
|
and output it before the instruction BEFORE. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_jump_insn_before (pattern, before)
|
|
|
|
|
register rtx pattern, before;
|
|
|
|
|
{
|
|
|
|
|
register rtx insn;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (pattern) == SEQUENCE)
|
|
|
|
|
insn = emit_insn_before (pattern, before);
|
|
|
|
|
else
|
|
|
|
|
{
|
1993-01-13 00:30:47 +01:00
|
|
|
|
insn = make_jump_insn_raw (pattern);
|
1994-09-30 23:26:03 +01:00
|
|
|
|
add_insn_before (insn, before);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make an instruction with body PATTERN and code CALL_INSN
|
|
|
|
|
and output it before the instruction BEFORE. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_call_insn_before (pattern, before)
|
|
|
|
|
register rtx pattern, before;
|
|
|
|
|
{
|
1994-05-06 23:45:57 +02:00
|
|
|
|
register rtx insn;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (pattern) == SEQUENCE)
|
|
|
|
|
insn = emit_insn_before (pattern, before);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
insn = make_call_insn_raw (pattern);
|
1994-09-30 23:26:03 +01:00
|
|
|
|
add_insn_before (insn, before);
|
1994-05-06 23:45:57 +02:00
|
|
|
|
PUT_CODE (insn, CALL_INSN);
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make an insn of code BARRIER
|
1999-02-26 00:45:42 +01:00
|
|
|
|
and output it before the insn BEFORE. */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_barrier_before (before)
|
|
|
|
|
register rtx before;
|
|
|
|
|
{
|
|
|
|
|
register rtx insn = rtx_alloc (BARRIER);
|
|
|
|
|
|
|
|
|
|
INSN_UID (insn) = cur_insn_uid++;
|
|
|
|
|
|
1994-09-30 23:26:03 +01:00
|
|
|
|
add_insn_before (insn, before);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
1999-02-26 00:45:42 +01:00
|
|
|
|
/* Emit the label LABEL before the insn BEFORE. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_label_before (label, before)
|
|
|
|
|
rtx label, before;
|
|
|
|
|
{
|
|
|
|
|
/* This can be called twice for the same label as a result of the
|
|
|
|
|
confusion that follows a syntax error! So make it harmless. */
|
|
|
|
|
if (INSN_UID (label) == 0)
|
|
|
|
|
{
|
|
|
|
|
INSN_UID (label) = cur_insn_uid++;
|
|
|
|
|
add_insn_before (label, before);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return label;
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* Emit a note of subtype SUBTYPE before the insn BEFORE. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_note_before (subtype, before)
|
|
|
|
|
int subtype;
|
|
|
|
|
rtx before;
|
|
|
|
|
{
|
|
|
|
|
register rtx note = rtx_alloc (NOTE);
|
|
|
|
|
INSN_UID (note) = cur_insn_uid++;
|
|
|
|
|
NOTE_SOURCE_FILE (note) = 0;
|
|
|
|
|
NOTE_LINE_NUMBER (note) = subtype;
|
|
|
|
|
|
1994-09-30 23:26:03 +01:00
|
|
|
|
add_insn_before (note, before);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
return note;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make an insn of code INSN with body PATTERN
|
|
|
|
|
and output it after the insn AFTER. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_insn_after (pattern, after)
|
|
|
|
|
register rtx pattern, after;
|
|
|
|
|
{
|
|
|
|
|
register rtx insn = after;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (pattern) == SEQUENCE)
|
|
|
|
|
{
|
|
|
|
|
register int i;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < XVECLEN (pattern, 0); i++)
|
|
|
|
|
{
|
|
|
|
|
insn = XVECEXP (pattern, 0, i);
|
|
|
|
|
add_insn_after (insn, after);
|
|
|
|
|
after = insn;
|
|
|
|
|
}
|
1999-09-05 18:08:20 +02:00
|
|
|
|
if (!ggc_p && XVECLEN (pattern, 0) < SEQUENCE_RESULT_SIZE)
|
1992-03-14 06:04:21 +01:00
|
|
|
|
sequence_result[XVECLEN (pattern, 0)] = pattern;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
1992-07-29 05:44:08 +02:00
|
|
|
|
insn = make_insn_raw (pattern);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
add_insn_after (insn, after);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
1992-09-20 11:52:26 +02:00
|
|
|
|
/* Similar to emit_insn_after, except that line notes are to be inserted so
|
|
|
|
|
as to act as if this insn were at FROM. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
emit_insn_after_with_line_notes (pattern, after, from)
|
|
|
|
|
rtx pattern, after, from;
|
|
|
|
|
{
|
|
|
|
|
rtx from_line = find_line_note (from);
|
|
|
|
|
rtx after_line = find_line_note (after);
|
|
|
|
|
rtx insn = emit_insn_after (pattern, after);
|
|
|
|
|
|
|
|
|
|
if (from_line)
|
|
|
|
|
emit_line_note_after (NOTE_SOURCE_FILE (from_line),
|
|
|
|
|
NOTE_LINE_NUMBER (from_line),
|
|
|
|
|
after);
|
|
|
|
|
|
|
|
|
|
if (after_line)
|
|
|
|
|
emit_line_note_after (NOTE_SOURCE_FILE (after_line),
|
|
|
|
|
NOTE_LINE_NUMBER (after_line),
|
|
|
|
|
insn);
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* Make an insn of code JUMP_INSN with body PATTERN
|
|
|
|
|
and output it after the insn AFTER. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_jump_insn_after (pattern, after)
|
|
|
|
|
register rtx pattern, after;
|
|
|
|
|
{
|
|
|
|
|
register rtx insn;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (pattern) == SEQUENCE)
|
|
|
|
|
insn = emit_insn_after (pattern, after);
|
|
|
|
|
else
|
|
|
|
|
{
|
1993-01-13 00:30:47 +01:00
|
|
|
|
insn = make_jump_insn_raw (pattern);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
add_insn_after (insn, after);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make an insn of code BARRIER
|
|
|
|
|
and output it after the insn AFTER. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_barrier_after (after)
|
|
|
|
|
register rtx after;
|
|
|
|
|
{
|
|
|
|
|
register rtx insn = rtx_alloc (BARRIER);
|
|
|
|
|
|
|
|
|
|
INSN_UID (insn) = cur_insn_uid++;
|
|
|
|
|
|
|
|
|
|
add_insn_after (insn, after);
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Emit the label LABEL after the insn AFTER. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_label_after (label, after)
|
|
|
|
|
rtx label, after;
|
|
|
|
|
{
|
|
|
|
|
/* This can be called twice for the same label
|
|
|
|
|
as a result of the confusion that follows a syntax error!
|
|
|
|
|
So make it harmless. */
|
|
|
|
|
if (INSN_UID (label) == 0)
|
|
|
|
|
{
|
|
|
|
|
INSN_UID (label) = cur_insn_uid++;
|
|
|
|
|
add_insn_after (label, after);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return label;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Emit a note of subtype SUBTYPE after the insn AFTER. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_note_after (subtype, after)
|
|
|
|
|
int subtype;
|
|
|
|
|
rtx after;
|
|
|
|
|
{
|
|
|
|
|
register rtx note = rtx_alloc (NOTE);
|
|
|
|
|
INSN_UID (note) = cur_insn_uid++;
|
|
|
|
|
NOTE_SOURCE_FILE (note) = 0;
|
|
|
|
|
NOTE_LINE_NUMBER (note) = subtype;
|
|
|
|
|
add_insn_after (note, after);
|
|
|
|
|
return note;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Emit a line note for FILE and LINE after the insn AFTER. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_line_note_after (file, line, after)
|
|
|
|
|
char *file;
|
|
|
|
|
int line;
|
|
|
|
|
rtx after;
|
|
|
|
|
{
|
|
|
|
|
register rtx note;
|
|
|
|
|
|
|
|
|
|
if (no_line_numbers && line > 0)
|
|
|
|
|
{
|
|
|
|
|
cur_insn_uid++;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
note = rtx_alloc (NOTE);
|
|
|
|
|
INSN_UID (note) = cur_insn_uid++;
|
|
|
|
|
NOTE_SOURCE_FILE (note) = file;
|
|
|
|
|
NOTE_LINE_NUMBER (note) = line;
|
|
|
|
|
add_insn_after (note, after);
|
|
|
|
|
return note;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make an insn of code INSN with pattern PATTERN
|
|
|
|
|
and add it to the end of the doubly-linked list.
|
|
|
|
|
If PATTERN is a SEQUENCE, take the elements of it
|
|
|
|
|
and emit an insn for each element.
|
|
|
|
|
|
|
|
|
|
Returns the last insn emitted. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_insn (pattern)
|
|
|
|
|
rtx pattern;
|
|
|
|
|
{
|
|
|
|
|
rtx insn = last_insn;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (pattern) == SEQUENCE)
|
|
|
|
|
{
|
|
|
|
|
register int i;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < XVECLEN (pattern, 0); i++)
|
|
|
|
|
{
|
|
|
|
|
insn = XVECEXP (pattern, 0, i);
|
|
|
|
|
add_insn (insn);
|
|
|
|
|
}
|
1999-09-05 18:08:20 +02:00
|
|
|
|
if (!ggc_p && XVECLEN (pattern, 0) < SEQUENCE_RESULT_SIZE)
|
1992-03-14 06:04:21 +01:00
|
|
|
|
sequence_result[XVECLEN (pattern, 0)] = pattern;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
1992-07-29 05:44:08 +02:00
|
|
|
|
insn = make_insn_raw (pattern);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
add_insn (insn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Emit the insns in a chain starting with INSN.
|
|
|
|
|
Return the last insn emitted. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_insns (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
rtx last = 0;
|
|
|
|
|
|
|
|
|
|
while (insn)
|
|
|
|
|
{
|
|
|
|
|
rtx next = NEXT_INSN (insn);
|
|
|
|
|
add_insn (insn);
|
|
|
|
|
last = insn;
|
|
|
|
|
insn = next;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return last;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Emit the insns in a chain starting with INSN and place them in front of
|
|
|
|
|
the insn BEFORE. Return the last insn emitted. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_insns_before (insn, before)
|
|
|
|
|
rtx insn;
|
|
|
|
|
rtx before;
|
|
|
|
|
{
|
|
|
|
|
rtx last = 0;
|
|
|
|
|
|
|
|
|
|
while (insn)
|
|
|
|
|
{
|
|
|
|
|
rtx next = NEXT_INSN (insn);
|
1994-09-30 23:26:03 +01:00
|
|
|
|
add_insn_before (insn, before);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
last = insn;
|
|
|
|
|
insn = next;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return last;
|
|
|
|
|
}
|
|
|
|
|
|
1992-08-21 08:12:24 +02:00
|
|
|
|
/* Emit the insns in a chain starting with FIRST and place them in back of
|
|
|
|
|
the insn AFTER. Return the last insn emitted. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_insns_after (first, after)
|
|
|
|
|
register rtx first;
|
|
|
|
|
register rtx after;
|
|
|
|
|
{
|
|
|
|
|
register rtx last;
|
|
|
|
|
register rtx after_after;
|
|
|
|
|
|
|
|
|
|
if (!after)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
if (!first)
|
|
|
|
|
return first;
|
|
|
|
|
|
|
|
|
|
for (last = first; NEXT_INSN (last); last = NEXT_INSN (last))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
after_after = NEXT_INSN (after);
|
|
|
|
|
|
|
|
|
|
NEXT_INSN (after) = first;
|
|
|
|
|
PREV_INSN (first) = after;
|
|
|
|
|
NEXT_INSN (last) = after_after;
|
|
|
|
|
if (after_after)
|
|
|
|
|
PREV_INSN (after_after) = last;
|
|
|
|
|
|
1992-09-01 22:31:58 +02:00
|
|
|
|
if (after == last_insn)
|
|
|
|
|
last_insn = last;
|
1992-08-21 08:12:24 +02:00
|
|
|
|
return last;
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* Make an insn of code JUMP_INSN with pattern PATTERN
|
|
|
|
|
and add it to the end of the doubly-linked list. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_jump_insn (pattern)
|
|
|
|
|
rtx pattern;
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (pattern) == SEQUENCE)
|
|
|
|
|
return emit_insn (pattern);
|
|
|
|
|
else
|
|
|
|
|
{
|
1993-01-13 00:30:47 +01:00
|
|
|
|
register rtx insn = make_jump_insn_raw (pattern);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
add_insn (insn);
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make an insn of code CALL_INSN with pattern PATTERN
|
|
|
|
|
and add it to the end of the doubly-linked list. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_call_insn (pattern)
|
|
|
|
|
rtx pattern;
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (pattern) == SEQUENCE)
|
|
|
|
|
return emit_insn (pattern);
|
|
|
|
|
else
|
|
|
|
|
{
|
1994-05-06 23:45:57 +02:00
|
|
|
|
register rtx insn = make_call_insn_raw (pattern);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
add_insn (insn);
|
|
|
|
|
PUT_CODE (insn, CALL_INSN);
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Add the label LABEL to the end of the doubly-linked list. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_label (label)
|
|
|
|
|
rtx label;
|
|
|
|
|
{
|
|
|
|
|
/* This can be called twice for the same label
|
|
|
|
|
as a result of the confusion that follows a syntax error!
|
|
|
|
|
So make it harmless. */
|
|
|
|
|
if (INSN_UID (label) == 0)
|
|
|
|
|
{
|
|
|
|
|
INSN_UID (label) = cur_insn_uid++;
|
|
|
|
|
add_insn (label);
|
|
|
|
|
}
|
|
|
|
|
return label;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make an insn of code BARRIER
|
|
|
|
|
and add it to the end of the doubly-linked list. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_barrier ()
|
|
|
|
|
{
|
|
|
|
|
register rtx barrier = rtx_alloc (BARRIER);
|
|
|
|
|
INSN_UID (barrier) = cur_insn_uid++;
|
|
|
|
|
add_insn (barrier);
|
|
|
|
|
return barrier;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make an insn of code NOTE
|
|
|
|
|
with data-fields specified by FILE and LINE
|
|
|
|
|
and add it to the end of the doubly-linked list,
|
|
|
|
|
but only if line-numbers are desired for debugging info. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_line_note (file, line)
|
|
|
|
|
char *file;
|
|
|
|
|
int line;
|
|
|
|
|
{
|
1999-08-01 14:07:41 +02:00
|
|
|
|
set_file_and_line_for_stmt (file, line);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
if (no_line_numbers)
|
|
|
|
|
return 0;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
return emit_note (file, line);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Make an insn of code NOTE
|
|
|
|
|
with data-fields specified by FILE and LINE
|
|
|
|
|
and add it to the end of the doubly-linked list.
|
|
|
|
|
If it is a line-number NOTE, omit it if it matches the previous one. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_note (file, line)
|
|
|
|
|
char *file;
|
|
|
|
|
int line;
|
|
|
|
|
{
|
|
|
|
|
register rtx note;
|
|
|
|
|
|
|
|
|
|
if (line > 0)
|
|
|
|
|
{
|
|
|
|
|
if (file && last_filename && !strcmp (file, last_filename)
|
|
|
|
|
&& line == last_linenum)
|
|
|
|
|
return 0;
|
|
|
|
|
last_filename = file;
|
|
|
|
|
last_linenum = line;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (no_line_numbers && line > 0)
|
|
|
|
|
{
|
|
|
|
|
cur_insn_uid++;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
note = rtx_alloc (NOTE);
|
|
|
|
|
INSN_UID (note) = cur_insn_uid++;
|
|
|
|
|
NOTE_SOURCE_FILE (note) = file;
|
|
|
|
|
NOTE_LINE_NUMBER (note) = line;
|
|
|
|
|
add_insn (note);
|
|
|
|
|
return note;
|
|
|
|
|
}
|
|
|
|
|
|
1998-12-07 23:18:00 +01:00
|
|
|
|
/* Emit a NOTE, and don't omit it even if LINE is the previous note. */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit_line_note_force (file, line)
|
|
|
|
|
char *file;
|
|
|
|
|
int line;
|
|
|
|
|
{
|
|
|
|
|
last_linenum = -1;
|
|
|
|
|
return emit_line_note (file, line);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Cause next statement to emit a line note even if the line number
|
|
|
|
|
has not changed. This is used at the beginning of a function. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
force_next_line_note ()
|
|
|
|
|
{
|
|
|
|
|
last_linenum = -1;
|
|
|
|
|
}
|
1999-03-25 13:04:24 +01:00
|
|
|
|
|
|
|
|
|
/* Place a note of KIND on insn INSN with DATUM as the datum. If a
|
|
|
|
|
note of this type already exists, remove it first. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
set_unique_reg_note (insn, kind, datum)
|
|
|
|
|
rtx insn;
|
|
|
|
|
enum reg_note kind;
|
|
|
|
|
rtx datum;
|
|
|
|
|
{
|
|
|
|
|
rtx note = find_reg_note (insn, kind, NULL_RTX);
|
|
|
|
|
|
|
|
|
|
/* First remove the note if there already is one. */
|
|
|
|
|
if (note)
|
|
|
|
|
remove_note (insn, note);
|
|
|
|
|
|
|
|
|
|
REG_NOTES (insn) = gen_rtx_EXPR_LIST (kind, datum, REG_NOTES (insn));
|
|
|
|
|
}
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
/* Return an indication of which type of insn should have X as a body.
|
|
|
|
|
The value is CODE_LABEL, INSN, CALL_INSN or JUMP_INSN. */
|
|
|
|
|
|
|
|
|
|
enum rtx_code
|
|
|
|
|
classify_insn (x)
|
|
|
|
|
rtx x;
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (x) == CODE_LABEL)
|
|
|
|
|
return CODE_LABEL;
|
|
|
|
|
if (GET_CODE (x) == CALL)
|
|
|
|
|
return CALL_INSN;
|
|
|
|
|
if (GET_CODE (x) == RETURN)
|
|
|
|
|
return JUMP_INSN;
|
|
|
|
|
if (GET_CODE (x) == SET)
|
|
|
|
|
{
|
|
|
|
|
if (SET_DEST (x) == pc_rtx)
|
|
|
|
|
return JUMP_INSN;
|
|
|
|
|
else if (GET_CODE (SET_SRC (x)) == CALL)
|
|
|
|
|
return CALL_INSN;
|
|
|
|
|
else
|
|
|
|
|
return INSN;
|
|
|
|
|
}
|
|
|
|
|
if (GET_CODE (x) == PARALLEL)
|
|
|
|
|
{
|
|
|
|
|
register int j;
|
|
|
|
|
for (j = XVECLEN (x, 0) - 1; j >= 0; j--)
|
|
|
|
|
if (GET_CODE (XVECEXP (x, 0, j)) == CALL)
|
|
|
|
|
return CALL_INSN;
|
|
|
|
|
else if (GET_CODE (XVECEXP (x, 0, j)) == SET
|
|
|
|
|
&& SET_DEST (XVECEXP (x, 0, j)) == pc_rtx)
|
|
|
|
|
return JUMP_INSN;
|
|
|
|
|
else if (GET_CODE (XVECEXP (x, 0, j)) == SET
|
|
|
|
|
&& GET_CODE (SET_SRC (XVECEXP (x, 0, j))) == CALL)
|
|
|
|
|
return CALL_INSN;
|
|
|
|
|
}
|
|
|
|
|
return INSN;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Emit the rtl pattern X as an appropriate kind of insn.
|
|
|
|
|
If X is a label, it is simply added into the insn chain. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
emit (x)
|
|
|
|
|
rtx x;
|
|
|
|
|
{
|
|
|
|
|
enum rtx_code code = classify_insn (x);
|
|
|
|
|
|
|
|
|
|
if (code == CODE_LABEL)
|
|
|
|
|
return emit_label (x);
|
|
|
|
|
else if (code == INSN)
|
|
|
|
|
return emit_insn (x);
|
|
|
|
|
else if (code == JUMP_INSN)
|
|
|
|
|
{
|
|
|
|
|
register rtx insn = emit_jump_insn (x);
|
|
|
|
|
if (simplejump_p (insn) || GET_CODE (x) == RETURN)
|
|
|
|
|
return emit_barrier ();
|
|
|
|
|
return insn;
|
|
|
|
|
}
|
|
|
|
|
else if (code == CALL_INSN)
|
|
|
|
|
return emit_call_insn (x);
|
|
|
|
|
else
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
|
1999-04-30 01:01:29 +02:00
|
|
|
|
/* Begin emitting insns to a sequence which can be packaged in an
|
|
|
|
|
RTL_EXPR. If this sequence will contain something that might cause
|
|
|
|
|
the compiler to pop arguments to function calls (because those
|
|
|
|
|
pops have previously been deferred; see INHIBIT_DEFER_POP for more
|
|
|
|
|
details), use do_pending_stack_adjust before calling this function.
|
|
|
|
|
That will ensure that the deferred pops are not accidentally
|
|
|
|
|
emitted in the middel of this sequence. */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
start_sequence ()
|
|
|
|
|
{
|
|
|
|
|
struct sequence_stack *tem;
|
|
|
|
|
|
1999-09-05 18:08:20 +02:00
|
|
|
|
tem = (struct sequence_stack *) xmalloc (sizeof (struct sequence_stack));
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
1999-08-09 16:00:21 +02:00
|
|
|
|
tem->next = seq_stack;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
tem->first = first_insn;
|
|
|
|
|
tem->last = last_insn;
|
1999-08-09 16:00:21 +02:00
|
|
|
|
tem->sequence_rtl_expr = seq_rtl_expr;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
1999-08-09 16:00:21 +02:00
|
|
|
|
seq_stack = tem;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
first_insn = 0;
|
|
|
|
|
last_insn = 0;
|
|
|
|
|
}
|
|
|
|
|
|
1999-04-30 01:01:29 +02:00
|
|
|
|
/* Similarly, but indicate that this sequence will be placed in T, an
|
|
|
|
|
RTL_EXPR. See the documentation for start_sequence for more
|
|
|
|
|
information about how to use this function. */
|
1993-11-26 00:11:29 +01:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
start_sequence_for_rtl_expr (t)
|
|
|
|
|
tree t;
|
|
|
|
|
{
|
|
|
|
|
start_sequence ();
|
|
|
|
|
|
1999-08-09 16:00:21 +02:00
|
|
|
|
seq_rtl_expr = t;
|
1993-11-26 00:11:29 +01:00
|
|
|
|
}
|
|
|
|
|
|
1999-04-30 01:01:29 +02:00
|
|
|
|
/* Set up the insn chain starting with FIRST as the current sequence,
|
|
|
|
|
saving the previously current one. See the documentation for
|
|
|
|
|
start_sequence for more information about how to use this function. */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
push_to_sequence (first)
|
|
|
|
|
rtx first;
|
|
|
|
|
{
|
|
|
|
|
rtx last;
|
|
|
|
|
|
|
|
|
|
start_sequence ();
|
|
|
|
|
|
|
|
|
|
for (last = first; last && NEXT_INSN (last); last = NEXT_INSN (last));
|
|
|
|
|
|
|
|
|
|
first_insn = first;
|
|
|
|
|
last_insn = last;
|
|
|
|
|
}
|
|
|
|
|
|
1993-03-23 13:52:39 +01:00
|
|
|
|
/* Set up the outer-level insn chain
|
|
|
|
|
as the current sequence, saving the previously current one. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
push_topmost_sequence ()
|
|
|
|
|
{
|
1998-04-02 01:18:11 +02:00
|
|
|
|
struct sequence_stack *stack, *top = NULL;
|
1993-03-23 13:52:39 +01:00
|
|
|
|
|
|
|
|
|
start_sequence ();
|
|
|
|
|
|
1999-08-09 16:00:21 +02:00
|
|
|
|
for (stack = seq_stack; stack; stack = stack->next)
|
1993-03-23 13:52:39 +01:00
|
|
|
|
top = stack;
|
|
|
|
|
|
|
|
|
|
first_insn = top->first;
|
|
|
|
|
last_insn = top->last;
|
1999-08-09 16:00:21 +02:00
|
|
|
|
seq_rtl_expr = top->sequence_rtl_expr;
|
1993-03-23 13:52:39 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* After emitting to the outer-level insn chain, update the outer-level
|
|
|
|
|
insn chain, and restore the previous saved state. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
pop_topmost_sequence ()
|
|
|
|
|
{
|
1998-04-02 01:18:11 +02:00
|
|
|
|
struct sequence_stack *stack, *top = NULL;
|
1993-03-23 13:52:39 +01:00
|
|
|
|
|
1999-08-09 16:00:21 +02:00
|
|
|
|
for (stack = seq_stack; stack; stack = stack->next)
|
1993-03-23 13:52:39 +01:00
|
|
|
|
top = stack;
|
|
|
|
|
|
|
|
|
|
top->first = first_insn;
|
|
|
|
|
top->last = last_insn;
|
1999-08-09 16:00:21 +02:00
|
|
|
|
/* ??? Why don't we save seq_rtl_expr here? */
|
1993-03-23 13:52:39 +01:00
|
|
|
|
|
|
|
|
|
end_sequence ();
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* After emitting to a sequence, restore previous saved state.
|
|
|
|
|
|
1999-04-30 01:01:29 +02:00
|
|
|
|
To get the contents of the sequence just made, you must call
|
|
|
|
|
`gen_sequence' *before* calling here.
|
|
|
|
|
|
|
|
|
|
If the compiler might have deferred popping arguments while
|
|
|
|
|
generating this sequence, and this sequence will not be immediately
|
|
|
|
|
inserted into the instruction stream, use do_pending_stack_adjust
|
|
|
|
|
before calling gen_sequence. That will ensure that the deferred
|
|
|
|
|
pops are inserted into this sequence, and not into some random
|
|
|
|
|
location in the instruction stream. See INHIBIT_DEFER_POP for more
|
|
|
|
|
information about deferred popping of arguments. */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
end_sequence ()
|
|
|
|
|
{
|
1999-08-09 16:00:21 +02:00
|
|
|
|
struct sequence_stack *tem = seq_stack;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
first_insn = tem->first;
|
|
|
|
|
last_insn = tem->last;
|
1999-08-09 16:00:21 +02:00
|
|
|
|
seq_rtl_expr = tem->sequence_rtl_expr;
|
|
|
|
|
seq_stack = tem->next;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
1999-09-05 18:08:20 +02:00
|
|
|
|
free (tem);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 if currently emitting into a sequence. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
in_sequence_p ()
|
|
|
|
|
{
|
1999-08-09 16:00:21 +02:00
|
|
|
|
return seq_stack != 0;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Generate a SEQUENCE rtx containing the insns already emitted
|
|
|
|
|
to the current sequence.
|
|
|
|
|
|
|
|
|
|
This is how the gen_... function from a DEFINE_EXPAND
|
|
|
|
|
constructs the SEQUENCE that it returns. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
gen_sequence ()
|
|
|
|
|
{
|
|
|
|
|
rtx result;
|
|
|
|
|
rtx tem;
|
|
|
|
|
int i;
|
|
|
|
|
int len;
|
|
|
|
|
|
|
|
|
|
/* Count the insns in the chain. */
|
|
|
|
|
len = 0;
|
|
|
|
|
for (tem = first_insn; tem; tem = NEXT_INSN (tem))
|
|
|
|
|
len++;
|
|
|
|
|
|
|
|
|
|
/* If only one insn, return its pattern rather than a SEQUENCE.
|
|
|
|
|
(Now that we cache SEQUENCE expressions, it isn't worth special-casing
|
|
|
|
|
the case of an empty list.) */
|
|
|
|
|
if (len == 1
|
1997-09-16 04:07:50 +02:00
|
|
|
|
&& ! RTX_FRAME_RELATED_P (first_insn)
|
1992-03-14 06:04:21 +01:00
|
|
|
|
&& (GET_CODE (first_insn) == INSN
|
|
|
|
|
|| GET_CODE (first_insn) == JUMP_INSN
|
1995-04-14 02:26:46 +02:00
|
|
|
|
/* Don't discard the call usage field. */
|
|
|
|
|
|| (GET_CODE (first_insn) == CALL_INSN
|
|
|
|
|
&& CALL_INSN_FUNCTION_USAGE (first_insn) == NULL_RTX)))
|
1996-03-10 12:23:17 +01:00
|
|
|
|
{
|
1999-09-05 18:08:20 +02:00
|
|
|
|
if (!ggc_p)
|
|
|
|
|
{
|
|
|
|
|
NEXT_INSN (first_insn) = free_insn;
|
|
|
|
|
free_insn = first_insn;
|
|
|
|
|
}
|
1996-03-10 12:23:17 +01:00
|
|
|
|
return PATTERN (first_insn);
|
|
|
|
|
}
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
/* Put them in a vector. See if we already have a SEQUENCE of the
|
|
|
|
|
appropriate length around. */
|
1999-09-05 18:08:20 +02:00
|
|
|
|
if (!ggc_p && len < SEQUENCE_RESULT_SIZE
|
|
|
|
|
&& (result = sequence_result[len]) != 0)
|
1992-03-14 06:04:21 +01:00
|
|
|
|
sequence_result[len] = 0;
|
|
|
|
|
else
|
|
|
|
|
{
|
1995-05-16 14:39:54 +02:00
|
|
|
|
/* Ensure that this rtl goes in saveable_obstack, since we may
|
|
|
|
|
cache it. */
|
1993-03-02 21:55:53 +01:00
|
|
|
|
push_obstacks_nochange ();
|
|
|
|
|
rtl_in_saveable_obstack ();
|
1998-01-08 22:17:05 +01:00
|
|
|
|
result = gen_rtx_SEQUENCE (VOIDmode, rtvec_alloc (len));
|
1993-03-02 21:55:53 +01:00
|
|
|
|
pop_obstacks ();
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i = 0, tem = first_insn; tem; tem = NEXT_INSN (tem), i++)
|
|
|
|
|
XVECEXP (result, 0, i) = tem;
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
1998-09-24 01:28:17 +02:00
|
|
|
|
/* Put the various virtual registers into REGNO_REG_RTX. */
|
|
|
|
|
|
|
|
|
|
void
|
1999-08-09 16:00:21 +02:00
|
|
|
|
init_virtual_regs (es)
|
|
|
|
|
struct emit_status *es;
|
1998-09-24 01:28:17 +02:00
|
|
|
|
{
|
1999-08-09 16:00:21 +02:00
|
|
|
|
rtx *ptr = es->x_regno_reg_rtx;
|
|
|
|
|
ptr[VIRTUAL_INCOMING_ARGS_REGNUM] = virtual_incoming_args_rtx;
|
|
|
|
|
ptr[VIRTUAL_STACK_VARS_REGNUM] = virtual_stack_vars_rtx;
|
|
|
|
|
ptr[VIRTUAL_STACK_DYNAMIC_REGNUM] = virtual_stack_dynamic_rtx;
|
|
|
|
|
ptr[VIRTUAL_OUTGOING_ARGS_REGNUM] = virtual_outgoing_args_rtx;
|
|
|
|
|
ptr[VIRTUAL_CFA_REGNUM] = virtual_cfa_rtx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
clear_emit_caches ()
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
/* Clear the start_sequence/gen_sequence cache. */
|
|
|
|
|
for (i = 0; i < SEQUENCE_RESULT_SIZE; i++)
|
|
|
|
|
sequence_result[i] = 0;
|
|
|
|
|
free_insn = 0;
|
1998-09-24 01:28:17 +02:00
|
|
|
|
}
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* Initialize data structures and variables in this file
|
|
|
|
|
before generating rtl for each function. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
init_emit ()
|
|
|
|
|
{
|
1999-08-09 16:00:21 +02:00
|
|
|
|
struct function *f = current_function;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
1999-08-09 16:00:21 +02:00
|
|
|
|
f->emit = (struct emit_status *) xmalloc (sizeof (struct emit_status));
|
1992-03-14 06:04:21 +01:00
|
|
|
|
first_insn = NULL;
|
|
|
|
|
last_insn = NULL;
|
1999-08-09 16:00:21 +02:00
|
|
|
|
seq_rtl_expr = NULL;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
cur_insn_uid = 1;
|
|
|
|
|
reg_rtx_no = LAST_VIRTUAL_REGISTER + 1;
|
|
|
|
|
last_linenum = 0;
|
|
|
|
|
last_filename = 0;
|
|
|
|
|
first_label_num = label_num;
|
|
|
|
|
last_label_num = 0;
|
1999-08-09 16:00:21 +02:00
|
|
|
|
seq_stack = NULL;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
1999-08-09 16:00:21 +02:00
|
|
|
|
clear_emit_caches ();
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
/* Init the tables that describe all the pseudo regs. */
|
|
|
|
|
|
1999-08-09 16:00:21 +02:00
|
|
|
|
f->emit->regno_pointer_flag_length = LAST_VIRTUAL_REGISTER + 101;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
1999-08-09 16:00:21 +02:00
|
|
|
|
f->emit->regno_pointer_flag
|
1999-09-05 18:08:20 +02:00
|
|
|
|
= (char *) xcalloc (f->emit->regno_pointer_flag_length, sizeof (char));
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
1999-08-09 16:00:21 +02:00
|
|
|
|
f->emit->regno_pointer_align
|
1999-09-05 18:08:20 +02:00
|
|
|
|
= (char *) xcalloc (f->emit->regno_pointer_flag_length,
|
|
|
|
|
sizeof (char));
|
1995-12-27 21:21:02 +01:00
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
regno_reg_rtx
|
1999-09-05 18:08:20 +02:00
|
|
|
|
= (rtx *) xcalloc (f->emit->regno_pointer_flag_length * sizeof (rtx),
|
|
|
|
|
sizeof (rtx));
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
/* Put copies of all the virtual register rtx into regno_reg_rtx. */
|
1999-08-09 16:00:21 +02:00
|
|
|
|
init_virtual_regs (f->emit);
|
1992-06-22 12:43:55 +02:00
|
|
|
|
|
|
|
|
|
/* Indicate that the virtual registers and stack locations are
|
|
|
|
|
all pointers. */
|
|
|
|
|
REGNO_POINTER_FLAG (STACK_POINTER_REGNUM) = 1;
|
|
|
|
|
REGNO_POINTER_FLAG (FRAME_POINTER_REGNUM) = 1;
|
1994-11-22 12:28:38 +01:00
|
|
|
|
REGNO_POINTER_FLAG (HARD_FRAME_POINTER_REGNUM) = 1;
|
1992-06-22 12:43:55 +02:00
|
|
|
|
REGNO_POINTER_FLAG (ARG_POINTER_REGNUM) = 1;
|
|
|
|
|
|
|
|
|
|
REGNO_POINTER_FLAG (VIRTUAL_INCOMING_ARGS_REGNUM) = 1;
|
|
|
|
|
REGNO_POINTER_FLAG (VIRTUAL_STACK_VARS_REGNUM) = 1;
|
|
|
|
|
REGNO_POINTER_FLAG (VIRTUAL_STACK_DYNAMIC_REGNUM) = 1;
|
|
|
|
|
REGNO_POINTER_FLAG (VIRTUAL_OUTGOING_ARGS_REGNUM) = 1;
|
tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused.
* tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused. Kill.
(BUILT_IN_FP, BUILT_IN_SP, BUILT_IN_SET_RETURN_ADDR_REG): Kill.
(BUILT_IN_EH_STUB_OLD, BUILT_IN_EH_STUB, BUILT_IN_SET_EH_REGS): Kill.
(BUILT_IN_EH_RETURN, BUILT_IN_DWARF_CFA): New.
* c-decl.c (init_decl_processing): Update accordingly.
* expr.c (expand_builtin): Likewise.
* cp/decl.c (init_decl_processing): Likewise.
* rtl.h (global_rtl): Add cfa entry.
(virtual_cfa_rtx, VIRTUAL_CFA_REGNUM): New.
(LAST_VIRTUAL_REGISTER): Update.
* emit-rtl.c (global_rtl): Add cfa entry.
(init_emit): Initialize it.
* function.c (cfa_offset): New.
(instantiate_virtual_regs): Initialize it.
(instantiate_virtual_regs_1): Instantiate virtual_cfa_rtx.
(expand_function_end): Call expand_eh_return.
* tm.texi (ARG_POINTER_CFA_OFFSET): New.
* except.c (current_function_eh_stub_label): Kill.
(current_function_eh_old_stub_label): Likwise; update all references.
(expand_builtin_set_return_addr_reg): Kill.
(expand_builtin_eh_stub_old, expand_builtin_eh_stub): Kill.
(expand_builtin_set_eh_regs): Kill.
(eh_regs): Produce a third reg for the actual handler address.
(eh_return_context, eh_return_stack_adjust): New.
(eh_return_handler, eh_return_stub_label): New.
(init_eh_for_function): Initialize them.
(expand_builtin_eh_return, expand_eh_return): New.
* except.h: Update prototypes.
* flow.c (find_basic_blocks_1): Update references to the stub label.
* function.h (struct function): Kill stub label elements.
* libgcc2.c (in_reg_window): For REG_SAVED_REG, check that the
register number is one that would be in the previous window.
Provide a dummy definition for non-windowed targets.
(get_reg_addr): New function.
(get_reg, put_reg, copy_reg): Use it.
(__throw): Rely on in_reg_window, not INCOMING_REGNO. Kill stub
generating code and use __builtin_eh_return. Use __builtin_dwarf_cfa.
* alpha.c (alpha_eh_epilogue_sp_ofs): New.
(alpha_init_expanders): Initialize it.
(alpha_expand_epilogue): Use it.
* alpha.h: Declare it.
* alpha.md (eh_epilogue): New.
* m68h.h (ARG_POINTER_CFA_OFFSET): New.
* sparc.h (ARG_POINTER_CFA_OFFSET): New.
From-SVN: r22436
1998-09-15 21:19:12 +02:00
|
|
|
|
REGNO_POINTER_FLAG (VIRTUAL_CFA_REGNUM) = 1;
|
1993-03-22 08:41:33 +01:00
|
|
|
|
|
1995-12-27 21:21:02 +01:00
|
|
|
|
#ifdef STACK_BOUNDARY
|
|
|
|
|
REGNO_POINTER_ALIGN (STACK_POINTER_REGNUM) = STACK_BOUNDARY / BITS_PER_UNIT;
|
|
|
|
|
REGNO_POINTER_ALIGN (FRAME_POINTER_REGNUM) = STACK_BOUNDARY / BITS_PER_UNIT;
|
|
|
|
|
REGNO_POINTER_ALIGN (HARD_FRAME_POINTER_REGNUM)
|
|
|
|
|
= STACK_BOUNDARY / BITS_PER_UNIT;
|
|
|
|
|
REGNO_POINTER_ALIGN (ARG_POINTER_REGNUM) = STACK_BOUNDARY / BITS_PER_UNIT;
|
|
|
|
|
|
|
|
|
|
REGNO_POINTER_ALIGN (VIRTUAL_INCOMING_ARGS_REGNUM)
|
|
|
|
|
= STACK_BOUNDARY / BITS_PER_UNIT;
|
|
|
|
|
REGNO_POINTER_ALIGN (VIRTUAL_STACK_VARS_REGNUM)
|
|
|
|
|
= STACK_BOUNDARY / BITS_PER_UNIT;
|
|
|
|
|
REGNO_POINTER_ALIGN (VIRTUAL_STACK_DYNAMIC_REGNUM)
|
|
|
|
|
= STACK_BOUNDARY / BITS_PER_UNIT;
|
|
|
|
|
REGNO_POINTER_ALIGN (VIRTUAL_OUTGOING_ARGS_REGNUM)
|
|
|
|
|
= STACK_BOUNDARY / BITS_PER_UNIT;
|
tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused.
* tree.h (BUILT_IN_CALLER_RETURN_ADDRESS): Unused. Kill.
(BUILT_IN_FP, BUILT_IN_SP, BUILT_IN_SET_RETURN_ADDR_REG): Kill.
(BUILT_IN_EH_STUB_OLD, BUILT_IN_EH_STUB, BUILT_IN_SET_EH_REGS): Kill.
(BUILT_IN_EH_RETURN, BUILT_IN_DWARF_CFA): New.
* c-decl.c (init_decl_processing): Update accordingly.
* expr.c (expand_builtin): Likewise.
* cp/decl.c (init_decl_processing): Likewise.
* rtl.h (global_rtl): Add cfa entry.
(virtual_cfa_rtx, VIRTUAL_CFA_REGNUM): New.
(LAST_VIRTUAL_REGISTER): Update.
* emit-rtl.c (global_rtl): Add cfa entry.
(init_emit): Initialize it.
* function.c (cfa_offset): New.
(instantiate_virtual_regs): Initialize it.
(instantiate_virtual_regs_1): Instantiate virtual_cfa_rtx.
(expand_function_end): Call expand_eh_return.
* tm.texi (ARG_POINTER_CFA_OFFSET): New.
* except.c (current_function_eh_stub_label): Kill.
(current_function_eh_old_stub_label): Likwise; update all references.
(expand_builtin_set_return_addr_reg): Kill.
(expand_builtin_eh_stub_old, expand_builtin_eh_stub): Kill.
(expand_builtin_set_eh_regs): Kill.
(eh_regs): Produce a third reg for the actual handler address.
(eh_return_context, eh_return_stack_adjust): New.
(eh_return_handler, eh_return_stub_label): New.
(init_eh_for_function): Initialize them.
(expand_builtin_eh_return, expand_eh_return): New.
* except.h: Update prototypes.
* flow.c (find_basic_blocks_1): Update references to the stub label.
* function.h (struct function): Kill stub label elements.
* libgcc2.c (in_reg_window): For REG_SAVED_REG, check that the
register number is one that would be in the previous window.
Provide a dummy definition for non-windowed targets.
(get_reg_addr): New function.
(get_reg, put_reg, copy_reg): Use it.
(__throw): Rely on in_reg_window, not INCOMING_REGNO. Kill stub
generating code and use __builtin_eh_return. Use __builtin_dwarf_cfa.
* alpha.c (alpha_eh_epilogue_sp_ofs): New.
(alpha_init_expanders): Initialize it.
(alpha_expand_epilogue): Use it.
* alpha.h: Declare it.
* alpha.md (eh_epilogue): New.
* m68h.h (ARG_POINTER_CFA_OFFSET): New.
* sparc.h (ARG_POINTER_CFA_OFFSET): New.
From-SVN: r22436
1998-09-15 21:19:12 +02:00
|
|
|
|
REGNO_POINTER_ALIGN (VIRTUAL_CFA_REGNUM) = UNITS_PER_WORD;
|
1995-12-27 21:21:02 +01:00
|
|
|
|
#endif
|
|
|
|
|
|
1993-03-22 08:41:33 +01:00
|
|
|
|
#ifdef INIT_EXPANDERS
|
|
|
|
|
INIT_EXPANDERS;
|
|
|
|
|
#endif
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
Makefile.in (tree.o): Depend on ggc.h.
* Makefile.in (tree.o): Depend on ggc.h.
(varasm.o): Likewise.
(function.o): Likewise.
(stmt.o): Likewise.
(except.o): Likewise.
(optabs.o): Likewise.
(emit-rtl.o): Likewise.
* emit-rtl.c: Include ggc.h.
(sequence_element_free_list): Remove, and all references.
(mark_sequence): New functions.
(mark_emit_state): New function.
* except.c: Include ggc.h.
(mark_eh_node, mark_eh_stack, mark_eh_queue): New functions.
(mark_tree_label_node): New functions.
(mark_eh_state): New function.
* function.c: Include ggc.h.
(mark_temp_slot, mark_function_chain): New functions.
(mark_function_state): New function.
(init_function_once): New function.
* function.h (init_function_once): New function.
* ggc-callbacks.c (lang_mark_false_label_stack): New function.
* ggc.h (label_node): Declare.
(eh_status, emit_status, stmt_status, varasm_status): Likewise.
(lang_mark_false_label_stack): New function.
(mark_temp_slot): Remove declaration.
(mark_function_chain): Likewise.
(mark_eh_state): Adjust prototype.
(mark_stmt_state, mark_emit_state, mark_varasm_state, mark_optab):
Likewise.
* optabs.c: Include ggc.h.
(mark_optab): New function.
(init_optabs): Add gc roots.
* stmt.c: Include ggc.h.
(mark_cond_nesting, mark_loop_nesting): New functions.
(mark_block_nesting, mark_case_nesting, mark_goto_fixup): Likewise.
(mark_stmt_state): New function.
* toplev.c (compile_file): Call init_function_once.
* tree.c: Include ggc.h.
(type_hash): Move declaration earlier in file.
(TYPE_HASH_SIZE, type_hash_table): Likewise.
(init_obstacks): Add gc roots.
(mark_type_hash): New function.
* varasm.c: Include ggc.h.
(mark_pool_constant): New function.
(mark_varasm_state): New function.
Co-Authored-By: Bernd Schmidt <bernds@cygnus.co.uk>
Co-Authored-By: Mark Mitchell <mark@codesourcery.com>
From-SVN: r29119
1999-09-05 04:41:35 +02:00
|
|
|
|
/* Mark SS for GC. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
mark_sequence_stack (ss)
|
|
|
|
|
struct sequence_stack *ss;
|
|
|
|
|
{
|
|
|
|
|
while (ss)
|
|
|
|
|
{
|
|
|
|
|
ggc_mark_rtx (ss->first);
|
|
|
|
|
ggc_mark_tree (ss->sequence_rtl_expr);
|
|
|
|
|
ss = ss->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Mark ES for GC. */
|
|
|
|
|
|
|
|
|
|
void
|
1999-09-16 03:12:25 +02:00
|
|
|
|
mark_emit_status (es)
|
Makefile.in (tree.o): Depend on ggc.h.
* Makefile.in (tree.o): Depend on ggc.h.
(varasm.o): Likewise.
(function.o): Likewise.
(stmt.o): Likewise.
(except.o): Likewise.
(optabs.o): Likewise.
(emit-rtl.o): Likewise.
* emit-rtl.c: Include ggc.h.
(sequence_element_free_list): Remove, and all references.
(mark_sequence): New functions.
(mark_emit_state): New function.
* except.c: Include ggc.h.
(mark_eh_node, mark_eh_stack, mark_eh_queue): New functions.
(mark_tree_label_node): New functions.
(mark_eh_state): New function.
* function.c: Include ggc.h.
(mark_temp_slot, mark_function_chain): New functions.
(mark_function_state): New function.
(init_function_once): New function.
* function.h (init_function_once): New function.
* ggc-callbacks.c (lang_mark_false_label_stack): New function.
* ggc.h (label_node): Declare.
(eh_status, emit_status, stmt_status, varasm_status): Likewise.
(lang_mark_false_label_stack): New function.
(mark_temp_slot): Remove declaration.
(mark_function_chain): Likewise.
(mark_eh_state): Adjust prototype.
(mark_stmt_state, mark_emit_state, mark_varasm_state, mark_optab):
Likewise.
* optabs.c: Include ggc.h.
(mark_optab): New function.
(init_optabs): Add gc roots.
* stmt.c: Include ggc.h.
(mark_cond_nesting, mark_loop_nesting): New functions.
(mark_block_nesting, mark_case_nesting, mark_goto_fixup): Likewise.
(mark_stmt_state): New function.
* toplev.c (compile_file): Call init_function_once.
* tree.c: Include ggc.h.
(type_hash): Move declaration earlier in file.
(TYPE_HASH_SIZE, type_hash_table): Likewise.
(init_obstacks): Add gc roots.
(mark_type_hash): New function.
* varasm.c: Include ggc.h.
(mark_pool_constant): New function.
(mark_varasm_state): New function.
Co-Authored-By: Bernd Schmidt <bernds@cygnus.co.uk>
Co-Authored-By: Mark Mitchell <mark@codesourcery.com>
From-SVN: r29119
1999-09-05 04:41:35 +02:00
|
|
|
|
struct emit_status *es;
|
|
|
|
|
{
|
|
|
|
|
rtx *r;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
if (es == 0)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
for (i = es->regno_pointer_flag_length, r = es->x_regno_reg_rtx;
|
|
|
|
|
i > 0; --i, ++r)
|
|
|
|
|
ggc_mark_rtx (*r);
|
|
|
|
|
|
|
|
|
|
mark_sequence_stack (es->sequence_stack);
|
|
|
|
|
ggc_mark_tree (es->sequence_rtl_expr);
|
|
|
|
|
ggc_mark_rtx (es->x_first_insn);
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* Create some permanent unique rtl objects shared between all functions.
|
|
|
|
|
LINE_NUMBERS is nonzero if line numbers are to be generated. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
init_emit_once (line_numbers)
|
|
|
|
|
int line_numbers;
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
enum machine_mode mode;
|
1998-06-29 23:40:49 +02:00
|
|
|
|
enum machine_mode double_mode;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
no_line_numbers = ! line_numbers;
|
|
|
|
|
|
1999-09-23 22:34:19 +02:00
|
|
|
|
/* Compute the word and byte modes. */
|
|
|
|
|
|
|
|
|
|
byte_mode = VOIDmode;
|
|
|
|
|
word_mode = VOIDmode;
|
|
|
|
|
double_mode = VOIDmode;
|
|
|
|
|
|
|
|
|
|
for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); mode != VOIDmode;
|
|
|
|
|
mode = GET_MODE_WIDER_MODE (mode))
|
|
|
|
|
{
|
|
|
|
|
if (GET_MODE_BITSIZE (mode) == BITS_PER_UNIT
|
|
|
|
|
&& byte_mode == VOIDmode)
|
|
|
|
|
byte_mode = mode;
|
|
|
|
|
|
|
|
|
|
if (GET_MODE_BITSIZE (mode) == BITS_PER_WORD
|
|
|
|
|
&& word_mode == VOIDmode)
|
|
|
|
|
word_mode = mode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#ifndef DOUBLE_TYPE_SIZE
|
|
|
|
|
#define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); mode != VOIDmode;
|
|
|
|
|
mode = GET_MODE_WIDER_MODE (mode))
|
|
|
|
|
{
|
|
|
|
|
if (GET_MODE_BITSIZE (mode) == DOUBLE_TYPE_SIZE
|
|
|
|
|
&& double_mode == VOIDmode)
|
|
|
|
|
double_mode = mode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ptr_mode = mode_for_size (POINTER_SIZE, GET_MODE_CLASS (Pmode), 0);
|
|
|
|
|
|
1999-09-18 20:16:44 +02:00
|
|
|
|
/* Assign register numbers to the globally defined register rtx.
|
|
|
|
|
This must be done at runtime because the register number field
|
|
|
|
|
is in a union and some compilers can't initialize unions. */
|
|
|
|
|
|
|
|
|
|
pc_rtx = gen_rtx (PC, VOIDmode);
|
|
|
|
|
cc0_rtx = gen_rtx (CC0, VOIDmode);
|
|
|
|
|
stack_pointer_rtx = gen_rtx_raw_REG (Pmode, STACK_POINTER_REGNUM);
|
|
|
|
|
frame_pointer_rtx = gen_rtx_raw_REG (Pmode, FRAME_POINTER_REGNUM);
|
|
|
|
|
if (hard_frame_pointer_rtx == 0)
|
|
|
|
|
hard_frame_pointer_rtx = gen_rtx_raw_REG (Pmode,
|
|
|
|
|
HARD_FRAME_POINTER_REGNUM);
|
|
|
|
|
if (arg_pointer_rtx == 0)
|
|
|
|
|
arg_pointer_rtx = gen_rtx_raw_REG (Pmode, ARG_POINTER_REGNUM);
|
|
|
|
|
virtual_incoming_args_rtx =
|
|
|
|
|
gen_rtx_raw_REG (Pmode, VIRTUAL_INCOMING_ARGS_REGNUM);
|
|
|
|
|
virtual_stack_vars_rtx =
|
|
|
|
|
gen_rtx_raw_REG (Pmode, VIRTUAL_STACK_VARS_REGNUM);
|
|
|
|
|
virtual_stack_dynamic_rtx =
|
|
|
|
|
gen_rtx_raw_REG (Pmode, VIRTUAL_STACK_DYNAMIC_REGNUM);
|
|
|
|
|
virtual_outgoing_args_rtx =
|
|
|
|
|
gen_rtx_raw_REG (Pmode, VIRTUAL_OUTGOING_ARGS_REGNUM);
|
|
|
|
|
virtual_cfa_rtx = gen_rtx_raw_REG (Pmode, VIRTUAL_CFA_REGNUM);
|
|
|
|
|
|
|
|
|
|
/* These rtx must be roots if GC is enabled. */
|
|
|
|
|
if (ggc_p)
|
|
|
|
|
ggc_add_rtx_root (global_rtl, GR_MAX);
|
|
|
|
|
|
|
|
|
|
#ifdef INIT_EXPANDERS
|
|
|
|
|
/* This is to initialize save_machine_status and restore_machine_status before
|
|
|
|
|
the first call to push_function_context_to. This is needed by the Chill
|
|
|
|
|
front end which calls push_function_context_to before the first cal to
|
|
|
|
|
init_function_start. */
|
|
|
|
|
INIT_EXPANDERS;
|
|
|
|
|
#endif
|
|
|
|
|
|
1992-03-14 06:04:21 +01:00
|
|
|
|
/* Create the unique rtx's for certain rtx codes and operand values. */
|
|
|
|
|
|
1999-09-07 07:49:18 +02:00
|
|
|
|
/* Don't use gen_rtx here since gen_rtx in this case
|
|
|
|
|
tries to use these variables. */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
for (i = - MAX_SAVED_CONST_INT; i <= MAX_SAVED_CONST_INT; i++)
|
1999-09-18 20:16:44 +02:00
|
|
|
|
const_int_rtx[i + MAX_SAVED_CONST_INT] =
|
|
|
|
|
gen_rtx_raw_CONST_INT (VOIDmode, i);
|
|
|
|
|
if (ggc_p)
|
|
|
|
|
ggc_add_rtx_root (const_int_rtx, 2 * MAX_SAVED_CONST_INT + 1);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
1997-12-12 01:27:40 +01:00
|
|
|
|
if (STORE_FLAG_VALUE >= - MAX_SAVED_CONST_INT
|
|
|
|
|
&& STORE_FLAG_VALUE <= MAX_SAVED_CONST_INT)
|
1999-09-18 20:16:44 +02:00
|
|
|
|
const_true_rtx = const_int_rtx[STORE_FLAG_VALUE + MAX_SAVED_CONST_INT];
|
1997-12-12 01:27:40 +01:00
|
|
|
|
else
|
1998-01-08 22:17:05 +01:00
|
|
|
|
const_true_rtx = gen_rtx_CONST_INT (VOIDmode, STORE_FLAG_VALUE);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
1998-06-29 23:40:49 +02:00
|
|
|
|
dconst0 = REAL_VALUE_ATOF ("0", double_mode);
|
|
|
|
|
dconst1 = REAL_VALUE_ATOF ("1", double_mode);
|
|
|
|
|
dconst2 = REAL_VALUE_ATOF ("2", double_mode);
|
|
|
|
|
dconstm1 = REAL_VALUE_ATOF ("-1", double_mode);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
for (i = 0; i <= 2; i++)
|
|
|
|
|
{
|
|
|
|
|
for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); mode != VOIDmode;
|
|
|
|
|
mode = GET_MODE_WIDER_MODE (mode))
|
|
|
|
|
{
|
|
|
|
|
rtx tem = rtx_alloc (CONST_DOUBLE);
|
|
|
|
|
union real_extract u;
|
|
|
|
|
|
1994-06-15 00:19:28 +02:00
|
|
|
|
bzero ((char *) &u, sizeof u); /* Zero any holes in a structure. */
|
1992-03-14 06:04:21 +01:00
|
|
|
|
u.d = i == 0 ? dconst0 : i == 1 ? dconst1 : dconst2;
|
|
|
|
|
|
1994-06-15 00:19:28 +02:00
|
|
|
|
bcopy ((char *) &u, (char *) &CONST_DOUBLE_LOW (tem), sizeof u);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
CONST_DOUBLE_MEM (tem) = cc0_rtx;
|
|
|
|
|
PUT_MODE (tem, mode);
|
|
|
|
|
|
|
|
|
|
const_tiny_rtx[i][(int) mode] = tem;
|
|
|
|
|
}
|
|
|
|
|
|
1992-07-06 22:04:13 +02:00
|
|
|
|
const_tiny_rtx[i][(int) VOIDmode] = GEN_INT (i);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
|
|
|
|
for (mode = GET_CLASS_NARROWEST_MODE (MODE_INT); mode != VOIDmode;
|
|
|
|
|
mode = GET_MODE_WIDER_MODE (mode))
|
1992-07-06 22:04:13 +02:00
|
|
|
|
const_tiny_rtx[i][(int) mode] = GEN_INT (i);
|
1993-03-05 07:27:22 +01:00
|
|
|
|
|
|
|
|
|
for (mode = GET_CLASS_NARROWEST_MODE (MODE_PARTIAL_INT);
|
|
|
|
|
mode != VOIDmode;
|
|
|
|
|
mode = GET_MODE_WIDER_MODE (mode))
|
|
|
|
|
const_tiny_rtx[i][(int) mode] = GEN_INT (i);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
|
|
|
|
|
1999-09-02 03:22:31 +02:00
|
|
|
|
for (mode = CCmode; mode < MAX_MACHINE_MODE; ++mode)
|
|
|
|
|
if (GET_MODE_CLASS (mode) == MODE_CC)
|
|
|
|
|
const_tiny_rtx[0][(int) mode] = const0_rtx;
|
1992-03-14 06:04:21 +01:00
|
|
|
|
|
1999-09-05 05:49:52 +02:00
|
|
|
|
ggc_add_rtx_root (&const_tiny_rtx[0][0], sizeof(const_tiny_rtx)/sizeof(rtx));
|
1999-09-07 17:20:58 +02:00
|
|
|
|
ggc_add_rtx_root (&const_true_rtx, 1);
|
1999-09-21 06:04:16 +02:00
|
|
|
|
|
|
|
|
|
#ifdef RETURN_ADDRESS_POINTER_REGNUM
|
|
|
|
|
return_address_pointer_rtx
|
|
|
|
|
= gen_rtx_raw_REG (Pmode, RETURN_ADDRESS_POINTER_REGNUM);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef STRUCT_VALUE
|
|
|
|
|
struct_value_rtx = STRUCT_VALUE;
|
|
|
|
|
#else
|
|
|
|
|
struct_value_rtx = gen_rtx_REG (Pmode, STRUCT_VALUE_REGNUM);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef STRUCT_VALUE_INCOMING
|
|
|
|
|
struct_value_incoming_rtx = STRUCT_VALUE_INCOMING;
|
|
|
|
|
#else
|
|
|
|
|
#ifdef STRUCT_VALUE_INCOMING_REGNUM
|
|
|
|
|
struct_value_incoming_rtx
|
|
|
|
|
= gen_rtx_REG (Pmode, STRUCT_VALUE_INCOMING_REGNUM);
|
|
|
|
|
#else
|
|
|
|
|
struct_value_incoming_rtx = struct_value_rtx;
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef STATIC_CHAIN_REGNUM
|
|
|
|
|
static_chain_rtx = gen_rtx_REG (Pmode, STATIC_CHAIN_REGNUM);
|
|
|
|
|
|
|
|
|
|
#ifdef STATIC_CHAIN_INCOMING_REGNUM
|
|
|
|
|
if (STATIC_CHAIN_INCOMING_REGNUM != STATIC_CHAIN_REGNUM)
|
|
|
|
|
static_chain_incoming_rtx
|
|
|
|
|
= gen_rtx_REG (Pmode, STATIC_CHAIN_INCOMING_REGNUM);
|
|
|
|
|
else
|
|
|
|
|
#endif
|
|
|
|
|
static_chain_incoming_rtx = static_chain_rtx;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef STATIC_CHAIN
|
|
|
|
|
static_chain_rtx = STATIC_CHAIN;
|
|
|
|
|
|
|
|
|
|
#ifdef STATIC_CHAIN_INCOMING
|
|
|
|
|
static_chain_incoming_rtx = STATIC_CHAIN_INCOMING;
|
|
|
|
|
#else
|
|
|
|
|
static_chain_incoming_rtx = static_chain_rtx;
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#ifdef PIC_OFFSET_TABLE_REGNUM
|
|
|
|
|
pic_offset_table_rtx = gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM);
|
|
|
|
|
#endif
|
|
|
|
|
|
1999-09-05 05:49:52 +02:00
|
|
|
|
ggc_add_rtx_root (&pic_offset_table_rtx, 1);
|
|
|
|
|
ggc_add_rtx_root (&struct_value_rtx, 1);
|
|
|
|
|
ggc_add_rtx_root (&struct_value_incoming_rtx, 1);
|
|
|
|
|
ggc_add_rtx_root (&static_chain_rtx, 1);
|
|
|
|
|
ggc_add_rtx_root (&static_chain_incoming_rtx, 1);
|
|
|
|
|
ggc_add_rtx_root (&return_address_pointer_rtx, 1);
|
1992-03-14 06:04:21 +01:00
|
|
|
|
}
|
1998-02-17 11:26:44 +01:00
|
|
|
|
|
|
|
|
|
/* Query and clear/ restore no_line_numbers. This is used by the
|
|
|
|
|
switch / case handling in stmt.c to give proper line numbers in
|
|
|
|
|
warnings about unreachable code. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
force_line_numbers ()
|
|
|
|
|
{
|
|
|
|
|
int old = no_line_numbers;
|
|
|
|
|
|
|
|
|
|
no_line_numbers = 0;
|
|
|
|
|
if (old)
|
|
|
|
|
force_next_line_note ();
|
|
|
|
|
return old;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
restore_line_number_status (old_value)
|
|
|
|
|
int old_value;
|
|
|
|
|
{
|
|
|
|
|
no_line_numbers = old_value;
|
|
|
|
|
}
|