aboutsummaryrefslogtreecommitdiff
path: root/gcc/profile.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/profile.c')
-rw-r--r--gcc/profile.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/gcc/profile.c b/gcc/profile.c
index 970eac5466e..ba8b3e10499 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -41,7 +41,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
achieve this, see Dain Sample's UC Berkeley thesis. */
#include "config.h"
-#include <stdio.h>
+#include "system.h"
#include "rtl.h"
#include "flags.h"
#include "insn-flags.h"
@@ -53,7 +53,6 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
#include "gcov-io.h"
extern char * xmalloc ();
-extern void free ();
/* One of these is dynamically created whenever we identify an arc in the
function. */
@@ -362,7 +361,7 @@ instrument_arcs (f, num_blocks, dump_file)
emit_barrier_after (arcptr->branch_insn);
/* Fix up the table jump. */
- new_lref = gen_rtx (LABEL_REF, Pmode, new_label);
+ new_lref = gen_rtx_LABEL_REF (Pmode, new_label);
XVECEXP (PATTERN (arcptr->branch_insn),
(code == ADDR_DIFF_VEC), index) = new_lref;
}
@@ -1134,8 +1133,8 @@ branch_prob (f, dump_file)
num_branches++;
REG_NOTES (arcptr->branch_insn)
- = gen_rtx (EXPR_LIST, REG_BR_PROB, GEN_INT (prob),
- REG_NOTES (arcptr->branch_insn));
+ = gen_rtx_EXPR_LIST (REG_BR_PROB, GEN_INT (prob),
+ REG_NOTES (arcptr->branch_insn));
}
}
@@ -1154,8 +1153,8 @@ branch_prob (f, dump_file)
else
{
REG_NOTES (binfo->first_insn)
- = gen_rtx (EXPR_LIST, REG_EXEC_COUNT, GEN_INT (total),
- REG_NOTES (binfo->first_insn));
+ = gen_rtx_EXPR_LIST (REG_EXEC_COUNT, GEN_INT (total),
+ REG_NOTES (binfo->first_insn));
if (i == num_blocks - 1)
return_label_execution_count = total;
}
@@ -1493,7 +1492,7 @@ init_arc_profiler ()
/* Generate and save a copy of this so it can be shared. */
char *name = xmalloc (20);
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 2);
- profiler_label = gen_rtx (SYMBOL_REF, Pmode, name);
+ profiler_label = gen_rtx_SYMBOL_REF (Pmode, name);
}
/* Output instructions as RTL to increment the arc execution count. */
@@ -1504,11 +1503,8 @@ output_arc_profiler (arcno, insert_after)
rtx insert_after;
{
rtx profiler_target_addr
- = (arcno
- ? gen_rtx (CONST, Pmode,
- gen_rtx (PLUS, Pmode, profiler_label,
- gen_rtx (CONST_INT, VOIDmode,
- LONG_TYPE_SIZE / BITS_PER_UNIT * arcno)))
+ = (arcno ? plus_constant (profiler_label,
+ LONG_TYPE_SIZE / BITS_PER_UNIT * arcno)
: profiler_label);
enum machine_mode mode = mode_for_size (LONG_TYPE_SIZE, MODE_INT, 0);
rtx profiler_reg = gen_reg_rtx (mode);
@@ -1564,14 +1560,14 @@ output_arc_profiler (arcno, insert_after)
start_sequence ();
emit_move_insn (address_reg, profiler_target_addr);
- mem_ref = gen_rtx (MEM, mode, address_reg);
+ mem_ref = gen_rtx_MEM (mode, address_reg);
emit_move_insn (profiler_reg, mem_ref);
- add_ref = gen_rtx (PLUS, mode, profiler_reg, GEN_INT (1));
+ add_ref = gen_rtx_PLUS (mode, profiler_reg, GEN_INT (1));
emit_move_insn (profiler_reg, add_ref);
/* This is the same rtx as above, but it is not legal to share this rtx. */
- mem_ref = gen_rtx (MEM, mode, address_reg);
+ mem_ref = gen_rtx_MEM (mode, address_reg);
emit_move_insn (mem_ref, profiler_reg);
sequence = gen_sequence ();
@@ -1633,8 +1629,8 @@ output_func_start_profiler ()
/* Actually generate the code to call __bb_init_func. */
name = xmalloc (20);
ASM_GENERATE_INTERNAL_LABEL (name, "LPBX", 0);
- table_address = force_reg (Pmode, gen_rtx (SYMBOL_REF, Pmode, name));
- emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__bb_init_func"), 0,
+ table_address = force_reg (Pmode, gen_rtx_SYMBOL_REF (Pmode, name));
+ emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__bb_init_func"), 0,
mode, 1, table_address, Pmode);
expand_function_end (input_filename, lineno, 0);