gcc/gcc/cselib.c

1872 lines
49 KiB
C
Raw Normal View History

/* Common subexpression elimination library for GNU compiler.
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008, 2009
re PR middle-end/31150 (Not promoting an whole array to be static const) PR middle-end/31150 * dse.c (struct store_info): Add const_rhs field. (clear_rhs_from_active_local_stores): Clear also const_rhs. (record_store): Try also cselib_expand_value_rtx to get a constant. (find_shift_sequence, get_stored_val): Use const_rhs instead of rhs if worthwhile. * cselib.c (cselib_record_sets): If !cselib_record_memory and there is just one set from read-only MEM, look at REG_EQUAL or REG_EQUIV note. * dse.c (struct store_info): Add redundant_reason field. (record_store): When storing the same constant as has been stored by an earlier store, set redundant_reason field to the earlier store's insn_info_t. Don't delete cannot_delete insns. (find_shift_sequence): Remove read_info argument, add read_mode and require_cst arguments. Return early if require_cst and constant wouldn't be returned. (get_stored_val): New function. (replace_read): Use it. (scan_insn): Put even cannot_delete insns with exactly 1 store into active_local_stores. (dse_step1): Don't delete cannot_delete insns. Remove redundant constant stores if contains_cselib_groups and earlier store storing the same value hasn't been eliminated. (dse_step6): Renamed to dse_step7. New function. (dse_step7): Renamed from dse_step6. (rest_of_handle_dse): Call dse_step6 and dse_step7 at the end. * cselib.c (cselib_expand_value_rtx): Don't wrap CONST_INTs into CONST unless really necessary. Handle SUBREG, unary, ternary, bitfield and compares specially, to be able to simplify operations on constants. (expand_loc): Try to optimize LO_SUM. * dse.c (get_call_args): New function. (scan_insn): Don't handle BUILT_IN_BZERO. For memset, attempt to get call arguments and if successful and both len and val are constants, handle the call as (mem:BLK) (const_int) store. * dse.c (struct store_info): Add is_large bool field, change positions_needed into a union of a bitmask and bitmap + count. (free_store_info): Free bitmap if is_large. (set_usage_bits): Don't look at stores where offset + width >= MAX_OFFSET. (set_position_unneeded, set_all_positions_unneeded, any_positions_needed_p, all_positions_needed_p): New static inline functions. (record_store): Handle BLKmode stores of CONST_INT, if MEM_SIZE is set on the MEM. Use the new positions_needed accessor inlines. (replace_read): Handle reads from BLKmode CONST_INT stores. (check_mem_read_rtx): Use all_positions_needed_p function. (dse_step1): Free large positions_needed bitmaps and clear is_large. * dse.c (struct store_info): Change begin and end types to HOST_WIDE_INT. * dse.c (record_store): Fix check for unused store. * expr.c (block_clear_fn): No longer static. * expr.h (block_clear_fn): Declare. * dse.c (scan_insn): Memset and bzero can just read their arguments. * gcc.c-torture/execute/20081218-1.c: New test. From-SVN: r142892
2008-12-23 00:41:17 +01:00
Free Software Foundation, Inc.
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
This file is part of GCC.
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
GCC 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 3, or (at your option) any later
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
version.
Makefile.in, [...]: replace "GNU CC" with "GCC". * Makefile.in, alias.c, basic-block.h, bb-reorder.c, bitmap.c, bitmap.h, builtin-types.def, builtins.c, builtins.def, c-aux-info.c, c-common.c, c-common.def, c-common.h, c-convert.c, c-decl.c, c-dump.c, c-dump.h, c-errors.c, c-format.c, c-lang.c, c-lex.c, c-lex.h, c-parse.in, c-pragma.c, c-pragma.h, c-semantics.c, c-tree.h, c-typeck.c, caller-save.c, calls.c, collect2.c, collect2.h, combine.c, conditions.h, config.gcc, configure.frag, configure.in, conflict.c, convert.c, convert.h, cppspec.c, crtstuff.c, cse.c, cselib.c, cselib.h, dbxout.c, dbxout.h, defaults.h, dependence.c, df.c, df.h, diagnostic.c, diagnostic.h, doloop.c, dominance.c, dwarf.h, dwarf2.h, dwarf2asm.c, dwarf2asm.h, dwarf2out.c, dwarf2out.h, dwarfout.c, emit-rtl.c, errors.c, errors.h, except.c, except.h, exgettext, explow.c, expmed.c, expr.c, expr.h, final.c, fixproto, flags.h, flow.c, fold-const.c, fp-test.c, function.c, function.h, gbl-ctors.h, gcc.c, gcc.h, gcc.hlp, gccspec.c, gcov-io.h, gcse.c, genattr.c, genattrtab.c, gencheck.c, gencodes.c, genconfig.c, genemit.c, genextract.c, genflags.c, gengenrtl.c, genmultilib, genopinit.c, genoutput.c, genpeep.c, genrecog.c, gensupport.c, gensupport.h, ggc-callbacks.c, ggc-common.c, ggc-none.c, ggc-page.c, ggc-simple.c, ggc.h, global.c, graph.c, graph.h, gthr-aix.h, gthr-dce.h, gthr-posix.h, gthr-rtems.h, gthr-single.h, gthr-solaris.h, gthr-vxworks.h, gthr-win32.h, gthr.h, haifa-sched.c, halfpic.c, halfpic.h, hard-reg-set.h, hwint.h, ifcvt.c, input.h, insn-addr.h, integrate.c, integrate.h, jump.c, lcm.c, libgcc2.c, libgcc2.h, lists.c, local-alloc.c, loop.c, loop.h, machmode.def, machmode.h, main.c, mbchar.c, mbchar.h, mips-tdump.c, mips-tfile.c, mklibgcc.in, mkmap-flat.awk, mkmap-symver.awk, optabs.c, output.h, params.c, params.def, params.h, predict.c, predict.def, predict.h, prefix.c, prefix.h, print-rtl.c, print-tree.c, profile.c, protoize.c, read-rtl.c, real.c, real.h, recog.c, recog.h, reg-stack.c, regclass.c, regmove.c, regrename.c, regs.h, reload.c, reload.h, reload1.c, reorg.c, resource.c, resource.h, rtl.c, rtl.def, rtl.h, rtlanal.c, sbitmap.c, sbitmap.h, sched-deps.c, sched-ebb.c, sched-int.h, sched-rgn.c, sched-vis.c, sdbout.c, sdbout.h, sibcall.c, simplify-rtx.c, ssa-ccp.c, ssa-dce.c, ssa.c, ssa.h, stmt.c, stor-layout.c, stringpool.c, system.h, timevar.c, timevar.def, timevar.h, tlink.c, toplev.c, toplev.h, tree.c, tree.def, tree.h, tsystem.h, unroll.c, unwind-dw2-fde.c, unwind-dw2-fde.h, unwind-dw2.c, unwind-pe.h, unwind-sjlj.c, unwind.h, unwind.inc, varasm.c, varray.c, varray.h, xcoffout.c, xcoffout.h: replace "GNU CC" with "GCC". From-SVN: r45105
2001-08-22 16:35:51 +02:00
GCC 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 GCC; see the file COPYING3. If not see
<http://www.gnu.org/licenses/>. */
#include "config.h"
#include "system.h"
#include "coretypes.h"
#include "tm.h"
#include "rtl.h"
#include "tm_p.h"
#include "regs.h"
#include "hard-reg-set.h"
#include "flags.h"
#include "real.h"
#include "insn-config.h"
#include "recog.h"
#include "function.h"
#include "emit-rtl.h"
#include "toplev.h"
#include "output.h"
#include "ggc.h"
#include "hashtab.h"
#include "cselib.h"
#include "params.h"
#include "alloc-pool.h"
#include "target.h"
static bool cselib_record_memory;
static int entry_and_rtx_equal_p (const void *, const void *);
static hashval_t get_value_hash (const void *);
static struct elt_list *new_elt_list (struct elt_list *, cselib_val *);
static struct elt_loc_list *new_elt_loc_list (struct elt_loc_list *, rtx);
static void unchain_one_value (cselib_val *);
static void unchain_one_elt_list (struct elt_list **);
static void unchain_one_elt_loc_list (struct elt_loc_list **);
static int discard_useless_locs (void **, void *);
static int discard_useless_values (void **, void *);
static void remove_useless_values (void);
static rtx wrap_constant (enum machine_mode, rtx);
static unsigned int cselib_hash_rtx (rtx, int);
static cselib_val *new_cselib_val (unsigned int, enum machine_mode);
static void add_mem_for_addr (cselib_val *, cselib_val *, rtx);
static cselib_val *cselib_lookup_mem (rtx, int);
static void cselib_invalidate_regno (unsigned int, enum machine_mode);
static void cselib_invalidate_mem (rtx);
static void cselib_record_set (rtx, cselib_val *, cselib_val *);
static void cselib_record_sets (rtx);
/* There are three ways in which cselib can look up an rtx:
- for a REG, the reg_values table (which is indexed by regno) is used
- for a MEM, we recursively look up its address and then follow the
addr_list of that value
- for everything else, we compute a hash value and go through the hash
table. Since different rtx's can still have the same hash value,
this involves walking the table entries for a given value and comparing
the locations of the entries with the rtx we are looking up. */
/* A table that enables us to look up elts by their value. */
static htab_t cselib_hash_table;
/* This is a global so we don't have to pass this through every function.
It is used in new_elt_loc_list to set SETTING_INSN. */
static rtx cselib_current_insn;
/* Every new unknown value gets a unique number. */
static unsigned int next_unknown_value;
/* The number of registers we had when the varrays were last resized. */
static unsigned int cselib_nregs;
/* Count values without known locations. Whenever this grows too big, we
remove these useless values from the table. */
static int n_useless_values;
/* Number of useless values before we remove them from the hash table. */
#define MAX_USELESS_VALUES 32
/* This table maps from register number to values. It does not
contain pointers to cselib_val structures, but rather elt_lists.
The purpose is to be able to refer to the same register in
different modes. The first element of the list defines the mode in
which the register was set; if the mode is unknown or the value is
no longer valid in that mode, ELT will be NULL for the first
element. */
static struct elt_list **reg_values;
static unsigned int reg_values_size;
#define REG_VALUES(i) reg_values[i]
/* The largest number of hard regs used by any entry added to the
REG_VALUES table. Cleared on each cselib_clear_table() invocation. */
static unsigned int max_value_regs;
/* Here the set of indices I with REG_VALUES(I) != 0 is saved. This is used
in cselib_clear_table() for fast emptying. */
static unsigned int *used_regs;
static unsigned int n_used_regs;
/* We pass this to cselib_invalidate_mem to invalidate all of
memory for a non-const call instruction. */
static GTY(()) rtx callmem;
/* Set by discard_useless_locs if it deleted the last location of any
value. */
static int values_became_useless;
/* Used as stop element of the containing_mem list so we can check
presence in the list by checking the next pointer. */
static cselib_val dummy_val;
/* Used to list all values that contain memory reference.
May or may not contain the useless values - the list is compacted
each time memory is invalidated. */
static cselib_val *first_containing_mem = &dummy_val;
static alloc_pool elt_loc_list_pool, elt_list_pool, cselib_val_pool, value_pool;
/* If nonnull, cselib will call this function before freeing useless
VALUEs. A VALUE is deemed useless if its "locs" field is null. */
void (*cselib_discard_hook) (cselib_val *);
/* Allocate a struct elt_list and fill in its two elements with the
arguments. */
static inline struct elt_list *
new_elt_list (struct elt_list *next, cselib_val *elt)
{
struct elt_list *el;
alias.c (record_alias_subset, [...]): Fix -Wc++-compat and/or -Wcast-qual warnings. * alias.c (record_alias_subset, init_alias_analysis): Fix -Wc++-compat and/or -Wcast-qual warnings. * attribs.c (lookup_attribute_spec): Likewise. * bb-reorder.c (find_traces, rotate_loop, find_traces_1_round, copy_bb, connect_traces, find_rarely_executed_basic_blocks_and_cr): Likewise. * bt-load.c (find_btr_def_group, add_btr_def, new_btr_user, note_btr_set, migrate_btr_defs): Likewise. * builtins.c (result_vector, expand_builtin_memcpy, expand_builtin_mempcpy_args, expand_builtin_strncpy, builtin_memset_read_str, expand_builtin_printf, fold_builtin_memchr, rewrite_call_expr, fold_builtin_printf): Likewise. * caller-save.c (mark_set_regs): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cgraph.c (cgraph_edge): Likewise. * combine.c (likely_spilled_retval_1): Likewise. * coverage.c (htab_counts_entry_hash, htab_counts_entry_eq, htab_counts_entry_del, get_coverage_counts): Likewise. * cselib.c (new_elt_list, new_elt_loc_list, entry_and_rtx_equal_p, new_cselib_val): Likewise. * dbgcnt.c (dbg_cnt_process_opt): Likewise. * dbxout.c (dbxout_init, dbxout_type, output_used_types_helper): Likewise. * df-core.c (df_compact_blocks): Likewise. * df-problems.c (df_grow_bb_info, df_chain_create): Likewise. * df-scan.c (df_grow_reg_info, df_ref_create, df_insn_create_insn_record, df_insn_rescan, df_notes_rescan, df_ref_compare, df_ref_create_structure, df_bb_refs_record, df_record_entry_block_defs, df_record_exit_block_uses, df_bb_verify): Likewise. * df.h (DF_REF_EXTRACT_WIDTH_CONST, DF_REF_EXTRACT_OFFSET_CONST, DF_REF_EXTRACT_MODE_CONST): New. * dominance.c (get_immediate_dominator, get_dominated_by, nearest_common_dominator, root_of_dom_tree, iterate_fix_dominators, first_dom_son, next_dom_son): Fix -Wc++-compat and/or -Wcast-qual warnings. * dse.c (clear_alias_set_lookup, get_group_info, gen_rtx_MEM, record_store, replace_read, check_mem_read_rtx, scan_insn, dse_step1, dse_record_singleton_alias_set): Likewise. * dwarf2asm.c (dw2_force_const_mem): Likewise. From-SVN: r137137
2008-06-26 02:28:15 +02:00
el = (struct elt_list *) pool_alloc (elt_list_pool);
el->next = next;
el->elt = elt;
return el;
}
/* Allocate a struct elt_loc_list and fill in its two elements with the
arguments. */
static inline struct elt_loc_list *
new_elt_loc_list (struct elt_loc_list *next, rtx loc)
{
struct elt_loc_list *el;
alias.c (record_alias_subset, [...]): Fix -Wc++-compat and/or -Wcast-qual warnings. * alias.c (record_alias_subset, init_alias_analysis): Fix -Wc++-compat and/or -Wcast-qual warnings. * attribs.c (lookup_attribute_spec): Likewise. * bb-reorder.c (find_traces, rotate_loop, find_traces_1_round, copy_bb, connect_traces, find_rarely_executed_basic_blocks_and_cr): Likewise. * bt-load.c (find_btr_def_group, add_btr_def, new_btr_user, note_btr_set, migrate_btr_defs): Likewise. * builtins.c (result_vector, expand_builtin_memcpy, expand_builtin_mempcpy_args, expand_builtin_strncpy, builtin_memset_read_str, expand_builtin_printf, fold_builtin_memchr, rewrite_call_expr, fold_builtin_printf): Likewise. * caller-save.c (mark_set_regs): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cgraph.c (cgraph_edge): Likewise. * combine.c (likely_spilled_retval_1): Likewise. * coverage.c (htab_counts_entry_hash, htab_counts_entry_eq, htab_counts_entry_del, get_coverage_counts): Likewise. * cselib.c (new_elt_list, new_elt_loc_list, entry_and_rtx_equal_p, new_cselib_val): Likewise. * dbgcnt.c (dbg_cnt_process_opt): Likewise. * dbxout.c (dbxout_init, dbxout_type, output_used_types_helper): Likewise. * df-core.c (df_compact_blocks): Likewise. * df-problems.c (df_grow_bb_info, df_chain_create): Likewise. * df-scan.c (df_grow_reg_info, df_ref_create, df_insn_create_insn_record, df_insn_rescan, df_notes_rescan, df_ref_compare, df_ref_create_structure, df_bb_refs_record, df_record_entry_block_defs, df_record_exit_block_uses, df_bb_verify): Likewise. * df.h (DF_REF_EXTRACT_WIDTH_CONST, DF_REF_EXTRACT_OFFSET_CONST, DF_REF_EXTRACT_MODE_CONST): New. * dominance.c (get_immediate_dominator, get_dominated_by, nearest_common_dominator, root_of_dom_tree, iterate_fix_dominators, first_dom_son, next_dom_son): Fix -Wc++-compat and/or -Wcast-qual warnings. * dse.c (clear_alias_set_lookup, get_group_info, gen_rtx_MEM, record_store, replace_read, check_mem_read_rtx, scan_insn, dse_step1, dse_record_singleton_alias_set): Likewise. * dwarf2asm.c (dw2_force_const_mem): Likewise. From-SVN: r137137
2008-06-26 02:28:15 +02:00
el = (struct elt_loc_list *) pool_alloc (elt_loc_list_pool);
el->next = next;
el->loc = loc;
el->setting_insn = cselib_current_insn;
return el;
}
/* The elt_list at *PL is no longer needed. Unchain it and free its
storage. */
static inline void
unchain_one_elt_list (struct elt_list **pl)
{
struct elt_list *l = *pl;
*pl = l->next;
pool_free (elt_list_pool, l);
}
/* Likewise for elt_loc_lists. */
static void
unchain_one_elt_loc_list (struct elt_loc_list **pl)
{
struct elt_loc_list *l = *pl;
*pl = l->next;
pool_free (elt_loc_list_pool, l);
}
/* Likewise for cselib_vals. This also frees the addr_list associated with
V. */
static void
unchain_one_value (cselib_val *v)
{
while (v->addr_list)
unchain_one_elt_list (&v->addr_list);
pool_free (cselib_val_pool, v);
}
/* Remove all entries from the hash table. Also used during
initialization. If CLEAR_ALL isn't set, then only clear the entries
which are known to have been used. */
void
cselib_clear_table (void)
{
unsigned int i;
for (i = 0; i < n_used_regs; i++)
REG_VALUES (used_regs[i]) = 0;
max_value_regs = 0;
n_used_regs = 0;
htab_empty (cselib_hash_table);
n_useless_values = 0;
next_unknown_value = 0;
first_containing_mem = &dummy_val;
}
/* The equality test for our hash table. The first argument ENTRY is a table
element (i.e. a cselib_val), while the second arg X is an rtx. We know
that all callers of htab_find_slot_with_hash will wrap CONST_INTs into a
CONST of an appropriate mode. */
static int
entry_and_rtx_equal_p (const void *entry, const void *x_arg)
{
struct elt_loc_list *l;
const cselib_val *const v = (const cselib_val *) entry;
alias.c (record_alias_subset, [...]): Fix -Wc++-compat and/or -Wcast-qual warnings. * alias.c (record_alias_subset, init_alias_analysis): Fix -Wc++-compat and/or -Wcast-qual warnings. * attribs.c (lookup_attribute_spec): Likewise. * bb-reorder.c (find_traces, rotate_loop, find_traces_1_round, copy_bb, connect_traces, find_rarely_executed_basic_blocks_and_cr): Likewise. * bt-load.c (find_btr_def_group, add_btr_def, new_btr_user, note_btr_set, migrate_btr_defs): Likewise. * builtins.c (result_vector, expand_builtin_memcpy, expand_builtin_mempcpy_args, expand_builtin_strncpy, builtin_memset_read_str, expand_builtin_printf, fold_builtin_memchr, rewrite_call_expr, fold_builtin_printf): Likewise. * caller-save.c (mark_set_regs): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cgraph.c (cgraph_edge): Likewise. * combine.c (likely_spilled_retval_1): Likewise. * coverage.c (htab_counts_entry_hash, htab_counts_entry_eq, htab_counts_entry_del, get_coverage_counts): Likewise. * cselib.c (new_elt_list, new_elt_loc_list, entry_and_rtx_equal_p, new_cselib_val): Likewise. * dbgcnt.c (dbg_cnt_process_opt): Likewise. * dbxout.c (dbxout_init, dbxout_type, output_used_types_helper): Likewise. * df-core.c (df_compact_blocks): Likewise. * df-problems.c (df_grow_bb_info, df_chain_create): Likewise. * df-scan.c (df_grow_reg_info, df_ref_create, df_insn_create_insn_record, df_insn_rescan, df_notes_rescan, df_ref_compare, df_ref_create_structure, df_bb_refs_record, df_record_entry_block_defs, df_record_exit_block_uses, df_bb_verify): Likewise. * df.h (DF_REF_EXTRACT_WIDTH_CONST, DF_REF_EXTRACT_OFFSET_CONST, DF_REF_EXTRACT_MODE_CONST): New. * dominance.c (get_immediate_dominator, get_dominated_by, nearest_common_dominator, root_of_dom_tree, iterate_fix_dominators, first_dom_son, next_dom_son): Fix -Wc++-compat and/or -Wcast-qual warnings. * dse.c (clear_alias_set_lookup, get_group_info, gen_rtx_MEM, record_store, replace_read, check_mem_read_rtx, scan_insn, dse_step1, dse_record_singleton_alias_set): Likewise. * dwarf2asm.c (dw2_force_const_mem): Likewise. From-SVN: r137137
2008-06-26 02:28:15 +02:00
rtx x = CONST_CAST_RTX ((const_rtx)x_arg);
enum machine_mode mode = GET_MODE (x);
gcc_assert (!CONST_INT_P (x) && GET_CODE (x) != CONST_FIXED
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
&& (mode != VOIDmode || GET_CODE (x) != CONST_DOUBLE));
if (mode != GET_MODE (v->val_rtx))
return 0;
/* Unwrap X if necessary. */
if (GET_CODE (x) == CONST
&& (CONST_INT_P (XEXP (x, 0))
rtl.c (rtx_code_size): Check CONST_FIXED to calcualte correct sizes in DEF_RTL_EXPR. * rtl.c (rtx_code_size): Check CONST_FIXED to calcualte correct sizes in DEF_RTL_EXPR. (copy_rtx): Handle CONST_FIXED. (rtx_equal_p): Likewise. * rtl.h (fixed_value.h): New include. (rtx_def): Add a new field of fixed_value to u. (XCNMPFV): Define for accessing fixed_value. (CONST_FIXED_VALUE, CONST_FIXED_VALUE_HIGH, CONST_FIXED_VALUE_LOW): Define. * rtl.def (CONST_FIXED): New constant. (SS_MULT, US_MULT, SS_DIV, US_DIV, FRACT_CONVERT, UNSIGNED_FRACT_CONVERT, SAT_FRACT, UNSIGNED_SAT_FRACT, US_NEG, US_ASHIFT): New codes. * doc/rtl.texi (Expressions): Document const_fixed, us_neg, ss_mult, us_mult, ss_div, us_div, us_ashift, fract_convert, sat_fract, unsigned_fract_convert, unsigned_sat_fract): Document them. * varasm.c (assemble_integer): Extend to support fixed-point constants by using different machine classes. (decode_addr_const): Handle FIXED_CST. (const_hash_1): Likewise. (compare_constant): Likewise. (copy_constant): Likewise. (const_rtx_hash_1): Handle CONST_FIXED. (output_constant_pool_2): Handle MODE_FRACT, MODE_UFRACT, MODE_ACCUM, MODE_UACCUM, MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (initializer_constant_valid_p): Handle FIXED_CST. (output_constant): Support FIXED_POINT_TYPE. * gengenrtl.c (excluded_rtx): Check CONST_FIXED to exclude. * cse.c (hash_rtx): Support CONST_FIXED. (exp_equiv_p): Likewise. (cannon_reg): Likewise. (fold_rtx): Likewise. (equiv_constant): Likewise. (cse_process_notes_1): Likewise. (count_reg_usage): Likewise. * cselib.c (entry_and_rtx_equal_p): Check CONST_FIXED. (rtx_equal_for_cselib_p): Handle CONST_FIXED. (wrap_constant): Check CONST_FIXED. (cselib_hash_rtx): Support CONST_FIXED. (cselib_subst_to_values): Likewise. * df-scan.c (df_uses_record): Likewise. * gcse.c (want_to_gcse_p): Likewise. (oprs_unchanged_p): Likewise. (oprs_not_set_p): Likewise. (compute_transp): Likewise. (extract_mentioned_regs_helper): Likewise. * genemit.c (gen_exp): Likewise. * local-alloc.c (equiv_init_varies_p): Likewise. (contains_replace_regs): Likewise. (memref_referenced_p): Likewise. * loop-invariant.c (check_maybe_invariant): Likewise. (hash_invariant_expr_1): Likewise. (invariant_expr_equal_p): Likewise. * postreload-gcse.c (oprs_unchanged_p): Likewise. * regclass.c (reg_scan_mark_refs): Likewise. * regrename.c (scan_rtx): Likewise. * resource.c (mark_referenced_resources): Likewise. (mark_set_resources): Likewise. * rtlanal.c (rtx_unstable_p): Likewise. (rtx_varies_p): Likewise. (count_occurrences): Likewise. (reg_mentioned_p): Likewise. (modified_between_p): Likewise. (modified_in_p): Likewise. (volatile_insn_p): Likewise. (volatile_refs_p): Likewise. (side_effects_p): Likewise. (may_trap_p_1): Likewise. (inequality_comparisons_p): Likewise. (computed_jump_p_1): Likewise. (commutative_operand_precedence): Likewise. * sched-deps.c (sched_analyze_2): Likewise. * sched-vis.c (print_value): Likewise. * reload.c (operands_match_p): Likewise. (subst_reg_equivs): Likewise. * reload1.c (eliminate_regs_1): Likewise. (elimination_effects): Likewise. (scan_paradoxical_subregs): Likewise. * alias.c (rtx_equal_for_memref_p): Likewise. * Makefile.in (RTL_BASE_H): Add fixed-value.h. * emit-rtl.c (const_fixed_htab): New hash table. (const_fixed_htab_hash, const_fixed_htab_eq, lookup_const_fixed): Declare. (const_fixed_htab_hash, const_fixed_htab_eq, lookup_const_fixed, const_fixed_from_fixed_value): New functions. (verify_rtx_sharing): Handle CONST_FIXED. (copy_rtx_if_shared_1): Likewise. (reset_used_flags): Likewise. (set_used_flags): Likewise. (copy_insn_1): Likewise. (init_emit_once): Create const_fixed_htab. Store fixed-point scalar and vector zero and one to const_tiny_rtx. From-SVN: r127725
2007-08-23 02:30:39 +02:00
|| GET_CODE (XEXP (x, 0)) == CONST_FIXED
|| GET_CODE (XEXP (x, 0)) == CONST_DOUBLE))
x = XEXP (x, 0);
/* We don't guarantee that distinct rtx's have different hash values,
so we need to do a comparison. */
for (l = v->locs; l; l = l->next)
if (rtx_equal_for_cselib_p (l->loc, x))
return 1;
return 0;
}
/* The hash function for our hash table. The value is always computed with
Makefile.in (OBJS-common): Add postreload-gcse.c. * Makefile.in (OBJS-common): Add postreload-gcse.c. Add new postreload-gcse.o. * cse.c (SAFE_HASH): Define as wrapper around safe_hash. (lookup_as_function, insert, rehash_using_reg, use_related_value, equiv_constant): Use SAFE_HASH instead of safe_hash. (exp_equiv_p): Export. Add for_gcse argument when comparing for GCSE. (lookup, lookup_for_remove, merge_equiv_classes, find_best_addr, find_comparison_args, fold_rtx, cse_insn): Update callers. (hash_rtx): New function derived from old canon_hash and bits from gcse.c hash_expr_1. (canon_hash_string): Rename to hash_rtx_string. (canon_hash, safe_hash): Make static inline. Call hash_rtx. * cselib.c (hash_rtx): Rename to cselib_hash_rtx. (cselib_lookup): Update this caller. * gcse.c (modify_mem_list_set, canon_modify_mem_list_set): Make static. (hash_expr): Call hash_rtx. (ldst_entry): Likewise. (expr_equiv_p): Call exp_equiv_p. (struct unoccr, hash_expr_1, hash_string_1, lookup_expr, reg_used_on_edge, reg_set_between_after_reload_p, reg_used_between_after_reload_p, get_avail_load_store_reg, is_jump_table_basic_block, bb_has_well_behaved_predecessors, get_bb_avail_insn, hash_scan_set_after_reload, compute_hash_table_after_reload, eliminate_partially_redundant_loads, gcse_after_reload, get_bb_avail_insn, gcse_after_reload_main): Remove. * postreload-gcse.c: New file, reincarnating most of the above. * rtl.h (exp_equiv_p, hash_rtx): New prototypes. (gcse_after_reload_main): Update prototype. * timevar.def (TV_GCSE_AFTER_RELOAD): New timevar. * passes.c (rest_of_handle_gcse2): Use it. From-SVN: r86206
2004-08-18 22:53:59 +02:00
cselib_hash_rtx when adding an element; this function just extracts the
hash value from a cselib_val structure. */
static hashval_t
get_value_hash (const void *entry)
{
alias.c (mems_in_disjoint_alias_sets_p, [...]): Constify. * alias.c (mems_in_disjoint_alias_sets_p, fixed_scalar_and_varying_struct_p, aliases_everything_p, nonoverlapping_component_refs_p, nonoverlapping_memrefs_p, write_dependence_p, mems_in_disjoint_alias_sets_p, read_dependence, true_dependence, canon_true_dependence, anti_dependence, output_dependence): Constify. * combine.c (extended_count): Likewise. * cse.c (cse_rtx_varies_p, hash_rtx, exp_equiv_p): Likewise. * cselib.c (get_value_hash, references_value_p, cselib_reg_set_mode, cselib_rtx_varies_p): Likewise. * cselib.h (cselib_reg_set_mode, references_value_p): Likewise. * emit-rtl.c (mem_expr_equal_p, active_insn_p): Likewise. * function.c (contains, prologue_epilogue_contains, sibcall_epilogue_contains): Likewise. * jump.c (simplejump_p, condjump_p, condjump_in_parallel_p, pc_set, any_uncondjump_p, any_condjump_p, onlyjump_p, only_sets_cc0_p, sets_cc0_p, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * recog.c (asm_noperands): Likewise. * reload1.c (function_invariant_p): Likewise. * rtl.h (mem_expr_equal_p, active_insn_p, rtx_varies_p, rtx_addr_varies_p, asm_noperands, exp_equiv_p, hash_rtx, condjump_p, any_condjump_p, any_uncondjump_p, pc_set, simplejump_p, onlyjump_p, only_sets_cc0_p, sets_cc0_p, true_regnum, reg_or_subregno, condjump_in_parallel_p, extended_count, prologue_epilogue_contains, sibcall_epilogue_contains, function_invariant_p, true_dependence, canon_true_dependence, read_dependence, anti_dependence, output_dependence): Likewise. * rtlanal.c (rtx_varies_p, rtx_addr_varies_p): Likewise. java: * jcf-io.c (find_class): Fix -Wcast-qual warnings. From-SVN: r127063
2007-07-30 17:35:02 +02:00
const cselib_val *const v = (const cselib_val *) entry;
return v->value;
}
/* Return true if X contains a VALUE rtx. If ONLY_USELESS is set, we
only return true for values which point to a cselib_val whose value
element has been set to zero, which implies the cselib_val will be
removed. */
int
alias.c (mems_in_disjoint_alias_sets_p, [...]): Constify. * alias.c (mems_in_disjoint_alias_sets_p, fixed_scalar_and_varying_struct_p, aliases_everything_p, nonoverlapping_component_refs_p, nonoverlapping_memrefs_p, write_dependence_p, mems_in_disjoint_alias_sets_p, read_dependence, true_dependence, canon_true_dependence, anti_dependence, output_dependence): Constify. * combine.c (extended_count): Likewise. * cse.c (cse_rtx_varies_p, hash_rtx, exp_equiv_p): Likewise. * cselib.c (get_value_hash, references_value_p, cselib_reg_set_mode, cselib_rtx_varies_p): Likewise. * cselib.h (cselib_reg_set_mode, references_value_p): Likewise. * emit-rtl.c (mem_expr_equal_p, active_insn_p): Likewise. * function.c (contains, prologue_epilogue_contains, sibcall_epilogue_contains): Likewise. * jump.c (simplejump_p, condjump_p, condjump_in_parallel_p, pc_set, any_uncondjump_p, any_condjump_p, onlyjump_p, only_sets_cc0_p, sets_cc0_p, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * recog.c (asm_noperands): Likewise. * reload1.c (function_invariant_p): Likewise. * rtl.h (mem_expr_equal_p, active_insn_p, rtx_varies_p, rtx_addr_varies_p, asm_noperands, exp_equiv_p, hash_rtx, condjump_p, any_condjump_p, any_uncondjump_p, pc_set, simplejump_p, onlyjump_p, only_sets_cc0_p, sets_cc0_p, true_regnum, reg_or_subregno, condjump_in_parallel_p, extended_count, prologue_epilogue_contains, sibcall_epilogue_contains, function_invariant_p, true_dependence, canon_true_dependence, read_dependence, anti_dependence, output_dependence): Likewise. * rtlanal.c (rtx_varies_p, rtx_addr_varies_p): Likewise. java: * jcf-io.c (find_class): Fix -Wcast-qual warnings. From-SVN: r127063
2007-07-30 17:35:02 +02:00
references_value_p (const_rtx x, int only_useless)
{
alias.c (mems_in_disjoint_alias_sets_p, [...]): Constify. * alias.c (mems_in_disjoint_alias_sets_p, fixed_scalar_and_varying_struct_p, aliases_everything_p, nonoverlapping_component_refs_p, nonoverlapping_memrefs_p, write_dependence_p, mems_in_disjoint_alias_sets_p, read_dependence, true_dependence, canon_true_dependence, anti_dependence, output_dependence): Constify. * combine.c (extended_count): Likewise. * cse.c (cse_rtx_varies_p, hash_rtx, exp_equiv_p): Likewise. * cselib.c (get_value_hash, references_value_p, cselib_reg_set_mode, cselib_rtx_varies_p): Likewise. * cselib.h (cselib_reg_set_mode, references_value_p): Likewise. * emit-rtl.c (mem_expr_equal_p, active_insn_p): Likewise. * function.c (contains, prologue_epilogue_contains, sibcall_epilogue_contains): Likewise. * jump.c (simplejump_p, condjump_p, condjump_in_parallel_p, pc_set, any_uncondjump_p, any_condjump_p, onlyjump_p, only_sets_cc0_p, sets_cc0_p, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * recog.c (asm_noperands): Likewise. * reload1.c (function_invariant_p): Likewise. * rtl.h (mem_expr_equal_p, active_insn_p, rtx_varies_p, rtx_addr_varies_p, asm_noperands, exp_equiv_p, hash_rtx, condjump_p, any_condjump_p, any_uncondjump_p, pc_set, simplejump_p, onlyjump_p, only_sets_cc0_p, sets_cc0_p, true_regnum, reg_or_subregno, condjump_in_parallel_p, extended_count, prologue_epilogue_contains, sibcall_epilogue_contains, function_invariant_p, true_dependence, canon_true_dependence, read_dependence, anti_dependence, output_dependence): Likewise. * rtlanal.c (rtx_varies_p, rtx_addr_varies_p): Likewise. java: * jcf-io.c (find_class): Fix -Wcast-qual warnings. From-SVN: r127063
2007-07-30 17:35:02 +02:00
const enum rtx_code code = GET_CODE (x);
const char *fmt = GET_RTX_FORMAT (code);
int i, j;
if (GET_CODE (x) == VALUE
&& (! only_useless || CSELIB_VAL_PTR (x)->locs == 0))
return 1;
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
{
if (fmt[i] == 'e' && references_value_p (XEXP (x, i), only_useless))
return 1;
else if (fmt[i] == 'E')
for (j = 0; j < XVECLEN (x, i); j++)
if (references_value_p (XVECEXP (x, i, j), only_useless))
return 1;
}
return 0;
}
/* For all locations found in X, delete locations that reference useless
values (i.e. values without any location). Called through
htab_traverse. */
static int
discard_useless_locs (void **x, void *info ATTRIBUTE_UNUSED)
{
cselib_val *v = (cselib_val *)*x;
struct elt_loc_list **p = &v->locs;
int had_locs = v->locs != 0;
while (*p)
{
if (references_value_p ((*p)->loc, 1))
unchain_one_elt_loc_list (p);
else
p = &(*p)->next;
}
if (had_locs && v->locs == 0)
{
n_useless_values++;
values_became_useless = 1;
}
return 1;
}
/* If X is a value with no locations, remove it from the hashtable. */
static int
discard_useless_values (void **x, void *info ATTRIBUTE_UNUSED)
{
cselib_val *v = (cselib_val *)*x;
if (v->locs == 0)
{
if (cselib_discard_hook)
cselib_discard_hook (v);
CSELIB_VAL_PTR (v->val_rtx) = NULL;
htab_clear_slot (cselib_hash_table, x);
unchain_one_value (v);
n_useless_values--;
}
return 1;
}
/* Clean out useless values (i.e. those which no longer have locations
associated with them) from the hash table. */
static void
remove_useless_values (void)
{
cselib_val **p, *v;
/* First pass: eliminate locations that reference the value. That in
turn can make more values useless. */
do
{
values_became_useless = 0;
htab_traverse (cselib_hash_table, discard_useless_locs, 0);
}
while (values_became_useless);
/* Second pass: actually remove the values. */
p = &first_containing_mem;
for (v = *p; v != &dummy_val; v = v->next_containing_mem)
if (v->locs)
{
*p = v;
p = &(*p)->next_containing_mem;
}
*p = &dummy_val;
htab_traverse (cselib_hash_table, discard_useless_values, 0);
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
gcc_assert (!n_useless_values);
}
/* Return the mode in which a register was last set. If X is not a
register, return its mode. If the mode in which the register was
set is not known, or the value was already clobbered, return
VOIDmode. */
enum machine_mode
alias.c (mems_in_disjoint_alias_sets_p, [...]): Constify. * alias.c (mems_in_disjoint_alias_sets_p, fixed_scalar_and_varying_struct_p, aliases_everything_p, nonoverlapping_component_refs_p, nonoverlapping_memrefs_p, write_dependence_p, mems_in_disjoint_alias_sets_p, read_dependence, true_dependence, canon_true_dependence, anti_dependence, output_dependence): Constify. * combine.c (extended_count): Likewise. * cse.c (cse_rtx_varies_p, hash_rtx, exp_equiv_p): Likewise. * cselib.c (get_value_hash, references_value_p, cselib_reg_set_mode, cselib_rtx_varies_p): Likewise. * cselib.h (cselib_reg_set_mode, references_value_p): Likewise. * emit-rtl.c (mem_expr_equal_p, active_insn_p): Likewise. * function.c (contains, prologue_epilogue_contains, sibcall_epilogue_contains): Likewise. * jump.c (simplejump_p, condjump_p, condjump_in_parallel_p, pc_set, any_uncondjump_p, any_condjump_p, onlyjump_p, only_sets_cc0_p, sets_cc0_p, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * recog.c (asm_noperands): Likewise. * reload1.c (function_invariant_p): Likewise. * rtl.h (mem_expr_equal_p, active_insn_p, rtx_varies_p, rtx_addr_varies_p, asm_noperands, exp_equiv_p, hash_rtx, condjump_p, any_condjump_p, any_uncondjump_p, pc_set, simplejump_p, onlyjump_p, only_sets_cc0_p, sets_cc0_p, true_regnum, reg_or_subregno, condjump_in_parallel_p, extended_count, prologue_epilogue_contains, sibcall_epilogue_contains, function_invariant_p, true_dependence, canon_true_dependence, read_dependence, anti_dependence, output_dependence): Likewise. * rtlanal.c (rtx_varies_p, rtx_addr_varies_p): Likewise. java: * jcf-io.c (find_class): Fix -Wcast-qual warnings. From-SVN: r127063
2007-07-30 17:35:02 +02:00
cselib_reg_set_mode (const_rtx x)
{
alias.c (record_set, [...]): Use REG_P. 2004-06-15 Jerry Quinn <jlquinn@optonline.net> * alias.c (record_set, record_base_value, canon_rtx, get_addr, nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P. * bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set): Likewise. * builtins.c (expand_builtin_setjmp, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp, expand_builtin_strcmp, expand_builtin_strncmp, expand_builtin_frame_address): Likewise. * caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs, insert_one_insn): Likewise. * calls.c (prepare_call_address, precompute_register_parameters, precompute_arguments, expand_call, emit_library_call_value_1): Likewise. * cfganal.c (flow_active_insn_p): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, can_combine_p, combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, make_extraction, recog_for_combine, gen_lowpart_for_combine, simplify_comparison, record_dead_and_set_regs_1, record_dead_and_set_regs, record_promoted_value, check_promoted_subreg, get_last_value_validate, get_last_value, reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes, unmentioned_reg_p_1): Likewise. * conflict.c (mark_reg): Likewise. * cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost, mention_regs, insert_regs, lookup, lookup_for_remove, insert, merge_equiv_classes, flush_hash_table, invalidate, remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg, invalidate_for_call, use_related_value, canon_hash, exp_equiv_p, cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant, record_jump_cond, cse_insn, addr_affects_sp_p, invalidate_from_clobbers, cse_process_notes, cse_around_loop, cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p, cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms, dbxout_block): Likewise. * df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise. * dojump.c (do_jump): Likewise. * dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg, is_based_loc, rtl_for_decl_location): Likewise. * emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl, set_decl_incoming_rtl, mark_user_reg): Likewise. * explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg, copy_to_suggested_reg, allocate_dynamic_stack_space, probe_stack_range, hard_function_value): Likewise. * expmed.c (store_bit_field, store_fixed_bit_field, store_split_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_divmod, emit_store_flag_force): Likewise. * expr.c (convert_move, convert_modes, block_move_libcall_safe_for_call_parm, emit_group_load, use_reg, use_group_regs, emit_move_insn, emit_move_insn_1, compress_float_constant, push_block, emit_single_push_insn, emit_push_insn, get_subtarget, expand_assignment, store_expr, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment, do_store_flag, do_tablejump): Likewise. * final.c (profile_function, final_scan_insn, alter_subreg, get_mem_expr_from_op, output_asm_operand_names, output_operand, only_leaf_regs_used, leaf_renumber_regs_insn): Likewise. * flow.c (verify_wide_reg_1, mark_regs_live_at_end, find_regno_partial, propagate_one_insn, init_propagate_block_info, insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond, attempt_auto_inc, find_auto_inc, mark_used_regs, count_or_remove_death_notes_bb): Likewise. * function.c (find_temp_slot_from_address, update_temp_slot_address, preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn, fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof, put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk, purge_single_hard_subreg_set, instantiate_decl, instantiate_virtual_regs_1, aggregate_value_p, assign_parms, promoted_input_arg, setjmp_vars_warning, setjmp_args_warning, setjmp_protect, setjmp_protect_args, fix_lexical_addr, expand_function_start, diddle_return_value, clobber_return_register, expand_function_end, keep_stack_depressed, handle_epilogue_set, update_epilogue_consts): Likewise. * genemit.c (gen_exp, gen_insn): Likewise. * genrecog.c (make_insn_sequence): Likewise. * global.c (global_conflicts, expand_preferences, mark_reg_store, mark_reg_conflicts, set_preference, reg_becomes_live, build_insn_chain, mark_reg_change): Likewise. * haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight): Likewise. * ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block): Likewise. * integrate.c (copy_rtx_and_substitute, try_constants, subst_constants, mark_stores, allocate_initial_values): Likewise. * jump.c (reversed_comparison_code_parts, delete_prior_computation, delete_computation, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem, update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set, wipe_dead_reg, no_conflict_p): Likewise. * loop-iv.c (simple_reg_p, simple_set_p, kill_sets, iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered, simple_rhs_p, simplify_using_assignment, implies_p): Likewise. * loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p, move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p, find_single_use_in_loop, count_one_set, loop_bivs_init_find, loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs, valid_initial_value_p, simplify_giv_expr, consec_sets_giv, loop_regs_update, check_dbra_loop, maybe_eliminate_biv, maybe_eliminate_biv_1, record_initial, update_reg_last_use, canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop, try_swap_copy_prop): Likewise. * optabs.c (expand_binop, expand_vector_binop, expand_vector_unop, expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float): Likewise. * postreload.c (reload_cse_simplify, reload_cse_simplify_set, reload_cse_simplify_operands, reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * print-rtl.c (print_rtx): Likewise. * ra-build.c (copy_insn_p, remember_move, init_one_web_common, contains_pseudo, handle_asm_insn): Likewise. * ra-debug.c (ra_print_rtx_object, dump_constraints, dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, emit_colors, remove_suspicious_death_notes): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use, register_operand, scratch_operand, nonmemory_operand, constrain_operands): Likewise. * reg-stack (check_asm_stack_operands, remove_regno_note, emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat, subst_asm_stack_regs): Likewise. * regclass.c (scan_one_insn, record_reg_classes, copy_cost, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (discover_flags_reg, replacement_quality, copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize, fixup_match_1): Likewise. * regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value, kill_set_value, copyprop_hardreg_forward_1): Likewise. * reload.c (MATCHES, push_secondary_reload, find_reusable_reload, reload_inner_reg_of_subreg, can_reload_into, push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, find_reloads_toplev, find_reloads_address, subst_indexed_address, find_reloads_address_1, find_reloads_subreg_address, find_replacement, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise. * reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns, find_reg, delete_dead_insn, alter_reg, eliminate_regs, elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs, forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs, emit_input_reload_insns, emit_output_reload_insns, do_input_reload, do_output_reload, emit_reload_insns, gen_reload, delete_address_reloads_1, inc_for_reload): Likewise. * reorg.c (update_reg_dead_notes, fix_reg_dead_note, update_reg_unused_notes, fill_slots_from_thread): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c (nonzero_address_p, get_jump_table_offset, global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p, reg_set_p, set_noop_p, find_last_value, refers_to_regno_p, note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in, parms_set, find_first_parameter_load, keep_with_call_p, hoist_test_store, hoist_update_store, address_cost, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn, sched_analyze): Likewise. * sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1): Likewise. * sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise. * simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_subreg): Likewise. * stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands, expand_end_stmt_expr, expand_return, expand_decl, expand_anon_union_decl): Likewise. * unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body, find_splittable_regs, find_splittable_givs, find_common_reg_term, loop_iterations): Likewise. * var-tracking.c (variable_union, variable_part_different_p, variable_different_p, count_uses, add_uses, add_stores, compute_bb_dataflow, set_variable_part, delete_variable_part, emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (assemble_variable): Likewise. From-SVN: r83195
2004-06-15 20:02:40 +02:00
if (!REG_P (x))
return GET_MODE (x);
if (REG_VALUES (REGNO (x)) == NULL
|| REG_VALUES (REGNO (x))->elt == NULL)
return VOIDmode;
return GET_MODE (REG_VALUES (REGNO (x))->elt->val_rtx);
}
/* Return nonzero if we can prove that X and Y contain the same value, taking
our gathered information into account. */
int
rtx_equal_for_cselib_p (rtx x, rtx y)
{
enum rtx_code code;
const char *fmt;
int i;
alias.c (record_set, [...]): Use REG_P. 2004-06-15 Jerry Quinn <jlquinn@optonline.net> * alias.c (record_set, record_base_value, canon_rtx, get_addr, nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P. * bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set): Likewise. * builtins.c (expand_builtin_setjmp, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp, expand_builtin_strcmp, expand_builtin_strncmp, expand_builtin_frame_address): Likewise. * caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs, insert_one_insn): Likewise. * calls.c (prepare_call_address, precompute_register_parameters, precompute_arguments, expand_call, emit_library_call_value_1): Likewise. * cfganal.c (flow_active_insn_p): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, can_combine_p, combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, make_extraction, recog_for_combine, gen_lowpart_for_combine, simplify_comparison, record_dead_and_set_regs_1, record_dead_and_set_regs, record_promoted_value, check_promoted_subreg, get_last_value_validate, get_last_value, reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes, unmentioned_reg_p_1): Likewise. * conflict.c (mark_reg): Likewise. * cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost, mention_regs, insert_regs, lookup, lookup_for_remove, insert, merge_equiv_classes, flush_hash_table, invalidate, remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg, invalidate_for_call, use_related_value, canon_hash, exp_equiv_p, cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant, record_jump_cond, cse_insn, addr_affects_sp_p, invalidate_from_clobbers, cse_process_notes, cse_around_loop, cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p, cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms, dbxout_block): Likewise. * df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise. * dojump.c (do_jump): Likewise. * dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg, is_based_loc, rtl_for_decl_location): Likewise. * emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl, set_decl_incoming_rtl, mark_user_reg): Likewise. * explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg, copy_to_suggested_reg, allocate_dynamic_stack_space, probe_stack_range, hard_function_value): Likewise. * expmed.c (store_bit_field, store_fixed_bit_field, store_split_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_divmod, emit_store_flag_force): Likewise. * expr.c (convert_move, convert_modes, block_move_libcall_safe_for_call_parm, emit_group_load, use_reg, use_group_regs, emit_move_insn, emit_move_insn_1, compress_float_constant, push_block, emit_single_push_insn, emit_push_insn, get_subtarget, expand_assignment, store_expr, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment, do_store_flag, do_tablejump): Likewise. * final.c (profile_function, final_scan_insn, alter_subreg, get_mem_expr_from_op, output_asm_operand_names, output_operand, only_leaf_regs_used, leaf_renumber_regs_insn): Likewise. * flow.c (verify_wide_reg_1, mark_regs_live_at_end, find_regno_partial, propagate_one_insn, init_propagate_block_info, insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond, attempt_auto_inc, find_auto_inc, mark_used_regs, count_or_remove_death_notes_bb): Likewise. * function.c (find_temp_slot_from_address, update_temp_slot_address, preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn, fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof, put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk, purge_single_hard_subreg_set, instantiate_decl, instantiate_virtual_regs_1, aggregate_value_p, assign_parms, promoted_input_arg, setjmp_vars_warning, setjmp_args_warning, setjmp_protect, setjmp_protect_args, fix_lexical_addr, expand_function_start, diddle_return_value, clobber_return_register, expand_function_end, keep_stack_depressed, handle_epilogue_set, update_epilogue_consts): Likewise. * genemit.c (gen_exp, gen_insn): Likewise. * genrecog.c (make_insn_sequence): Likewise. * global.c (global_conflicts, expand_preferences, mark_reg_store, mark_reg_conflicts, set_preference, reg_becomes_live, build_insn_chain, mark_reg_change): Likewise. * haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight): Likewise. * ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block): Likewise. * integrate.c (copy_rtx_and_substitute, try_constants, subst_constants, mark_stores, allocate_initial_values): Likewise. * jump.c (reversed_comparison_code_parts, delete_prior_computation, delete_computation, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem, update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set, wipe_dead_reg, no_conflict_p): Likewise. * loop-iv.c (simple_reg_p, simple_set_p, kill_sets, iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered, simple_rhs_p, simplify_using_assignment, implies_p): Likewise. * loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p, move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p, find_single_use_in_loop, count_one_set, loop_bivs_init_find, loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs, valid_initial_value_p, simplify_giv_expr, consec_sets_giv, loop_regs_update, check_dbra_loop, maybe_eliminate_biv, maybe_eliminate_biv_1, record_initial, update_reg_last_use, canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop, try_swap_copy_prop): Likewise. * optabs.c (expand_binop, expand_vector_binop, expand_vector_unop, expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float): Likewise. * postreload.c (reload_cse_simplify, reload_cse_simplify_set, reload_cse_simplify_operands, reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * print-rtl.c (print_rtx): Likewise. * ra-build.c (copy_insn_p, remember_move, init_one_web_common, contains_pseudo, handle_asm_insn): Likewise. * ra-debug.c (ra_print_rtx_object, dump_constraints, dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, emit_colors, remove_suspicious_death_notes): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use, register_operand, scratch_operand, nonmemory_operand, constrain_operands): Likewise. * reg-stack (check_asm_stack_operands, remove_regno_note, emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat, subst_asm_stack_regs): Likewise. * regclass.c (scan_one_insn, record_reg_classes, copy_cost, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (discover_flags_reg, replacement_quality, copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize, fixup_match_1): Likewise. * regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value, kill_set_value, copyprop_hardreg_forward_1): Likewise. * reload.c (MATCHES, push_secondary_reload, find_reusable_reload, reload_inner_reg_of_subreg, can_reload_into, push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, find_reloads_toplev, find_reloads_address, subst_indexed_address, find_reloads_address_1, find_reloads_subreg_address, find_replacement, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise. * reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns, find_reg, delete_dead_insn, alter_reg, eliminate_regs, elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs, forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs, emit_input_reload_insns, emit_output_reload_insns, do_input_reload, do_output_reload, emit_reload_insns, gen_reload, delete_address_reloads_1, inc_for_reload): Likewise. * reorg.c (update_reg_dead_notes, fix_reg_dead_note, update_reg_unused_notes, fill_slots_from_thread): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c (nonzero_address_p, get_jump_table_offset, global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p, reg_set_p, set_noop_p, find_last_value, refers_to_regno_p, note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in, parms_set, find_first_parameter_load, keep_with_call_p, hoist_test_store, hoist_update_store, address_cost, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn, sched_analyze): Likewise. * sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1): Likewise. * sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise. * simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_subreg): Likewise. * stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands, expand_end_stmt_expr, expand_return, expand_decl, expand_anon_union_decl): Likewise. * unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body, find_splittable_regs, find_splittable_givs, find_common_reg_term, loop_iterations): Likewise. * var-tracking.c (variable_union, variable_part_different_p, variable_different_p, count_uses, add_uses, add_stores, compute_bb_dataflow, set_variable_part, delete_variable_part, emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (assemble_variable): Likewise. From-SVN: r83195
2004-06-15 20:02:40 +02:00
if (REG_P (x) || MEM_P (x))
{
cselib_val *e = cselib_lookup (x, GET_MODE (x), 0);
if (e)
x = e->val_rtx;
}
alias.c (record_set, [...]): Use REG_P. 2004-06-15 Jerry Quinn <jlquinn@optonline.net> * alias.c (record_set, record_base_value, canon_rtx, get_addr, nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P. * bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set): Likewise. * builtins.c (expand_builtin_setjmp, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp, expand_builtin_strcmp, expand_builtin_strncmp, expand_builtin_frame_address): Likewise. * caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs, insert_one_insn): Likewise. * calls.c (prepare_call_address, precompute_register_parameters, precompute_arguments, expand_call, emit_library_call_value_1): Likewise. * cfganal.c (flow_active_insn_p): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, can_combine_p, combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, make_extraction, recog_for_combine, gen_lowpart_for_combine, simplify_comparison, record_dead_and_set_regs_1, record_dead_and_set_regs, record_promoted_value, check_promoted_subreg, get_last_value_validate, get_last_value, reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes, unmentioned_reg_p_1): Likewise. * conflict.c (mark_reg): Likewise. * cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost, mention_regs, insert_regs, lookup, lookup_for_remove, insert, merge_equiv_classes, flush_hash_table, invalidate, remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg, invalidate_for_call, use_related_value, canon_hash, exp_equiv_p, cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant, record_jump_cond, cse_insn, addr_affects_sp_p, invalidate_from_clobbers, cse_process_notes, cse_around_loop, cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p, cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms, dbxout_block): Likewise. * df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise. * dojump.c (do_jump): Likewise. * dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg, is_based_loc, rtl_for_decl_location): Likewise. * emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl, set_decl_incoming_rtl, mark_user_reg): Likewise. * explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg, copy_to_suggested_reg, allocate_dynamic_stack_space, probe_stack_range, hard_function_value): Likewise. * expmed.c (store_bit_field, store_fixed_bit_field, store_split_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_divmod, emit_store_flag_force): Likewise. * expr.c (convert_move, convert_modes, block_move_libcall_safe_for_call_parm, emit_group_load, use_reg, use_group_regs, emit_move_insn, emit_move_insn_1, compress_float_constant, push_block, emit_single_push_insn, emit_push_insn, get_subtarget, expand_assignment, store_expr, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment, do_store_flag, do_tablejump): Likewise. * final.c (profile_function, final_scan_insn, alter_subreg, get_mem_expr_from_op, output_asm_operand_names, output_operand, only_leaf_regs_used, leaf_renumber_regs_insn): Likewise. * flow.c (verify_wide_reg_1, mark_regs_live_at_end, find_regno_partial, propagate_one_insn, init_propagate_block_info, insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond, attempt_auto_inc, find_auto_inc, mark_used_regs, count_or_remove_death_notes_bb): Likewise. * function.c (find_temp_slot_from_address, update_temp_slot_address, preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn, fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof, put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk, purge_single_hard_subreg_set, instantiate_decl, instantiate_virtual_regs_1, aggregate_value_p, assign_parms, promoted_input_arg, setjmp_vars_warning, setjmp_args_warning, setjmp_protect, setjmp_protect_args, fix_lexical_addr, expand_function_start, diddle_return_value, clobber_return_register, expand_function_end, keep_stack_depressed, handle_epilogue_set, update_epilogue_consts): Likewise. * genemit.c (gen_exp, gen_insn): Likewise. * genrecog.c (make_insn_sequence): Likewise. * global.c (global_conflicts, expand_preferences, mark_reg_store, mark_reg_conflicts, set_preference, reg_becomes_live, build_insn_chain, mark_reg_change): Likewise. * haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight): Likewise. * ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block): Likewise. * integrate.c (copy_rtx_and_substitute, try_constants, subst_constants, mark_stores, allocate_initial_values): Likewise. * jump.c (reversed_comparison_code_parts, delete_prior_computation, delete_computation, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem, update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set, wipe_dead_reg, no_conflict_p): Likewise. * loop-iv.c (simple_reg_p, simple_set_p, kill_sets, iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered, simple_rhs_p, simplify_using_assignment, implies_p): Likewise. * loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p, move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p, find_single_use_in_loop, count_one_set, loop_bivs_init_find, loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs, valid_initial_value_p, simplify_giv_expr, consec_sets_giv, loop_regs_update, check_dbra_loop, maybe_eliminate_biv, maybe_eliminate_biv_1, record_initial, update_reg_last_use, canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop, try_swap_copy_prop): Likewise. * optabs.c (expand_binop, expand_vector_binop, expand_vector_unop, expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float): Likewise. * postreload.c (reload_cse_simplify, reload_cse_simplify_set, reload_cse_simplify_operands, reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * print-rtl.c (print_rtx): Likewise. * ra-build.c (copy_insn_p, remember_move, init_one_web_common, contains_pseudo, handle_asm_insn): Likewise. * ra-debug.c (ra_print_rtx_object, dump_constraints, dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, emit_colors, remove_suspicious_death_notes): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use, register_operand, scratch_operand, nonmemory_operand, constrain_operands): Likewise. * reg-stack (check_asm_stack_operands, remove_regno_note, emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat, subst_asm_stack_regs): Likewise. * regclass.c (scan_one_insn, record_reg_classes, copy_cost, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (discover_flags_reg, replacement_quality, copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize, fixup_match_1): Likewise. * regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value, kill_set_value, copyprop_hardreg_forward_1): Likewise. * reload.c (MATCHES, push_secondary_reload, find_reusable_reload, reload_inner_reg_of_subreg, can_reload_into, push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, find_reloads_toplev, find_reloads_address, subst_indexed_address, find_reloads_address_1, find_reloads_subreg_address, find_replacement, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise. * reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns, find_reg, delete_dead_insn, alter_reg, eliminate_regs, elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs, forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs, emit_input_reload_insns, emit_output_reload_insns, do_input_reload, do_output_reload, emit_reload_insns, gen_reload, delete_address_reloads_1, inc_for_reload): Likewise. * reorg.c (update_reg_dead_notes, fix_reg_dead_note, update_reg_unused_notes, fill_slots_from_thread): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c (nonzero_address_p, get_jump_table_offset, global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p, reg_set_p, set_noop_p, find_last_value, refers_to_regno_p, note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in, parms_set, find_first_parameter_load, keep_with_call_p, hoist_test_store, hoist_update_store, address_cost, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn, sched_analyze): Likewise. * sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1): Likewise. * sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise. * simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_subreg): Likewise. * stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands, expand_end_stmt_expr, expand_return, expand_decl, expand_anon_union_decl): Likewise. * unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body, find_splittable_regs, find_splittable_givs, find_common_reg_term, loop_iterations): Likewise. * var-tracking.c (variable_union, variable_part_different_p, variable_different_p, count_uses, add_uses, add_stores, compute_bb_dataflow, set_variable_part, delete_variable_part, emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (assemble_variable): Likewise. From-SVN: r83195
2004-06-15 20:02:40 +02:00
if (REG_P (y) || MEM_P (y))
{
cselib_val *e = cselib_lookup (y, GET_MODE (y), 0);
if (e)
y = e->val_rtx;
}
if (x == y)
return 1;
if (GET_CODE (x) == VALUE && GET_CODE (y) == VALUE)
return CSELIB_VAL_PTR (x) == CSELIB_VAL_PTR (y);
if (GET_CODE (x) == VALUE)
{
cselib_val *e = CSELIB_VAL_PTR (x);
struct elt_loc_list *l;
for (l = e->locs; l; l = l->next)
{
rtx t = l->loc;
/* Avoid infinite recursion. */
alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 Jerry Quinn <jlquinn@optonline.net> * alias.c (get_alias_set, canon_rtx, get_addr, nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1): Use MEM_P. * builtins.c (expand_builtin_prefetch, expand_builtin_profile_func, expand_builtin): Likewise. * calls.c (expand_call, emit_library_call_value_1, store_one_arg): Likewise. * combine.c (can_combine_p, combinable_i3pat, try_combine, find_split_point, combine_simplify_rtx, simplify_set, make_extraction, rtx_equal_for_field_assignment_p, gen_lowpart_for_combine, record_dead_and_set_regs_1, get_last_value_validate, mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise. * cse.c (check_dependence, canon_hash, equiv_constant, gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers, cse_around_loop, cse_check_loop_start, cse_set_around_loop, count_reg_usage): Likewise. * cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup, cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol, dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise. * ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise. * df.c (df_uses_record): Likewise. * dojump (do_jump): Likewise. * dwarf2out.c (stack_adjust_offset, mem_loc_descriptor, loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info, decl_start_label): Likewise. * emit-rtl.c (gen_complex_constant_part, gen_highpart, operand_subword, change_address_1, make_safe_from): Likewise. * explow.c (break_out_memory_refs, copy_all_regs, validize_mem, stabilize, force_not_mem): Likewise. * expmed.c (store_bit_field, store_split_bit_field, extract_bit_field, expand_mult_const, expand_divmod, emit_store_flag): Likewise. * expr.c (convert_move, convert_modes, emit_block_move, emit_group_load, emit_group_store, clear_storage, emit_move_insn, emit_move_insn_1, expand_assignment, store_expr, store_constructor_field, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment): Likewise. * final.c (cleanup_subreg_operands, alter_subreg, get_mem_expr_from_op): Likewise. * flow.c (notice_stack_pointer_modification_1, init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs): Likewise. * function.c (mark_temp_addr_taken, preserve_temp_slots, preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1, optimize_bit_field, flush_addressof, purge_addressof_1, instantiate_decl, instantiate_virtual_regs_1, assign_parms, setjmp_protect, setjmp_protect_args, fix_lexical_addr, keep_stack_depressed): Likewise. * ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok, noce_process_if_block, find_memory): Likewise. * integrate.c (subst_constants, allocate_initial_values): Likewise. * local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p, update_equiv_regs): Likewise. * loop.c (scan_loop, prescan_loop, note_addr_stored, check_store, maybe_eliminate_biv_1, find_mem_in_note_1): Likewise. * optabs.c (expand_abs, emit_unop_insn): Likewise. * passes.c (rest_of_handle_final): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, move2add_note_store): Likewise. * ra-build.c (detect_remat_webs): Likewise. * ra-debug.c (dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, insert_stores): Likewise. * recog.c (validate_change, apply_change_group, cancel_changes, validate_replace_rtx_1, general_operand, register_operand, nonmemory_operand, push_operand, pop_operand, memory_operand, indirect_operand, asm_operand_ok, offsettable_memref_p, offsettable_nonstrict_memref_p, constrain_operands, store_data_bypass_p): Likewise. * reg-stack.c (subst_stack_regs_pat): Likewise. * regclass.c (record_operand_costs, scan_one_insn, record_reg_classes, copy_cost, reg_scan_mark_refs): Likewise. * regmove.c (optimize_reg_copy_3, stack_memref_p, combine_stack_adjustments_for_block): Likewise. * regrename.c (copyprop_hardreg_forward_1): Likewise. * reload.c (can_reload_into, push_reload, decompose, immune_p, find_reloads, find_reloads_address, find_reloads_address_1, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg): Likewise. * reload1.c (reload, eliminate_regs, eliminate_regs_in_insn, reload_as_needed, choose_reload_regs, emit_input_reload_insns, do_input_reload, emit_reload_insns, gen_reload, delete_output_reload, delete_address_reloads): Likewise. * resource.c (mark_referenced_resources): Likewise. * rtlanal.c (get_jump_table_offset, count_occurrences, reg_referenced_p, reg_set_p, set_of_1, set_noop_p, reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol, sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms, sdbout_global_decl): Likewise. * simplify-rtx.c (simplify_subreg): Likewise. * stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl, expand_anon_union_decl, expand_end_case_type): Likewise. * unroll.c (calculate_giv_inc): Likewise. * var-tracking.c (stack_adjust_offset_pre_post, bb_stack_adjust_offset, track_expr_p, count_uses, add_uses, add_stores, compute_bb_dataflow, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (make_var_volatile, notice_global_symbol, assemble_external, decode_addr_const, mark_weak, default_encode_section_info): Likewise. From-SVN: r83980
2004-07-01 14:52:53 +02:00
if (REG_P (t) || MEM_P (t))
continue;
else if (rtx_equal_for_cselib_p (t, y))
return 1;
}
return 0;
}
if (GET_CODE (y) == VALUE)
{
cselib_val *e = CSELIB_VAL_PTR (y);
struct elt_loc_list *l;
for (l = e->locs; l; l = l->next)
{
rtx t = l->loc;
alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 Jerry Quinn <jlquinn@optonline.net> * alias.c (get_alias_set, canon_rtx, get_addr, nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1): Use MEM_P. * builtins.c (expand_builtin_prefetch, expand_builtin_profile_func, expand_builtin): Likewise. * calls.c (expand_call, emit_library_call_value_1, store_one_arg): Likewise. * combine.c (can_combine_p, combinable_i3pat, try_combine, find_split_point, combine_simplify_rtx, simplify_set, make_extraction, rtx_equal_for_field_assignment_p, gen_lowpart_for_combine, record_dead_and_set_regs_1, get_last_value_validate, mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise. * cse.c (check_dependence, canon_hash, equiv_constant, gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers, cse_around_loop, cse_check_loop_start, cse_set_around_loop, count_reg_usage): Likewise. * cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup, cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol, dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise. * ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise. * df.c (df_uses_record): Likewise. * dojump (do_jump): Likewise. * dwarf2out.c (stack_adjust_offset, mem_loc_descriptor, loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info, decl_start_label): Likewise. * emit-rtl.c (gen_complex_constant_part, gen_highpart, operand_subword, change_address_1, make_safe_from): Likewise. * explow.c (break_out_memory_refs, copy_all_regs, validize_mem, stabilize, force_not_mem): Likewise. * expmed.c (store_bit_field, store_split_bit_field, extract_bit_field, expand_mult_const, expand_divmod, emit_store_flag): Likewise. * expr.c (convert_move, convert_modes, emit_block_move, emit_group_load, emit_group_store, clear_storage, emit_move_insn, emit_move_insn_1, expand_assignment, store_expr, store_constructor_field, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment): Likewise. * final.c (cleanup_subreg_operands, alter_subreg, get_mem_expr_from_op): Likewise. * flow.c (notice_stack_pointer_modification_1, init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs): Likewise. * function.c (mark_temp_addr_taken, preserve_temp_slots, preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1, optimize_bit_field, flush_addressof, purge_addressof_1, instantiate_decl, instantiate_virtual_regs_1, assign_parms, setjmp_protect, setjmp_protect_args, fix_lexical_addr, keep_stack_depressed): Likewise. * ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok, noce_process_if_block, find_memory): Likewise. * integrate.c (subst_constants, allocate_initial_values): Likewise. * local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p, update_equiv_regs): Likewise. * loop.c (scan_loop, prescan_loop, note_addr_stored, check_store, maybe_eliminate_biv_1, find_mem_in_note_1): Likewise. * optabs.c (expand_abs, emit_unop_insn): Likewise. * passes.c (rest_of_handle_final): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, move2add_note_store): Likewise. * ra-build.c (detect_remat_webs): Likewise. * ra-debug.c (dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, insert_stores): Likewise. * recog.c (validate_change, apply_change_group, cancel_changes, validate_replace_rtx_1, general_operand, register_operand, nonmemory_operand, push_operand, pop_operand, memory_operand, indirect_operand, asm_operand_ok, offsettable_memref_p, offsettable_nonstrict_memref_p, constrain_operands, store_data_bypass_p): Likewise. * reg-stack.c (subst_stack_regs_pat): Likewise. * regclass.c (record_operand_costs, scan_one_insn, record_reg_classes, copy_cost, reg_scan_mark_refs): Likewise. * regmove.c (optimize_reg_copy_3, stack_memref_p, combine_stack_adjustments_for_block): Likewise. * regrename.c (copyprop_hardreg_forward_1): Likewise. * reload.c (can_reload_into, push_reload, decompose, immune_p, find_reloads, find_reloads_address, find_reloads_address_1, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg): Likewise. * reload1.c (reload, eliminate_regs, eliminate_regs_in_insn, reload_as_needed, choose_reload_regs, emit_input_reload_insns, do_input_reload, emit_reload_insns, gen_reload, delete_output_reload, delete_address_reloads): Likewise. * resource.c (mark_referenced_resources): Likewise. * rtlanal.c (get_jump_table_offset, count_occurrences, reg_referenced_p, reg_set_p, set_of_1, set_noop_p, reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol, sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms, sdbout_global_decl): Likewise. * simplify-rtx.c (simplify_subreg): Likewise. * stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl, expand_anon_union_decl, expand_end_case_type): Likewise. * unroll.c (calculate_giv_inc): Likewise. * var-tracking.c (stack_adjust_offset_pre_post, bb_stack_adjust_offset, track_expr_p, count_uses, add_uses, add_stores, compute_bb_dataflow, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (make_var_volatile, notice_global_symbol, assemble_external, decode_addr_const, mark_weak, default_encode_section_info): Likewise. From-SVN: r83980
2004-07-01 14:52:53 +02:00
if (REG_P (t) || MEM_P (t))
continue;
else if (rtx_equal_for_cselib_p (x, t))
return 1;
}
return 0;
}
if (GET_CODE (x) != GET_CODE (y) || GET_MODE (x) != GET_MODE (y))
return 0;
/* These won't be handled correctly by the code below. */
switch (GET_CODE (x))
{
case CONST_DOUBLE:
rtl.c (rtx_code_size): Check CONST_FIXED to calcualte correct sizes in DEF_RTL_EXPR. * rtl.c (rtx_code_size): Check CONST_FIXED to calcualte correct sizes in DEF_RTL_EXPR. (copy_rtx): Handle CONST_FIXED. (rtx_equal_p): Likewise. * rtl.h (fixed_value.h): New include. (rtx_def): Add a new field of fixed_value to u. (XCNMPFV): Define for accessing fixed_value. (CONST_FIXED_VALUE, CONST_FIXED_VALUE_HIGH, CONST_FIXED_VALUE_LOW): Define. * rtl.def (CONST_FIXED): New constant. (SS_MULT, US_MULT, SS_DIV, US_DIV, FRACT_CONVERT, UNSIGNED_FRACT_CONVERT, SAT_FRACT, UNSIGNED_SAT_FRACT, US_NEG, US_ASHIFT): New codes. * doc/rtl.texi (Expressions): Document const_fixed, us_neg, ss_mult, us_mult, ss_div, us_div, us_ashift, fract_convert, sat_fract, unsigned_fract_convert, unsigned_sat_fract): Document them. * varasm.c (assemble_integer): Extend to support fixed-point constants by using different machine classes. (decode_addr_const): Handle FIXED_CST. (const_hash_1): Likewise. (compare_constant): Likewise. (copy_constant): Likewise. (const_rtx_hash_1): Handle CONST_FIXED. (output_constant_pool_2): Handle MODE_FRACT, MODE_UFRACT, MODE_ACCUM, MODE_UACCUM, MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (initializer_constant_valid_p): Handle FIXED_CST. (output_constant): Support FIXED_POINT_TYPE. * gengenrtl.c (excluded_rtx): Check CONST_FIXED to exclude. * cse.c (hash_rtx): Support CONST_FIXED. (exp_equiv_p): Likewise. (cannon_reg): Likewise. (fold_rtx): Likewise. (equiv_constant): Likewise. (cse_process_notes_1): Likewise. (count_reg_usage): Likewise. * cselib.c (entry_and_rtx_equal_p): Check CONST_FIXED. (rtx_equal_for_cselib_p): Handle CONST_FIXED. (wrap_constant): Check CONST_FIXED. (cselib_hash_rtx): Support CONST_FIXED. (cselib_subst_to_values): Likewise. * df-scan.c (df_uses_record): Likewise. * gcse.c (want_to_gcse_p): Likewise. (oprs_unchanged_p): Likewise. (oprs_not_set_p): Likewise. (compute_transp): Likewise. (extract_mentioned_regs_helper): Likewise. * genemit.c (gen_exp): Likewise. * local-alloc.c (equiv_init_varies_p): Likewise. (contains_replace_regs): Likewise. (memref_referenced_p): Likewise. * loop-invariant.c (check_maybe_invariant): Likewise. (hash_invariant_expr_1): Likewise. (invariant_expr_equal_p): Likewise. * postreload-gcse.c (oprs_unchanged_p): Likewise. * regclass.c (reg_scan_mark_refs): Likewise. * regrename.c (scan_rtx): Likewise. * resource.c (mark_referenced_resources): Likewise. (mark_set_resources): Likewise. * rtlanal.c (rtx_unstable_p): Likewise. (rtx_varies_p): Likewise. (count_occurrences): Likewise. (reg_mentioned_p): Likewise. (modified_between_p): Likewise. (modified_in_p): Likewise. (volatile_insn_p): Likewise. (volatile_refs_p): Likewise. (side_effects_p): Likewise. (may_trap_p_1): Likewise. (inequality_comparisons_p): Likewise. (computed_jump_p_1): Likewise. (commutative_operand_precedence): Likewise. * sched-deps.c (sched_analyze_2): Likewise. * sched-vis.c (print_value): Likewise. * reload.c (operands_match_p): Likewise. (subst_reg_equivs): Likewise. * reload1.c (eliminate_regs_1): Likewise. (elimination_effects): Likewise. (scan_paradoxical_subregs): Likewise. * alias.c (rtx_equal_for_memref_p): Likewise. * Makefile.in (RTL_BASE_H): Add fixed-value.h. * emit-rtl.c (const_fixed_htab): New hash table. (const_fixed_htab_hash, const_fixed_htab_eq, lookup_const_fixed): Declare. (const_fixed_htab_hash, const_fixed_htab_eq, lookup_const_fixed, const_fixed_from_fixed_value): New functions. (verify_rtx_sharing): Handle CONST_FIXED. (copy_rtx_if_shared_1): Likewise. (reset_used_flags): Likewise. (set_used_flags): Likewise. (copy_insn_1): Likewise. (init_emit_once): Create const_fixed_htab. Store fixed-point scalar and vector zero and one to const_tiny_rtx. From-SVN: r127725
2007-08-23 02:30:39 +02:00
case CONST_FIXED:
return 0;
case LABEL_REF:
return XEXP (x, 0) == XEXP (y, 0);
default:
break;
}
code = GET_CODE (x);
fmt = GET_RTX_FORMAT (code);
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
{
int j;
switch (fmt[i])
{
case 'w':
if (XWINT (x, i) != XWINT (y, i))
return 0;
break;
case 'n':
case 'i':
if (XINT (x, i) != XINT (y, i))
return 0;
break;
case 'V':
case 'E':
/* Two vectors must have the same length. */
if (XVECLEN (x, i) != XVECLEN (y, i))
return 0;
/* And the corresponding elements must match. */
for (j = 0; j < XVECLEN (x, i); j++)
if (! rtx_equal_for_cselib_p (XVECEXP (x, i, j),
XVECEXP (y, i, j)))
return 0;
break;
case 'e':
if (i == 1
&& targetm.commutative_p (x, UNKNOWN)
&& rtx_equal_for_cselib_p (XEXP (x, 1), XEXP (y, 0))
&& rtx_equal_for_cselib_p (XEXP (x, 0), XEXP (y, 1)))
return 1;
if (! rtx_equal_for_cselib_p (XEXP (x, i), XEXP (y, i)))
return 0;
break;
case 'S':
case 's':
if (strcmp (XSTR (x, i), XSTR (y, i)))
return 0;
break;
case 'u':
/* These are just backpointers, so they don't matter. */
break;
case '0':
case 't':
break;
/* It is believed that rtx's at this level will never
contain anything but integers and other rtx's,
except for within LABEL_REFs and SYMBOL_REFs. */
default:
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
gcc_unreachable ();
}
}
return 1;
}
/* We need to pass down the mode of constants through the hash table
functions. For that purpose, wrap them in a CONST of the appropriate
mode. */
static rtx
wrap_constant (enum machine_mode mode, rtx x)
{
if (!CONST_INT_P (x) && GET_CODE (x) != CONST_FIXED
&& (GET_CODE (x) != CONST_DOUBLE || GET_MODE (x) != VOIDmode))
return x;
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
gcc_assert (mode != VOIDmode);
return gen_rtx_CONST (mode, x);
}
/* Hash an rtx. Return 0 if we couldn't hash the rtx.
For registers and memory locations, we look up their cselib_val structure
and return its VALUE element.
Possible reasons for return 0 are: the object is volatile, or we couldn't
find a register or memory location in the table and CREATE is zero. If
CREATE is nonzero, table elts are created for regs and mem.
N.B. this hash function returns the same hash value for RTXes that
differ only in the order of operands, thus it is suitable for comparisons
that take commutativity into account.
If we wanted to also support associative rules, we'd have to use a different
strategy to avoid returning spurious 0, e.g. return ~(~0U >> 1) .
We used to have a MODE argument for hashing for CONST_INTs, but that
didn't make sense, since it caused spurious hash differences between
(set (reg:SI 1) (const_int))
(plus:SI (reg:SI 2) (reg:SI 1))
and
(plus:SI (reg:SI 2) (const_int))
If the mode is important in any context, it must be checked specifically
in a comparison anyway, since relying on hash differences is unsafe. */
static unsigned int
cselib_hash_rtx (rtx x, int create)
{
cselib_val *e;
int i, j;
enum rtx_code code;
const char *fmt;
unsigned int hash = 0;
code = GET_CODE (x);
hash += (unsigned) code + (unsigned) GET_MODE (x);
switch (code)
{
case MEM:
case REG:
e = cselib_lookup (x, GET_MODE (x), create);
if (! e)
return 0;
return e->value;
case CONST_INT:
hash += ((unsigned) CONST_INT << 7) + INTVAL (x);
return hash ? hash : (unsigned int) CONST_INT;
case CONST_DOUBLE:
/* This is like the general case, except that it only counts
the integers representing the constant. */
hash += (unsigned) code + (unsigned) GET_MODE (x);
if (GET_MODE (x) != VOIDmode)
hash += real_hash (CONST_DOUBLE_REAL_VALUE (x));
else
hash += ((unsigned) CONST_DOUBLE_LOW (x)
+ (unsigned) CONST_DOUBLE_HIGH (x));
return hash ? hash : (unsigned int) CONST_DOUBLE;
rtl.c (rtx_code_size): Check CONST_FIXED to calcualte correct sizes in DEF_RTL_EXPR. * rtl.c (rtx_code_size): Check CONST_FIXED to calcualte correct sizes in DEF_RTL_EXPR. (copy_rtx): Handle CONST_FIXED. (rtx_equal_p): Likewise. * rtl.h (fixed_value.h): New include. (rtx_def): Add a new field of fixed_value to u. (XCNMPFV): Define for accessing fixed_value. (CONST_FIXED_VALUE, CONST_FIXED_VALUE_HIGH, CONST_FIXED_VALUE_LOW): Define. * rtl.def (CONST_FIXED): New constant. (SS_MULT, US_MULT, SS_DIV, US_DIV, FRACT_CONVERT, UNSIGNED_FRACT_CONVERT, SAT_FRACT, UNSIGNED_SAT_FRACT, US_NEG, US_ASHIFT): New codes. * doc/rtl.texi (Expressions): Document const_fixed, us_neg, ss_mult, us_mult, ss_div, us_div, us_ashift, fract_convert, sat_fract, unsigned_fract_convert, unsigned_sat_fract): Document them. * varasm.c (assemble_integer): Extend to support fixed-point constants by using different machine classes. (decode_addr_const): Handle FIXED_CST. (const_hash_1): Likewise. (compare_constant): Likewise. (copy_constant): Likewise. (const_rtx_hash_1): Handle CONST_FIXED. (output_constant_pool_2): Handle MODE_FRACT, MODE_UFRACT, MODE_ACCUM, MODE_UACCUM, MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (initializer_constant_valid_p): Handle FIXED_CST. (output_constant): Support FIXED_POINT_TYPE. * gengenrtl.c (excluded_rtx): Check CONST_FIXED to exclude. * cse.c (hash_rtx): Support CONST_FIXED. (exp_equiv_p): Likewise. (cannon_reg): Likewise. (fold_rtx): Likewise. (equiv_constant): Likewise. (cse_process_notes_1): Likewise. (count_reg_usage): Likewise. * cselib.c (entry_and_rtx_equal_p): Check CONST_FIXED. (rtx_equal_for_cselib_p): Handle CONST_FIXED. (wrap_constant): Check CONST_FIXED. (cselib_hash_rtx): Support CONST_FIXED. (cselib_subst_to_values): Likewise. * df-scan.c (df_uses_record): Likewise. * gcse.c (want_to_gcse_p): Likewise. (oprs_unchanged_p): Likewise. (oprs_not_set_p): Likewise. (compute_transp): Likewise. (extract_mentioned_regs_helper): Likewise. * genemit.c (gen_exp): Likewise. * local-alloc.c (equiv_init_varies_p): Likewise. (contains_replace_regs): Likewise. (memref_referenced_p): Likewise. * loop-invariant.c (check_maybe_invariant): Likewise. (hash_invariant_expr_1): Likewise. (invariant_expr_equal_p): Likewise. * postreload-gcse.c (oprs_unchanged_p): Likewise. * regclass.c (reg_scan_mark_refs): Likewise. * regrename.c (scan_rtx): Likewise. * resource.c (mark_referenced_resources): Likewise. (mark_set_resources): Likewise. * rtlanal.c (rtx_unstable_p): Likewise. (rtx_varies_p): Likewise. (count_occurrences): Likewise. (reg_mentioned_p): Likewise. (modified_between_p): Likewise. (modified_in_p): Likewise. (volatile_insn_p): Likewise. (volatile_refs_p): Likewise. (side_effects_p): Likewise. (may_trap_p_1): Likewise. (inequality_comparisons_p): Likewise. (computed_jump_p_1): Likewise. (commutative_operand_precedence): Likewise. * sched-deps.c (sched_analyze_2): Likewise. * sched-vis.c (print_value): Likewise. * reload.c (operands_match_p): Likewise. (subst_reg_equivs): Likewise. * reload1.c (eliminate_regs_1): Likewise. (elimination_effects): Likewise. (scan_paradoxical_subregs): Likewise. * alias.c (rtx_equal_for_memref_p): Likewise. * Makefile.in (RTL_BASE_H): Add fixed-value.h. * emit-rtl.c (const_fixed_htab): New hash table. (const_fixed_htab_hash, const_fixed_htab_eq, lookup_const_fixed): Declare. (const_fixed_htab_hash, const_fixed_htab_eq, lookup_const_fixed, const_fixed_from_fixed_value): New functions. (verify_rtx_sharing): Handle CONST_FIXED. (copy_rtx_if_shared_1): Likewise. (reset_used_flags): Likewise. (set_used_flags): Likewise. (copy_insn_1): Likewise. (init_emit_once): Create const_fixed_htab. Store fixed-point scalar and vector zero and one to const_tiny_rtx. From-SVN: r127725
2007-08-23 02:30:39 +02:00
case CONST_FIXED:
hash += (unsigned int) code + (unsigned int) GET_MODE (x);
hash += fixed_hash (CONST_FIXED_VALUE (x));
return hash ? hash : (unsigned int) CONST_FIXED;
i386.md ("mmx_uavgv8qi3"): Use const_vector. 2002-02-19 Aldy Hernandez <aldyh@redhat.com> * config/i386/i386.md ("mmx_uavgv8qi3"): Use const_vector. ("mmx_uavgv4hi3"): Same. ("pmulhrwv4hi3"): Same. * tree-inline.c (walk_tree): Handle vectors. * c-common.c (constant_expression_warning): Handle vectors. (overflow_warning): Same. * sched-deps.c (sched_analyze_2): Handle vectors. * rtlanal.c (rtx_unstable_p): Handle vectors. (rtx_varies_p): Same. (count_occurrences): Same. (regs_set_between_p): Same. (modified_between_p): Same. (modified_in_p): Same. (volatile_insn_p): Same. (volatile_refs_p): Same. (side_effects_p): Same. (may_trap_p): Same. (inequality_comparisons_p): Same. (replace_regs): Same. (computed_jump_p_1): Same. * rtl.c (DEF_MACHMODE): Change all definitions to accept 8th argument. (inner_mode_array): New. (copy_rtx): Handle vectors. (copy_most_rtx): Same. (rtx_equal_p): Same. (get_mode_alignment): Adjust for vectors. * resource.c (mark_referenced_resources): Handle vectors. (mark_set_resources): Same. * reload1.c (eliminate_regs): Handle vectors. (elimination_effects): Same. (scan_paradoxical_subregs): Same. * reload.c (subst_reg_equivs): Handle vectors. * regrename.c (scan_rtx): Handle vectors. * regclass.c (reg_scan_mark_refs): Handle vectors. * recog.c (find_single_use_1): Handle vectors. * local-alloc.c (equiv_init_varies_p): Handle vectors. (contains_replace_regs): Same. (memref_referenced_p): Same. * integrate.c (copy_rtx_and_substitute): Handle vectors. (subst_constants): Same. * genattrtab.c (attr_copy_rtx): Handle vectors. (encode_units_mask): Same. (clear_struct_flag): Same. (count_sub_rtxs): Same. * gcse.c (want_to_gcse_p): Handle vectors. (oprs_unchanged_p): Same. (hash_expr_1): Same. (oprs_not_set_p): Same. (expr_killed_p): Same. (compute_transp): Same. (store_ops_ok): Same. * function.c (purge_addressof_1): Do not allow paradoxical subregs of vectors. (fixup_var_refs_1): Same. (instantiate_virtual_regs_1): Same. * fold-const.c (operand_equal_p): Handle vectors. (fold): Same. (rtl_expr_nonnegative_p): Same. * flow.c (mark_used_regs): Handle vectors. * df.c (df_uses_record): Handle vectors. * cselib.c (cselib_subst_to_values): Handle vectors. (cselib_mem_conflict_p): Same. (hash_rtx): Same. * cse.c (canon_reg): Handle vectors. (fold_rt): Same. (cse_process_notes): Same. (count_reg_usage): Same. (canon_hash): Same. * alias.c (nonlocal_mentioned_p): Add case for CONST_VECTOR. * combine.c (mark_used_regs_combine): Add case for CONST_VECTOR. * emit-rtl.c (init_emit_once): Generate const0_rtx for vectors. (gen_rtx): Handle CONST_VECTOR. (gen_const_vector_0): New. (copy_rtx_if_shared): CONST_VECTORs can be shared. (reset_used_flags): Same. (copy_insn_1): Same. (initializer_constant_valid_p): Handle VECTOR_CST. * doc/c-tree.texi (Expression trees): Document VECTOR_CST. * doc/rtl.texi (Constants): Document const_vector. (CONST0_RTX): Update for vectors. (RTL sharing): Same. * print-tree.c (print_node): Add case for VECTOR_CST. * tree.h (TREE_VECTOR_CST_ELTS): New. (struct tree_vector): New. (union tree_node): Add vector node. (build_vector): Add prototype. * tree.def (VECTOR_CST): New. * tree.c (build_vector): New. * expmed.c (make_tree): Handle CONST_VECTOR. * rtl.h (CONSTANT_P): CONST_VECTORs are constants too. (CONST_VECTOR_ELT): New. (CONST_VECTOR_NUNITS): New. * machmode.h (GET_MODE_INNER): New. (DEF_MACHMODE): Accept 8th arg. * machmode.def: Add 8th argument for vector inner mode. Add inner vector modes for vectors. * rtl.def (VEC_CONST): Remove. (CONST_VECTOR): New. * expr.c (clear_storage): Allow vectors. (is_zeros_p): Handle VECTOR_CST. * varasm.c (output_constant_pool): Handle vectors. (rtx_const): Add veclo and vechi fields. (kind): Add RTX_VECTOR. (decode_rtx_const): Add case for vector. * config/rs6000/rs6000-protos.h: Add zero_constant. * config/rs6000/rs6000.c (rs6000_emit_move): Handle vector constants. Force easy vector constants into memory. (easy_vector_constant): New. (emit_easy_vector_constant): New. (rs6000_legitimize_reload_address): Do not generate bad reloads on darwin. * config/rs6000/rs6000.md ("altivec_lvx"): Reflect what instruction does. ("altivec_lvxl"): Same. (altivec_lvebx): Same. (altivec_lvehx): Same. (altivec_lvewx): Same. ("*movv4si_const0"): New. ("*movv4sf_const0"): New. ("*movv8hi_const0"): New. ("*movv16qi_const0"): New. From-SVN: r49853
2002-02-19 03:53:41 +01:00
case CONST_VECTOR:
{
int units;
rtx elt;
units = CONST_VECTOR_NUNITS (x);
for (i = 0; i < units; ++i)
{
elt = CONST_VECTOR_ELT (x, i);
hash += cselib_hash_rtx (elt, 0);
i386.md ("mmx_uavgv8qi3"): Use const_vector. 2002-02-19 Aldy Hernandez <aldyh@redhat.com> * config/i386/i386.md ("mmx_uavgv8qi3"): Use const_vector. ("mmx_uavgv4hi3"): Same. ("pmulhrwv4hi3"): Same. * tree-inline.c (walk_tree): Handle vectors. * c-common.c (constant_expression_warning): Handle vectors. (overflow_warning): Same. * sched-deps.c (sched_analyze_2): Handle vectors. * rtlanal.c (rtx_unstable_p): Handle vectors. (rtx_varies_p): Same. (count_occurrences): Same. (regs_set_between_p): Same. (modified_between_p): Same. (modified_in_p): Same. (volatile_insn_p): Same. (volatile_refs_p): Same. (side_effects_p): Same. (may_trap_p): Same. (inequality_comparisons_p): Same. (replace_regs): Same. (computed_jump_p_1): Same. * rtl.c (DEF_MACHMODE): Change all definitions to accept 8th argument. (inner_mode_array): New. (copy_rtx): Handle vectors. (copy_most_rtx): Same. (rtx_equal_p): Same. (get_mode_alignment): Adjust for vectors. * resource.c (mark_referenced_resources): Handle vectors. (mark_set_resources): Same. * reload1.c (eliminate_regs): Handle vectors. (elimination_effects): Same. (scan_paradoxical_subregs): Same. * reload.c (subst_reg_equivs): Handle vectors. * regrename.c (scan_rtx): Handle vectors. * regclass.c (reg_scan_mark_refs): Handle vectors. * recog.c (find_single_use_1): Handle vectors. * local-alloc.c (equiv_init_varies_p): Handle vectors. (contains_replace_regs): Same. (memref_referenced_p): Same. * integrate.c (copy_rtx_and_substitute): Handle vectors. (subst_constants): Same. * genattrtab.c (attr_copy_rtx): Handle vectors. (encode_units_mask): Same. (clear_struct_flag): Same. (count_sub_rtxs): Same. * gcse.c (want_to_gcse_p): Handle vectors. (oprs_unchanged_p): Same. (hash_expr_1): Same. (oprs_not_set_p): Same. (expr_killed_p): Same. (compute_transp): Same. (store_ops_ok): Same. * function.c (purge_addressof_1): Do not allow paradoxical subregs of vectors. (fixup_var_refs_1): Same. (instantiate_virtual_regs_1): Same. * fold-const.c (operand_equal_p): Handle vectors. (fold): Same. (rtl_expr_nonnegative_p): Same. * flow.c (mark_used_regs): Handle vectors. * df.c (df_uses_record): Handle vectors. * cselib.c (cselib_subst_to_values): Handle vectors. (cselib_mem_conflict_p): Same. (hash_rtx): Same. * cse.c (canon_reg): Handle vectors. (fold_rt): Same. (cse_process_notes): Same. (count_reg_usage): Same. (canon_hash): Same. * alias.c (nonlocal_mentioned_p): Add case for CONST_VECTOR. * combine.c (mark_used_regs_combine): Add case for CONST_VECTOR. * emit-rtl.c (init_emit_once): Generate const0_rtx for vectors. (gen_rtx): Handle CONST_VECTOR. (gen_const_vector_0): New. (copy_rtx_if_shared): CONST_VECTORs can be shared. (reset_used_flags): Same. (copy_insn_1): Same. (initializer_constant_valid_p): Handle VECTOR_CST. * doc/c-tree.texi (Expression trees): Document VECTOR_CST. * doc/rtl.texi (Constants): Document const_vector. (CONST0_RTX): Update for vectors. (RTL sharing): Same. * print-tree.c (print_node): Add case for VECTOR_CST. * tree.h (TREE_VECTOR_CST_ELTS): New. (struct tree_vector): New. (union tree_node): Add vector node. (build_vector): Add prototype. * tree.def (VECTOR_CST): New. * tree.c (build_vector): New. * expmed.c (make_tree): Handle CONST_VECTOR. * rtl.h (CONSTANT_P): CONST_VECTORs are constants too. (CONST_VECTOR_ELT): New. (CONST_VECTOR_NUNITS): New. * machmode.h (GET_MODE_INNER): New. (DEF_MACHMODE): Accept 8th arg. * machmode.def: Add 8th argument for vector inner mode. Add inner vector modes for vectors. * rtl.def (VEC_CONST): Remove. (CONST_VECTOR): New. * expr.c (clear_storage): Allow vectors. (is_zeros_p): Handle VECTOR_CST. * varasm.c (output_constant_pool): Handle vectors. (rtx_const): Add veclo and vechi fields. (kind): Add RTX_VECTOR. (decode_rtx_const): Add case for vector. * config/rs6000/rs6000-protos.h: Add zero_constant. * config/rs6000/rs6000.c (rs6000_emit_move): Handle vector constants. Force easy vector constants into memory. (easy_vector_constant): New. (emit_easy_vector_constant): New. (rs6000_legitimize_reload_address): Do not generate bad reloads on darwin. * config/rs6000/rs6000.md ("altivec_lvx"): Reflect what instruction does. ("altivec_lvxl"): Same. (altivec_lvebx): Same. (altivec_lvehx): Same. (altivec_lvewx): Same. ("*movv4si_const0"): New. ("*movv4sf_const0"): New. ("*movv8hi_const0"): New. ("*movv16qi_const0"): New. From-SVN: r49853
2002-02-19 03:53:41 +01:00
}
return hash;
}
/* Assume there is only one rtx object for any given label. */
case LABEL_REF:
/* We don't hash on the address of the CODE_LABEL to avoid bootstrap
differences and differences between each stage's debugging dumps. */
hash += (((unsigned int) LABEL_REF << 7)
+ CODE_LABEL_NUMBER (XEXP (x, 0)));
return hash ? hash : (unsigned int) LABEL_REF;
case SYMBOL_REF:
{
/* Don't hash on the symbol's address to avoid bootstrap differences.
Different hash values may cause expressions to be recorded in
different orders and thus different registers to be used in the
final assembler. This also avoids differences in the dump files
between various stages. */
unsigned int h = 0;
const unsigned char *p = (const unsigned char *) XSTR (x, 0);
while (*p)
h += (h << 7) + *p++; /* ??? revisit */
hash += ((unsigned int) SYMBOL_REF << 7) + h;
return hash ? hash : (unsigned int) SYMBOL_REF;
}
case PRE_DEC:
case PRE_INC:
case POST_DEC:
case POST_INC:
case POST_MODIFY:
case PRE_MODIFY:
case PC:
case CC0:
case CALL:
case UNSPEC_VOLATILE:
return 0;
case ASM_OPERANDS:
if (MEM_VOLATILE_P (x))
return 0;
break;
default:
break;
}
i = GET_RTX_LENGTH (code) - 1;
fmt = GET_RTX_FORMAT (code);
for (; i >= 0; i--)
{
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
switch (fmt[i])
{
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
case 'e':
{
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
rtx tem = XEXP (x, i);
unsigned int tem_hash = cselib_hash_rtx (tem, create);
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
if (tem_hash == 0)
return 0;
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
hash += tem_hash;
}
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
break;
case 'E':
for (j = 0; j < XVECLEN (x, i); j++)
{
unsigned int tem_hash
= cselib_hash_rtx (XVECEXP (x, i, j), create);
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
if (tem_hash == 0)
return 0;
hash += tem_hash;
}
break;
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
case 's':
{
const unsigned char *p = (const unsigned char *) XSTR (x, i);
if (p)
while (*p)
hash += *p++;
break;
}
case 'i':
hash += XINT (x, i);
break;
case '0':
case 't':
/* unused */
break;
default:
gcc_unreachable ();
}
}
return hash ? hash : 1 + (unsigned int) GET_CODE (x);
}
/* Create a new value structure for VALUE and initialize it. The mode of the
value is MODE. */
static inline cselib_val *
new_cselib_val (unsigned int value, enum machine_mode mode)
{
alias.c (record_alias_subset, [...]): Fix -Wc++-compat and/or -Wcast-qual warnings. * alias.c (record_alias_subset, init_alias_analysis): Fix -Wc++-compat and/or -Wcast-qual warnings. * attribs.c (lookup_attribute_spec): Likewise. * bb-reorder.c (find_traces, rotate_loop, find_traces_1_round, copy_bb, connect_traces, find_rarely_executed_basic_blocks_and_cr): Likewise. * bt-load.c (find_btr_def_group, add_btr_def, new_btr_user, note_btr_set, migrate_btr_defs): Likewise. * builtins.c (result_vector, expand_builtin_memcpy, expand_builtin_mempcpy_args, expand_builtin_strncpy, builtin_memset_read_str, expand_builtin_printf, fold_builtin_memchr, rewrite_call_expr, fold_builtin_printf): Likewise. * caller-save.c (mark_set_regs): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cgraph.c (cgraph_edge): Likewise. * combine.c (likely_spilled_retval_1): Likewise. * coverage.c (htab_counts_entry_hash, htab_counts_entry_eq, htab_counts_entry_del, get_coverage_counts): Likewise. * cselib.c (new_elt_list, new_elt_loc_list, entry_and_rtx_equal_p, new_cselib_val): Likewise. * dbgcnt.c (dbg_cnt_process_opt): Likewise. * dbxout.c (dbxout_init, dbxout_type, output_used_types_helper): Likewise. * df-core.c (df_compact_blocks): Likewise. * df-problems.c (df_grow_bb_info, df_chain_create): Likewise. * df-scan.c (df_grow_reg_info, df_ref_create, df_insn_create_insn_record, df_insn_rescan, df_notes_rescan, df_ref_compare, df_ref_create_structure, df_bb_refs_record, df_record_entry_block_defs, df_record_exit_block_uses, df_bb_verify): Likewise. * df.h (DF_REF_EXTRACT_WIDTH_CONST, DF_REF_EXTRACT_OFFSET_CONST, DF_REF_EXTRACT_MODE_CONST): New. * dominance.c (get_immediate_dominator, get_dominated_by, nearest_common_dominator, root_of_dom_tree, iterate_fix_dominators, first_dom_son, next_dom_son): Fix -Wc++-compat and/or -Wcast-qual warnings. * dse.c (clear_alias_set_lookup, get_group_info, gen_rtx_MEM, record_store, replace_read, check_mem_read_rtx, scan_insn, dse_step1, dse_record_singleton_alias_set): Likewise. * dwarf2asm.c (dw2_force_const_mem): Likewise. From-SVN: r137137
2008-06-26 02:28:15 +02:00
cselib_val *e = (cselib_val *) pool_alloc (cselib_val_pool);
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
gcc_assert (value);
e->value = value;
cse.c (CHEAP_REGNO): Redefine using REGNO_PTR_FRAME_P and HARD_REGISTER_NUM_P. * cse.c (CHEAP_REGNO): Redefine using REGNO_PTR_FRAME_P and HARD_REGISTER_NUM_P. * cselib.c (new_cselib_val): Make comment correct and more detailed. * flow.c (mark_set_1): Likewise. * except.c (duplicate_eh_region_1, duplicate_eh_region_2, duplicate_eh_regions): Remove. * except.h (duplicate_eh_regions): Remove prototype. * integrate.c (get_label_from_map, copy_rtx_and_substitute, global_const_equiv_varray): Remove. * integrate.h (get_label_from_map, copy_rtx_and_substitute, global_const_equiv_varray, set_label_in_map): Remove prototypes, extern declaration, and #define. (MAYBE_EXTEND_CONST_EQUIV_VARRAY, SET_CONST_EQUIV_DATA): Remove. (struct inline_remap): Remove. * varray.c (struct element): Remove entry for const_equiv_data. * varray.h (struct const_equiv_data): Remove. (enum varray_data_enum) <VARRAY_DATA_CONST_EQUIV>: Remove. (union varray_data_tag) <const_equiv>: Remove. (VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV, VARRAY_PUSH_CONST_EQUIV, VARRAY_TOP_CONST_EQUIV): Remove. * regstack.c (record_label_references): Remove unused function. * rtl.def (VALUE): Update comment. (LABEL_REF): Remove unused operand 2. * rtl.h (struct rtx_def): Update for removed accessor macros. (XCADVFLAGS, INSN_DEAD_CODE_P, LINE_NUMBER, CONTAINING_INSN, REG_LOOP_TEST_P): Remove. (ADDR_DIFF_VEC_FLAGS, CSELIB_VAL_PTR, LABEL_NEXTREF): Add comments. * web.c (entry_register): Don't copy REG_LOOP_TEST_P. * doc/rtl.texi (INSN_DEAD_CODE_P, REG_LOOP_TEST_P): Remove. From-SVN: r90580
2004-11-13 15:18:04 +01:00
/* We use an alloc pool to allocate this RTL construct because it
accounts for about 8% of the overall memory usage. We know
precisely when we can have VALUE RTXen (when cselib is active)
so we don't need to put them in garbage collected memory.
cse.c (CHEAP_REGNO): Redefine using REGNO_PTR_FRAME_P and HARD_REGISTER_NUM_P. * cse.c (CHEAP_REGNO): Redefine using REGNO_PTR_FRAME_P and HARD_REGISTER_NUM_P. * cselib.c (new_cselib_val): Make comment correct and more detailed. * flow.c (mark_set_1): Likewise. * except.c (duplicate_eh_region_1, duplicate_eh_region_2, duplicate_eh_regions): Remove. * except.h (duplicate_eh_regions): Remove prototype. * integrate.c (get_label_from_map, copy_rtx_and_substitute, global_const_equiv_varray): Remove. * integrate.h (get_label_from_map, copy_rtx_and_substitute, global_const_equiv_varray, set_label_in_map): Remove prototypes, extern declaration, and #define. (MAYBE_EXTEND_CONST_EQUIV_VARRAY, SET_CONST_EQUIV_DATA): Remove. (struct inline_remap): Remove. * varray.c (struct element): Remove entry for const_equiv_data. * varray.h (struct const_equiv_data): Remove. (enum varray_data_enum) <VARRAY_DATA_CONST_EQUIV>: Remove. (union varray_data_tag) <const_equiv>: Remove. (VARRAY_CONST_EQUIV_INIT, VARRAY_CONST_EQUIV, VARRAY_PUSH_CONST_EQUIV, VARRAY_TOP_CONST_EQUIV): Remove. * regstack.c (record_label_references): Remove unused function. * rtl.def (VALUE): Update comment. (LABEL_REF): Remove unused operand 2. * rtl.h (struct rtx_def): Update for removed accessor macros. (XCADVFLAGS, INSN_DEAD_CODE_P, LINE_NUMBER, CONTAINING_INSN, REG_LOOP_TEST_P): Remove. (ADDR_DIFF_VEC_FLAGS, CSELIB_VAL_PTR, LABEL_NEXTREF): Add comments. * web.c (entry_register): Don't copy REG_LOOP_TEST_P. * doc/rtl.texi (INSN_DEAD_CODE_P, REG_LOOP_TEST_P): Remove. From-SVN: r90580
2004-11-13 15:18:04 +01:00
??? Why should a VALUE be an RTX in the first place? */
alias.c (record_alias_subset, [...]): Fix -Wc++-compat and/or -Wcast-qual warnings. * alias.c (record_alias_subset, init_alias_analysis): Fix -Wc++-compat and/or -Wcast-qual warnings. * attribs.c (lookup_attribute_spec): Likewise. * bb-reorder.c (find_traces, rotate_loop, find_traces_1_round, copy_bb, connect_traces, find_rarely_executed_basic_blocks_and_cr): Likewise. * bt-load.c (find_btr_def_group, add_btr_def, new_btr_user, note_btr_set, migrate_btr_defs): Likewise. * builtins.c (result_vector, expand_builtin_memcpy, expand_builtin_mempcpy_args, expand_builtin_strncpy, builtin_memset_read_str, expand_builtin_printf, fold_builtin_memchr, rewrite_call_expr, fold_builtin_printf): Likewise. * caller-save.c (mark_set_regs): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cgraph.c (cgraph_edge): Likewise. * combine.c (likely_spilled_retval_1): Likewise. * coverage.c (htab_counts_entry_hash, htab_counts_entry_eq, htab_counts_entry_del, get_coverage_counts): Likewise. * cselib.c (new_elt_list, new_elt_loc_list, entry_and_rtx_equal_p, new_cselib_val): Likewise. * dbgcnt.c (dbg_cnt_process_opt): Likewise. * dbxout.c (dbxout_init, dbxout_type, output_used_types_helper): Likewise. * df-core.c (df_compact_blocks): Likewise. * df-problems.c (df_grow_bb_info, df_chain_create): Likewise. * df-scan.c (df_grow_reg_info, df_ref_create, df_insn_create_insn_record, df_insn_rescan, df_notes_rescan, df_ref_compare, df_ref_create_structure, df_bb_refs_record, df_record_entry_block_defs, df_record_exit_block_uses, df_bb_verify): Likewise. * df.h (DF_REF_EXTRACT_WIDTH_CONST, DF_REF_EXTRACT_OFFSET_CONST, DF_REF_EXTRACT_MODE_CONST): New. * dominance.c (get_immediate_dominator, get_dominated_by, nearest_common_dominator, root_of_dom_tree, iterate_fix_dominators, first_dom_son, next_dom_son): Fix -Wc++-compat and/or -Wcast-qual warnings. * dse.c (clear_alias_set_lookup, get_group_info, gen_rtx_MEM, record_store, replace_read, check_mem_read_rtx, scan_insn, dse_step1, dse_record_singleton_alias_set): Likewise. * dwarf2asm.c (dw2_force_const_mem): Likewise. From-SVN: r137137
2008-06-26 02:28:15 +02:00
e->val_rtx = (rtx) pool_alloc (value_pool);
memset (e->val_rtx, 0, RTX_HDR_SIZE);
PUT_CODE (e->val_rtx, VALUE);
PUT_MODE (e->val_rtx, mode);
CSELIB_VAL_PTR (e->val_rtx) = e;
e->addr_list = 0;
e->locs = 0;
e->next_containing_mem = 0;
return e;
}
/* ADDR_ELT is a value that is used as address. MEM_ELT is the value that
contains the data at this address. X is a MEM that represents the
value. Update the two value structures to represent this situation. */
static void
add_mem_for_addr (cselib_val *addr_elt, cselib_val *mem_elt, rtx x)
{
struct elt_loc_list *l;
/* Avoid duplicates. */
for (l = mem_elt->locs; l; l = l->next)
alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 Jerry Quinn <jlquinn@optonline.net> * alias.c (get_alias_set, canon_rtx, get_addr, nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1): Use MEM_P. * builtins.c (expand_builtin_prefetch, expand_builtin_profile_func, expand_builtin): Likewise. * calls.c (expand_call, emit_library_call_value_1, store_one_arg): Likewise. * combine.c (can_combine_p, combinable_i3pat, try_combine, find_split_point, combine_simplify_rtx, simplify_set, make_extraction, rtx_equal_for_field_assignment_p, gen_lowpart_for_combine, record_dead_and_set_regs_1, get_last_value_validate, mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise. * cse.c (check_dependence, canon_hash, equiv_constant, gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers, cse_around_loop, cse_check_loop_start, cse_set_around_loop, count_reg_usage): Likewise. * cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup, cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol, dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise. * ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise. * df.c (df_uses_record): Likewise. * dojump (do_jump): Likewise. * dwarf2out.c (stack_adjust_offset, mem_loc_descriptor, loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info, decl_start_label): Likewise. * emit-rtl.c (gen_complex_constant_part, gen_highpart, operand_subword, change_address_1, make_safe_from): Likewise. * explow.c (break_out_memory_refs, copy_all_regs, validize_mem, stabilize, force_not_mem): Likewise. * expmed.c (store_bit_field, store_split_bit_field, extract_bit_field, expand_mult_const, expand_divmod, emit_store_flag): Likewise. * expr.c (convert_move, convert_modes, emit_block_move, emit_group_load, emit_group_store, clear_storage, emit_move_insn, emit_move_insn_1, expand_assignment, store_expr, store_constructor_field, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment): Likewise. * final.c (cleanup_subreg_operands, alter_subreg, get_mem_expr_from_op): Likewise. * flow.c (notice_stack_pointer_modification_1, init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs): Likewise. * function.c (mark_temp_addr_taken, preserve_temp_slots, preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1, optimize_bit_field, flush_addressof, purge_addressof_1, instantiate_decl, instantiate_virtual_regs_1, assign_parms, setjmp_protect, setjmp_protect_args, fix_lexical_addr, keep_stack_depressed): Likewise. * ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok, noce_process_if_block, find_memory): Likewise. * integrate.c (subst_constants, allocate_initial_values): Likewise. * local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p, update_equiv_regs): Likewise. * loop.c (scan_loop, prescan_loop, note_addr_stored, check_store, maybe_eliminate_biv_1, find_mem_in_note_1): Likewise. * optabs.c (expand_abs, emit_unop_insn): Likewise. * passes.c (rest_of_handle_final): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, move2add_note_store): Likewise. * ra-build.c (detect_remat_webs): Likewise. * ra-debug.c (dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, insert_stores): Likewise. * recog.c (validate_change, apply_change_group, cancel_changes, validate_replace_rtx_1, general_operand, register_operand, nonmemory_operand, push_operand, pop_operand, memory_operand, indirect_operand, asm_operand_ok, offsettable_memref_p, offsettable_nonstrict_memref_p, constrain_operands, store_data_bypass_p): Likewise. * reg-stack.c (subst_stack_regs_pat): Likewise. * regclass.c (record_operand_costs, scan_one_insn, record_reg_classes, copy_cost, reg_scan_mark_refs): Likewise. * regmove.c (optimize_reg_copy_3, stack_memref_p, combine_stack_adjustments_for_block): Likewise. * regrename.c (copyprop_hardreg_forward_1): Likewise. * reload.c (can_reload_into, push_reload, decompose, immune_p, find_reloads, find_reloads_address, find_reloads_address_1, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg): Likewise. * reload1.c (reload, eliminate_regs, eliminate_regs_in_insn, reload_as_needed, choose_reload_regs, emit_input_reload_insns, do_input_reload, emit_reload_insns, gen_reload, delete_output_reload, delete_address_reloads): Likewise. * resource.c (mark_referenced_resources): Likewise. * rtlanal.c (get_jump_table_offset, count_occurrences, reg_referenced_p, reg_set_p, set_of_1, set_noop_p, reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol, sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms, sdbout_global_decl): Likewise. * simplify-rtx.c (simplify_subreg): Likewise. * stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl, expand_anon_union_decl, expand_end_case_type): Likewise. * unroll.c (calculate_giv_inc): Likewise. * var-tracking.c (stack_adjust_offset_pre_post, bb_stack_adjust_offset, track_expr_p, count_uses, add_uses, add_stores, compute_bb_dataflow, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (make_var_volatile, notice_global_symbol, assemble_external, decode_addr_const, mark_weak, default_encode_section_info): Likewise. From-SVN: r83980
2004-07-01 14:52:53 +02:00
if (MEM_P (l->loc)
&& CSELIB_VAL_PTR (XEXP (l->loc, 0)) == addr_elt)
return;
addr_elt->addr_list = new_elt_list (addr_elt->addr_list, mem_elt);
[multiple changes] Mon Jul 9 06:41:07 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * emit-rtl.c (adjust_address_nv, replace_equiv_address_nv): New fcns. (operand_subword): Use them. (change_address_1): Renamed from change_address; new arg VALIDATE. * expr.h: Reflect above changes; change_address now macro. * alias.c (canon_rtx): Use replace_equiv_address_nv instead of making MEM. * cselib.c (add_mem_for_addr): Likewise. * expr.c (protect_from_queue, emit_move_insn_1): Likewise. * regmove.c (try_apply_stack_adjustment): Likewise. * reload.c (push_reload, make_memloc): Likewise. * reload1.c (eliminate_regs): Likewise. * simplify-rtx.c (simplify_replace_rtx): Likewise. * caller-save.c (setup_save_areas): Use adjust_address_nv instead of adjust_addess. * combine.c (make_extraction, simplify_shift_const): Likewise. (gen_lowpart_for_combine): Likewise. * cse.c (gen_lowpart_if_possible): Likewise. * function.c (fixup_var_refs_1, purge_addressof_1): Likewise. * expr.c (expand_expr, case COMPONENT_REF): Likewise. * optabs.c (gen_move_insn): Likewise. * reload1.c (alter_reg): Likewise. * simplify-rtx.c (simplify_subreg): Likewise. * stmt.c (expand_anon_union_decl): Likewise. * recog.c (validate_replace_rtx_1): Likewise. (expr.h): Include. * Makefile.in (recog.o): Add $(EXPR_H). * explow.c (stabilize): Call replace_equiv_address. * expr.c (move_by_pieces_1, store_by_pieces_2): Likewise. * final.c (alter_subreg): OFFSET is HOST_WIDE_INT. 2001-07-09 Bo Thorsen <bo@suse.co.uk> * config/i386/unix.h (ASM_OUTPUT_MI_THUNK): Fix x86-64 vtable support. 2001-07-09 Neil Booth <neil@daikokuya.demon.co.uk> * final.c (output_addr_const): Use target opening and closing parentheses. * target-def.h: Define TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN defaults, add to TARGET_ASM_OUT. * target.h (struct gcc_target): Add open_paren and close_paren. * doc/md.texi: Update. * doc/tm.texi: Document TARGET_ASM_FUNCTION_END_PROLOGUE, TARGET_ASM_FUNCTION_BEGIN_EPILOGUE, TARGET_ASM_OPEN_PAREN and TARGET_ASM_CLOSE_PAREN. * config/i386/i386.c (TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN): Override. * config/pdp11/pdp11.c (TARGET_ASM_OPEN_PAREN, TARGET_ASM_CLOSE_PAREN): Override. * config/1750a/1750a.h (ASM_OPEN_PAREN, ASM_CLOSE_PAREN): Remove. * config/a29k/a29k.h: Similarly. * config/alpha/alpha.h: Similarly. * config/arc/arc.h: Similarly. * config/arm/aof.h: Similarly. * config/arm/aout.h: Similarly. * config/avr/avr.h: Similarly. * config/c4x/c4x.h: Similarly. * config/clipper/clipper.h: Similarly. * config/convex/convex.h: Similarly. * config/d30v/d30v.h: Similarly. * config/dsp16xx/dsp16xx.h: Similarly. * config/elxsi/elxsi.h: Similarly. * config/fr30/fr30.h: Similarly. * config/h8300/h8300.h: Similarly. * config/i370/i370.h: Similarly. * config/i386/i386.h: Similarly. * config/i860/i860.h: Similarly. * config/i960/i960.h: Similarly. * config/ia64/ia64.h: Similarly. * config/m32r/m32r.h: Similarly. * config/m68hc11/m68hc11.h: Similarly. * config/m68k/m68k.h: Similarly. * config/m88k/m88k.h: Similarly. * config/mcore/mcore.h: Similarly. * config/mips/mips.h: Similarly. * config/mn10200/mn10200.h: Similarly. * config/mn10300/mn10300.h: Similarly. * config/ns32k/ns32k.h: Similarly. * config/pa/pa.h: Similarly. * config/pdp11/pdp11.h: Similarly. * config/pj/pj.h: Similarly. * config/romp/romp.h: Similarly. * config/rs6000/rs6000.h: Similarly. * config/sh/sh.h: Similarly. * config/sparc/sparc.h: Similarly. * config/v850/v850.h: Similarly. * config/vax/vax.h: Similarly. * config/we32k/we32k.h: Similarly. 2001-07-09 Joseph S. Myers <jsm28@cam.ac.uk> * doc/c-tree.texi: Document representation of attributes. 2001-07-08 Joseph S. Myers <jsm28@cam.ac.uk> * doc/tm.texi: Update some places for the rename of target to targetm. Fix typo. 2001-07-08 Joseph S. Myers <jsm28@cam.ac.uk> * target.h (struct gcc_target): Add insert_attributes. * target-def.h (TARGET_INSERT_ATTRIBUTES): Define. (TARGET_INITIALIZER): Update. * tree.c, tree.h (default_insert_attributes): New function. Update comments on other default functions to refer to targetm, not target. * doc/tm.texi (INSERT_ATTRIBUTES): Update to document TARGET_INSERT_ATTRIBUTES. (SET_DEFAULT_DECL_ATTRIBUTES): Remove. * c-common.c (decl_attributes): Use targetm.insert_attributes. Don't use PRAGMA_INSERT_ATTRIBUTES. * Makefile.in (c-common.o): Depend on $(TARGET_H). * c-decl.c (start_decl, start_function): Don't call SET_DEFAULT_DECL_ATTRIBUTES. * config/c4x/c4x.h (SET_DEFAULT_DECL_ATTRIBUTES): Don't define. * config/c4x/c4x-protos.h (c4x_set_default_attributes): Don't declare. * config/c4x/c4x.c (TARGET_INSERT_ATTRIBUTES): Define. (c4x_check_attribute): Avoid modifying attribute list itself. (c4x_set_default_attributes): Rename to c4x_insert_attributes. Make static. * config/sh/sh.h (PRAGMA_INSERT_ATTRIBUTES): Don't define. * config/sh/sh-protos.h (sh_pragma_insert_attributes): Don't declare. * config/sh/sh.c (TARGET_INSERT_ATTRIBUTES): Define. (sh_pragma_insert_attributes): Rename to sh_insert_attributes. Make static. * config/v850/v850.h (SET_DEFAULT_DECL_ATTRIBUTES): Don't define. * config/v850/v850-protos.h (v850_set_default_decl_attr): Don't declare. * config/v850/v850.c (TARGET_INSERT_ATTRIBUTES): Define. (v850_set_default_decl_attr): Rename to v850_insert_attributes. Adjust parameters. Make static. 2001-07-08 Joseph S. Myers <jsm28@cam.ac.uk> * c-common.c (decl_attributes): Only take a single attributes parameter. * c-common.h (decl_attributes): Update prototype. * c-decl.c (start_decl, start_function): Only take a single attributes parameter. Update calls to decl_attributes. (finish_struct, finish_enum): Update calls to decl_attributes. (push_parm_decl): Expect unified list of attributes. Update call to decl_attributes. * c-parse.in (fndef, initdcl, notype_initdcl, nested_function, notype_nested_function, component_declarator, component_notype_declarator, label): Update calls to decl_attributes. (absdcl_maybe_attribute, parm, firstparm, myparm): Unify attribute lists that are passed to push_parm_decl. * c-tree.h (start_function, start_decl): Update prototypes. * config/sh/sh-protos.h, config/sh/sh.c (sh_pragma_insert_attributes): Only take a single attributes parameter. * config/sh/sh.h (PRAGMA_INSERT_ATTRIBUTES): Likewise. * doc/tm.texi (INSERT_ATTRIBUTES): Update. * objc/objc-act.c (define_decl, generate_objc_symtab_decl, build_module_descriptor, generate_static_references, generate_strings, build_selector_translation_table, generate_descriptor_table, generate_protocols, generate_ivars_list, generate_dispatch_table, generate_protocol_list, generate_category, generate_shared_structures, really_start_method, add_objc_decls, generate_classref_translation_entry): Update calls to start_decl and start_function. (build_tmp_function_decl, start_method_def): Unify attribute lists that are passed to push_parm_decl. 2001-07-08 Neil Booth <neil@daikokuya.demon.co.uk> * final.c (no_asm_to_stream): New. (final_scan_insn): Use target structures for prologue ends and epilogue starts. * output.h (no_asm_to_stream): New. * target-def.h (TARGET_ASM_FUNCTION_END_PROLOGUE, TARGET_ASM_FUNCTION_BEGIN_EPILOGUE): New. (TARGET_ASM_OUT): Update. * target.h (struct gcc_target): New members function_end_prologue and function_begin_epilogue. * config/1750/1750.h (ASM_OUTPUT_FUNNAM): Delete as unused. * config/alpha/alpha-protos.h (output_end_prologue): Delete. * config/alpha/alpha.c (output_end_prologue): Rename to alpha_output_function_end_prologue. Use in target struct and make static. * config/alpha/alpha.h (FUNCTION_END_PROLOGUE): Delete. * config/ia64/ia64-protos.h (ia64_output_end_prologue): Delete. * config/ia64/ia64.c (ia64_output_end_prologue): Rename to ia64_output_function_end_prologue. Use in target struct and make static. (ia64_function_prologue, ia64_funciton_epilogue): Rename mistyped prototypes. * config/ia64/ia64.h (FUNCTION_END_PROLOGUE): Delete. * config/m88k/m88k-protos.h (m88k_end_prologue, m88k_begin_epilogue): Delete. * config/m88k/m88k.c (m88k_end_prologue, m88k_begin_epilogue): Rename an use in target struct, make static. * config/ia64/ia64.h (FUNCTION_END_PROLOGUE, FUNCTION_BEGIN_EPILOGUE): Delete. 2001-07-08 Richard Henderson <rth@redhat.com> * stmt.c (emit_case_nodes): Convert modes properly in low+high test. 2001-07-08 Richard Henderson <rth@redhat.com> * config/i386/i386.md: Remove constraints strings from define_split and define_peephole2 patterns. (eh_return_si, eh_return_di): Split eh_return_1 for modes. (eh_return): Use them. 2001-07-08 Richard Henderson <rth@redhat.com> * doc/tm.texi (Exception Handling): New subnode of Stack and Calling. Document MD_FALLBACK_FRAME_STATE_FOR. 2001-07-07 Stephane Carrez <Stephane.Carrez@worldnet.fr> * config/m68hc11/m68hc11.c (m68hc11_initial_elimination_offset): Take into account m68hc11_sp_correction for FRAME_POINTER_REGNUM elimination. * config/m68hc11/m68hc11.h (STARTING_FRAME_OFFSET): Use 0. 2001-07-07 Nick Clifton <nickc@cambridge.redhat.com> * config/ia64/sysv4.h (ASM_OUTPUT_LABELREF): Append # to end of the label inside NAME as opposed to just the end of NAME. 2001-07-07 Neil Booth <neil@daikokuya.demon.co.uk> * config/alpha/alpha-protos.h (vms_valid_decl_attribute_p): Delete. * config/alpha/alpha.c (alpha_init_machine_status, alpha_mark_machine_status, alpha_free_machine_status): Delete. (TARGET_VALID_DECL_ATTRIBUTE): Define for VMS. (vms_valid_decl_attribute_p): Make static, conditionally compile. * config/alpha/alpha.h (VALID_MACHINE_DECL_ATTRIBUTE): Delete. 2001-07-06 Stan Shebs <shebs@apple.com> * target.h (targetm): Rename global from "target", so as not to conflict with local variables. * c-decl.c: Ditto. * c-typeck.c: Ditto. * final.c: Ditto. * tree.c: Ditto. * cp/decl.c: Ditto. * cp/decl2.c: Ditto. * cp/typeck.c: Ditto. * 1750a/1750a.c: Ditto. * a29k/a29k.c: Ditto. * arc/arc.c: Ditto. * arm/arm.c: Ditto. * avr/avr.c: Ditto. * clipper/clipper.c: Ditto. * convex/convex.c: Ditto. * d30v/d30v.c: Ditto. * dsp16xx/dsp16xx.c: Ditto. * elxsi/elxsi.c: Ditto. * fr30/fr30.c: Ditto. * h8300/h8300.c: Ditto. * i370/i370.c: Ditto. * i386/i386.c: Ditto. * i860/i860.c: Ditto. * i960/i960.c: Ditto. * ia64/ia64.c: Ditto. * m32r/m32r.c: Ditto. * m68hc11/m68hc11.c: Ditto. * m68k/m68k.c: Ditto. * m88k/m88k.c: Ditto. * mips/mips.c: Ditto. * ns32k/ns32k.c: Ditto. * pa/pa.c: Ditto. * pdp11/pdp11.c: Ditto. * romp/romp.c: Ditto. * rs6000/rs6000.c: Ditto. * sh/sh.c: Ditto. * sparc/sparc.c: Ditto. * vax/vax.c: Ditto. * we32k/we32k.c: Ditto. * doc/tm.texi: Update the manual to match. 2001-07-06 Richard Henderson <rth@redhat.com> * except.h (MUST_USE_SJLJ_EXCEPTIONS): Examine the value of DWARF2_UNWIND_INFO not just whether it is defined. 2001-07-06 Diego Novillo <dnovillo@redhat.com> * combine.c (combine_simplify_rtx): Also recompute 'mode' if the call to simplify_binary_operation returns a new pattern. 2001-07-06 Roman Lechtchinsky <rl@cs.tu-berlin.de> * glimits.h (__SHRT_MAX__): New. (SHRT_MIN, USHRT_MAX): Define in terms of SHRT_MAX. (SHRT_MAX): Define in terms of __SHRT_MAX__. 2001-07-06 Jan van Male <jan.vanmale@fenk.wau.nl> * alias.c (base_alias_check): Cast GET_MODE_UNIT_SIZE to int to avoid warnings. 2001-07-06 Richard Henderson <rth@redhat.com> * bitmap.c (bitmap_release_memory): Move adjacent to the allocation functions. (bitmap_first_set_bit, bitmap_last_set_bit): Streamline knowing the implementation. Binary search for the set bit. (bitmap_union_of_diff): Allocate the temporary on the stack instead of using xmalloc. 2001-07-06 Richard Henderson <rth@redhat.com> * genrecog.c (validate_pattern): Warn for constraints in define_{expand,split,peephole2}. Remove strict_low_part before looking up match_dup. 2001-07-06 DJ Delorie <dj@redhat.com> * doc/gcc.texi (Makefile): Rename to be a more general purpose chapter about various build hints and history. Add section talking about the various types of native and cross builds. 2001-07-06 Neil Booth <neil@daikokuya.demon.co.uk> * Makefile.in (final.o): Depend on target.h. * final.c: Include target.h. (default_function_pro_epilogue): New. (final_start_function): Use target structure for function prologues. (final_end_function): Use target structure for function epilogues. * fold-const.c (real_hex_to_f): Constify s and p. * output.h (default_function_pro_epilogue): New. * real.h (real_hex_to_f): Update prototype. * target-def.h (TARGET_ASM_FUNCTION_PROLOGUE, TARGET_ASM_FUNCTION_EPILOGUE, TARGET_ASM_OUT): New. (TARGET_INITIALIZER): Update. * target.h (gcc_target): Add struct asm_out. * doc/tm.texi: Update. config: Update each arch to use TARGET_ASM_FUNCTION_PROLOGUE and TARGET_ASM_FUNCTION_EPILOGUE. Move macro code to functions in cpu/cpu.c, or rename old functions consistently. Take a HOST_WIDE INT not an int as the SIZE parameter. Remove now redundant macros and prototypes. Make new functions static. * 1750a/1750a.c: Similarly. * 1750a/1750a.h: Similarly. * a29k/a29k-protos.h: Similarly. * a29k/a29k.c: Similarly. * a29k/a29k.h: Similarly. * arc/arc-protos.h: Similarly. * arc/arc.c: Similarly. * arc/arc.h: Similarly. * arm/arm-protos.h: Similarly. * arm/arm.c: Similarly. * arm/arm.h: Similarly. * avr/avr-protos.h: Similarly. * avr/avr.c: Similarly. * avr/avr.h: Similarly. * clipper/clipper-protos.h: Similarly. * clipper/clipper.c: Similarly. * clipper/clipper.h: Similarly. * convex/convex.c: Similarly. * convex/convex.h: Similarly. * d30v/d30v-protos.h: Similarly. * d30v/d30v.c: Similarly. * d30v/d30v.h: Similarly. * d30v/d30v.md: Similarly. * dsp16xx/dsp16xx-protos.h: Similarly. * dsp16xx/dsp16xx.c: Similarly. * dsp16xx/dsp16xx.h: Similarly. * elxsi/elxsi.c: Similarly. * elxsi/elxsi.h: Similarly. * fr30/fr30.c: Similarly. * fr30/fr30.md: Similarly. * h8300/h8300-protos.h: Similarly. * h8300/h8300.c: Similarly. * h8300/h8300.h: Similarly. * i370/i370-protos.h: Similarly. * i370/i370.c: Similarly. * i370/i370.h: Similarly. * i386/i386.c: Similarly. * i386/osf1elf.h: Similarly. * i386/osfrose.h: Similarly. * i860/i860-protos.h: Similarly. * i860/i860.c: Similarly. * i860/i860.h: Similarly. * i960/i960-protos.h: Similarly. * i960/i960.c: Similarly. * i960/i960.h: Similarly. * ia64/ia64-protos.h: Similarly. * ia64/ia64.c: Similarly. * ia64/ia64.h: Similarly. * m32r/m32r-protos.h: Similarly. * m32r/m32r.c: Similarly. * m32r/m32r.h: Similarly. * m68hc11/m68hc11-protos.h: Similarly. * m68hc11/m68hc11.c: Similarly. * m68hc11/m68hc11.h: Similarly. * m68k/crds.h: Similarly. * m68k/dpx2.h: Similarly. * m68k/m68k-protos.h: Similarly. * m68k/m68k.c: Similarly. * m68k/m68k.h: Similarly. * m68k/news.h: Similarly. * m88k/m88k-protos.h: Similarly. * m88k/m88k.c: Similarly. * m88k/m88k.h: Similarly. * mips/mips-protos.h: Similarly. * mips/mips.c: Similarly. * mips/mips.h: Similarly. * ns32k/merlin.h: Similarly. * ns32k/ns32k.c: Similarly. * ns32k/ns32k.h: Similarly. * ns32k/tek6000.h: Similarly. * pa/pa-protos.h: Similarly. * pa/pa.c: Similarly. * pa/pa.h: Similarly. * pdp11/2bsd.h: Similarly. * pdp11/pdp11-protos.h: Similarly. * pdp11/pdp11.c: Similarly. * pdp11/pdp11.h: Similarly. * romp/romp-protos.h: Similarly. * romp/romp.c: Similarly. * romp/romp.h: Similarly. * rs6000/rs6000-protos.h: Similarly. * rs6000/rs6000.c: Similarly. * rs6000/rs6000.h: Similarly. * rs6000/sysv4.h: Similarly. * sh/sh-protos.h: Similarly. * sh/sh.c: Similarly. * sh/sh.h: Similarly. * sparc/sparc-protos.h: Similarly. * sparc/sparc.c: Similarly. * sparc/sparc.h: Similarly. * vax/vax.c: Similarly. * vax/vax.h: Similarly. * vax/vms.h: Similarly. * we32k/we32k.c: Similarly. * we32k/we32k.h: Similarly. Fri Jul 6 11:47:59 2001 Jeffrey A Law (law@cygnus.com) * basic-block.h (first_insn_after_basic_block_note): Declare. * flow.c (first_insn_after_basic_block_note): Define. Moved from... * ssa.c (first_insn_after_basic_block_note): Remove. * ssa-dce.c (find_inherently_necessary): Consider BARRIERs necessary. (ssa_eliminate_dead_code): Properly update the CFG and PHI nodes when we find a dead conditional branch. Insert BARRIERs after any blocks with no successors, but which do not have any BARRIERs. 2001-07-06 Zack Weinberg <zackw@stanford.edu> * varray.c (varray_check_failed): Use internal_error. 2001-07-05 Andrew Haley <aph@redhat.com> * Makefile.in (LIB2_DIVMOD_FUNCS): New. (LIB2FUNCS): Move divmod functions to LIB2_DIVMOD_FUNCS. * mklibgcc.in: Compile LIB2_DIVMOD_FUNCS. 2001-07-02 Jason Merrill <jason_merrill@redhat.com> * dwarf2out.c (mem_loc_descriptor): Only look through a constant pool reference if the target constant is also a SYMBOL_REF. 2001-07-05 Eric Christopher <echristo@redhat.com> * config/mips/mips.h (MASK_MIPS3900): Remove. (MASK_MIPS16,MASK_NO_CHECK_ZERO_DIV,MASK_CHECK_RANGE_DIV, MASK_UNINIT_CONST_IN_RODATA): Change for 3900 mask removal. (TARGET_MIPS3900): Change to use mips_arch. (TARGET_MIPS4000): New. (TARGET_MIPS4100): New. (TARGET_MIPS4300): New. (TARGET_SWITCHES): Change 3900 and 4650 options to NULL. (SUBTARGET_TARGET_OPTIONS): Add -march. Change help text for -mipsX. (GENERATE_BRANCHLIKELY): Move TARGET_MIPS3900. (ISA_HAS_BRANCHLIKELY): To here. (CC1_CPU_SPEC): New. (CC1_SPEC): Use here. Remove 4650 and 3900 options. (mips_arch_string): Declare. (mips_arch): Declare. (TARGET_OPTIONS): Add -march and -mtune. * config/mips/mips.c (mips_arch_string): New. (mips_arch): New. (override_options): Handle -march for codegen and -mtune for scheduling. Use mips_arch. Move tx39 target default here. (mips_parse_cpu): Move error message to override_options. * config/mips/r3900.h (TARGET_DEFAULT): Remove. * config/mips/mips.md: Use TARGET_MIPS4000 and TARGET_MIPS4300. * doc/invoke.texi (Option Summary): Add -march and -mtune entries. (MIPS Options): Ditto. Change mcpu entry to historical text. 2001-07-05 H.J. Lu (hjl@gnu.org) * config/mips/mips.c (mips_parse_cpu): New function to parse -march=*/-mcpu=*. 2001-07-05 Jim Wilson <wilson@redhat.com> * config/ia64/lib1funcs.asm: Revert 2001-07-02 change. * config/ia64/t-ia64: Likewise. (LIB1ASMFUNCS): Update comment. 2001-07-05 David Edelsohn <edelsohn@gnu.org> * doc/install.texi (Install GCC: Binaries): Fix typo. 2001-07-04 Stephane Carrez <Stephane.Carrez@worldnet.fr> * config/m68hc11/m68hc11.md ("*ashlsi3"): Operand 1 can be a memory reference using the stack pointer, adjust it since we push Y temporarily. ("*ashrsi3"): Likewise. ("*lshrsi3"): Likewise. 2001-07-05 Stephane Carrez <Stephane.Carrez@worldnet.fr> * config/m68hc11/m68hc11.h (RETURN_ADDR_RTX): Fix return address when -fomit-frame-pointer is used. 2001-07-05 Jeffrey Oldham <oldham@codesourcery.com> * flow.c: Reverse Jan Hubicka's patch of 02July2001. (try_redirect_by_replacing_jump): Reverse updating properly the count and frequency information. Reverse removing cc0 setter. (forwarder_block_p): Reverse fixing for fallthru blocks. 2001-07-05 DJ Delorie <dj@redhat.com> * gcc.c (TARGET_OPTION_TRANSLATE_TABLE): New. (translate_options): If the above is defined, use it to map given options to new options. * doc/tm.texi: Document it. 2001-07-05 Brad Lucier <lucier@math.purdue.edu> Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> * doc/invoke.texi (Optimize Options): Document that -fgcse may cause programs using computed gotos to run more slowly. 2001-07-05 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> * doc/install.texi (Specific): Markup, spelling and typo fixes. Fixed sorting. Consistently require binutils 2.11.2, not prereleases. (Specific, decstation-*): Canonicalize as mips-dec-*. (Specific, i?86-*-sco3.2v5*): Remove make bootstrap requirement, always necessary. (Specific, m68k-altos): Removed reference to README.altos, deleted. (Specific, mips-*): Reword MIPS C compiler requirements. (Specific, powerpc*-*-*): New, mention --with-cpu once. (Specific, sunv5): Removed, obsolete. 2001-07-05 Nathan Sidwell <nathan@codesourcery.com> * dwarf2out.c (output_loc_list): Use an all ones mask for .text asm output and don't rely on long long literals. Reformat some long lines. 2001-07-05 Andreas Jaeger <aj@suse.de> * doc/gcc.texi (GNU/Linux): Remove accidental re-add of GPL section. 2001-07-04 Daniel Berlin <dan@cgsoftware.com> * dwarf2out.c (dwarf2out_define): Update comment. (dwarf2out_undef): Ditto. (dwarf2out_start_source_file): Ditto. (dwarf2out_end_source_file): Ditto. (dwarf2out_finish): Output DW_MACINFO_end_file for primary file, since we never call the start/end debug hook for the primary file. 2001-07-04 Kazu Hirata <kazu@hxi.com> * config/h8300/h8300.c (get_shift_alg): Remove an extra operand from shll. 2001-07-04 Nathan Sidwell <nathan@codesourcery.com> * cppinit.c (remove_dup_dirs): Inform if a system include directory is being reordered. * doc/invoke.texi (Directory Options): GCC warns if you hide a system include. * doc/cpp.texi (Search Paths): Likewise. * doc/gcc.texi (Interoperation): Remove information about -I/usr/include. 2001-07-04 Nathan Sidwell <nathan@codesourcery.com> * varray.h (VARRAY_TOP_GENERIC_PTR): Remove spurious parameter. (VARRAY_TOP_CHAR_PTR): Likewise. 2001-07-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * gcc.c (process_command): Don't assign elements of a const char*. Wed Jul 4 13:40:02 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * emit-rtl.c (change_address): Don't abort if invalid address while reload is in progress. 2001-07-04 Daniel Berlin <dan@cgsoftware.com> * c-lex.c (cb_file_change): Pass line number to debug_start_source_file. (cb_undefine): Pass correct line number to debug_undef. * toplev.c (debug_start_source_file): Add line number to parameters. Pass it along to dwarf2out_start_source_file. (decode_g_option): Stop resetting debug level back to normal when we change debug formats, unless the current level is none. (Before, -g3 -gdwarf-2 would use debug level 2, rather than 3). * toplev.h (debug_start_source_file): Add line number to parameters. * dwarf2out.h (dwarf2out_start_source_file): Add line number to parameters. * dwarf2out.c (dwarf2out_start_source_file): Add line number to parameters. Output debug_macinfo data for starting file if requested. (dwarf2out_end_source_file): Output debug_macinfo data for ending file if requested. (dwarf2out_define): Output debug_macinfo data for defining a macro if requested. (dwarf2out_undef): Output debug_macinfo data for undefining a macro if requested. (DEBUG_MACINFO_SECTION): New. DWARF2 macro info section name. (DEBUG_MACINFO_SECTION_LABEL): New. DWARF2 macro info section label. (macinfo_section_label): New. DWARF2 macro info section label. (dwarf2out_init): If we want macro info, output the start label for the section. (dwarf2out_finish): If we want macro info, add a DW_AT_macro_info attribute to the compilation unit die pointing to the macro info. 2001-07-04 Daniel Berlin <dan@cgsoftware.com> * dwarf2out.c (new_loc_list): Move to inside #ifdef DWARF2_DEBUGGING_INFO. (add_loc_descr_to_loc_list): Ditto. (output_loc_list): Ditto. Also, fix thinko in curr not being initialized. (gen_internal_sym): Ditto. Wed Jul 4 13:40:02 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * emit-rtl.c (replace_equiv_address): New function. * expr.h (replace_equiv_address): New declaration. * explow.c (validize_mem): Call it instead of change_address and also call if -fforce-addr and address is constant. * expr.c: Replace more calls to change_address with adjust_address and/or replace_equiv_address or to validize_mem. * function.c, regmove.c, config/alpha/alpha.c: Likewise. * config/arm/arm.md, config/clipper/clipper.md: Likewise. * config/dsp16xx/dsp16xx.md, config/fr30/fr30.c: Likewise. * config/i370/i370.md, config/i860/i860.md: Likewise. * config/i960/i960.md, config/mips/mips.c: Likewise. * config/mips/mips.md, config/pa/pa.md: Likewise. * config/pdp11/pdp11.md, config/rs6000/rs6000.c: Likewise. * config/rs6000/rs6000.md, config/sh/sh.md: Likewise. 2001-07-04 Kaveh R. Ghazi <ghazi@caip.rutgers.edu> * bitmap.c (bitmap_union_of_diff): Don't use BITMAP_ALLOCA. * bitmap.h (BITMAP_ALLOCA): Don't pass alloca as an argument to a function. 2001-07-04 Joseph S. Myers <jsm28@cam.ac.uk> * doc/include: New directory. * doc/fdl.texi: Move to doc/include/fdl.texi. * doc/texinfo.tex: Move to doc/include/texinfo.tex. * doc/include/funding.texi, doc/include/gpl.texi: New files. * doc/gcc.texi: Use funding.texi and gpl.texi. * Makefile.in ($(docdir)/cpp.info, $(docdir)/gcc.info, $(docdir)/cppinternals.info, cpp.dvi. gcc.dvi. cppinternals.dvi): Update dependencies and use -I $(docdir)/include. 2001-07-04 Anthony Green <green@redhat.com> * config/v850/t-v850 (v850-c.o): Add missing dependencies. 2001-07-04 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> * doc/install.texi (sparc64-*-*): Remove garbage. Wed Jul 4 09:07:44 2001 Jan van Male <jan.vanmale@fenk.wau.nl> * i386.c (ix86_expand_builtin, case IX86_BUILTIN_SETPS): Fix typo in last change to use adjust_address. 2001-07-04 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> * doc/install.texi (Specific): Update information for *-*-solaris*. Tue Jul 3 22:33:15 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * explow.c (plus_constant_wide): Reinitialize Y for restart. 2001-07-03 Stan Shebs <shebs@apple.com> * config/darwin.h (SECTION_FUNCTION): Remove WAS_TEXT argument, remove case for flag_no_mach_text_sections. (EXTRA_SECTION_FUNCTIONS): Remove arg from uses of SECTION_FUNCTION. * config/darwin.c (flag_no_mach_text_sections): Remove. * config/darwin-protos.h (darwin_init_pragma): Remove decl. Tue Jul 3 15:35:52 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * explow.c (plus_constant_wide, case PLUS): Call find_constant_term and avoid checking for constant as first operand. * recog.c (find_constant_term_loc): No longer static. (adj_offettable_operand): Delete. * rtl.h (adj_offsettable_operand): Delete declaration. (find_constant_term): Add declaration. * caller-save.c: Replace calls to adj_offsettable_operand with calls to adjust_address. * config/arm/arm.c, config/c4x/c4x.c: Likewise. * config/clipper/clipper.md, config/h8300/h8300.c: Likewise. * config/i386/i386.c, config/i386/i386.md: Likewise. * config/i860/i860.c, config/i960/i960.c: Likewise. * config/i960/i960.md, config/m68hc11/m68hc11.c: Likewise. * config/m68k/m68k.c, config/m68k/m68k.md: Likewise. * config/m88k/m88k.md, config/mcore/mcore.c: Likewise. * config/mips/mips.c, config/mips/mips.md: Likewise. * config/mn10200/mn10200.c, config/mn10300/mn10300.c: Likewise. * config/ns32k/ns32k.c, config/ns32k/ns32k.md: Likewise. * config/pa/pa.c, config/pdp11/pdp11.c: Likewise. * config/pdp11/pdp11.md, config/sh/sh.c, config/v850/v850.c: Likewise. * config/vax/vax.md, config/ns32k/ns32k.c: Likewise. * config/ns32k/ns32k.md: Likewise. 2001-07-03 Zack Weinberg <zackw@stanford.edu> * rtl.c (copy_rtx): Handle 'T' format letter. * gensupport.c (collect_insn_data): Likewise. * print-rtl.c (print_rtx): Print 'T' slots like 's'. 2001-07-03 Nick Clifton <nickc@cambridge.redhat.com> * doc/invoke.texi (Directory Options): Specifiy range for <N> in -B option. Use 'dir' not 'foo' as example directory name. 2001-07-03 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> * config/i386/sol2.h (ASM_PREFERRED_EH_DATA_FORMAT): Define. Fixes PRs bootstrap/3067, bootstrap/3249, bootstrap/3275. 2001-07-03 Joseph S. Myers <jsm28@cam.ac.uk> * doc/cppinternals.texi: Improve formatting and logical markup. 2001-07-03 Andreas Jaeger <aj@suse.de> * Makefile.in (insn-recog.o): Add dependency on reload.h. * genrecog.c (write_header): Include reload.h for prototypes in insn-recog.c. 2001-07-03 Neil Booth <neil@daikokuya.demon.co.uk> config: * i386/cygwin.h (VALID_MACHINE_DECL_ATTRIBUTE, VALID_MACHINE_TYPE_ATTRIBUTE): Remove. * i386/i386-protos.h (i386_pe_valid_decl_attribute_p, i386_pe_valid_type_attribute_p): Add. * i386/i386.c (TARGET_INITIALIZER): Override for cygwin targets. * i386/winnt.c (i386_valid_decl_attribute_p): Return directly. Mon Jul 2 21:52:19 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * explow.c (plus_constant_wide, case LO_SUM): New case. (plus_constant_for_output_wide): Delete. * rtl.h (plus_constant_for_output): Delete. * alias.c (canon_rtx, init_alias_analysis): Call plus_constant instead of plus_constant_for_output. * recog.c (offsettable_address_p, adj_offsettable_operand): Likewise. * config/darwin.c, config/arm/arm.c, config/m68k/m68k.c: Likewise. * config/m88k/m88k.c, config/mips/mips.c, config/pa/pa.c: Likewise. * config/rs6000/rs6000.c, config/sparc/sparc.c: Likewise. * config/sparc/sparc.md: Likewise. Convert some change_address calls to adjust_address. 2001-07-03 Joseph S. Myers <jsm28@cam.ac.uk> * doc/extend.texi, doc/gcc.texi, doc/invoke.texi, doc/md.texi, doc/rtl.texi, doc/tm.texi: Improve formatting. Improve documentation of -std and -Wwrite-strings. 2001-07-02 Geoffrey Keating <geoffk@redhat.com> * cse.c (canon_hash): Don't register registers in very small register classes, as extending their lifetime might cause reload to fail. Mon Jul 2 23:14:00 CEST 2001 Jan Hubicka <jh@suse.cz> * flow.c (try_redirect_by_replacing_jump): Remove cc0 setter. * flow.c (forwarder_block_p): Fix for fallthru blocks. (try_redirect_by_replacing_jump): Update properly the count and frequency information. Mon Jul 2 14:20:13 2001 Jeffrey A Law (law@cygnus.com) * toplev.c (dump_file_index): Move SSA dumps just after first jump dump. (dump_file): Corresponding changes. (rest_of_compilation): Move SSA path to just after the first jump pass. * doc/gcc.texi (Passes): Update due to movement of SSA path. * doc/invoke.texi: Update dump file #s as they were completely out of date with reality. 2001-07-02 Geoffrey Keating <geoffk@redhat.com> * doc/tm.texi (Frame Layout): Document STACK_PUSH_CODE. * expr.c (emit_move_insn_1): Deal with non-default STACK_PUSH_CODE. * expr.c (emit_single_push_insn): Fix warning. 2001-07-02 Toshiyasu Morita <toshiyasu.morita@hsa.hitachi.com> * expr.c (emit_move_insn_1): Avoid modifying cfun->expr->x_stack_pointer when PUSH_ROUNDING is defined. Mon Jul 2 15:33:31 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * emit-rtl.c (adjust_address): New function. * expr.h (adjust_address): Add declaration. * builtins.c: Replace some calls to change_address with calls to it or to validize_mem. * caller-save.c, dwarf2out.c, except.c, expmed.c, expr.c: Likewise. * function.c, config/a29k/a29k.md, config/alpha/alpha.c: Likewise. * config/arm/arm.c, config/convex/convex.c: Likewise. * config/dsp16xx/dsp16xx.md, config/fr30/fr30.c: Likewise. * config/i386/i386.c, config/i386/i386.md: Likewise. * config/ia64/ia64.c, config/ia64/ia64.md: Likewise. * config/m32r/m32r.c, config/m68k/m68k.md: Likewise. * config/m88k/m88k.c, config/mips/mips.md: Likewise. * config/ns32k/ns32k.c, config/rs6000/rs6000.c: Likewise. * config/sh/sh.c, config/sparc/sparc.md: Likewise. 2001-07-02 Jim Wilson <wilson@redhat.com> * config/ia64/ia64.h: Delete obsolete lib1funcs.asm comment. 2001-07-02 Steve Ellcey <sje@cup.hp.com> * config/ia64/t-ia64: Change LIB1ASMFUNCS to use single underscore. * config/ia64/lib1funcs.asm: Change macro names to match t-ia64. 2001-07-02 Zack Weinberg <zackw@stanford.edu> * cppinit.c (lang_defaults): New table. (set_lang): Just read from lang_defaults into the live options structure. 2001-07-02 Zack Weinberg <zackw@stanford.edu> * Makefile.in (doc): Depend on $(GENERATED_MANPAGES). * doc/.cvsignore: Add gcc.1, cpp.1, gcov.1. * doc/gcc.1, doc/cpp.1, doc/gcov.1: Removed. 2001-07-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> * doc/install.texi: Various spelling and markup fixes. (Installing GCC): Component specific installation instructions are gone. Fix reference. Warn about removing old install dir in the presence of shared libs. (Configuration): Invoke with options target to match configure --help. Consistently refer to gas, gld pathnames. Invert --enable-multilib documentation. Remove references to old compiler versions. Mon Jul 2 12:50:51 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * flow.c (try_simplify_condjump): Fix typo in updating fallthru flags. 2001-07-02 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> * doc/install.texi (Specific, mips*-sgi-irix4): Split from IRIX 5 section. (Specific, mips*-sgi-irix5): Note IDO download. Reworded MIPS C hints. Use GNU as instead of GAS. Markup fixes. Removed SGI Freeware reference, IRIX 6 only. (Specific, mips*-sgi-irix6): Removed ranlib caveats, obsolete. Note N64 library requirement/workaround. Update O32 hints. Complete list of structure passing bug victims. 2001-07-02 Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> * doc/install.texi: Remove CVS Id. 2001-07-02 Andreas Jaeger <aj@suse.de> * ssa-dce.c (note_inherently_necessary_set): Add unused attribute. (find_inherently_necessary): Remove unused variable. 2001-07-02 Nathan Sidwell <nathan@codesourcery.com> * c-common.h (TDI_inlined): New ast dump phase. (dump_flag_name): New function. * c-dump.c (dump_files): Add inlined phase. (dump_flag_name): Define. * doc/invoke.texi (-fdump-ast-inlined): Document. Mon Jul 2 06:29:36 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * stor-layout.c (layout_decl): Revert change to handling of alignment in packed types. Sun Jul 1 11:53:52 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * c-common.c (decl_attributes, case A_MODE): Don't call layout_decl for FIELD_DECL. 2001-07-01 Geoffrey Keating <geoffk@redhat.com> * doc/tm.texi (FUNCTION_ARG): Document that the last call is special. 2001-07-01 Nathan Sidwell <nathan@codesourcery.com> * tlink.c (recompile_files): Remove COMPILER_PATH and LIBRARY_PATH from the environment. 2001-07-01 Zack Weinberg <zackw@stanford.edu> * c-common.h (enum rid): Add RID_FIRST_AT, RID_LAST_AT, RID_LAST_PQ. Move RID_FIRST_PQ down with the other FIRST/LAST enumerators. (OBJC_IS_AT_KEYWORD, OBJC_IS_PQ_KEYWORD): New macros. * c-parse.in (OBJC_STRING): Kill. (objc_string): Decompose to [objc_string] '@' STRING. (reswords): Take the leading '@' off all the Objective C keywords. (objc_rid_sans_at): Kill. (init_reswords): Don't initialize it. (yylexname): Use OBJC_IS_AT_KEYWORD and OBJC_IS_PQ_KEYWORD. (_yylex): Kill reconsider label. Look ahead one token after an '@'; if we get an identifier, check whether it's an Objective C @-keyword. If so, return the keyword. Otherwise, put back the token and return the '@' as a terminal. * cpplib.c (lex_macro_node): Remove unnecessary check for leading '@' on identifier. Clarify control flow and commentary. Sun Jul 1 11:53:52 2001 Richard Kenner <kenner@vlsi1.ultra.nyu.edu> * cse.c (new_label_ref): Variable deleted. (insert): Remove set of new_label_ref. (check_for_label_ref): New function. (cse_basic_block): Don't check new_label_ref; call check_for_label_ref. See ChangeLog.5 for earlier changes. From-SVN: r43861
2001-07-09 13:20:51 +02:00
mem_elt->locs
= new_elt_loc_list (mem_elt->locs,
replace_equiv_address_nv (x, addr_elt->val_rtx));
if (mem_elt->next_containing_mem == NULL)
{
mem_elt->next_containing_mem = first_containing_mem;
first_containing_mem = mem_elt;
}
}
/* Subroutine of cselib_lookup. Return a value for X, which is a MEM rtx.
If CREATE, make a new one if we haven't seen it before. */
static cselib_val *
cselib_lookup_mem (rtx x, int create)
{
enum machine_mode mode = GET_MODE (x);
void **slot;
cselib_val *addr;
cselib_val *mem_elt;
struct elt_list *l;
if (MEM_VOLATILE_P (x) || mode == BLKmode
|| !cselib_record_memory
|| (FLOAT_MODE_P (mode) && flag_float_store))
return 0;
/* Look up the value for the address. */
addr = cselib_lookup (XEXP (x, 0), mode, create);
if (! addr)
return 0;
/* Find a value that describes a value of our mode at that address. */
for (l = addr->addr_list; l; l = l->next)
if (GET_MODE (l->elt->val_rtx) == mode)
return l->elt;
if (! create)
return 0;
mem_elt = new_cselib_val (++next_unknown_value, mode);
add_mem_for_addr (addr, mem_elt, x);
slot = htab_find_slot_with_hash (cselib_hash_table, wrap_constant (mode, x),
mem_elt->value, INSERT);
*slot = mem_elt;
return mem_elt;
}
/* Search thru the possible substitutions in P. We prefer a non reg
substitution because this allows us to expand the tree further. If
we find, just a reg, take the lowest regno. There may be several
non-reg results, we just take the first one because they will all
expand to the same place. */
static rtx
expand_loc (struct elt_loc_list *p, bitmap regs_active, int max_depth)
{
rtx reg_result = NULL;
unsigned int regno = UINT_MAX;
struct elt_loc_list *p_in = p;
for (; p; p = p -> next)
{
/* Avoid infinite recursion trying to expand a reg into a
the same reg. */
if ((REG_P (p->loc))
&& (REGNO (p->loc) < regno)
&& !bitmap_bit_p (regs_active, REGNO (p->loc)))
{
reg_result = p->loc;
regno = REGNO (p->loc);
}
/* Avoid infinite recursion and do not try to expand the
value. */
else if (GET_CODE (p->loc) == VALUE
&& CSELIB_VAL_PTR (p->loc)->locs == p_in)
continue;
else if (!REG_P (p->loc))
{
re PR middle-end/31150 (Not promoting an whole array to be static const) PR middle-end/31150 * dse.c (struct store_info): Add const_rhs field. (clear_rhs_from_active_local_stores): Clear also const_rhs. (record_store): Try also cselib_expand_value_rtx to get a constant. (find_shift_sequence, get_stored_val): Use const_rhs instead of rhs if worthwhile. * cselib.c (cselib_record_sets): If !cselib_record_memory and there is just one set from read-only MEM, look at REG_EQUAL or REG_EQUIV note. * dse.c (struct store_info): Add redundant_reason field. (record_store): When storing the same constant as has been stored by an earlier store, set redundant_reason field to the earlier store's insn_info_t. Don't delete cannot_delete insns. (find_shift_sequence): Remove read_info argument, add read_mode and require_cst arguments. Return early if require_cst and constant wouldn't be returned. (get_stored_val): New function. (replace_read): Use it. (scan_insn): Put even cannot_delete insns with exactly 1 store into active_local_stores. (dse_step1): Don't delete cannot_delete insns. Remove redundant constant stores if contains_cselib_groups and earlier store storing the same value hasn't been eliminated. (dse_step6): Renamed to dse_step7. New function. (dse_step7): Renamed from dse_step6. (rest_of_handle_dse): Call dse_step6 and dse_step7 at the end. * cselib.c (cselib_expand_value_rtx): Don't wrap CONST_INTs into CONST unless really necessary. Handle SUBREG, unary, ternary, bitfield and compares specially, to be able to simplify operations on constants. (expand_loc): Try to optimize LO_SUM. * dse.c (get_call_args): New function. (scan_insn): Don't handle BUILT_IN_BZERO. For memset, attempt to get call arguments and if successful and both len and val are constants, handle the call as (mem:BLK) (const_int) store. * dse.c (struct store_info): Add is_large bool field, change positions_needed into a union of a bitmask and bitmap + count. (free_store_info): Free bitmap if is_large. (set_usage_bits): Don't look at stores where offset + width >= MAX_OFFSET. (set_position_unneeded, set_all_positions_unneeded, any_positions_needed_p, all_positions_needed_p): New static inline functions. (record_store): Handle BLKmode stores of CONST_INT, if MEM_SIZE is set on the MEM. Use the new positions_needed accessor inlines. (replace_read): Handle reads from BLKmode CONST_INT stores. (check_mem_read_rtx): Use all_positions_needed_p function. (dse_step1): Free large positions_needed bitmaps and clear is_large. * dse.c (struct store_info): Change begin and end types to HOST_WIDE_INT. * dse.c (record_store): Fix check for unused store. * expr.c (block_clear_fn): No longer static. * expr.h (block_clear_fn): Declare. * dse.c (scan_insn): Memset and bzero can just read their arguments. * gcc.c-torture/execute/20081218-1.c: New test. From-SVN: r142892
2008-12-23 00:41:17 +01:00
rtx result, note;
if (dump_file)
{
print_inline_rtx (dump_file, p->loc, 0);
fprintf (dump_file, "\n");
}
re PR middle-end/31150 (Not promoting an whole array to be static const) PR middle-end/31150 * dse.c (struct store_info): Add const_rhs field. (clear_rhs_from_active_local_stores): Clear also const_rhs. (record_store): Try also cselib_expand_value_rtx to get a constant. (find_shift_sequence, get_stored_val): Use const_rhs instead of rhs if worthwhile. * cselib.c (cselib_record_sets): If !cselib_record_memory and there is just one set from read-only MEM, look at REG_EQUAL or REG_EQUIV note. * dse.c (struct store_info): Add redundant_reason field. (record_store): When storing the same constant as has been stored by an earlier store, set redundant_reason field to the earlier store's insn_info_t. Don't delete cannot_delete insns. (find_shift_sequence): Remove read_info argument, add read_mode and require_cst arguments. Return early if require_cst and constant wouldn't be returned. (get_stored_val): New function. (replace_read): Use it. (scan_insn): Put even cannot_delete insns with exactly 1 store into active_local_stores. (dse_step1): Don't delete cannot_delete insns. Remove redundant constant stores if contains_cselib_groups and earlier store storing the same value hasn't been eliminated. (dse_step6): Renamed to dse_step7. New function. (dse_step7): Renamed from dse_step6. (rest_of_handle_dse): Call dse_step6 and dse_step7 at the end. * cselib.c (cselib_expand_value_rtx): Don't wrap CONST_INTs into CONST unless really necessary. Handle SUBREG, unary, ternary, bitfield and compares specially, to be able to simplify operations on constants. (expand_loc): Try to optimize LO_SUM. * dse.c (get_call_args): New function. (scan_insn): Don't handle BUILT_IN_BZERO. For memset, attempt to get call arguments and if successful and both len and val are constants, handle the call as (mem:BLK) (const_int) store. * dse.c (struct store_info): Add is_large bool field, change positions_needed into a union of a bitmask and bitmap + count. (free_store_info): Free bitmap if is_large. (set_usage_bits): Don't look at stores where offset + width >= MAX_OFFSET. (set_position_unneeded, set_all_positions_unneeded, any_positions_needed_p, all_positions_needed_p): New static inline functions. (record_store): Handle BLKmode stores of CONST_INT, if MEM_SIZE is set on the MEM. Use the new positions_needed accessor inlines. (replace_read): Handle reads from BLKmode CONST_INT stores. (check_mem_read_rtx): Use all_positions_needed_p function. (dse_step1): Free large positions_needed bitmaps and clear is_large. * dse.c (struct store_info): Change begin and end types to HOST_WIDE_INT. * dse.c (record_store): Fix check for unused store. * expr.c (block_clear_fn): No longer static. * expr.h (block_clear_fn): Declare. * dse.c (scan_insn): Memset and bzero can just read their arguments. * gcc.c-torture/execute/20081218-1.c: New test. From-SVN: r142892
2008-12-23 00:41:17 +01:00
if (GET_CODE (p->loc) == LO_SUM
&& GET_CODE (XEXP (p->loc, 1)) == SYMBOL_REF
&& p->setting_insn
&& (note = find_reg_note (p->setting_insn, REG_EQUAL, NULL_RTX))
&& XEXP (note, 0) == XEXP (p->loc, 1))
return XEXP (p->loc, 1);
result = cselib_expand_value_rtx (p->loc, regs_active, max_depth - 1);
if (result)
return result;
}
}
if (regno != UINT_MAX)
{
rtx result;
if (dump_file)
fprintf (dump_file, "r%d\n", regno);
result = cselib_expand_value_rtx (reg_result, regs_active, max_depth - 1);
if (result)
return result;
}
if (dump_file)
{
if (reg_result)
{
print_inline_rtx (dump_file, reg_result, 0);
fprintf (dump_file, "\n");
}
else
fprintf (dump_file, "NULL\n");
}
return reg_result;
}
/* Forward substitute and expand an expression out to its roots.
This is the opposite of common subexpression. Because local value
numbering is such a weak optimization, the expanded expression is
pretty much unique (not from a pointer equals point of view but
from a tree shape point of view.
This function returns NULL if the expansion fails. The expansion
will fail if there is no value number for one of the operands or if
one of the operands has been overwritten between the current insn
and the beginning of the basic block. For instance x has no
expansion in:
r1 <- r1 + 3
x <- r1 + 8
REGS_ACTIVE is a scratch bitmap that should be clear when passing in.
It is clear on return. */
rtx
cselib_expand_value_rtx (rtx orig, bitmap regs_active, int max_depth)
{
rtx copy, scopy;
int i, j;
RTX_CODE code;
const char *format_ptr;
re PR middle-end/31150 (Not promoting an whole array to be static const) PR middle-end/31150 * dse.c (struct store_info): Add const_rhs field. (clear_rhs_from_active_local_stores): Clear also const_rhs. (record_store): Try also cselib_expand_value_rtx to get a constant. (find_shift_sequence, get_stored_val): Use const_rhs instead of rhs if worthwhile. * cselib.c (cselib_record_sets): If !cselib_record_memory and there is just one set from read-only MEM, look at REG_EQUAL or REG_EQUIV note. * dse.c (struct store_info): Add redundant_reason field. (record_store): When storing the same constant as has been stored by an earlier store, set redundant_reason field to the earlier store's insn_info_t. Don't delete cannot_delete insns. (find_shift_sequence): Remove read_info argument, add read_mode and require_cst arguments. Return early if require_cst and constant wouldn't be returned. (get_stored_val): New function. (replace_read): Use it. (scan_insn): Put even cannot_delete insns with exactly 1 store into active_local_stores. (dse_step1): Don't delete cannot_delete insns. Remove redundant constant stores if contains_cselib_groups and earlier store storing the same value hasn't been eliminated. (dse_step6): Renamed to dse_step7. New function. (dse_step7): Renamed from dse_step6. (rest_of_handle_dse): Call dse_step6 and dse_step7 at the end. * cselib.c (cselib_expand_value_rtx): Don't wrap CONST_INTs into CONST unless really necessary. Handle SUBREG, unary, ternary, bitfield and compares specially, to be able to simplify operations on constants. (expand_loc): Try to optimize LO_SUM. * dse.c (get_call_args): New function. (scan_insn): Don't handle BUILT_IN_BZERO. For memset, attempt to get call arguments and if successful and both len and val are constants, handle the call as (mem:BLK) (const_int) store. * dse.c (struct store_info): Add is_large bool field, change positions_needed into a union of a bitmask and bitmap + count. (free_store_info): Free bitmap if is_large. (set_usage_bits): Don't look at stores where offset + width >= MAX_OFFSET. (set_position_unneeded, set_all_positions_unneeded, any_positions_needed_p, all_positions_needed_p): New static inline functions. (record_store): Handle BLKmode stores of CONST_INT, if MEM_SIZE is set on the MEM. Use the new positions_needed accessor inlines. (replace_read): Handle reads from BLKmode CONST_INT stores. (check_mem_read_rtx): Use all_positions_needed_p function. (dse_step1): Free large positions_needed bitmaps and clear is_large. * dse.c (struct store_info): Change begin and end types to HOST_WIDE_INT. * dse.c (record_store): Fix check for unused store. * expr.c (block_clear_fn): No longer static. * expr.h (block_clear_fn): Declare. * dse.c (scan_insn): Memset and bzero can just read their arguments. * gcc.c-torture/execute/20081218-1.c: New test. From-SVN: r142892
2008-12-23 00:41:17 +01:00
enum machine_mode mode;
code = GET_CODE (orig);
/* For the context of dse, if we end up expand into a huge tree, we
will not have a useful address, so we might as well just give up
quickly. */
if (max_depth <= 0)
return NULL;
switch (code)
{
case REG:
{
struct elt_list *l = REG_VALUES (REGNO (orig));
if (l && l->elt == NULL)
l = l->next;
for (; l; l = l->next)
if (GET_MODE (l->elt->val_rtx) == GET_MODE (orig))
{
rtx result;
int regno = REGNO (orig);
/* The only thing that we are not willing to do (this
is requirement of dse and if others potential uses
need this function we should add a parm to control
it) is that we will not substitute the
STACK_POINTER_REGNUM, FRAME_POINTER or the
HARD_FRAME_POINTER.
These expansions confuses the code that notices that
stores into the frame go dead at the end of the
function and that the frame is not effected by calls
to subroutines. If you allow the
STACK_POINTER_REGNUM substitution, then dse will
think that parameter pushing also goes dead which is
wrong. If you allow the FRAME_POINTER or the
HARD_FRAME_POINTER then you lose the opportunity to
make the frame assumptions. */
if (regno == STACK_POINTER_REGNUM
|| regno == FRAME_POINTER_REGNUM
|| regno == HARD_FRAME_POINTER_REGNUM)
return orig;
bitmap_set_bit (regs_active, regno);
if (dump_file)
fprintf (dump_file, "expanding: r%d into: ", regno);
result = expand_loc (l->elt->locs, regs_active, max_depth);
bitmap_clear_bit (regs_active, regno);
if (result)
return result;
else
return orig;
}
}
case CONST_INT:
case CONST_DOUBLE:
case CONST_VECTOR:
case SYMBOL_REF:
case CODE_LABEL:
case PC:
case CC0:
case SCRATCH:
/* SCRATCH must be shared because they represent distinct values. */
return orig;
case CLOBBER:
if (REG_P (XEXP (orig, 0)) && HARD_REGISTER_NUM_P (REGNO (XEXP (orig, 0))))
return orig;
break;
case CONST:
if (shared_const_p (orig))
return orig;
break;
re PR middle-end/31150 (Not promoting an whole array to be static const) PR middle-end/31150 * dse.c (struct store_info): Add const_rhs field. (clear_rhs_from_active_local_stores): Clear also const_rhs. (record_store): Try also cselib_expand_value_rtx to get a constant. (find_shift_sequence, get_stored_val): Use const_rhs instead of rhs if worthwhile. * cselib.c (cselib_record_sets): If !cselib_record_memory and there is just one set from read-only MEM, look at REG_EQUAL or REG_EQUIV note. * dse.c (struct store_info): Add redundant_reason field. (record_store): When storing the same constant as has been stored by an earlier store, set redundant_reason field to the earlier store's insn_info_t. Don't delete cannot_delete insns. (find_shift_sequence): Remove read_info argument, add read_mode and require_cst arguments. Return early if require_cst and constant wouldn't be returned. (get_stored_val): New function. (replace_read): Use it. (scan_insn): Put even cannot_delete insns with exactly 1 store into active_local_stores. (dse_step1): Don't delete cannot_delete insns. Remove redundant constant stores if contains_cselib_groups and earlier store storing the same value hasn't been eliminated. (dse_step6): Renamed to dse_step7. New function. (dse_step7): Renamed from dse_step6. (rest_of_handle_dse): Call dse_step6 and dse_step7 at the end. * cselib.c (cselib_expand_value_rtx): Don't wrap CONST_INTs into CONST unless really necessary. Handle SUBREG, unary, ternary, bitfield and compares specially, to be able to simplify operations on constants. (expand_loc): Try to optimize LO_SUM. * dse.c (get_call_args): New function. (scan_insn): Don't handle BUILT_IN_BZERO. For memset, attempt to get call arguments and if successful and both len and val are constants, handle the call as (mem:BLK) (const_int) store. * dse.c (struct store_info): Add is_large bool field, change positions_needed into a union of a bitmask and bitmap + count. (free_store_info): Free bitmap if is_large. (set_usage_bits): Don't look at stores where offset + width >= MAX_OFFSET. (set_position_unneeded, set_all_positions_unneeded, any_positions_needed_p, all_positions_needed_p): New static inline functions. (record_store): Handle BLKmode stores of CONST_INT, if MEM_SIZE is set on the MEM. Use the new positions_needed accessor inlines. (replace_read): Handle reads from BLKmode CONST_INT stores. (check_mem_read_rtx): Use all_positions_needed_p function. (dse_step1): Free large positions_needed bitmaps and clear is_large. * dse.c (struct store_info): Change begin and end types to HOST_WIDE_INT. * dse.c (record_store): Fix check for unused store. * expr.c (block_clear_fn): No longer static. * expr.h (block_clear_fn): Declare. * dse.c (scan_insn): Memset and bzero can just read their arguments. * gcc.c-torture/execute/20081218-1.c: New test. From-SVN: r142892
2008-12-23 00:41:17 +01:00
case SUBREG:
{
re PR middle-end/31150 (Not promoting an whole array to be static const) PR middle-end/31150 * dse.c (struct store_info): Add const_rhs field. (clear_rhs_from_active_local_stores): Clear also const_rhs. (record_store): Try also cselib_expand_value_rtx to get a constant. (find_shift_sequence, get_stored_val): Use const_rhs instead of rhs if worthwhile. * cselib.c (cselib_record_sets): If !cselib_record_memory and there is just one set from read-only MEM, look at REG_EQUAL or REG_EQUIV note. * dse.c (struct store_info): Add redundant_reason field. (record_store): When storing the same constant as has been stored by an earlier store, set redundant_reason field to the earlier store's insn_info_t. Don't delete cannot_delete insns. (find_shift_sequence): Remove read_info argument, add read_mode and require_cst arguments. Return early if require_cst and constant wouldn't be returned. (get_stored_val): New function. (replace_read): Use it. (scan_insn): Put even cannot_delete insns with exactly 1 store into active_local_stores. (dse_step1): Don't delete cannot_delete insns. Remove redundant constant stores if contains_cselib_groups and earlier store storing the same value hasn't been eliminated. (dse_step6): Renamed to dse_step7. New function. (dse_step7): Renamed from dse_step6. (rest_of_handle_dse): Call dse_step6 and dse_step7 at the end. * cselib.c (cselib_expand_value_rtx): Don't wrap CONST_INTs into CONST unless really necessary. Handle SUBREG, unary, ternary, bitfield and compares specially, to be able to simplify operations on constants. (expand_loc): Try to optimize LO_SUM. * dse.c (get_call_args): New function. (scan_insn): Don't handle BUILT_IN_BZERO. For memset, attempt to get call arguments and if successful and both len and val are constants, handle the call as (mem:BLK) (const_int) store. * dse.c (struct store_info): Add is_large bool field, change positions_needed into a union of a bitmask and bitmap + count. (free_store_info): Free bitmap if is_large. (set_usage_bits): Don't look at stores where offset + width >= MAX_OFFSET. (set_position_unneeded, set_all_positions_unneeded, any_positions_needed_p, all_positions_needed_p): New static inline functions. (record_store): Handle BLKmode stores of CONST_INT, if MEM_SIZE is set on the MEM. Use the new positions_needed accessor inlines. (replace_read): Handle reads from BLKmode CONST_INT stores. (check_mem_read_rtx): Use all_positions_needed_p function. (dse_step1): Free large positions_needed bitmaps and clear is_large. * dse.c (struct store_info): Change begin and end types to HOST_WIDE_INT. * dse.c (record_store): Fix check for unused store. * expr.c (block_clear_fn): No longer static. * expr.h (block_clear_fn): Declare. * dse.c (scan_insn): Memset and bzero can just read their arguments. * gcc.c-torture/execute/20081218-1.c: New test. From-SVN: r142892
2008-12-23 00:41:17 +01:00
rtx subreg = cselib_expand_value_rtx (SUBREG_REG (orig), regs_active,
max_depth - 1);
if (!subreg)
return NULL;
scopy = simplify_gen_subreg (GET_MODE (orig), subreg,
GET_MODE (SUBREG_REG (orig)),
SUBREG_BYTE (orig));
if (scopy == NULL
|| (GET_CODE (scopy) == SUBREG
&& !REG_P (SUBREG_REG (scopy))
&& !MEM_P (SUBREG_REG (scopy))))
return shallow_copy_rtx (orig);
return scopy;
}
re PR middle-end/31150 (Not promoting an whole array to be static const) PR middle-end/31150 * dse.c (struct store_info): Add const_rhs field. (clear_rhs_from_active_local_stores): Clear also const_rhs. (record_store): Try also cselib_expand_value_rtx to get a constant. (find_shift_sequence, get_stored_val): Use const_rhs instead of rhs if worthwhile. * cselib.c (cselib_record_sets): If !cselib_record_memory and there is just one set from read-only MEM, look at REG_EQUAL or REG_EQUIV note. * dse.c (struct store_info): Add redundant_reason field. (record_store): When storing the same constant as has been stored by an earlier store, set redundant_reason field to the earlier store's insn_info_t. Don't delete cannot_delete insns. (find_shift_sequence): Remove read_info argument, add read_mode and require_cst arguments. Return early if require_cst and constant wouldn't be returned. (get_stored_val): New function. (replace_read): Use it. (scan_insn): Put even cannot_delete insns with exactly 1 store into active_local_stores. (dse_step1): Don't delete cannot_delete insns. Remove redundant constant stores if contains_cselib_groups and earlier store storing the same value hasn't been eliminated. (dse_step6): Renamed to dse_step7. New function. (dse_step7): Renamed from dse_step6. (rest_of_handle_dse): Call dse_step6 and dse_step7 at the end. * cselib.c (cselib_expand_value_rtx): Don't wrap CONST_INTs into CONST unless really necessary. Handle SUBREG, unary, ternary, bitfield and compares specially, to be able to simplify operations on constants. (expand_loc): Try to optimize LO_SUM. * dse.c (get_call_args): New function. (scan_insn): Don't handle BUILT_IN_BZERO. For memset, attempt to get call arguments and if successful and both len and val are constants, handle the call as (mem:BLK) (const_int) store. * dse.c (struct store_info): Add is_large bool field, change positions_needed into a union of a bitmask and bitmap + count. (free_store_info): Free bitmap if is_large. (set_usage_bits): Don't look at stores where offset + width >= MAX_OFFSET. (set_position_unneeded, set_all_positions_unneeded, any_positions_needed_p, all_positions_needed_p): New static inline functions. (record_store): Handle BLKmode stores of CONST_INT, if MEM_SIZE is set on the MEM. Use the new positions_needed accessor inlines. (replace_read): Handle reads from BLKmode CONST_INT stores. (check_mem_read_rtx): Use all_positions_needed_p function. (dse_step1): Free large positions_needed bitmaps and clear is_large. * dse.c (struct store_info): Change begin and end types to HOST_WIDE_INT. * dse.c (record_store): Fix check for unused store. * expr.c (block_clear_fn): No longer static. * expr.h (block_clear_fn): Declare. * dse.c (scan_insn): Memset and bzero can just read their arguments. * gcc.c-torture/execute/20081218-1.c: New test. From-SVN: r142892
2008-12-23 00:41:17 +01:00
case VALUE:
if (dump_file)
fprintf (dump_file, "expanding value %s into: ",
GET_MODE_NAME (GET_MODE (orig)));
return expand_loc (CSELIB_VAL_PTR (orig)->locs, regs_active, max_depth);
default:
break;
}
/* Copy the various flags, fields, and other information. We assume
that all fields need copying, and then clear the fields that should
not be copied. That is the sensible default behavior, and forces
us to explicitly document why we are *not* copying a flag. */
copy = shallow_copy_rtx (orig);
re PR middle-end/31150 (Not promoting an whole array to be static const) PR middle-end/31150 * dse.c (struct store_info): Add const_rhs field. (clear_rhs_from_active_local_stores): Clear also const_rhs. (record_store): Try also cselib_expand_value_rtx to get a constant. (find_shift_sequence, get_stored_val): Use const_rhs instead of rhs if worthwhile. * cselib.c (cselib_record_sets): If !cselib_record_memory and there is just one set from read-only MEM, look at REG_EQUAL or REG_EQUIV note. * dse.c (struct store_info): Add redundant_reason field. (record_store): When storing the same constant as has been stored by an earlier store, set redundant_reason field to the earlier store's insn_info_t. Don't delete cannot_delete insns. (find_shift_sequence): Remove read_info argument, add read_mode and require_cst arguments. Return early if require_cst and constant wouldn't be returned. (get_stored_val): New function. (replace_read): Use it. (scan_insn): Put even cannot_delete insns with exactly 1 store into active_local_stores. (dse_step1): Don't delete cannot_delete insns. Remove redundant constant stores if contains_cselib_groups and earlier store storing the same value hasn't been eliminated. (dse_step6): Renamed to dse_step7. New function. (dse_step7): Renamed from dse_step6. (rest_of_handle_dse): Call dse_step6 and dse_step7 at the end. * cselib.c (cselib_expand_value_rtx): Don't wrap CONST_INTs into CONST unless really necessary. Handle SUBREG, unary, ternary, bitfield and compares specially, to be able to simplify operations on constants. (expand_loc): Try to optimize LO_SUM. * dse.c (get_call_args): New function. (scan_insn): Don't handle BUILT_IN_BZERO. For memset, attempt to get call arguments and if successful and both len and val are constants, handle the call as (mem:BLK) (const_int) store. * dse.c (struct store_info): Add is_large bool field, change positions_needed into a union of a bitmask and bitmap + count. (free_store_info): Free bitmap if is_large. (set_usage_bits): Don't look at stores where offset + width >= MAX_OFFSET. (set_position_unneeded, set_all_positions_unneeded, any_positions_needed_p, all_positions_needed_p): New static inline functions. (record_store): Handle BLKmode stores of CONST_INT, if MEM_SIZE is set on the MEM. Use the new positions_needed accessor inlines. (replace_read): Handle reads from BLKmode CONST_INT stores. (check_mem_read_rtx): Use all_positions_needed_p function. (dse_step1): Free large positions_needed bitmaps and clear is_large. * dse.c (struct store_info): Change begin and end types to HOST_WIDE_INT. * dse.c (record_store): Fix check for unused store. * expr.c (block_clear_fn): No longer static. * expr.h (block_clear_fn): Declare. * dse.c (scan_insn): Memset and bzero can just read their arguments. * gcc.c-torture/execute/20081218-1.c: New test. From-SVN: r142892
2008-12-23 00:41:17 +01:00
format_ptr = GET_RTX_FORMAT (code);
re PR middle-end/31150 (Not promoting an whole array to be static const) PR middle-end/31150 * dse.c (struct store_info): Add const_rhs field. (clear_rhs_from_active_local_stores): Clear also const_rhs. (record_store): Try also cselib_expand_value_rtx to get a constant. (find_shift_sequence, get_stored_val): Use const_rhs instead of rhs if worthwhile. * cselib.c (cselib_record_sets): If !cselib_record_memory and there is just one set from read-only MEM, look at REG_EQUAL or REG_EQUIV note. * dse.c (struct store_info): Add redundant_reason field. (record_store): When storing the same constant as has been stored by an earlier store, set redundant_reason field to the earlier store's insn_info_t. Don't delete cannot_delete insns. (find_shift_sequence): Remove read_info argument, add read_mode and require_cst arguments. Return early if require_cst and constant wouldn't be returned. (get_stored_val): New function. (replace_read): Use it. (scan_insn): Put even cannot_delete insns with exactly 1 store into active_local_stores. (dse_step1): Don't delete cannot_delete insns. Remove redundant constant stores if contains_cselib_groups and earlier store storing the same value hasn't been eliminated. (dse_step6): Renamed to dse_step7. New function. (dse_step7): Renamed from dse_step6. (rest_of_handle_dse): Call dse_step6 and dse_step7 at the end. * cselib.c (cselib_expand_value_rtx): Don't wrap CONST_INTs into CONST unless really necessary. Handle SUBREG, unary, ternary, bitfield and compares specially, to be able to simplify operations on constants. (expand_loc): Try to optimize LO_SUM. * dse.c (get_call_args): New function. (scan_insn): Don't handle BUILT_IN_BZERO. For memset, attempt to get call arguments and if successful and both len and val are constants, handle the call as (mem:BLK) (const_int) store. * dse.c (struct store_info): Add is_large bool field, change positions_needed into a union of a bitmask and bitmap + count. (free_store_info): Free bitmap if is_large. (set_usage_bits): Don't look at stores where offset + width >= MAX_OFFSET. (set_position_unneeded, set_all_positions_unneeded, any_positions_needed_p, all_positions_needed_p): New static inline functions. (record_store): Handle BLKmode stores of CONST_INT, if MEM_SIZE is set on the MEM. Use the new positions_needed accessor inlines. (replace_read): Handle reads from BLKmode CONST_INT stores. (check_mem_read_rtx): Use all_positions_needed_p function. (dse_step1): Free large positions_needed bitmaps and clear is_large. * dse.c (struct store_info): Change begin and end types to HOST_WIDE_INT. * dse.c (record_store): Fix check for unused store. * expr.c (block_clear_fn): No longer static. * expr.h (block_clear_fn): Declare. * dse.c (scan_insn): Memset and bzero can just read their arguments. * gcc.c-torture/execute/20081218-1.c: New test. From-SVN: r142892
2008-12-23 00:41:17 +01:00
for (i = 0; i < GET_RTX_LENGTH (code); i++)
switch (*format_ptr++)
{
case 'e':
if (XEXP (orig, i) != NULL)
{
rtx result = cselib_expand_value_rtx (XEXP (orig, i), regs_active, max_depth - 1);
if (!result)
return NULL;
XEXP (copy, i) = result;
}
break;
case 'E':
case 'V':
if (XVEC (orig, i) != NULL)
{
XVEC (copy, i) = rtvec_alloc (XVECLEN (orig, i));
for (j = 0; j < XVECLEN (copy, i); j++)
{
rtx result = cselib_expand_value_rtx (XVECEXP (orig, i, j), regs_active, max_depth - 1);
if (!result)
return NULL;
XVECEXP (copy, i, j) = result;
}
}
break;
case 't':
case 'w':
case 'i':
case 's':
case 'S':
case 'T':
case 'u':
case 'B':
case '0':
/* These are left unchanged. */
break;
default:
gcc_unreachable ();
}
re PR middle-end/31150 (Not promoting an whole array to be static const) PR middle-end/31150 * dse.c (struct store_info): Add const_rhs field. (clear_rhs_from_active_local_stores): Clear also const_rhs. (record_store): Try also cselib_expand_value_rtx to get a constant. (find_shift_sequence, get_stored_val): Use const_rhs instead of rhs if worthwhile. * cselib.c (cselib_record_sets): If !cselib_record_memory and there is just one set from read-only MEM, look at REG_EQUAL or REG_EQUIV note. * dse.c (struct store_info): Add redundant_reason field. (record_store): When storing the same constant as has been stored by an earlier store, set redundant_reason field to the earlier store's insn_info_t. Don't delete cannot_delete insns. (find_shift_sequence): Remove read_info argument, add read_mode and require_cst arguments. Return early if require_cst and constant wouldn't be returned. (get_stored_val): New function. (replace_read): Use it. (scan_insn): Put even cannot_delete insns with exactly 1 store into active_local_stores. (dse_step1): Don't delete cannot_delete insns. Remove redundant constant stores if contains_cselib_groups and earlier store storing the same value hasn't been eliminated. (dse_step6): Renamed to dse_step7. New function. (dse_step7): Renamed from dse_step6. (rest_of_handle_dse): Call dse_step6 and dse_step7 at the end. * cselib.c (cselib_expand_value_rtx): Don't wrap CONST_INTs into CONST unless really necessary. Handle SUBREG, unary, ternary, bitfield and compares specially, to be able to simplify operations on constants. (expand_loc): Try to optimize LO_SUM. * dse.c (get_call_args): New function. (scan_insn): Don't handle BUILT_IN_BZERO. For memset, attempt to get call arguments and if successful and both len and val are constants, handle the call as (mem:BLK) (const_int) store. * dse.c (struct store_info): Add is_large bool field, change positions_needed into a union of a bitmask and bitmap + count. (free_store_info): Free bitmap if is_large. (set_usage_bits): Don't look at stores where offset + width >= MAX_OFFSET. (set_position_unneeded, set_all_positions_unneeded, any_positions_needed_p, all_positions_needed_p): New static inline functions. (record_store): Handle BLKmode stores of CONST_INT, if MEM_SIZE is set on the MEM. Use the new positions_needed accessor inlines. (replace_read): Handle reads from BLKmode CONST_INT stores. (check_mem_read_rtx): Use all_positions_needed_p function. (dse_step1): Free large positions_needed bitmaps and clear is_large. * dse.c (struct store_info): Change begin and end types to HOST_WIDE_INT. * dse.c (record_store): Fix check for unused store. * expr.c (block_clear_fn): No longer static. * expr.h (block_clear_fn): Declare. * dse.c (scan_insn): Memset and bzero can just read their arguments. * gcc.c-torture/execute/20081218-1.c: New test. From-SVN: r142892
2008-12-23 00:41:17 +01:00
mode = GET_MODE (copy);
/* If an operand has been simplified into CONST_INT, which doesn't
have a mode and the mode isn't derivable from whole rtx's mode,
try simplify_*_operation first with mode from original's operand
and as a fallback wrap CONST_INT into gen_rtx_CONST. */
scopy = copy;
switch (GET_RTX_CLASS (code))
{
case RTX_UNARY:
if (CONST_INT_P (XEXP (copy, 0))
&& GET_MODE (XEXP (orig, 0)) != VOIDmode)
{
scopy = simplify_unary_operation (code, mode, XEXP (copy, 0),
GET_MODE (XEXP (orig, 0)));
if (scopy)
return scopy;
}
break;
case RTX_COMM_ARITH:
case RTX_BIN_ARITH:
/* These expressions can derive operand modes from the whole rtx's mode. */
break;
case RTX_TERNARY:
case RTX_BITFIELD_OPS:
if (CONST_INT_P (XEXP (copy, 0))
&& GET_MODE (XEXP (orig, 0)) != VOIDmode)
{
scopy = simplify_ternary_operation (code, mode,
GET_MODE (XEXP (orig, 0)),
XEXP (copy, 0), XEXP (copy, 1),
XEXP (copy, 2));
if (scopy)
return scopy;
}
break;
case RTX_COMPARE:
case RTX_COMM_COMPARE:
if (CONST_INT_P (XEXP (copy, 0))
&& GET_MODE (XEXP (copy, 1)) == VOIDmode
&& (GET_MODE (XEXP (orig, 0)) != VOIDmode
|| GET_MODE (XEXP (orig, 1)) != VOIDmode))
{
scopy = simplify_relational_operation (code, mode,
(GET_MODE (XEXP (orig, 0))
!= VOIDmode)
? GET_MODE (XEXP (orig, 0))
: GET_MODE (XEXP (orig, 1)),
XEXP (copy, 0),
XEXP (copy, 1));
if (scopy)
return scopy;
}
break;
default:
break;
}
if (scopy == NULL_RTX)
{
XEXP (copy, 0)
= gen_rtx_CONST (GET_MODE (XEXP (orig, 0)), XEXP (copy, 0));
if (dump_file)
fprintf (dump_file, " wrapping const_int result in const to preserve mode %s\n",
GET_MODE_NAME (GET_MODE (XEXP (copy, 0))));
}
scopy = simplify_rtx (copy);
if (scopy)
return scopy;
return copy;
}
/* Walk rtx X and replace all occurrences of REG and MEM subexpressions
with VALUE expressions. This way, it becomes independent of changes
to registers and memory.
X isn't actually modified; if modifications are needed, new rtl is
allocated. However, the return value can share rtl with X. */
rtx
cselib_subst_to_values (rtx x)
{
enum rtx_code code = GET_CODE (x);
const char *fmt = GET_RTX_FORMAT (code);
cselib_val *e;
struct elt_list *l;
rtx copy = x;
int i;
switch (code)
{
case REG:
l = REG_VALUES (REGNO (x));
if (l && l->elt == NULL)
l = l->next;
for (; l; l = l->next)
if (GET_MODE (l->elt->val_rtx) == GET_MODE (x))
return l->elt->val_rtx;
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
gcc_unreachable ();
case MEM:
e = cselib_lookup_mem (x, 0);
if (! e)
{
/* This happens for autoincrements. Assign a value that doesn't
match any other. */
e = new_cselib_val (++next_unknown_value, GET_MODE (x));
}
return e->val_rtx;
case CONST_DOUBLE:
i386.md ("mmx_uavgv8qi3"): Use const_vector. 2002-02-19 Aldy Hernandez <aldyh@redhat.com> * config/i386/i386.md ("mmx_uavgv8qi3"): Use const_vector. ("mmx_uavgv4hi3"): Same. ("pmulhrwv4hi3"): Same. * tree-inline.c (walk_tree): Handle vectors. * c-common.c (constant_expression_warning): Handle vectors. (overflow_warning): Same. * sched-deps.c (sched_analyze_2): Handle vectors. * rtlanal.c (rtx_unstable_p): Handle vectors. (rtx_varies_p): Same. (count_occurrences): Same. (regs_set_between_p): Same. (modified_between_p): Same. (modified_in_p): Same. (volatile_insn_p): Same. (volatile_refs_p): Same. (side_effects_p): Same. (may_trap_p): Same. (inequality_comparisons_p): Same. (replace_regs): Same. (computed_jump_p_1): Same. * rtl.c (DEF_MACHMODE): Change all definitions to accept 8th argument. (inner_mode_array): New. (copy_rtx): Handle vectors. (copy_most_rtx): Same. (rtx_equal_p): Same. (get_mode_alignment): Adjust for vectors. * resource.c (mark_referenced_resources): Handle vectors. (mark_set_resources): Same. * reload1.c (eliminate_regs): Handle vectors. (elimination_effects): Same. (scan_paradoxical_subregs): Same. * reload.c (subst_reg_equivs): Handle vectors. * regrename.c (scan_rtx): Handle vectors. * regclass.c (reg_scan_mark_refs): Handle vectors. * recog.c (find_single_use_1): Handle vectors. * local-alloc.c (equiv_init_varies_p): Handle vectors. (contains_replace_regs): Same. (memref_referenced_p): Same. * integrate.c (copy_rtx_and_substitute): Handle vectors. (subst_constants): Same. * genattrtab.c (attr_copy_rtx): Handle vectors. (encode_units_mask): Same. (clear_struct_flag): Same. (count_sub_rtxs): Same. * gcse.c (want_to_gcse_p): Handle vectors. (oprs_unchanged_p): Same. (hash_expr_1): Same. (oprs_not_set_p): Same. (expr_killed_p): Same. (compute_transp): Same. (store_ops_ok): Same. * function.c (purge_addressof_1): Do not allow paradoxical subregs of vectors. (fixup_var_refs_1): Same. (instantiate_virtual_regs_1): Same. * fold-const.c (operand_equal_p): Handle vectors. (fold): Same. (rtl_expr_nonnegative_p): Same. * flow.c (mark_used_regs): Handle vectors. * df.c (df_uses_record): Handle vectors. * cselib.c (cselib_subst_to_values): Handle vectors. (cselib_mem_conflict_p): Same. (hash_rtx): Same. * cse.c (canon_reg): Handle vectors. (fold_rt): Same. (cse_process_notes): Same. (count_reg_usage): Same. (canon_hash): Same. * alias.c (nonlocal_mentioned_p): Add case for CONST_VECTOR. * combine.c (mark_used_regs_combine): Add case for CONST_VECTOR. * emit-rtl.c (init_emit_once): Generate const0_rtx for vectors. (gen_rtx): Handle CONST_VECTOR. (gen_const_vector_0): New. (copy_rtx_if_shared): CONST_VECTORs can be shared. (reset_used_flags): Same. (copy_insn_1): Same. (initializer_constant_valid_p): Handle VECTOR_CST. * doc/c-tree.texi (Expression trees): Document VECTOR_CST. * doc/rtl.texi (Constants): Document const_vector. (CONST0_RTX): Update for vectors. (RTL sharing): Same. * print-tree.c (print_node): Add case for VECTOR_CST. * tree.h (TREE_VECTOR_CST_ELTS): New. (struct tree_vector): New. (union tree_node): Add vector node. (build_vector): Add prototype. * tree.def (VECTOR_CST): New. * tree.c (build_vector): New. * expmed.c (make_tree): Handle CONST_VECTOR. * rtl.h (CONSTANT_P): CONST_VECTORs are constants too. (CONST_VECTOR_ELT): New. (CONST_VECTOR_NUNITS): New. * machmode.h (GET_MODE_INNER): New. (DEF_MACHMODE): Accept 8th arg. * machmode.def: Add 8th argument for vector inner mode. Add inner vector modes for vectors. * rtl.def (VEC_CONST): Remove. (CONST_VECTOR): New. * expr.c (clear_storage): Allow vectors. (is_zeros_p): Handle VECTOR_CST. * varasm.c (output_constant_pool): Handle vectors. (rtx_const): Add veclo and vechi fields. (kind): Add RTX_VECTOR. (decode_rtx_const): Add case for vector. * config/rs6000/rs6000-protos.h: Add zero_constant. * config/rs6000/rs6000.c (rs6000_emit_move): Handle vector constants. Force easy vector constants into memory. (easy_vector_constant): New. (emit_easy_vector_constant): New. (rs6000_legitimize_reload_address): Do not generate bad reloads on darwin. * config/rs6000/rs6000.md ("altivec_lvx"): Reflect what instruction does. ("altivec_lvxl"): Same. (altivec_lvebx): Same. (altivec_lvehx): Same. (altivec_lvewx): Same. ("*movv4si_const0"): New. ("*movv4sf_const0"): New. ("*movv8hi_const0"): New. ("*movv16qi_const0"): New. From-SVN: r49853
2002-02-19 03:53:41 +01:00
case CONST_VECTOR:
case CONST_INT:
rtl.c (rtx_code_size): Check CONST_FIXED to calcualte correct sizes in DEF_RTL_EXPR. * rtl.c (rtx_code_size): Check CONST_FIXED to calcualte correct sizes in DEF_RTL_EXPR. (copy_rtx): Handle CONST_FIXED. (rtx_equal_p): Likewise. * rtl.h (fixed_value.h): New include. (rtx_def): Add a new field of fixed_value to u. (XCNMPFV): Define for accessing fixed_value. (CONST_FIXED_VALUE, CONST_FIXED_VALUE_HIGH, CONST_FIXED_VALUE_LOW): Define. * rtl.def (CONST_FIXED): New constant. (SS_MULT, US_MULT, SS_DIV, US_DIV, FRACT_CONVERT, UNSIGNED_FRACT_CONVERT, SAT_FRACT, UNSIGNED_SAT_FRACT, US_NEG, US_ASHIFT): New codes. * doc/rtl.texi (Expressions): Document const_fixed, us_neg, ss_mult, us_mult, ss_div, us_div, us_ashift, fract_convert, sat_fract, unsigned_fract_convert, unsigned_sat_fract): Document them. * varasm.c (assemble_integer): Extend to support fixed-point constants by using different machine classes. (decode_addr_const): Handle FIXED_CST. (const_hash_1): Likewise. (compare_constant): Likewise. (copy_constant): Likewise. (const_rtx_hash_1): Handle CONST_FIXED. (output_constant_pool_2): Handle MODE_FRACT, MODE_UFRACT, MODE_ACCUM, MODE_UACCUM, MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM. (initializer_constant_valid_p): Handle FIXED_CST. (output_constant): Support FIXED_POINT_TYPE. * gengenrtl.c (excluded_rtx): Check CONST_FIXED to exclude. * cse.c (hash_rtx): Support CONST_FIXED. (exp_equiv_p): Likewise. (cannon_reg): Likewise. (fold_rtx): Likewise. (equiv_constant): Likewise. (cse_process_notes_1): Likewise. (count_reg_usage): Likewise. * cselib.c (entry_and_rtx_equal_p): Check CONST_FIXED. (rtx_equal_for_cselib_p): Handle CONST_FIXED. (wrap_constant): Check CONST_FIXED. (cselib_hash_rtx): Support CONST_FIXED. (cselib_subst_to_values): Likewise. * df-scan.c (df_uses_record): Likewise. * gcse.c (want_to_gcse_p): Likewise. (oprs_unchanged_p): Likewise. (oprs_not_set_p): Likewise. (compute_transp): Likewise. (extract_mentioned_regs_helper): Likewise. * genemit.c (gen_exp): Likewise. * local-alloc.c (equiv_init_varies_p): Likewise. (contains_replace_regs): Likewise. (memref_referenced_p): Likewise. * loop-invariant.c (check_maybe_invariant): Likewise. (hash_invariant_expr_1): Likewise. (invariant_expr_equal_p): Likewise. * postreload-gcse.c (oprs_unchanged_p): Likewise. * regclass.c (reg_scan_mark_refs): Likewise. * regrename.c (scan_rtx): Likewise. * resource.c (mark_referenced_resources): Likewise. (mark_set_resources): Likewise. * rtlanal.c (rtx_unstable_p): Likewise. (rtx_varies_p): Likewise. (count_occurrences): Likewise. (reg_mentioned_p): Likewise. (modified_between_p): Likewise. (modified_in_p): Likewise. (volatile_insn_p): Likewise. (volatile_refs_p): Likewise. (side_effects_p): Likewise. (may_trap_p_1): Likewise. (inequality_comparisons_p): Likewise. (computed_jump_p_1): Likewise. (commutative_operand_precedence): Likewise. * sched-deps.c (sched_analyze_2): Likewise. * sched-vis.c (print_value): Likewise. * reload.c (operands_match_p): Likewise. (subst_reg_equivs): Likewise. * reload1.c (eliminate_regs_1): Likewise. (elimination_effects): Likewise. (scan_paradoxical_subregs): Likewise. * alias.c (rtx_equal_for_memref_p): Likewise. * Makefile.in (RTL_BASE_H): Add fixed-value.h. * emit-rtl.c (const_fixed_htab): New hash table. (const_fixed_htab_hash, const_fixed_htab_eq, lookup_const_fixed): Declare. (const_fixed_htab_hash, const_fixed_htab_eq, lookup_const_fixed, const_fixed_from_fixed_value): New functions. (verify_rtx_sharing): Handle CONST_FIXED. (copy_rtx_if_shared_1): Likewise. (reset_used_flags): Likewise. (set_used_flags): Likewise. (copy_insn_1): Likewise. (init_emit_once): Create const_fixed_htab. Store fixed-point scalar and vector zero and one to const_tiny_rtx. From-SVN: r127725
2007-08-23 02:30:39 +02:00
case CONST_FIXED:
return x;
case POST_INC:
case PRE_INC:
case POST_DEC:
case PRE_DEC:
case POST_MODIFY:
case PRE_MODIFY:
e = new_cselib_val (++next_unknown_value, GET_MODE (x));
return e->val_rtx;
default:
break;
}
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
{
if (fmt[i] == 'e')
{
rtx t = cselib_subst_to_values (XEXP (x, i));
if (t != XEXP (x, i) && x == copy)
copy = shallow_copy_rtx (x);
XEXP (copy, i) = t;
}
else if (fmt[i] == 'E')
{
int j, k;
for (j = 0; j < XVECLEN (x, i); j++)
{
rtx t = cselib_subst_to_values (XVECEXP (x, i, j));
if (t != XVECEXP (x, i, j) && XVEC (x, i) == XVEC (copy, i))
{
if (x == copy)
copy = shallow_copy_rtx (x);
XVEC (copy, i) = rtvec_alloc (XVECLEN (x, i));
for (k = 0; k < j; k++)
XVECEXP (copy, i, k) = XVECEXP (x, i, k);
}
XVECEXP (copy, i, j) = t;
}
}
}
return copy;
}
/* Look up the rtl expression X in our tables and return the value it has.
If CREATE is zero, we return NULL if we don't know the value. Otherwise,
we create a new one if possible, using mode MODE if X doesn't have a mode
(i.e. because it's a constant). */
cselib_val *
cselib_lookup (rtx x, enum machine_mode mode, int create)
{
void **slot;
cselib_val *e;
unsigned int hashval;
if (GET_MODE (x) != VOIDmode)
mode = GET_MODE (x);
if (GET_CODE (x) == VALUE)
return CSELIB_VAL_PTR (x);
alias.c (record_set, [...]): Use REG_P. 2004-06-15 Jerry Quinn <jlquinn@optonline.net> * alias.c (record_set, record_base_value, canon_rtx, get_addr, nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P. * bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set): Likewise. * builtins.c (expand_builtin_setjmp, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp, expand_builtin_strcmp, expand_builtin_strncmp, expand_builtin_frame_address): Likewise. * caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs, insert_one_insn): Likewise. * calls.c (prepare_call_address, precompute_register_parameters, precompute_arguments, expand_call, emit_library_call_value_1): Likewise. * cfganal.c (flow_active_insn_p): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, can_combine_p, combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, make_extraction, recog_for_combine, gen_lowpart_for_combine, simplify_comparison, record_dead_and_set_regs_1, record_dead_and_set_regs, record_promoted_value, check_promoted_subreg, get_last_value_validate, get_last_value, reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes, unmentioned_reg_p_1): Likewise. * conflict.c (mark_reg): Likewise. * cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost, mention_regs, insert_regs, lookup, lookup_for_remove, insert, merge_equiv_classes, flush_hash_table, invalidate, remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg, invalidate_for_call, use_related_value, canon_hash, exp_equiv_p, cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant, record_jump_cond, cse_insn, addr_affects_sp_p, invalidate_from_clobbers, cse_process_notes, cse_around_loop, cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p, cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms, dbxout_block): Likewise. * df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise. * dojump.c (do_jump): Likewise. * dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg, is_based_loc, rtl_for_decl_location): Likewise. * emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl, set_decl_incoming_rtl, mark_user_reg): Likewise. * explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg, copy_to_suggested_reg, allocate_dynamic_stack_space, probe_stack_range, hard_function_value): Likewise. * expmed.c (store_bit_field, store_fixed_bit_field, store_split_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_divmod, emit_store_flag_force): Likewise. * expr.c (convert_move, convert_modes, block_move_libcall_safe_for_call_parm, emit_group_load, use_reg, use_group_regs, emit_move_insn, emit_move_insn_1, compress_float_constant, push_block, emit_single_push_insn, emit_push_insn, get_subtarget, expand_assignment, store_expr, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment, do_store_flag, do_tablejump): Likewise. * final.c (profile_function, final_scan_insn, alter_subreg, get_mem_expr_from_op, output_asm_operand_names, output_operand, only_leaf_regs_used, leaf_renumber_regs_insn): Likewise. * flow.c (verify_wide_reg_1, mark_regs_live_at_end, find_regno_partial, propagate_one_insn, init_propagate_block_info, insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond, attempt_auto_inc, find_auto_inc, mark_used_regs, count_or_remove_death_notes_bb): Likewise. * function.c (find_temp_slot_from_address, update_temp_slot_address, preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn, fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof, put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk, purge_single_hard_subreg_set, instantiate_decl, instantiate_virtual_regs_1, aggregate_value_p, assign_parms, promoted_input_arg, setjmp_vars_warning, setjmp_args_warning, setjmp_protect, setjmp_protect_args, fix_lexical_addr, expand_function_start, diddle_return_value, clobber_return_register, expand_function_end, keep_stack_depressed, handle_epilogue_set, update_epilogue_consts): Likewise. * genemit.c (gen_exp, gen_insn): Likewise. * genrecog.c (make_insn_sequence): Likewise. * global.c (global_conflicts, expand_preferences, mark_reg_store, mark_reg_conflicts, set_preference, reg_becomes_live, build_insn_chain, mark_reg_change): Likewise. * haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight): Likewise. * ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block): Likewise. * integrate.c (copy_rtx_and_substitute, try_constants, subst_constants, mark_stores, allocate_initial_values): Likewise. * jump.c (reversed_comparison_code_parts, delete_prior_computation, delete_computation, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem, update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set, wipe_dead_reg, no_conflict_p): Likewise. * loop-iv.c (simple_reg_p, simple_set_p, kill_sets, iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered, simple_rhs_p, simplify_using_assignment, implies_p): Likewise. * loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p, move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p, find_single_use_in_loop, count_one_set, loop_bivs_init_find, loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs, valid_initial_value_p, simplify_giv_expr, consec_sets_giv, loop_regs_update, check_dbra_loop, maybe_eliminate_biv, maybe_eliminate_biv_1, record_initial, update_reg_last_use, canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop, try_swap_copy_prop): Likewise. * optabs.c (expand_binop, expand_vector_binop, expand_vector_unop, expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float): Likewise. * postreload.c (reload_cse_simplify, reload_cse_simplify_set, reload_cse_simplify_operands, reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * print-rtl.c (print_rtx): Likewise. * ra-build.c (copy_insn_p, remember_move, init_one_web_common, contains_pseudo, handle_asm_insn): Likewise. * ra-debug.c (ra_print_rtx_object, dump_constraints, dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, emit_colors, remove_suspicious_death_notes): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use, register_operand, scratch_operand, nonmemory_operand, constrain_operands): Likewise. * reg-stack (check_asm_stack_operands, remove_regno_note, emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat, subst_asm_stack_regs): Likewise. * regclass.c (scan_one_insn, record_reg_classes, copy_cost, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (discover_flags_reg, replacement_quality, copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize, fixup_match_1): Likewise. * regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value, kill_set_value, copyprop_hardreg_forward_1): Likewise. * reload.c (MATCHES, push_secondary_reload, find_reusable_reload, reload_inner_reg_of_subreg, can_reload_into, push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, find_reloads_toplev, find_reloads_address, subst_indexed_address, find_reloads_address_1, find_reloads_subreg_address, find_replacement, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise. * reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns, find_reg, delete_dead_insn, alter_reg, eliminate_regs, elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs, forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs, emit_input_reload_insns, emit_output_reload_insns, do_input_reload, do_output_reload, emit_reload_insns, gen_reload, delete_address_reloads_1, inc_for_reload): Likewise. * reorg.c (update_reg_dead_notes, fix_reg_dead_note, update_reg_unused_notes, fill_slots_from_thread): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c (nonzero_address_p, get_jump_table_offset, global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p, reg_set_p, set_noop_p, find_last_value, refers_to_regno_p, note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in, parms_set, find_first_parameter_load, keep_with_call_p, hoist_test_store, hoist_update_store, address_cost, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn, sched_analyze): Likewise. * sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1): Likewise. * sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise. * simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_subreg): Likewise. * stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands, expand_end_stmt_expr, expand_return, expand_decl, expand_anon_union_decl): Likewise. * unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body, find_splittable_regs, find_splittable_givs, find_common_reg_term, loop_iterations): Likewise. * var-tracking.c (variable_union, variable_part_different_p, variable_different_p, count_uses, add_uses, add_stores, compute_bb_dataflow, set_variable_part, delete_variable_part, emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (assemble_variable): Likewise. From-SVN: r83195
2004-06-15 20:02:40 +02:00
if (REG_P (x))
{
struct elt_list *l;
unsigned int i = REGNO (x);
l = REG_VALUES (i);
if (l && l->elt == NULL)
l = l->next;
for (; l; l = l->next)
if (mode == GET_MODE (l->elt->val_rtx))
return l->elt;
if (! create)
return 0;
if (i < FIRST_PSEUDO_REGISTER)
{
alias.c (record_set): Use hard_regno_nregs. * alias.c (record_set): Use hard_regno_nregs. * bt-load.c (find_btr_reference, note_btr_set): Likewise. * builtins.c (apply_args_size): Likewise. * caller-save.c (setup_save_areas, save_call_clobbered_regs, mark_set_regs, add_stored_regs, mark_referenced_regs, insert_restore, insert_save, insert_one_insn): Likewise. * cfgcleanup.c: Include regs.h (mark_effect, mentions_nonequal_regs): Likewise. * cfgrtl.c (mark_killed_regs): Likewise * combine.c (update_table_tick, record_value_for_reg, record_dead_and_set_regs, get_last_value_validate, use_crosses_set_p, reg_dead_at_p_1, reg_dead_at_p, mark_used_regs_combine, move_deaths, reg_bitfield_target_p, distribute_notes): Likewise. * cse.c (mention_regs, insert, invalidate, invalidate_for_call, exp_equiv_p, cse_insn): Likewise. * cselib.c (cselib_lookup): Likewise. (cselib_invalidate_regno, cselib_record_set): Likewise. * df.c (df_ref_record): Likewise. * dwarf2out.c (reg_loc_descriptor, multiple_reg_loc_descriptor): Likewise. * flow.c (mark_reg, insn_dead_p, mark_set_1, mark_used_reg, count_or_remove_death_notes_bb): Likewise. * function.c (aggregate_value_p, keep_stack_depressed): Likewise. * gloval.c (global_alloc, find_reg, mark_reg_store, mark_reg_conflicts, mark_reg_death, set_preference, reg_becomes_live, reg_dies): Likewise. * integrate.c (mark_stores): Likewise. * jump.c (delete_prior_computation): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (combine_regs, find_free_reg, post_mark_life): Likewise. * loop.c (LOOP_REGNO_NREGS): Likewise. * postreload.c (reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * ra-colorize.c (combine, color_usable_p, get_free_reg, calculate_dont_begin, calculate_dont_begin, colorize_one_web, try_recolor_web, insert_coalesced_conflicts, check_colors, break_precolored_alias): Likewise. * ra-debug.c: Include regs.h (ra_print_rtx_object): Likewise. * ra-rewrite (choose_spill_colors): Likewise. (spill_same_color_p, update_spill_colors, spill_is_free): Likewise. * ra.c (init_ra): Likewise. * recog.c (reg_fits_class_p, peep2_reg_dead_p, peep2_find_free_register): Likewise. * reg-stack.c (subst_stack_regs_pat, convert_regs_exit): Likewise. * regclass.c (hard_regno_nregs): New array. (init_reg_modes_once): Initialize it. (choose_hard_reg_mode): Use it. (record_reg_classes): Likewise. * regmove.c (mark_flags_life_zones): Likewise. * regrename.c (note_sets, clear_dead_regs, regrename_optimize, scan_rtx_reg, dump_def_use_chain, kill_value, set_value_regno, copy_value, maybe_mode_change, find_oldest_value_reg, copyprop_hardreg_forward_1): * regs.h (hard_regno_nregs): Declare. * realod.c (reload_inner_reg_of_subreg): Use it. (push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, refers_to_regno_for_reload_p, find_equiv_reg, regno_clobbered_p, reload_adjust_reg_for_mode): Likewise. * reload1.c (compute_use_by_pseudos, count_pseudo, count_spilled_pseudo, find_reg, find_reload_regs, mark_home_live, spill_hard_reg, forget_old_reloads_1, mark_reload_reg_in_use, clear_reload_reg_in_use, reload_reg_free_for_value_p, free_for_value_p allocate_reload_reg, choose_reload_regs, emit_reload_insns, delete_output_reload): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c: Include regs.h (refers_to_regno_p, reg_overlap_mentioned_p, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, subreg_regno_offset, subreg_offset_representable_p, hoist_test_store): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sched-rgn.c (check_live_1, update_live_1): Likewise. * stmt.c: Include regs.h (decl_conflicts_with_clobbers_p): Likewise. * varasm.c (make_decl_rtl): Likewise. * Makefile.in (cfgcleanup.o, rtlanal.o, ra-debug.o): Add regs.h dependnecy. From-SVN: r77088
2004-02-02 01:17:18 +01:00
unsigned int n = hard_regno_nregs[i][mode];
if (n > max_value_regs)
max_value_regs = n;
}
e = new_cselib_val (++next_unknown_value, GET_MODE (x));
e->locs = new_elt_loc_list (e->locs, x);
if (REG_VALUES (i) == 0)
{
/* Maintain the invariant that the first entry of
REG_VALUES, if present, must be the value used to set the
register, or NULL. */
used_regs[n_used_regs++] = i;
REG_VALUES (i) = new_elt_list (REG_VALUES (i), NULL);
}
REG_VALUES (i)->next = new_elt_list (REG_VALUES (i)->next, e);
slot = htab_find_slot_with_hash (cselib_hash_table, x, e->value, INSERT);
*slot = e;
return e;
}
alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 Jerry Quinn <jlquinn@optonline.net> * alias.c (get_alias_set, canon_rtx, get_addr, nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1): Use MEM_P. * builtins.c (expand_builtin_prefetch, expand_builtin_profile_func, expand_builtin): Likewise. * calls.c (expand_call, emit_library_call_value_1, store_one_arg): Likewise. * combine.c (can_combine_p, combinable_i3pat, try_combine, find_split_point, combine_simplify_rtx, simplify_set, make_extraction, rtx_equal_for_field_assignment_p, gen_lowpart_for_combine, record_dead_and_set_regs_1, get_last_value_validate, mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise. * cse.c (check_dependence, canon_hash, equiv_constant, gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers, cse_around_loop, cse_check_loop_start, cse_set_around_loop, count_reg_usage): Likewise. * cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup, cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol, dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise. * ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise. * df.c (df_uses_record): Likewise. * dojump (do_jump): Likewise. * dwarf2out.c (stack_adjust_offset, mem_loc_descriptor, loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info, decl_start_label): Likewise. * emit-rtl.c (gen_complex_constant_part, gen_highpart, operand_subword, change_address_1, make_safe_from): Likewise. * explow.c (break_out_memory_refs, copy_all_regs, validize_mem, stabilize, force_not_mem): Likewise. * expmed.c (store_bit_field, store_split_bit_field, extract_bit_field, expand_mult_const, expand_divmod, emit_store_flag): Likewise. * expr.c (convert_move, convert_modes, emit_block_move, emit_group_load, emit_group_store, clear_storage, emit_move_insn, emit_move_insn_1, expand_assignment, store_expr, store_constructor_field, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment): Likewise. * final.c (cleanup_subreg_operands, alter_subreg, get_mem_expr_from_op): Likewise. * flow.c (notice_stack_pointer_modification_1, init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs): Likewise. * function.c (mark_temp_addr_taken, preserve_temp_slots, preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1, optimize_bit_field, flush_addressof, purge_addressof_1, instantiate_decl, instantiate_virtual_regs_1, assign_parms, setjmp_protect, setjmp_protect_args, fix_lexical_addr, keep_stack_depressed): Likewise. * ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok, noce_process_if_block, find_memory): Likewise. * integrate.c (subst_constants, allocate_initial_values): Likewise. * local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p, update_equiv_regs): Likewise. * loop.c (scan_loop, prescan_loop, note_addr_stored, check_store, maybe_eliminate_biv_1, find_mem_in_note_1): Likewise. * optabs.c (expand_abs, emit_unop_insn): Likewise. * passes.c (rest_of_handle_final): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, move2add_note_store): Likewise. * ra-build.c (detect_remat_webs): Likewise. * ra-debug.c (dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, insert_stores): Likewise. * recog.c (validate_change, apply_change_group, cancel_changes, validate_replace_rtx_1, general_operand, register_operand, nonmemory_operand, push_operand, pop_operand, memory_operand, indirect_operand, asm_operand_ok, offsettable_memref_p, offsettable_nonstrict_memref_p, constrain_operands, store_data_bypass_p): Likewise. * reg-stack.c (subst_stack_regs_pat): Likewise. * regclass.c (record_operand_costs, scan_one_insn, record_reg_classes, copy_cost, reg_scan_mark_refs): Likewise. * regmove.c (optimize_reg_copy_3, stack_memref_p, combine_stack_adjustments_for_block): Likewise. * regrename.c (copyprop_hardreg_forward_1): Likewise. * reload.c (can_reload_into, push_reload, decompose, immune_p, find_reloads, find_reloads_address, find_reloads_address_1, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg): Likewise. * reload1.c (reload, eliminate_regs, eliminate_regs_in_insn, reload_as_needed, choose_reload_regs, emit_input_reload_insns, do_input_reload, emit_reload_insns, gen_reload, delete_output_reload, delete_address_reloads): Likewise. * resource.c (mark_referenced_resources): Likewise. * rtlanal.c (get_jump_table_offset, count_occurrences, reg_referenced_p, reg_set_p, set_of_1, set_noop_p, reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol, sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms, sdbout_global_decl): Likewise. * simplify-rtx.c (simplify_subreg): Likewise. * stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl, expand_anon_union_decl, expand_end_case_type): Likewise. * unroll.c (calculate_giv_inc): Likewise. * var-tracking.c (stack_adjust_offset_pre_post, bb_stack_adjust_offset, track_expr_p, count_uses, add_uses, add_stores, compute_bb_dataflow, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (make_var_volatile, notice_global_symbol, assemble_external, decode_addr_const, mark_weak, default_encode_section_info): Likewise. From-SVN: r83980
2004-07-01 14:52:53 +02:00
if (MEM_P (x))
return cselib_lookup_mem (x, create);
hashval = cselib_hash_rtx (x, create);
/* Can't even create if hashing is not possible. */
if (! hashval)
return 0;
slot = htab_find_slot_with_hash (cselib_hash_table, wrap_constant (mode, x),
hashval, create ? INSERT : NO_INSERT);
if (slot == 0)
return 0;
e = (cselib_val *) *slot;
if (e)
return e;
e = new_cselib_val (hashval, mode);
/* We have to fill the slot before calling cselib_subst_to_values:
the hash table is inconsistent until we do so, and
cselib_subst_to_values will need to do lookups. */
*slot = (void *) e;
e->locs = new_elt_loc_list (e->locs, cselib_subst_to_values (x));
return e;
}
/* Invalidate any entries in reg_values that overlap REGNO. This is called
if REGNO is changing. MODE is the mode of the assignment to REGNO, which
is used to determine how many hard registers are being changed. If MODE
is VOIDmode, then only REGNO is being changed; this is used when
invalidating call clobbered registers across a call. */
static void
cselib_invalidate_regno (unsigned int regno, enum machine_mode mode)
{
unsigned int endregno;
unsigned int i;
/* If we see pseudos after reload, something is _wrong_. */
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
gcc_assert (!reload_completed || regno < FIRST_PSEUDO_REGISTER
|| reg_renumber[regno] < 0);
/* Determine the range of registers that must be invalidated. For
pseudos, only REGNO is affected. For hard regs, we must take MODE
into account, and we must also invalidate lower register numbers
if they contain values that overlap REGNO. */
if (regno < FIRST_PSEUDO_REGISTER)
{
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
gcc_assert (mode != VOIDmode);
if (regno < max_value_regs)
i = 0;
else
i = regno - max_value_regs;
regs.h (end_hard_regno): New function. gcc/ * regs.h (end_hard_regno): New function. (END_HARD_REGNO, END_REGNO): New macros. (add_to_hard_reg_set): New function. (remove_from_hard_reg_set): Likewise. (in_hard_reg_set_p): Likewise. (overlaps_hard_reg_set_p): Likewise. * bt-load.c (find_btr_reference): Use overlaps_hard_reg_set_p. (note_btr_set): Use END_HARD_REGNO. * caller-save.c (setup_save_areas): Use end_hard_regno. (mark_set_regs): Use END_HARD_REGNO. (add_stored_regs): Use end_hard_regno. (mark_referenced_regs): Use add_to_hard_reg_set. * combine.c (update_table_tick): Use END_REGNO. (record_value_for_reg): Likewise. (record_dead_and_set_regs): Likewise. (get_last_value_validate): Likewise. (use_crosses_set_p): Likewise. (reg_dead_at_p_1): Likewise. (reg_dead_at_p): Likewise. (mark_used_regs_combine): Use add_to_hard_reg_set. (move_deaths): Use END_HARD_REGNO. (reg_bitfield_target_p): Use end_hard_regno. (distribute_notes): Use END_HARD_REGNO. * cse.c (mention_regs): Use END_REGNO. (insert): Use add_to_hard_reg_set. (invalidate): Use END_HARD_REGNO. (invalidate_for_call): Likewise. (exp_equiv_p): Use END_REGNO. (cse_insn): Likewise. * cselib.c (cselib_invalidate_regno): Use end_hard_regno. * df-problems.c (df_urec_mark_reg_change): Use END_HARD_REGNO. * df-scan.c (df_ref_record): Use END_HARD_REGNO. * function.c (keep_stack_depressed): Use end_hard_regno. * global.c (global_alloc): Use end_hard_regno. (global_conflicts): Use add_to_hard_reg_set instead of mark_reg_live_nc. (find_reg): Likewise. (mark_reg_store): Likewise. (mark_reg_conflicts): Likewise. (mark_reg_death): Use remove_from_hard_reg_set. (mark_reg_live_nc): Delete. (set_preference): Use end_hard_regno. * local-alloc.c (mark_life): Use add_to_hard_reg_set and remove_from_hard_reg_set. (post_mark_life): Use add_to_hard_reg_set. * mode-switching.c (reg_dies): Use remove_from_hard_reg_set. (reg_becomes_live): Use add_to_hard_reg_set. * recog.c (reg_fits_class_p): Use in_hard_reg_set_p. (peep2_find_free_register): Use add_to_hard_reg_set. * reg-stack.c (convert_regs_exit): Use END_HARD_REGNO. * regclass.c (record_reg_classes): Use in_hard_reg_set_p. * regrename.c (note_sets): Use add_to_hard_reg_set. (clear_dead_regs): Use remove_from_hard_reg_set. (regrename_optimize): Use add_to_hard_reg_set. (find_oldest_value_reg): Use in_hard_reg_set_p. * reload.c (push_reload): Use in_hard_reg_set_p and end_hard_regno. (hard_reg_set_here_p): Use end_hard_regno. (decompose): Likewise. (reg_overlap_mentioned_for_reload_p): Use END_HARD_REGNO. (find_equiv_reg): Use in_hard_reg_set_p and end_hard_regno. * reload1.c (compute_use_by_pseudos): Use add_to_hard_reg_set. (mark_home_live): Use end_hard_regno. (spill_hard_reg): Likewise. (clear_reload_reg_in_use): Likewise. * reorg.c (delete_prior_computation): Use END_REGNO. * resource.c (update_live_status): Use END_HARD_REGNO. (mark_referenced_resources): Use add_to_hard_reg_set. (mark_set_resources): Likewise. (mark_target_live_regs): Likewise. Use remove_from_hard_reg_set. * rtlanal.c (refers_to_regno_p): Use END_REGNO. (reg_overlap_mentioned_p): Likewise. (dead_or_set_p): Likewise. Use an exclusive upper loop bound. (covers_regno_no_parallel_p): Use END_REGNO. (find_regno_note): Likewise. (find_reg_fusage): Use END_HARD_REGNO. * stmt.c (decl_overlaps_hard_reg_set_p): Use overlaps_hard_reg_set_p. * var-tracking.c (emit_note_insn_var_location): Use end_hard_regno. From-SVN: r124961
2007-05-22 22:52:39 +02:00
endregno = end_hard_regno (mode, regno);
}
else
{
i = regno;
endregno = regno + 1;
}
for (; i < endregno; i++)
{
struct elt_list **l = &REG_VALUES (i);
/* Go through all known values for this reg; if it overlaps the range
we're invalidating, remove the value. */
while (*l)
{
cselib_val *v = (*l)->elt;
struct elt_loc_list **p;
unsigned int this_last = i;
if (i < FIRST_PSEUDO_REGISTER && v != NULL)
regs.h (end_hard_regno): New function. gcc/ * regs.h (end_hard_regno): New function. (END_HARD_REGNO, END_REGNO): New macros. (add_to_hard_reg_set): New function. (remove_from_hard_reg_set): Likewise. (in_hard_reg_set_p): Likewise. (overlaps_hard_reg_set_p): Likewise. * bt-load.c (find_btr_reference): Use overlaps_hard_reg_set_p. (note_btr_set): Use END_HARD_REGNO. * caller-save.c (setup_save_areas): Use end_hard_regno. (mark_set_regs): Use END_HARD_REGNO. (add_stored_regs): Use end_hard_regno. (mark_referenced_regs): Use add_to_hard_reg_set. * combine.c (update_table_tick): Use END_REGNO. (record_value_for_reg): Likewise. (record_dead_and_set_regs): Likewise. (get_last_value_validate): Likewise. (use_crosses_set_p): Likewise. (reg_dead_at_p_1): Likewise. (reg_dead_at_p): Likewise. (mark_used_regs_combine): Use add_to_hard_reg_set. (move_deaths): Use END_HARD_REGNO. (reg_bitfield_target_p): Use end_hard_regno. (distribute_notes): Use END_HARD_REGNO. * cse.c (mention_regs): Use END_REGNO. (insert): Use add_to_hard_reg_set. (invalidate): Use END_HARD_REGNO. (invalidate_for_call): Likewise. (exp_equiv_p): Use END_REGNO. (cse_insn): Likewise. * cselib.c (cselib_invalidate_regno): Use end_hard_regno. * df-problems.c (df_urec_mark_reg_change): Use END_HARD_REGNO. * df-scan.c (df_ref_record): Use END_HARD_REGNO. * function.c (keep_stack_depressed): Use end_hard_regno. * global.c (global_alloc): Use end_hard_regno. (global_conflicts): Use add_to_hard_reg_set instead of mark_reg_live_nc. (find_reg): Likewise. (mark_reg_store): Likewise. (mark_reg_conflicts): Likewise. (mark_reg_death): Use remove_from_hard_reg_set. (mark_reg_live_nc): Delete. (set_preference): Use end_hard_regno. * local-alloc.c (mark_life): Use add_to_hard_reg_set and remove_from_hard_reg_set. (post_mark_life): Use add_to_hard_reg_set. * mode-switching.c (reg_dies): Use remove_from_hard_reg_set. (reg_becomes_live): Use add_to_hard_reg_set. * recog.c (reg_fits_class_p): Use in_hard_reg_set_p. (peep2_find_free_register): Use add_to_hard_reg_set. * reg-stack.c (convert_regs_exit): Use END_HARD_REGNO. * regclass.c (record_reg_classes): Use in_hard_reg_set_p. * regrename.c (note_sets): Use add_to_hard_reg_set. (clear_dead_regs): Use remove_from_hard_reg_set. (regrename_optimize): Use add_to_hard_reg_set. (find_oldest_value_reg): Use in_hard_reg_set_p. * reload.c (push_reload): Use in_hard_reg_set_p and end_hard_regno. (hard_reg_set_here_p): Use end_hard_regno. (decompose): Likewise. (reg_overlap_mentioned_for_reload_p): Use END_HARD_REGNO. (find_equiv_reg): Use in_hard_reg_set_p and end_hard_regno. * reload1.c (compute_use_by_pseudos): Use add_to_hard_reg_set. (mark_home_live): Use end_hard_regno. (spill_hard_reg): Likewise. (clear_reload_reg_in_use): Likewise. * reorg.c (delete_prior_computation): Use END_REGNO. * resource.c (update_live_status): Use END_HARD_REGNO. (mark_referenced_resources): Use add_to_hard_reg_set. (mark_set_resources): Likewise. (mark_target_live_regs): Likewise. Use remove_from_hard_reg_set. * rtlanal.c (refers_to_regno_p): Use END_REGNO. (reg_overlap_mentioned_p): Likewise. (dead_or_set_p): Likewise. Use an exclusive upper loop bound. (covers_regno_no_parallel_p): Use END_REGNO. (find_regno_note): Likewise. (find_reg_fusage): Use END_HARD_REGNO. * stmt.c (decl_overlaps_hard_reg_set_p): Use overlaps_hard_reg_set_p. * var-tracking.c (emit_note_insn_var_location): Use end_hard_regno. From-SVN: r124961
2007-05-22 22:52:39 +02:00
this_last = end_hard_regno (GET_MODE (v->val_rtx), i) - 1;
if (this_last < regno || v == NULL)
{
l = &(*l)->next;
continue;
}
/* We have an overlap. */
if (*l == REG_VALUES (i))
{
/* Maintain the invariant that the first entry of
REG_VALUES, if present, must be the value used to set
the register, or NULL. This is also nice because
then we won't push the same regno onto user_regs
multiple times. */
(*l)->elt = NULL;
l = &(*l)->next;
}
else
unchain_one_elt_list (l);
/* Now, we clear the mapping from value to reg. It must exist, so
this code will crash intentionally if it doesn't. */
for (p = &v->locs; ; p = &(*p)->next)
{
rtx x = (*p)->loc;
alias.c (record_set, [...]): Use REG_P. 2004-06-15 Jerry Quinn <jlquinn@optonline.net> * alias.c (record_set, record_base_value, canon_rtx, get_addr, nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P. * bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set): Likewise. * builtins.c (expand_builtin_setjmp, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp, expand_builtin_strcmp, expand_builtin_strncmp, expand_builtin_frame_address): Likewise. * caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs, insert_one_insn): Likewise. * calls.c (prepare_call_address, precompute_register_parameters, precompute_arguments, expand_call, emit_library_call_value_1): Likewise. * cfganal.c (flow_active_insn_p): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, can_combine_p, combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, make_extraction, recog_for_combine, gen_lowpart_for_combine, simplify_comparison, record_dead_and_set_regs_1, record_dead_and_set_regs, record_promoted_value, check_promoted_subreg, get_last_value_validate, get_last_value, reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes, unmentioned_reg_p_1): Likewise. * conflict.c (mark_reg): Likewise. * cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost, mention_regs, insert_regs, lookup, lookup_for_remove, insert, merge_equiv_classes, flush_hash_table, invalidate, remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg, invalidate_for_call, use_related_value, canon_hash, exp_equiv_p, cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant, record_jump_cond, cse_insn, addr_affects_sp_p, invalidate_from_clobbers, cse_process_notes, cse_around_loop, cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p, cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms, dbxout_block): Likewise. * df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise. * dojump.c (do_jump): Likewise. * dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg, is_based_loc, rtl_for_decl_location): Likewise. * emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl, set_decl_incoming_rtl, mark_user_reg): Likewise. * explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg, copy_to_suggested_reg, allocate_dynamic_stack_space, probe_stack_range, hard_function_value): Likewise. * expmed.c (store_bit_field, store_fixed_bit_field, store_split_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_divmod, emit_store_flag_force): Likewise. * expr.c (convert_move, convert_modes, block_move_libcall_safe_for_call_parm, emit_group_load, use_reg, use_group_regs, emit_move_insn, emit_move_insn_1, compress_float_constant, push_block, emit_single_push_insn, emit_push_insn, get_subtarget, expand_assignment, store_expr, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment, do_store_flag, do_tablejump): Likewise. * final.c (profile_function, final_scan_insn, alter_subreg, get_mem_expr_from_op, output_asm_operand_names, output_operand, only_leaf_regs_used, leaf_renumber_regs_insn): Likewise. * flow.c (verify_wide_reg_1, mark_regs_live_at_end, find_regno_partial, propagate_one_insn, init_propagate_block_info, insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond, attempt_auto_inc, find_auto_inc, mark_used_regs, count_or_remove_death_notes_bb): Likewise. * function.c (find_temp_slot_from_address, update_temp_slot_address, preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn, fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof, put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk, purge_single_hard_subreg_set, instantiate_decl, instantiate_virtual_regs_1, aggregate_value_p, assign_parms, promoted_input_arg, setjmp_vars_warning, setjmp_args_warning, setjmp_protect, setjmp_protect_args, fix_lexical_addr, expand_function_start, diddle_return_value, clobber_return_register, expand_function_end, keep_stack_depressed, handle_epilogue_set, update_epilogue_consts): Likewise. * genemit.c (gen_exp, gen_insn): Likewise. * genrecog.c (make_insn_sequence): Likewise. * global.c (global_conflicts, expand_preferences, mark_reg_store, mark_reg_conflicts, set_preference, reg_becomes_live, build_insn_chain, mark_reg_change): Likewise. * haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight): Likewise. * ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block): Likewise. * integrate.c (copy_rtx_and_substitute, try_constants, subst_constants, mark_stores, allocate_initial_values): Likewise. * jump.c (reversed_comparison_code_parts, delete_prior_computation, delete_computation, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem, update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set, wipe_dead_reg, no_conflict_p): Likewise. * loop-iv.c (simple_reg_p, simple_set_p, kill_sets, iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered, simple_rhs_p, simplify_using_assignment, implies_p): Likewise. * loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p, move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p, find_single_use_in_loop, count_one_set, loop_bivs_init_find, loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs, valid_initial_value_p, simplify_giv_expr, consec_sets_giv, loop_regs_update, check_dbra_loop, maybe_eliminate_biv, maybe_eliminate_biv_1, record_initial, update_reg_last_use, canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop, try_swap_copy_prop): Likewise. * optabs.c (expand_binop, expand_vector_binop, expand_vector_unop, expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float): Likewise. * postreload.c (reload_cse_simplify, reload_cse_simplify_set, reload_cse_simplify_operands, reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * print-rtl.c (print_rtx): Likewise. * ra-build.c (copy_insn_p, remember_move, init_one_web_common, contains_pseudo, handle_asm_insn): Likewise. * ra-debug.c (ra_print_rtx_object, dump_constraints, dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, emit_colors, remove_suspicious_death_notes): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use, register_operand, scratch_operand, nonmemory_operand, constrain_operands): Likewise. * reg-stack (check_asm_stack_operands, remove_regno_note, emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat, subst_asm_stack_regs): Likewise. * regclass.c (scan_one_insn, record_reg_classes, copy_cost, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (discover_flags_reg, replacement_quality, copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize, fixup_match_1): Likewise. * regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value, kill_set_value, copyprop_hardreg_forward_1): Likewise. * reload.c (MATCHES, push_secondary_reload, find_reusable_reload, reload_inner_reg_of_subreg, can_reload_into, push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, find_reloads_toplev, find_reloads_address, subst_indexed_address, find_reloads_address_1, find_reloads_subreg_address, find_replacement, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise. * reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns, find_reg, delete_dead_insn, alter_reg, eliminate_regs, elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs, forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs, emit_input_reload_insns, emit_output_reload_insns, do_input_reload, do_output_reload, emit_reload_insns, gen_reload, delete_address_reloads_1, inc_for_reload): Likewise. * reorg.c (update_reg_dead_notes, fix_reg_dead_note, update_reg_unused_notes, fill_slots_from_thread): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c (nonzero_address_p, get_jump_table_offset, global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p, reg_set_p, set_noop_p, find_last_value, refers_to_regno_p, note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in, parms_set, find_first_parameter_load, keep_with_call_p, hoist_test_store, hoist_update_store, address_cost, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn, sched_analyze): Likewise. * sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1): Likewise. * sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise. * simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_subreg): Likewise. * stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands, expand_end_stmt_expr, expand_return, expand_decl, expand_anon_union_decl): Likewise. * unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body, find_splittable_regs, find_splittable_givs, find_common_reg_term, loop_iterations): Likewise. * var-tracking.c (variable_union, variable_part_different_p, variable_different_p, count_uses, add_uses, add_stores, compute_bb_dataflow, set_variable_part, delete_variable_part, emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (assemble_variable): Likewise. From-SVN: r83195
2004-06-15 20:02:40 +02:00
if (REG_P (x) && REGNO (x) == i)
{
unchain_one_elt_loc_list (p);
break;
}
}
if (v->locs == 0)
n_useless_values++;
}
}
}
/* Return 1 if X has a value that can vary even between two
executions of the program. 0 means X can be compared reliably
against certain constants or near-constants. */
alias.c (mems_in_disjoint_alias_sets_p, [...]): Constify. * alias.c (mems_in_disjoint_alias_sets_p, fixed_scalar_and_varying_struct_p, aliases_everything_p, nonoverlapping_component_refs_p, nonoverlapping_memrefs_p, write_dependence_p, mems_in_disjoint_alias_sets_p, read_dependence, true_dependence, canon_true_dependence, anti_dependence, output_dependence): Constify. * combine.c (extended_count): Likewise. * cse.c (cse_rtx_varies_p, hash_rtx, exp_equiv_p): Likewise. * cselib.c (get_value_hash, references_value_p, cselib_reg_set_mode, cselib_rtx_varies_p): Likewise. * cselib.h (cselib_reg_set_mode, references_value_p): Likewise. * emit-rtl.c (mem_expr_equal_p, active_insn_p): Likewise. * function.c (contains, prologue_epilogue_contains, sibcall_epilogue_contains): Likewise. * jump.c (simplejump_p, condjump_p, condjump_in_parallel_p, pc_set, any_uncondjump_p, any_condjump_p, onlyjump_p, only_sets_cc0_p, sets_cc0_p, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * recog.c (asm_noperands): Likewise. * reload1.c (function_invariant_p): Likewise. * rtl.h (mem_expr_equal_p, active_insn_p, rtx_varies_p, rtx_addr_varies_p, asm_noperands, exp_equiv_p, hash_rtx, condjump_p, any_condjump_p, any_uncondjump_p, pc_set, simplejump_p, onlyjump_p, only_sets_cc0_p, sets_cc0_p, true_regnum, reg_or_subregno, condjump_in_parallel_p, extended_count, prologue_epilogue_contains, sibcall_epilogue_contains, function_invariant_p, true_dependence, canon_true_dependence, read_dependence, anti_dependence, output_dependence): Likewise. * rtlanal.c (rtx_varies_p, rtx_addr_varies_p): Likewise. java: * jcf-io.c (find_class): Fix -Wcast-qual warnings. From-SVN: r127063
2007-07-30 17:35:02 +02:00
static bool
cselib_rtx_varies_p (const_rtx x ATTRIBUTE_UNUSED, bool from_alias ATTRIBUTE_UNUSED)
{
/* We actually don't need to verify very hard. This is because
if X has actually changed, we invalidate the memory anyway,
so assume that all common memory addresses are
invariant. */
return 0;
}
/* Invalidate any locations in the table which are changed because of a
store to MEM_RTX. If this is called because of a non-const call
instruction, MEM_RTX is (mem:BLK const0_rtx). */
static void
cselib_invalidate_mem (rtx mem_rtx)
{
cselib_val **vp, *v, *next;
int num_mems = 0;
rtx mem_addr;
mem_addr = canon_rtx (get_addr (XEXP (mem_rtx, 0)));
mem_rtx = canon_rtx (mem_rtx);
vp = &first_containing_mem;
for (v = *vp; v != &dummy_val; v = next)
{
bool has_mem = false;
struct elt_loc_list **p = &v->locs;
int had_locs = v->locs != 0;
while (*p)
{
rtx x = (*p)->loc;
cselib_val *addr;
struct elt_list **mem_chain;
/* MEMs may occur in locations only at the top level; below
that every MEM or REG is substituted by its VALUE. */
alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 Jerry Quinn <jlquinn@optonline.net> * alias.c (get_alias_set, canon_rtx, get_addr, nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1): Use MEM_P. * builtins.c (expand_builtin_prefetch, expand_builtin_profile_func, expand_builtin): Likewise. * calls.c (expand_call, emit_library_call_value_1, store_one_arg): Likewise. * combine.c (can_combine_p, combinable_i3pat, try_combine, find_split_point, combine_simplify_rtx, simplify_set, make_extraction, rtx_equal_for_field_assignment_p, gen_lowpart_for_combine, record_dead_and_set_regs_1, get_last_value_validate, mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise. * cse.c (check_dependence, canon_hash, equiv_constant, gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers, cse_around_loop, cse_check_loop_start, cse_set_around_loop, count_reg_usage): Likewise. * cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup, cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol, dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise. * ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise. * df.c (df_uses_record): Likewise. * dojump (do_jump): Likewise. * dwarf2out.c (stack_adjust_offset, mem_loc_descriptor, loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info, decl_start_label): Likewise. * emit-rtl.c (gen_complex_constant_part, gen_highpart, operand_subword, change_address_1, make_safe_from): Likewise. * explow.c (break_out_memory_refs, copy_all_regs, validize_mem, stabilize, force_not_mem): Likewise. * expmed.c (store_bit_field, store_split_bit_field, extract_bit_field, expand_mult_const, expand_divmod, emit_store_flag): Likewise. * expr.c (convert_move, convert_modes, emit_block_move, emit_group_load, emit_group_store, clear_storage, emit_move_insn, emit_move_insn_1, expand_assignment, store_expr, store_constructor_field, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment): Likewise. * final.c (cleanup_subreg_operands, alter_subreg, get_mem_expr_from_op): Likewise. * flow.c (notice_stack_pointer_modification_1, init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs): Likewise. * function.c (mark_temp_addr_taken, preserve_temp_slots, preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1, optimize_bit_field, flush_addressof, purge_addressof_1, instantiate_decl, instantiate_virtual_regs_1, assign_parms, setjmp_protect, setjmp_protect_args, fix_lexical_addr, keep_stack_depressed): Likewise. * ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok, noce_process_if_block, find_memory): Likewise. * integrate.c (subst_constants, allocate_initial_values): Likewise. * local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p, update_equiv_regs): Likewise. * loop.c (scan_loop, prescan_loop, note_addr_stored, check_store, maybe_eliminate_biv_1, find_mem_in_note_1): Likewise. * optabs.c (expand_abs, emit_unop_insn): Likewise. * passes.c (rest_of_handle_final): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, move2add_note_store): Likewise. * ra-build.c (detect_remat_webs): Likewise. * ra-debug.c (dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, insert_stores): Likewise. * recog.c (validate_change, apply_change_group, cancel_changes, validate_replace_rtx_1, general_operand, register_operand, nonmemory_operand, push_operand, pop_operand, memory_operand, indirect_operand, asm_operand_ok, offsettable_memref_p, offsettable_nonstrict_memref_p, constrain_operands, store_data_bypass_p): Likewise. * reg-stack.c (subst_stack_regs_pat): Likewise. * regclass.c (record_operand_costs, scan_one_insn, record_reg_classes, copy_cost, reg_scan_mark_refs): Likewise. * regmove.c (optimize_reg_copy_3, stack_memref_p, combine_stack_adjustments_for_block): Likewise. * regrename.c (copyprop_hardreg_forward_1): Likewise. * reload.c (can_reload_into, push_reload, decompose, immune_p, find_reloads, find_reloads_address, find_reloads_address_1, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg): Likewise. * reload1.c (reload, eliminate_regs, eliminate_regs_in_insn, reload_as_needed, choose_reload_regs, emit_input_reload_insns, do_input_reload, emit_reload_insns, gen_reload, delete_output_reload, delete_address_reloads): Likewise. * resource.c (mark_referenced_resources): Likewise. * rtlanal.c (get_jump_table_offset, count_occurrences, reg_referenced_p, reg_set_p, set_of_1, set_noop_p, reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol, sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms, sdbout_global_decl): Likewise. * simplify-rtx.c (simplify_subreg): Likewise. * stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl, expand_anon_union_decl, expand_end_case_type): Likewise. * unroll.c (calculate_giv_inc): Likewise. * var-tracking.c (stack_adjust_offset_pre_post, bb_stack_adjust_offset, track_expr_p, count_uses, add_uses, add_stores, compute_bb_dataflow, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (make_var_volatile, notice_global_symbol, assemble_external, decode_addr_const, mark_weak, default_encode_section_info): Likewise. From-SVN: r83980
2004-07-01 14:52:53 +02:00
if (!MEM_P (x))
{
p = &(*p)->next;
continue;
}
if (num_mems < PARAM_VALUE (PARAM_MAX_CSELIB_MEMORY_LOCATIONS)
&& ! canon_true_dependence (mem_rtx, GET_MODE (mem_rtx), mem_addr,
x, NULL_RTX, cselib_rtx_varies_p))
{
has_mem = true;
num_mems++;
p = &(*p)->next;
continue;
}
/* This one overlaps. */
/* We must have a mapping from this MEM's address to the
value (E). Remove that, too. */
addr = cselib_lookup (XEXP (x, 0), VOIDmode, 0);
mem_chain = &addr->addr_list;
for (;;)
{
if ((*mem_chain)->elt == v)
{
unchain_one_elt_list (mem_chain);
break;
}
mem_chain = &(*mem_chain)->next;
}
unchain_one_elt_loc_list (p);
}
if (had_locs && v->locs == 0)
n_useless_values++;
next = v->next_containing_mem;
if (has_mem)
{
*vp = v;
vp = &(*vp)->next_containing_mem;
}
else
v->next_containing_mem = NULL;
}
*vp = &dummy_val;
}
/* Invalidate DEST, which is being assigned to or clobbered. */
void
cselib_invalidate_rtx (rtx dest)
{
while (GET_CODE (dest) == SUBREG
|| GET_CODE (dest) == ZERO_EXTRACT
|| GET_CODE (dest) == STRICT_LOW_PART)
dest = XEXP (dest, 0);
alias.c (record_set, [...]): Use REG_P. 2004-06-15 Jerry Quinn <jlquinn@optonline.net> * alias.c (record_set, record_base_value, canon_rtx, get_addr, nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P. * bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set): Likewise. * builtins.c (expand_builtin_setjmp, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp, expand_builtin_strcmp, expand_builtin_strncmp, expand_builtin_frame_address): Likewise. * caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs, insert_one_insn): Likewise. * calls.c (prepare_call_address, precompute_register_parameters, precompute_arguments, expand_call, emit_library_call_value_1): Likewise. * cfganal.c (flow_active_insn_p): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, can_combine_p, combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, make_extraction, recog_for_combine, gen_lowpart_for_combine, simplify_comparison, record_dead_and_set_regs_1, record_dead_and_set_regs, record_promoted_value, check_promoted_subreg, get_last_value_validate, get_last_value, reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes, unmentioned_reg_p_1): Likewise. * conflict.c (mark_reg): Likewise. * cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost, mention_regs, insert_regs, lookup, lookup_for_remove, insert, merge_equiv_classes, flush_hash_table, invalidate, remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg, invalidate_for_call, use_related_value, canon_hash, exp_equiv_p, cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant, record_jump_cond, cse_insn, addr_affects_sp_p, invalidate_from_clobbers, cse_process_notes, cse_around_loop, cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p, cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms, dbxout_block): Likewise. * df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise. * dojump.c (do_jump): Likewise. * dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg, is_based_loc, rtl_for_decl_location): Likewise. * emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl, set_decl_incoming_rtl, mark_user_reg): Likewise. * explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg, copy_to_suggested_reg, allocate_dynamic_stack_space, probe_stack_range, hard_function_value): Likewise. * expmed.c (store_bit_field, store_fixed_bit_field, store_split_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_divmod, emit_store_flag_force): Likewise. * expr.c (convert_move, convert_modes, block_move_libcall_safe_for_call_parm, emit_group_load, use_reg, use_group_regs, emit_move_insn, emit_move_insn_1, compress_float_constant, push_block, emit_single_push_insn, emit_push_insn, get_subtarget, expand_assignment, store_expr, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment, do_store_flag, do_tablejump): Likewise. * final.c (profile_function, final_scan_insn, alter_subreg, get_mem_expr_from_op, output_asm_operand_names, output_operand, only_leaf_regs_used, leaf_renumber_regs_insn): Likewise. * flow.c (verify_wide_reg_1, mark_regs_live_at_end, find_regno_partial, propagate_one_insn, init_propagate_block_info, insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond, attempt_auto_inc, find_auto_inc, mark_used_regs, count_or_remove_death_notes_bb): Likewise. * function.c (find_temp_slot_from_address, update_temp_slot_address, preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn, fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof, put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk, purge_single_hard_subreg_set, instantiate_decl, instantiate_virtual_regs_1, aggregate_value_p, assign_parms, promoted_input_arg, setjmp_vars_warning, setjmp_args_warning, setjmp_protect, setjmp_protect_args, fix_lexical_addr, expand_function_start, diddle_return_value, clobber_return_register, expand_function_end, keep_stack_depressed, handle_epilogue_set, update_epilogue_consts): Likewise. * genemit.c (gen_exp, gen_insn): Likewise. * genrecog.c (make_insn_sequence): Likewise. * global.c (global_conflicts, expand_preferences, mark_reg_store, mark_reg_conflicts, set_preference, reg_becomes_live, build_insn_chain, mark_reg_change): Likewise. * haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight): Likewise. * ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block): Likewise. * integrate.c (copy_rtx_and_substitute, try_constants, subst_constants, mark_stores, allocate_initial_values): Likewise. * jump.c (reversed_comparison_code_parts, delete_prior_computation, delete_computation, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem, update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set, wipe_dead_reg, no_conflict_p): Likewise. * loop-iv.c (simple_reg_p, simple_set_p, kill_sets, iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered, simple_rhs_p, simplify_using_assignment, implies_p): Likewise. * loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p, move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p, find_single_use_in_loop, count_one_set, loop_bivs_init_find, loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs, valid_initial_value_p, simplify_giv_expr, consec_sets_giv, loop_regs_update, check_dbra_loop, maybe_eliminate_biv, maybe_eliminate_biv_1, record_initial, update_reg_last_use, canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop, try_swap_copy_prop): Likewise. * optabs.c (expand_binop, expand_vector_binop, expand_vector_unop, expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float): Likewise. * postreload.c (reload_cse_simplify, reload_cse_simplify_set, reload_cse_simplify_operands, reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * print-rtl.c (print_rtx): Likewise. * ra-build.c (copy_insn_p, remember_move, init_one_web_common, contains_pseudo, handle_asm_insn): Likewise. * ra-debug.c (ra_print_rtx_object, dump_constraints, dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, emit_colors, remove_suspicious_death_notes): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use, register_operand, scratch_operand, nonmemory_operand, constrain_operands): Likewise. * reg-stack (check_asm_stack_operands, remove_regno_note, emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat, subst_asm_stack_regs): Likewise. * regclass.c (scan_one_insn, record_reg_classes, copy_cost, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (discover_flags_reg, replacement_quality, copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize, fixup_match_1): Likewise. * regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value, kill_set_value, copyprop_hardreg_forward_1): Likewise. * reload.c (MATCHES, push_secondary_reload, find_reusable_reload, reload_inner_reg_of_subreg, can_reload_into, push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, find_reloads_toplev, find_reloads_address, subst_indexed_address, find_reloads_address_1, find_reloads_subreg_address, find_replacement, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise. * reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns, find_reg, delete_dead_insn, alter_reg, eliminate_regs, elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs, forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs, emit_input_reload_insns, emit_output_reload_insns, do_input_reload, do_output_reload, emit_reload_insns, gen_reload, delete_address_reloads_1, inc_for_reload): Likewise. * reorg.c (update_reg_dead_notes, fix_reg_dead_note, update_reg_unused_notes, fill_slots_from_thread): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c (nonzero_address_p, get_jump_table_offset, global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p, reg_set_p, set_noop_p, find_last_value, refers_to_regno_p, note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in, parms_set, find_first_parameter_load, keep_with_call_p, hoist_test_store, hoist_update_store, address_cost, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn, sched_analyze): Likewise. * sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1): Likewise. * sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise. * simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_subreg): Likewise. * stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands, expand_end_stmt_expr, expand_return, expand_decl, expand_anon_union_decl): Likewise. * unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body, find_splittable_regs, find_splittable_givs, find_common_reg_term, loop_iterations): Likewise. * var-tracking.c (variable_union, variable_part_different_p, variable_different_p, count_uses, add_uses, add_stores, compute_bb_dataflow, set_variable_part, delete_variable_part, emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (assemble_variable): Likewise. From-SVN: r83195
2004-06-15 20:02:40 +02:00
if (REG_P (dest))
cselib_invalidate_regno (REGNO (dest), GET_MODE (dest));
alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 Jerry Quinn <jlquinn@optonline.net> * alias.c (get_alias_set, canon_rtx, get_addr, nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1): Use MEM_P. * builtins.c (expand_builtin_prefetch, expand_builtin_profile_func, expand_builtin): Likewise. * calls.c (expand_call, emit_library_call_value_1, store_one_arg): Likewise. * combine.c (can_combine_p, combinable_i3pat, try_combine, find_split_point, combine_simplify_rtx, simplify_set, make_extraction, rtx_equal_for_field_assignment_p, gen_lowpart_for_combine, record_dead_and_set_regs_1, get_last_value_validate, mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise. * cse.c (check_dependence, canon_hash, equiv_constant, gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers, cse_around_loop, cse_check_loop_start, cse_set_around_loop, count_reg_usage): Likewise. * cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup, cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol, dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise. * ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise. * df.c (df_uses_record): Likewise. * dojump (do_jump): Likewise. * dwarf2out.c (stack_adjust_offset, mem_loc_descriptor, loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info, decl_start_label): Likewise. * emit-rtl.c (gen_complex_constant_part, gen_highpart, operand_subword, change_address_1, make_safe_from): Likewise. * explow.c (break_out_memory_refs, copy_all_regs, validize_mem, stabilize, force_not_mem): Likewise. * expmed.c (store_bit_field, store_split_bit_field, extract_bit_field, expand_mult_const, expand_divmod, emit_store_flag): Likewise. * expr.c (convert_move, convert_modes, emit_block_move, emit_group_load, emit_group_store, clear_storage, emit_move_insn, emit_move_insn_1, expand_assignment, store_expr, store_constructor_field, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment): Likewise. * final.c (cleanup_subreg_operands, alter_subreg, get_mem_expr_from_op): Likewise. * flow.c (notice_stack_pointer_modification_1, init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs): Likewise. * function.c (mark_temp_addr_taken, preserve_temp_slots, preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1, optimize_bit_field, flush_addressof, purge_addressof_1, instantiate_decl, instantiate_virtual_regs_1, assign_parms, setjmp_protect, setjmp_protect_args, fix_lexical_addr, keep_stack_depressed): Likewise. * ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok, noce_process_if_block, find_memory): Likewise. * integrate.c (subst_constants, allocate_initial_values): Likewise. * local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p, update_equiv_regs): Likewise. * loop.c (scan_loop, prescan_loop, note_addr_stored, check_store, maybe_eliminate_biv_1, find_mem_in_note_1): Likewise. * optabs.c (expand_abs, emit_unop_insn): Likewise. * passes.c (rest_of_handle_final): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, move2add_note_store): Likewise. * ra-build.c (detect_remat_webs): Likewise. * ra-debug.c (dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, insert_stores): Likewise. * recog.c (validate_change, apply_change_group, cancel_changes, validate_replace_rtx_1, general_operand, register_operand, nonmemory_operand, push_operand, pop_operand, memory_operand, indirect_operand, asm_operand_ok, offsettable_memref_p, offsettable_nonstrict_memref_p, constrain_operands, store_data_bypass_p): Likewise. * reg-stack.c (subst_stack_regs_pat): Likewise. * regclass.c (record_operand_costs, scan_one_insn, record_reg_classes, copy_cost, reg_scan_mark_refs): Likewise. * regmove.c (optimize_reg_copy_3, stack_memref_p, combine_stack_adjustments_for_block): Likewise. * regrename.c (copyprop_hardreg_forward_1): Likewise. * reload.c (can_reload_into, push_reload, decompose, immune_p, find_reloads, find_reloads_address, find_reloads_address_1, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg): Likewise. * reload1.c (reload, eliminate_regs, eliminate_regs_in_insn, reload_as_needed, choose_reload_regs, emit_input_reload_insns, do_input_reload, emit_reload_insns, gen_reload, delete_output_reload, delete_address_reloads): Likewise. * resource.c (mark_referenced_resources): Likewise. * rtlanal.c (get_jump_table_offset, count_occurrences, reg_referenced_p, reg_set_p, set_of_1, set_noop_p, reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol, sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms, sdbout_global_decl): Likewise. * simplify-rtx.c (simplify_subreg): Likewise. * stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl, expand_anon_union_decl, expand_end_case_type): Likewise. * unroll.c (calculate_giv_inc): Likewise. * var-tracking.c (stack_adjust_offset_pre_post, bb_stack_adjust_offset, track_expr_p, count_uses, add_uses, add_stores, compute_bb_dataflow, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (make_var_volatile, notice_global_symbol, assemble_external, decode_addr_const, mark_weak, default_encode_section_info): Likewise. From-SVN: r83980
2004-07-01 14:52:53 +02:00
else if (MEM_P (dest))
cselib_invalidate_mem (dest);
/* Some machines don't define AUTO_INC_DEC, but they still use push
instructions. We need to catch that case here in order to
invalidate the stack pointer correctly. Note that invalidating
the stack pointer is different from invalidating DEST. */
if (push_operand (dest, GET_MODE (dest)))
cselib_invalidate_rtx (stack_pointer_rtx);
}
/* A wrapper for cselib_invalidate_rtx to be called via note_stores. */
static void
alias.c (record_set, [...]): Constify. * alias.c (record_set, memory_modified_1): Constify. * bt-load.c (note_btr_set): Likewise. * caller-save.c (mark_set_regs, add_stored_regs): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, expand_field_assignment, record_dead_and_set_regs_1, use_crosses_set_p, reg_dead_at_p_1, can_combine_p, likely_spilled_retval_1): Likewise. * config/frv/frv.c (frv_registers_update_1, frv_io_check_address, frv_io_handle_set): Likewise. * config/mips/mips.c (mips_sim_record_set, vr4130_true_reg_dependence_p_1): Likewise. * config/mt/mt.c (insn_dependent_p_1): Likewise. * config/s390/s390.c (s390_reg_clobbered_rtx): Likewise. * config/sh/sh.c (flow_dependent_p_1): Likewise. * cselib.c (cselib_invalidate_rtx_note_stores): Likewise. * dce.c (mark_nonreg_stores_1, mark_nonreg_stores_2): Likewise. * ddg.c (mark_mem_store): Likewise. * df-problems.c (df_urec_mark_reg_change): Likewise. * function.c (update_epilogue_consts): Likewise. * gcse.c (record_set_info, record_last_set_info, mems_conflict_for_gcse_p, canon_list_insert, reg_set_info, reg_clear_last_set): Likewise. * global.c (mark_reg_store, mark_reg_clobber, reg_becomes_live): Likewise. * jump.c (reversed_comparison_code_parts): Likewise. * local-alloc.c (validate_equiv_mem_from_store, no_equiv, reg_is_set): Likewise. * loop-iv.c (mark_altered): Likewise. * mode-switching.c (reg_becomes_live): Likewise. * optabs.c (no_conflict_move_test): Likewise. * postreload-gcse.c (record_last_set_info, find_mem_conflicts): Likewise. * postreload.c (reload_combine_note_store, move2add_note_store): Likewise. * regmove.c (flags_set_1): Likewise. * regrename.c (note_sets, kill_clobbered_value, kill_set_value): Likewise. * reload1.c (mark_not_eliminable, forget_old_reloads_1): Likewise. * resource.c (update_live_status): Likewise. * rtl.h (set_of, note_stores): Likewise. * rtlanal.c (set_of_1, parms_set, struct set_of_data, set_of, note_stores, parms_set): Likewise. * sched-rgn.c (sets_likely_spilled_1): Likewise. * stack-ptr-mod.c (notice_stack_pointer_modification_1): Likewise. * var-tracking.c (count_stores, add_stores): Likewise. From-SVN: r127065
2007-07-30 18:30:18 +02:00
cselib_invalidate_rtx_note_stores (rtx dest, const_rtx ignore ATTRIBUTE_UNUSED,
void *data ATTRIBUTE_UNUSED)
{
cselib_invalidate_rtx (dest);
}
/* Record the result of a SET instruction. DEST is being set; the source
contains the value described by SRC_ELT. If DEST is a MEM, DEST_ADDR_ELT
describes its address. */
static void
cselib_record_set (rtx dest, cselib_val *src_elt, cselib_val *dest_addr_elt)
{
alias.c (record_set, [...]): Use REG_P. 2004-06-15 Jerry Quinn <jlquinn@optonline.net> * alias.c (record_set, record_base_value, canon_rtx, get_addr, nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P. * bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set): Likewise. * builtins.c (expand_builtin_setjmp, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp, expand_builtin_strcmp, expand_builtin_strncmp, expand_builtin_frame_address): Likewise. * caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs, insert_one_insn): Likewise. * calls.c (prepare_call_address, precompute_register_parameters, precompute_arguments, expand_call, emit_library_call_value_1): Likewise. * cfganal.c (flow_active_insn_p): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, can_combine_p, combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, make_extraction, recog_for_combine, gen_lowpart_for_combine, simplify_comparison, record_dead_and_set_regs_1, record_dead_and_set_regs, record_promoted_value, check_promoted_subreg, get_last_value_validate, get_last_value, reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes, unmentioned_reg_p_1): Likewise. * conflict.c (mark_reg): Likewise. * cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost, mention_regs, insert_regs, lookup, lookup_for_remove, insert, merge_equiv_classes, flush_hash_table, invalidate, remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg, invalidate_for_call, use_related_value, canon_hash, exp_equiv_p, cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant, record_jump_cond, cse_insn, addr_affects_sp_p, invalidate_from_clobbers, cse_process_notes, cse_around_loop, cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p, cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms, dbxout_block): Likewise. * df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise. * dojump.c (do_jump): Likewise. * dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg, is_based_loc, rtl_for_decl_location): Likewise. * emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl, set_decl_incoming_rtl, mark_user_reg): Likewise. * explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg, copy_to_suggested_reg, allocate_dynamic_stack_space, probe_stack_range, hard_function_value): Likewise. * expmed.c (store_bit_field, store_fixed_bit_field, store_split_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_divmod, emit_store_flag_force): Likewise. * expr.c (convert_move, convert_modes, block_move_libcall_safe_for_call_parm, emit_group_load, use_reg, use_group_regs, emit_move_insn, emit_move_insn_1, compress_float_constant, push_block, emit_single_push_insn, emit_push_insn, get_subtarget, expand_assignment, store_expr, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment, do_store_flag, do_tablejump): Likewise. * final.c (profile_function, final_scan_insn, alter_subreg, get_mem_expr_from_op, output_asm_operand_names, output_operand, only_leaf_regs_used, leaf_renumber_regs_insn): Likewise. * flow.c (verify_wide_reg_1, mark_regs_live_at_end, find_regno_partial, propagate_one_insn, init_propagate_block_info, insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond, attempt_auto_inc, find_auto_inc, mark_used_regs, count_or_remove_death_notes_bb): Likewise. * function.c (find_temp_slot_from_address, update_temp_slot_address, preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn, fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof, put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk, purge_single_hard_subreg_set, instantiate_decl, instantiate_virtual_regs_1, aggregate_value_p, assign_parms, promoted_input_arg, setjmp_vars_warning, setjmp_args_warning, setjmp_protect, setjmp_protect_args, fix_lexical_addr, expand_function_start, diddle_return_value, clobber_return_register, expand_function_end, keep_stack_depressed, handle_epilogue_set, update_epilogue_consts): Likewise. * genemit.c (gen_exp, gen_insn): Likewise. * genrecog.c (make_insn_sequence): Likewise. * global.c (global_conflicts, expand_preferences, mark_reg_store, mark_reg_conflicts, set_preference, reg_becomes_live, build_insn_chain, mark_reg_change): Likewise. * haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight): Likewise. * ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block): Likewise. * integrate.c (copy_rtx_and_substitute, try_constants, subst_constants, mark_stores, allocate_initial_values): Likewise. * jump.c (reversed_comparison_code_parts, delete_prior_computation, delete_computation, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem, update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set, wipe_dead_reg, no_conflict_p): Likewise. * loop-iv.c (simple_reg_p, simple_set_p, kill_sets, iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered, simple_rhs_p, simplify_using_assignment, implies_p): Likewise. * loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p, move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p, find_single_use_in_loop, count_one_set, loop_bivs_init_find, loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs, valid_initial_value_p, simplify_giv_expr, consec_sets_giv, loop_regs_update, check_dbra_loop, maybe_eliminate_biv, maybe_eliminate_biv_1, record_initial, update_reg_last_use, canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop, try_swap_copy_prop): Likewise. * optabs.c (expand_binop, expand_vector_binop, expand_vector_unop, expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float): Likewise. * postreload.c (reload_cse_simplify, reload_cse_simplify_set, reload_cse_simplify_operands, reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * print-rtl.c (print_rtx): Likewise. * ra-build.c (copy_insn_p, remember_move, init_one_web_common, contains_pseudo, handle_asm_insn): Likewise. * ra-debug.c (ra_print_rtx_object, dump_constraints, dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, emit_colors, remove_suspicious_death_notes): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use, register_operand, scratch_operand, nonmemory_operand, constrain_operands): Likewise. * reg-stack (check_asm_stack_operands, remove_regno_note, emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat, subst_asm_stack_regs): Likewise. * regclass.c (scan_one_insn, record_reg_classes, copy_cost, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (discover_flags_reg, replacement_quality, copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize, fixup_match_1): Likewise. * regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value, kill_set_value, copyprop_hardreg_forward_1): Likewise. * reload.c (MATCHES, push_secondary_reload, find_reusable_reload, reload_inner_reg_of_subreg, can_reload_into, push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, find_reloads_toplev, find_reloads_address, subst_indexed_address, find_reloads_address_1, find_reloads_subreg_address, find_replacement, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise. * reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns, find_reg, delete_dead_insn, alter_reg, eliminate_regs, elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs, forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs, emit_input_reload_insns, emit_output_reload_insns, do_input_reload, do_output_reload, emit_reload_insns, gen_reload, delete_address_reloads_1, inc_for_reload): Likewise. * reorg.c (update_reg_dead_notes, fix_reg_dead_note, update_reg_unused_notes, fill_slots_from_thread): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c (nonzero_address_p, get_jump_table_offset, global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p, reg_set_p, set_noop_p, find_last_value, refers_to_regno_p, note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in, parms_set, find_first_parameter_load, keep_with_call_p, hoist_test_store, hoist_update_store, address_cost, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn, sched_analyze): Likewise. * sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1): Likewise. * sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise. * simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_subreg): Likewise. * stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands, expand_end_stmt_expr, expand_return, expand_decl, expand_anon_union_decl): Likewise. * unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body, find_splittable_regs, find_splittable_givs, find_common_reg_term, loop_iterations): Likewise. * var-tracking.c (variable_union, variable_part_different_p, variable_different_p, count_uses, add_uses, add_stores, compute_bb_dataflow, set_variable_part, delete_variable_part, emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (assemble_variable): Likewise. From-SVN: r83195
2004-06-15 20:02:40 +02:00
int dreg = REG_P (dest) ? (int) REGNO (dest) : -1;
if (src_elt == 0 || side_effects_p (dest))
return;
if (dreg >= 0)
{
if (dreg < FIRST_PSEUDO_REGISTER)
{
alias.c (record_set): Use hard_regno_nregs. * alias.c (record_set): Use hard_regno_nregs. * bt-load.c (find_btr_reference, note_btr_set): Likewise. * builtins.c (apply_args_size): Likewise. * caller-save.c (setup_save_areas, save_call_clobbered_regs, mark_set_regs, add_stored_regs, mark_referenced_regs, insert_restore, insert_save, insert_one_insn): Likewise. * cfgcleanup.c: Include regs.h (mark_effect, mentions_nonequal_regs): Likewise. * cfgrtl.c (mark_killed_regs): Likewise * combine.c (update_table_tick, record_value_for_reg, record_dead_and_set_regs, get_last_value_validate, use_crosses_set_p, reg_dead_at_p_1, reg_dead_at_p, mark_used_regs_combine, move_deaths, reg_bitfield_target_p, distribute_notes): Likewise. * cse.c (mention_regs, insert, invalidate, invalidate_for_call, exp_equiv_p, cse_insn): Likewise. * cselib.c (cselib_lookup): Likewise. (cselib_invalidate_regno, cselib_record_set): Likewise. * df.c (df_ref_record): Likewise. * dwarf2out.c (reg_loc_descriptor, multiple_reg_loc_descriptor): Likewise. * flow.c (mark_reg, insn_dead_p, mark_set_1, mark_used_reg, count_or_remove_death_notes_bb): Likewise. * function.c (aggregate_value_p, keep_stack_depressed): Likewise. * gloval.c (global_alloc, find_reg, mark_reg_store, mark_reg_conflicts, mark_reg_death, set_preference, reg_becomes_live, reg_dies): Likewise. * integrate.c (mark_stores): Likewise. * jump.c (delete_prior_computation): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (combine_regs, find_free_reg, post_mark_life): Likewise. * loop.c (LOOP_REGNO_NREGS): Likewise. * postreload.c (reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * ra-colorize.c (combine, color_usable_p, get_free_reg, calculate_dont_begin, calculate_dont_begin, colorize_one_web, try_recolor_web, insert_coalesced_conflicts, check_colors, break_precolored_alias): Likewise. * ra-debug.c: Include regs.h (ra_print_rtx_object): Likewise. * ra-rewrite (choose_spill_colors): Likewise. (spill_same_color_p, update_spill_colors, spill_is_free): Likewise. * ra.c (init_ra): Likewise. * recog.c (reg_fits_class_p, peep2_reg_dead_p, peep2_find_free_register): Likewise. * reg-stack.c (subst_stack_regs_pat, convert_regs_exit): Likewise. * regclass.c (hard_regno_nregs): New array. (init_reg_modes_once): Initialize it. (choose_hard_reg_mode): Use it. (record_reg_classes): Likewise. * regmove.c (mark_flags_life_zones): Likewise. * regrename.c (note_sets, clear_dead_regs, regrename_optimize, scan_rtx_reg, dump_def_use_chain, kill_value, set_value_regno, copy_value, maybe_mode_change, find_oldest_value_reg, copyprop_hardreg_forward_1): * regs.h (hard_regno_nregs): Declare. * realod.c (reload_inner_reg_of_subreg): Use it. (push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, refers_to_regno_for_reload_p, find_equiv_reg, regno_clobbered_p, reload_adjust_reg_for_mode): Likewise. * reload1.c (compute_use_by_pseudos, count_pseudo, count_spilled_pseudo, find_reg, find_reload_regs, mark_home_live, spill_hard_reg, forget_old_reloads_1, mark_reload_reg_in_use, clear_reload_reg_in_use, reload_reg_free_for_value_p, free_for_value_p allocate_reload_reg, choose_reload_regs, emit_reload_insns, delete_output_reload): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c: Include regs.h (refers_to_regno_p, reg_overlap_mentioned_p, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, subreg_regno_offset, subreg_offset_representable_p, hoist_test_store): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sched-rgn.c (check_live_1, update_live_1): Likewise. * stmt.c: Include regs.h (decl_conflicts_with_clobbers_p): Likewise. * varasm.c (make_decl_rtl): Likewise. * Makefile.in (cfgcleanup.o, rtlanal.o, ra-debug.o): Add regs.h dependnecy. From-SVN: r77088
2004-02-02 01:17:18 +01:00
unsigned int n = hard_regno_nregs[dreg][GET_MODE (dest)];
if (n > max_value_regs)
max_value_regs = n;
}
if (REG_VALUES (dreg) == 0)
{
used_regs[n_used_regs++] = dreg;
REG_VALUES (dreg) = new_elt_list (REG_VALUES (dreg), src_elt);
}
else
{
cfganal.c (flow_depth_first_order_compute, [...]): Use gcc_assert or gcc_unreachable. * cfganal.c (flow_depth_first_order_compute, dfs_enumerate_from, cfgbuild.c, inside_basic_block_p, control_flow_insn_p, make_label_edge, make_edges, find_basic_blocks_1): Use gcc_assert or gcc_unreachable. * cfg.c (clear_edges, initialize_bb_rbi, compact_blocks, remove_edge, alloc_aux_for_blocks, free_aux_for_blocks, alloc_aux_for_edges, free_aux_for_edges): Likewise. * cfgcleanup.c (try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps): Likewise. * cfgexpand.c (expand_gimple_cond_expr, expand_gimple_tailcall): Likewise. * cfghooks.c (duplicate_block): Likewise. * cfglayout.c (record_effective_endpoints, insn_locators_initialize, change_scope, fixup_reorder_chain, verify_insn_chain, fixup_fallthru_exit_predecessor, duplicate_insn_chain, cfg_layout_finalize): Likewise. * cfgloopanal.c (check_irred): Likewise. * cfgloop.c (superloop_at_depth, flow_loops_free, flow_loop_entry_edges_find, flow_loops_find, flow_loop_outside_edge_p, get_loop_body, get_loop_body_in_dom_order, get_loop_body_in_bfs_order, get_loop_exit_edges, num_loop_branches, cancel_loop, verify_loop_structure): Likewise. cfgloopmanip.c (find_path, remove_path, loop_delete_branch_edge, duplicate_loop_to_header_edge, create_preheader, create_loop_notes): Likewise. * cfgrtl.c (delete_insn, try_redirect_by_replacing_jump, edirect_branch_edge, force_nonfallthru_and_redirect, rtl_split_edge, insert_insn_on_edge, commit_one_edge_insertion, commit_edge_insertions, commit_edge_insertions_watch_calls, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_redirect_edge_and_branch_force, cfg_layout_merge_blocks, rtl_flow_call_edges_add): Likewise. * cgraph.c (cgraph_node, cgraph_create_edge, cgraph_remove_edge, cgraph_redirect_edge_callee, cgraph_global_info, cgraph_rtl_info, cgraph_varpool_node): Likewise. * cgraphunit.c (cgraph_finalize_function, cgraph_finalize_compilation_unit, cgraph_mark_functions_to_output, cgraph_expand_function, cgraph_remove_unreachable_nodes, cgraph_clone_inlined_nodes, cgraph_mark_inline_edge, cgraph_mark_inline, cgraph_expand_all_functions, cgraph_build_static_cdtor): Likewise. * combine.c (do_SUBST, try_combine, subst, combine_simplify_rtx, simplify_logical, distribute_notes, insn_cuid): Likewise. * conflict.c (conflict_graph_add, print_conflict): Likewise. * coverage.c (rtl_coverage_counter_ref, tree_coverage_counter_ref, coverage_checksum_string): Likewise. * cse.c (make_new_qty, make_regs_eqv, insert, invalidate, hash_rtx, exp_equiv_p, cse_basic_block, count_reg_usage, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (entry_and_rtx_equal_p, remove_useless_values, rtx_equal_for_cselib_p, wrap_constant, cselib_hash_rtx, new_cselib_val, cselib_subst_to_values, cselib_invalidate_regno, cselib_record_set): Likewise. From-SVN: r87145
2004-09-07 17:46:53 +02:00
/* The register should have been invalidated. */
gcc_assert (REG_VALUES (dreg)->elt == 0);
REG_VALUES (dreg)->elt = src_elt;
}
if (src_elt->locs == 0)
n_useless_values--;
src_elt->locs = new_elt_loc_list (src_elt->locs, dest);
}
alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 Jerry Quinn <jlquinn@optonline.net> * alias.c (get_alias_set, canon_rtx, get_addr, nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1): Use MEM_P. * builtins.c (expand_builtin_prefetch, expand_builtin_profile_func, expand_builtin): Likewise. * calls.c (expand_call, emit_library_call_value_1, store_one_arg): Likewise. * combine.c (can_combine_p, combinable_i3pat, try_combine, find_split_point, combine_simplify_rtx, simplify_set, make_extraction, rtx_equal_for_field_assignment_p, gen_lowpart_for_combine, record_dead_and_set_regs_1, get_last_value_validate, mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise. * cse.c (check_dependence, canon_hash, equiv_constant, gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers, cse_around_loop, cse_check_loop_start, cse_set_around_loop, count_reg_usage): Likewise. * cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup, cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol, dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise. * ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise. * df.c (df_uses_record): Likewise. * dojump (do_jump): Likewise. * dwarf2out.c (stack_adjust_offset, mem_loc_descriptor, loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info, decl_start_label): Likewise. * emit-rtl.c (gen_complex_constant_part, gen_highpart, operand_subword, change_address_1, make_safe_from): Likewise. * explow.c (break_out_memory_refs, copy_all_regs, validize_mem, stabilize, force_not_mem): Likewise. * expmed.c (store_bit_field, store_split_bit_field, extract_bit_field, expand_mult_const, expand_divmod, emit_store_flag): Likewise. * expr.c (convert_move, convert_modes, emit_block_move, emit_group_load, emit_group_store, clear_storage, emit_move_insn, emit_move_insn_1, expand_assignment, store_expr, store_constructor_field, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment): Likewise. * final.c (cleanup_subreg_operands, alter_subreg, get_mem_expr_from_op): Likewise. * flow.c (notice_stack_pointer_modification_1, init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs): Likewise. * function.c (mark_temp_addr_taken, preserve_temp_slots, preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1, optimize_bit_field, flush_addressof, purge_addressof_1, instantiate_decl, instantiate_virtual_regs_1, assign_parms, setjmp_protect, setjmp_protect_args, fix_lexical_addr, keep_stack_depressed): Likewise. * ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok, noce_process_if_block, find_memory): Likewise. * integrate.c (subst_constants, allocate_initial_values): Likewise. * local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p, update_equiv_regs): Likewise. * loop.c (scan_loop, prescan_loop, note_addr_stored, check_store, maybe_eliminate_biv_1, find_mem_in_note_1): Likewise. * optabs.c (expand_abs, emit_unop_insn): Likewise. * passes.c (rest_of_handle_final): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, move2add_note_store): Likewise. * ra-build.c (detect_remat_webs): Likewise. * ra-debug.c (dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, insert_stores): Likewise. * recog.c (validate_change, apply_change_group, cancel_changes, validate_replace_rtx_1, general_operand, register_operand, nonmemory_operand, push_operand, pop_operand, memory_operand, indirect_operand, asm_operand_ok, offsettable_memref_p, offsettable_nonstrict_memref_p, constrain_operands, store_data_bypass_p): Likewise. * reg-stack.c (subst_stack_regs_pat): Likewise. * regclass.c (record_operand_costs, scan_one_insn, record_reg_classes, copy_cost, reg_scan_mark_refs): Likewise. * regmove.c (optimize_reg_copy_3, stack_memref_p, combine_stack_adjustments_for_block): Likewise. * regrename.c (copyprop_hardreg_forward_1): Likewise. * reload.c (can_reload_into, push_reload, decompose, immune_p, find_reloads, find_reloads_address, find_reloads_address_1, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg): Likewise. * reload1.c (reload, eliminate_regs, eliminate_regs_in_insn, reload_as_needed, choose_reload_regs, emit_input_reload_insns, do_input_reload, emit_reload_insns, gen_reload, delete_output_reload, delete_address_reloads): Likewise. * resource.c (mark_referenced_resources): Likewise. * rtlanal.c (get_jump_table_offset, count_occurrences, reg_referenced_p, reg_set_p, set_of_1, set_noop_p, reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol, sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms, sdbout_global_decl): Likewise. * simplify-rtx.c (simplify_subreg): Likewise. * stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl, expand_anon_union_decl, expand_end_case_type): Likewise. * unroll.c (calculate_giv_inc): Likewise. * var-tracking.c (stack_adjust_offset_pre_post, bb_stack_adjust_offset, track_expr_p, count_uses, add_uses, add_stores, compute_bb_dataflow, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (make_var_volatile, notice_global_symbol, assemble_external, decode_addr_const, mark_weak, default_encode_section_info): Likewise. From-SVN: r83980
2004-07-01 14:52:53 +02:00
else if (MEM_P (dest) && dest_addr_elt != 0
&& cselib_record_memory)
{
if (src_elt->locs == 0)
n_useless_values--;
add_mem_for_addr (dest_addr_elt, src_elt, dest);
}
}
/* Describe a single set that is part of an insn. */
struct set
{
rtx src;
rtx dest;
cselib_val *src_elt;
cselib_val *dest_addr_elt;
};
/* There is no good way to determine how many elements there can be
in a PARALLEL. Since it's fairly cheap, use a really large number. */
#define MAX_SETS (FIRST_PSEUDO_REGISTER * 2)
/* Record the effects of any sets in INSN. */
static void
cselib_record_sets (rtx insn)
{
int n_sets = 0;
int i;
struct set sets[MAX_SETS];
rtx body = PATTERN (insn);
rtx cond = 0;
body = PATTERN (insn);
if (GET_CODE (body) == COND_EXEC)
{
cond = COND_EXEC_TEST (body);
body = COND_EXEC_CODE (body);
}
/* Find all sets. */
if (GET_CODE (body) == SET)
{
sets[0].src = SET_SRC (body);
sets[0].dest = SET_DEST (body);
n_sets = 1;
}
else if (GET_CODE (body) == PARALLEL)
{
/* Look through the PARALLEL and record the values being
set, if possible. Also handle any CLOBBERs. */
for (i = XVECLEN (body, 0) - 1; i >= 0; --i)
{
rtx x = XVECEXP (body, 0, i);
if (GET_CODE (x) == SET)
{
sets[n_sets].src = SET_SRC (x);
sets[n_sets].dest = SET_DEST (x);
n_sets++;
}
}
}
re PR middle-end/31150 (Not promoting an whole array to be static const) PR middle-end/31150 * dse.c (struct store_info): Add const_rhs field. (clear_rhs_from_active_local_stores): Clear also const_rhs. (record_store): Try also cselib_expand_value_rtx to get a constant. (find_shift_sequence, get_stored_val): Use const_rhs instead of rhs if worthwhile. * cselib.c (cselib_record_sets): If !cselib_record_memory and there is just one set from read-only MEM, look at REG_EQUAL or REG_EQUIV note. * dse.c (struct store_info): Add redundant_reason field. (record_store): When storing the same constant as has been stored by an earlier store, set redundant_reason field to the earlier store's insn_info_t. Don't delete cannot_delete insns. (find_shift_sequence): Remove read_info argument, add read_mode and require_cst arguments. Return early if require_cst and constant wouldn't be returned. (get_stored_val): New function. (replace_read): Use it. (scan_insn): Put even cannot_delete insns with exactly 1 store into active_local_stores. (dse_step1): Don't delete cannot_delete insns. Remove redundant constant stores if contains_cselib_groups and earlier store storing the same value hasn't been eliminated. (dse_step6): Renamed to dse_step7. New function. (dse_step7): Renamed from dse_step6. (rest_of_handle_dse): Call dse_step6 and dse_step7 at the end. * cselib.c (cselib_expand_value_rtx): Don't wrap CONST_INTs into CONST unless really necessary. Handle SUBREG, unary, ternary, bitfield and compares specially, to be able to simplify operations on constants. (expand_loc): Try to optimize LO_SUM. * dse.c (get_call_args): New function. (scan_insn): Don't handle BUILT_IN_BZERO. For memset, attempt to get call arguments and if successful and both len and val are constants, handle the call as (mem:BLK) (const_int) store. * dse.c (struct store_info): Add is_large bool field, change positions_needed into a union of a bitmask and bitmap + count. (free_store_info): Free bitmap if is_large. (set_usage_bits): Don't look at stores where offset + width >= MAX_OFFSET. (set_position_unneeded, set_all_positions_unneeded, any_positions_needed_p, all_positions_needed_p): New static inline functions. (record_store): Handle BLKmode stores of CONST_INT, if MEM_SIZE is set on the MEM. Use the new positions_needed accessor inlines. (replace_read): Handle reads from BLKmode CONST_INT stores. (check_mem_read_rtx): Use all_positions_needed_p function. (dse_step1): Free large positions_needed bitmaps and clear is_large. * dse.c (struct store_info): Change begin and end types to HOST_WIDE_INT. * dse.c (record_store): Fix check for unused store. * expr.c (block_clear_fn): No longer static. * expr.h (block_clear_fn): Declare. * dse.c (scan_insn): Memset and bzero can just read their arguments. * gcc.c-torture/execute/20081218-1.c: New test. From-SVN: r142892
2008-12-23 00:41:17 +01:00
if (n_sets == 1
&& MEM_P (sets[0].src)
&& !cselib_record_memory
&& MEM_READONLY_P (sets[0].src))
{
rtx note = find_reg_equal_equiv_note (insn);
if (note && CONSTANT_P (XEXP (note, 0)))
sets[0].src = XEXP (note, 0);
}
/* Look up the values that are read. Do this before invalidating the
locations that are written. */
for (i = 0; i < n_sets; i++)
{
rtx dest = sets[i].dest;
/* A STRICT_LOW_PART can be ignored; we'll record the equivalence for
the low part after invalidating any knowledge about larger modes. */
if (GET_CODE (sets[i].dest) == STRICT_LOW_PART)
sets[i].dest = dest = XEXP (dest, 0);
/* We don't know how to record anything but REG or MEM. */
alias.c (record_set, [...]): Use REG_P. 2004-06-15 Jerry Quinn <jlquinn@optonline.net> * alias.c (record_set, record_base_value, canon_rtx, get_addr, nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P. * bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set): Likewise. * builtins.c (expand_builtin_setjmp, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp, expand_builtin_strcmp, expand_builtin_strncmp, expand_builtin_frame_address): Likewise. * caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs, insert_one_insn): Likewise. * calls.c (prepare_call_address, precompute_register_parameters, precompute_arguments, expand_call, emit_library_call_value_1): Likewise. * cfganal.c (flow_active_insn_p): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, can_combine_p, combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, make_extraction, recog_for_combine, gen_lowpart_for_combine, simplify_comparison, record_dead_and_set_regs_1, record_dead_and_set_regs, record_promoted_value, check_promoted_subreg, get_last_value_validate, get_last_value, reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes, unmentioned_reg_p_1): Likewise. * conflict.c (mark_reg): Likewise. * cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost, mention_regs, insert_regs, lookup, lookup_for_remove, insert, merge_equiv_classes, flush_hash_table, invalidate, remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg, invalidate_for_call, use_related_value, canon_hash, exp_equiv_p, cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant, record_jump_cond, cse_insn, addr_affects_sp_p, invalidate_from_clobbers, cse_process_notes, cse_around_loop, cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p, cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms, dbxout_block): Likewise. * df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise. * dojump.c (do_jump): Likewise. * dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg, is_based_loc, rtl_for_decl_location): Likewise. * emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl, set_decl_incoming_rtl, mark_user_reg): Likewise. * explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg, copy_to_suggested_reg, allocate_dynamic_stack_space, probe_stack_range, hard_function_value): Likewise. * expmed.c (store_bit_field, store_fixed_bit_field, store_split_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_divmod, emit_store_flag_force): Likewise. * expr.c (convert_move, convert_modes, block_move_libcall_safe_for_call_parm, emit_group_load, use_reg, use_group_regs, emit_move_insn, emit_move_insn_1, compress_float_constant, push_block, emit_single_push_insn, emit_push_insn, get_subtarget, expand_assignment, store_expr, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment, do_store_flag, do_tablejump): Likewise. * final.c (profile_function, final_scan_insn, alter_subreg, get_mem_expr_from_op, output_asm_operand_names, output_operand, only_leaf_regs_used, leaf_renumber_regs_insn): Likewise. * flow.c (verify_wide_reg_1, mark_regs_live_at_end, find_regno_partial, propagate_one_insn, init_propagate_block_info, insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond, attempt_auto_inc, find_auto_inc, mark_used_regs, count_or_remove_death_notes_bb): Likewise. * function.c (find_temp_slot_from_address, update_temp_slot_address, preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn, fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof, put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk, purge_single_hard_subreg_set, instantiate_decl, instantiate_virtual_regs_1, aggregate_value_p, assign_parms, promoted_input_arg, setjmp_vars_warning, setjmp_args_warning, setjmp_protect, setjmp_protect_args, fix_lexical_addr, expand_function_start, diddle_return_value, clobber_return_register, expand_function_end, keep_stack_depressed, handle_epilogue_set, update_epilogue_consts): Likewise. * genemit.c (gen_exp, gen_insn): Likewise. * genrecog.c (make_insn_sequence): Likewise. * global.c (global_conflicts, expand_preferences, mark_reg_store, mark_reg_conflicts, set_preference, reg_becomes_live, build_insn_chain, mark_reg_change): Likewise. * haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight): Likewise. * ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block): Likewise. * integrate.c (copy_rtx_and_substitute, try_constants, subst_constants, mark_stores, allocate_initial_values): Likewise. * jump.c (reversed_comparison_code_parts, delete_prior_computation, delete_computation, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem, update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set, wipe_dead_reg, no_conflict_p): Likewise. * loop-iv.c (simple_reg_p, simple_set_p, kill_sets, iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered, simple_rhs_p, simplify_using_assignment, implies_p): Likewise. * loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p, move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p, find_single_use_in_loop, count_one_set, loop_bivs_init_find, loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs, valid_initial_value_p, simplify_giv_expr, consec_sets_giv, loop_regs_update, check_dbra_loop, maybe_eliminate_biv, maybe_eliminate_biv_1, record_initial, update_reg_last_use, canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop, try_swap_copy_prop): Likewise. * optabs.c (expand_binop, expand_vector_binop, expand_vector_unop, expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float): Likewise. * postreload.c (reload_cse_simplify, reload_cse_simplify_set, reload_cse_simplify_operands, reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * print-rtl.c (print_rtx): Likewise. * ra-build.c (copy_insn_p, remember_move, init_one_web_common, contains_pseudo, handle_asm_insn): Likewise. * ra-debug.c (ra_print_rtx_object, dump_constraints, dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, emit_colors, remove_suspicious_death_notes): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use, register_operand, scratch_operand, nonmemory_operand, constrain_operands): Likewise. * reg-stack (check_asm_stack_operands, remove_regno_note, emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat, subst_asm_stack_regs): Likewise. * regclass.c (scan_one_insn, record_reg_classes, copy_cost, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (discover_flags_reg, replacement_quality, copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize, fixup_match_1): Likewise. * regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value, kill_set_value, copyprop_hardreg_forward_1): Likewise. * reload.c (MATCHES, push_secondary_reload, find_reusable_reload, reload_inner_reg_of_subreg, can_reload_into, push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, find_reloads_toplev, find_reloads_address, subst_indexed_address, find_reloads_address_1, find_reloads_subreg_address, find_replacement, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise. * reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns, find_reg, delete_dead_insn, alter_reg, eliminate_regs, elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs, forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs, emit_input_reload_insns, emit_output_reload_insns, do_input_reload, do_output_reload, emit_reload_insns, gen_reload, delete_address_reloads_1, inc_for_reload): Likewise. * reorg.c (update_reg_dead_notes, fix_reg_dead_note, update_reg_unused_notes, fill_slots_from_thread): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c (nonzero_address_p, get_jump_table_offset, global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p, reg_set_p, set_noop_p, find_last_value, refers_to_regno_p, note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in, parms_set, find_first_parameter_load, keep_with_call_p, hoist_test_store, hoist_update_store, address_cost, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn, sched_analyze): Likewise. * sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1): Likewise. * sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise. * simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_subreg): Likewise. * stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands, expand_end_stmt_expr, expand_return, expand_decl, expand_anon_union_decl): Likewise. * unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body, find_splittable_regs, find_splittable_givs, find_common_reg_term, loop_iterations): Likewise. * var-tracking.c (variable_union, variable_part_different_p, variable_different_p, count_uses, add_uses, add_stores, compute_bb_dataflow, set_variable_part, delete_variable_part, emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (assemble_variable): Likewise. From-SVN: r83195
2004-06-15 20:02:40 +02:00
if (REG_P (dest)
alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 Jerry Quinn <jlquinn@optonline.net> * alias.c (get_alias_set, canon_rtx, get_addr, nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1): Use MEM_P. * builtins.c (expand_builtin_prefetch, expand_builtin_profile_func, expand_builtin): Likewise. * calls.c (expand_call, emit_library_call_value_1, store_one_arg): Likewise. * combine.c (can_combine_p, combinable_i3pat, try_combine, find_split_point, combine_simplify_rtx, simplify_set, make_extraction, rtx_equal_for_field_assignment_p, gen_lowpart_for_combine, record_dead_and_set_regs_1, get_last_value_validate, mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise. * cse.c (check_dependence, canon_hash, equiv_constant, gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers, cse_around_loop, cse_check_loop_start, cse_set_around_loop, count_reg_usage): Likewise. * cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup, cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol, dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise. * ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise. * df.c (df_uses_record): Likewise. * dojump (do_jump): Likewise. * dwarf2out.c (stack_adjust_offset, mem_loc_descriptor, loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info, decl_start_label): Likewise. * emit-rtl.c (gen_complex_constant_part, gen_highpart, operand_subword, change_address_1, make_safe_from): Likewise. * explow.c (break_out_memory_refs, copy_all_regs, validize_mem, stabilize, force_not_mem): Likewise. * expmed.c (store_bit_field, store_split_bit_field, extract_bit_field, expand_mult_const, expand_divmod, emit_store_flag): Likewise. * expr.c (convert_move, convert_modes, emit_block_move, emit_group_load, emit_group_store, clear_storage, emit_move_insn, emit_move_insn_1, expand_assignment, store_expr, store_constructor_field, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment): Likewise. * final.c (cleanup_subreg_operands, alter_subreg, get_mem_expr_from_op): Likewise. * flow.c (notice_stack_pointer_modification_1, init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs): Likewise. * function.c (mark_temp_addr_taken, preserve_temp_slots, preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1, optimize_bit_field, flush_addressof, purge_addressof_1, instantiate_decl, instantiate_virtual_regs_1, assign_parms, setjmp_protect, setjmp_protect_args, fix_lexical_addr, keep_stack_depressed): Likewise. * ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok, noce_process_if_block, find_memory): Likewise. * integrate.c (subst_constants, allocate_initial_values): Likewise. * local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p, update_equiv_regs): Likewise. * loop.c (scan_loop, prescan_loop, note_addr_stored, check_store, maybe_eliminate_biv_1, find_mem_in_note_1): Likewise. * optabs.c (expand_abs, emit_unop_insn): Likewise. * passes.c (rest_of_handle_final): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, move2add_note_store): Likewise. * ra-build.c (detect_remat_webs): Likewise. * ra-debug.c (dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, insert_stores): Likewise. * recog.c (validate_change, apply_change_group, cancel_changes, validate_replace_rtx_1, general_operand, register_operand, nonmemory_operand, push_operand, pop_operand, memory_operand, indirect_operand, asm_operand_ok, offsettable_memref_p, offsettable_nonstrict_memref_p, constrain_operands, store_data_bypass_p): Likewise. * reg-stack.c (subst_stack_regs_pat): Likewise. * regclass.c (record_operand_costs, scan_one_insn, record_reg_classes, copy_cost, reg_scan_mark_refs): Likewise. * regmove.c (optimize_reg_copy_3, stack_memref_p, combine_stack_adjustments_for_block): Likewise. * regrename.c (copyprop_hardreg_forward_1): Likewise. * reload.c (can_reload_into, push_reload, decompose, immune_p, find_reloads, find_reloads_address, find_reloads_address_1, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg): Likewise. * reload1.c (reload, eliminate_regs, eliminate_regs_in_insn, reload_as_needed, choose_reload_regs, emit_input_reload_insns, do_input_reload, emit_reload_insns, gen_reload, delete_output_reload, delete_address_reloads): Likewise. * resource.c (mark_referenced_resources): Likewise. * rtlanal.c (get_jump_table_offset, count_occurrences, reg_referenced_p, reg_set_p, set_of_1, set_noop_p, reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol, sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms, sdbout_global_decl): Likewise. * simplify-rtx.c (simplify_subreg): Likewise. * stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl, expand_anon_union_decl, expand_end_case_type): Likewise. * unroll.c (calculate_giv_inc): Likewise. * var-tracking.c (stack_adjust_offset_pre_post, bb_stack_adjust_offset, track_expr_p, count_uses, add_uses, add_stores, compute_bb_dataflow, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (make_var_volatile, notice_global_symbol, assemble_external, decode_addr_const, mark_weak, default_encode_section_info): Likewise. From-SVN: r83980
2004-07-01 14:52:53 +02:00
|| (MEM_P (dest) && cselib_record_memory))
{
rtx src = sets[i].src;
if (cond)
src = gen_rtx_IF_THEN_ELSE (GET_MODE (dest), cond, src, dest);
sets[i].src_elt = cselib_lookup (src, GET_MODE (dest), 1);
alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 Jerry Quinn <jlquinn@optonline.net> * alias.c (get_alias_set, canon_rtx, get_addr, nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1): Use MEM_P. * builtins.c (expand_builtin_prefetch, expand_builtin_profile_func, expand_builtin): Likewise. * calls.c (expand_call, emit_library_call_value_1, store_one_arg): Likewise. * combine.c (can_combine_p, combinable_i3pat, try_combine, find_split_point, combine_simplify_rtx, simplify_set, make_extraction, rtx_equal_for_field_assignment_p, gen_lowpart_for_combine, record_dead_and_set_regs_1, get_last_value_validate, mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise. * cse.c (check_dependence, canon_hash, equiv_constant, gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers, cse_around_loop, cse_check_loop_start, cse_set_around_loop, count_reg_usage): Likewise. * cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup, cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol, dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise. * ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise. * df.c (df_uses_record): Likewise. * dojump (do_jump): Likewise. * dwarf2out.c (stack_adjust_offset, mem_loc_descriptor, loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info, decl_start_label): Likewise. * emit-rtl.c (gen_complex_constant_part, gen_highpart, operand_subword, change_address_1, make_safe_from): Likewise. * explow.c (break_out_memory_refs, copy_all_regs, validize_mem, stabilize, force_not_mem): Likewise. * expmed.c (store_bit_field, store_split_bit_field, extract_bit_field, expand_mult_const, expand_divmod, emit_store_flag): Likewise. * expr.c (convert_move, convert_modes, emit_block_move, emit_group_load, emit_group_store, clear_storage, emit_move_insn, emit_move_insn_1, expand_assignment, store_expr, store_constructor_field, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment): Likewise. * final.c (cleanup_subreg_operands, alter_subreg, get_mem_expr_from_op): Likewise. * flow.c (notice_stack_pointer_modification_1, init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs): Likewise. * function.c (mark_temp_addr_taken, preserve_temp_slots, preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1, optimize_bit_field, flush_addressof, purge_addressof_1, instantiate_decl, instantiate_virtual_regs_1, assign_parms, setjmp_protect, setjmp_protect_args, fix_lexical_addr, keep_stack_depressed): Likewise. * ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok, noce_process_if_block, find_memory): Likewise. * integrate.c (subst_constants, allocate_initial_values): Likewise. * local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p, update_equiv_regs): Likewise. * loop.c (scan_loop, prescan_loop, note_addr_stored, check_store, maybe_eliminate_biv_1, find_mem_in_note_1): Likewise. * optabs.c (expand_abs, emit_unop_insn): Likewise. * passes.c (rest_of_handle_final): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, move2add_note_store): Likewise. * ra-build.c (detect_remat_webs): Likewise. * ra-debug.c (dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, insert_stores): Likewise. * recog.c (validate_change, apply_change_group, cancel_changes, validate_replace_rtx_1, general_operand, register_operand, nonmemory_operand, push_operand, pop_operand, memory_operand, indirect_operand, asm_operand_ok, offsettable_memref_p, offsettable_nonstrict_memref_p, constrain_operands, store_data_bypass_p): Likewise. * reg-stack.c (subst_stack_regs_pat): Likewise. * regclass.c (record_operand_costs, scan_one_insn, record_reg_classes, copy_cost, reg_scan_mark_refs): Likewise. * regmove.c (optimize_reg_copy_3, stack_memref_p, combine_stack_adjustments_for_block): Likewise. * regrename.c (copyprop_hardreg_forward_1): Likewise. * reload.c (can_reload_into, push_reload, decompose, immune_p, find_reloads, find_reloads_address, find_reloads_address_1, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg): Likewise. * reload1.c (reload, eliminate_regs, eliminate_regs_in_insn, reload_as_needed, choose_reload_regs, emit_input_reload_insns, do_input_reload, emit_reload_insns, gen_reload, delete_output_reload, delete_address_reloads): Likewise. * resource.c (mark_referenced_resources): Likewise. * rtlanal.c (get_jump_table_offset, count_occurrences, reg_referenced_p, reg_set_p, set_of_1, set_noop_p, reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol, sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms, sdbout_global_decl): Likewise. * simplify-rtx.c (simplify_subreg): Likewise. * stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl, expand_anon_union_decl, expand_end_case_type): Likewise. * unroll.c (calculate_giv_inc): Likewise. * var-tracking.c (stack_adjust_offset_pre_post, bb_stack_adjust_offset, track_expr_p, count_uses, add_uses, add_stores, compute_bb_dataflow, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (make_var_volatile, notice_global_symbol, assemble_external, decode_addr_const, mark_weak, default_encode_section_info): Likewise. From-SVN: r83980
2004-07-01 14:52:53 +02:00
if (MEM_P (dest))
sets[i].dest_addr_elt = cselib_lookup (XEXP (dest, 0), Pmode, 1);
else
sets[i].dest_addr_elt = 0;
}
}
/* Invalidate all locations written by this insn. Note that the elts we
looked up in the previous loop aren't affected, just some of their
locations may go away. */
note_stores (body, cselib_invalidate_rtx_note_stores, NULL);
/* If this is an asm, look for duplicate sets. This can happen when the
user uses the same value as an output multiple times. This is valid
if the outputs are not actually used thereafter. Treat this case as
if the value isn't actually set. We do this by smashing the destination
to pc_rtx, so that we won't record the value later. */
if (n_sets >= 2 && asm_noperands (body) >= 0)
{
for (i = 0; i < n_sets; i++)
{
rtx dest = sets[i].dest;
alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 Jerry Quinn <jlquinn@optonline.net> * alias.c (get_alias_set, canon_rtx, get_addr, nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1): Use MEM_P. * builtins.c (expand_builtin_prefetch, expand_builtin_profile_func, expand_builtin): Likewise. * calls.c (expand_call, emit_library_call_value_1, store_one_arg): Likewise. * combine.c (can_combine_p, combinable_i3pat, try_combine, find_split_point, combine_simplify_rtx, simplify_set, make_extraction, rtx_equal_for_field_assignment_p, gen_lowpart_for_combine, record_dead_and_set_regs_1, get_last_value_validate, mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise. * cse.c (check_dependence, canon_hash, equiv_constant, gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers, cse_around_loop, cse_check_loop_start, cse_set_around_loop, count_reg_usage): Likewise. * cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup, cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol, dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise. * ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise. * df.c (df_uses_record): Likewise. * dojump (do_jump): Likewise. * dwarf2out.c (stack_adjust_offset, mem_loc_descriptor, loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info, decl_start_label): Likewise. * emit-rtl.c (gen_complex_constant_part, gen_highpart, operand_subword, change_address_1, make_safe_from): Likewise. * explow.c (break_out_memory_refs, copy_all_regs, validize_mem, stabilize, force_not_mem): Likewise. * expmed.c (store_bit_field, store_split_bit_field, extract_bit_field, expand_mult_const, expand_divmod, emit_store_flag): Likewise. * expr.c (convert_move, convert_modes, emit_block_move, emit_group_load, emit_group_store, clear_storage, emit_move_insn, emit_move_insn_1, expand_assignment, store_expr, store_constructor_field, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment): Likewise. * final.c (cleanup_subreg_operands, alter_subreg, get_mem_expr_from_op): Likewise. * flow.c (notice_stack_pointer_modification_1, init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs): Likewise. * function.c (mark_temp_addr_taken, preserve_temp_slots, preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1, optimize_bit_field, flush_addressof, purge_addressof_1, instantiate_decl, instantiate_virtual_regs_1, assign_parms, setjmp_protect, setjmp_protect_args, fix_lexical_addr, keep_stack_depressed): Likewise. * ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok, noce_process_if_block, find_memory): Likewise. * integrate.c (subst_constants, allocate_initial_values): Likewise. * local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p, update_equiv_regs): Likewise. * loop.c (scan_loop, prescan_loop, note_addr_stored, check_store, maybe_eliminate_biv_1, find_mem_in_note_1): Likewise. * optabs.c (expand_abs, emit_unop_insn): Likewise. * passes.c (rest_of_handle_final): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, move2add_note_store): Likewise. * ra-build.c (detect_remat_webs): Likewise. * ra-debug.c (dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, insert_stores): Likewise. * recog.c (validate_change, apply_change_group, cancel_changes, validate_replace_rtx_1, general_operand, register_operand, nonmemory_operand, push_operand, pop_operand, memory_operand, indirect_operand, asm_operand_ok, offsettable_memref_p, offsettable_nonstrict_memref_p, constrain_operands, store_data_bypass_p): Likewise. * reg-stack.c (subst_stack_regs_pat): Likewise. * regclass.c (record_operand_costs, scan_one_insn, record_reg_classes, copy_cost, reg_scan_mark_refs): Likewise. * regmove.c (optimize_reg_copy_3, stack_memref_p, combine_stack_adjustments_for_block): Likewise. * regrename.c (copyprop_hardreg_forward_1): Likewise. * reload.c (can_reload_into, push_reload, decompose, immune_p, find_reloads, find_reloads_address, find_reloads_address_1, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg): Likewise. * reload1.c (reload, eliminate_regs, eliminate_regs_in_insn, reload_as_needed, choose_reload_regs, emit_input_reload_insns, do_input_reload, emit_reload_insns, gen_reload, delete_output_reload, delete_address_reloads): Likewise. * resource.c (mark_referenced_resources): Likewise. * rtlanal.c (get_jump_table_offset, count_occurrences, reg_referenced_p, reg_set_p, set_of_1, set_noop_p, reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol, sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms, sdbout_global_decl): Likewise. * simplify-rtx.c (simplify_subreg): Likewise. * stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl, expand_anon_union_decl, expand_end_case_type): Likewise. * unroll.c (calculate_giv_inc): Likewise. * var-tracking.c (stack_adjust_offset_pre_post, bb_stack_adjust_offset, track_expr_p, count_uses, add_uses, add_stores, compute_bb_dataflow, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (make_var_volatile, notice_global_symbol, assemble_external, decode_addr_const, mark_weak, default_encode_section_info): Likewise. From-SVN: r83980
2004-07-01 14:52:53 +02:00
if (REG_P (dest) || MEM_P (dest))
{
int j;
for (j = i + 1; j < n_sets; j++)
if (rtx_equal_p (dest, sets[j].dest))
{
sets[i].dest = pc_rtx;
sets[j].dest = pc_rtx;
}
}
}
}
/* Now enter the equivalences in our tables. */
for (i = 0; i < n_sets; i++)
{
rtx dest = sets[i].dest;
alias.c (record_set, [...]): Use REG_P. 2004-06-15 Jerry Quinn <jlquinn@optonline.net> * alias.c (record_set, record_base_value, canon_rtx, get_addr, nonlocal_mentioned_p_1, init_alias_analysis): Use REG_P. * bt-load.c (find_btr_reference, insn_sets_btr_p, note_btr_set): Likewise. * builtins.c (expand_builtin_setjmp, expand_builtin_apply, expand_builtin_mathfn, expand_builtin_strlen, expand_builtin_memcmp, expand_builtin_strcmp, expand_builtin_strncmp, expand_builtin_frame_address): Likewise. * caller-save.c (mark_set_regs, add_stored_regs, mark_referenced_regs, insert_one_insn): Likewise. * calls.c (prepare_call_address, precompute_register_parameters, precompute_arguments, expand_call, emit_library_call_value_1): Likewise. * cfganal.c (flow_active_insn_p): Likewise. * combine.c (set_nonzero_bits_and_sign_copies, can_combine_p, combinable_i3pat, try_combine, find_split_point, COMBINE_RTX_EQUAL_P, subst, combine_simplify_rtx, simplify_if_then_else, simplify_set, make_extraction, recog_for_combine, gen_lowpart_for_combine, simplify_comparison, record_dead_and_set_regs_1, record_dead_and_set_regs, record_promoted_value, check_promoted_subreg, get_last_value_validate, get_last_value, reg_dead_at_p_1, reg_bitfield_target_p, distribute_notes, unmentioned_reg_p_1): Likewise. * conflict.c (mark_reg): Likewise. * cse.c (HASH, COST, COST_IN, approx_reg_cost_1, notreg_cost, mention_regs, insert_regs, lookup, lookup_for_remove, insert, merge_equiv_classes, flush_hash_table, invalidate, remove_invalid_refs, remove_invalid_subreg_refs, rehash_using_reg, invalidate_for_call, use_related_value, canon_hash, exp_equiv_p, cse_rtx_varies_p, canon_reg, find_best_addr, fold_rtx, equiv_constant, record_jump_cond, cse_insn, addr_affects_sp_p, invalidate_from_clobbers, cse_process_notes, cse_around_loop, cse_set_around_loop, count_reg_usage, set_live_p, cse_change_cc_mode, cse_cc_succs, cse_condition_code_reg): Likewise. * cselib.c (cselib_reg_set_mode, rtx_equal_for_cselib_p, cselib_lookup, cselib_invalidate_regno, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (dbxout_symbol_location, dbxout_parms, dbxout_reg_parms, dbxout_block): Likewise. * df.c (df_ref_record, df_def_record_1, df_uses_record): Likewise. * dojump.c (do_jump): Likewise. * dwarf2out.c (dwarf2out_frame_debug_expr, is_pseudo_reg, is_based_loc, rtl_for_decl_location): Likewise. * emit-rtl.c (set_reg_attrs_for_parm, set_decl_rtl, set_decl_incoming_rtl, mark_user_reg): Likewise. * explow.c (copy_all_regs, copy_all_regs, memory_address, force_reg, copy_to_suggested_reg, allocate_dynamic_stack_space, probe_stack_range, hard_function_value): Likewise. * expmed.c (store_bit_field, store_fixed_bit_field, store_split_bit_field, extract_bit_field, extract_fixed_bit_field, extract_split_bit_field, expand_divmod, emit_store_flag_force): Likewise. * expr.c (convert_move, convert_modes, block_move_libcall_safe_for_call_parm, emit_group_load, use_reg, use_group_regs, emit_move_insn, emit_move_insn_1, compress_float_constant, push_block, emit_single_push_insn, emit_push_insn, get_subtarget, expand_assignment, store_expr, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment, do_store_flag, do_tablejump): Likewise. * final.c (profile_function, final_scan_insn, alter_subreg, get_mem_expr_from_op, output_asm_operand_names, output_operand, only_leaf_regs_used, leaf_renumber_regs_insn): Likewise. * flow.c (verify_wide_reg_1, mark_regs_live_at_end, find_regno_partial, propagate_one_insn, init_propagate_block_info, insn_dead_p, libcall_dead_p, mark_set_1, not_reg_cond, attempt_auto_inc, find_auto_inc, mark_used_regs, count_or_remove_death_notes_bb): Likewise. * function.c (find_temp_slot_from_address, update_temp_slot_address, preserve_temp_slots, put_var_into_stack, fixup_var_refs_insn, fixup_var_refs_1, fixup_stack_1, optimize_bit_field, flush_addressof, put_addressof_into_stack, purge_addressof_1, insns_for_mem_walk, purge_single_hard_subreg_set, instantiate_decl, instantiate_virtual_regs_1, aggregate_value_p, assign_parms, promoted_input_arg, setjmp_vars_warning, setjmp_args_warning, setjmp_protect, setjmp_protect_args, fix_lexical_addr, expand_function_start, diddle_return_value, clobber_return_register, expand_function_end, keep_stack_depressed, handle_epilogue_set, update_epilogue_consts): Likewise. * genemit.c (gen_exp, gen_insn): Likewise. * genrecog.c (make_insn_sequence): Likewise. * global.c (global_conflicts, expand_preferences, mark_reg_store, mark_reg_conflicts, set_preference, reg_becomes_live, build_insn_chain, mark_reg_change): Likewise. * haifa_sched.c (CONST_BASED_ADDRESS_P, find_set_reg_weight): Likewise. * ifcvt.c (noce_try_abs, noce_get_condition, noce_process_if_block): Likewise. * integrate.c (copy_rtx_and_substitute, try_constants, subst_constants, mark_stores, allocate_initial_values): Likewise. * jump.c (reversed_comparison_code_parts, delete_prior_computation, delete_computation, rtx_renumbered_equal_p, true_regnum, reg_or_subregno): Likewise. * lcm.c (reg_dies, reg_becomes_live): Likewise. * local-alloc.c (validate_equiv_mem_from_store, validate_equiv_mem, update_equiv_regs, no_equiv, block_alloc, combine_regs, reg_is_set, wipe_dead_reg, no_conflict_p): Likewise. * loop-iv.c (simple_reg_p, simple_set_p, kill_sets, iv_get_reaching_def, iv_analyze_biv, altered_reg_used, mark_altered, simple_rhs_p, simplify_using_assignment, implies_p): Likewise. * loop.c (scan_loop, combine_movables, rtx_equal_for_loop_p, move_movables, note_set_pseudo_multiple_uses, consec_sets_invariant_p, find_single_use_in_loop, count_one_set, loop_bivs_init_find, loop_givs_rescan, check_insn_for_bivs, check_insn_for_givs, valid_initial_value_p, simplify_giv_expr, consec_sets_giv, loop_regs_update, check_dbra_loop, maybe_eliminate_biv, maybe_eliminate_biv_1, record_initial, update_reg_last_use, canonicalize_condition, loop_regs_scan, load_mems, try_copy_prop, try_swap_copy_prop): Likewise. * optabs.c (expand_binop, expand_vector_binop, expand_vector_unop, expand_abs, emit_no_conflict_block, emit_libcall_block, expand_float): Likewise. * postreload.c (reload_cse_simplify, reload_cse_simplify_set, reload_cse_simplify_operands, reload_combine, reload_combine_note_store, reload_combine_note_use, reload_cse_move2add, move2add_note_store): Likewise. * print-rtl.c (print_rtx): Likewise. * ra-build.c (copy_insn_p, remember_move, init_one_web_common, contains_pseudo, handle_asm_insn): Likewise. * ra-debug.c (ra_print_rtx_object, dump_constraints, dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, emit_colors, remove_suspicious_death_notes): Likewise. * recog.c (validate_replace_rtx_1, find_single_use_1, find_single_use, register_operand, scratch_operand, nonmemory_operand, constrain_operands): Likewise. * reg-stack (check_asm_stack_operands, remove_regno_note, emit_swap_insn, swap_rtx_condition, subst_stack_regs_pat, subst_asm_stack_regs): Likewise. * regclass.c (scan_one_insn, record_reg_classes, copy_cost, record_address_regs, reg_scan_mark_refs): Likewise. * regmove.c (discover_flags_reg, replacement_quality, copy_src_to_dest, reg_is_remote_constant_p, regmove_optimize, fixup_match_1): Likewise. * regrename.c (note_sets, clear_dead_regs, build_def_use, kill_value, kill_set_value, copyprop_hardreg_forward_1): Likewise. * reload.c (MATCHES, push_secondary_reload, find_reusable_reload, reload_inner_reg_of_subreg, can_reload_into, push_reload, combine_reloads, find_dummy_reload, hard_reg_set_here_p, operands_match_p, decompose, find_reloads, find_reloads_toplev, find_reloads_address, subst_indexed_address, find_reloads_address_1, find_reloads_subreg_address, find_replacement, refers_to_regno_for_reload_p, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg, regno_clobbered_p): Likewise. * reload1.c (replace_pseudos_in, reload, calculate_needs_all_insns, find_reg, delete_dead_insn, alter_reg, eliminate_regs, elimination_effects, eliminate_regs_in_insn, scan_paradoxical_subregs, forget_old_reloads_1, reload_reg_free_for_value_p, choose_reload_regs, emit_input_reload_insns, emit_output_reload_insns, do_input_reload, do_output_reload, emit_reload_insns, gen_reload, delete_address_reloads_1, inc_for_reload): Likewise. * reorg.c (update_reg_dead_notes, fix_reg_dead_note, update_reg_unused_notes, fill_slots_from_thread): Likewise. * resource.c (update_live_status, mark_referenced_resources, mark_set_resources, mark_target_live_regs): Likewise. * rtlanal.c (nonzero_address_p, get_jump_table_offset, global_reg_mentioned_p_1, reg_mentioned_p, reg_referenced_p, reg_set_p, set_noop_p, find_last_value, refers_to_regno_p, note_stores, dead_or_set_p, dead_or_set_regno_p, find_regno_note, find_reg_fusage, find_regno_fusage, replace_regs, regno_use_in, parms_set, find_first_parameter_load, keep_with_call_p, hoist_test_store, hoist_update_store, address_cost, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (deps_may_trap_p, sched_analyze_1, sched_analyze_insn, sched_analyze): Likewise. * sched-rgn.c (check_live_1, update_live_1, sets_likely_spilled_1): Likewise. * sdbout.c (sdbout_symbol, sdbout_parms, sdbout_reg_parms): Likewise. * simplify-rtx.c (simplify_replace_rtx, simplify_unary_operation, simplify_binary_operation, simplify_const_relational_operation, simplify_subreg): Likewise. * stmt.c (decl_conflicts_with_clobbers_p, expand_asm_operands, expand_end_stmt_expr, expand_return, expand_decl, expand_anon_union_decl): Likewise. * unroll.c (precondition_loop_p, calculate_giv_inc, copy_loop_body, find_splittable_regs, find_splittable_givs, find_common_reg_term, loop_iterations): Likewise. * var-tracking.c (variable_union, variable_part_different_p, variable_different_p, count_uses, add_uses, add_stores, compute_bb_dataflow, set_variable_part, delete_variable_part, emit_notes_in_bb, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (assemble_variable): Likewise. From-SVN: r83195
2004-06-15 20:02:40 +02:00
if (REG_P (dest)
alias.c (get_alias_set, [...]): Use MEM_P. 2004-07-01 Jerry Quinn <jlquinn@optonline.net> * alias.c (get_alias_set, canon_rtx, get_addr, nonoverlapping_memrefs_p, nonlocal_referenced_p_1, memory_modified_1): Use MEM_P. * builtins.c (expand_builtin_prefetch, expand_builtin_profile_func, expand_builtin): Likewise. * calls.c (expand_call, emit_library_call_value_1, store_one_arg): Likewise. * combine.c (can_combine_p, combinable_i3pat, try_combine, find_split_point, combine_simplify_rtx, simplify_set, make_extraction, rtx_equal_for_field_assignment_p, gen_lowpart_for_combine, record_dead_and_set_regs_1, get_last_value_validate, mark_used_regs_combine, move_deaths, unmentioned_reg_p_1): Likewise. * cse.c (check_dependence, canon_hash, equiv_constant, gen_lowpart_if_possible, cse_insn, invalidate_from_clobbers, cse_around_loop, cse_check_loop_start, cse_set_around_loop, count_reg_usage): Likewise. * cselib.c (rtx_equal_for_cselib_p, add_mem_for_addr, cselib_lookup, cselib_invalidate_mem, cselib_invalidate_rtx, cselib_record_set, cselib_record_sets): Likewise. * dbxout.c (PARM_PASSED_IN_MEMORY, dbxout_symbol, dbxout_symbol_location, dbxout_parms, dbxout_reg_parms): Likewise. * ddg.c (mark_mem_use, mark_mem_store, rtx_mem_access_p): Likewise. * df.c (df_uses_record): Likewise. * dojump (do_jump): Likewise. * dwarf2out.c (stack_adjust_offset, mem_loc_descriptor, loc_descriptor_from_tree, rtl_for_decl_location, add_bound_info, decl_start_label): Likewise. * emit-rtl.c (gen_complex_constant_part, gen_highpart, operand_subword, change_address_1, make_safe_from): Likewise. * explow.c (break_out_memory_refs, copy_all_regs, validize_mem, stabilize, force_not_mem): Likewise. * expmed.c (store_bit_field, store_split_bit_field, extract_bit_field, expand_mult_const, expand_divmod, emit_store_flag): Likewise. * expr.c (convert_move, convert_modes, emit_block_move, emit_group_load, emit_group_store, clear_storage, emit_move_insn, emit_move_insn_1, expand_assignment, store_expr, store_constructor_field, store_constructor, store_field, force_operand, safe_from_p, expand_expr_real_1, expand_increment): Likewise. * final.c (cleanup_subreg_operands, alter_subreg, get_mem_expr_from_op): Likewise. * flow.c (notice_stack_pointer_modification_1, init_propagate_block_info, insn_dead_p, mark_set_1, mark_used_regs): Likewise. * function.c (mark_temp_addr_taken, preserve_temp_slots, preserve_rtl_expr_result, put_var_into_stack, fixup_var_refs_1, optimize_bit_field, flush_addressof, purge_addressof_1, instantiate_decl, instantiate_virtual_regs_1, assign_parms, setjmp_protect, setjmp_protect_args, fix_lexical_addr, keep_stack_depressed): Likewise. * ifcvt.c (noce_try_cmove_arith, noce_try_abs, noce_operand_ok, noce_process_if_block, find_memory): Likewise. * integrate.c (subst_constants, allocate_initial_values): Likewise. * local-alloc.c (validate_equiv_mem_from_store, memref_referenced_p, update_equiv_regs): Likewise. * loop.c (scan_loop, prescan_loop, note_addr_stored, check_store, maybe_eliminate_biv_1, find_mem_in_note_1): Likewise. * optabs.c (expand_abs, emit_unop_insn): Likewise. * passes.c (rest_of_handle_final): Likewise. * postreload.c (reload_cse_simplify_set, reload_cse_simplify_operands, move2add_note_store): Likewise. * ra-build.c (detect_remat_webs): Likewise. * ra-debug.c (dump_static_insn_cost): Likewise. * ra-rewrite.c (slots_overlap_p, insert_stores): Likewise. * recog.c (validate_change, apply_change_group, cancel_changes, validate_replace_rtx_1, general_operand, register_operand, nonmemory_operand, push_operand, pop_operand, memory_operand, indirect_operand, asm_operand_ok, offsettable_memref_p, offsettable_nonstrict_memref_p, constrain_operands, store_data_bypass_p): Likewise. * reg-stack.c (subst_stack_regs_pat): Likewise. * regclass.c (record_operand_costs, scan_one_insn, record_reg_classes, copy_cost, reg_scan_mark_refs): Likewise. * regmove.c (optimize_reg_copy_3, stack_memref_p, combine_stack_adjustments_for_block): Likewise. * regrename.c (copyprop_hardreg_forward_1): Likewise. * reload.c (can_reload_into, push_reload, decompose, immune_p, find_reloads, find_reloads_address, find_reloads_address_1, reg_overlap_mentioned_for_reload_p, refers_to_mem_for_reload_p, find_equiv_reg): Likewise. * reload1.c (reload, eliminate_regs, eliminate_regs_in_insn, reload_as_needed, choose_reload_regs, emit_input_reload_insns, do_input_reload, emit_reload_insns, gen_reload, delete_output_reload, delete_address_reloads): Likewise. * resource.c (mark_referenced_resources): Likewise. * rtlanal.c (get_jump_table_offset, count_occurrences, reg_referenced_p, reg_set_p, set_of_1, set_noop_p, reg_overlap_mentioned_p, note_uses, replace_regs, nonzero_bits1, num_sign_bit_copies1): Likewise. * rtlhooks.c (gen_lowpart_general): Likewise. * sched-deps.c (sched_analyze_1, sched_analyze_2): Likewise. * sdbout.c (PARM_PASSED_IN_MEMORY, sdbout_symbol, sdbout_toplevel_data, sdbout_parms, sdbout_reg_parms, sdbout_global_decl): Likewise. * simplify-rtx.c (simplify_subreg): Likewise. * stmt.c (expand_asm_operands, expand_expr_stmt_value, expand_decl, expand_anon_union_decl, expand_end_case_type): Likewise. * unroll.c (calculate_giv_inc): Likewise. * var-tracking.c (stack_adjust_offset_pre_post, bb_stack_adjust_offset, track_expr_p, count_uses, add_uses, add_stores, compute_bb_dataflow, vt_get_decl_and_offset, vt_add_function_parameters): Likewise. * varasm.c (make_var_volatile, notice_global_symbol, assemble_external, decode_addr_const, mark_weak, default_encode_section_info): Likewise. From-SVN: r83980
2004-07-01 14:52:53 +02:00
|| (MEM_P (dest) && cselib_record_memory))
cselib_record_set (dest, sets[i].src_elt, sets[i].dest_addr_elt);
}
}
/* Record the effects of INSN. */
void
cselib_process_insn (rtx insn)
{
int i;
rtx x;
cselib_current_insn = insn;
/* Forget everything at a CODE_LABEL, a volatile asm, or a setjmp. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (LABEL_P (insn)
|| (CALL_P (insn)
&& find_reg_note (insn, REG_SETJMP, NULL))
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
|| (NONJUMP_INSN_P (insn)
&& GET_CODE (PATTERN (insn)) == ASM_OPERANDS
&& MEM_VOLATILE_P (PATTERN (insn))))
{
cselib_clear_table ();
return;
}
if (! INSN_P (insn))
{
cselib_current_insn = 0;
return;
}
/* If this is a call instruction, forget anything stored in a
call clobbered register, or, if this is not a const call, in
memory. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (CALL_P (insn))
{
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
if (call_used_regs[i]
|| (REG_VALUES (i) && REG_VALUES (i)->elt
&& HARD_REGNO_CALL_PART_CLOBBERED (i,
GET_MODE (REG_VALUES (i)->elt->val_rtx))))
cselib_invalidate_regno (i, reg_raw_mode[i]);
[multiple changes] 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com> PATCH rtl/7335 PATCH rtl/33826 * see.c (see_copy_insn): Copy new pure const attributes for new call. * c-decl.c (merge_decls): Ditto. * postreload.c (record_opr_changes): Change CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. * tree.c (define_local_buitin): Rename DECL_IS_PURE to DECL_PURE_P. Initialized DECL_LOOPING_CONST_PURE. (process_call_operands): Set tree_side_effects properly. * tree.h (TREE_READONLY_DECL_P): Removed. (DECL_IS_PURE): Renamed to DECL_PURE_P. (DECL_LOOPING_OR_CONST_P): New macro. (struct tree_function_decl): Added looping_const_or_pure_p. (ECF_*) Renumbered. (ECF_LOOPING_OR_CONST_P): New macro, * rtlanal.c (pure_const_p): Removed. * builtins.c (expand_builtin): Rename DECL_IS_PURE to DECL_PURE_P. * reorg.c (delete_prior_computation) Changed CONST_OR_PURE_CALL_P to RTL_CONST_CALL_P. * ipa-pure-const.c (pure_const_state_e): Added looping field. (check_decl, check_tree, check_call, scan_function): Initialize looping. (analyze_function): Rename DECL_IS_PURE to DECL_PURE_P. (static_execute): Set looping true for recursive functions. Undo setting state to IPA_NEITHER for recursive functions. * cse.c (cse_insn): * ifcvt.c (noce_can_store_speculate_p): Changed CONST_OR_PURE_CALL_P and pure_call_p to RTL_CONST_CALL_P or RTL_CONST_OR_PURE_CALL_P. * dse.c (scan_insn): Ditto. * local-alloc.c (validate_equiv_mem, memref_used_between_p): Ditto. * gcse.c (oprs_not_seen_p) Changed CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. (store_killed_in_insn): Changed CONST_OR_PURE_CALL_P and pure_call_p to RTL_CONST_CALL_P. * gimplify.c (gimplify_call_expr): Clear side effects for non-looping pure and constant calls. * calls.c (emit_call_1): Set rtl flags from ecf flags. (flags_from_decl_or_type): Set ecf flags from decl flags. (initialize_argument_information): Turn off ECF_LOOPING_CONST_OR_PURE when turning off ECF_CONST. Change const to pure if callee_copies is true rather than just turning off const. (expand_call): Turn off ECF_LOOPING_PURE_CONST_CALL and remove old way of marking pure calls. (emit_library_call_value_1): Turn off ECF_LOOPING_PURE_CONST_CALL. Remove hack that was supposed to fix pr7335 and remove old way of marking pure calls. * emit-rtl.c (emit_copy_of_insn_after): Copy RTL_CONST_CALL_P, RTL_PURE_CALL_P, RTL_LOOPING_CONST_OR_PURE_CALL_P. * cselib.c (cselib_process_insn): Changed CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. * tree-ssa-pre.c (can_value_number_call): Fixed spacing. * loop-invariant.c (find_exits, find_invariant_bb): Changed CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. * sched-deps.c (schedule_analyze): Ditto. * rtl.h (struct rtx_def): Use call field, unchanging field, and return_val field of calls to represent pure and const function info. (CONST_OR_PURE_CALL_P): Deleted macro. (RTL_CONST_CALL_P, RTL_PURE_CALL_P, RTL_LOOPING_CONST_OR_PURE_CALL_P, RTL_CONST_OR_PURE_P): New macros. * tree-inline.c (copy_body_r): Changed TREE_READONLY_DECL_P to TREE_READONLY. * tree-optimize.c (execute_fixup_cfg): Added test for ECF_LOOPING_CONST_OR_PURE. * c-common.c (handle_pure_attribute): Changed DECL_IS_PURE to DECL_PURE_P. * tree-cfg.c (update_call_expr_flags): Do not clear tree side effects for looping pure or const calls. (verify_gimple_expr): Added verification code. * config/alpha/alpha.c (alpha_legitimize_address, alpha_emit_xfloating_libcall): Changed CONST_OR_PURE_CALL_P to RTL_CONST_CALL_P. * config/s390/s390.c (s390_emit_tls_call_insn): Ditto. * config/rs6000/rs6000.c (rs6000_legitimize_tls_address): Ditto. * config/mips/mips.c (mips_call_tls_get_addr): Ditto. * cfgrtl.c (need_fake_edge_p): Changed CONST_OR_PURE_CALL_P to RTL_CONST_OR_PURE_CALL_P. * dce.c (deletable_insn_p): Allow non looping, non sibling, pure and const calls to be deleted. java: 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com> * decl.c (java_init_decl_processing): Change DECL_IS_PURE to DECL_PURE_P. cp: 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com> * decl.c (duplicate_decls): Merge in DECL_PURE_P, TREE_READONLY, DECL_LOOPING_CONST_OR_PURE_P attributes. * rtti.c (build_dynamic_cast_1): Rename DECL_IS_PURE to DECL_PURE_P. gfortran: 2008-05-07 Kenneth Zadeck <zadeck@naturalbridge.com> * trans-decl.c (gfc_get_extern_function_decl, build_function_decl): Rename DECL_IS_PURE to DECL_PURE_P. From-SVN: r135053
2008-05-07 22:48:07 +02:00
/* Since it is not clear how cselib is going to be used, be
conservative here and treat looping pure or const functions
as if they were regular functions. */
if (RTL_LOOPING_CONST_OR_PURE_CALL_P (insn)
|| !(RTL_CONST_OR_PURE_CALL_P (insn)))
cselib_invalidate_mem (callmem);
}
cselib_record_sets (insn);
#ifdef AUTO_INC_DEC
/* Clobber any registers which appear in REG_INC notes. We
could keep track of the changes to their values, but it is
unlikely to help. */
for (x = REG_NOTES (insn); x; x = XEXP (x, 1))
if (REG_NOTE_KIND (x) == REG_INC)
cselib_invalidate_rtx (XEXP (x, 0));
#endif
/* Look for any CLOBBERs in CALL_INSN_FUNCTION_USAGE, but only
after we have processed the insn. */
alias.c (nonlocal_mentioned_p, [...]): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. 2004-07-08 Jerry Quinn <jlquinn@optonline.net> * alias.c (nonlocal_mentioned_p, nonlocal_referenced_p, nonlocal_set_p, init_alias_analysis): Use, LABEL_P, JUMP_P, CALL_P, NONJUMP_INSN_P, INSN_P, NOTE_P, BARRIER_P. * bb-reorder.c (mark_bb_for_unlikely_executed_section, add_labels_and_missing_jumps, find_jump_block, fix_crossing_unconditional_branches, add_reg_crossing_jump_notes): Likewise. * bt-load.c (btr_referenced_p, compute_defs_uses_and_gen, link_btr_uses, move_btr_def): Likewise. * builtins.c (expand_builtin_longjmp, expand_builtin_nonlocal_goto, expand_builtin_expect_jump): Likewise. * caller-save.c (save_call_clobbered_regs, insert_one_insn): Likewise. * calls.c (expand_call, emit_library_call_value_1): Likewise. * cfganal.c (forwarder_block_p): Likewise. * cfgbuild.c (inside_basic_block_p, count_basic_blocks, make_label_edge, rtl_make_eh_edge, make_edges, find_basic_blocks_1, find_bb_boundaries): Likewise. * cfgcleanup.c (try_simplify_condjump, try_forward_edges, merge_blocks_move_predecessor_nojumps, merge_blocks_move_successor_nojumps, insns_match_p, flow_find_cross_jump, outgoing_edges_match, try_crossjump_to_edge, try_optimize_cfg): Likewise. * cfgexpand.c (expand_block, construct_exit_block): Likewise. * cfglayout.c (skip_insns_after_block, label_for_bb, record_effective_endpoints, insn_locators_initialize, fixup_reorder_chain, update_unlikely_executed_notes): Likewise. * cfgmainloop.c (create_loop_notes): Likewise. * cfgrtl.c (delete_insn, delete_insn_chain, create_basic_block_structure, rtl_delete_block, free_bb_for_insn, update_bb_for_insn, rtl_merge_blocks, rtl_can_merge_blocks, block_label, try_redirect_by_replacing_jump, last_loop_beg_note, redirect_branch_edge, force_nonfallthru_and_redirect, rtl_tidy_fallthru_edge, back_edge_of_syntactic_loop_p, rtl_split_edge, commit_one_edge_insertion, print_rtl_with_bb, update_br_prob_note, rtl_verify_flow_info_1, rtl_verify_flow_info, purge_dead_edges, cfg_layout_redirect_edge_and_branch, cfg_layout_delete_block, cfg_layout_can_merge_blocks_p, cfg_layout_merge_blocks, rtl_block_ends_with_call_p, need_fake_edge_p, rtl_flow_call_edges_add): Likewise. * combine.c (combine_instructions, can_combine_p, try_combine, find_split_point, record_dead_and_set_regs, reg_dead_at_p, distribute_notes, distribute_links, insn_cuid): Likewise. * cse.c (fold_rtx, cse_insn, cse_around_loop, invalidate_skipped_block, cse_set_around_loop, cse_end_of_basic_block, cse_main, cse_basic_block, cse_condition_code_reg): Likewise. * cselib.c (cselib_process_insn): Likewise. * ddg.c (create_ddg): Likewise. * df.c (df_insn_refs_record, df_bb_rd_local_compute, df_insns_modify): Likewise. * dwarf2out.c (dwarf2out_stack_adjust, dwarf2out_frame_debug, gen_label_die, dwarf2out_var_location): Likewise. * emit-rtl.c (get_first_nonnote_insn, get_last_nonnote_insn, next_insn, previous_insn, next_nonnote_insn, prev_nonnote_insn, last_call_insn, active_insn_p, next_label, prev_label, link_cc0_insns, next_cc0_user, try_split, add_insn_after, add_insn_before, remove_insn, add_function_usage_to, reorder_insns, find_line_note, remove_unnecessary_notes, emit_insn_after_1, classify_insn): Likewise. * except.c (convert_from_eh_region_ranges_1, emit_to_new_bb_before, connect_post_landing_pads, sjlj_mark_call_sites, sjlj_emit_function_enter, sjlj_emit_function_exit, reachable_handlers, can_throw_internal, can_throw_external, set_nothrow_function_flags, convert_to_eh_region_ranges): Likewise. * explow.c (optimize_save_area_alloca): Likewise. * expr.c (expand_expr_real): Likewise. * final.c (insn_current_reference_address, compute_alignments, shorten_branches, final, scan_ahead_for_unlikely_executed_note, final_scan_insn, output_asm_label, leaf_function_p): Likewise. * flow.c (first_insn_after_basic_block_note, delete_dead_jumptables, propagate_block_delete_insn, propagate_one_insn, init_propagate_block_info, propagate_block, libcall_dead_p, mark_set_1, attempt_auto_inc, find_auto_inc, try_pre_increment): Likewise. * function.c (instantiate_virtual_regs, reorder_blocks_1, expand_function_start, expand_function_end, contains, thread_prologue_and_epilogue_insns, reposition_prologue_and_epilogue_notes): Likewise. * gcse.c (constprop_register, bypass_conditional_jumps, insert_insn_end_bb, gcse_after_reload): Likewise. * genemit.c (gen_expand, gen_split): Likewise. * genpeep.c (gen_peephole, main): Likewise. * global.c (build_insn_chain): Likewise. * graph.c (node_data, print_rtl_graph_with_bb): Likewise. * haifa-sched.c (unlink_other_notes, unlink_line_notes, get_block_head_tail, no_real_insns_p, rm_line_notes, save_line_notes, restore_line_notes, rm_redundant_line_notes, rm_other_notes, ok_for_early_queue_removal, set_priorities, sched_init): Likewise. * ifcvt.c (count_bb_insns, first_active_insn, last_active_insn, cond_exec_process_insns, end_ifcvt_sequence, noce_process_if_block, merge_if_block, block_jumps_and_fallthru_p, find_if_block, dead_or_predicable): Likewise. * integrate.c (try_constants): Likewise. * jump.c (rebuild_jump_labels, cleanup_barriers, purge_line_number_notes, init_label_info, mark_all_labels, squeeze_notes, get_label_before, get_label_after, reversed_comparison_code_parts, simplejump_p, pc_set, returnjump_p, onlyjump_p, follow_jumps, mark_jump_label, delete_barrier, delete_prior_computation, delete_computation, delete_related_insns, delete_for_peephole, redirect_jump): Likewise. * lcm.c (optimize_mode_switching): Likewise. * local-alloc.c (validate_equiv_mem, update_equiv_regs, block_alloc): Likewise. * loop-doloop.c (doloop_valid_p, doloop_optimize): Likewise. * loop-invariant.c (find_exits, find_invariants_bb): Likewise. * loop-iv.c (simplify_using_assignment): Likewise. * loop.c (compute_luids, loop_optimize, scan_loop, libcall_other_reg, libcall_benefit, skip_consec_insns, move_movables, prescan_loop, find_and_verify_loops, labels_in_range_p, for_each_insn_in_loop, loop_bivs_init_find, strength_reduce, check_insn_for_bivs, check_insn_for_givs, check_final_value, update_giv_derive, basic_induction_var, product_cheap_p, check_dbra_loop, loop_insn_first_p, last_use_this_basic_block, canonicalize_condition, get_condition, loop_regs_scan, load_mems, try_copy_prop, LOOP_BLOCK_NUM, loop_dump_aux): Likewise. * modulo-sched.c (doloop_register_get, find_line_note, sms_schedule, sms_schedule_by_order): Likewise. * optabs.c (emit_no_conflict_block, emit_libcall_block): Likewise. * postreload.c (reload_cse_simplify_operands, reload_combine, reload_cse_move2add): Likewise. * predict.c (can_predict_insn_p, estimate_probability, expected_value_to_br_prob, process_note_predictions): Likewise. * print-rtl.c (print_rtx, print_rtl, print_rtl_single): Likewise. * profile.c (branch_prob): Likewise. * ra-build.c (live_out_1, livethrough_conflicts_bb, detect_webs_set_in_cond_jump): Likewise. * ra-debug.c (ra_print_rtx_object, ra_debug_insns, ra_print_rtl_with_bb): Likewise. * ra-rewrite.c (insert_stores, rewrite_program2): Likewise. * recog.c (next_insn_tests_no_inequality, find_single_use, split_all_insns, peephole2_optimize, if_test_bypass_p): Likewise. * reg-stack.c (next_flags_user, record_label_references, emit_swap_insn, swap_rtx_condition, subst_stack_regs, compensate_edge, convert_regs_1): Likewise. * regclass.c (scan_one_insn): Likewise. * regmove.c (optimize_reg_copy_1, optimize_reg_copy_2, fixup_match_2, regmove_optimize, fixup_match_1, single_set_for_csa, combine_stack_adjustments_for_block): Likewise. * regrename.c (build_def_use, copyprop_hardreg_forward_1): Likewise. * reload.c (find_reloads, find_reloads_address_1, subst_reloads, find_equiv_reg): Likewise. * reload1.c (reload, calculate_needs_all_insns, set_label_offsets, reload_as_needed, emit_input_reload_insns, do_output_reload, delete_output_reload, delete_address_reloads_1, fixup_abnormal_edges): Likewise. * reorg.c (find_end_label, emit_delay_sequence, delete_from_delay_slot, delete_scheduled_jump, optimize_skip, get_jump_flags, rare_destination, mostly_true_jump, try_merge_delay_insns, redundant_insn, own_thread_p, fill_simple_delay_slots, fill_slots_from_thread, fill_eager_delay_slots, relax_delay_slots, make_return_insns, dbr_schedule): Likewise. * resource.c (find_basic_block, next_insn_no_annul, find_dead_or_set_registers, mark_target_live_regs): Likewise. * rtl.h (RTX_PREV): Likewise. * rtlanal.c (global_reg_mentioned_p, no_labels_between_p, no_jumps_between_p, reg_used_between_p, reg_referenced_between_p, reg_set_p, find_last_value, dead_or_set_regno_p, find_reg_fusage, find_regno_fusage, pure_call_p, replace_label, rtx_referenced_p_1, tablejump_p, computed_jump_p, insns_safe_to_move_p, find_first_parameter_load, can_hoist_insn_p): Likewise. * sched-deps.c (get_condition, add_dependence, sched_analyze_2, sched_analyze_insn, sched_analyze, add_forward_dependence): Likewise. * sched-ebb.c (fix_basic_block_boundaries, add_deps_for_risky_insns, schedule_ebbs): Likewise. * sched-rgn.c (is_cfg_nonregular, find_conditional_protection, is_conditionally_protected, can_schedule_ready_p, add_branch_dependences, debug_dependencies): Likewise. * stmt.c (emit_nop, expand_start_case, emit_jump_if_reachable): Likewise. * unroll.c (unroll_loop, copy_loop_body, back_branch_in_range_p, reg_dead_after_loop, loop_find_equiv_value, loop_iterations, set_dominates_use, ujump_to_loop_cont): Likewise. * var-tracking.c (prologue_stack_adjust, vt_initialize): Likewise. * varasm.c (output_constant_pool_1): Likewise. From-SVN: r84341
2004-07-09 05:29:35 +02:00
if (CALL_P (insn))
for (x = CALL_INSN_FUNCTION_USAGE (insn); x; x = XEXP (x, 1))
if (GET_CODE (XEXP (x, 0)) == CLOBBER)
cselib_invalidate_rtx (XEXP (XEXP (x, 0), 0));
cselib_current_insn = 0;
if (n_useless_values > MAX_USELESS_VALUES
/* remove_useless_values is linear in the hash table size. Avoid
quadratic behavior for very large hashtables with very few
useless elements. */
&& (unsigned int)n_useless_values > cselib_hash_table->n_elements / 4)
remove_useless_values ();
}
/* Initialize cselib for one pass. The caller must also call
init_alias_analysis. */
void
cselib_init (bool record_memory)
{
elt_list_pool = create_alloc_pool ("elt_list",
sizeof (struct elt_list), 10);
elt_loc_list_pool = create_alloc_pool ("elt_loc_list",
sizeof (struct elt_loc_list), 10);
cselib_val_pool = create_alloc_pool ("cselib_val_list",
sizeof (cselib_val), 10);
re PR target/9703 ([arm] Accessing data through constant pool more times could be solved in less instructions) * cselib.c (cselib_init): Change RTX_SIZE to RTX_CODE_SIZE. * emit-rtl.c (copy_rtx_if_shared_1): Use shallow_copy_rtx. (copy_insn_1): Likewise. Don't copy each field individually. Reindent. * read-rtl.c (apply_macro_to_rtx): Use RTX_CODE_SIZE instead of RTX_SIZE. * reload1.c (eliminate_regs): Use shallow_copy_rtx. * rtl.c (rtx_size): Rename variable to... (rtx_code_size): ...this. (rtx_size): New function. (rtx_alloc_stat): Use RTX_CODE_SIZE instead of RTX_SIZE. (copy_rtx): Use shallow_copy_rtx. Don't copy each field individually. Reindent. (shallow_copy_rtx_stat): Use rtx_size instead of RTX_SIZE. * rtl.h (rtx_code_size): New variable. (rtx_size): Change from a variable to a function. (RTX_SIZE): Rename to... (RTX_CODE_SIZE): ...this. PR target/9703 PR tree-optimization/17106 * doc/tm.texi (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Document. (Anchored Addresses): New section. * doc/invoke.texi (-fsection-anchors): Document. * doc/rtl.texi (SYMBOL_REF_IN_BLOCK_P, SYMBOL_FLAG_IN_BLOCK): Likewise. (SYMBOL_REF_ANCHOR_P, SYMBOL_FLAG_ANCHOR): Likewise. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): Likewise. * hooks.c (hook_bool_mode_rtx_false): New function. * hooks.h (hook_bool_mode_rtx_false): Declare. * gengtype.c (create_optional_field): New function. (adjust_field_rtx_def): Add the "block_sym" field for SYMBOL_REFs when SYMBOL_REF_IN_BLOCK_P is true. * target.h (output_anchor, use_blocks_for_constant_p): New hooks. (min_anchor_offset, max_anchor_offset): Likewise. (use_anchors_for_symbol_p): New hook. * toplev.c (compile_file): Call output_object_blocks. (target_supports_section_anchors_p): New function. (process_options): Check that -fsection-anchors is only used on targets that support it and when -funit-at-a-time is in effect. * tree-ssa-loop-ivopts.c (prepare_decl_rtl): Only create DECL_RTL if the decl doesn't have one. * dwarf2out.c: Remove instantiations of VEC(rtx,gc). * expr.c (emit_move_multi_word, emit_move_insn): Pass the result of force_const_mem through use_anchored_address. (expand_expr_constant): New function. (expand_expr_addr_expr_1): Call it. Use the same modifier when calling expand_expr for INDIRECT_REF. (expand_expr_real_1): Pass DECL_RTL through use_anchored_address for all modifiers except EXPAND_INITIALIZER. Use expand_expr_constant. * expr.h (use_anchored_address): Declare. * loop-unroll.c: Don't declare rtx vectors here. * explow.c: Include output.h. (validize_mem): Call use_anchored_address. (use_anchored_address): New function. * common.opt (-fsection-anchors): New switch. * varasm.c (object_block_htab, anchor_labelno): New variables. (hash_section, object_block_entry_eq, object_block_entry_hash) (use_object_blocks_p, get_block_for_section, create_block_symbol) (use_blocks_for_decl_p, change_symbol_section): New functions. (get_variable_section): New function, split out from assemble_variable. (make_decl_rtl): Create a block symbol if use_object_blocks_p and use_blocks_for_decl_p say so. Use change_symbol_section if the symbol has already been created. (assemble_variable_contents): New function, split out from... (assemble_variable): ...here. Don't output any code for block symbols; just pass them to place_block_symbol. Use get_variable_section and assemble_variable_contents. (get_constant_alignment, get_constant_section, get_constant_size): New functions, split from output_constant_def_contents. (build_constant_desc): Create a block symbol if use_object_blocks_p says so. Or into SYMBOL_REF_FLAGS. (assemble_constant_contents): New function, split from... (output_constant_def_contents): ...here. Don't output any code for block symbols; just pass them to place_section_symbol. Use get_constant_section and get_constant_alignment. (force_const_mem): Create a block symbol if use_object_blocks_p and use_blocks_for_constant_p say so. Or into SYMBOL_REF_FLAGS. (output_constant_pool_1): Add an explicit alignment argument. Don't switch sections here. (output_constant_pool): Adjust call to output_constant_pool_1. Switch sections here instead. Don't output anything for block symbols; just pass them to place_block_symbol. (init_varasm_once): Initialize object_block_htab. (default_encode_section_info): Keep the old SYMBOL_FLAG_IN_BLOCK. (default_asm_output_anchor, default_use_aenchors_for_symbol_p) (place_block_symbol, get_section_anchor, output_object_block) (output_object_block_htab, output_object_blocks): New functions. * target-def.h (TARGET_ASM_OUTPUT_ANCHOR): New macro. (TARGET_ASM_OUT): Include it. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): New macro. (TARGET_MIN_ANCHOR_OFFSET, TARGET_MAX_ANCHOR_OFFSET): New macros. (TARGET_USE_ANCHORS_FOR_SYMBOL_P): New macro. (TARGET_INITIALIZER): Include them. * rtl.c (rtl_check_failed_block_symbol): New function. * rtl.h: Include vec.h. Declare heap and gc rtx vectors. (block_symbol, object_block): New structures. (rtx_def): Add a block_symbol field to the union. (BLOCK_SYMBOL_CHECK): New macro. (rtl_check_failed_block_symbol): Declare. (SYMBOL_FLAG_IN_BLOCK, SYMBOL_FLAG_ANCHOR): New SYMBOL_REF flags. (SYMBOL_REF_IN_BLOCK_P, SYMBOL_REF_ANCHOR_P): New predicates. (SYMBOL_FLAG_MACH_DEP_SHIFT): Bump by 2. (SYMBOL_REF_BLOCK, SYMBOL_REF_BLOCK_OFFSET): New accessors. * output.h (output_section_symbols): Declare. (object_block): Name structure. (place_section_symbol, get_section_anchor, default_asm_output_anchor) (default_use_anchors_for_symbol_p): Declare. * Makefile.in (RTL_BASE_H): Add vec.h. (explow.o): Depend on output.h. * config/rs6000/rs6000.c (TARGET_MIN_ANCHOR_OFFSET): Override default. (TARGET_MAX_ANCHOR_OFFSET): Likewise. (TARGET_USE_BLOCKS_FOR_CONSTANT_P): Likewise. (rs6000_use_blocks_for_constant_p): New function. From-SVN: r111254
2006-02-18 23:06:53 +01:00
value_pool = create_alloc_pool ("value", RTX_CODE_SIZE (VALUE), 100);
cselib_record_memory = record_memory;
/* (mem:BLK (scratch)) is a special mechanism to conflict with everything,
see canon_true_dependence. This is only created once. */
if (! callmem)
callmem = gen_rtx_MEM (BLKmode, gen_rtx_SCRATCH (VOIDmode));
cselib_nregs = max_reg_num ();
/* We preserve reg_values to allow expensive clearing of the whole thing.
Reallocate it however if it happens to be too large. */
if (!reg_values || reg_values_size < cselib_nregs
|| (reg_values_size > 10 && reg_values_size > cselib_nregs * 4))
{
if (reg_values)
free (reg_values);
/* Some space for newly emit instructions so we don't end up
reallocating in between passes. */
reg_values_size = cselib_nregs + (63 + cselib_nregs) / 16;
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
reg_values = XCNEWVEC (struct elt_list *, reg_values_size);
}
tree-vrp.c: Use XNEW/XCNEW allocation wrappers. 2006-01-31 Marcin Dalecki <martin@dalecki.de> * tree-vrp.c: Use XNEW/XCNEW allocation wrappers. * regrename.c: Ditto. * tree-ssa-loop-im.c: Ditto. * tree-dump.c: Ditto. * tree-complex.c: Ditto. * genrecog.c: Ditto. * tree-ssa-threadupdate.c: Ditto. * tracer.c: Ditto. * java/class.c: Ditto. * java/jcf-parse.c: Ditto. * java/resource.c: Ditto. * java/except.c: Ditto. * java/jvspec.c: Ditto. * java/jcf-write.c: Ditto. * java/jcf-path.c: Ditto. * java/gjavah.c: Ditto. * java/zextract.c: Ditto. * java/jcf-io.c: Ditto. * java/jcf.h: Ditto. * java/buffer.c: Ditto. * java/lang.c: Ditto. * java/parse-scan.y: Ditto. * java/lex.c: Ditto. * java/lex.h: Ditto. * cfgloopmanip.c: Ditto. * postreload-gcse.c: Ditto. * tree-ssa-loop-manip.c: Ditto. * postreload.c: Ditto. * tree-ssa-loop-ch.c: Ditto. * loop.c: Ditto. * ipa-cp.c: Ditto. * cppspec.c: Ditto. * diagnostic.c: Ditto. * final.c: Ditto. * genoutput.c: Ditto. * gcc.c: Ditto. * cfghooks.c: Ditto. * cfgloopanal.c: Ditto. * objc/objc-act.c: Ditto. * gcov.c: Ditto. * genextract.c: Ditto. * genautomata.c: Ditto. * pretty-print.c: Ditto. * genemit.c: Ditto. * cgraphunit.c: Ditto. * flow.c: Ditto. * df-scan.c: Ditto. * haifa-sched.c: Ditto. * dominance.c: Ditto. * dbxout.c: Ditto. * tree-ssa-loop-ivopts.c: Ditto. * df-core.c: Ditto. * mode-switching.c: Ditto. * modulo-sched.c: Ditto. * graph.c: Ditto. * ipa-pure-const.c: Ditto. * cse.c: Ditto. * fix-header.c: Ditto. * web.c: Ditto. * tree-stdarg.c: Ditto. * ipa-utils.c: Ditto. * loop-init.c: Ditto. * ipa-inline.c: Ditto. * cfganal.c: Ditto. * global.c: Ditto. * alloc-pool.c: Ditto. * dwarf2out.c: Ditto. * opts.c: Ditto. * genattrtab.c: Ditto. * tree-ssa-loop-ivcanon.c: Ditto. * predict.c: Ditto. * timevar.c: Ditto. * lcm.c: Ditto. * fortran/gfortranspec.c: Ditto. * regmove.c: Ditto. * local-alloc.c: Ditto. * langhooks.c: Ditto. * function.c: Ditto. * tree-vectorizer.c: Ditto. * gcse.c: Ditto. * ipa-type-escape.c: Ditto. * alias.c: Ditto. * tree-if-conv.c: Ditto. * profile.c: Ditto. * ipa.c: Ditto. * tree-data-ref.c: Ditto. * loop-unroll.c: Ditto. * treelang/treetree.c: Ditto. * calls.c: Ditto. * bt-load.c: Ditto. * ggc-common.c: Ditto. * except.c: Ditto. * coverage.c: Ditto. * cselib.c: Ditto. * tree-cfgcleanup.c: Ditto. * tree-ssa-pre.c: Ditto. * cfgcleanup.c: Ditto. * loop-invariant.c: Ditto. * loop-iv.c: Ditto. * ipa-prop.c: Ditto. * print-tree.c: Ditto. * conflict.c: Ditto. * ggc-page.c: Ditto. * sched-deps.c: Ditto. * regclass.c: Ditto. * tree-object-size.c: Ditto. * combine.c: Ditto. * bb-reorder.c: Ditto. * resource.c: Ditto. * var-tracking.c: Ditto. * cfgloop.c: Ditto. * df-problems.c: Ditto. * reg-stack.c: Ditto. * tlink.c: Ditto. * gccspec.c: Ditto. * sched-rgn.c: Ditto. * tree-ssa-structalias.c: Ditto. * tree-ssa-reassoc.c: Ditto. * config/darwin-c.c: Ditto. * config/darwin.c: Ditto. * config/arm/arm.c: Ditto. * cfgrtl.c: Ditto. * collect2.c: Ditto. * reload1.c: Ditto. From-SVN: r110446
2006-01-31 20:56:55 +01:00
used_regs = XNEWVEC (unsigned int, cselib_nregs);
n_used_regs = 0;
cselib_hash_table = htab_create (31, get_value_hash,
entry_and_rtx_equal_p, NULL);
}
/* Called when the current user is done with cselib. */
void
cselib_finish (void)
{
cselib_discard_hook = NULL;
free_alloc_pool (elt_list_pool);
free_alloc_pool (elt_loc_list_pool);
free_alloc_pool (cselib_val_pool);
free_alloc_pool (value_pool);
cselib_clear_table ();
htab_delete (cselib_hash_table);
free (used_regs);
used_regs = 0;
cselib_hash_table = 0;
n_useless_values = 0;
next_unknown_value = 0;
}
#include "gt-cselib.h"