1991-11-27 15:45:36 +01:00
|
|
|
|
/* Subroutines used by or related to instruction recognition.
|
2000-02-26 15:26:24 +01:00
|
|
|
|
Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998
|
2002-01-15 14:38:03 +01:00
|
|
|
|
1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
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.
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
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 2, or (at your option) any later
|
|
|
|
|
version.
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
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.
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
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
|
|
|
|
along with GCC; see the file COPYING. If not, write to the Free
|
|
|
|
|
Software Foundation, 59 Temple Place - Suite 330, Boston, MA
|
|
|
|
|
02111-1307, USA. */
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "config.h"
|
Major cutover to using system.h:
* Makefile.in (alias.o, bitmap.o, c-aux-info.o, c-common.o,
c-decl.o, c-iterate.o, c-lang.o, c-lex.o, c-pragma.o, c-typeck.o,
caller-save.o, calls.o, collect2.o, combine.o, cse.o, dbxout.o,
dwarf2out.o, dwarfout.o, emit-rtl.o, except.o, explow.o, expmed.o,
expr.o, final.o, flow.o, function.o, getpwd.o, global.o,
integrate.o, jump.o, local-alloc.o, loop.o, optabs.o, pexecute.o,
prefix.o, print-rtl.o, print-tree.o, profile.o, real.o, recog.o,
reg-stack.o, regclass.o, regmove.o, reload.o, reload1.o, reorg.o,
rtl.o, rtlanal.o, sdbout.o, stmt.o, stor-layout.o, stupid.o,
tlink.o, toplev.o, tree.o, unroll.o, varasm.o, xcoffout.o): Depend
on system.h.
* alias.c, bitmap.c, c-aux-info.c, c-common.c, c-decl.c,
c-iterate.c, c-lang.c, c-lex.c, c-pragma.c, c-typeck.c,
caller-save.c, calls.c, collect2.c, combine.c, cse.c, dbxout.c,
dwarf2out.c, dwarfout.c, emit-rtl.c, except.c, explow.c, expmed.c,
expr.c, final.c, flow.c, function.c, gcc.c, getpwd.c, global.c,
integrate.c, jump.c, local-alloc.c, loop.c, optabs.c, pexecute.c,
prefix.c, print-rtl.c, print-tree.c, profile.c, real.c, recog.c,
reg-stack.c, regclass.c, regmove.c, reload.c, reload1.c, reorg.c,
rtl.c, rtlanal.c, sched.c, sdbout.c, stmt.c, stor-layout.c,
stupid.c, tlink.c, toplev.c, tree.c, unroll.c, varasm.c,
xcoffout.c: Include system.h. Organize include ordering so
that stdarg/varargs comes before other system headers. Remove
spurious casts of functions assured of a prototype in system.h.
From-SVN: r18726
1998-03-20 15:58:42 +01:00
|
|
|
|
#include "system.h"
|
alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO...
* alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO;
change gen_rtx(expr...) to gen_rtx_fmt_foo(expr...).
* caller-save.c, calls.c, combine.c, cse.c: Likewise.
* dwarf2out.c, except.c, explow.c, expmed.c, expr.c: Likewise.
* final.c, flow.c, function.c, genpeep.c, haifa-sched.c: Likewise.
* halfpic.c, integrate.c, jump.c, local-alloc.c, loop.c: Likewise.
* profile.c, recog.c, reg-stack.c, regclass.c, regmove.c: Likewise.
* reload.c, reload1.c, reorg.c, sched.c, stmt.c, stupid.c: Likewise.
* unroll.c, varasm.c: Likewise.
* config/alpha/alpha.c, config/alpha/alpha.md: Likewise.
From-SVN: r17357
1998-01-15 00:10:50 +01:00
|
|
|
|
#include "rtl.h"
|
1999-09-20 12:00:03 +02:00
|
|
|
|
#include "tm_p.h"
|
1991-11-27 15:45:36 +01:00
|
|
|
|
#include "insn-config.h"
|
|
|
|
|
#include "insn-attr.h"
|
2000-05-28 04:17:59 +02:00
|
|
|
|
#include "hard-reg-set.h"
|
1991-11-27 15:45:36 +01:00
|
|
|
|
#include "recog.h"
|
|
|
|
|
#include "regs.h"
|
[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
|
|
|
|
#include "expr.h"
|
1999-08-09 16:00:21 +02:00
|
|
|
|
#include "function.h"
|
1991-11-27 15:45:36 +01:00
|
|
|
|
#include "flags.h"
|
|
|
|
|
#include "real.h"
|
1998-10-25 13:56:39 +01:00
|
|
|
|
#include "toplev.h"
|
1999-02-02 22:22:52 +01:00
|
|
|
|
#include "basic-block.h"
|
1999-08-31 22:37:09 +02:00
|
|
|
|
#include "output.h"
|
2000-11-03 23:24:21 +01:00
|
|
|
|
#include "reload.h"
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
#ifndef STACK_PUSH_CODE
|
|
|
|
|
#ifdef STACK_GROWS_DOWNWARD
|
|
|
|
|
#define STACK_PUSH_CODE PRE_DEC
|
|
|
|
|
#else
|
|
|
|
|
#define STACK_PUSH_CODE PRE_INC
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
1999-01-19 22:55:35 +01:00
|
|
|
|
#ifndef STACK_POP_CODE
|
|
|
|
|
#ifdef STACK_GROWS_DOWNWARD
|
|
|
|
|
#define STACK_POP_CODE POST_INC
|
|
|
|
|
#else
|
|
|
|
|
#define STACK_POP_CODE POST_DEC
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
2000-01-17 16:37:04 +01:00
|
|
|
|
static void validate_replace_rtx_1 PARAMS ((rtx *, rtx, rtx, rtx));
|
|
|
|
|
static rtx *find_single_use_1 PARAMS ((rtx, rtx *));
|
2001-02-17 20:50:58 +01:00
|
|
|
|
static void validate_replace_src_1 PARAMS ((rtx *, void *));
|
2001-06-08 14:19:12 +02:00
|
|
|
|
static rtx split_insn PARAMS ((rtx));
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
/* Nonzero means allow operands to be volatile.
|
|
|
|
|
This should be 0 if you are generating rtl, such as if you are calling
|
|
|
|
|
the functions in optabs.c and expmed.c (most of the time).
|
|
|
|
|
This should be 1 if all valid insns need to be recognized,
|
|
|
|
|
such as in regclass.c and final.c and reload.c.
|
|
|
|
|
|
|
|
|
|
init_recog and init_recog_no_volatile are responsible for setting this. */
|
|
|
|
|
|
|
|
|
|
int volatile_ok;
|
|
|
|
|
|
1999-09-12 03:51:28 +02:00
|
|
|
|
struct recog_data recog_data;
|
Makefile.in (insn-extract.o): Fix dependencies.
* Makefile.in (insn-extract.o): Fix dependencies.
* genextract.c (main): Generate includes for insn-config.h and
recog.h.
Delete generation of declarations which are now in recog.h.
* genrecog.c (main): Delete generation of definitions which are
now in recog.c.
* local-alloc.c (block_alloc): Use extract_insn and the variables
it sets up instead of looking up values by insn_code.
* recog.c (recog_operand, recog_operand_loc, recog_dup_loc,
recog_dup_num): Define here instead of generating the definition in
genrecog.c.
(recog_n_operands, recog_n_dups, recog_n_alternatives,
recog_operand_mode, recog_constraints, recog_operand_address_p):
New variables.
(extract_insn): New function.
* recog.h (extract_insn): Declare function.
(which_alternative, recog_n_operands, recog_n_dups,
recog_n_alternatives, recog_operand_mode, recog_constraints,
recog_operand_address_p): Declare variables.
* regclass.c (n_occurrences): New static function.
* reload.c (n_occurrences): Delete function.
(find_reloads): Use extract_insn.
* reload.h (n_occurrences): Delete declaration.
From-SVN: r23147
1998-10-17 03:28:57 +02:00
|
|
|
|
|
1998-12-04 13:55:59 +01:00
|
|
|
|
/* Contains a vector of operand_alternative structures for every operand.
|
|
|
|
|
Set up by preprocess_constraints. */
|
|
|
|
|
struct operand_alternative recog_op_alt[MAX_RECOG_OPERANDS][MAX_RECOG_ALTERNATIVES];
|
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
/* On return from `constrain_operands', indicate which alternative
|
|
|
|
|
was satisfied. */
|
|
|
|
|
|
|
|
|
|
int which_alternative;
|
|
|
|
|
|
|
|
|
|
/* Nonzero after end of reload pass.
|
|
|
|
|
Set to 1 or 0 by toplev.c.
|
|
|
|
|
Controls the significance of (SUBREG (MEM)). */
|
|
|
|
|
|
|
|
|
|
int reload_completed;
|
|
|
|
|
|
|
|
|
|
/* Initialize data used by the function `recog'.
|
|
|
|
|
This must be called once in the compilation of a function
|
|
|
|
|
before any insn recognition may be done in the function. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
init_recog_no_volatile ()
|
|
|
|
|
{
|
|
|
|
|
volatile_ok = 0;
|
|
|
|
|
}
|
|
|
|
|
|
1991-12-24 03:03:33 +01:00
|
|
|
|
void
|
1991-11-27 15:45:36 +01:00
|
|
|
|
init_recog ()
|
|
|
|
|
{
|
|
|
|
|
volatile_ok = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Try recognizing the instruction INSN,
|
|
|
|
|
and return the code number that results.
|
1995-05-16 14:39:54 +02:00
|
|
|
|
Remember the code so that repeated calls do not
|
1991-11-27 15:45:36 +01:00
|
|
|
|
need to spend the time for actual rerecognition.
|
|
|
|
|
|
|
|
|
|
This function is the normal interface to instruction recognition.
|
|
|
|
|
The automatically-generated function `recog' is normally called
|
|
|
|
|
through this one. (The only exception is in combine.c.) */
|
|
|
|
|
|
|
|
|
|
int
|
2000-09-29 13:24:13 +02:00
|
|
|
|
recog_memoized_1 (insn)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
if (INSN_CODE (insn) < 0)
|
2001-05-01 14:11:35 +02:00
|
|
|
|
INSN_CODE (insn) = recog (PATTERN (insn), insn, 0);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
return INSN_CODE (insn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Check that X is an insn-body for an `asm' with operands
|
|
|
|
|
and that the operands mentioned in it are legitimate. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
check_asm_operands (x)
|
|
|
|
|
rtx x;
|
|
|
|
|
{
|
1999-01-15 19:43:47 +01:00
|
|
|
|
int noperands;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
rtx *operands;
|
final.c (bb_str): Qualify a char* with the keyword `const'.
* final.c (bb_str): Qualify a char* with the keyword `const'.
(add_bb_string, final_scan_insn, output_asm_insn): Likewise.
* fix-header.c (read_scan_file): Likewise.
* genoutput.c (output_epilogue, process_template): Likewise.
* local-alloc.c (requires_inout, block_alloc): Likewise.
* output.h (output_asm_insn, assemble_string): Likewise.
* recog.c (recog_constraints, check_asm_operands,
decode_asm_operands, extract_insn, preprocess_constraints,
constrain_operands): Likewise.
* recog.h (operand_alternative, recog_constraints, insn_template,
insn_outfun, insn_operand_constraint, insn_name): Likewise.
* regclass.c (record_reg_classes, scan_one_insn): Likewise.
* regmove.c (find_matches): Likewise.
* reload.c (alternative_allows_memconst): Likewise.
* reload1.c (constraint_accepts_reg_p,
reload_cse_simplify_operands): Likewise.
* rtl.h (decode_asm_operands): Likewise.
* scan.h (fn_decl): Likewise.
* varasm.c (assemble_string): Likewise.
From-SVN: r24834
1999-01-23 20:45:50 +01:00
|
|
|
|
const char **constraints;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
int i;
|
|
|
|
|
|
1999-01-15 19:43:47 +01:00
|
|
|
|
/* Post-reload, be more strict with things. */
|
|
|
|
|
if (reload_completed)
|
|
|
|
|
{
|
|
|
|
|
/* ??? Doh! We've not got the wrapping insn. Cook one up. */
|
|
|
|
|
extract_insn (make_insn_raw (x));
|
|
|
|
|
constrain_operands (1);
|
|
|
|
|
return which_alternative >= 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
noperands = asm_noperands (x);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
if (noperands < 0)
|
|
|
|
|
return 0;
|
|
|
|
|
if (noperands == 0)
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
operands = (rtx *) alloca (noperands * sizeof (rtx));
|
final.c (bb_str): Qualify a char* with the keyword `const'.
* final.c (bb_str): Qualify a char* with the keyword `const'.
(add_bb_string, final_scan_insn, output_asm_insn): Likewise.
* fix-header.c (read_scan_file): Likewise.
* genoutput.c (output_epilogue, process_template): Likewise.
* local-alloc.c (requires_inout, block_alloc): Likewise.
* output.h (output_asm_insn, assemble_string): Likewise.
* recog.c (recog_constraints, check_asm_operands,
decode_asm_operands, extract_insn, preprocess_constraints,
constrain_operands): Likewise.
* recog.h (operand_alternative, recog_constraints, insn_template,
insn_outfun, insn_operand_constraint, insn_name): Likewise.
* regclass.c (record_reg_classes, scan_one_insn): Likewise.
* regmove.c (find_matches): Likewise.
* reload.c (alternative_allows_memconst): Likewise.
* reload1.c (constraint_accepts_reg_p,
reload_cse_simplify_operands): Likewise.
* rtl.h (decode_asm_operands): Likewise.
* scan.h (fn_decl): Likewise.
* varasm.c (assemble_string): Likewise.
From-SVN: r24834
1999-01-23 20:45:50 +01:00
|
|
|
|
constraints = (const char **) alloca (noperands * sizeof (char *));
|
1999-01-15 19:43:47 +01:00
|
|
|
|
|
2001-05-04 17:06:41 +02:00
|
|
|
|
decode_asm_operands (x, operands, NULL, constraints, NULL);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < noperands; i++)
|
1999-01-15 19:43:47 +01:00
|
|
|
|
{
|
final.c (bb_str): Qualify a char* with the keyword `const'.
* final.c (bb_str): Qualify a char* with the keyword `const'.
(add_bb_string, final_scan_insn, output_asm_insn): Likewise.
* fix-header.c (read_scan_file): Likewise.
* genoutput.c (output_epilogue, process_template): Likewise.
* local-alloc.c (requires_inout, block_alloc): Likewise.
* output.h (output_asm_insn, assemble_string): Likewise.
* recog.c (recog_constraints, check_asm_operands,
decode_asm_operands, extract_insn, preprocess_constraints,
constrain_operands): Likewise.
* recog.h (operand_alternative, recog_constraints, insn_template,
insn_outfun, insn_operand_constraint, insn_name): Likewise.
* regclass.c (record_reg_classes, scan_one_insn): Likewise.
* regmove.c (find_matches): Likewise.
* reload.c (alternative_allows_memconst): Likewise.
* reload1.c (constraint_accepts_reg_p,
reload_cse_simplify_operands): Likewise.
* rtl.h (decode_asm_operands): Likewise.
* scan.h (fn_decl): Likewise.
* varasm.c (assemble_string): Likewise.
From-SVN: r24834
1999-01-23 20:45:50 +01:00
|
|
|
|
const char *c = constraints[i];
|
1999-02-01 21:03:23 +01:00
|
|
|
|
if (c[0] == '%')
|
|
|
|
|
c++;
|
2002-01-15 14:38:03 +01:00
|
|
|
|
if (ISDIGIT ((unsigned char) c[0]) && c[1] == '\0')
|
1999-01-15 19:43:47 +01:00
|
|
|
|
c = constraints[c[0] - '0'];
|
|
|
|
|
|
|
|
|
|
if (! asm_operand_ok (operands[i], c))
|
2002-05-09 03:42:28 +02:00
|
|
|
|
return 0;
|
1999-01-15 19:43:47 +01:00
|
|
|
|
}
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
1998-08-19 14:30:47 +02:00
|
|
|
|
/* Static data for the next two routines. */
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
1998-08-19 14:30:47 +02:00
|
|
|
|
typedef struct change_t
|
|
|
|
|
{
|
|
|
|
|
rtx object;
|
|
|
|
|
int old_code;
|
|
|
|
|
rtx *loc;
|
|
|
|
|
rtx old;
|
|
|
|
|
} change_t;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
1998-08-19 14:30:47 +02:00
|
|
|
|
static change_t *changes;
|
|
|
|
|
static int changes_allocated;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
static int num_changes = 0;
|
|
|
|
|
|
2001-07-12 03:36:16 +02:00
|
|
|
|
/* Validate a proposed change to OBJECT. LOC is the location in the rtl
|
1991-11-27 15:45:36 +01:00
|
|
|
|
at which NEW will be placed. If OBJECT is zero, no validation is done,
|
|
|
|
|
the change is simply made.
|
|
|
|
|
|
|
|
|
|
Two types of objects are supported: If OBJECT is a MEM, memory_address_p
|
|
|
|
|
will be called with the address and mode as parameters. If OBJECT is
|
|
|
|
|
an INSN, CALL_INSN, or JUMP_INSN, the insn will be re-recognized with
|
|
|
|
|
the change in place.
|
|
|
|
|
|
|
|
|
|
IN_GROUP is non-zero if this is part of a group of changes that must be
|
|
|
|
|
performed as a group. In that case, the changes will be stored. The
|
|
|
|
|
function `apply_change_group' will validate and apply the changes.
|
|
|
|
|
|
|
|
|
|
If IN_GROUP is zero, this is a single change. Try to recognize the insn
|
|
|
|
|
or validate the memory reference with the change applied. If the result
|
|
|
|
|
is not valid for the machine, suppress the change and return zero.
|
|
|
|
|
Otherwise, perform the change and return 1. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
validate_change (object, loc, new, in_group)
|
|
|
|
|
rtx object;
|
|
|
|
|
rtx *loc;
|
|
|
|
|
rtx new;
|
|
|
|
|
int in_group;
|
|
|
|
|
{
|
|
|
|
|
rtx old = *loc;
|
|
|
|
|
|
|
|
|
|
if (old == new || rtx_equal_p (old, new))
|
|
|
|
|
return 1;
|
|
|
|
|
|
1998-08-19 14:30:47 +02:00
|
|
|
|
if (in_group == 0 && num_changes != 0)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
abort ();
|
|
|
|
|
|
2001-10-16 06:19:26 +02:00
|
|
|
|
*loc = new;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
/* Save the information describing this change. */
|
1998-08-19 14:30:47 +02:00
|
|
|
|
if (num_changes >= changes_allocated)
|
|
|
|
|
{
|
|
|
|
|
if (changes_allocated == 0)
|
|
|
|
|
/* This value allows for repeated substitutions inside complex
|
|
|
|
|
indexed addresses, or changes in up to 5 insns. */
|
|
|
|
|
changes_allocated = MAX_RECOG_OPERANDS * 5;
|
|
|
|
|
else
|
|
|
|
|
changes_allocated *= 2;
|
|
|
|
|
|
2002-05-09 03:42:28 +02:00
|
|
|
|
changes =
|
|
|
|
|
(change_t*) xrealloc (changes,
|
|
|
|
|
sizeof (change_t) * changes_allocated);
|
1998-08-19 14:30:47 +02:00
|
|
|
|
}
|
2002-05-09 03:42:28 +02:00
|
|
|
|
|
1998-08-19 14:30:47 +02:00
|
|
|
|
changes[num_changes].object = object;
|
|
|
|
|
changes[num_changes].loc = loc;
|
|
|
|
|
changes[num_changes].old = old;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
if (object && GET_CODE (object) != MEM)
|
|
|
|
|
{
|
|
|
|
|
/* Set INSN_CODE to force rerecognition of insn. Save old code in
|
|
|
|
|
case invalid. */
|
1998-08-19 14:30:47 +02:00
|
|
|
|
changes[num_changes].old_code = INSN_CODE (object);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
INSN_CODE (object) = -1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
num_changes++;
|
|
|
|
|
|
|
|
|
|
/* If we are making a group of changes, return 1. Otherwise, validate the
|
|
|
|
|
change group we made. */
|
|
|
|
|
|
|
|
|
|
if (in_group)
|
|
|
|
|
return 1;
|
|
|
|
|
else
|
|
|
|
|
return apply_change_group ();
|
|
|
|
|
}
|
|
|
|
|
|
1998-10-23 01:08:26 +02:00
|
|
|
|
/* This subroutine of apply_change_group verifies whether the changes to INSN
|
|
|
|
|
were valid; i.e. whether INSN can still be recognized. */
|
|
|
|
|
|
2001-02-19 00:56:34 +01:00
|
|
|
|
int
|
1998-10-23 01:08:26 +02:00
|
|
|
|
insn_invalid_p (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
2001-02-19 00:56:34 +01:00
|
|
|
|
rtx pat = PATTERN (insn);
|
|
|
|
|
int num_clobbers = 0;
|
|
|
|
|
/* If we are before reload and the pattern is a SET, see if we can add
|
|
|
|
|
clobbers. */
|
|
|
|
|
int icode = recog (pat, insn,
|
|
|
|
|
(GET_CODE (pat) == SET
|
|
|
|
|
&& ! reload_completed && ! reload_in_progress)
|
2001-05-01 14:11:35 +02:00
|
|
|
|
? &num_clobbers : 0);
|
1998-10-23 01:08:26 +02:00
|
|
|
|
int is_asm = icode < 0 && asm_noperands (PATTERN (insn)) >= 0;
|
|
|
|
|
|
2002-05-09 03:42:28 +02:00
|
|
|
|
|
2001-02-19 00:56:34 +01:00
|
|
|
|
/* If this is an asm and the operand aren't legal, then fail. Likewise if
|
|
|
|
|
this is not an asm and the insn wasn't recognized. */
|
|
|
|
|
if ((is_asm && ! check_asm_operands (PATTERN (insn)))
|
|
|
|
|
|| (!is_asm && icode < 0))
|
1998-10-23 01:08:26 +02:00
|
|
|
|
return 1;
|
|
|
|
|
|
2001-02-19 00:56:34 +01:00
|
|
|
|
/* If we have to add CLOBBERs, fail if we have to add ones that reference
|
|
|
|
|
hard registers since our callers can't know if they are live or not.
|
|
|
|
|
Otherwise, add them. */
|
|
|
|
|
if (num_clobbers > 0)
|
|
|
|
|
{
|
|
|
|
|
rtx newpat;
|
|
|
|
|
|
|
|
|
|
if (added_clobbers_hard_reg_p (icode))
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
newpat = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (num_clobbers + 1));
|
|
|
|
|
XVECEXP (newpat, 0, 0) = pat;
|
|
|
|
|
add_clobbers (newpat, icode);
|
|
|
|
|
PATTERN (insn) = pat = newpat;
|
|
|
|
|
}
|
|
|
|
|
|
1998-10-23 01:08:26 +02:00
|
|
|
|
/* After reload, verify that all constraints are satisfied. */
|
|
|
|
|
if (reload_completed)
|
|
|
|
|
{
|
1998-11-04 22:25:00 +01:00
|
|
|
|
extract_insn (insn);
|
1998-10-23 01:08:26 +02:00
|
|
|
|
|
1998-11-04 22:25:00 +01:00
|
|
|
|
if (! constrain_operands (1))
|
1998-10-23 01:08:26 +02:00
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2001-02-19 00:56:34 +01:00
|
|
|
|
INSN_CODE (insn) = icode;
|
1998-10-23 01:08:26 +02:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
/* Apply a group of changes previously issued with `validate_change'.
|
|
|
|
|
Return 1 if all changes are valid, zero otherwise. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
apply_change_group ()
|
|
|
|
|
{
|
|
|
|
|
int i;
|
2001-05-15 13:55:42 +02:00
|
|
|
|
rtx last_validated = NULL_RTX;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
/* The changes have been applied and all INSN_CODEs have been reset to force
|
|
|
|
|
rerecognition.
|
|
|
|
|
|
|
|
|
|
The changes are valid if we aren't given an object, or if we are
|
|
|
|
|
given a MEM and it still is a valid address, or if this is in insn
|
|
|
|
|
and it is recognized. In the latter case, if reload has completed,
|
|
|
|
|
we also require that the operands meet the constraints for
|
1998-11-04 22:25:00 +01:00
|
|
|
|
the insn. */
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < num_changes; i++)
|
|
|
|
|
{
|
1998-08-19 14:30:47 +02:00
|
|
|
|
rtx object = changes[i].object;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
2001-05-15 13:55:42 +02:00
|
|
|
|
/* if there is no object to test or if it is the same as the one we
|
|
|
|
|
already tested, ignore it. */
|
|
|
|
|
if (object == 0 || object == last_validated)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (object) == MEM)
|
|
|
|
|
{
|
|
|
|
|
if (! memory_address_p (GET_MODE (object), XEXP (object, 0)))
|
|
|
|
|
break;
|
|
|
|
|
}
|
1998-10-23 01:08:26 +02:00
|
|
|
|
else if (insn_invalid_p (object))
|
1991-11-27 15:45:36 +01:00
|
|
|
|
{
|
|
|
|
|
rtx pat = PATTERN (object);
|
|
|
|
|
|
|
|
|
|
/* Perhaps we couldn't recognize the insn because there were
|
|
|
|
|
extra CLOBBERs at the end. If so, try to re-recognize
|
|
|
|
|
without the last CLOBBER (later iterations will cause each of
|
|
|
|
|
them to be eliminated, in turn). But don't do this if we
|
|
|
|
|
have an ASM_OPERAND. */
|
|
|
|
|
if (GET_CODE (pat) == PARALLEL
|
|
|
|
|
&& GET_CODE (XVECEXP (pat, 0, XVECLEN (pat, 0) - 1)) == CLOBBER
|
|
|
|
|
&& asm_noperands (PATTERN (object)) < 0)
|
|
|
|
|
{
|
2001-10-16 06:19:26 +02:00
|
|
|
|
rtx newpat;
|
|
|
|
|
|
|
|
|
|
if (XVECLEN (pat, 0) == 2)
|
|
|
|
|
newpat = XVECEXP (pat, 0, 0);
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int j;
|
|
|
|
|
|
|
|
|
|
newpat
|
2002-05-09 03:42:28 +02:00
|
|
|
|
= gen_rtx_PARALLEL (VOIDmode,
|
2001-10-16 06:19:26 +02:00
|
|
|
|
rtvec_alloc (XVECLEN (pat, 0) - 1));
|
|
|
|
|
for (j = 0; j < XVECLEN (newpat, 0); j++)
|
|
|
|
|
XVECEXP (newpat, 0, j) = XVECEXP (pat, 0, j);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Add a new change to this group to replace the pattern
|
|
|
|
|
with this new pattern. Then consider this change
|
|
|
|
|
as having succeeded. The change we added will
|
|
|
|
|
cause the entire call to fail if things remain invalid.
|
|
|
|
|
|
|
|
|
|
Note that this can lose if a later change than the one
|
|
|
|
|
we are processing specified &XVECEXP (PATTERN (object), 0, X)
|
|
|
|
|
but this shouldn't occur. */
|
|
|
|
|
|
|
|
|
|
validate_change (object, &PATTERN (object), newpat, 1);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
1991-11-27 15:45:36 +01:00
|
|
|
|
else if (GET_CODE (pat) == USE || GET_CODE (pat) == CLOBBER)
|
|
|
|
|
/* If this insn is a CLOBBER or USE, it is always valid, but is
|
|
|
|
|
never recognized. */
|
|
|
|
|
continue;
|
|
|
|
|
else
|
|
|
|
|
break;
|
|
|
|
|
}
|
2001-05-15 13:55:42 +02:00
|
|
|
|
last_validated = object;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (i == num_changes)
|
|
|
|
|
{
|
basic-block.h (BB_REACHABLE): Renumber.
* basic-block.h (BB_REACHABLE): Renumber.
(BB_DIRTY, BB_NEW): New flags.
(clear_bb_flags): Declare.
(update_life_info_in_dirty_blocks): Declare.
* cfg.c (clear_bb_flags): New function.
* cfgrtl.c (create_basic_block_structure): Set flags to BB_NEW.
* emit-rtl.c (add_insn_after, add_insn_before, remove_insn,
reorder_insns, emit_insn_after): Mark block as dirty.
* flow.c (update_life_info): Fix clearing of PROP_LOG_LINKS.
(update_life_info_in_dirty_blocks): New function.
* recog.c (apply_change_group): Dirtify block.
* cse.c (cse_insn): Reorder emitting of jump insn to keep
cfg consistent.
* gcse.c (delete_null_pointer_checks): Likewise.
* toplev.c (dump_file_index): Move cse2 after bp,
add DFI_null
(dump_file_info): Similary.
(rest_of_compilation): Avoid most of CFG rebuilds;
do first if converision after null pointer checks, do cse2
after branch prediction; avoid full liveness rebuild after
initializing subregs.
* invoke.texi (-d options): Document -du, renumber.
* cfgcleanup.c (bb_flags): Remove BB_UPDATE_LIFE.
(notice_new_block): Do not set BB_UPDATE_LIFE.
(try_forward_edges, merge_blocks_move_predecessor_nojumps,
merge_blocks_move_successor_nojumps, merge_blocks,
try_crossjump_to_edge): Likewise.
(try_optimize_cfg): Likewise; use update_life_info_in_dirty_blocks.
* cfgrtl.c (merge_blocks_nomove): Copy b's flags to a.
* ifcvt.c (SET_UPDATE_LIFE, UPDATE_LIFE): Kill.
(merge_of_block): Do not use life_data_ok.
(find_if_case_1): Do not use SET_UPDATE_LIFE.
(if_convert): Use BB_DIRTY mechanizm to update life.
* lcm.c (optimize_mode_switching): Update
update_life_info_in_dirty_blocks
From-SVN: r50127
2002-02-28 11:11:01 +01:00
|
|
|
|
basic_block bb;
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < num_changes; i++)
|
|
|
|
|
if (changes[i].object
|
|
|
|
|
&& INSN_P (changes[i].object)
|
|
|
|
|
&& (bb = BLOCK_FOR_INSN (changes[i].object)))
|
2002-05-09 03:42:28 +02:00
|
|
|
|
bb->flags |= BB_DIRTY;
|
basic-block.h (BB_REACHABLE): Renumber.
* basic-block.h (BB_REACHABLE): Renumber.
(BB_DIRTY, BB_NEW): New flags.
(clear_bb_flags): Declare.
(update_life_info_in_dirty_blocks): Declare.
* cfg.c (clear_bb_flags): New function.
* cfgrtl.c (create_basic_block_structure): Set flags to BB_NEW.
* emit-rtl.c (add_insn_after, add_insn_before, remove_insn,
reorder_insns, emit_insn_after): Mark block as dirty.
* flow.c (update_life_info): Fix clearing of PROP_LOG_LINKS.
(update_life_info_in_dirty_blocks): New function.
* recog.c (apply_change_group): Dirtify block.
* cse.c (cse_insn): Reorder emitting of jump insn to keep
cfg consistent.
* gcse.c (delete_null_pointer_checks): Likewise.
* toplev.c (dump_file_index): Move cse2 after bp,
add DFI_null
(dump_file_info): Similary.
(rest_of_compilation): Avoid most of CFG rebuilds;
do first if converision after null pointer checks, do cse2
after branch prediction; avoid full liveness rebuild after
initializing subregs.
* invoke.texi (-d options): Document -du, renumber.
* cfgcleanup.c (bb_flags): Remove BB_UPDATE_LIFE.
(notice_new_block): Do not set BB_UPDATE_LIFE.
(try_forward_edges, merge_blocks_move_predecessor_nojumps,
merge_blocks_move_successor_nojumps, merge_blocks,
try_crossjump_to_edge): Likewise.
(try_optimize_cfg): Likewise; use update_life_info_in_dirty_blocks.
* cfgrtl.c (merge_blocks_nomove): Copy b's flags to a.
* ifcvt.c (SET_UPDATE_LIFE, UPDATE_LIFE): Kill.
(merge_of_block): Do not use life_data_ok.
(find_if_case_1): Do not use SET_UPDATE_LIFE.
(if_convert): Use BB_DIRTY mechanizm to update life.
* lcm.c (optimize_mode_switching): Update
update_life_info_in_dirty_blocks
From-SVN: r50127
2002-02-28 11:11:01 +01:00
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
num_changes = 0;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
cancel_changes (0);
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2001-10-10 13:33:39 +02:00
|
|
|
|
/* Return the number of changes so far in the current group. */
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
num_validated_changes ()
|
|
|
|
|
{
|
|
|
|
|
return num_changes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Retract the changes numbered NUM and up. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
cancel_changes (num)
|
|
|
|
|
int num;
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
/* Back out all the changes. Do this in the opposite order in which
|
|
|
|
|
they were made. */
|
|
|
|
|
for (i = num_changes - 1; i >= num; i--)
|
|
|
|
|
{
|
1998-08-19 14:30:47 +02:00
|
|
|
|
*changes[i].loc = changes[i].old;
|
|
|
|
|
if (changes[i].object && GET_CODE (changes[i].object) != MEM)
|
|
|
|
|
INSN_CODE (changes[i].object) = changes[i].old_code;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
}
|
|
|
|
|
num_changes = num;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Replace every occurrence of FROM in X with TO. Mark each change with
|
|
|
|
|
validate_change passing OBJECT. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
validate_replace_rtx_1 (loc, from, to, object)
|
|
|
|
|
rtx *loc;
|
|
|
|
|
rtx from, to, object;
|
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
int i, j;
|
|
|
|
|
const char *fmt;
|
|
|
|
|
rtx x = *loc;
|
2000-07-31 10:37:30 +02:00
|
|
|
|
enum rtx_code code;
|
2001-05-19 10:24:50 +02:00
|
|
|
|
enum machine_mode op0_mode = VOIDmode;
|
|
|
|
|
int prev_changes = num_changes;
|
|
|
|
|
rtx new;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
2000-07-31 10:37:30 +02:00
|
|
|
|
if (!x)
|
|
|
|
|
return;
|
2001-05-19 10:24:50 +02:00
|
|
|
|
|
2000-07-31 10:37:30 +02:00
|
|
|
|
code = GET_CODE (x);
|
2001-05-19 10:24:50 +02:00
|
|
|
|
fmt = GET_RTX_FORMAT (code);
|
|
|
|
|
if (fmt[0] == 'e')
|
|
|
|
|
op0_mode = GET_MODE (XEXP (x, 0));
|
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
/* X matches FROM if it is the same rtx or they are both referring to the
|
|
|
|
|
same register in the same mode. Avoid calling rtx_equal_p unless the
|
|
|
|
|
operands look similar. */
|
|
|
|
|
|
|
|
|
|
if (x == from
|
|
|
|
|
|| (GET_CODE (x) == REG && GET_CODE (from) == REG
|
|
|
|
|
&& GET_MODE (x) == GET_MODE (from)
|
|
|
|
|
&& REGNO (x) == REGNO (from))
|
|
|
|
|
|| (GET_CODE (x) == GET_CODE (from) && GET_MODE (x) == GET_MODE (from)
|
|
|
|
|
&& rtx_equal_p (x, from)))
|
|
|
|
|
{
|
|
|
|
|
validate_change (object, loc, to, 1);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2001-10-16 06:19:26 +02:00
|
|
|
|
/* Call ourself recursively to perform the replacements. */
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
2001-05-19 10:24:50 +02:00
|
|
|
|
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
|
|
|
|
|
{
|
|
|
|
|
if (fmt[i] == 'e')
|
|
|
|
|
validate_replace_rtx_1 (&XEXP (x, i), from, to, object);
|
|
|
|
|
else if (fmt[i] == 'E')
|
|
|
|
|
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
|
|
|
|
|
validate_replace_rtx_1 (&XVECEXP (x, i, j), from, to, object);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
}
|
|
|
|
|
|
2001-10-16 06:19:26 +02:00
|
|
|
|
/* If we didn't substitute, there is nothing more to do. */
|
2001-05-19 10:24:50 +02:00
|
|
|
|
if (num_changes == prev_changes)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* Allow substituted expression to have different mode. This is used by
|
|
|
|
|
regmove to change mode of pseudo register. */
|
|
|
|
|
if (fmt[0] == 'e' && GET_MODE (XEXP (x, 0)) != VOIDmode)
|
|
|
|
|
op0_mode = GET_MODE (XEXP (x, 0));
|
|
|
|
|
|
|
|
|
|
/* Do changes needed to keep rtx consistent. Don't do any other
|
|
|
|
|
simplifications, as it is not our job. */
|
|
|
|
|
|
|
|
|
|
if ((GET_RTX_CLASS (code) == '<' || GET_RTX_CLASS (code) == 'c')
|
|
|
|
|
&& swap_commutative_operands_p (XEXP (x, 0), XEXP (x, 1)))
|
|
|
|
|
{
|
|
|
|
|
validate_change (object, loc,
|
|
|
|
|
gen_rtx_fmt_ee (GET_RTX_CLASS (code) == 'c' ? code
|
|
|
|
|
: swap_condition (code),
|
|
|
|
|
GET_MODE (x), XEXP (x, 1),
|
|
|
|
|
XEXP (x, 0)), 1);
|
|
|
|
|
x = *loc;
|
|
|
|
|
code = GET_CODE (x);
|
|
|
|
|
}
|
1997-04-13 15:48:25 +02:00
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case PLUS:
|
1998-05-06 23:09:07 +02:00
|
|
|
|
/* If we have a PLUS whose second operand is now a CONST_INT, use
|
2001-05-19 10:24:50 +02:00
|
|
|
|
plus_constant to try to simplify it.
|
|
|
|
|
??? We may want later to remove this, once simplification is
|
|
|
|
|
separated from this function. */
|
2001-06-12 17:26:49 +02:00
|
|
|
|
if (GET_CODE (XEXP (x, 1)) == CONST_INT)
|
2001-05-19 10:24:50 +02:00
|
|
|
|
validate_change (object, loc,
|
2001-12-13 02:21:52 +01:00
|
|
|
|
simplify_gen_binary
|
|
|
|
|
(PLUS, GET_MODE (x), XEXP (x, 0), XEXP (x, 1)), 1);
|
2001-05-19 10:24:50 +02:00
|
|
|
|
break;
|
1997-04-13 15:48:25 +02:00
|
|
|
|
case MINUS:
|
2001-05-19 10:24:50 +02:00
|
|
|
|
if (GET_CODE (XEXP (x, 1)) == CONST_INT
|
|
|
|
|
|| GET_CODE (XEXP (x, 1)) == CONST_DOUBLE)
|
|
|
|
|
validate_change (object, loc,
|
|
|
|
|
simplify_gen_binary
|
|
|
|
|
(PLUS, GET_MODE (x), XEXP (x, 0),
|
|
|
|
|
simplify_gen_unary (NEG,
|
2001-07-29 19:01:53 +02:00
|
|
|
|
GET_MODE (x), XEXP (x, 1),
|
|
|
|
|
GET_MODE (x))), 1);
|
1997-04-13 15:48:25 +02:00
|
|
|
|
break;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
case ZERO_EXTEND:
|
|
|
|
|
case SIGN_EXTEND:
|
2001-05-19 10:24:50 +02:00
|
|
|
|
if (GET_MODE (XEXP (x, 0)) == VOIDmode)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
{
|
2001-05-19 10:24:50 +02:00
|
|
|
|
new = simplify_gen_unary (code, GET_MODE (x), XEXP (x, 0),
|
|
|
|
|
op0_mode);
|
2000-11-10 01:07:52 +01:00
|
|
|
|
/* If any of the above failed, substitute in something that
|
|
|
|
|
we know won't be recognized. */
|
|
|
|
|
if (!new)
|
alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO...
* alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO;
change gen_rtx(expr...) to gen_rtx_fmt_foo(expr...).
* caller-save.c, calls.c, combine.c, cse.c: Likewise.
* dwarf2out.c, except.c, explow.c, expmed.c, expr.c: Likewise.
* final.c, flow.c, function.c, genpeep.c, haifa-sched.c: Likewise.
* halfpic.c, integrate.c, jump.c, local-alloc.c, loop.c: Likewise.
* profile.c, recog.c, reg-stack.c, regclass.c, regmove.c: Likewise.
* reload.c, reload1.c, reorg.c, sched.c, stmt.c, stupid.c: Likewise.
* unroll.c, varasm.c: Likewise.
* config/alpha/alpha.c, config/alpha/alpha.md: Likewise.
From-SVN: r17357
1998-01-15 00:10:50 +01:00
|
|
|
|
new = gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
validate_change (object, loc, new, 1);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case SUBREG:
|
2001-05-19 10:24:50 +02:00
|
|
|
|
/* All subregs possible to simplify should be simplified. */
|
|
|
|
|
new = simplify_subreg (GET_MODE (x), SUBREG_REG (x), op0_mode,
|
|
|
|
|
SUBREG_BYTE (x));
|
|
|
|
|
|
2001-10-16 06:19:26 +02:00
|
|
|
|
/* Subregs of VOIDmode operands are incorrect. */
|
2001-05-19 10:24:50 +02:00
|
|
|
|
if (!new && GET_MODE (SUBREG_REG (x)) == VOIDmode)
|
|
|
|
|
new = gen_rtx_CLOBBER (GET_MODE (x), const0_rtx);
|
|
|
|
|
if (new)
|
|
|
|
|
validate_change (object, loc, new, 1);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
break;
|
|
|
|
|
case ZERO_EXTRACT:
|
|
|
|
|
case SIGN_EXTRACT:
|
|
|
|
|
/* If we are replacing a register with memory, try to change the memory
|
2001-05-19 10:24:50 +02:00
|
|
|
|
to be the mode required for memory in extract operations (this isn't
|
|
|
|
|
likely to be an insertion operation; if it was, nothing bad will
|
|
|
|
|
happen, we might just fail in some cases). */
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
2001-05-19 10:24:50 +02:00
|
|
|
|
if (GET_CODE (XEXP (x, 0)) == MEM
|
1991-11-27 15:45:36 +01:00
|
|
|
|
&& GET_CODE (XEXP (x, 1)) == CONST_INT
|
|
|
|
|
&& GET_CODE (XEXP (x, 2)) == CONST_INT
|
2001-05-19 10:24:50 +02:00
|
|
|
|
&& !mode_dependent_address_p (XEXP (XEXP (x, 0), 0))
|
|
|
|
|
&& !MEM_VOLATILE_P (XEXP (x, 0)))
|
1991-11-27 15:45:36 +01:00
|
|
|
|
{
|
|
|
|
|
enum machine_mode wanted_mode = VOIDmode;
|
2001-05-19 10:24:50 +02:00
|
|
|
|
enum machine_mode is_mode = GET_MODE (XEXP (x, 0));
|
1991-11-27 15:45:36 +01:00
|
|
|
|
int pos = INTVAL (XEXP (x, 2));
|
|
|
|
|
|
2001-08-22 02:33:33 +02:00
|
|
|
|
if (GET_CODE (x) == ZERO_EXTRACT)
|
1998-09-16 00:47:10 +02:00
|
|
|
|
{
|
2001-08-22 02:33:33 +02:00
|
|
|
|
enum machine_mode new_mode
|
|
|
|
|
= mode_for_extraction (EP_extzv, 1);
|
|
|
|
|
if (new_mode != MAX_MACHINE_MODE)
|
|
|
|
|
wanted_mode = new_mode;
|
1998-09-16 00:47:10 +02:00
|
|
|
|
}
|
2001-08-22 02:33:33 +02:00
|
|
|
|
else if (GET_CODE (x) == SIGN_EXTRACT)
|
1998-09-16 00:47:10 +02:00
|
|
|
|
{
|
2001-08-22 02:33:33 +02:00
|
|
|
|
enum machine_mode new_mode
|
|
|
|
|
= mode_for_extraction (EP_extv, 1);
|
|
|
|
|
if (new_mode != MAX_MACHINE_MODE)
|
|
|
|
|
wanted_mode = new_mode;
|
1998-09-16 00:47:10 +02:00
|
|
|
|
}
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
1992-05-07 08:41:23 +02:00
|
|
|
|
/* If we have a narrower mode, we can do something. */
|
1991-11-27 15:45:36 +01:00
|
|
|
|
if (wanted_mode != VOIDmode
|
|
|
|
|
&& GET_MODE_SIZE (wanted_mode) < GET_MODE_SIZE (is_mode))
|
|
|
|
|
{
|
|
|
|
|
int offset = pos / BITS_PER_UNIT;
|
|
|
|
|
rtx newmem;
|
|
|
|
|
|
Use byte offsets in SUBREGs instead of words.
2001-04-03 Jakub Jelinek <jakub@redhat.com>
David S. Miller <davem@pierdol.cobaltmicro.com>
Andrew MacLeod <amacleod@redhat.com>
Use byte offsets in SUBREGs instead of words.
* alias.c (nonlocal_mentioned_p): Use subreg_regno function.
* caller-save.c (mark_set_regs): Change callers of subreg_hard_regno
to pass new argument.
(add_stored_regs): Use subreg_regno_offset function.
* calls.c (expand_call): For non-paradoxical SUBREG take endianess
into account.
(precompute_arguments): Use gen_lowpart_SUBREG.
* combine.c (try_combine): Replace explicit XEXP with SUBREG_REG.
(combine_simplify_rtx): Rework to use SUBREG_BYTE.
(simplify_set): Rework to use SUBREG_BYTE.
(expand_field_assignment): Use SUBREG_BYTE.
(make_extraction): Use SUBREG_BYTE.
(if_then_else_cond): Use SUBREG_BYTE.
(apply_distributive_law): Use SUBREG_BYTE and fixup subreg comments.
(gen_lowpart_for_combine): Compute full byte offset.
* cse.c (mention_regs): Use SUBREG_BYTE.
(remove_invalid_subreg_refs): Rework to use SUBREG_BYTE.
(canon_hash): Use SUBREG_BYTE.
(fold_rtx): Pass SUBREG_BYTE div UNITS_PER_WORD to operand_subword.
(gen_lowpart_if_possible): Formatting.
* dbxout.c (dbxout_symbol_location): Compute SUBREG hard regnos
correctly.
* dwarf2out.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG
(mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG
(loc_descriptor): Fixup explicit XEXP into SUBREG_REG
* dwarfout.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG
(output_mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG
(output_loc_descriptor): Fixup explicit XEXP into SUBREG_REG
* emit-rtl.c (gen_rtx_SUBREG): New function, used to verify
certain invariants about SUBREGs the compiler creates.
(gen_lowpart_SUBREG): New function.
(subreg_hard_regno): New function to get the final register number.
(gen_lowpart_common): Use SUBREG_BYTE.
(gen_imagpart): Spacing nits.
(subreg_realpart_p): Use SUBREG_BYTE.
(gen_highpart): Use SUBREG_BYTE.
(subreg_lowpart_p): Always compute endian corrected goal offset,
even at the byte level, then compare against that.
(constant_subword): New function, pulled out all constant cases
from operand_subword and changed second argument name to offset.
(operand_subword): Detect non REG/SUBREG/CONCAT/MEM cases early
and call constant_subword to do the work. Return const0_rtx if
looking for a word outside of OP.
(operand_subword_force): Change second arg name to offset.
* expmed.c (store_bit_field): Use SUBREG_BYTE.
(store_split_bit_field): Use SUBREG_BYTE.
(extract_bit_field): Use SUBREG_BYTE.
(extract_split_bit_field): Use SUBREG_BYTE.
(expand_shift): Use SUBREG_BYTE.
* expr.c (store_expr, expand_expr): Use gen_lowpart_SUBREG.
* final.c (alter_subreg) Use subreg_hard_regno and SUBREG_BYTE.
* flow.c (set_noop_p): Use SUBREG_BYTE.
(mark_set_1): Remove ALTER_HARD_SUBREG. Use subreg_regno_offset instead.
* function.c (fixup_var_refs_1): Fixup explicit XEXP into a SUBREG_REG.
(fixup_memory_subreg): Use SUBREG_BYTE and remove byte endian
correction code.
(optimize_bit_field): Use SUBREG_BYTE.
(purge_addressof_1): Use SUBREG_BYTE.
(purge_single_hard_subreg_set): Use subreg_regno_offset function.
(assign_params): Mark arguments SUBREG_PROMOTED_VAR_P if they are
actually promoted by the caller and PROMOTE_FOR_CALLS_ONLY is true.
* gengenrtl.c (special_rtx): Add SUBREG.
* global.c (mark_reg_store): Use SUBREG_BYTE.
(set_preference): Rework to use subreg_regno_offset and SUBREG_BYTE.
* ifcvt (noce_emit_move_insn): Use SUBREG_BYTE.
* integrate.c (copy_rtx_and_substitute): Use SUBREG_BYTE and make sure
final byte offset is congruent to subreg's mode size.
(subst_constants): Use SUBREG_BYTE.
(mark_stores): Use subreg_regno_offset function.
* jump.c (rtx_renumbered_equal_p, true_regnum): Use subreg_regno_offset
function and SUBREG_BYTE.
* local-alloc.c (combine_regs): Use subreg_regno_offset function.
(reg_is_born): Use subreg_hard_regno.
* recog.c (valid_replace_rtx_1): Use SUBREG_BYTE and remove byte
endian correction code. Don't combine subregs unless resulting
offset aligns with type. Fix subreg constant extraction for DImode.
Simplify SUBREG of VOIDmode CONST_DOUBLE.
(general_operand): Remove dead mode_altering_drug code.
(indirect_operand): Use SUBREG_BYTE.
(constrain_operands): Use subreg_regno_offset function.
* reg-stack.c (get_true_reg): Use subreg_regno_offset function.
* regmove.c (regmove_optimize): Use SUBREG_BYTE.
(optimize_reg_copy_3): Use gen_lowpart_SUBREG.
* regs.h (REG_SIZE): Allow target to override.
(REGMODE_NATURAL_SIZE): New macro which target can override.
* reload.c (reload_inner_reg_of_subreg): subreg_regno should be used
on the entire subreg rtx.
(push_reload): Use SUBREG_BYTE in comments and code.
(find_dummy_reload): Use subreg_regno_offset. Only adjust offsets
for hard registers inside subregs.
(operands_match_p): Use subreg_regno_offset.
(find_reloads): Use SUBREG_BYTE and only advance offset for subregs
containing hard regs.
(find_reload_toplev): Use SUBREG_BYTE. Remove byte endian
corrections when fixing up MEM subregs.
(find_reloads_address_1): Use SUBREG_BYTE, subreg_regno, and
subreg_regno_offset where appropriate.
(find_reloads_subreg_address): Use SUBREG_BYTE. Remove
byte endian corrections when fixing up MEM subregs.
(subst_reloads): When combining two subregs, make sure final
offset is congruent to subreg's mode size.
(find_replacement): Use SUBREG_BYTE and subreg_regno_offset.
(refers_to_regno_for_reload_p): Use subreg_regno.
(reg_overlap_mentioned_for_reload_p): Use subreg_regno_offset.
* reload1.c (eliminate_regs) Use SUBREG_BYTE. Remove byte endian
correction code for memory subreg fixups.
(forget_old_reload_1): Use subreg_regno_offset.
(choose_reload_regs): Use subreg_regno.
(emit_input_reload_insns): Use SUBREG_BYTE.
(reload_combine_note_store): Use subreg_regno_offset.
(move2add_note_store): Use subreg_regno_offset.
* resource.c (update_live_status, mark_referenced_resources): Use
subreg_regno function.
(mark_set_resources): Use subreg_regno function.
* rtl.h (SUBREG_WORD): Rename to SUBREG_BYTE.
(subreg_regno_offset, subreg_regno): Define prototypes.
(subreg_hard_regno, constant_subword, gen_rtx_SUBREG): Newi functions.
(gen_lowpart_SUBREG): Add prototype.
* rtl.texi (subreg): Update to reflect new byte offset representation.
Add mentioning of the effect that BYTES_BIG_ENDIAN has on subregs now.
* rtlanal.c (refers_to_regno_p): Use subreg_regno.
(reg_overlap_mentioned_p): Use subreg_regno.
(replace_regs); Make sure final offset of combined subreg is
congruent to size of subreg's mode.
(subreg_regno_offset): New function.
(subreg_regno): New function.
* sched-vis.c (print_value): Change SUBREG_WORD to SUBREG_BYTE.
* sdbout.c (sdbout_symbol): Compute offset using alter_subreg.
* stmt.c (expand_anon_union_decl): Use gen_lowpart_SUBREG.
* tm.texi (ALTER_HARD_SUBREG): Remove, it is now dead.
(SUBREG_REGNO_OFFSET): Describe SUBREG_REGNO_OFFSET overrides.
* config/a29k/a29k.c (gpc_reg_operand): Use subreg_regno.
(a29k_get_reloaded_address): Use SUBREG_BYTE.
(print_operand): Use SUBREG_BYTE.
* config/alpha/alpha.c (print_operand_address): Use SUBREG_BYTE.
* config/arm/arm.c (arm_reload_in_hi): Use SUBREG_BYTE.
(arm_reload_out_hi): Use SUBREG_BYTE.
* config/d30v/d30v.c (d30v_split_double): Use subreg_regno_offset
instead of SUBREG_WORD.
(d30v_print_operand_memory_reference): Use subreg_regno_offset.
* config/dsp16xx/dsp16xx.md (extendqihi2, zero_extendqihi2): Fix
SUBREG creation to use byte offset.
* config/h8300/h8300.md (Unnamed HImode zero extraction and 16bit
inverted load insns): Fix explicit rtl subregs to use byte
offsets.
* config/i370/i370.md (cmpstrsi, movstrsi, mulsi3, divsi3,
udivsi3, umodsi3): Generate SUBREGs with byte offsets.
* config/i860/i860.c (single_insn_src_p): Use SUBREG_BYTE.
* config/i860/i860.md (mulsi3_big): Fixup explicit SUBREGs in rtl
to use byte offsets.
(unnamed fmlow.dd insn): Fixup SUBREGS to use byte offsets.
* config/i960/i960.md (extendhisi2): Generate SUBREGs with byte
offsets, also make sure it is congruent to SUBREG's mode size.
(extendqisi2, extendqihi2, zero_extendhisi2, zero_extendqisi2,
unnamed ldob insn): Generate SUBREGs with byte offset.
(zero_extendqihi2): SUBREG's are byte offsets.
* config/m68hc11/m68hc11.c (m68hc11_gen_lowpart): Use SUBREG_BYTE.
(m68hc11_gen_highpart): Use SUBREG_BYTE.
* config/m68k/m68k.md (zero_extendhisi2, zero_extendqihi2,
zero-extendqisi2): Generate SUBREGs with byte offset.
(umulsidi3, mulsidi3, subreghi1ashrdi_const32,
subregsi1ashrdi_const32, subreg1lshrdi_const32): Fixup explicit
subregs in rtl to use byte offsets.
* config/m88k/m88k.md (extendsidi2): fixup subregs to use byte offset.
* config/mips/mips.c (mips_move_1word): Use subreg_regno_offset.
(mips_move_2words): Use subreg_regno_offset.
(mips_secondary_reload_class): Use subreg_regno_offset.
* config/mips/mips.md (DImode plus, minus, move, and logical op
splits): Fixup explicit subregs in rtl to use byte offsets.
* config/mn10200/mn10200.c (print_operand): Use subreg_regno function.
* config/mn10300/mn10300.c (print_operand): Use subreg_regno function.
* config/ns32k/ns32k.md (udivmoddisi4): Fix explicit subregs in
rtl to use byte offsets.
* config/pa/pa.c (emit_move_sequence): Use SUBREG_BYTE.
* config/pa/pa.md (floatunssisf2, floatunssidf2, mulsi3): fix explicit
subregs to use byte offsets.
* config/pdp11/pdp11.md (zero_extendhisi2, modhi3, modhi3+1):
Fixup explicit subregs in rtl to use byte offsets.
* config/romp/romp.c (memory_offset_in_range_p): Use SUBREG_BYTE
and remove byte endian correction code.
* config/sh/sh.c (output_movedouble): Use subreg_regno.
(gen_ashift_hi): Use SUBREG_BYTE.
(regs_used): Use subreg_regno_offset.
(machine_dependent_reorg): Use subreg_regno_offset.
* config/sh/sh.h (INDEX_REGISTER_RTX_P): Use SUBREG_BYTE.
* config/sh/sh.md (DImode and DFmode move splits): Use subreg_regno.
(movdf_i4): Subregs are byte offsets now.
* config/sparc/sparc.c (ultra_find_type): Use SUBREG_BYTE.
* config/sparc/sparc.h (ALTER_HARD_SUBREG): Removed.
(REGMODE_NATURAL_SIZE): Override.
(REG_SIZE): For SUBREG check float mode on SUBREG_REG's mode.
* config/sparc/sparc.md (TFmode move splits): Generate SUBREGs
with byte offsets.
(zero_extendhisi2, zero_extendqidi2_insn, extendhisi2,
extendqihi2, sign_extendqihi2_insn, sign_extendqisi2_insn,
extendqidi2): Generate SUBREGs with byte offsets, also make sure
it is congruent to SUBREG's mode size.
(smulsi3_highpart_v8plus): Fix explicit subregs in rtl to use byte
offsets.
(cmp_siqi_trunc, cmp_siqi_trunc_set, cmp_diqi_trunc,
cmp_diqi_trunc_set, lshrdi3_v8plus+1, lshrdi3_v8plus+2,
lshrdi3_v8plus+3, lshrdi3_v8plus+4): Use proper
SUBREG_BYTE offset for non-paradoxical subregs in patterns.
* config/v850/v850.c (print_operand, output_move_double): Use
subreg_regno function.
Co-Authored-By: Andrew MacLeod <amacleod@redhat.com>
Co-Authored-By: David S. Miller <davem@pierdol.cobaltmicro.com>
From-SVN: r41058
2001-04-03 17:06:12 +02:00
|
|
|
|
/* If the bytes and bits are counted differently, we
|
2001-05-19 10:24:50 +02:00
|
|
|
|
must adjust the offset. */
|
1994-11-16 22:10:09 +01:00
|
|
|
|
if (BYTES_BIG_ENDIAN != BITS_BIG_ENDIAN)
|
2001-05-19 10:24:50 +02:00
|
|
|
|
offset =
|
|
|
|
|
(GET_MODE_SIZE (is_mode) - GET_MODE_SIZE (wanted_mode) -
|
|
|
|
|
offset);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
pos %= GET_MODE_BITSIZE (wanted_mode);
|
|
|
|
|
|
[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
|
|
|
|
newmem = adjust_address_nv (XEXP (x, 0), wanted_mode, offset);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
1992-07-07 00:16:17 +02:00
|
|
|
|
validate_change (object, &XEXP (x, 2), GEN_INT (pos), 1);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
validate_change (object, &XEXP (x, 0), newmem, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
2001-05-19 10:24:50 +02:00
|
|
|
|
|
alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO...
* alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO;
change gen_rtx(expr...) to gen_rtx_fmt_foo(expr...).
* caller-save.c, calls.c, combine.c, cse.c: Likewise.
* dwarf2out.c, except.c, explow.c, expmed.c, expr.c: Likewise.
* final.c, flow.c, function.c, genpeep.c, haifa-sched.c: Likewise.
* halfpic.c, integrate.c, jump.c, local-alloc.c, loop.c: Likewise.
* profile.c, recog.c, reg-stack.c, regclass.c, regmove.c: Likewise.
* reload.c, reload1.c, reorg.c, sched.c, stmt.c, stupid.c: Likewise.
* unroll.c, varasm.c: Likewise.
* config/alpha/alpha.c, config/alpha/alpha.md: Likewise.
From-SVN: r17357
1998-01-15 00:10:50 +01:00
|
|
|
|
default:
|
|
|
|
|
break;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2000-07-30 20:44:13 +02:00
|
|
|
|
/* Try replacing every occurrence of FROM in subexpression LOC of INSN
|
|
|
|
|
with TO. After all changes have been made, validate by seeing
|
|
|
|
|
if INSN is still valid. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
validate_replace_rtx_subexp (from, to, insn, loc)
|
|
|
|
|
rtx from, to, insn, *loc;
|
|
|
|
|
{
|
|
|
|
|
validate_replace_rtx_1 (loc, from, to, insn);
|
|
|
|
|
return apply_change_group ();
|
|
|
|
|
}
|
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
/* Try replacing every occurrence of FROM in INSN with TO. After all
|
|
|
|
|
changes have been made, validate by seeing if INSN is still valid. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
validate_replace_rtx (from, to, insn)
|
|
|
|
|
rtx from, to, insn;
|
|
|
|
|
{
|
|
|
|
|
validate_replace_rtx_1 (&PATTERN (insn), from, to, insn);
|
|
|
|
|
return apply_change_group ();
|
|
|
|
|
}
|
1998-05-20 02:24:32 +02:00
|
|
|
|
|
2001-02-16 20:14:09 +01:00
|
|
|
|
/* Try replacing every occurrence of FROM in INSN with TO. */
|
1998-08-23 01:21:23 +02:00
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
validate_replace_rtx_group (from, to, insn)
|
|
|
|
|
rtx from, to, insn;
|
|
|
|
|
{
|
|
|
|
|
validate_replace_rtx_1 (&PATTERN (insn), from, to, insn);
|
|
|
|
|
}
|
|
|
|
|
|
2001-02-17 20:50:58 +01:00
|
|
|
|
/* Function called by note_uses to replace used subexpressions. */
|
|
|
|
|
struct validate_replace_src_data
|
2001-02-19 00:56:34 +01:00
|
|
|
|
{
|
|
|
|
|
rtx from; /* Old RTX */
|
|
|
|
|
rtx to; /* New RTX */
|
|
|
|
|
rtx insn; /* Insn in which substitution is occurring. */
|
|
|
|
|
};
|
2001-02-17 20:50:58 +01:00
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
validate_replace_src_1 (x, data)
|
|
|
|
|
rtx *x;
|
|
|
|
|
void *data;
|
|
|
|
|
{
|
|
|
|
|
struct validate_replace_src_data *d
|
|
|
|
|
= (struct validate_replace_src_data *) data;
|
|
|
|
|
|
|
|
|
|
validate_replace_rtx_1 (x, d->from, d->to, d->insn);
|
|
|
|
|
}
|
|
|
|
|
|
1998-05-20 02:24:32 +02:00
|
|
|
|
/* Try replacing every occurrence of FROM in INSN with TO, avoiding
|
|
|
|
|
SET_DESTs. After all changes have been made, validate by seeing if
|
|
|
|
|
INSN is still valid. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
validate_replace_src (from, to, insn)
|
|
|
|
|
rtx from, to, insn;
|
|
|
|
|
{
|
2001-02-17 20:50:58 +01:00
|
|
|
|
struct validate_replace_src_data d;
|
2001-02-16 20:14:09 +01:00
|
|
|
|
|
2001-02-17 20:50:58 +01:00
|
|
|
|
d.from = from;
|
|
|
|
|
d.to = to;
|
|
|
|
|
d.insn = insn;
|
|
|
|
|
note_uses (&PATTERN (insn), validate_replace_src_1, &d);
|
1998-05-20 02:24:32 +02:00
|
|
|
|
return apply_change_group ();
|
|
|
|
|
}
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
#ifdef HAVE_cc0
|
|
|
|
|
/* Return 1 if the insn using CC0 set by INSN does not contain
|
|
|
|
|
any ordered tests applied to the condition codes.
|
|
|
|
|
EQ and NE tests do not count. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
next_insn_tests_no_inequality (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx next = next_cc0_user (insn);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
/* If there is no next insn, we have to take the conservative choice. */
|
|
|
|
|
if (next == 0)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return ((GET_CODE (next) == JUMP_INSN
|
|
|
|
|
|| GET_CODE (next) == INSN
|
|
|
|
|
|| GET_CODE (next) == CALL_INSN)
|
|
|
|
|
&& ! inequality_comparisons_p (PATTERN (next)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#if 0 /* This is useless since the insn that sets the cc's
|
|
|
|
|
must be followed immediately by the use of them. */
|
|
|
|
|
/* Return 1 if the CC value set up by INSN is not used. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
next_insns_test_no_inequality (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx next = NEXT_INSN (insn);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
for (; next != 0; next = NEXT_INSN (next))
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (next) == CODE_LABEL
|
|
|
|
|
|| GET_CODE (next) == BARRIER)
|
|
|
|
|
return 1;
|
|
|
|
|
if (GET_CODE (next) == NOTE)
|
|
|
|
|
continue;
|
|
|
|
|
if (inequality_comparisons_p (PATTERN (next)))
|
|
|
|
|
return 0;
|
|
|
|
|
if (sets_cc0_p (PATTERN (next)) == 1)
|
|
|
|
|
return 1;
|
|
|
|
|
if (! reg_mentioned_p (cc0_rtx, PATTERN (next)))
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* This is used by find_single_use to locate an rtx that contains exactly one
|
|
|
|
|
use of DEST, which is typically either a REG or CC0. It returns a
|
|
|
|
|
pointer to the innermost rtx expression containing DEST. Appearances of
|
|
|
|
|
DEST that are being used to totally replace it are not counted. */
|
|
|
|
|
|
|
|
|
|
static rtx *
|
|
|
|
|
find_single_use_1 (dest, loc)
|
|
|
|
|
rtx dest;
|
|
|
|
|
rtx *loc;
|
|
|
|
|
{
|
|
|
|
|
rtx x = *loc;
|
|
|
|
|
enum rtx_code code = GET_CODE (x);
|
|
|
|
|
rtx *result = 0;
|
|
|
|
|
rtx *this_result;
|
|
|
|
|
int i;
|
rtl.h (rtx_format): Constify a char*.
* rtl.h (rtx_format): Constify a char*.
* rtl.c (rtx_format): Likewise.
(copy_rtx, copy_most_rtx, read_rtx): Likewise.
(init_rtl): Use accessor macro, not `rtx_format'.
* alias.c (rtx_equal_for_memref_p, find_symbolic_term): Constify a
char*.
* caller-save.c (mark_referenced_regs): Likewise.
* combine.c (subst, make_compound_operation, known_cond,
gen_rtx_combine, update_table_tick, get_last_value_validate,
use_crosses_set_p, mark_used_regs_combine, move_deaths): Likewise.
* cse.c (rtx_cost, mention_regs, canon_hash, exp_equiv_p,
refers_to_p, canon_reg, fold_rtx, cse_process_notes,
count_reg_usage): Likewise.
* emit-rtl.c (gen_rtx, copy_rtx_if_shared, reset_used_flags):
Likewise.
* final.c (leaf_renumber_regs_insn): Likewise.
* flow.c (mark_used_regs, find_use_as_address, dump_flow_info,
dump_edge_info, count_reg_references): Likewise.
* function.c (fixup_var_refs_1, walk_fixup_memory_subreg,
fixup_stack_1, purge_addressof_1, instantiate_virtual_regs_1):
Likewise.
* gcse.c (oprs_unchanged_p, hash_expr_1, expr_equiv_p,
oprs_not_set_p, expr_killed_p, compute_transp, find_used_regs,
add_label_notes): Likewise.
* genattrtab.c (attr_rtx, attr_copy_rtx, encode_units_mask,
clear_struct_flag, count_sub_rtxs, count_alternatives,
compares_alternatives_p, contained_in_p, walk_attr_value,
write_expr_attr_cache): Likewise.
* genconfig.c (walk_insn_part): Likewise.
* genemit.c (max_operand_1, gen_exp): Likewise.
* genextract.c (walk_rtx): Likewise.
* genflags.c (num_operands): Likewise.
* genoutput.c (scan_operands): Likewise.
* genpeep.c (match_rtx): Likewise.
* genrecog.c (add_to_sequence): Likewise.
* haifa-sched.c (may_trap_exp, sched_analyze_2, attach_deaths):
Likewise.
* integrate.c (save_constants, copy_for_inline,
copy_rtx_and_substitute, subst_constants, restore_constants):
Likewise.
* jump.c (mark_jump_label, invert_exp, redirect_exp,
rtx_renumbered_equal_p, rtx_equal_for_thread_p): Likewise.
* local-alloc.c (contains_replace_regs, memref_referenced_p):
Likewise.
* loop.c (record_excess_regs, rtx_equal_for_loop_p,
add_label_notes, replace_call_address, count_nonfixed_reads,
invariant_p, find_single_use_in_loop, find_mem_givs,
find_life_end, maybe_eliminate_biv_1, update_reg_last_use):
Likewise.
* print-rtl.c (reg_names, print_rtx): Likewise.
* recog.c (validate_replace_rtx_1, find_single_use_1): Likewise.
* reg-stack.c (stack_regs_mentioned_p, record_label_references,
record_reg_life_pat, swap_rtx_condition, goto_block_pat,
print_blocks): Likewise.
* regclass.c (fix_register, record_address_regs,
reg_scan_mark_refs): Likewise.
* regmove.c (stable_but_for_p): Likewise.
* reload.c (loc_mentioned_in_p, operands_match_p,
find_reloads_toplevsubst_reg_equivs, find_reloads_address_1,
copy_replacements, refers_to_regno_for_reload_p,
refers_to_mem_for_reload_p, find_inc_amount, regno_clobbered_p,
reload_when_needed_name, reg_class_names, debug_reload_to_stream):
Likewise.
* reload1.c (eliminate_regs, scan_paradoxical_subregs,
delete_address_reloads_1, count_occurrences,
reload_cse_mem_conflict_p, reload_combine_note_use,
add_auto_inc_notes): Likewise.
* resource.c (mark_referenced_resources, mark_set_resources):
Likewise.
* rtlanal.c (rtx_unstable_p, rtx_varies_p, rtx_addr_varies_p,
reg_mentioned_p, regs_set_between_p, modified_between_p,
modified_in_p, refers_to_regno_p, reg_overlap_mentioned_p,
rtx_equal_p, volatile_insn_p, volatile_refs_p, side_effects_p,
may_trap_p, inequality_comparisons_p, replace_rtx, replace_regs,
jmp_uses_reg_or_mem, for_each_rtx, regno_use_in): Likewise.
* sched.c (sched_analyze_2, attach_deaths): Likewise.
* stupid.c (stupid_mark_refs): Likewise.
* unroll.c (remap_split_bivs): Likewise.
* varasm.c (mark_constants): Likewise.
* a29k/a29k.c (uses_local_reg_p): Likewise.
* alpha/alpha.c (summarize_insn): Likewise.
* arm/arm.c (symbol_mentioned_p, label_mentioned_p,
eliminate_lr2ip): Likewise.
* arm/thumb.c (symbol_mentioned_p, label_mentioned_p): Likewise.
* i386/i386.c (symbolic_reference_mentioned_p, copy_all_rtx,
reg_mentioned_in_mem): Likewise.
* ns32k/ns32k.c (global_symbolic_reference_mentioned_p,
symbolic_reference_mentioned_p): Likewise.
* romp/romp.c (unsigned_comparisons_p, hash_rtx): Likewise.
* sh/sh.c (regs_used, mark_use): Likewise.
* vax/vax.c (vax_rtx_cost): Likewise.
From-SVN: r28784
1999-08-21 01:05:25 +02:00
|
|
|
|
const char *fmt;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case CONST_INT:
|
|
|
|
|
case CONST:
|
|
|
|
|
case LABEL_REF:
|
|
|
|
|
case SYMBOL_REF:
|
|
|
|
|
case CONST_DOUBLE:
|
2002-02-19 03:53:41 +01:00
|
|
|
|
case CONST_VECTOR:
|
1991-11-27 15:45:36 +01:00
|
|
|
|
case CLOBBER:
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
case SET:
|
|
|
|
|
/* If the destination is anything other than CC0, PC, a REG or a SUBREG
|
|
|
|
|
of a REG that occupies all of the REG, the insn uses DEST if
|
|
|
|
|
it is mentioned in the destination or the source. Otherwise, we
|
|
|
|
|
need just check the source. */
|
|
|
|
|
if (GET_CODE (SET_DEST (x)) != CC0
|
|
|
|
|
&& GET_CODE (SET_DEST (x)) != PC
|
|
|
|
|
&& GET_CODE (SET_DEST (x)) != REG
|
|
|
|
|
&& ! (GET_CODE (SET_DEST (x)) == SUBREG
|
|
|
|
|
&& GET_CODE (SUBREG_REG (SET_DEST (x))) == REG
|
|
|
|
|
&& (((GET_MODE_SIZE (GET_MODE (SUBREG_REG (SET_DEST (x))))
|
|
|
|
|
+ (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)
|
|
|
|
|
== ((GET_MODE_SIZE (GET_MODE (SET_DEST (x)))
|
|
|
|
|
+ (UNITS_PER_WORD - 1)) / UNITS_PER_WORD))))
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
return find_single_use_1 (dest, &SET_SRC (x));
|
|
|
|
|
|
|
|
|
|
case MEM:
|
|
|
|
|
case SUBREG:
|
|
|
|
|
return find_single_use_1 (dest, &XEXP (x, 0));
|
2002-05-09 03:42:28 +02:00
|
|
|
|
|
alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO...
* alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO;
change gen_rtx(expr...) to gen_rtx_fmt_foo(expr...).
* caller-save.c, calls.c, combine.c, cse.c: Likewise.
* dwarf2out.c, except.c, explow.c, expmed.c, expr.c: Likewise.
* final.c, flow.c, function.c, genpeep.c, haifa-sched.c: Likewise.
* halfpic.c, integrate.c, jump.c, local-alloc.c, loop.c: Likewise.
* profile.c, recog.c, reg-stack.c, regclass.c, regmove.c: Likewise.
* reload.c, reload1.c, reorg.c, sched.c, stmt.c, stupid.c: Likewise.
* unroll.c, varasm.c: Likewise.
* config/alpha/alpha.c, config/alpha/alpha.md: Likewise.
From-SVN: r17357
1998-01-15 00:10:50 +01:00
|
|
|
|
default:
|
|
|
|
|
break;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If it wasn't one of the common cases above, check each expression and
|
|
|
|
|
vector of this code. Look for a unique usage of DEST. */
|
|
|
|
|
|
|
|
|
|
fmt = GET_RTX_FORMAT (code);
|
|
|
|
|
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
|
|
|
|
|
{
|
|
|
|
|
if (fmt[i] == 'e')
|
|
|
|
|
{
|
|
|
|
|
if (dest == XEXP (x, i)
|
|
|
|
|
|| (GET_CODE (dest) == REG && GET_CODE (XEXP (x, i)) == REG
|
|
|
|
|
&& REGNO (dest) == REGNO (XEXP (x, i))))
|
|
|
|
|
this_result = loc;
|
|
|
|
|
else
|
|
|
|
|
this_result = find_single_use_1 (dest, &XEXP (x, i));
|
|
|
|
|
|
|
|
|
|
if (result == 0)
|
|
|
|
|
result = this_result;
|
|
|
|
|
else if (this_result)
|
|
|
|
|
/* Duplicate usage. */
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else if (fmt[i] == 'E')
|
|
|
|
|
{
|
|
|
|
|
int j;
|
|
|
|
|
|
|
|
|
|
for (j = XVECLEN (x, i) - 1; j >= 0; j--)
|
|
|
|
|
{
|
|
|
|
|
if (XVECEXP (x, i, j) == dest
|
|
|
|
|
|| (GET_CODE (dest) == REG
|
|
|
|
|
&& GET_CODE (XVECEXP (x, i, j)) == REG
|
|
|
|
|
&& REGNO (XVECEXP (x, i, j)) == REGNO (dest)))
|
|
|
|
|
this_result = loc;
|
|
|
|
|
else
|
|
|
|
|
this_result = find_single_use_1 (dest, &XVECEXP (x, i, j));
|
|
|
|
|
|
|
|
|
|
if (result == 0)
|
|
|
|
|
result = this_result;
|
|
|
|
|
else if (this_result)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* See if DEST, produced in INSN, is used only a single time in the
|
|
|
|
|
sequel. If so, return a pointer to the innermost rtx expression in which
|
|
|
|
|
it is used.
|
|
|
|
|
|
|
|
|
|
If PLOC is non-zero, *PLOC is set to the insn containing the single use.
|
|
|
|
|
|
|
|
|
|
This routine will return usually zero either before flow is called (because
|
|
|
|
|
there will be no LOG_LINKS notes) or after reload (because the REG_DEAD
|
|
|
|
|
note can't be trusted).
|
|
|
|
|
|
|
|
|
|
If DEST is cc0_rtx, we look only at the next insn. In that case, we don't
|
|
|
|
|
care about REG_DEAD notes or LOG_LINKS.
|
|
|
|
|
|
|
|
|
|
Otherwise, we find the single use by finding an insn that has a
|
|
|
|
|
LOG_LINKS pointing at INSN and has a REG_DEAD note for DEST. If DEST is
|
|
|
|
|
only referenced once in that insn, we know that it must be the first
|
|
|
|
|
and last insn referencing DEST. */
|
|
|
|
|
|
|
|
|
|
rtx *
|
|
|
|
|
find_single_use (dest, insn, ploc)
|
|
|
|
|
rtx dest;
|
|
|
|
|
rtx insn;
|
|
|
|
|
rtx *ploc;
|
|
|
|
|
{
|
|
|
|
|
rtx next;
|
|
|
|
|
rtx *result;
|
|
|
|
|
rtx link;
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_cc0
|
|
|
|
|
if (dest == cc0_rtx)
|
|
|
|
|
{
|
|
|
|
|
next = NEXT_INSN (insn);
|
|
|
|
|
if (next == 0
|
|
|
|
|
|| (GET_CODE (next) != INSN && GET_CODE (next) != JUMP_INSN))
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
result = find_single_use_1 (dest, &PATTERN (next));
|
|
|
|
|
if (result && ploc)
|
|
|
|
|
*ploc = next;
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if (reload_completed || reload_in_progress || GET_CODE (dest) != REG)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
for (next = next_nonnote_insn (insn);
|
|
|
|
|
next != 0 && GET_CODE (next) != CODE_LABEL;
|
|
|
|
|
next = next_nonnote_insn (next))
|
2000-08-04 22:28:08 +02:00
|
|
|
|
if (INSN_P (next) && dead_or_set_p (next, dest))
|
1991-11-27 15:45:36 +01:00
|
|
|
|
{
|
|
|
|
|
for (link = LOG_LINKS (next); link; link = XEXP (link, 1))
|
|
|
|
|
if (XEXP (link, 0) == insn)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
if (link)
|
|
|
|
|
{
|
|
|
|
|
result = find_single_use_1 (dest, &PATTERN (next));
|
|
|
|
|
if (ploc)
|
|
|
|
|
*ploc = next;
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 if OP is a valid general operand for machine mode MODE.
|
|
|
|
|
This is either a register reference, a memory reference,
|
|
|
|
|
or a constant. In the case of a memory reference, the address
|
|
|
|
|
is checked for general validity for the target machine.
|
|
|
|
|
|
|
|
|
|
Register and memory references must have mode MODE in order to be valid,
|
|
|
|
|
but some constants have no machine mode and are valid for any mode.
|
|
|
|
|
|
|
|
|
|
If MODE is VOIDmode, OP is checked for validity for whatever mode
|
|
|
|
|
it has.
|
|
|
|
|
|
|
|
|
|
The main use of this function is as a predicate in match_operand
|
|
|
|
|
expressions in the machine description.
|
|
|
|
|
|
1992-05-07 08:41:23 +02:00
|
|
|
|
For an explanation of this function's behavior for registers of
|
1991-11-27 15:45:36 +01:00
|
|
|
|
class NO_REGS, see the comment for `register_operand'. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
general_operand (op, mode)
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx op;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
enum rtx_code code = GET_CODE (op);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
if (mode == VOIDmode)
|
|
|
|
|
mode = GET_MODE (op);
|
|
|
|
|
|
|
|
|
|
/* Don't accept CONST_INT or anything similar
|
|
|
|
|
if the caller wants something floating. */
|
|
|
|
|
if (GET_MODE (op) == VOIDmode && mode != VOIDmode
|
1992-10-11 21:27:23 +01:00
|
|
|
|
&& GET_MODE_CLASS (mode) != MODE_INT
|
|
|
|
|
&& GET_MODE_CLASS (mode) != MODE_PARTIAL_INT)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
return 0;
|
|
|
|
|
|
2001-04-12 07:25:55 +02:00
|
|
|
|
if (GET_CODE (op) == CONST_INT
|
|
|
|
|
&& trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op))
|
|
|
|
|
return 0;
|
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
if (CONSTANT_P (op))
|
2000-07-30 20:53:33 +02:00
|
|
|
|
return ((GET_MODE (op) == VOIDmode || GET_MODE (op) == mode
|
|
|
|
|
|| mode == VOIDmode)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
#ifdef LEGITIMATE_PIC_OPERAND_P
|
|
|
|
|
&& (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op))
|
|
|
|
|
#endif
|
|
|
|
|
&& LEGITIMATE_CONSTANT_P (op));
|
|
|
|
|
|
|
|
|
|
/* Except for certain constants with VOIDmode, already checked for,
|
|
|
|
|
OP's mode must match MODE if MODE specifies a mode. */
|
|
|
|
|
|
|
|
|
|
if (GET_MODE (op) != mode)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (code == SUBREG)
|
|
|
|
|
{
|
2002-06-28 17:43:54 +02:00
|
|
|
|
rtx sub = SUBREG_REG (op);
|
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
#ifdef INSN_SCHEDULING
|
|
|
|
|
/* On machines that have insn scheduling, we want all memory
|
|
|
|
|
reference to be explicit, so outlaw paradoxical SUBREGs. */
|
2002-06-28 17:43:54 +02:00
|
|
|
|
if (GET_CODE (sub) == MEM
|
|
|
|
|
&& GET_MODE_SIZE (mode) > GET_MODE_SIZE (GET_MODE (sub)))
|
1991-11-27 15:45:36 +01:00
|
|
|
|
return 0;
|
|
|
|
|
#endif
|
2001-05-19 10:24:50 +02:00
|
|
|
|
/* Avoid memories with nonzero SUBREG_BYTE, as offsetting the memory
|
|
|
|
|
may result in incorrect reference. We should simplify all valid
|
2001-05-19 13:51:32 +02:00
|
|
|
|
subregs of MEM anyway. But allow this after reload because we
|
2002-05-09 03:42:28 +02:00
|
|
|
|
might be called from cleanup_subreg_operands.
|
2001-05-19 13:51:32 +02:00
|
|
|
|
|
|
|
|
|
??? This is a kludge. */
|
|
|
|
|
if (!reload_completed && SUBREG_BYTE (op) != 0
|
2002-06-28 17:43:54 +02:00
|
|
|
|
&& GET_CODE (sub) == MEM)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
/* FLOAT_MODE subregs can't be paradoxical. Combine will occasionally
|
|
|
|
|
create such rtl, and we must reject it. */
|
|
|
|
|
if (GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT
|
|
|
|
|
&& GET_MODE_SIZE (GET_MODE (op)) > GET_MODE_SIZE (GET_MODE (sub)))
|
2002-05-09 03:42:28 +02:00
|
|
|
|
return 0;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
2002-06-28 17:43:54 +02:00
|
|
|
|
op = sub;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
code = GET_CODE (op);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (code == REG)
|
|
|
|
|
/* A register whose class is NO_REGS is not a general operand. */
|
|
|
|
|
return (REGNO (op) >= FIRST_PSEUDO_REGISTER
|
|
|
|
|
|| REGNO_REG_CLASS (REGNO (op)) != NO_REGS);
|
|
|
|
|
|
|
|
|
|
if (code == MEM)
|
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx y = XEXP (op, 0);
|
2000-07-23 19:17:37 +02:00
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
if (! volatile_ok && MEM_VOLATILE_P (op))
|
|
|
|
|
return 0;
|
2000-07-23 19:17:37 +02:00
|
|
|
|
|
alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO...
* alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO;
change gen_rtx(expr...) to gen_rtx_fmt_foo(expr...).
* caller-save.c, calls.c, combine.c, cse.c: Likewise.
* dwarf2out.c, except.c, explow.c, expmed.c, expr.c: Likewise.
* final.c, flow.c, function.c, genpeep.c, haifa-sched.c: Likewise.
* halfpic.c, integrate.c, jump.c, local-alloc.c, loop.c: Likewise.
* profile.c, recog.c, reg-stack.c, regclass.c, regmove.c: Likewise.
* reload.c, reload1.c, reorg.c, sched.c, stmt.c, stupid.c: Likewise.
* unroll.c, varasm.c: Likewise.
* config/alpha/alpha.c, config/alpha/alpha.md: Likewise.
From-SVN: r17357
1998-01-15 00:10:50 +01:00
|
|
|
|
if (GET_CODE (y) == ADDRESSOF)
|
|
|
|
|
return 1;
|
2000-07-23 19:17:37 +02:00
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
/* Use the mem's mode, since it will be reloaded thus. */
|
|
|
|
|
mode = GET_MODE (op);
|
|
|
|
|
GO_IF_LEGITIMATE_ADDRESS (mode, y, win);
|
|
|
|
|
}
|
alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO...
* alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO;
change gen_rtx(expr...) to gen_rtx_fmt_foo(expr...).
* caller-save.c, calls.c, combine.c, cse.c: Likewise.
* dwarf2out.c, except.c, explow.c, expmed.c, expr.c: Likewise.
* final.c, flow.c, function.c, genpeep.c, haifa-sched.c: Likewise.
* halfpic.c, integrate.c, jump.c, local-alloc.c, loop.c: Likewise.
* profile.c, recog.c, reg-stack.c, regclass.c, regmove.c: Likewise.
* reload.c, reload1.c, reorg.c, sched.c, stmt.c, stupid.c: Likewise.
* unroll.c, varasm.c: Likewise.
* config/alpha/alpha.c, config/alpha/alpha.md: Likewise.
From-SVN: r17357
1998-01-15 00:10:50 +01:00
|
|
|
|
|
|
|
|
|
/* Pretend this is an operand for now; we'll run force_operand
|
|
|
|
|
on its replacement in fixup_var_refs_1. */
|
|
|
|
|
if (code == ADDRESSOF)
|
|
|
|
|
return 1;
|
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
win:
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 if OP is a valid memory address for a memory reference
|
|
|
|
|
of mode MODE.
|
|
|
|
|
|
|
|
|
|
The main use of this function is as a predicate in match_operand
|
|
|
|
|
expressions in the machine description. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
address_operand (op, mode)
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx op;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
|
|
|
|
return memory_address_p (mode, op);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 if OP is a register reference of mode MODE.
|
|
|
|
|
If MODE is VOIDmode, accept a register in any mode.
|
|
|
|
|
|
|
|
|
|
The main use of this function is as a predicate in match_operand
|
|
|
|
|
expressions in the machine description.
|
|
|
|
|
|
|
|
|
|
As a special exception, registers whose class is NO_REGS are
|
|
|
|
|
not accepted by `register_operand'. The reason for this change
|
|
|
|
|
is to allow the representation of special architecture artifacts
|
|
|
|
|
(such as a condition code register) without extending the rtl
|
|
|
|
|
definitions. Since registers of class NO_REGS cannot be used
|
|
|
|
|
as registers in any case where register classes are examined,
|
|
|
|
|
it is most consistent to keep this function from accepting them. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
register_operand (op, mode)
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx op;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
|
|
|
|
if (GET_MODE (op) != mode && mode != VOIDmode)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (op) == SUBREG)
|
|
|
|
|
{
|
2002-06-28 17:43:54 +02:00
|
|
|
|
rtx sub = SUBREG_REG (op);
|
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
/* Before reload, we can allow (SUBREG (MEM...)) as a register operand
|
|
|
|
|
because it is guaranteed to be reloaded into one.
|
|
|
|
|
Just make sure the MEM is valid in itself.
|
|
|
|
|
(Ideally, (SUBREG (MEM)...) should not exist after reload,
|
|
|
|
|
but currently it does result from (SUBREG (REG)...) where the
|
|
|
|
|
reg went on the stack.) */
|
2002-06-28 17:43:54 +02:00
|
|
|
|
if (! reload_completed && GET_CODE (sub) == MEM)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
return general_operand (op, mode);
|
1995-07-01 12:55:03 +02:00
|
|
|
|
|
2000-06-13 23:47:44 +02:00
|
|
|
|
#ifdef CLASS_CANNOT_CHANGE_MODE
|
2002-06-28 17:43:54 +02:00
|
|
|
|
if (GET_CODE (sub) == REG
|
|
|
|
|
&& REGNO (sub) < FIRST_PSEUDO_REGISTER
|
2000-06-13 23:47:44 +02:00
|
|
|
|
&& (TEST_HARD_REG_BIT
|
|
|
|
|
(reg_class_contents[(int) CLASS_CANNOT_CHANGE_MODE],
|
2002-06-28 17:43:54 +02:00
|
|
|
|
REGNO (sub)))
|
|
|
|
|
&& CLASS_CANNOT_CHANGE_MODE_P (mode, GET_MODE (sub))
|
|
|
|
|
&& GET_MODE_CLASS (GET_MODE (sub)) != MODE_COMPLEX_INT
|
|
|
|
|
&& GET_MODE_CLASS (GET_MODE (sub)) != MODE_COMPLEX_FLOAT)
|
1995-07-01 12:55:03 +02:00
|
|
|
|
return 0;
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-06-28 17:43:54 +02:00
|
|
|
|
/* FLOAT_MODE subregs can't be paradoxical. Combine will occasionally
|
|
|
|
|
create such rtl, and we must reject it. */
|
|
|
|
|
if (GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT
|
|
|
|
|
&& GET_MODE_SIZE (GET_MODE (op)) > GET_MODE_SIZE (GET_MODE (sub)))
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
op = sub;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
}
|
|
|
|
|
|
[multiple changes]
Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR>
* gcov.c (DIR_SEPARATOR): Provide default.
(output_data): Add test for MS-DOS format absolute filename.
(fancy_abort): Correct program name.
(open_files): Open all files in binary mode.
* libgcc2.c (__bb_exit_func): Likewise.
* profile.c (init_branch_prob): Specify binary when opening files.
* flags.h (flag_unwind_tables): New decl.
* toplev.c (flag_unwind_table): New definition.
(f_options): Add -funwind-tables.
(decode_g_option): Clarify warning when unknown -g option is given.
(rest_of_compilation): If inside an inlined external function,
pretend we are just being declared.
* dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables.
(dwarf2out_frame_finish): Likewise.
Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com>
* flow.c (propagate_block): When the last reference to a label
before an ADDR_VEC is deleted because the reference is a dead
store, delete the ADDR_VEC.
Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt>
* fold-const.c (merge_ranges): In not in0, but in1, handle
upper bounds equal like subset case.
Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com>
* dbxout.c (dbxout_parms): Generate a second stabs line for parameters
passed in a register but moved to the stack.
Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr>
* gcc.c (pass_exit_codes, greatest_status): New variables.
(struct option_map): Add entry for "--pass-exit-codes".
(execute): Update greatest_status if error.
(display_help): Add documentation for -pass-exit-codes.
(process_command): Handle -pass-exit-codes.
(main): Look at pass_exit_codes and greatest_status on call to exit.
Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads): Refine test for no input reload
case to not includes reloads emitted after insn.
* function.c (find_temp_slots_from_address): Handle sum involving
a register that points to a temp slot.
(update_temp_slot_address): Make recursive call if both old and
new are PLUS with a common operand.
* calls.c (expand_call): Mark temp slot for result as having
address taken.
* rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case.
* gcc.c (process_command): Add standard_exec_prefix with "GCC"
component as well as "BINUTILS".
* integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS.
* integrate.c (copy_rtx_and_substitute): Likewise.
(expand_inline_function, integrate_parm_decls, integrate_decl_tree):
All callers changed.
* unroll.c (inital_reg_note_copy, copy_loop_body): Likewise.
* dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use
gdb extensions, write size of type; also be more consistent
in using references when this is a subtype.
* pa.md (extv, extzv, insv): Use define_expand to reject constant
that is out of range.
* loop.c (unknown_constant_address_altered): New variable.
(prescan_loop): Initialize it.
(note_addr_stored): Set it for RTX_UNCHANGING_P MEM.
(invariant_p, case MEM): Remove handling for volatile and readony;
check new variable if readonly.
(check_dbra_loop): Chdeck unknown_constant_address_altered.
* cse.c (canon_hash, case MEM): Do not record if BLKmode.
(addr_affects_sp_p): Removed from note_mem_written and only
define #ifdef AUTO_INC_DEC.
* alpha.c (input_operand, case ADDRESSOF): Treat as REG.
* regclass.c (record_reg_classes): Properly handle register move
directions.
* varasm.c (initializer_constant_valid_p, case MINUS_EXPR):
Don't think valid if both operands are invalid.
(struct constant_descriptor): New field RTL.
(mark_const_hash_entry): Mark it.
(record_constant{,_rtx}): Initialize it.
(output_constant_def): Allocate RTL in permanent obstack and
save in table.
({record,compare}_constant_1): Modes must match for
CONSTRUCTOR of ARRAY_TYPE.
* c-common.h (initializer_constant_valid_p): Delete decl from here.
* output.h (initializer_constant_valid_p): Move decl to here.
* c-common.c (initializer_constant_valid_p): Delete function from here.
* varasm.c (initializer_constant_valid_p): Move function to here.
* tree.h (STRIP_SIGN_NOPS): New macro.
* fold-const.c (optimize_minmax_comparison): New function.
(invert_truthvalue, case WITH_RECORD_EXPR): New case.
(fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS.
(fold, case EQ_EXPR): Call optimize_minmax_comparison and add
cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and
widening conversions.
(fold, case LE_EXPR): Rework changing unsigned to signed comparisons
to look at size of mode, not precision of type; also add missing cases.
(optimize_bit_field_compare, decode_field_reference): Don't try to
optimize COMPONENT_REF of a PLACEHOLDER_EXPR.
* dwarf2out.c (ctype.h): Include.
(dwarf2out_set_demangle_name_func): New function.
(size_of_line_info): Deleted.
(output_line_info): Compute size of line info table from difference
of labels.
(base_type_die, add_name_attribute): Call demangle function, if any.
(field_byte_offset): Use bits per word for variable length fields.
(gen_array_type_die): Add array name.
(gen_subprogram_die): Ignore DECL_INLINE if -fno-inline.
(dwarf2out_add_library_unit_info): New function.
* explow.c (set_stack_check_libfunc): New function.
(stack_check_libfunc): New static variable.
(probe_stack_range): Allow front-end to set up a libfunc to call.
* combine.c (simplify_comparison): When making comparison in wider
mode, check for having commuted an AND and a SUBREG.
(contains_muldiv): New function.
(try_combine): Call it when dividing a PARALLEL.
(simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart.
(simplify_comparison, case ASHIFTRT): Recognize sign-extension of
a PLUS.
(record_value_for_reg): If TEM is a binary operation with two CLOBBERs,
use one of the CLOBBERs instead.
(if_then_else_cond): If comparing against zero, just return thing
being compared.
* optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x).
Don't generate shifts and subtract if have conditional arithmetic.
* rtl.h (delete_barrier): New declaration.
* jump.c (jump_optimize): Set up to handle conditional call.
In conditional arithmetic case, handle CALL_INSN followed by a BARRIER.
(delete_barrier): New function.
* rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode.
* recog.c (nonmemory_operand): Accept ADDRESSOF.
* tree.c (build_type_attribute_variant): Push to obstack of
ttype around type_hash_canon call.
* expr.c (placeholder_list): Move decl to file scope.
(expand_expr): Don't force access to volatile just because its
address is taken.
If ignoring reference operations, just expand the operands.
(expand_expr, case COMPONENT_REF): Propagate
EXPAND_CONST_ADDRESS to recursive call when expanding inner.
Refine test for using bitfield operations vs pointer punning.
(expand_expr, case CONVERT_EXPR): If converting to
BLKmode UNION_TYPE from BLKmode, just return inner object.
Use proper mode in store_field call.
Properly set sizes of object to store and total size in store_field
call for convert to union.
(expand_expr, case ARRAY_REF): If OP0 is in a register, put it in
memory (like for ADDR_EXPR). Also, don't put constant in register if
we'll want it in memory.
(readonly_fields_p): New function.
(expand_expr, case INDIRECT_REF): Call it if LHS.
(expand_assignment): Handle a RESULT_DECL where
DECL_RTL is a PARALLEL.
(do_jump, case WITH_RECORD_EXPR): New case.
(get_inner_reference): Always go inside a CONVERT_EXPR
and NOP_EXPR if both modes are the same.
(store_field): Use bitfield operations if size of bitsize is not same
as size of RHS's type.
Check for bitpos not a multiple of alignment in BLKmode case.
Do block move in largest possible alignment.
(store_constructor): Set BITSIZE to -1 for variable size and properly
in case of array of BLKmode.
(expand_expr_unaligned): New function.
(do_compare_and_jump): Call it.
* mips/iris5.h (SWITCHES_NEED_SPACES): New macro.
* collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES
does not include 'o'.
* function.c (instantiate_virtual_regs_1, case SET): Handle case where
both SET_DEST and SET_SRC reference a virtual register.
(gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG.
* integrate.c (expand_inline_function): Handle case of setting
virtual stack vars register (from built in setjmp); when parameter
lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early.
(subst_constant): Add new parm, MEMONLY.
(expand_inline_function, integrate_parm_decls): Pass new parm.
(integrate_decl_tree): Likewise.
(copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P.
(try_constants): Call subst_constants twice, with MEMONLY 0 and 1.
(copy_rtx_and_substitute, case SET): Add explicit calls to
copy_rtx_and_substitute for both sides.
* stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for
constraints.
(pushcase{,_range}): Convert to NOMINAL_TYPE after checking for
within INDEX_TYPE, instead of before.
(fixup_gotos): Use f->target_rtl, not the next insn,
since latter may be from a later fixup.
(expand_value_return): Correctly convert VAL when promoting function
return; support RETURN_REG being a PARALLEL.
(expand_return): When checking for result in regs and having
cleanup, consider PARALLEL in DECL_RTL as being in regs.
From-SVN: r30299
1999-11-01 02:11:22 +01:00
|
|
|
|
/* If we have an ADDRESSOF, consider it valid since it will be
|
2001-08-13 01:40:53 +02:00
|
|
|
|
converted into something that will not be a MEM. */
|
[multiple changes]
Fri Oct 29 15:25:07 1999 Arnaud Charlet <charlet@ACT-Europe.FR>
* gcov.c (DIR_SEPARATOR): Provide default.
(output_data): Add test for MS-DOS format absolute filename.
(fancy_abort): Correct program name.
(open_files): Open all files in binary mode.
* libgcc2.c (__bb_exit_func): Likewise.
* profile.c (init_branch_prob): Specify binary when opening files.
* flags.h (flag_unwind_tables): New decl.
* toplev.c (flag_unwind_table): New definition.
(f_options): Add -funwind-tables.
(decode_g_option): Clarify warning when unknown -g option is given.
(rest_of_compilation): If inside an inlined external function,
pretend we are just being declared.
* dwarf2out.c (dwarf2out_do_frame): Check -funwind_tables.
(dwarf2out_frame_finish): Likewise.
Fri Oct 29 06:32:44 1999 Geoffrey Keating <geoffk@cygnus.com>
* flow.c (propagate_block): When the last reference to a label
before an ADDR_VEC is deleted because the reference is a dead
store, delete the ADDR_VEC.
Fri Oct 29 07:44:26 1999 Vasco Pedro <vp@di.fct.unl.pt>
* fold-const.c (merge_ranges): In not in0, but in1, handle
upper bounds equal like subset case.
Thu Oct 28 19:22:24 1999 Douglas Rupp <rupp@gnat.com>
* dbxout.c (dbxout_parms): Generate a second stabs line for parameters
passed in a register but moved to the stack.
Thu Oct 28 19:12:57 1999 Sam Tardieu <tardieu@act-europe.fr>
* gcc.c (pass_exit_codes, greatest_status): New variables.
(struct option_map): Add entry for "--pass-exit-codes".
(execute): Update greatest_status if error.
(display_help): Add documentation for -pass-exit-codes.
(process_command): Handle -pass-exit-codes.
(main): Look at pass_exit_codes and greatest_status on call to exit.
Thu Oct 28 18:06:50 1999 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* reload.c (find_reloads): Refine test for no input reload
case to not includes reloads emitted after insn.
* function.c (find_temp_slots_from_address): Handle sum involving
a register that points to a temp slot.
(update_temp_slot_address): Make recursive call if both old and
new are PLUS with a common operand.
* calls.c (expand_call): Mark temp slot for result as having
address taken.
* rtlanal.c (reg_referenced_p, case IF_THEN_ELSE): New case.
* gcc.c (process_command): Add standard_exec_prefix with "GCC"
component as well as "BINUTILS".
* integrate.h (copy_rtx_and_substitute): New arg, FOR_LHS.
* integrate.c (copy_rtx_and_substitute): Likewise.
(expand_inline_function, integrate_parm_decls, integrate_decl_tree):
All callers changed.
* unroll.c (inital_reg_note_copy, copy_loop_body): Likewise.
* dbxout.c (dbxout_type, case INTEGER_TYPE_NODE): If can use
gdb extensions, write size of type; also be more consistent
in using references when this is a subtype.
* pa.md (extv, extzv, insv): Use define_expand to reject constant
that is out of range.
* loop.c (unknown_constant_address_altered): New variable.
(prescan_loop): Initialize it.
(note_addr_stored): Set it for RTX_UNCHANGING_P MEM.
(invariant_p, case MEM): Remove handling for volatile and readony;
check new variable if readonly.
(check_dbra_loop): Chdeck unknown_constant_address_altered.
* cse.c (canon_hash, case MEM): Do not record if BLKmode.
(addr_affects_sp_p): Removed from note_mem_written and only
define #ifdef AUTO_INC_DEC.
* alpha.c (input_operand, case ADDRESSOF): Treat as REG.
* regclass.c (record_reg_classes): Properly handle register move
directions.
* varasm.c (initializer_constant_valid_p, case MINUS_EXPR):
Don't think valid if both operands are invalid.
(struct constant_descriptor): New field RTL.
(mark_const_hash_entry): Mark it.
(record_constant{,_rtx}): Initialize it.
(output_constant_def): Allocate RTL in permanent obstack and
save in table.
({record,compare}_constant_1): Modes must match for
CONSTRUCTOR of ARRAY_TYPE.
* c-common.h (initializer_constant_valid_p): Delete decl from here.
* output.h (initializer_constant_valid_p): Move decl to here.
* c-common.c (initializer_constant_valid_p): Delete function from here.
* varasm.c (initializer_constant_valid_p): Move function to here.
* tree.h (STRIP_SIGN_NOPS): New macro.
* fold-const.c (optimize_minmax_comparison): New function.
(invert_truthvalue, case WITH_RECORD_EXPR): New case.
(fold): Use STRIP_SIGN_NOPS instead of STRIP_TYPE_NOPS.
(fold, case EQ_EXPR): Call optimize_minmax_comparison and add
cases with ABS_EXPR, NEGATE_EXPR, PLUS_EXPR, MINUS_EXPR, and
widening conversions.
(fold, case LE_EXPR): Rework changing unsigned to signed comparisons
to look at size of mode, not precision of type; also add missing cases.
(optimize_bit_field_compare, decode_field_reference): Don't try to
optimize COMPONENT_REF of a PLACEHOLDER_EXPR.
* dwarf2out.c (ctype.h): Include.
(dwarf2out_set_demangle_name_func): New function.
(size_of_line_info): Deleted.
(output_line_info): Compute size of line info table from difference
of labels.
(base_type_die, add_name_attribute): Call demangle function, if any.
(field_byte_offset): Use bits per word for variable length fields.
(gen_array_type_die): Add array name.
(gen_subprogram_die): Ignore DECL_INLINE if -fno-inline.
(dwarf2out_add_library_unit_info): New function.
* explow.c (set_stack_check_libfunc): New function.
(stack_check_libfunc): New static variable.
(probe_stack_range): Allow front-end to set up a libfunc to call.
* combine.c (simplify_comparison): When making comparison in wider
mode, check for having commuted an AND and a SUBREG.
(contains_muldiv): New function.
(try_combine): Call it when dividing a PARALLEL.
(simplify_rtx, case TRUNCATE): Don't remove for umulsi3_highpart.
(simplify_comparison, case ASHIFTRT): Recognize sign-extension of
a PLUS.
(record_value_for_reg): If TEM is a binary operation with two CLOBBERs,
use one of the CLOBBERs instead.
(if_then_else_cond): If comparing against zero, just return thing
being compared.
* optabs.c (expand_abs): If machine has MAX, ABS (x) is MAX (x, -x).
Don't generate shifts and subtract if have conditional arithmetic.
* rtl.h (delete_barrier): New declaration.
* jump.c (jump_optimize): Set up to handle conditional call.
In conditional arithmetic case, handle CALL_INSN followed by a BARRIER.
(delete_barrier): New function.
* rtl.c (read_rtx): Call fatal if bad RTL code; check for bad mode.
* recog.c (nonmemory_operand): Accept ADDRESSOF.
* tree.c (build_type_attribute_variant): Push to obstack of
ttype around type_hash_canon call.
* expr.c (placeholder_list): Move decl to file scope.
(expand_expr): Don't force access to volatile just because its
address is taken.
If ignoring reference operations, just expand the operands.
(expand_expr, case COMPONENT_REF): Propagate
EXPAND_CONST_ADDRESS to recursive call when expanding inner.
Refine test for using bitfield operations vs pointer punning.
(expand_expr, case CONVERT_EXPR): If converting to
BLKmode UNION_TYPE from BLKmode, just return inner object.
Use proper mode in store_field call.
Properly set sizes of object to store and total size in store_field
call for convert to union.
(expand_expr, case ARRAY_REF): If OP0 is in a register, put it in
memory (like for ADDR_EXPR). Also, don't put constant in register if
we'll want it in memory.
(readonly_fields_p): New function.
(expand_expr, case INDIRECT_REF): Call it if LHS.
(expand_assignment): Handle a RESULT_DECL where
DECL_RTL is a PARALLEL.
(do_jump, case WITH_RECORD_EXPR): New case.
(get_inner_reference): Always go inside a CONVERT_EXPR
and NOP_EXPR if both modes are the same.
(store_field): Use bitfield operations if size of bitsize is not same
as size of RHS's type.
Check for bitpos not a multiple of alignment in BLKmode case.
Do block move in largest possible alignment.
(store_constructor): Set BITSIZE to -1 for variable size and properly
in case of array of BLKmode.
(expand_expr_unaligned): New function.
(do_compare_and_jump): Call it.
* mips/iris5.h (SWITCHES_NEED_SPACES): New macro.
* collect2.c (main): Only allow -ofoo if SWITCHES_NEED_SPACES
does not include 'o'.
* function.c (instantiate_virtual_regs_1, case SET): Handle case where
both SET_DEST and SET_SRC reference a virtual register.
(gen_mem_addressof): Copy RTX_UNCHANGING_P from new REG to old REG.
* integrate.c (expand_inline_function): Handle case of setting
virtual stack vars register (from built in setjmp); when parameter
lives in memory, expand virtual_{stack_vars,incoming_args}_rtx early.
(subst_constant): Add new parm, MEMONLY.
(expand_inline_function, integrate_parm_decls): Pass new parm.
(integrate_decl_tree): Likewise.
(copy_rtx_and_substitute, case MEM): Do copy RTX_UNCHANGING_P.
(try_constants): Call subst_constants twice, with MEMONLY 0 and 1.
(copy_rtx_and_substitute, case SET): Add explicit calls to
copy_rtx_and_substitute for both sides.
* stmt.c (expand_asm_operands): Don't use TREE_STRING_LENGTH for
constraints.
(pushcase{,_range}): Convert to NOMINAL_TYPE after checking for
within INDEX_TYPE, instead of before.
(fixup_gotos): Use f->target_rtl, not the next insn,
since latter may be from a later fixup.
(expand_value_return): Correctly convert VAL when promoting function
return; support RETURN_REG being a PARALLEL.
(expand_return): When checking for result in regs and having
cleanup, consider PARALLEL in DECL_RTL as being in regs.
From-SVN: r30299
1999-11-01 02:11:22 +01:00
|
|
|
|
if (GET_CODE (op) == ADDRESSOF)
|
|
|
|
|
return 1;
|
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
/* We don't consider registers whose class is NO_REGS
|
|
|
|
|
to be a register operand. */
|
|
|
|
|
return (GET_CODE (op) == REG
|
|
|
|
|
&& (REGNO (op) >= FIRST_PSEUDO_REGISTER
|
|
|
|
|
|| REGNO_REG_CLASS (REGNO (op)) != NO_REGS));
|
|
|
|
|
}
|
|
|
|
|
|
1999-10-15 03:52:29 +02:00
|
|
|
|
/* Return 1 for a register in Pmode; ignore the tested mode. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
pmode_register_operand (op, mode)
|
|
|
|
|
rtx op;
|
|
|
|
|
enum machine_mode mode ATTRIBUTE_UNUSED;
|
|
|
|
|
{
|
|
|
|
|
return register_operand (op, Pmode);
|
|
|
|
|
}
|
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
/* Return 1 if OP should match a MATCH_SCRATCH, i.e., if it is a SCRATCH
|
|
|
|
|
or a hard register. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
scratch_operand (op, mode)
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx op;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
1999-10-27 03:25:13 +02:00
|
|
|
|
if (GET_MODE (op) != mode && mode != VOIDmode)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return (GET_CODE (op) == SCRATCH
|
|
|
|
|
|| (GET_CODE (op) == REG
|
|
|
|
|
&& REGNO (op) < FIRST_PSEUDO_REGISTER));
|
1991-11-27 15:45:36 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 if OP is a valid immediate operand for mode MODE.
|
|
|
|
|
|
|
|
|
|
The main use of this function is as a predicate in match_operand
|
|
|
|
|
expressions in the machine description. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
immediate_operand (op, mode)
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx op;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
|
|
|
|
/* Don't accept CONST_INT or anything similar
|
|
|
|
|
if the caller wants something floating. */
|
|
|
|
|
if (GET_MODE (op) == VOIDmode && mode != VOIDmode
|
1992-10-11 21:27:23 +01:00
|
|
|
|
&& GET_MODE_CLASS (mode) != MODE_INT
|
|
|
|
|
&& GET_MODE_CLASS (mode) != MODE_PARTIAL_INT)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
return 0;
|
|
|
|
|
|
2001-04-12 07:25:55 +02:00
|
|
|
|
if (GET_CODE (op) == CONST_INT
|
|
|
|
|
&& trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op))
|
|
|
|
|
return 0;
|
|
|
|
|
|
1999-01-21 03:21:28 +01:00
|
|
|
|
/* Accept CONSTANT_P_RTX, since it will be gone by CSE1 and
|
|
|
|
|
result in 0/1. It seems a safe assumption that this is
|
|
|
|
|
in range for everyone. */
|
|
|
|
|
if (GET_CODE (op) == CONSTANT_P_RTX)
|
|
|
|
|
return 1;
|
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
return (CONSTANT_P (op)
|
|
|
|
|
&& (GET_MODE (op) == mode || mode == VOIDmode
|
|
|
|
|
|| GET_MODE (op) == VOIDmode)
|
|
|
|
|
#ifdef LEGITIMATE_PIC_OPERAND_P
|
|
|
|
|
&& (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op))
|
|
|
|
|
#endif
|
|
|
|
|
&& LEGITIMATE_CONSTANT_P (op));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Returns 1 if OP is an operand that is a CONST_INT. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
const_int_operand (op, mode)
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx op;
|
2001-05-22 08:46:20 +02:00
|
|
|
|
enum machine_mode mode;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
{
|
2001-05-22 08:46:20 +02:00
|
|
|
|
if (GET_CODE (op) != CONST_INT)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (mode != VOIDmode
|
|
|
|
|
&& trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op))
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return 1;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Returns 1 if OP is an operand that is a constant integer or constant
|
|
|
|
|
floating-point number. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
const_double_operand (op, mode)
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx op;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
|
|
|
|
/* Don't accept CONST_INT or anything similar
|
|
|
|
|
if the caller wants something floating. */
|
|
|
|
|
if (GET_MODE (op) == VOIDmode && mode != VOIDmode
|
1992-10-11 21:27:23 +01:00
|
|
|
|
&& GET_MODE_CLASS (mode) != MODE_INT
|
|
|
|
|
&& GET_MODE_CLASS (mode) != MODE_PARTIAL_INT)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return ((GET_CODE (op) == CONST_DOUBLE || GET_CODE (op) == CONST_INT)
|
|
|
|
|
&& (mode == VOIDmode || GET_MODE (op) == mode
|
|
|
|
|
|| GET_MODE (op) == VOIDmode));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 if OP is a general operand that is not an immediate operand. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
nonimmediate_operand (op, mode)
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx op;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
|
|
|
|
return (general_operand (op, mode) && ! CONSTANT_P (op));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 if OP is a register reference or immediate value of mode MODE. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
nonmemory_operand (op, mode)
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx op;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
|
|
|
|
if (CONSTANT_P (op))
|
|
|
|
|
{
|
|
|
|
|
/* Don't accept CONST_INT or anything similar
|
|
|
|
|
if the caller wants something floating. */
|
|
|
|
|
if (GET_MODE (op) == VOIDmode && mode != VOIDmode
|
1992-10-11 21:27:23 +01:00
|
|
|
|
&& GET_MODE_CLASS (mode) != MODE_INT
|
|
|
|
|
&& GET_MODE_CLASS (mode) != MODE_PARTIAL_INT)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
return 0;
|
|
|
|
|
|
2001-04-12 07:25:55 +02:00
|
|
|
|
if (GET_CODE (op) == CONST_INT
|
|
|
|
|
&& trunc_int_for_mode (INTVAL (op), mode) != INTVAL (op))
|
|
|
|
|
return 0;
|
|
|
|
|
|
2000-07-30 20:53:33 +02:00
|
|
|
|
return ((GET_MODE (op) == VOIDmode || GET_MODE (op) == mode
|
2001-10-16 06:19:26 +02:00
|
|
|
|
|| mode == VOIDmode)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
#ifdef LEGITIMATE_PIC_OPERAND_P
|
|
|
|
|
&& (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op))
|
|
|
|
|
#endif
|
|
|
|
|
&& LEGITIMATE_CONSTANT_P (op));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (GET_MODE (op) != mode && mode != VOIDmode)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (op) == SUBREG)
|
|
|
|
|
{
|
|
|
|
|
/* Before reload, we can allow (SUBREG (MEM...)) as a register operand
|
|
|
|
|
because it is guaranteed to be reloaded into one.
|
|
|
|
|
Just make sure the MEM is valid in itself.
|
|
|
|
|
(Ideally, (SUBREG (MEM)...) should not exist after reload,
|
|
|
|
|
but currently it does result from (SUBREG (REG)...) where the
|
|
|
|
|
reg went on the stack.) */
|
|
|
|
|
if (! reload_completed && GET_CODE (SUBREG_REG (op)) == MEM)
|
|
|
|
|
return general_operand (op, mode);
|
|
|
|
|
op = SUBREG_REG (op);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* We don't consider registers whose class is NO_REGS
|
|
|
|
|
to be a register operand. */
|
|
|
|
|
return (GET_CODE (op) == REG
|
|
|
|
|
&& (REGNO (op) >= FIRST_PSEUDO_REGISTER
|
|
|
|
|
|| REGNO_REG_CLASS (REGNO (op)) != NO_REGS));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 if OP is a valid operand that stands for pushing a
|
|
|
|
|
value of mode MODE onto the stack.
|
|
|
|
|
|
|
|
|
|
The main use of this function is as a predicate in match_operand
|
|
|
|
|
expressions in the machine description. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
push_operand (op, mode)
|
|
|
|
|
rtx op;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
2001-03-21 20:49:54 +01:00
|
|
|
|
unsigned int rounded_size = GET_MODE_SIZE (mode);
|
|
|
|
|
|
|
|
|
|
#ifdef PUSH_ROUNDING
|
|
|
|
|
rounded_size = PUSH_ROUNDING (rounded_size);
|
|
|
|
|
#endif
|
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
if (GET_CODE (op) != MEM)
|
|
|
|
|
return 0;
|
|
|
|
|
|
1999-03-07 03:45:29 +01:00
|
|
|
|
if (mode != VOIDmode && GET_MODE (op) != mode)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
op = XEXP (op, 0);
|
|
|
|
|
|
2001-03-21 20:49:54 +01:00
|
|
|
|
if (rounded_size == GET_MODE_SIZE (mode))
|
2001-03-21 18:54:00 +01:00
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (op) != STACK_PUSH_CODE)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (op) != PRE_MODIFY
|
|
|
|
|
|| GET_CODE (XEXP (op, 1)) != PLUS
|
|
|
|
|
|| XEXP (XEXP (op, 1), 0) != XEXP (op, 0)
|
|
|
|
|
|| GET_CODE (XEXP (XEXP (op, 1), 1)) != CONST_INT
|
|
|
|
|
#ifdef STACK_GROWS_DOWNWARD
|
2001-03-21 20:49:54 +01:00
|
|
|
|
|| INTVAL (XEXP (XEXP (op, 1), 1)) != - (int) rounded_size
|
2001-03-21 18:54:00 +01:00
|
|
|
|
#else
|
|
|
|
|
|| INTVAL (XEXP (XEXP (op, 1), 1)) != rounded_size
|
|
|
|
|
#endif
|
|
|
|
|
)
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
return XEXP (op, 0) == stack_pointer_rtx;
|
|
|
|
|
}
|
|
|
|
|
|
1999-01-19 22:55:35 +01:00
|
|
|
|
/* Return 1 if OP is a valid operand that stands for popping a
|
|
|
|
|
value of mode MODE off the stack.
|
|
|
|
|
|
|
|
|
|
The main use of this function is as a predicate in match_operand
|
|
|
|
|
expressions in the machine description. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
pop_operand (op, mode)
|
|
|
|
|
rtx op;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (op) != MEM)
|
|
|
|
|
return 0;
|
|
|
|
|
|
1999-03-07 03:45:29 +01:00
|
|
|
|
if (mode != VOIDmode && GET_MODE (op) != mode)
|
1999-01-19 22:55:35 +01:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
op = XEXP (op, 0);
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (op) != STACK_POP_CODE)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
return XEXP (op, 0) == stack_pointer_rtx;
|
|
|
|
|
}
|
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
/* Return 1 if ADDR is a valid memory address for mode MODE. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
memory_address_p (mode, addr)
|
2000-01-13 01:17:33 +01:00
|
|
|
|
enum machine_mode mode ATTRIBUTE_UNUSED;
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx addr;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
{
|
alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO...
* alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO;
change gen_rtx(expr...) to gen_rtx_fmt_foo(expr...).
* caller-save.c, calls.c, combine.c, cse.c: Likewise.
* dwarf2out.c, except.c, explow.c, expmed.c, expr.c: Likewise.
* final.c, flow.c, function.c, genpeep.c, haifa-sched.c: Likewise.
* halfpic.c, integrate.c, jump.c, local-alloc.c, loop.c: Likewise.
* profile.c, recog.c, reg-stack.c, regclass.c, regmove.c: Likewise.
* reload.c, reload1.c, reorg.c, sched.c, stmt.c, stupid.c: Likewise.
* unroll.c, varasm.c: Likewise.
* config/alpha/alpha.c, config/alpha/alpha.md: Likewise.
From-SVN: r17357
1998-01-15 00:10:50 +01:00
|
|
|
|
if (GET_CODE (addr) == ADDRESSOF)
|
|
|
|
|
return 1;
|
2002-05-09 03:42:28 +02:00
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
GO_IF_LEGITIMATE_ADDRESS (mode, addr, win);
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
win:
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 if OP is a valid memory reference with mode MODE,
|
|
|
|
|
including a valid address.
|
|
|
|
|
|
|
|
|
|
The main use of this function is as a predicate in match_operand
|
|
|
|
|
expressions in the machine description. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
memory_operand (op, mode)
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx op;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
|
|
|
|
rtx inner;
|
|
|
|
|
|
|
|
|
|
if (! reload_completed)
|
|
|
|
|
/* Note that no SUBREG is a memory operand before end of reload pass,
|
|
|
|
|
because (SUBREG (MEM...)) forces reloading into a register. */
|
|
|
|
|
return GET_CODE (op) == MEM && general_operand (op, mode);
|
|
|
|
|
|
|
|
|
|
if (mode != VOIDmode && GET_MODE (op) != mode)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
inner = op;
|
|
|
|
|
if (GET_CODE (inner) == SUBREG)
|
|
|
|
|
inner = SUBREG_REG (inner);
|
|
|
|
|
|
|
|
|
|
return (GET_CODE (inner) == MEM && general_operand (op, mode));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 if OP is a valid indirect memory reference with mode MODE;
|
|
|
|
|
that is, a memory reference whose address is a general_operand. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
indirect_operand (op, mode)
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx op;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
|
|
|
|
/* Before reload, a SUBREG isn't in memory (see memory_operand, above). */
|
|
|
|
|
if (! reload_completed
|
|
|
|
|
&& GET_CODE (op) == SUBREG && GET_CODE (SUBREG_REG (op)) == MEM)
|
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
int offset = SUBREG_BYTE (op);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
rtx inner = SUBREG_REG (op);
|
|
|
|
|
|
1993-12-12 14:01:09 +01:00
|
|
|
|
if (mode != VOIDmode && GET_MODE (op) != mode)
|
|
|
|
|
return 0;
|
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
/* The only way that we can have a general_operand as the resulting
|
|
|
|
|
address is if OFFSET is zero and the address already is an operand
|
|
|
|
|
or if the address is (plus Y (const_int -OFFSET)) and Y is an
|
|
|
|
|
operand. */
|
|
|
|
|
|
|
|
|
|
return ((offset == 0 && general_operand (XEXP (inner, 0), Pmode))
|
|
|
|
|
|| (GET_CODE (XEXP (inner, 0)) == PLUS
|
|
|
|
|
&& GET_CODE (XEXP (XEXP (inner, 0), 1)) == CONST_INT
|
|
|
|
|
&& INTVAL (XEXP (XEXP (inner, 0), 1)) == -offset
|
|
|
|
|
&& general_operand (XEXP (XEXP (inner, 0), 0), Pmode)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (GET_CODE (op) == MEM
|
|
|
|
|
&& memory_operand (op, mode)
|
|
|
|
|
&& general_operand (XEXP (op, 0), Pmode));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 if this is a comparison operator. This allows the use of
|
|
|
|
|
MATCH_OPERATOR to recognize all the branch insns. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
comparison_operator (op, mode)
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx op;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
|
|
|
|
return ((mode == VOIDmode || GET_MODE (op) == mode)
|
|
|
|
|
&& GET_RTX_CLASS (GET_CODE (op)) == '<');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If BODY is an insn body that uses ASM_OPERANDS,
|
|
|
|
|
return the number of operands (both input and output) in the insn.
|
|
|
|
|
Otherwise return -1. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
asm_noperands (body)
|
|
|
|
|
rtx body;
|
|
|
|
|
{
|
2000-09-29 13:40:24 +02:00
|
|
|
|
switch (GET_CODE (body))
|
1991-11-27 15:45:36 +01:00
|
|
|
|
{
|
2000-09-29 13:40:24 +02:00
|
|
|
|
case ASM_OPERANDS:
|
|
|
|
|
/* No output operands: return number of input operands. */
|
|
|
|
|
return ASM_OPERANDS_INPUT_LENGTH (body);
|
|
|
|
|
case SET:
|
|
|
|
|
if (GET_CODE (SET_SRC (body)) == ASM_OPERANDS)
|
|
|
|
|
/* Single output operand: BODY is (set OUTPUT (asm_operands ...)). */
|
|
|
|
|
return ASM_OPERANDS_INPUT_LENGTH (SET_SRC (body)) + 1;
|
|
|
|
|
else
|
|
|
|
|
return -1;
|
|
|
|
|
case PARALLEL:
|
|
|
|
|
if (GET_CODE (XVECEXP (body, 0, 0)) == SET
|
|
|
|
|
&& GET_CODE (SET_SRC (XVECEXP (body, 0, 0))) == ASM_OPERANDS)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
{
|
2000-09-29 13:40:24 +02:00
|
|
|
|
/* Multiple output operands, or 1 output plus some clobbers:
|
|
|
|
|
body is [(set OUTPUT (asm_operands ...))... (clobber (reg ...))...]. */
|
|
|
|
|
int i;
|
|
|
|
|
int n_sets;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
2000-09-29 13:40:24 +02:00
|
|
|
|
/* Count backwards through CLOBBERs to determine number of SETs. */
|
|
|
|
|
for (i = XVECLEN (body, 0); i > 0; i--)
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (XVECEXP (body, 0, i - 1)) == SET)
|
|
|
|
|
break;
|
|
|
|
|
if (GET_CODE (XVECEXP (body, 0, i - 1)) != CLOBBER)
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
2000-09-29 13:40:24 +02:00
|
|
|
|
/* N_SETS is now number of output operands. */
|
|
|
|
|
n_sets = i;
|
|
|
|
|
|
|
|
|
|
/* Verify that all the SETs we have
|
|
|
|
|
came from a single original asm_operands insn
|
|
|
|
|
(so that invalid combinations are blocked). */
|
|
|
|
|
for (i = 0; i < n_sets; i++)
|
|
|
|
|
{
|
|
|
|
|
rtx elt = XVECEXP (body, 0, i);
|
|
|
|
|
if (GET_CODE (elt) != SET)
|
|
|
|
|
return -1;
|
|
|
|
|
if (GET_CODE (SET_SRC (elt)) != ASM_OPERANDS)
|
|
|
|
|
return -1;
|
|
|
|
|
/* If these ASM_OPERANDS rtx's came from different original insns
|
|
|
|
|
then they aren't allowed together. */
|
|
|
|
|
if (ASM_OPERANDS_INPUT_VEC (SET_SRC (elt))
|
|
|
|
|
!= ASM_OPERANDS_INPUT_VEC (SET_SRC (XVECEXP (body, 0, 0))))
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
return (ASM_OPERANDS_INPUT_LENGTH (SET_SRC (XVECEXP (body, 0, 0)))
|
|
|
|
|
+ n_sets);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
}
|
2000-09-29 13:40:24 +02:00
|
|
|
|
else if (GET_CODE (XVECEXP (body, 0, 0)) == ASM_OPERANDS)
|
|
|
|
|
{
|
|
|
|
|
/* 0 outputs, but some clobbers:
|
|
|
|
|
body is [(asm_operands ...) (clobber (reg ...))...]. */
|
|
|
|
|
int i;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
2000-09-29 13:40:24 +02:00
|
|
|
|
/* Make sure all the other parallel things really are clobbers. */
|
|
|
|
|
for (i = XVECLEN (body, 0) - 1; i > 0; i--)
|
|
|
|
|
if (GET_CODE (XVECEXP (body, 0, i)) != CLOBBER)
|
|
|
|
|
return -1;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
2000-09-29 13:40:24 +02:00
|
|
|
|
return ASM_OPERANDS_INPUT_LENGTH (XVECEXP (body, 0, 0));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
return -1;
|
|
|
|
|
default:
|
|
|
|
|
return -1;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Assuming BODY is an insn body that uses ASM_OPERANDS,
|
|
|
|
|
copy its operands (both input and output) into the vector OPERANDS,
|
|
|
|
|
the locations of the operands within the insn into the vector OPERAND_LOCS,
|
|
|
|
|
and the constraints for the operands into CONSTRAINTS.
|
|
|
|
|
Write the modes of the operands into MODES.
|
|
|
|
|
Return the assembler-template.
|
|
|
|
|
|
|
|
|
|
If MODES, OPERAND_LOCS, CONSTRAINTS or OPERANDS is 0,
|
|
|
|
|
we don't store that info. */
|
|
|
|
|
|
rtl.h (rtunion_def): Constify member `rtstr'.
* rtl.h (rtunion_def): Constify member `rtstr'.
(emit_line_note_after, emit_line_note, emit_line_note_force,
emit_note, decode_asm_operands): Constify.
* cse.c (canon_hash): Likewise.
* dbxout.c (dbxout_block): Likewise.
* diagnostic.c (file_and_line_for_asm, v_error_for_asm,
v_warning_for_asm): Likewise.
* dwarfout.c (function_start_label): Likewise.
* emit-rtl.c (emit_line_note_after, emit_line_note, emit_note,
emit_line_note_force): Likewise.
* final.c (last_filename, asm_insn_count, final_scan_insn,
output_source_line): Likewise.
* function.h (struct emit_status): Likewise.
* gcse.c (hash_expr_1): Likewise.
* genattr.c (gen_attr, main): Likewise.
* genattrtab.c (struct function_unit, current_alternative_string,
write_attr_valueq, n_comma_elts, next_comma_elt, attr_eq,
attr_numeral, check_attr_test, check_attr_value,
convert_set_attr_alternative, convert_set_attr,
compute_alternative_mask, simplify_by_exploding, gen_attr,
gen_unit): Likewise.
* genflags.c (gen_insn): Likewise.
* gengenrtl.c (type_from_format): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (n_occurrences, process_template, process_template):
Likewise.
* ggc-page.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc-simple.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc.h (ggc_mark_string, ggc_mark, ggc_mark_if_gcable,
ggc_set_mark, ggc_get_size): Likewise.
* objc/objc-act.c (build_module_descriptor, finish_objc): Likewise.
* optabs.c (init_one_libfunc): Likewise.
* output.h (assemble_start_function): Likewise.
* recog.c (decode_asm_operands): Likewise.
* toplev.c (rest_of_compilation): Likewise.
* tree.h (emit_line_note_after, emit_line_note,
emit_line_note_force): Likewise.
* varasm.c (asm_output_bss, asm_output_aligned_bss,
asm_emit_uninitialised, assemble_start_function,
assemble_variable, const_hash, compare_constant_1,
find_pool_constant, mark_constant_pool, assemble_alias): Likewise.
* xcoffout.h (DBX_FINISH_SYMBOL): Likewise.
* alpha/alpha.md (call_vms, call_value_vms): Likewise.
* arm/aof.h (ASM_OUTPUT_ASCII): Likewise.
* arm/aout.h (ASM_OUTPUT_ASCII): Likewise.
* arm/arm-protos.h (output_ascii_pseudo_op, arm_dllexport_name_p,
arm_dllimport_name_p): Likewise.
* arm/arm.c (arm_encode_call_attribute, output_ascii_pseudo_op):
Likewise.
* arm/arm.h (ASM_OUTPUT_MI_THUNK): Likewise.
* arm/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/pe.c (arm_dllexport_name_p, arm_dllimport_name_p,
arm_mark_dllexport, arm_mark_dllimport,
arm_pe_encode_section_info): Likewise.
* arm/telf.h (ASM_OUTPUT_DEF_FROM_DECLS,
ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/thumb.c (thumb_function_prologue): Likewise.
* arm/thumb.h (ASM_OUTPUT_ASCII): Likewise.
* avr/avr.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* clipper/clix.h (ASM_OUTPUT_ASCII): Likewise.
* fx80/fx80.h (ASM_OUTPUT_ASCII): Likewise.
* i386/cygwin.h (ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/freebsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/i386-interix.h (ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII, ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/i386-protos.h (asm_output_function_prefix): Likewise.
* i386/i386.c (asm_output_function_prefix): Likewise.
* i386/i386elf.h (ASM_OUTPUT_ASCII): Likewise.
* i386/osfrose.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/ptx4-i.h (ASM_OUTPUT_ASCII): Likewise.
* i386/sco5.h (ASM_FINISH_DECLARE_OBJECT,
ASM_OUTPUT_LIMITED_STRING, ASM_OUTPUT_ASCII,
ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/sysv4.h (ASM_OUTPUT_ASCII): Likewise.
* i860/paragon.h (ASM_OUTPUT_ASCII): Likewise.
* i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise.
* m32r/m32r.c (m32r_encode_section_info): Likewise.
* mcore-elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mcore/mcore.c (mcore_encode_section_info): Likewise.
* mips/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/elf64.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/iris6.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/mips.h (ASM_OUTPUT_IDENT): Likewise.
* mips/mips.md (movdi, movsi): Likewise.
* mips/netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* openbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* ptx4.h (ASM_FINISH_DECLARE_OBJECT, ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII): Likewise.
* rs6000/rs6000.c (rs6000_allocate_stack_space, output_epilog,
output_mi_thunk, output_toc): Likewise.
* rs6000/rs6000.md (movsi): Likewise.
* rs6000/sysv4.h (ASM_OUTPUT_INT, ASM_OUTPUT_SECTION_NAME): Likewise.
* tahoe/harris.h (ASM_OUTPUT_ASCII): Likewise.
* v850/v850.c (print_operand, print_operand_address,
v850_encode_data_area): Likewise.
ch:
* grant.c (globalize_decl): Constify a char*.
cp:
* decl2.c (finish_objects): Constify a char*.
* method.c (emit_thunk): Likewise.
From-SVN: r32388
2000-03-07 21:39:10 +01:00
|
|
|
|
const char *
|
1991-11-27 15:45:36 +01:00
|
|
|
|
decode_asm_operands (body, operands, operand_locs, constraints, modes)
|
|
|
|
|
rtx body;
|
|
|
|
|
rtx *operands;
|
|
|
|
|
rtx **operand_locs;
|
final.c (bb_str): Qualify a char* with the keyword `const'.
* final.c (bb_str): Qualify a char* with the keyword `const'.
(add_bb_string, final_scan_insn, output_asm_insn): Likewise.
* fix-header.c (read_scan_file): Likewise.
* genoutput.c (output_epilogue, process_template): Likewise.
* local-alloc.c (requires_inout, block_alloc): Likewise.
* output.h (output_asm_insn, assemble_string): Likewise.
* recog.c (recog_constraints, check_asm_operands,
decode_asm_operands, extract_insn, preprocess_constraints,
constrain_operands): Likewise.
* recog.h (operand_alternative, recog_constraints, insn_template,
insn_outfun, insn_operand_constraint, insn_name): Likewise.
* regclass.c (record_reg_classes, scan_one_insn): Likewise.
* regmove.c (find_matches): Likewise.
* reload.c (alternative_allows_memconst): Likewise.
* reload1.c (constraint_accepts_reg_p,
reload_cse_simplify_operands): Likewise.
* rtl.h (decode_asm_operands): Likewise.
* scan.h (fn_decl): Likewise.
* varasm.c (assemble_string): Likewise.
From-SVN: r24834
1999-01-23 20:45:50 +01:00
|
|
|
|
const char **constraints;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
enum machine_mode *modes;
|
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
int i;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
int noperands;
|
rtl.h (rtunion_def): Constify member `rtstr'.
* rtl.h (rtunion_def): Constify member `rtstr'.
(emit_line_note_after, emit_line_note, emit_line_note_force,
emit_note, decode_asm_operands): Constify.
* cse.c (canon_hash): Likewise.
* dbxout.c (dbxout_block): Likewise.
* diagnostic.c (file_and_line_for_asm, v_error_for_asm,
v_warning_for_asm): Likewise.
* dwarfout.c (function_start_label): Likewise.
* emit-rtl.c (emit_line_note_after, emit_line_note, emit_note,
emit_line_note_force): Likewise.
* final.c (last_filename, asm_insn_count, final_scan_insn,
output_source_line): Likewise.
* function.h (struct emit_status): Likewise.
* gcse.c (hash_expr_1): Likewise.
* genattr.c (gen_attr, main): Likewise.
* genattrtab.c (struct function_unit, current_alternative_string,
write_attr_valueq, n_comma_elts, next_comma_elt, attr_eq,
attr_numeral, check_attr_test, check_attr_value,
convert_set_attr_alternative, convert_set_attr,
compute_alternative_mask, simplify_by_exploding, gen_attr,
gen_unit): Likewise.
* genflags.c (gen_insn): Likewise.
* gengenrtl.c (type_from_format): Likewise.
* genopinit.c (gen_insn): Likewise.
* genoutput.c (n_occurrences, process_template, process_template):
Likewise.
* ggc-page.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc-simple.c (ggc_set_mark, ggc_mark_if_gcable, ggc_get_size):
Likewise.
* ggc.h (ggc_mark_string, ggc_mark, ggc_mark_if_gcable,
ggc_set_mark, ggc_get_size): Likewise.
* objc/objc-act.c (build_module_descriptor, finish_objc): Likewise.
* optabs.c (init_one_libfunc): Likewise.
* output.h (assemble_start_function): Likewise.
* recog.c (decode_asm_operands): Likewise.
* toplev.c (rest_of_compilation): Likewise.
* tree.h (emit_line_note_after, emit_line_note,
emit_line_note_force): Likewise.
* varasm.c (asm_output_bss, asm_output_aligned_bss,
asm_emit_uninitialised, assemble_start_function,
assemble_variable, const_hash, compare_constant_1,
find_pool_constant, mark_constant_pool, assemble_alias): Likewise.
* xcoffout.h (DBX_FINISH_SYMBOL): Likewise.
* alpha/alpha.md (call_vms, call_value_vms): Likewise.
* arm/aof.h (ASM_OUTPUT_ASCII): Likewise.
* arm/aout.h (ASM_OUTPUT_ASCII): Likewise.
* arm/arm-protos.h (output_ascii_pseudo_op, arm_dllexport_name_p,
arm_dllimport_name_p): Likewise.
* arm/arm.c (arm_encode_call_attribute, output_ascii_pseudo_op):
Likewise.
* arm/arm.h (ASM_OUTPUT_MI_THUNK): Likewise.
* arm/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/pe.c (arm_dllexport_name_p, arm_dllimport_name_p,
arm_mark_dllexport, arm_mark_dllimport,
arm_pe_encode_section_info): Likewise.
* arm/telf.h (ASM_OUTPUT_DEF_FROM_DECLS,
ASM_FINISH_DECLARE_OBJECT): Likewise.
* arm/thumb.c (thumb_function_prologue): Likewise.
* arm/thumb.h (ASM_OUTPUT_ASCII): Likewise.
* avr/avr.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* clipper/clix.h (ASM_OUTPUT_ASCII): Likewise.
* fx80/fx80.h (ASM_OUTPUT_ASCII): Likewise.
* i386/cygwin.h (ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/freebsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/i386-interix.h (ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII, ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/i386-protos.h (asm_output_function_prefix): Likewise.
* i386/i386.c (asm_output_function_prefix): Likewise.
* i386/i386elf.h (ASM_OUTPUT_ASCII): Likewise.
* i386/osfrose.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* i386/ptx4-i.h (ASM_OUTPUT_ASCII): Likewise.
* i386/sco5.h (ASM_FINISH_DECLARE_OBJECT,
ASM_OUTPUT_LIMITED_STRING, ASM_OUTPUT_ASCII,
ASM_OUTPUT_SECTION_NAME): Likewise.
* i386/sysv4.h (ASM_OUTPUT_ASCII): Likewise.
* i860/paragon.h (ASM_OUTPUT_ASCII): Likewise.
* i860/sysv3.h (ASM_OUTPUT_ASCII): Likewise.
* m32r/m32r.c (m32r_encode_section_info): Likewise.
* mcore-elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mcore/mcore.c (mcore_encode_section_info): Likewise.
* mips/elf.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/elf64.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/iris6.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* mips/mips.h (ASM_OUTPUT_IDENT): Likewise.
* mips/mips.md (movdi, movsi): Likewise.
* mips/netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* netbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* openbsd.h (ASM_FINISH_DECLARE_OBJECT): Likewise.
* ptx4.h (ASM_FINISH_DECLARE_OBJECT, ASM_OUTPUT_LIMITED_STRING,
ASM_OUTPUT_ASCII): Likewise.
* rs6000/rs6000.c (rs6000_allocate_stack_space, output_epilog,
output_mi_thunk, output_toc): Likewise.
* rs6000/rs6000.md (movsi): Likewise.
* rs6000/sysv4.h (ASM_OUTPUT_INT, ASM_OUTPUT_SECTION_NAME): Likewise.
* tahoe/harris.h (ASM_OUTPUT_ASCII): Likewise.
* v850/v850.c (print_operand, print_operand_address,
v850_encode_data_area): Likewise.
ch:
* grant.c (globalize_decl): Constify a char*.
cp:
* decl2.c (finish_objects): Constify a char*.
* method.c (emit_thunk): Likewise.
From-SVN: r32388
2000-03-07 21:39:10 +01:00
|
|
|
|
const char *template = 0;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (body) == SET && GET_CODE (SET_SRC (body)) == ASM_OPERANDS)
|
|
|
|
|
{
|
|
|
|
|
rtx asmop = SET_SRC (body);
|
|
|
|
|
/* Single output operand: BODY is (set OUTPUT (asm_operands ....)). */
|
|
|
|
|
|
|
|
|
|
noperands = ASM_OPERANDS_INPUT_LENGTH (asmop) + 1;
|
|
|
|
|
|
|
|
|
|
for (i = 1; i < noperands; i++)
|
|
|
|
|
{
|
|
|
|
|
if (operand_locs)
|
|
|
|
|
operand_locs[i] = &ASM_OPERANDS_INPUT (asmop, i - 1);
|
|
|
|
|
if (operands)
|
|
|
|
|
operands[i] = ASM_OPERANDS_INPUT (asmop, i - 1);
|
|
|
|
|
if (constraints)
|
|
|
|
|
constraints[i] = ASM_OPERANDS_INPUT_CONSTRAINT (asmop, i - 1);
|
|
|
|
|
if (modes)
|
|
|
|
|
modes[i] = ASM_OPERANDS_INPUT_MODE (asmop, i - 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* The output is in the SET.
|
|
|
|
|
Its constraint is in the ASM_OPERANDS itself. */
|
|
|
|
|
if (operands)
|
|
|
|
|
operands[0] = SET_DEST (body);
|
|
|
|
|
if (operand_locs)
|
|
|
|
|
operand_locs[0] = &SET_DEST (body);
|
|
|
|
|
if (constraints)
|
|
|
|
|
constraints[0] = ASM_OPERANDS_OUTPUT_CONSTRAINT (asmop);
|
|
|
|
|
if (modes)
|
|
|
|
|
modes[0] = GET_MODE (SET_DEST (body));
|
|
|
|
|
template = ASM_OPERANDS_TEMPLATE (asmop);
|
|
|
|
|
}
|
|
|
|
|
else if (GET_CODE (body) == ASM_OPERANDS)
|
|
|
|
|
{
|
|
|
|
|
rtx asmop = body;
|
|
|
|
|
/* No output operands: BODY is (asm_operands ....). */
|
|
|
|
|
|
|
|
|
|
noperands = ASM_OPERANDS_INPUT_LENGTH (asmop);
|
|
|
|
|
|
|
|
|
|
/* The input operands are found in the 1st element vector. */
|
|
|
|
|
/* Constraints for inputs are in the 2nd element vector. */
|
|
|
|
|
for (i = 0; i < noperands; i++)
|
|
|
|
|
{
|
|
|
|
|
if (operand_locs)
|
|
|
|
|
operand_locs[i] = &ASM_OPERANDS_INPUT (asmop, i);
|
|
|
|
|
if (operands)
|
|
|
|
|
operands[i] = ASM_OPERANDS_INPUT (asmop, i);
|
|
|
|
|
if (constraints)
|
|
|
|
|
constraints[i] = ASM_OPERANDS_INPUT_CONSTRAINT (asmop, i);
|
|
|
|
|
if (modes)
|
|
|
|
|
modes[i] = ASM_OPERANDS_INPUT_MODE (asmop, i);
|
|
|
|
|
}
|
|
|
|
|
template = ASM_OPERANDS_TEMPLATE (asmop);
|
|
|
|
|
}
|
|
|
|
|
else if (GET_CODE (body) == PARALLEL
|
2001-11-02 11:52:08 +01:00
|
|
|
|
&& GET_CODE (XVECEXP (body, 0, 0)) == SET
|
|
|
|
|
&& GET_CODE (SET_SRC (XVECEXP (body, 0, 0))) == ASM_OPERANDS)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
{
|
|
|
|
|
rtx asmop = SET_SRC (XVECEXP (body, 0, 0));
|
|
|
|
|
int nparallel = XVECLEN (body, 0); /* Includes CLOBBERs. */
|
|
|
|
|
int nin = ASM_OPERANDS_INPUT_LENGTH (asmop);
|
|
|
|
|
int nout = 0; /* Does not include CLOBBERs. */
|
|
|
|
|
|
|
|
|
|
/* At least one output, plus some CLOBBERs. */
|
|
|
|
|
|
|
|
|
|
/* The outputs are in the SETs.
|
|
|
|
|
Their constraints are in the ASM_OPERANDS itself. */
|
|
|
|
|
for (i = 0; i < nparallel; i++)
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (XVECEXP (body, 0, i)) == CLOBBER)
|
|
|
|
|
break; /* Past last SET */
|
2002-05-09 03:42:28 +02:00
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
if (operands)
|
|
|
|
|
operands[i] = SET_DEST (XVECEXP (body, 0, i));
|
|
|
|
|
if (operand_locs)
|
|
|
|
|
operand_locs[i] = &SET_DEST (XVECEXP (body, 0, i));
|
|
|
|
|
if (constraints)
|
|
|
|
|
constraints[i] = XSTR (SET_SRC (XVECEXP (body, 0, i)), 1);
|
|
|
|
|
if (modes)
|
|
|
|
|
modes[i] = GET_MODE (SET_DEST (XVECEXP (body, 0, i)));
|
|
|
|
|
nout++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < nin; i++)
|
|
|
|
|
{
|
|
|
|
|
if (operand_locs)
|
|
|
|
|
operand_locs[i + nout] = &ASM_OPERANDS_INPUT (asmop, i);
|
|
|
|
|
if (operands)
|
|
|
|
|
operands[i + nout] = ASM_OPERANDS_INPUT (asmop, i);
|
|
|
|
|
if (constraints)
|
|
|
|
|
constraints[i + nout] = ASM_OPERANDS_INPUT_CONSTRAINT (asmop, i);
|
|
|
|
|
if (modes)
|
|
|
|
|
modes[i + nout] = ASM_OPERANDS_INPUT_MODE (asmop, i);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template = ASM_OPERANDS_TEMPLATE (asmop);
|
|
|
|
|
}
|
|
|
|
|
else if (GET_CODE (body) == PARALLEL
|
|
|
|
|
&& GET_CODE (XVECEXP (body, 0, 0)) == ASM_OPERANDS)
|
|
|
|
|
{
|
|
|
|
|
/* No outputs, but some CLOBBERs. */
|
|
|
|
|
|
|
|
|
|
rtx asmop = XVECEXP (body, 0, 0);
|
|
|
|
|
int nin = ASM_OPERANDS_INPUT_LENGTH (asmop);
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < nin; i++)
|
|
|
|
|
{
|
|
|
|
|
if (operand_locs)
|
|
|
|
|
operand_locs[i] = &ASM_OPERANDS_INPUT (asmop, i);
|
|
|
|
|
if (operands)
|
|
|
|
|
operands[i] = ASM_OPERANDS_INPUT (asmop, i);
|
|
|
|
|
if (constraints)
|
|
|
|
|
constraints[i] = ASM_OPERANDS_INPUT_CONSTRAINT (asmop, i);
|
|
|
|
|
if (modes)
|
|
|
|
|
modes[i] = ASM_OPERANDS_INPUT_MODE (asmop, i);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template = ASM_OPERANDS_TEMPLATE (asmop);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return template;
|
|
|
|
|
}
|
1999-01-15 19:43:47 +01:00
|
|
|
|
|
2002-05-09 03:42:28 +02:00
|
|
|
|
/* Check if an asm_operand matches it's constraints.
|
1999-02-01 21:03:23 +01:00
|
|
|
|
Return > 0 if ok, = 0 if bad, < 0 if inconclusive. */
|
1999-01-15 19:43:47 +01:00
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
asm_operand_ok (op, constraint)
|
|
|
|
|
rtx op;
|
|
|
|
|
const char *constraint;
|
|
|
|
|
{
|
1999-02-01 21:03:23 +01:00
|
|
|
|
int result = 0;
|
|
|
|
|
|
1999-01-15 19:43:47 +01:00
|
|
|
|
/* Use constrain_operands after reload. */
|
|
|
|
|
if (reload_completed)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
while (*constraint)
|
|
|
|
|
{
|
2000-08-29 02:44:21 +02:00
|
|
|
|
char c = *constraint++;
|
|
|
|
|
switch (c)
|
1999-01-15 19:43:47 +01:00
|
|
|
|
{
|
|
|
|
|
case '=':
|
|
|
|
|
case '+':
|
|
|
|
|
case '*':
|
|
|
|
|
case '%':
|
|
|
|
|
case '?':
|
|
|
|
|
case '!':
|
|
|
|
|
case '#':
|
|
|
|
|
case '&':
|
|
|
|
|
case ',':
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case '0': case '1': case '2': case '3': case '4':
|
|
|
|
|
case '5': case '6': case '7': case '8': case '9':
|
1999-02-01 21:03:23 +01:00
|
|
|
|
/* For best results, our caller should have given us the
|
|
|
|
|
proper matching constraint, but we can't actually fail
|
|
|
|
|
the check if they didn't. Indicate that results are
|
|
|
|
|
inconclusive. */
|
c-format.c (maybe_read_dollar_number): Use safe-ctype macros and/or fold extra calls into fewer ones.
* c-format.c (maybe_read_dollar_number): Use safe-ctype macros
and/or fold extra calls into fewer ones.
* collect2.c (dump_file): Likewise.
* cppexp.c (parse_number): Likewise.
* cpplex.c (_cpp_lex_direct): Likewise.
* final.c (output_asm_insn, asm_fprintf): Likewise.
* fix-header.c (inf_scan_ident, main): Likewise.
* fixinc/fixfixes.c (char_macro_use_fix, char_macro_def_fix):
Likewise.
* fold-const.c (real_hex_to_f): Likewise.
* gen-protos.c (parse_fn_proto): Likewise.
* genattrtab.c (check_attr_test, check_attr_value): Likewise.
* genrecog.c (change_state, write_action): Likewise.
* gensupport.c (shift_output_template): Likewise.
* local-alloc.c (requires_inout): Likewise.
* mips-tfile.c (IS_ASM_IDENT): Likewise.
* protoize.c (is_id_char, main): Likewise.
* real.c (asctoeg): Likewise.
* recog.c (asm_operand_ok): Likewise.
* reload.c (find_reloads): Likewise.
* scan.c (scan_identget_token): Likewise.
* sched-vis.c (print_value): Likewise.
* stringpool.c (ggc_alloc_string): Likewise.
* toplev.c (read_integral_parameter, decode_g_option): Likewise.
* tradcif.y (parse_number, yylex, parse_escape): Likewise.
* tradcpp.c (rescan): Likewise.
* tree.c (clean_symbol_name): Likewise.
* varasm.c (decode_reg_name): Likewise.
* alpha.h (ASM_OUTPUT_ASCII): Likewise.
* darwin.c (name_needs_quotes, func_name_maybe_scoped): Likewise.
* dsp16xx.h (ASM_OUTPUT_ASCII): Likewise.
* m88k.c (output_ascii): Likewise.
* m88k.h (OVERRIDE_OPTIONS): Likewise.
* mcore.h (REG_CLASS_FROM_LETTER): Likewise.
* ns32k/encore.h (ASM_OUTPUT_ASCII): Likewise.
* sh.h (REG_CLASS_FROM_LETTER): Likewise.
cp:
* xref.c (GNU_xref_member): Use safe-ctype macros and/or fold
extra calls into fewer ones.
f:
* bad.c (ffebad_finish): Use safe-ctype macros and/or fold extra
calls into fewer ones.
* implic.c (ffeimplic_lookup_): Likewise.
* intdoc.c (dumpimp): Likewise.
* intrin.c (ffeintrin_init_0): Likewise.
* lex.c (ffelex_backslash_, ffelex_cfebackslash_, ffelex_hash_):
Likewise.
* lex.h (ffelex_is_firstnamechar): Likewise.
* target.c (ffetarget_integerhex): Likewise.
java:
* gjavah.c (jni_print_char, decode_signature_piece): Use
safe-ctype macros and/or fold extra calls into fewer ones.
* lex.c (java_read_unicode, java_lex): Likewise.
* lex.h (JAVA_START_CHAR_P, JAVA_PART_CHAR_P, JAVA_ASCII_DIGIT,
JAVA_ASCII_HEXDIGIT, JAVA_ASCII_LETTER): Likewise.
* mangle_name.c (append_unicode_mangled_name,
unicode_mangling_length): Likewise.
From-SVN: r46397
2001-10-21 23:32:15 +02:00
|
|
|
|
while (ISDIGIT (*constraint))
|
2001-10-11 09:07:30 +02:00
|
|
|
|
constraint++;
|
1999-02-01 21:03:23 +01:00
|
|
|
|
result = -1;
|
1999-01-15 19:43:47 +01:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'p':
|
|
|
|
|
if (address_operand (op, VOIDmode))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'm':
|
|
|
|
|
case 'V': /* non-offsettable */
|
|
|
|
|
if (memory_operand (op, VOIDmode))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'o': /* offsettable */
|
|
|
|
|
if (offsettable_nonstrict_memref_p (op))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case '<':
|
1999-02-01 21:03:23 +01:00
|
|
|
|
/* ??? Before flow, auto inc/dec insns are not supposed to exist,
|
|
|
|
|
excepting those that expand_call created. Further, on some
|
|
|
|
|
machines which do not have generalized auto inc/dec, an inc/dec
|
|
|
|
|
is not a memory_operand.
|
|
|
|
|
|
|
|
|
|
Match any memory and hope things are resolved after reload. */
|
|
|
|
|
|
1999-01-15 19:43:47 +01:00
|
|
|
|
if (GET_CODE (op) == MEM
|
1999-02-01 21:03:23 +01:00
|
|
|
|
&& (1
|
|
|
|
|
|| GET_CODE (XEXP (op, 0)) == PRE_DEC
|
2002-05-09 03:42:28 +02:00
|
|
|
|
|| GET_CODE (XEXP (op, 0)) == POST_DEC))
|
1999-01-15 19:43:47 +01:00
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case '>':
|
|
|
|
|
if (GET_CODE (op) == MEM
|
1999-02-01 21:03:23 +01:00
|
|
|
|
&& (1
|
|
|
|
|
|| GET_CODE (XEXP (op, 0)) == PRE_INC
|
2002-05-09 03:42:28 +02:00
|
|
|
|
|| GET_CODE (XEXP (op, 0)) == POST_INC))
|
1999-01-15 19:43:47 +01:00
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'E':
|
|
|
|
|
case 'F':
|
|
|
|
|
if (GET_CODE (op) == CONST_DOUBLE)
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'G':
|
|
|
|
|
if (GET_CODE (op) == CONST_DOUBLE
|
|
|
|
|
&& CONST_DOUBLE_OK_FOR_LETTER_P (op, 'G'))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'H':
|
|
|
|
|
if (GET_CODE (op) == CONST_DOUBLE
|
|
|
|
|
&& CONST_DOUBLE_OK_FOR_LETTER_P (op, 'H'))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 's':
|
|
|
|
|
if (GET_CODE (op) == CONST_INT
|
|
|
|
|
|| (GET_CODE (op) == CONST_DOUBLE
|
|
|
|
|
&& GET_MODE (op) == VOIDmode))
|
|
|
|
|
break;
|
|
|
|
|
/* FALLTHRU */
|
|
|
|
|
|
|
|
|
|
case 'i':
|
|
|
|
|
if (CONSTANT_P (op)
|
|
|
|
|
#ifdef LEGITIMATE_PIC_OPERAND_P
|
|
|
|
|
&& (! flag_pic || LEGITIMATE_PIC_OPERAND_P (op))
|
|
|
|
|
#endif
|
|
|
|
|
)
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'n':
|
|
|
|
|
if (GET_CODE (op) == CONST_INT
|
|
|
|
|
|| (GET_CODE (op) == CONST_DOUBLE
|
|
|
|
|
&& GET_MODE (op) == VOIDmode))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'I':
|
|
|
|
|
if (GET_CODE (op) == CONST_INT
|
|
|
|
|
&& CONST_OK_FOR_LETTER_P (INTVAL (op), 'I'))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'J':
|
|
|
|
|
if (GET_CODE (op) == CONST_INT
|
|
|
|
|
&& CONST_OK_FOR_LETTER_P (INTVAL (op), 'J'))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'K':
|
|
|
|
|
if (GET_CODE (op) == CONST_INT
|
|
|
|
|
&& CONST_OK_FOR_LETTER_P (INTVAL (op), 'K'))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'L':
|
|
|
|
|
if (GET_CODE (op) == CONST_INT
|
|
|
|
|
&& CONST_OK_FOR_LETTER_P (INTVAL (op), 'L'))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'M':
|
|
|
|
|
if (GET_CODE (op) == CONST_INT
|
|
|
|
|
&& CONST_OK_FOR_LETTER_P (INTVAL (op), 'M'))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'N':
|
|
|
|
|
if (GET_CODE (op) == CONST_INT
|
|
|
|
|
&& CONST_OK_FOR_LETTER_P (INTVAL (op), 'N'))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'O':
|
|
|
|
|
if (GET_CODE (op) == CONST_INT
|
|
|
|
|
&& CONST_OK_FOR_LETTER_P (INTVAL (op), 'O'))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'P':
|
|
|
|
|
if (GET_CODE (op) == CONST_INT
|
|
|
|
|
&& CONST_OK_FOR_LETTER_P (INTVAL (op), 'P'))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'X':
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
case 'g':
|
|
|
|
|
if (general_operand (op, VOIDmode))
|
|
|
|
|
return 1;
|
|
|
|
|
break;
|
|
|
|
|
|
2000-08-29 02:44:21 +02:00
|
|
|
|
default:
|
|
|
|
|
/* For all other letters, we first check for a register class,
|
|
|
|
|
otherwise it is an EXTRA_CONSTRAINT. */
|
|
|
|
|
if (REG_CLASS_FROM_LETTER (c) != NO_REGS)
|
|
|
|
|
{
|
|
|
|
|
case 'r':
|
|
|
|
|
if (GET_MODE (op) == BLKmode)
|
|
|
|
|
break;
|
|
|
|
|
if (register_operand (op, VOIDmode))
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
1999-01-15 19:43:47 +01:00
|
|
|
|
#ifdef EXTRA_CONSTRAINT
|
2000-08-29 02:44:21 +02:00
|
|
|
|
if (EXTRA_CONSTRAINT (op, c))
|
1999-01-15 19:43:47 +01:00
|
|
|
|
return 1;
|
|
|
|
|
#endif
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1999-02-01 21:03:23 +01:00
|
|
|
|
return result;
|
1999-01-15 19:43:47 +01:00
|
|
|
|
}
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
/* Given an rtx *P, if it is a sum containing an integer constant term,
|
|
|
|
|
return the location (type rtx *) of the pointer to that constant term.
|
|
|
|
|
Otherwise, return a null pointer. */
|
|
|
|
|
|
explow.c (plus_constant_wide, case PLUS): Call find_constant_term and avoid checking for constant as first operand.
* 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.
From-SVN: r43733
2001-07-03 21:44:20 +02:00
|
|
|
|
rtx *
|
1991-11-27 15:45:36 +01:00
|
|
|
|
find_constant_term_loc (p)
|
|
|
|
|
rtx *p;
|
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx *tem;
|
|
|
|
|
enum rtx_code code = GET_CODE (*p);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
/* If *P IS such a constant term, P is its location. */
|
|
|
|
|
|
|
|
|
|
if (code == CONST_INT || code == SYMBOL_REF || code == LABEL_REF
|
|
|
|
|
|| code == CONST)
|
|
|
|
|
return p;
|
|
|
|
|
|
|
|
|
|
/* Otherwise, if not a sum, it has no constant term. */
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (*p) != PLUS)
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
/* If one of the summands is constant, return its location. */
|
|
|
|
|
|
|
|
|
|
if (XEXP (*p, 0) && CONSTANT_P (XEXP (*p, 0))
|
|
|
|
|
&& XEXP (*p, 1) && CONSTANT_P (XEXP (*p, 1)))
|
|
|
|
|
return p;
|
|
|
|
|
|
|
|
|
|
/* Otherwise, check each summand for containing a constant term. */
|
|
|
|
|
|
|
|
|
|
if (XEXP (*p, 0) != 0)
|
|
|
|
|
{
|
|
|
|
|
tem = find_constant_term_loc (&XEXP (*p, 0));
|
|
|
|
|
if (tem != 0)
|
|
|
|
|
return tem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (XEXP (*p, 1) != 0)
|
|
|
|
|
{
|
|
|
|
|
tem = find_constant_term_loc (&XEXP (*p, 1));
|
|
|
|
|
if (tem != 0)
|
|
|
|
|
return tem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 if OP is a memory reference
|
|
|
|
|
whose address contains no side effects
|
|
|
|
|
and remains valid after the addition
|
|
|
|
|
of a positive integer less than the
|
|
|
|
|
size of the object being referenced.
|
|
|
|
|
|
|
|
|
|
We assume that the original address is valid and do not check it.
|
|
|
|
|
|
|
|
|
|
This uses strict_memory_address_p as a subroutine, so
|
|
|
|
|
don't use it before reload. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
offsettable_memref_p (op)
|
|
|
|
|
rtx op;
|
|
|
|
|
{
|
|
|
|
|
return ((GET_CODE (op) == MEM)
|
|
|
|
|
&& offsettable_address_p (1, GET_MODE (op), XEXP (op, 0)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Similar, but don't require a strictly valid mem ref:
|
|
|
|
|
consider pseudo-regs valid as index or base regs. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
offsettable_nonstrict_memref_p (op)
|
|
|
|
|
rtx op;
|
|
|
|
|
{
|
|
|
|
|
return ((GET_CODE (op) == MEM)
|
|
|
|
|
&& offsettable_address_p (0, GET_MODE (op), XEXP (op, 0)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 if Y is a memory address which contains no side effects
|
|
|
|
|
and would remain valid after the addition of a positive integer
|
|
|
|
|
less than the size of that mode.
|
|
|
|
|
|
|
|
|
|
We assume that the original address is valid and do not check it.
|
|
|
|
|
We do check that it is valid for narrower modes.
|
|
|
|
|
|
|
|
|
|
If STRICTP is nonzero, we require a strictly valid address,
|
|
|
|
|
for the sake of use in reload.c. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
offsettable_address_p (strictp, mode, y)
|
|
|
|
|
int strictp;
|
|
|
|
|
enum machine_mode mode;
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx y;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
enum rtx_code ycode = GET_CODE (y);
|
|
|
|
|
rtx z;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
rtx y1 = y;
|
|
|
|
|
rtx *y2;
|
2000-01-17 16:37:04 +01:00
|
|
|
|
int (*addressp) PARAMS ((enum machine_mode, rtx)) =
|
1999-09-14 20:19:09 +02:00
|
|
|
|
(strictp ? strict_memory_address_p : memory_address_p);
|
2000-05-25 08:17:05 +02:00
|
|
|
|
unsigned int mode_sz = GET_MODE_SIZE (mode);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
if (CONSTANT_ADDRESS_P (y))
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
/* Adjusting an offsettable address involves changing to a narrower mode.
|
|
|
|
|
Make sure that's OK. */
|
|
|
|
|
|
|
|
|
|
if (mode_dependent_address_p (y))
|
|
|
|
|
return 0;
|
|
|
|
|
|
2000-05-25 08:17:05 +02:00
|
|
|
|
/* ??? How much offset does an offsettable BLKmode reference need?
|
|
|
|
|
Clearly that depends on the situation in which it's being used.
|
|
|
|
|
However, the current situation in which we test 0xffffffff is
|
|
|
|
|
less than ideal. Caveat user. */
|
|
|
|
|
if (mode_sz == 0)
|
|
|
|
|
mode_sz = BIGGEST_ALIGNMENT / BITS_PER_UNIT;
|
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
/* If the expression contains a constant term,
|
|
|
|
|
see if it remains valid when max possible offset is added. */
|
|
|
|
|
|
|
|
|
|
if ((ycode == PLUS) && (y2 = find_constant_term_loc (&y1)))
|
|
|
|
|
{
|
|
|
|
|
int good;
|
|
|
|
|
|
|
|
|
|
y1 = *y2;
|
2000-05-25 08:17:05 +02:00
|
|
|
|
*y2 = plus_constant (*y2, mode_sz - 1);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
/* Use QImode because an odd displacement may be automatically invalid
|
|
|
|
|
for any wider mode. But it should be valid for a single byte. */
|
|
|
|
|
good = (*addressp) (QImode, y);
|
|
|
|
|
|
|
|
|
|
/* In any case, restore old contents of memory. */
|
|
|
|
|
*y2 = y1;
|
|
|
|
|
return good;
|
|
|
|
|
}
|
|
|
|
|
|
2000-07-28 19:46:18 +02:00
|
|
|
|
if (GET_RTX_CLASS (ycode) == 'a')
|
1991-11-27 15:45:36 +01:00
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
/* The offset added here is chosen as the maximum offset that
|
|
|
|
|
any instruction could need to add when operating on something
|
|
|
|
|
of the specified mode. We assume that if Y and Y+c are
|
2001-07-11 00:09:10 +02:00
|
|
|
|
valid addresses then so is Y+d for all 0<d<c. adjust_address will
|
|
|
|
|
go inside a LO_SUM here, so we do so as well. */
|
2002-04-13 00:47:34 +02:00
|
|
|
|
if (GET_CODE (y) == LO_SUM
|
|
|
|
|
&& mode != BLKmode
|
|
|
|
|
&& mode_sz <= GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT)
|
2001-07-11 00:09:10 +02:00
|
|
|
|
z = gen_rtx_LO_SUM (GET_MODE (y), XEXP (y, 0),
|
|
|
|
|
plus_constant (XEXP (y, 1), mode_sz - 1));
|
|
|
|
|
else
|
|
|
|
|
z = plus_constant (y, mode_sz - 1);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
/* Use QImode because an odd displacement may be automatically invalid
|
|
|
|
|
for any wider mode. But it should be valid for a single byte. */
|
|
|
|
|
return (*addressp) (QImode, z);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 if ADDR is an address-expression whose effect depends
|
|
|
|
|
on the mode of the memory reference it is used in.
|
|
|
|
|
|
|
|
|
|
Autoincrement addressing is a typical example of mode-dependence
|
|
|
|
|
because the amount of the increment depends on the mode. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
mode_dependent_address_p (addr)
|
2001-08-13 01:40:53 +02:00
|
|
|
|
rtx addr ATTRIBUTE_UNUSED; /* Maybe used in GO_IF_MODE_DEPENDENT_ADDRESS. */
|
1991-11-27 15:45:36 +01:00
|
|
|
|
{
|
|
|
|
|
GO_IF_MODE_DEPENDENT_ADDRESS (addr, win);
|
|
|
|
|
return 0;
|
2001-08-13 01:40:53 +02:00
|
|
|
|
/* Label `win' might (not) be used via GO_IF_MODE_DEPENDENT_ADDRESS. */
|
1999-01-18 07:17:31 +01:00
|
|
|
|
win: ATTRIBUTE_UNUSED_LABEL
|
1991-11-27 15:45:36 +01:00
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 if OP is a general operand
|
|
|
|
|
other than a memory ref with a mode dependent address. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
mode_independent_operand (op, mode)
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
rtx op;
|
|
|
|
|
{
|
|
|
|
|
rtx addr;
|
|
|
|
|
|
|
|
|
|
if (! general_operand (op, mode))
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (op) != MEM)
|
|
|
|
|
return 1;
|
|
|
|
|
|
|
|
|
|
addr = XEXP (op, 0);
|
|
|
|
|
GO_IF_MODE_DEPENDENT_ADDRESS (addr, lose);
|
|
|
|
|
return 1;
|
2001-08-13 01:40:53 +02:00
|
|
|
|
/* Label `lose' might (not) be used via GO_IF_MODE_DEPENDENT_ADDRESS. */
|
1999-01-18 07:17:31 +01:00
|
|
|
|
lose: ATTRIBUTE_UNUSED_LABEL
|
1991-11-27 15:45:36 +01:00
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
2000-09-12 01:54:11 +02:00
|
|
|
|
/* Like extract_insn, but save insn extracted and don't extract again, when
|
|
|
|
|
called again for the same insn expecting that recog_data still contain the
|
|
|
|
|
valid information. This is used primary by gen_attr infrastructure that
|
|
|
|
|
often does extract insn again and again. */
|
|
|
|
|
void
|
|
|
|
|
extract_insn_cached (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
if (recog_data.insn == insn && INSN_CODE (insn) >= 0)
|
|
|
|
|
return;
|
|
|
|
|
extract_insn (insn);
|
|
|
|
|
recog_data.insn = insn;
|
|
|
|
|
}
|
|
|
|
|
/* Do cached extract_insn, constrain_operand and complain about failures.
|
|
|
|
|
Used by insn_attrtab. */
|
|
|
|
|
void
|
|
|
|
|
extract_constrain_insn_cached (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
extract_insn_cached (insn);
|
|
|
|
|
if (which_alternative == -1
|
|
|
|
|
&& !constrain_operands (reload_completed))
|
|
|
|
|
fatal_insn_not_found (insn);
|
|
|
|
|
}
|
2000-09-29 13:40:24 +02:00
|
|
|
|
/* Do cached constrain_operand and complain about failures. */
|
|
|
|
|
int
|
|
|
|
|
constrain_operands_cached (strict)
|
|
|
|
|
int strict;
|
|
|
|
|
{
|
|
|
|
|
if (which_alternative == -1)
|
|
|
|
|
return constrain_operands (strict);
|
|
|
|
|
else
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2000-09-12 01:54:11 +02:00
|
|
|
|
|
1999-09-12 03:51:28 +02:00
|
|
|
|
/* Analyze INSN and fill in recog_data. */
|
|
|
|
|
|
Makefile.in (insn-extract.o): Fix dependencies.
* Makefile.in (insn-extract.o): Fix dependencies.
* genextract.c (main): Generate includes for insn-config.h and
recog.h.
Delete generation of declarations which are now in recog.h.
* genrecog.c (main): Delete generation of definitions which are
now in recog.c.
* local-alloc.c (block_alloc): Use extract_insn and the variables
it sets up instead of looking up values by insn_code.
* recog.c (recog_operand, recog_operand_loc, recog_dup_loc,
recog_dup_num): Define here instead of generating the definition in
genrecog.c.
(recog_n_operands, recog_n_dups, recog_n_alternatives,
recog_operand_mode, recog_constraints, recog_operand_address_p):
New variables.
(extract_insn): New function.
* recog.h (extract_insn): Declare function.
(which_alternative, recog_n_operands, recog_n_dups,
recog_n_alternatives, recog_operand_mode, recog_constraints,
recog_operand_address_p): Declare variables.
* regclass.c (n_occurrences): New static function.
* reload.c (n_occurrences): Delete function.
(find_reloads): Use extract_insn.
* reload.h (n_occurrences): Delete declaration.
From-SVN: r23147
1998-10-17 03:28:57 +02:00
|
|
|
|
void
|
|
|
|
|
extract_insn (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
int icode;
|
|
|
|
|
int noperands;
|
|
|
|
|
rtx body = PATTERN (insn);
|
|
|
|
|
|
2000-09-12 01:54:11 +02:00
|
|
|
|
recog_data.insn = NULL;
|
1999-09-12 03:51:28 +02:00
|
|
|
|
recog_data.n_operands = 0;
|
|
|
|
|
recog_data.n_alternatives = 0;
|
|
|
|
|
recog_data.n_dups = 0;
|
2000-09-12 01:54:11 +02:00
|
|
|
|
which_alternative = -1;
|
Makefile.in (insn-extract.o): Fix dependencies.
* Makefile.in (insn-extract.o): Fix dependencies.
* genextract.c (main): Generate includes for insn-config.h and
recog.h.
Delete generation of declarations which are now in recog.h.
* genrecog.c (main): Delete generation of definitions which are
now in recog.c.
* local-alloc.c (block_alloc): Use extract_insn and the variables
it sets up instead of looking up values by insn_code.
* recog.c (recog_operand, recog_operand_loc, recog_dup_loc,
recog_dup_num): Define here instead of generating the definition in
genrecog.c.
(recog_n_operands, recog_n_dups, recog_n_alternatives,
recog_operand_mode, recog_constraints, recog_operand_address_p):
New variables.
(extract_insn): New function.
* recog.h (extract_insn): Declare function.
(which_alternative, recog_n_operands, recog_n_dups,
recog_n_alternatives, recog_operand_mode, recog_constraints,
recog_operand_address_p): Declare variables.
* regclass.c (n_occurrences): New static function.
* reload.c (n_occurrences): Delete function.
(find_reloads): Use extract_insn.
* reload.h (n_occurrences): Delete declaration.
From-SVN: r23147
1998-10-17 03:28:57 +02:00
|
|
|
|
|
|
|
|
|
switch (GET_CODE (body))
|
|
|
|
|
{
|
|
|
|
|
case USE:
|
|
|
|
|
case CLOBBER:
|
|
|
|
|
case ASM_INPUT:
|
|
|
|
|
case ADDR_VEC:
|
|
|
|
|
case ADDR_DIFF_VEC:
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
case SET:
|
2000-09-29 13:40:24 +02:00
|
|
|
|
if (GET_CODE (SET_SRC (body)) == ASM_OPERANDS)
|
|
|
|
|
goto asm_insn;
|
|
|
|
|
else
|
|
|
|
|
goto normal_insn;
|
Makefile.in (insn-extract.o): Fix dependencies.
* Makefile.in (insn-extract.o): Fix dependencies.
* genextract.c (main): Generate includes for insn-config.h and
recog.h.
Delete generation of declarations which are now in recog.h.
* genrecog.c (main): Delete generation of definitions which are
now in recog.c.
* local-alloc.c (block_alloc): Use extract_insn and the variables
it sets up instead of looking up values by insn_code.
* recog.c (recog_operand, recog_operand_loc, recog_dup_loc,
recog_dup_num): Define here instead of generating the definition in
genrecog.c.
(recog_n_operands, recog_n_dups, recog_n_alternatives,
recog_operand_mode, recog_constraints, recog_operand_address_p):
New variables.
(extract_insn): New function.
* recog.h (extract_insn): Declare function.
(which_alternative, recog_n_operands, recog_n_dups,
recog_n_alternatives, recog_operand_mode, recog_constraints,
recog_operand_address_p): Declare variables.
* regclass.c (n_occurrences): New static function.
* reload.c (n_occurrences): Delete function.
(find_reloads): Use extract_insn.
* reload.h (n_occurrences): Delete declaration.
From-SVN: r23147
1998-10-17 03:28:57 +02:00
|
|
|
|
case PARALLEL:
|
2000-09-29 13:40:24 +02:00
|
|
|
|
if ((GET_CODE (XVECEXP (body, 0, 0)) == SET
|
|
|
|
|
&& GET_CODE (SET_SRC (XVECEXP (body, 0, 0))) == ASM_OPERANDS)
|
|
|
|
|
|| GET_CODE (XVECEXP (body, 0, 0)) == ASM_OPERANDS)
|
|
|
|
|
goto asm_insn;
|
|
|
|
|
else
|
|
|
|
|
goto normal_insn;
|
Makefile.in (insn-extract.o): Fix dependencies.
* Makefile.in (insn-extract.o): Fix dependencies.
* genextract.c (main): Generate includes for insn-config.h and
recog.h.
Delete generation of declarations which are now in recog.h.
* genrecog.c (main): Delete generation of definitions which are
now in recog.c.
* local-alloc.c (block_alloc): Use extract_insn and the variables
it sets up instead of looking up values by insn_code.
* recog.c (recog_operand, recog_operand_loc, recog_dup_loc,
recog_dup_num): Define here instead of generating the definition in
genrecog.c.
(recog_n_operands, recog_n_dups, recog_n_alternatives,
recog_operand_mode, recog_constraints, recog_operand_address_p):
New variables.
(extract_insn): New function.
* recog.h (extract_insn): Declare function.
(which_alternative, recog_n_operands, recog_n_dups,
recog_n_alternatives, recog_operand_mode, recog_constraints,
recog_operand_address_p): Declare variables.
* regclass.c (n_occurrences): New static function.
* reload.c (n_occurrences): Delete function.
(find_reloads): Use extract_insn.
* reload.h (n_occurrences): Delete declaration.
From-SVN: r23147
1998-10-17 03:28:57 +02:00
|
|
|
|
case ASM_OPERANDS:
|
2000-09-29 13:40:24 +02:00
|
|
|
|
asm_insn:
|
1999-09-12 03:51:28 +02:00
|
|
|
|
recog_data.n_operands = noperands = asm_noperands (body);
|
Makefile.in (insn-extract.o): Fix dependencies.
* Makefile.in (insn-extract.o): Fix dependencies.
* genextract.c (main): Generate includes for insn-config.h and
recog.h.
Delete generation of declarations which are now in recog.h.
* genrecog.c (main): Delete generation of definitions which are
now in recog.c.
* local-alloc.c (block_alloc): Use extract_insn and the variables
it sets up instead of looking up values by insn_code.
* recog.c (recog_operand, recog_operand_loc, recog_dup_loc,
recog_dup_num): Define here instead of generating the definition in
genrecog.c.
(recog_n_operands, recog_n_dups, recog_n_alternatives,
recog_operand_mode, recog_constraints, recog_operand_address_p):
New variables.
(extract_insn): New function.
* recog.h (extract_insn): Declare function.
(which_alternative, recog_n_operands, recog_n_dups,
recog_n_alternatives, recog_operand_mode, recog_constraints,
recog_operand_address_p): Declare variables.
* regclass.c (n_occurrences): New static function.
* reload.c (n_occurrences): Delete function.
(find_reloads): Use extract_insn.
* reload.h (n_occurrences): Delete declaration.
From-SVN: r23147
1998-10-17 03:28:57 +02:00
|
|
|
|
if (noperands >= 0)
|
|
|
|
|
{
|
|
|
|
|
/* This insn is an `asm' with operands. */
|
|
|
|
|
|
|
|
|
|
/* expand_asm_operands makes sure there aren't too many operands. */
|
|
|
|
|
if (noperands > MAX_RECOG_OPERANDS)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
/* Now get the operand values and constraints out of the insn. */
|
1999-09-12 03:51:28 +02:00
|
|
|
|
decode_asm_operands (body, recog_data.operand,
|
|
|
|
|
recog_data.operand_loc,
|
|
|
|
|
recog_data.constraints,
|
|
|
|
|
recog_data.operand_mode);
|
Makefile.in (insn-extract.o): Fix dependencies.
* Makefile.in (insn-extract.o): Fix dependencies.
* genextract.c (main): Generate includes for insn-config.h and
recog.h.
Delete generation of declarations which are now in recog.h.
* genrecog.c (main): Delete generation of definitions which are
now in recog.c.
* local-alloc.c (block_alloc): Use extract_insn and the variables
it sets up instead of looking up values by insn_code.
* recog.c (recog_operand, recog_operand_loc, recog_dup_loc,
recog_dup_num): Define here instead of generating the definition in
genrecog.c.
(recog_n_operands, recog_n_dups, recog_n_alternatives,
recog_operand_mode, recog_constraints, recog_operand_address_p):
New variables.
(extract_insn): New function.
* recog.h (extract_insn): Declare function.
(which_alternative, recog_n_operands, recog_n_dups,
recog_n_alternatives, recog_operand_mode, recog_constraints,
recog_operand_address_p): Declare variables.
* regclass.c (n_occurrences): New static function.
* reload.c (n_occurrences): Delete function.
(find_reloads): Use extract_insn.
* reload.h (n_occurrences): Delete declaration.
From-SVN: r23147
1998-10-17 03:28:57 +02:00
|
|
|
|
if (noperands > 0)
|
|
|
|
|
{
|
1999-09-12 03:51:28 +02:00
|
|
|
|
const char *p = recog_data.constraints[0];
|
|
|
|
|
recog_data.n_alternatives = 1;
|
Makefile.in (insn-extract.o): Fix dependencies.
* Makefile.in (insn-extract.o): Fix dependencies.
* genextract.c (main): Generate includes for insn-config.h and
recog.h.
Delete generation of declarations which are now in recog.h.
* genrecog.c (main): Delete generation of definitions which are
now in recog.c.
* local-alloc.c (block_alloc): Use extract_insn and the variables
it sets up instead of looking up values by insn_code.
* recog.c (recog_operand, recog_operand_loc, recog_dup_loc,
recog_dup_num): Define here instead of generating the definition in
genrecog.c.
(recog_n_operands, recog_n_dups, recog_n_alternatives,
recog_operand_mode, recog_constraints, recog_operand_address_p):
New variables.
(extract_insn): New function.
* recog.h (extract_insn): Declare function.
(which_alternative, recog_n_operands, recog_n_dups,
recog_n_alternatives, recog_operand_mode, recog_constraints,
recog_operand_address_p): Declare variables.
* regclass.c (n_occurrences): New static function.
* reload.c (n_occurrences): Delete function.
(find_reloads): Use extract_insn.
* reload.h (n_occurrences): Delete declaration.
From-SVN: r23147
1998-10-17 03:28:57 +02:00
|
|
|
|
while (*p)
|
1999-09-12 03:51:28 +02:00
|
|
|
|
recog_data.n_alternatives += (*p++ == ',');
|
Makefile.in (insn-extract.o): Fix dependencies.
* Makefile.in (insn-extract.o): Fix dependencies.
* genextract.c (main): Generate includes for insn-config.h and
recog.h.
Delete generation of declarations which are now in recog.h.
* genrecog.c (main): Delete generation of definitions which are
now in recog.c.
* local-alloc.c (block_alloc): Use extract_insn and the variables
it sets up instead of looking up values by insn_code.
* recog.c (recog_operand, recog_operand_loc, recog_dup_loc,
recog_dup_num): Define here instead of generating the definition in
genrecog.c.
(recog_n_operands, recog_n_dups, recog_n_alternatives,
recog_operand_mode, recog_constraints, recog_operand_address_p):
New variables.
(extract_insn): New function.
* recog.h (extract_insn): Declare function.
(which_alternative, recog_n_operands, recog_n_dups,
recog_n_alternatives, recog_operand_mode, recog_constraints,
recog_operand_address_p): Declare variables.
* regclass.c (n_occurrences): New static function.
* reload.c (n_occurrences): Delete function.
(find_reloads): Use extract_insn.
* reload.h (n_occurrences): Delete declaration.
From-SVN: r23147
1998-10-17 03:28:57 +02:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
2000-09-29 13:40:24 +02:00
|
|
|
|
fatal_insn_not_found (insn);
|
Makefile.in (insn-extract.o): Fix dependencies.
* Makefile.in (insn-extract.o): Fix dependencies.
* genextract.c (main): Generate includes for insn-config.h and
recog.h.
Delete generation of declarations which are now in recog.h.
* genrecog.c (main): Delete generation of definitions which are
now in recog.c.
* local-alloc.c (block_alloc): Use extract_insn and the variables
it sets up instead of looking up values by insn_code.
* recog.c (recog_operand, recog_operand_loc, recog_dup_loc,
recog_dup_num): Define here instead of generating the definition in
genrecog.c.
(recog_n_operands, recog_n_dups, recog_n_alternatives,
recog_operand_mode, recog_constraints, recog_operand_address_p):
New variables.
(extract_insn): New function.
* recog.h (extract_insn): Declare function.
(which_alternative, recog_n_operands, recog_n_dups,
recog_n_alternatives, recog_operand_mode, recog_constraints,
recog_operand_address_p): Declare variables.
* regclass.c (n_occurrences): New static function.
* reload.c (n_occurrences): Delete function.
(find_reloads): Use extract_insn.
* reload.h (n_occurrences): Delete declaration.
From-SVN: r23147
1998-10-17 03:28:57 +02:00
|
|
|
|
|
|
|
|
|
default:
|
2000-09-29 13:40:24 +02:00
|
|
|
|
normal_insn:
|
Makefile.in (insn-extract.o): Fix dependencies.
* Makefile.in (insn-extract.o): Fix dependencies.
* genextract.c (main): Generate includes for insn-config.h and
recog.h.
Delete generation of declarations which are now in recog.h.
* genrecog.c (main): Delete generation of definitions which are
now in recog.c.
* local-alloc.c (block_alloc): Use extract_insn and the variables
it sets up instead of looking up values by insn_code.
* recog.c (recog_operand, recog_operand_loc, recog_dup_loc,
recog_dup_num): Define here instead of generating the definition in
genrecog.c.
(recog_n_operands, recog_n_dups, recog_n_alternatives,
recog_operand_mode, recog_constraints, recog_operand_address_p):
New variables.
(extract_insn): New function.
* recog.h (extract_insn): Declare function.
(which_alternative, recog_n_operands, recog_n_dups,
recog_n_alternatives, recog_operand_mode, recog_constraints,
recog_operand_address_p): Declare variables.
* regclass.c (n_occurrences): New static function.
* reload.c (n_occurrences): Delete function.
(find_reloads): Use extract_insn.
* reload.h (n_occurrences): Delete declaration.
From-SVN: r23147
1998-10-17 03:28:57 +02:00
|
|
|
|
/* Ordinary insn: recognize it, get the operands via insn_extract
|
|
|
|
|
and get the constraints. */
|
|
|
|
|
|
|
|
|
|
icode = recog_memoized (insn);
|
|
|
|
|
if (icode < 0)
|
|
|
|
|
fatal_insn_not_found (insn);
|
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
recog_data.n_operands = noperands = insn_data[icode].n_operands;
|
|
|
|
|
recog_data.n_alternatives = insn_data[icode].n_alternatives;
|
|
|
|
|
recog_data.n_dups = insn_data[icode].n_dups;
|
Makefile.in (insn-extract.o): Fix dependencies.
* Makefile.in (insn-extract.o): Fix dependencies.
* genextract.c (main): Generate includes for insn-config.h and
recog.h.
Delete generation of declarations which are now in recog.h.
* genrecog.c (main): Delete generation of definitions which are
now in recog.c.
* local-alloc.c (block_alloc): Use extract_insn and the variables
it sets up instead of looking up values by insn_code.
* recog.c (recog_operand, recog_operand_loc, recog_dup_loc,
recog_dup_num): Define here instead of generating the definition in
genrecog.c.
(recog_n_operands, recog_n_dups, recog_n_alternatives,
recog_operand_mode, recog_constraints, recog_operand_address_p):
New variables.
(extract_insn): New function.
* recog.h (extract_insn): Declare function.
(which_alternative, recog_n_operands, recog_n_dups,
recog_n_alternatives, recog_operand_mode, recog_constraints,
recog_operand_address_p): Declare variables.
* regclass.c (n_occurrences): New static function.
* reload.c (n_occurrences): Delete function.
(find_reloads): Use extract_insn.
* reload.h (n_occurrences): Delete declaration.
From-SVN: r23147
1998-10-17 03:28:57 +02:00
|
|
|
|
|
|
|
|
|
insn_extract (insn);
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < noperands; i++)
|
|
|
|
|
{
|
1999-09-12 14:46:08 +02:00
|
|
|
|
recog_data.constraints[i] = insn_data[icode].operand[i].constraint;
|
|
|
|
|
recog_data.operand_mode[i] = insn_data[icode].operand[i].mode;
|
2000-07-31 10:42:26 +02:00
|
|
|
|
/* VOIDmode match_operands gets mode from their real operand. */
|
|
|
|
|
if (recog_data.operand_mode[i] == VOIDmode)
|
|
|
|
|
recog_data.operand_mode[i] = GET_MODE (recog_data.operand[i]);
|
Makefile.in (insn-extract.o): Fix dependencies.
* Makefile.in (insn-extract.o): Fix dependencies.
* genextract.c (main): Generate includes for insn-config.h and
recog.h.
Delete generation of declarations which are now in recog.h.
* genrecog.c (main): Delete generation of definitions which are
now in recog.c.
* local-alloc.c (block_alloc): Use extract_insn and the variables
it sets up instead of looking up values by insn_code.
* recog.c (recog_operand, recog_operand_loc, recog_dup_loc,
recog_dup_num): Define here instead of generating the definition in
genrecog.c.
(recog_n_operands, recog_n_dups, recog_n_alternatives,
recog_operand_mode, recog_constraints, recog_operand_address_p):
New variables.
(extract_insn): New function.
* recog.h (extract_insn): Declare function.
(which_alternative, recog_n_operands, recog_n_dups,
recog_n_alternatives, recog_operand_mode, recog_constraints,
recog_operand_address_p): Declare variables.
* regclass.c (n_occurrences): New static function.
* reload.c (n_occurrences): Delete function.
(find_reloads): Use extract_insn.
* reload.h (n_occurrences): Delete declaration.
From-SVN: r23147
1998-10-17 03:28:57 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
1998-11-04 22:25:00 +01:00
|
|
|
|
for (i = 0; i < noperands; i++)
|
1999-09-12 03:51:28 +02:00
|
|
|
|
recog_data.operand_type[i]
|
|
|
|
|
= (recog_data.constraints[i][0] == '=' ? OP_OUT
|
|
|
|
|
: recog_data.constraints[i][0] == '+' ? OP_INOUT
|
|
|
|
|
: OP_IN);
|
1998-12-04 13:55:59 +01:00
|
|
|
|
|
1999-09-12 03:51:28 +02:00
|
|
|
|
if (recog_data.n_alternatives > MAX_RECOG_ALTERNATIVES)
|
1998-12-04 13:55:59 +01:00
|
|
|
|
abort ();
|
Makefile.in (insn-extract.o): Fix dependencies.
* Makefile.in (insn-extract.o): Fix dependencies.
* genextract.c (main): Generate includes for insn-config.h and
recog.h.
Delete generation of declarations which are now in recog.h.
* genrecog.c (main): Delete generation of definitions which are
now in recog.c.
* local-alloc.c (block_alloc): Use extract_insn and the variables
it sets up instead of looking up values by insn_code.
* recog.c (recog_operand, recog_operand_loc, recog_dup_loc,
recog_dup_num): Define here instead of generating the definition in
genrecog.c.
(recog_n_operands, recog_n_dups, recog_n_alternatives,
recog_operand_mode, recog_constraints, recog_operand_address_p):
New variables.
(extract_insn): New function.
* recog.h (extract_insn): Declare function.
(which_alternative, recog_n_operands, recog_n_dups,
recog_n_alternatives, recog_operand_mode, recog_constraints,
recog_operand_address_p): Declare variables.
* regclass.c (n_occurrences): New static function.
* reload.c (n_occurrences): Delete function.
(find_reloads): Use extract_insn.
* reload.h (n_occurrences): Delete declaration.
From-SVN: r23147
1998-10-17 03:28:57 +02:00
|
|
|
|
}
|
|
|
|
|
|
1998-12-04 13:55:59 +01:00
|
|
|
|
/* After calling extract_insn, you can use this function to extract some
|
|
|
|
|
information from the constraint strings into a more usable form.
|
|
|
|
|
The collected data is stored in recog_op_alt. */
|
|
|
|
|
void
|
|
|
|
|
preprocess_constraints ()
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
|
1999-09-14 20:19:09 +02:00
|
|
|
|
memset (recog_op_alt, 0, sizeof recog_op_alt);
|
1999-09-12 03:51:28 +02:00
|
|
|
|
for (i = 0; i < recog_data.n_operands; i++)
|
1998-12-04 13:55:59 +01:00
|
|
|
|
{
|
|
|
|
|
int j;
|
|
|
|
|
struct operand_alternative *op_alt;
|
1999-09-12 03:51:28 +02:00
|
|
|
|
const char *p = recog_data.constraints[i];
|
1998-12-04 13:55:59 +01:00
|
|
|
|
|
|
|
|
|
op_alt = recog_op_alt[i];
|
|
|
|
|
|
1999-09-12 03:51:28 +02:00
|
|
|
|
for (j = 0; j < recog_data.n_alternatives; j++)
|
1998-12-04 13:55:59 +01:00
|
|
|
|
{
|
|
|
|
|
op_alt[j].class = NO_REGS;
|
|
|
|
|
op_alt[j].constraint = p;
|
|
|
|
|
op_alt[j].matches = -1;
|
|
|
|
|
op_alt[j].matched = -1;
|
|
|
|
|
|
|
|
|
|
if (*p == '\0' || *p == ',')
|
|
|
|
|
{
|
|
|
|
|
op_alt[j].anything_ok = 1;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for (;;)
|
|
|
|
|
{
|
|
|
|
|
char c = *p++;
|
|
|
|
|
if (c == '#')
|
|
|
|
|
do
|
|
|
|
|
c = *p++;
|
|
|
|
|
while (c != ',' && c != '\0');
|
|
|
|
|
if (c == ',' || c == '\0')
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
switch (c)
|
|
|
|
|
{
|
|
|
|
|
case '=': case '+': case '*': case '%':
|
|
|
|
|
case 'E': case 'F': case 'G': case 'H':
|
|
|
|
|
case 's': case 'i': case 'n':
|
|
|
|
|
case 'I': case 'J': case 'K': case 'L':
|
|
|
|
|
case 'M': case 'N': case 'O': case 'P':
|
|
|
|
|
/* These don't say anything we care about. */
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case '?':
|
|
|
|
|
op_alt[j].reject += 6;
|
|
|
|
|
break;
|
|
|
|
|
case '!':
|
|
|
|
|
op_alt[j].reject += 600;
|
|
|
|
|
break;
|
|
|
|
|
case '&':
|
|
|
|
|
op_alt[j].earlyclobber = 1;
|
2002-05-09 03:42:28 +02:00
|
|
|
|
break;
|
1998-12-04 13:55:59 +01:00
|
|
|
|
|
|
|
|
|
case '0': case '1': case '2': case '3': case '4':
|
|
|
|
|
case '5': case '6': case '7': case '8': case '9':
|
2001-10-11 09:07:30 +02:00
|
|
|
|
{
|
|
|
|
|
char *end;
|
|
|
|
|
op_alt[j].matches = strtoul (p - 1, &end, 10);
|
|
|
|
|
recog_op_alt[op_alt[j].matches][j].matched = i;
|
|
|
|
|
p = end;
|
|
|
|
|
}
|
1998-12-04 13:55:59 +01:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'm':
|
|
|
|
|
op_alt[j].memory_ok = 1;
|
|
|
|
|
break;
|
|
|
|
|
case '<':
|
|
|
|
|
op_alt[j].decmem_ok = 1;
|
|
|
|
|
break;
|
|
|
|
|
case '>':
|
|
|
|
|
op_alt[j].incmem_ok = 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'V':
|
|
|
|
|
op_alt[j].nonoffmem_ok = 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'o':
|
|
|
|
|
op_alt[j].offmem_ok = 1;
|
|
|
|
|
break;
|
|
|
|
|
case 'X':
|
|
|
|
|
op_alt[j].anything_ok = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'p':
|
2000-10-27 22:58:57 +02:00
|
|
|
|
op_alt[j].is_address = 1;
|
2001-12-17 17:46:11 +01:00
|
|
|
|
op_alt[j].class = reg_class_subunion[(int) op_alt[j].class]
|
|
|
|
|
[(int) MODE_BASE_REG_CLASS (VOIDmode)];
|
1998-12-04 13:55:59 +01:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'g': case 'r':
|
|
|
|
|
op_alt[j].class = reg_class_subunion[(int) op_alt[j].class][(int) GENERAL_REGS];
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
2002-01-15 14:38:03 +01:00
|
|
|
|
op_alt[j].class = reg_class_subunion[(int) op_alt[j].class][(int) REG_CLASS_FROM_LETTER ((unsigned char) c)];
|
1998-12-04 13:55:59 +01:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-05-09 03:42:28 +02:00
|
|
|
|
|
1998-11-04 22:25:00 +01:00
|
|
|
|
/* Check the operands of an insn against the insn's operand constraints
|
1991-11-27 15:45:36 +01:00
|
|
|
|
and return 1 if they are valid.
|
1998-11-04 22:25:00 +01:00
|
|
|
|
The information about the insn's operands, constraints, operand modes
|
|
|
|
|
etc. is obtained from the global variables set up by extract_insn.
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
WHICH_ALTERNATIVE is set to a number which indicates which
|
|
|
|
|
alternative of constraints was matched: 0 for the first alternative,
|
|
|
|
|
1 for the next, etc.
|
|
|
|
|
|
|
|
|
|
In addition, when two operands are match
|
|
|
|
|
and it happens that the output operand is (reg) while the
|
|
|
|
|
input operand is --(reg) or ++(reg) (a pre-inc or pre-dec),
|
|
|
|
|
make the output operand look like the input.
|
|
|
|
|
This is because the output operand is the one the template will print.
|
|
|
|
|
|
|
|
|
|
This is used in final, just before printing the assembler code and by
|
|
|
|
|
the routines that determine an insn's attribute.
|
|
|
|
|
|
|
|
|
|
If STRICT is a positive non-zero value, it means that we have been
|
|
|
|
|
called after reload has been completed. In that case, we must
|
|
|
|
|
do all checks strictly. If it is zero, it means that we have been called
|
|
|
|
|
before reload has completed. In that case, we first try to see if we can
|
|
|
|
|
find an alternative that matches strictly. If not, we try again, this
|
|
|
|
|
time assuming that reload will fix up the insn. This provides a "best
|
|
|
|
|
guess" for the alternative and is used to compute attributes of insns prior
|
|
|
|
|
to reload. A negative value of STRICT is used for this internal call. */
|
|
|
|
|
|
|
|
|
|
struct funny_match
|
|
|
|
|
{
|
|
|
|
|
int this, other;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
int
|
1998-11-04 22:25:00 +01:00
|
|
|
|
constrain_operands (strict)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
int strict;
|
|
|
|
|
{
|
final.c (bb_str): Qualify a char* with the keyword `const'.
* final.c (bb_str): Qualify a char* with the keyword `const'.
(add_bb_string, final_scan_insn, output_asm_insn): Likewise.
* fix-header.c (read_scan_file): Likewise.
* genoutput.c (output_epilogue, process_template): Likewise.
* local-alloc.c (requires_inout, block_alloc): Likewise.
* output.h (output_asm_insn, assemble_string): Likewise.
* recog.c (recog_constraints, check_asm_operands,
decode_asm_operands, extract_insn, preprocess_constraints,
constrain_operands): Likewise.
* recog.h (operand_alternative, recog_constraints, insn_template,
insn_outfun, insn_operand_constraint, insn_name): Likewise.
* regclass.c (record_reg_classes, scan_one_insn): Likewise.
* regmove.c (find_matches): Likewise.
* reload.c (alternative_allows_memconst): Likewise.
* reload1.c (constraint_accepts_reg_p,
reload_cse_simplify_operands): Likewise.
* rtl.h (decode_asm_operands): Likewise.
* scan.h (fn_decl): Likewise.
* varasm.c (assemble_string): Likewise.
From-SVN: r24834
1999-01-23 20:45:50 +01:00
|
|
|
|
const char *constraints[MAX_RECOG_OPERANDS];
|
1992-04-18 00:42:49 +02:00
|
|
|
|
int matching_operands[MAX_RECOG_OPERANDS];
|
|
|
|
|
int earlyclobber[MAX_RECOG_OPERANDS];
|
2001-10-11 05:16:15 +02:00
|
|
|
|
int c;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
|
|
|
|
struct funny_match funny_match[MAX_RECOG_OPERANDS];
|
|
|
|
|
int funny_match_index;
|
|
|
|
|
|
2000-10-26 02:30:55 +02:00
|
|
|
|
which_alternative = 0;
|
1999-09-12 03:51:28 +02:00
|
|
|
|
if (recog_data.n_operands == 0 || recog_data.n_alternatives == 0)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
return 1;
|
|
|
|
|
|
1999-09-12 03:51:28 +02:00
|
|
|
|
for (c = 0; c < recog_data.n_operands; c++)
|
1992-04-18 00:42:49 +02:00
|
|
|
|
{
|
1999-09-12 03:51:28 +02:00
|
|
|
|
constraints[c] = recog_data.constraints[c];
|
1992-04-18 00:42:49 +02:00
|
|
|
|
matching_operands[c] = -1;
|
|
|
|
|
}
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
2000-10-26 02:30:55 +02:00
|
|
|
|
do
|
1991-11-27 15:45:36 +01:00
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
int opno;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
int lose = 0;
|
|
|
|
|
funny_match_index = 0;
|
|
|
|
|
|
1999-09-12 03:51:28 +02:00
|
|
|
|
for (opno = 0; opno < recog_data.n_operands; opno++)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
rtx op = recog_data.operand[opno];
|
1991-11-27 15:45:36 +01:00
|
|
|
|
enum machine_mode mode = GET_MODE (op);
|
2001-10-11 05:16:15 +02:00
|
|
|
|
const char *p = constraints[opno];
|
1991-11-27 15:45:36 +01:00
|
|
|
|
int offset = 0;
|
|
|
|
|
int win = 0;
|
|
|
|
|
int val;
|
|
|
|
|
|
1992-04-18 00:42:49 +02:00
|
|
|
|
earlyclobber[opno] = 0;
|
|
|
|
|
|
1996-10-24 00:02:32 +02:00
|
|
|
|
/* A unary operator may be accepted by the predicate, but it
|
alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO...
* alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO;
change gen_rtx(expr...) to gen_rtx_fmt_foo(expr...).
* caller-save.c, calls.c, combine.c, cse.c: Likewise.
* dwarf2out.c, except.c, explow.c, expmed.c, expr.c: Likewise.
* final.c, flow.c, function.c, genpeep.c, haifa-sched.c: Likewise.
* halfpic.c, integrate.c, jump.c, local-alloc.c, loop.c: Likewise.
* profile.c, recog.c, reg-stack.c, regclass.c, regmove.c: Likewise.
* reload.c, reload1.c, reorg.c, sched.c, stmt.c, stupid.c: Likewise.
* unroll.c, varasm.c: Likewise.
* config/alpha/alpha.c, config/alpha/alpha.md: Likewise.
From-SVN: r17357
1998-01-15 00:10:50 +01:00
|
|
|
|
is irrelevant for matching constraints. */
|
1996-10-24 00:02:32 +02:00
|
|
|
|
if (GET_RTX_CLASS (GET_CODE (op)) == '1')
|
|
|
|
|
op = XEXP (op, 0);
|
|
|
|
|
|
1991-11-27 15:45:36 +01:00
|
|
|
|
if (GET_CODE (op) == SUBREG)
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (SUBREG_REG (op)) == REG
|
|
|
|
|
&& REGNO (SUBREG_REG (op)) < FIRST_PSEUDO_REGISTER)
|
Use byte offsets in SUBREGs instead of words.
2001-04-03 Jakub Jelinek <jakub@redhat.com>
David S. Miller <davem@pierdol.cobaltmicro.com>
Andrew MacLeod <amacleod@redhat.com>
Use byte offsets in SUBREGs instead of words.
* alias.c (nonlocal_mentioned_p): Use subreg_regno function.
* caller-save.c (mark_set_regs): Change callers of subreg_hard_regno
to pass new argument.
(add_stored_regs): Use subreg_regno_offset function.
* calls.c (expand_call): For non-paradoxical SUBREG take endianess
into account.
(precompute_arguments): Use gen_lowpart_SUBREG.
* combine.c (try_combine): Replace explicit XEXP with SUBREG_REG.
(combine_simplify_rtx): Rework to use SUBREG_BYTE.
(simplify_set): Rework to use SUBREG_BYTE.
(expand_field_assignment): Use SUBREG_BYTE.
(make_extraction): Use SUBREG_BYTE.
(if_then_else_cond): Use SUBREG_BYTE.
(apply_distributive_law): Use SUBREG_BYTE and fixup subreg comments.
(gen_lowpart_for_combine): Compute full byte offset.
* cse.c (mention_regs): Use SUBREG_BYTE.
(remove_invalid_subreg_refs): Rework to use SUBREG_BYTE.
(canon_hash): Use SUBREG_BYTE.
(fold_rtx): Pass SUBREG_BYTE div UNITS_PER_WORD to operand_subword.
(gen_lowpart_if_possible): Formatting.
* dbxout.c (dbxout_symbol_location): Compute SUBREG hard regnos
correctly.
* dwarf2out.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG
(mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG
(loc_descriptor): Fixup explicit XEXP into SUBREG_REG
* dwarfout.c (is_pseudo_reg): Fixup explicit XEXP into SUBREG_REG
(output_mem_loc_descriptor): Fixup explicit XEXP into SUBREG_REG
(output_loc_descriptor): Fixup explicit XEXP into SUBREG_REG
* emit-rtl.c (gen_rtx_SUBREG): New function, used to verify
certain invariants about SUBREGs the compiler creates.
(gen_lowpart_SUBREG): New function.
(subreg_hard_regno): New function to get the final register number.
(gen_lowpart_common): Use SUBREG_BYTE.
(gen_imagpart): Spacing nits.
(subreg_realpart_p): Use SUBREG_BYTE.
(gen_highpart): Use SUBREG_BYTE.
(subreg_lowpart_p): Always compute endian corrected goal offset,
even at the byte level, then compare against that.
(constant_subword): New function, pulled out all constant cases
from operand_subword and changed second argument name to offset.
(operand_subword): Detect non REG/SUBREG/CONCAT/MEM cases early
and call constant_subword to do the work. Return const0_rtx if
looking for a word outside of OP.
(operand_subword_force): Change second arg name to offset.
* expmed.c (store_bit_field): Use SUBREG_BYTE.
(store_split_bit_field): Use SUBREG_BYTE.
(extract_bit_field): Use SUBREG_BYTE.
(extract_split_bit_field): Use SUBREG_BYTE.
(expand_shift): Use SUBREG_BYTE.
* expr.c (store_expr, expand_expr): Use gen_lowpart_SUBREG.
* final.c (alter_subreg) Use subreg_hard_regno and SUBREG_BYTE.
* flow.c (set_noop_p): Use SUBREG_BYTE.
(mark_set_1): Remove ALTER_HARD_SUBREG. Use subreg_regno_offset instead.
* function.c (fixup_var_refs_1): Fixup explicit XEXP into a SUBREG_REG.
(fixup_memory_subreg): Use SUBREG_BYTE and remove byte endian
correction code.
(optimize_bit_field): Use SUBREG_BYTE.
(purge_addressof_1): Use SUBREG_BYTE.
(purge_single_hard_subreg_set): Use subreg_regno_offset function.
(assign_params): Mark arguments SUBREG_PROMOTED_VAR_P if they are
actually promoted by the caller and PROMOTE_FOR_CALLS_ONLY is true.
* gengenrtl.c (special_rtx): Add SUBREG.
* global.c (mark_reg_store): Use SUBREG_BYTE.
(set_preference): Rework to use subreg_regno_offset and SUBREG_BYTE.
* ifcvt (noce_emit_move_insn): Use SUBREG_BYTE.
* integrate.c (copy_rtx_and_substitute): Use SUBREG_BYTE and make sure
final byte offset is congruent to subreg's mode size.
(subst_constants): Use SUBREG_BYTE.
(mark_stores): Use subreg_regno_offset function.
* jump.c (rtx_renumbered_equal_p, true_regnum): Use subreg_regno_offset
function and SUBREG_BYTE.
* local-alloc.c (combine_regs): Use subreg_regno_offset function.
(reg_is_born): Use subreg_hard_regno.
* recog.c (valid_replace_rtx_1): Use SUBREG_BYTE and remove byte
endian correction code. Don't combine subregs unless resulting
offset aligns with type. Fix subreg constant extraction for DImode.
Simplify SUBREG of VOIDmode CONST_DOUBLE.
(general_operand): Remove dead mode_altering_drug code.
(indirect_operand): Use SUBREG_BYTE.
(constrain_operands): Use subreg_regno_offset function.
* reg-stack.c (get_true_reg): Use subreg_regno_offset function.
* regmove.c (regmove_optimize): Use SUBREG_BYTE.
(optimize_reg_copy_3): Use gen_lowpart_SUBREG.
* regs.h (REG_SIZE): Allow target to override.
(REGMODE_NATURAL_SIZE): New macro which target can override.
* reload.c (reload_inner_reg_of_subreg): subreg_regno should be used
on the entire subreg rtx.
(push_reload): Use SUBREG_BYTE in comments and code.
(find_dummy_reload): Use subreg_regno_offset. Only adjust offsets
for hard registers inside subregs.
(operands_match_p): Use subreg_regno_offset.
(find_reloads): Use SUBREG_BYTE and only advance offset for subregs
containing hard regs.
(find_reload_toplev): Use SUBREG_BYTE. Remove byte endian
corrections when fixing up MEM subregs.
(find_reloads_address_1): Use SUBREG_BYTE, subreg_regno, and
subreg_regno_offset where appropriate.
(find_reloads_subreg_address): Use SUBREG_BYTE. Remove
byte endian corrections when fixing up MEM subregs.
(subst_reloads): When combining two subregs, make sure final
offset is congruent to subreg's mode size.
(find_replacement): Use SUBREG_BYTE and subreg_regno_offset.
(refers_to_regno_for_reload_p): Use subreg_regno.
(reg_overlap_mentioned_for_reload_p): Use subreg_regno_offset.
* reload1.c (eliminate_regs) Use SUBREG_BYTE. Remove byte endian
correction code for memory subreg fixups.
(forget_old_reload_1): Use subreg_regno_offset.
(choose_reload_regs): Use subreg_regno.
(emit_input_reload_insns): Use SUBREG_BYTE.
(reload_combine_note_store): Use subreg_regno_offset.
(move2add_note_store): Use subreg_regno_offset.
* resource.c (update_live_status, mark_referenced_resources): Use
subreg_regno function.
(mark_set_resources): Use subreg_regno function.
* rtl.h (SUBREG_WORD): Rename to SUBREG_BYTE.
(subreg_regno_offset, subreg_regno): Define prototypes.
(subreg_hard_regno, constant_subword, gen_rtx_SUBREG): Newi functions.
(gen_lowpart_SUBREG): Add prototype.
* rtl.texi (subreg): Update to reflect new byte offset representation.
Add mentioning of the effect that BYTES_BIG_ENDIAN has on subregs now.
* rtlanal.c (refers_to_regno_p): Use subreg_regno.
(reg_overlap_mentioned_p): Use subreg_regno.
(replace_regs); Make sure final offset of combined subreg is
congruent to size of subreg's mode.
(subreg_regno_offset): New function.
(subreg_regno): New function.
* sched-vis.c (print_value): Change SUBREG_WORD to SUBREG_BYTE.
* sdbout.c (sdbout_symbol): Compute offset using alter_subreg.
* stmt.c (expand_anon_union_decl): Use gen_lowpart_SUBREG.
* tm.texi (ALTER_HARD_SUBREG): Remove, it is now dead.
(SUBREG_REGNO_OFFSET): Describe SUBREG_REGNO_OFFSET overrides.
* config/a29k/a29k.c (gpc_reg_operand): Use subreg_regno.
(a29k_get_reloaded_address): Use SUBREG_BYTE.
(print_operand): Use SUBREG_BYTE.
* config/alpha/alpha.c (print_operand_address): Use SUBREG_BYTE.
* config/arm/arm.c (arm_reload_in_hi): Use SUBREG_BYTE.
(arm_reload_out_hi): Use SUBREG_BYTE.
* config/d30v/d30v.c (d30v_split_double): Use subreg_regno_offset
instead of SUBREG_WORD.
(d30v_print_operand_memory_reference): Use subreg_regno_offset.
* config/dsp16xx/dsp16xx.md (extendqihi2, zero_extendqihi2): Fix
SUBREG creation to use byte offset.
* config/h8300/h8300.md (Unnamed HImode zero extraction and 16bit
inverted load insns): Fix explicit rtl subregs to use byte
offsets.
* config/i370/i370.md (cmpstrsi, movstrsi, mulsi3, divsi3,
udivsi3, umodsi3): Generate SUBREGs with byte offsets.
* config/i860/i860.c (single_insn_src_p): Use SUBREG_BYTE.
* config/i860/i860.md (mulsi3_big): Fixup explicit SUBREGs in rtl
to use byte offsets.
(unnamed fmlow.dd insn): Fixup SUBREGS to use byte offsets.
* config/i960/i960.md (extendhisi2): Generate SUBREGs with byte
offsets, also make sure it is congruent to SUBREG's mode size.
(extendqisi2, extendqihi2, zero_extendhisi2, zero_extendqisi2,
unnamed ldob insn): Generate SUBREGs with byte offset.
(zero_extendqihi2): SUBREG's are byte offsets.
* config/m68hc11/m68hc11.c (m68hc11_gen_lowpart): Use SUBREG_BYTE.
(m68hc11_gen_highpart): Use SUBREG_BYTE.
* config/m68k/m68k.md (zero_extendhisi2, zero_extendqihi2,
zero-extendqisi2): Generate SUBREGs with byte offset.
(umulsidi3, mulsidi3, subreghi1ashrdi_const32,
subregsi1ashrdi_const32, subreg1lshrdi_const32): Fixup explicit
subregs in rtl to use byte offsets.
* config/m88k/m88k.md (extendsidi2): fixup subregs to use byte offset.
* config/mips/mips.c (mips_move_1word): Use subreg_regno_offset.
(mips_move_2words): Use subreg_regno_offset.
(mips_secondary_reload_class): Use subreg_regno_offset.
* config/mips/mips.md (DImode plus, minus, move, and logical op
splits): Fixup explicit subregs in rtl to use byte offsets.
* config/mn10200/mn10200.c (print_operand): Use subreg_regno function.
* config/mn10300/mn10300.c (print_operand): Use subreg_regno function.
* config/ns32k/ns32k.md (udivmoddisi4): Fix explicit subregs in
rtl to use byte offsets.
* config/pa/pa.c (emit_move_sequence): Use SUBREG_BYTE.
* config/pa/pa.md (floatunssisf2, floatunssidf2, mulsi3): fix explicit
subregs to use byte offsets.
* config/pdp11/pdp11.md (zero_extendhisi2, modhi3, modhi3+1):
Fixup explicit subregs in rtl to use byte offsets.
* config/romp/romp.c (memory_offset_in_range_p): Use SUBREG_BYTE
and remove byte endian correction code.
* config/sh/sh.c (output_movedouble): Use subreg_regno.
(gen_ashift_hi): Use SUBREG_BYTE.
(regs_used): Use subreg_regno_offset.
(machine_dependent_reorg): Use subreg_regno_offset.
* config/sh/sh.h (INDEX_REGISTER_RTX_P): Use SUBREG_BYTE.
* config/sh/sh.md (DImode and DFmode move splits): Use subreg_regno.
(movdf_i4): Subregs are byte offsets now.
* config/sparc/sparc.c (ultra_find_type): Use SUBREG_BYTE.
* config/sparc/sparc.h (ALTER_HARD_SUBREG): Removed.
(REGMODE_NATURAL_SIZE): Override.
(REG_SIZE): For SUBREG check float mode on SUBREG_REG's mode.
* config/sparc/sparc.md (TFmode move splits): Generate SUBREGs
with byte offsets.
(zero_extendhisi2, zero_extendqidi2_insn, extendhisi2,
extendqihi2, sign_extendqihi2_insn, sign_extendqisi2_insn,
extendqidi2): Generate SUBREGs with byte offsets, also make sure
it is congruent to SUBREG's mode size.
(smulsi3_highpart_v8plus): Fix explicit subregs in rtl to use byte
offsets.
(cmp_siqi_trunc, cmp_siqi_trunc_set, cmp_diqi_trunc,
cmp_diqi_trunc_set, lshrdi3_v8plus+1, lshrdi3_v8plus+2,
lshrdi3_v8plus+3, lshrdi3_v8plus+4): Use proper
SUBREG_BYTE offset for non-paradoxical subregs in patterns.
* config/v850/v850.c (print_operand, output_move_double): Use
subreg_regno function.
Co-Authored-By: Andrew MacLeod <amacleod@redhat.com>
Co-Authored-By: David S. Miller <davem@pierdol.cobaltmicro.com>
From-SVN: r41058
2001-04-03 17:06:12 +02:00
|
|
|
|
offset = subreg_regno_offset (REGNO (SUBREG_REG (op)),
|
|
|
|
|
GET_MODE (SUBREG_REG (op)),
|
|
|
|
|
SUBREG_BYTE (op),
|
|
|
|
|
GET_MODE (op));
|
1991-11-27 15:45:36 +01:00
|
|
|
|
op = SUBREG_REG (op);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* An empty constraint or empty alternative
|
|
|
|
|
allows anything which matched the pattern. */
|
|
|
|
|
if (*p == 0 || *p == ',')
|
|
|
|
|
win = 1;
|
|
|
|
|
|
|
|
|
|
while (*p && (c = *p++) != ',')
|
|
|
|
|
switch (c)
|
|
|
|
|
{
|
1999-09-07 07:49:18 +02:00
|
|
|
|
case '?': case '!': case '*': case '%':
|
|
|
|
|
case '=': case '+':
|
1991-11-27 15:45:36 +01:00
|
|
|
|
break;
|
|
|
|
|
|
1994-03-06 21:17:55 +01:00
|
|
|
|
case '#':
|
|
|
|
|
/* Ignore rest of this alternative as far as
|
|
|
|
|
constraint checking is concerned. */
|
|
|
|
|
while (*p && *p != ',')
|
|
|
|
|
p++;
|
|
|
|
|
break;
|
|
|
|
|
|
1992-04-18 00:42:49 +02:00
|
|
|
|
case '&':
|
|
|
|
|
earlyclobber[opno] = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
1999-09-07 07:49:18 +02:00
|
|
|
|
case '0': case '1': case '2': case '3': case '4':
|
|
|
|
|
case '5': case '6': case '7': case '8': case '9':
|
2001-10-11 09:07:30 +02:00
|
|
|
|
{
|
|
|
|
|
/* This operand must be the same as a previous one.
|
|
|
|
|
This kind of constraint is used for instructions such
|
|
|
|
|
as add when they take only two operands.
|
|
|
|
|
|
|
|
|
|
Note that the lower-numbered operand is passed first.
|
|
|
|
|
|
|
|
|
|
If we are not testing strictly, assume that this
|
|
|
|
|
constraint will be satisfied. */
|
|
|
|
|
|
|
|
|
|
char *end;
|
|
|
|
|
int match;
|
|
|
|
|
|
|
|
|
|
match = strtoul (p - 1, &end, 10);
|
|
|
|
|
p = end;
|
|
|
|
|
|
|
|
|
|
if (strict < 0)
|
|
|
|
|
val = 1;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rtx op1 = recog_data.operand[match];
|
|
|
|
|
rtx op2 = recog_data.operand[opno];
|
|
|
|
|
|
|
|
|
|
/* A unary operator may be accepted by the predicate,
|
|
|
|
|
but it is irrelevant for matching constraints. */
|
|
|
|
|
if (GET_RTX_CLASS (GET_CODE (op1)) == '1')
|
|
|
|
|
op1 = XEXP (op1, 0);
|
|
|
|
|
if (GET_RTX_CLASS (GET_CODE (op2)) == '1')
|
|
|
|
|
op2 = XEXP (op2, 0);
|
|
|
|
|
|
|
|
|
|
val = operands_match_p (op1, op2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
matching_operands[opno] = match;
|
|
|
|
|
matching_operands[match] = opno;
|
|
|
|
|
|
|
|
|
|
if (val != 0)
|
|
|
|
|
win = 1;
|
|
|
|
|
|
|
|
|
|
/* If output is *x and input is *--x, arrange later
|
|
|
|
|
to change the output to *--x as well, since the
|
|
|
|
|
output op is the one that will be printed. */
|
|
|
|
|
if (val == 2 && strict > 0)
|
|
|
|
|
{
|
|
|
|
|
funny_match[funny_match_index].this = opno;
|
|
|
|
|
funny_match[funny_match_index++].other = match;
|
|
|
|
|
}
|
|
|
|
|
}
|
1991-11-27 15:45:36 +01:00
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'p':
|
|
|
|
|
/* p is used for address_operands. When we are called by
|
1994-10-17 16:30:22 +01:00
|
|
|
|
gen_reload, no one will have checked that the address is
|
|
|
|
|
strictly valid, i.e., that all pseudos requiring hard regs
|
|
|
|
|
have gotten them. */
|
1991-11-27 15:45:36 +01:00
|
|
|
|
if (strict <= 0
|
1999-09-12 03:51:28 +02:00
|
|
|
|
|| (strict_memory_address_p (recog_data.operand_mode[opno],
|
1998-11-04 22:25:00 +01:00
|
|
|
|
op)))
|
1991-11-27 15:45:36 +01:00
|
|
|
|
win = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
/* No need to check general_operand again;
|
|
|
|
|
it was done in insn-recog.c. */
|
|
|
|
|
case 'g':
|
|
|
|
|
/* Anything goes unless it is a REG and really has a hard reg
|
|
|
|
|
but the hard reg is not in the class GENERAL_REGS. */
|
|
|
|
|
if (strict < 0
|
|
|
|
|
|| GENERAL_REGS == ALL_REGS
|
|
|
|
|
|| GET_CODE (op) != REG
|
1992-05-27 12:21:59 +02:00
|
|
|
|
|| (reload_in_progress
|
|
|
|
|
&& REGNO (op) >= FIRST_PSEUDO_REGISTER)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|| reg_fits_class_p (op, GENERAL_REGS, offset, mode))
|
|
|
|
|
win = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'X':
|
1996-07-04 00:07:53 +02:00
|
|
|
|
/* This is used for a MATCH_SCRATCH in the cases when
|
|
|
|
|
we don't actually need anything. So anything goes
|
|
|
|
|
any time. */
|
1991-11-27 15:45:36 +01:00
|
|
|
|
win = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'm':
|
|
|
|
|
if (GET_CODE (op) == MEM
|
|
|
|
|
/* Before reload, accept what reload can turn into mem. */
|
1992-05-27 12:21:59 +02:00
|
|
|
|
|| (strict < 0 && CONSTANT_P (op))
|
|
|
|
|
/* During reload, accept a pseudo */
|
|
|
|
|
|| (reload_in_progress && GET_CODE (op) == REG
|
|
|
|
|
&& REGNO (op) >= FIRST_PSEUDO_REGISTER))
|
1991-11-27 15:45:36 +01:00
|
|
|
|
win = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case '<':
|
|
|
|
|
if (GET_CODE (op) == MEM
|
|
|
|
|
&& (GET_CODE (XEXP (op, 0)) == PRE_DEC
|
|
|
|
|
|| GET_CODE (XEXP (op, 0)) == POST_DEC))
|
|
|
|
|
win = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case '>':
|
|
|
|
|
if (GET_CODE (op) == MEM
|
|
|
|
|
&& (GET_CODE (XEXP (op, 0)) == PRE_INC
|
|
|
|
|
|| GET_CODE (XEXP (op, 0)) == POST_INC))
|
|
|
|
|
win = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'E':
|
|
|
|
|
case 'F':
|
|
|
|
|
if (GET_CODE (op) == CONST_DOUBLE)
|
|
|
|
|
win = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'G':
|
|
|
|
|
case 'H':
|
|
|
|
|
if (GET_CODE (op) == CONST_DOUBLE
|
|
|
|
|
&& CONST_DOUBLE_OK_FOR_LETTER_P (op, c))
|
|
|
|
|
win = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 's':
|
|
|
|
|
if (GET_CODE (op) == CONST_INT
|
|
|
|
|
|| (GET_CODE (op) == CONST_DOUBLE
|
|
|
|
|
&& GET_MODE (op) == VOIDmode))
|
|
|
|
|
break;
|
|
|
|
|
case 'i':
|
|
|
|
|
if (CONSTANT_P (op))
|
|
|
|
|
win = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'n':
|
|
|
|
|
if (GET_CODE (op) == CONST_INT
|
|
|
|
|
|| (GET_CODE (op) == CONST_DOUBLE
|
|
|
|
|
&& GET_MODE (op) == VOIDmode))
|
|
|
|
|
win = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'I':
|
|
|
|
|
case 'J':
|
|
|
|
|
case 'K':
|
|
|
|
|
case 'L':
|
|
|
|
|
case 'M':
|
|
|
|
|
case 'N':
|
|
|
|
|
case 'O':
|
|
|
|
|
case 'P':
|
|
|
|
|
if (GET_CODE (op) == CONST_INT
|
|
|
|
|
&& CONST_OK_FOR_LETTER_P (INTVAL (op), c))
|
|
|
|
|
win = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'V':
|
|
|
|
|
if (GET_CODE (op) == MEM
|
1996-03-12 01:08:58 +01:00
|
|
|
|
&& ((strict > 0 && ! offsettable_memref_p (op))
|
|
|
|
|
|| (strict < 0
|
|
|
|
|
&& !(CONSTANT_P (op) || GET_CODE (op) == MEM))
|
|
|
|
|
|| (reload_in_progress
|
|
|
|
|
&& !(GET_CODE (op) == REG
|
|
|
|
|
&& REGNO (op) >= FIRST_PSEUDO_REGISTER))))
|
1991-11-27 15:45:36 +01:00
|
|
|
|
win = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case 'o':
|
|
|
|
|
if ((strict > 0 && offsettable_memref_p (op))
|
|
|
|
|
|| (strict == 0 && offsettable_nonstrict_memref_p (op))
|
|
|
|
|
/* Before reload, accept what reload can handle. */
|
|
|
|
|
|| (strict < 0
|
1992-05-27 12:21:59 +02:00
|
|
|
|
&& (CONSTANT_P (op) || GET_CODE (op) == MEM))
|
|
|
|
|
/* During reload, accept a pseudo */
|
|
|
|
|
|| (reload_in_progress && GET_CODE (op) == REG
|
|
|
|
|
&& REGNO (op) >= FIRST_PSEUDO_REGISTER))
|
1991-11-27 15:45:36 +01:00
|
|
|
|
win = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
2000-08-29 02:44:21 +02:00
|
|
|
|
{
|
|
|
|
|
enum reg_class class;
|
|
|
|
|
|
|
|
|
|
class = (c == 'r' ? GENERAL_REGS : REG_CLASS_FROM_LETTER (c));
|
|
|
|
|
if (class != NO_REGS)
|
|
|
|
|
{
|
|
|
|
|
if (strict < 0
|
|
|
|
|
|| (strict == 0
|
|
|
|
|
&& GET_CODE (op) == REG
|
|
|
|
|
&& REGNO (op) >= FIRST_PSEUDO_REGISTER)
|
|
|
|
|
|| (strict == 0 && GET_CODE (op) == SCRATCH)
|
|
|
|
|
|| (GET_CODE (op) == REG
|
|
|
|
|
&& reg_fits_class_p (op, class, offset, mode)))
|
|
|
|
|
win = 1;
|
|
|
|
|
}
|
|
|
|
|
#ifdef EXTRA_CONSTRAINT
|
|
|
|
|
else if (EXTRA_CONSTRAINT (op, c))
|
|
|
|
|
win = 1;
|
|
|
|
|
#endif
|
|
|
|
|
break;
|
|
|
|
|
}
|
1991-11-27 15:45:36 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
constraints[opno] = p;
|
|
|
|
|
/* If this operand did not win somehow,
|
|
|
|
|
this alternative loses. */
|
|
|
|
|
if (! win)
|
|
|
|
|
lose = 1;
|
|
|
|
|
}
|
|
|
|
|
/* This alternative won; the operands are ok.
|
|
|
|
|
Change whichever operands this alternative says to change. */
|
|
|
|
|
if (! lose)
|
|
|
|
|
{
|
1992-04-18 00:42:49 +02:00
|
|
|
|
int opno, eopno;
|
|
|
|
|
|
|
|
|
|
/* See if any earlyclobber operand conflicts with some other
|
|
|
|
|
operand. */
|
|
|
|
|
|
|
|
|
|
if (strict > 0)
|
1999-09-12 03:51:28 +02:00
|
|
|
|
for (eopno = 0; eopno < recog_data.n_operands; eopno++)
|
1992-04-19 22:00:41 +02:00
|
|
|
|
/* Ignore earlyclobber operands now in memory,
|
|
|
|
|
because we would often report failure when we have
|
|
|
|
|
two memory operands, one of which was formerly a REG. */
|
|
|
|
|
if (earlyclobber[eopno]
|
1999-09-12 03:51:28 +02:00
|
|
|
|
&& GET_CODE (recog_data.operand[eopno]) == REG)
|
|
|
|
|
for (opno = 0; opno < recog_data.n_operands; opno++)
|
|
|
|
|
if ((GET_CODE (recog_data.operand[opno]) == MEM
|
|
|
|
|
|| recog_data.operand_type[opno] != OP_OUT)
|
1992-04-18 00:42:49 +02:00
|
|
|
|
&& opno != eopno
|
1996-07-04 00:07:53 +02:00
|
|
|
|
/* Ignore things like match_operator operands. */
|
1999-09-12 03:51:28 +02:00
|
|
|
|
&& *recog_data.constraints[opno] != 0
|
1992-04-18 00:42:49 +02:00
|
|
|
|
&& ! (matching_operands[opno] == eopno
|
1999-09-12 03:51:28 +02:00
|
|
|
|
&& operands_match_p (recog_data.operand[opno],
|
|
|
|
|
recog_data.operand[eopno]))
|
|
|
|
|
&& ! safe_from_earlyclobber (recog_data.operand[opno],
|
|
|
|
|
recog_data.operand[eopno]))
|
1992-04-18 00:42:49 +02:00
|
|
|
|
lose = 1;
|
|
|
|
|
|
|
|
|
|
if (! lose)
|
1991-11-27 15:45:36 +01:00
|
|
|
|
{
|
1992-04-18 00:42:49 +02:00
|
|
|
|
while (--funny_match_index >= 0)
|
|
|
|
|
{
|
1999-09-12 03:51:28 +02:00
|
|
|
|
recog_data.operand[funny_match[funny_match_index].other]
|
|
|
|
|
= recog_data.operand[funny_match[funny_match_index].this];
|
1992-04-18 00:42:49 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 1;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
which_alternative++;
|
|
|
|
|
}
|
2000-10-26 02:30:55 +02:00
|
|
|
|
while (which_alternative < recog_data.n_alternatives);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
|
2000-09-12 01:54:11 +02:00
|
|
|
|
which_alternative = -1;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
/* If we are about to reject this, but we are not to test strictly,
|
|
|
|
|
try a very loose test. Only return failure if it fails also. */
|
|
|
|
|
if (strict == 0)
|
1998-11-04 22:25:00 +01:00
|
|
|
|
return constrain_operands (-1);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
else
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return 1 iff OPERAND (assumed to be a REG rtx)
|
alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO...
* alias.c: Change all uses of gen_rtx(FOO...) to gen_rtx_FOO;
change gen_rtx(expr...) to gen_rtx_fmt_foo(expr...).
* caller-save.c, calls.c, combine.c, cse.c: Likewise.
* dwarf2out.c, except.c, explow.c, expmed.c, expr.c: Likewise.
* final.c, flow.c, function.c, genpeep.c, haifa-sched.c: Likewise.
* halfpic.c, integrate.c, jump.c, local-alloc.c, loop.c: Likewise.
* profile.c, recog.c, reg-stack.c, regclass.c, regmove.c: Likewise.
* reload.c, reload1.c, reorg.c, sched.c, stmt.c, stupid.c: Likewise.
* unroll.c, varasm.c: Likewise.
* config/alpha/alpha.c, config/alpha/alpha.md: Likewise.
From-SVN: r17357
1998-01-15 00:10:50 +01:00
|
|
|
|
is a hard reg in class CLASS when its regno is offset by OFFSET
|
1991-11-27 15:45:36 +01:00
|
|
|
|
and changed to mode MODE.
|
|
|
|
|
If REG occupies multiple hard regs, all of them must be in CLASS. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
reg_fits_class_p (operand, class, offset, mode)
|
|
|
|
|
rtx operand;
|
2001-10-11 05:16:15 +02:00
|
|
|
|
enum reg_class class;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
int offset;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
int regno = REGNO (operand);
|
1991-11-27 15:45:36 +01:00
|
|
|
|
if (regno < FIRST_PSEUDO_REGISTER
|
|
|
|
|
&& TEST_HARD_REG_BIT (reg_class_contents[(int) class],
|
|
|
|
|
regno + offset))
|
|
|
|
|
{
|
2001-10-11 05:16:15 +02:00
|
|
|
|
int sr;
|
1991-11-27 15:45:36 +01:00
|
|
|
|
regno += offset;
|
|
|
|
|
for (sr = HARD_REGNO_NREGS (regno, mode) - 1;
|
|
|
|
|
sr > 0; sr--)
|
|
|
|
|
if (! TEST_HARD_REG_BIT (reg_class_contents[(int) class],
|
|
|
|
|
regno + sr))
|
|
|
|
|
break;
|
|
|
|
|
return sr == 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
1999-02-02 22:22:52 +01:00
|
|
|
|
|
2001-06-08 14:19:12 +02:00
|
|
|
|
/* Split single instruction. Helper function for split_all_insns.
|
2001-10-16 06:19:26 +02:00
|
|
|
|
Return last insn in the sequence if successful, or NULL if unsuccessful. */
|
2001-06-08 14:19:12 +02:00
|
|
|
|
static rtx
|
|
|
|
|
split_insn (insn)
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
rtx set;
|
|
|
|
|
if (!INSN_P (insn))
|
|
|
|
|
;
|
|
|
|
|
/* Don't split no-op move insns. These should silently
|
|
|
|
|
disappear later in final. Splitting such insns would
|
|
|
|
|
break the code that handles REG_NO_CONFLICT blocks. */
|
|
|
|
|
|
|
|
|
|
else if ((set = single_set (insn)) != NULL && set_noop_p (set))
|
|
|
|
|
{
|
|
|
|
|
/* Nops get in the way while scheduling, so delete them
|
|
|
|
|
now if register allocation has already been done. It
|
|
|
|
|
is too risky to try to do this before register
|
|
|
|
|
allocation, and there are unlikely to be very many
|
|
|
|
|
nops then anyways. */
|
|
|
|
|
if (reload_completed)
|
2002-03-14 11:10:13 +01:00
|
|
|
|
delete_insn_and_edges (insn);
|
2001-06-08 14:19:12 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Split insns here to get max fine-grain parallelism. */
|
|
|
|
|
rtx first = PREV_INSN (insn);
|
|
|
|
|
rtx last = try_split (PATTERN (insn), insn, 1);
|
|
|
|
|
|
|
|
|
|
if (last != insn)
|
|
|
|
|
{
|
|
|
|
|
/* try_split returns the NOTE that INSN became. */
|
|
|
|
|
PUT_CODE (insn, NOTE);
|
|
|
|
|
NOTE_SOURCE_FILE (insn) = 0;
|
|
|
|
|
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
|
|
|
|
|
|
|
|
|
|
/* ??? Coddle to md files that generate subregs in post-
|
2002-05-09 03:42:28 +02:00
|
|
|
|
reload splitters instead of computing the proper
|
2001-06-08 14:19:12 +02:00
|
|
|
|
hard register. */
|
|
|
|
|
if (reload_completed && first != last)
|
|
|
|
|
{
|
|
|
|
|
first = NEXT_INSN (first);
|
|
|
|
|
while (1)
|
|
|
|
|
{
|
|
|
|
|
if (INSN_P (first))
|
|
|
|
|
cleanup_subreg_operands (first);
|
|
|
|
|
if (first == last)
|
|
|
|
|
break;
|
|
|
|
|
first = NEXT_INSN (first);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return last;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return NULL_RTX;
|
|
|
|
|
}
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
/* Split all insns in the function. If UPD_LIFE, update life info after. */
|
1999-02-02 22:22:52 +01:00
|
|
|
|
|
|
|
|
|
void
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
split_all_insns (upd_life)
|
|
|
|
|
int upd_life;
|
1999-02-02 22:22:52 +01:00
|
|
|
|
{
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
sbitmap blocks;
|
|
|
|
|
int changed;
|
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain.
* bb-reorder.c (make_reorder_chain, make_reorder_chain_1):
Use FOR_EACH_BB macros to iterate over basic block chain.
* cfg.c (clear_edges, clear_bb_flags, dump_flow_info,
alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges):
Likewise.
* cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add,
find_unreachable_blocks, create_edge_list, verify_edge_list,
remove_fake_edges, add_noreturn_fake_exit_edges,
flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute):
Likewise.
* cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks,
find_sub_basic_blocks): Likewise.
* cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks):
Likewise.
* cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps):
Likewise.
* cfgloop.c (flow_loops_cfg_dump, flow_loops_find):
Likewise.
* cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges,
commit_edge_insertions, commit_edge_insertions_watch_calls,
print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise.
* combine.c (combine_instructions, reg_dead_at_p): Likewise.
* conflict.c (conflict_graph_compute): Likewise.
* df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1,
df_modified_p, df_refs_unlink, df_dump): Likewise.
* dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise.
* final.c (compute_alignments): Likewise.
* flow.c (update_life_info, update_life_info_in_dirty_blocks,
delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data,
count_or_remove_death_notes): Likewise.
* gcse.c (oprs_unchanged_p, record_last_reg_set_info,
compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill,
classic_gcse, compute_transp, cprop, compute_pre_data,
compute_transpout, invalidate_nonnull_info,
delete_null_pointer_checks_1, delete_null_pointer_checks,
compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems,
compute_store_table, build_store_vectors, store_motion): Likewise.
* global.c (global_conflicts, mark_elimination): Likewise.
* graph.c (print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (sched_init): Likewise.
* ifcvt.c (if_convert): Likewise.
* lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete,
compute_available, compute_nearerout, compute_rev_insert_delete,
optimize_mode_switching): Likewise.
* local-alloc.c (local_alloc, update_equiv_regs): Likewise.
* predict.c (estimate_probability, note_prediction_to_br_prob,
propagate_freq, counts_to_freqs, expensive_function_p,
estimate_bb_frequencies): Likewise.
* profile.c (instrument_edges, get_exec_counts,
compute_branch_probabilities, compute_checksum, branch_prob,
find_spanning_tree): Likewise.
* recog.c (split_all_insns, peephole2_optimize): Likewise.
* reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs):
Likewise.
* regclass.c (scan_one_insn, regclass): Likewise.
* regmove.c (mark_flags_life_zones, regmove_optimize,
record_stack_memrefs): Likewise.
* regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise.
* reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise.
* resource.c (find_basic_block): Likewise.
* sched-ebb.c (schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, build_control_flow,
find_single_block_region, find_rgns, schedule_insns)
* sibcall.c (optimize_sibling_and_tail_recursive_call)
* ssa-ccp.c (optimize_unexecutable_edges,
ssa_ccp_df_delete_unreachable_insns): Likewise.
* ssa-dce.c (ssa_eliminate_dead_code): Likewise.
* ssa.c (find_evaluations, compute_dominance_frontiers_1,
rename_block, convert_to_ssa, compute_conservative_reg_partition,
compute_coalesced_reg_partition, rename_equivalent_regs,
convert_from_ssa): Likewise.
* config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue,
process_for_unwind_directive): Likewise.
* df.c (FOR_ALL_BBS): Removed.
* gcse.c (struct null_pointer_info): Type of current_block field
changed.
(struct reg_avail_info): Type of last_bb field changed.
* config/ia64/ia64.c (block_num): Removed.
(need_copy_state): Type changed.
(last_block): New.
From-SVN: r53804
2002-05-23 21:23:51 +02:00
|
|
|
|
basic_block bb;
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
|
basic-block.h (last_basic_block): Defined as synonym for n_basic_blocks.
* basic-block.h (last_basic_block): Defined as synonym for
n_basic_blocks.
* cfganal.c (mark_dfs_back_edges, flow_reverse_top_sort_order_compute,
flow_depth_first_order_compute, flow_preorder_transversal_compute,
flow_dfs_compute_reverse_init): Replaced relevant occurences of
n_basic_blocks with last_basic_block.
* cfgbuild.c (make_edges): Likewise.
* cfgloop.c (flow_loop_scan, flow_loops_find): Likewise.
* cfgrtl.c (verify_flow_info, purge_all_dead_edges): Likewise.
* combine.c (combine_instructions): Likewise.
* df.c (df_alloc, df_analyse_1, df_analyse, iterative_dataflow_sbitmap,
iterative_dataflow_bitmap): Likewise.
* dominance.c (init_dom_info, calc_dfs_tree_nonrec, calc_dfs_tree,
calc_idoms, idoms_to_doms): Likewise.
* flow.c (update_life_info_in_dirty_blocks, free_basic_block_vars):
Likewise.
* gcse.c (gcse_main, alloc_gcse_mem, compute_local_properties,
compute_hash_table, expr_reaches_here_p, one_classic_gcse_pass,
one_cprop_pass, compute_pre_data, pre_expr_reaches_here_p,
one_pre_gcse_pass, compute_transpout, delete_null_pointer_checks_1,
delete_null_pointer_checks, compute_code_hoist_vbeinout,
hoist_expr_reaches_here_p, hoist_code, one_code_hoisting_pass,
compute_store_table, build_store_vectors): Likewise.
* haifa-sched.c (sched_init): Likewise.
* ifcvt.c (if_convert): Likewise.
* lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete,
pre_edge_lcm, compute_available, compute_nearerout,
compute_rev_insert_delete, pre_edge_rev_lcm, optimize_mode_switching):
Likewise.
* predict.c (estimate_probability, process_note_prediction,
note_prediction_to_br_prob): Likewise.
* profile.c (GCOV_INDEX_TO_BB, BB_TO_GCOV_INDEX): Likewise.
* recog.c (split_all_insns, peephole2_optimize): Likewise.
* regrename.c (copyprop_hardreg_forward): Likewise.
* resource.c (init_resource_info): Likewise.
* sched-rgn.c (build_control_flow, find_rgns, compute_trg_info,
init_regions, schedule_insns): Likewise.
* ssa-ccp.c (ssa_const_prop): Likewise.
* ssa-dce.c (ssa_eliminate_dead_code): Likewise.
* ssa.c (compute_dominance_frontiers,
compute_iterated_dominance_frontiers, convert_to_ssa): Likewise.
* df.c (df_refs_unlink): Fix FOR_EACH_BB usage (in #if 0'ed code)
* gcse.c (alloc_rd_mem, alloc_avail_expr_mem): Use n_blocks for vector
sizes consistently.
From-SVN: r53924
2002-05-27 15:45:44 +02:00
|
|
|
|
blocks = sbitmap_alloc (last_basic_block);
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
sbitmap_zero (blocks);
|
|
|
|
|
changed = 0;
|
1999-02-02 22:22:52 +01:00
|
|
|
|
|
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain.
* bb-reorder.c (make_reorder_chain, make_reorder_chain_1):
Use FOR_EACH_BB macros to iterate over basic block chain.
* cfg.c (clear_edges, clear_bb_flags, dump_flow_info,
alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges):
Likewise.
* cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add,
find_unreachable_blocks, create_edge_list, verify_edge_list,
remove_fake_edges, add_noreturn_fake_exit_edges,
flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute):
Likewise.
* cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks,
find_sub_basic_blocks): Likewise.
* cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks):
Likewise.
* cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps):
Likewise.
* cfgloop.c (flow_loops_cfg_dump, flow_loops_find):
Likewise.
* cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges,
commit_edge_insertions, commit_edge_insertions_watch_calls,
print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise.
* combine.c (combine_instructions, reg_dead_at_p): Likewise.
* conflict.c (conflict_graph_compute): Likewise.
* df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1,
df_modified_p, df_refs_unlink, df_dump): Likewise.
* dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise.
* final.c (compute_alignments): Likewise.
* flow.c (update_life_info, update_life_info_in_dirty_blocks,
delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data,
count_or_remove_death_notes): Likewise.
* gcse.c (oprs_unchanged_p, record_last_reg_set_info,
compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill,
classic_gcse, compute_transp, cprop, compute_pre_data,
compute_transpout, invalidate_nonnull_info,
delete_null_pointer_checks_1, delete_null_pointer_checks,
compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems,
compute_store_table, build_store_vectors, store_motion): Likewise.
* global.c (global_conflicts, mark_elimination): Likewise.
* graph.c (print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (sched_init): Likewise.
* ifcvt.c (if_convert): Likewise.
* lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete,
compute_available, compute_nearerout, compute_rev_insert_delete,
optimize_mode_switching): Likewise.
* local-alloc.c (local_alloc, update_equiv_regs): Likewise.
* predict.c (estimate_probability, note_prediction_to_br_prob,
propagate_freq, counts_to_freqs, expensive_function_p,
estimate_bb_frequencies): Likewise.
* profile.c (instrument_edges, get_exec_counts,
compute_branch_probabilities, compute_checksum, branch_prob,
find_spanning_tree): Likewise.
* recog.c (split_all_insns, peephole2_optimize): Likewise.
* reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs):
Likewise.
* regclass.c (scan_one_insn, regclass): Likewise.
* regmove.c (mark_flags_life_zones, regmove_optimize,
record_stack_memrefs): Likewise.
* regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise.
* reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise.
* resource.c (find_basic_block): Likewise.
* sched-ebb.c (schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, build_control_flow,
find_single_block_region, find_rgns, schedule_insns)
* sibcall.c (optimize_sibling_and_tail_recursive_call)
* ssa-ccp.c (optimize_unexecutable_edges,
ssa_ccp_df_delete_unreachable_insns): Likewise.
* ssa-dce.c (ssa_eliminate_dead_code): Likewise.
* ssa.c (find_evaluations, compute_dominance_frontiers_1,
rename_block, convert_to_ssa, compute_conservative_reg_partition,
compute_coalesced_reg_partition, rename_equivalent_regs,
convert_from_ssa): Likewise.
* config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue,
process_for_unwind_directive): Likewise.
* df.c (FOR_ALL_BBS): Removed.
* gcse.c (struct null_pointer_info): Type of current_block field
changed.
(struct reg_avail_info): Type of last_bb field changed.
* config/ia64/ia64.c (block_num): Removed.
(need_copy_state): Type changed.
(last_block): New.
From-SVN: r53804
2002-05-23 21:23:51 +02:00
|
|
|
|
FOR_EACH_BB_REVERSE (bb)
|
1999-02-02 22:22:52 +01:00
|
|
|
|
{
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
rtx insn, next;
|
2002-03-14 19:09:49 +01:00
|
|
|
|
bool finish = false;
|
1999-02-02 22:22:52 +01:00
|
|
|
|
|
2002-03-14 19:09:49 +01:00
|
|
|
|
for (insn = bb->head; !finish ; insn = next)
|
1999-02-02 22:22:52 +01:00
|
|
|
|
{
|
2001-06-08 14:19:12 +02:00
|
|
|
|
rtx last;
|
1999-02-02 22:22:52 +01:00
|
|
|
|
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
/* Can't use `next_real_insn' because that might go across
|
|
|
|
|
CODE_LABELS and short-out basic blocks. */
|
|
|
|
|
next = NEXT_INSN (insn);
|
2002-03-14 19:09:49 +01:00
|
|
|
|
finish = (insn == bb->end);
|
2001-06-08 14:19:12 +02:00
|
|
|
|
last = split_insn (insn);
|
|
|
|
|
if (last)
|
1999-02-02 22:22:52 +01:00
|
|
|
|
{
|
2001-09-16 22:21:30 +02:00
|
|
|
|
/* The split sequence may include barrier, but the
|
|
|
|
|
BB boundary we are interested in will be set to previous
|
|
|
|
|
one. */
|
|
|
|
|
|
|
|
|
|
while (GET_CODE (last) == BARRIER)
|
|
|
|
|
last = PREV_INSN (last);
|
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain.
* bb-reorder.c (make_reorder_chain, make_reorder_chain_1):
Use FOR_EACH_BB macros to iterate over basic block chain.
* cfg.c (clear_edges, clear_bb_flags, dump_flow_info,
alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges):
Likewise.
* cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add,
find_unreachable_blocks, create_edge_list, verify_edge_list,
remove_fake_edges, add_noreturn_fake_exit_edges,
flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute):
Likewise.
* cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks,
find_sub_basic_blocks): Likewise.
* cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks):
Likewise.
* cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps):
Likewise.
* cfgloop.c (flow_loops_cfg_dump, flow_loops_find):
Likewise.
* cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges,
commit_edge_insertions, commit_edge_insertions_watch_calls,
print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise.
* combine.c (combine_instructions, reg_dead_at_p): Likewise.
* conflict.c (conflict_graph_compute): Likewise.
* df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1,
df_modified_p, df_refs_unlink, df_dump): Likewise.
* dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise.
* final.c (compute_alignments): Likewise.
* flow.c (update_life_info, update_life_info_in_dirty_blocks,
delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data,
count_or_remove_death_notes): Likewise.
* gcse.c (oprs_unchanged_p, record_last_reg_set_info,
compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill,
classic_gcse, compute_transp, cprop, compute_pre_data,
compute_transpout, invalidate_nonnull_info,
delete_null_pointer_checks_1, delete_null_pointer_checks,
compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems,
compute_store_table, build_store_vectors, store_motion): Likewise.
* global.c (global_conflicts, mark_elimination): Likewise.
* graph.c (print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (sched_init): Likewise.
* ifcvt.c (if_convert): Likewise.
* lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete,
compute_available, compute_nearerout, compute_rev_insert_delete,
optimize_mode_switching): Likewise.
* local-alloc.c (local_alloc, update_equiv_regs): Likewise.
* predict.c (estimate_probability, note_prediction_to_br_prob,
propagate_freq, counts_to_freqs, expensive_function_p,
estimate_bb_frequencies): Likewise.
* profile.c (instrument_edges, get_exec_counts,
compute_branch_probabilities, compute_checksum, branch_prob,
find_spanning_tree): Likewise.
* recog.c (split_all_insns, peephole2_optimize): Likewise.
* reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs):
Likewise.
* regclass.c (scan_one_insn, regclass): Likewise.
* regmove.c (mark_flags_life_zones, regmove_optimize,
record_stack_memrefs): Likewise.
* regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise.
* reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise.
* resource.c (find_basic_block): Likewise.
* sched-ebb.c (schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, build_control_flow,
find_single_block_region, find_rgns, schedule_insns)
* sibcall.c (optimize_sibling_and_tail_recursive_call)
* ssa-ccp.c (optimize_unexecutable_edges,
ssa_ccp_df_delete_unreachable_insns): Likewise.
* ssa-dce.c (ssa_eliminate_dead_code): Likewise.
* ssa.c (find_evaluations, compute_dominance_frontiers_1,
rename_block, convert_to_ssa, compute_conservative_reg_partition,
compute_coalesced_reg_partition, rename_equivalent_regs,
convert_from_ssa): Likewise.
* config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue,
process_for_unwind_directive): Likewise.
* df.c (FOR_ALL_BBS): Removed.
* gcse.c (struct null_pointer_info): Type of current_block field
changed.
(struct reg_avail_info): Type of last_bb field changed.
* config/ia64/ia64.c (block_num): Removed.
(need_copy_state): Type changed.
(last_block): New.
From-SVN: r53804
2002-05-23 21:23:51 +02:00
|
|
|
|
SET_BIT (blocks, bb->index);
|
2001-06-08 14:19:12 +02:00
|
|
|
|
changed = 1;
|
|
|
|
|
insn = last;
|
1999-02-02 22:22:52 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
|
2001-07-23 16:08:12 +02:00
|
|
|
|
if (changed)
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
{
|
2001-10-20 12:04:00 +02:00
|
|
|
|
find_many_sub_basic_blocks (blocks);
|
2001-07-23 16:08:12 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (changed && upd_life)
|
|
|
|
|
{
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
count_or_remove_death_notes (blocks, 1);
|
1999-10-20 16:04:12 +02:00
|
|
|
|
update_life_info (blocks, UPDATE_LIFE_LOCAL, PROP_DEATH_NOTES);
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
}
|
2001-07-23 16:08:12 +02:00
|
|
|
|
#ifdef ENABLE_CHECKING
|
|
|
|
|
verify_flow_info ();
|
|
|
|
|
#endif
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
|
|
|
|
|
sbitmap_free (blocks);
|
1999-02-02 22:22:52 +01:00
|
|
|
|
}
|
2001-07-24 20:34:07 +02:00
|
|
|
|
|
2002-05-09 03:42:28 +02:00
|
|
|
|
/* Same as split_all_insns, but do not expect CFG to be available.
|
2001-07-24 20:34:07 +02:00
|
|
|
|
Used by machine depedent reorg passes. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
split_all_insns_noflow ()
|
|
|
|
|
{
|
|
|
|
|
rtx next, insn;
|
|
|
|
|
|
|
|
|
|
for (insn = get_insns (); insn; insn = next)
|
|
|
|
|
{
|
|
|
|
|
next = NEXT_INSN (insn);
|
|
|
|
|
split_insn (insn);
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
1999-08-31 22:37:09 +02:00
|
|
|
|
|
|
|
|
|
#ifdef HAVE_peephole2
|
2000-05-27 22:23:15 +02:00
|
|
|
|
struct peep2_insn_data
|
|
|
|
|
{
|
|
|
|
|
rtx insn;
|
|
|
|
|
regset live_before;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
static struct peep2_insn_data peep2_insn_data[MAX_INSNS_PER_PEEP2 + 1];
|
|
|
|
|
static int peep2_current;
|
|
|
|
|
|
|
|
|
|
/* A non-insn marker indicating the last insn of the block.
|
|
|
|
|
The live_before regset for this element is correct, indicating
|
|
|
|
|
global_live_at_end for the block. */
|
|
|
|
|
#define PEEP2_EOB pc_rtx
|
|
|
|
|
|
|
|
|
|
/* Return the Nth non-note insn after `current', or return NULL_RTX if it
|
|
|
|
|
does not exist. Used by the recognizer to find the next insn to match
|
|
|
|
|
in a multi-insn pattern. */
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
|
1999-08-31 22:37:09 +02:00
|
|
|
|
rtx
|
2000-05-27 22:23:15 +02:00
|
|
|
|
peep2_next_insn (n)
|
1999-08-31 22:37:09 +02:00
|
|
|
|
int n;
|
|
|
|
|
{
|
2000-05-27 22:23:15 +02:00
|
|
|
|
if (n >= MAX_INSNS_PER_PEEP2 + 1)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
n += peep2_current;
|
|
|
|
|
if (n >= MAX_INSNS_PER_PEEP2 + 1)
|
|
|
|
|
n -= MAX_INSNS_PER_PEEP2 + 1;
|
|
|
|
|
|
|
|
|
|
if (peep2_insn_data[n].insn == PEEP2_EOB)
|
|
|
|
|
return NULL_RTX;
|
|
|
|
|
return peep2_insn_data[n].insn;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return true if REGNO is dead before the Nth non-note insn
|
|
|
|
|
after `current'. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
peep2_regno_dead_p (ofs, regno)
|
|
|
|
|
int ofs;
|
|
|
|
|
int regno;
|
|
|
|
|
{
|
|
|
|
|
if (ofs >= MAX_INSNS_PER_PEEP2 + 1)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
ofs += peep2_current;
|
|
|
|
|
if (ofs >= MAX_INSNS_PER_PEEP2 + 1)
|
|
|
|
|
ofs -= MAX_INSNS_PER_PEEP2 + 1;
|
|
|
|
|
|
|
|
|
|
if (peep2_insn_data[ofs].insn == NULL_RTX)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
return ! REGNO_REG_SET_P (peep2_insn_data[ofs].live_before, regno);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Similarly for a REG. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
peep2_reg_dead_p (ofs, reg)
|
|
|
|
|
int ofs;
|
|
|
|
|
rtx reg;
|
|
|
|
|
{
|
|
|
|
|
int regno, n;
|
|
|
|
|
|
|
|
|
|
if (ofs >= MAX_INSNS_PER_PEEP2 + 1)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
ofs += peep2_current;
|
|
|
|
|
if (ofs >= MAX_INSNS_PER_PEEP2 + 1)
|
|
|
|
|
ofs -= MAX_INSNS_PER_PEEP2 + 1;
|
|
|
|
|
|
|
|
|
|
if (peep2_insn_data[ofs].insn == NULL_RTX)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
regno = REGNO (reg);
|
|
|
|
|
n = HARD_REGNO_NREGS (regno, GET_MODE (reg));
|
|
|
|
|
while (--n >= 0)
|
|
|
|
|
if (REGNO_REG_SET_P (peep2_insn_data[ofs].live_before, regno + n))
|
|
|
|
|
return 0;
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Try to find a hard register of mode MODE, matching the register class in
|
|
|
|
|
CLASS_STR, which is available at the beginning of insn CURRENT_INSN and
|
|
|
|
|
remains available until the end of LAST_INSN. LAST_INSN may be NULL_RTX,
|
|
|
|
|
in which case the only condition is that the register must be available
|
|
|
|
|
before CURRENT_INSN.
|
|
|
|
|
Registers that already have bits set in REG_SET will not be considered.
|
|
|
|
|
|
|
|
|
|
If an appropriate register is available, it will be returned and the
|
|
|
|
|
corresponding bit(s) in REG_SET will be set; otherwise, NULL_RTX is
|
|
|
|
|
returned. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
peep2_find_free_register (from, to, class_str, mode, reg_set)
|
|
|
|
|
int from, to;
|
|
|
|
|
const char *class_str;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
HARD_REG_SET *reg_set;
|
|
|
|
|
{
|
|
|
|
|
static int search_ofs;
|
|
|
|
|
enum reg_class class;
|
|
|
|
|
HARD_REG_SET live;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
if (from >= MAX_INSNS_PER_PEEP2 + 1 || to >= MAX_INSNS_PER_PEEP2 + 1)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
from += peep2_current;
|
|
|
|
|
if (from >= MAX_INSNS_PER_PEEP2 + 1)
|
|
|
|
|
from -= MAX_INSNS_PER_PEEP2 + 1;
|
|
|
|
|
to += peep2_current;
|
|
|
|
|
if (to >= MAX_INSNS_PER_PEEP2 + 1)
|
|
|
|
|
to -= MAX_INSNS_PER_PEEP2 + 1;
|
|
|
|
|
|
|
|
|
|
if (peep2_insn_data[from].insn == NULL_RTX)
|
|
|
|
|
abort ();
|
|
|
|
|
REG_SET_TO_HARD_REG_SET (live, peep2_insn_data[from].live_before);
|
|
|
|
|
|
|
|
|
|
while (from != to)
|
1999-08-31 22:37:09 +02:00
|
|
|
|
{
|
2000-05-27 22:23:15 +02:00
|
|
|
|
HARD_REG_SET this_live;
|
|
|
|
|
|
|
|
|
|
if (++from >= MAX_INSNS_PER_PEEP2 + 1)
|
|
|
|
|
from = 0;
|
|
|
|
|
if (peep2_insn_data[from].insn == NULL_RTX)
|
|
|
|
|
abort ();
|
|
|
|
|
REG_SET_TO_HARD_REG_SET (this_live, peep2_insn_data[from].live_before);
|
|
|
|
|
IOR_HARD_REG_SET (live, this_live);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class = (class_str[0] == 'r' ? GENERAL_REGS
|
|
|
|
|
: REG_CLASS_FROM_LETTER (class_str[0]));
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
|
|
|
|
{
|
|
|
|
|
int raw_regno, regno, success, j;
|
|
|
|
|
|
|
|
|
|
/* Distribute the free registers as much as possible. */
|
|
|
|
|
raw_regno = search_ofs + i;
|
|
|
|
|
if (raw_regno >= FIRST_PSEUDO_REGISTER)
|
|
|
|
|
raw_regno -= FIRST_PSEUDO_REGISTER;
|
|
|
|
|
#ifdef REG_ALLOC_ORDER
|
|
|
|
|
regno = reg_alloc_order[raw_regno];
|
|
|
|
|
#else
|
|
|
|
|
regno = raw_regno;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* Don't allocate fixed registers. */
|
|
|
|
|
if (fixed_regs[regno])
|
|
|
|
|
continue;
|
|
|
|
|
/* Make sure the register is of the right class. */
|
|
|
|
|
if (! TEST_HARD_REG_BIT (reg_class_contents[class], regno))
|
|
|
|
|
continue;
|
|
|
|
|
/* And can support the mode we need. */
|
|
|
|
|
if (! HARD_REGNO_MODE_OK (regno, mode))
|
|
|
|
|
continue;
|
|
|
|
|
/* And that we don't create an extra save/restore. */
|
|
|
|
|
if (! call_used_regs[regno] && ! regs_ever_live[regno])
|
|
|
|
|
continue;
|
|
|
|
|
/* And we don't clobber traceback for noreturn functions. */
|
|
|
|
|
if ((regno == FRAME_POINTER_REGNUM || regno == HARD_FRAME_POINTER_REGNUM)
|
|
|
|
|
&& (! reload_completed || frame_pointer_needed))
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
success = 1;
|
|
|
|
|
for (j = HARD_REGNO_NREGS (regno, mode) - 1; j >= 0; j--)
|
|
|
|
|
{
|
|
|
|
|
if (TEST_HARD_REG_BIT (*reg_set, regno + j)
|
|
|
|
|
|| TEST_HARD_REG_BIT (live, regno + j))
|
|
|
|
|
{
|
|
|
|
|
success = 0;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (success)
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
{
|
2000-05-27 22:23:15 +02:00
|
|
|
|
for (j = HARD_REGNO_NREGS (regno, mode) - 1; j >= 0; j--)
|
|
|
|
|
SET_HARD_REG_BIT (*reg_set, regno + j);
|
1999-08-31 22:37:09 +02:00
|
|
|
|
|
2000-05-27 22:23:15 +02:00
|
|
|
|
/* Start the next search with the next register. */
|
|
|
|
|
if (++raw_regno >= FIRST_PSEUDO_REGISTER)
|
|
|
|
|
raw_regno = 0;
|
|
|
|
|
search_ofs = raw_regno;
|
1999-08-31 22:37:09 +02:00
|
|
|
|
|
2000-05-27 22:23:15 +02:00
|
|
|
|
return gen_rtx_REG (mode, regno);
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
}
|
1999-08-31 22:37:09 +02:00
|
|
|
|
}
|
|
|
|
|
|
2000-05-27 22:23:15 +02:00
|
|
|
|
search_ofs = 0;
|
|
|
|
|
return NULL_RTX;
|
1999-08-31 22:37:09 +02:00
|
|
|
|
}
|
|
|
|
|
|
2001-08-13 01:40:53 +02:00
|
|
|
|
/* Perform the peephole2 optimization pass. */
|
2000-05-27 22:23:15 +02:00
|
|
|
|
|
1999-08-31 22:37:09 +02:00
|
|
|
|
void
|
|
|
|
|
peephole2_optimize (dump_file)
|
|
|
|
|
FILE *dump_file ATTRIBUTE_UNUSED;
|
|
|
|
|
{
|
2000-05-27 22:23:15 +02:00
|
|
|
|
regset_head rs_heads[MAX_INSNS_PER_PEEP2 + 2];
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
rtx insn, prev;
|
2000-05-27 22:23:15 +02:00
|
|
|
|
regset live;
|
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain.
* bb-reorder.c (make_reorder_chain, make_reorder_chain_1):
Use FOR_EACH_BB macros to iterate over basic block chain.
* cfg.c (clear_edges, clear_bb_flags, dump_flow_info,
alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges):
Likewise.
* cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add,
find_unreachable_blocks, create_edge_list, verify_edge_list,
remove_fake_edges, add_noreturn_fake_exit_edges,
flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute):
Likewise.
* cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks,
find_sub_basic_blocks): Likewise.
* cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks):
Likewise.
* cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps):
Likewise.
* cfgloop.c (flow_loops_cfg_dump, flow_loops_find):
Likewise.
* cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges,
commit_edge_insertions, commit_edge_insertions_watch_calls,
print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise.
* combine.c (combine_instructions, reg_dead_at_p): Likewise.
* conflict.c (conflict_graph_compute): Likewise.
* df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1,
df_modified_p, df_refs_unlink, df_dump): Likewise.
* dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise.
* final.c (compute_alignments): Likewise.
* flow.c (update_life_info, update_life_info_in_dirty_blocks,
delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data,
count_or_remove_death_notes): Likewise.
* gcse.c (oprs_unchanged_p, record_last_reg_set_info,
compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill,
classic_gcse, compute_transp, cprop, compute_pre_data,
compute_transpout, invalidate_nonnull_info,
delete_null_pointer_checks_1, delete_null_pointer_checks,
compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems,
compute_store_table, build_store_vectors, store_motion): Likewise.
* global.c (global_conflicts, mark_elimination): Likewise.
* graph.c (print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (sched_init): Likewise.
* ifcvt.c (if_convert): Likewise.
* lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete,
compute_available, compute_nearerout, compute_rev_insert_delete,
optimize_mode_switching): Likewise.
* local-alloc.c (local_alloc, update_equiv_regs): Likewise.
* predict.c (estimate_probability, note_prediction_to_br_prob,
propagate_freq, counts_to_freqs, expensive_function_p,
estimate_bb_frequencies): Likewise.
* profile.c (instrument_edges, get_exec_counts,
compute_branch_probabilities, compute_checksum, branch_prob,
find_spanning_tree): Likewise.
* recog.c (split_all_insns, peephole2_optimize): Likewise.
* reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs):
Likewise.
* regclass.c (scan_one_insn, regclass): Likewise.
* regmove.c (mark_flags_life_zones, regmove_optimize,
record_stack_memrefs): Likewise.
* regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise.
* reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise.
* resource.c (find_basic_block): Likewise.
* sched-ebb.c (schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, build_control_flow,
find_single_block_region, find_rgns, schedule_insns)
* sibcall.c (optimize_sibling_and_tail_recursive_call)
* ssa-ccp.c (optimize_unexecutable_edges,
ssa_ccp_df_delete_unreachable_insns): Likewise.
* ssa-dce.c (ssa_eliminate_dead_code): Likewise.
* ssa.c (find_evaluations, compute_dominance_frontiers_1,
rename_block, convert_to_ssa, compute_conservative_reg_partition,
compute_coalesced_reg_partition, rename_equivalent_regs,
convert_from_ssa): Likewise.
* config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue,
process_for_unwind_directive): Likewise.
* df.c (FOR_ALL_BBS): Removed.
* gcse.c (struct null_pointer_info): Type of current_block field
changed.
(struct reg_avail_info): Type of last_bb field changed.
* config/ia64/ia64.c (block_num): Removed.
(need_copy_state): Type changed.
(last_block): New.
From-SVN: r53804
2002-05-23 21:23:51 +02:00
|
|
|
|
int i;
|
|
|
|
|
basic_block bb;
|
2000-05-27 22:23:15 +02:00
|
|
|
|
#ifdef HAVE_conditional_execution
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
sbitmap blocks;
|
2002-03-25 01:18:10 +01:00
|
|
|
|
bool changed;
|
2000-05-27 22:23:15 +02:00
|
|
|
|
#endif
|
2002-03-25 01:18:10 +01:00
|
|
|
|
bool do_cleanup_cfg = false;
|
2002-04-12 09:52:05 +02:00
|
|
|
|
bool do_rebuild_jump_labels = false;
|
1999-08-31 22:37:09 +02:00
|
|
|
|
|
2000-05-27 22:23:15 +02:00
|
|
|
|
/* Initialize the regsets we're going to use. */
|
|
|
|
|
for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i)
|
|
|
|
|
peep2_insn_data[i].live_before = INITIALIZE_REG_SET (rs_heads[i]);
|
|
|
|
|
live = INITIALIZE_REG_SET (rs_heads[i]);
|
1999-08-31 22:37:09 +02:00
|
|
|
|
|
2000-05-27 22:23:15 +02:00
|
|
|
|
#ifdef HAVE_conditional_execution
|
basic-block.h (last_basic_block): Defined as synonym for n_basic_blocks.
* basic-block.h (last_basic_block): Defined as synonym for
n_basic_blocks.
* cfganal.c (mark_dfs_back_edges, flow_reverse_top_sort_order_compute,
flow_depth_first_order_compute, flow_preorder_transversal_compute,
flow_dfs_compute_reverse_init): Replaced relevant occurences of
n_basic_blocks with last_basic_block.
* cfgbuild.c (make_edges): Likewise.
* cfgloop.c (flow_loop_scan, flow_loops_find): Likewise.
* cfgrtl.c (verify_flow_info, purge_all_dead_edges): Likewise.
* combine.c (combine_instructions): Likewise.
* df.c (df_alloc, df_analyse_1, df_analyse, iterative_dataflow_sbitmap,
iterative_dataflow_bitmap): Likewise.
* dominance.c (init_dom_info, calc_dfs_tree_nonrec, calc_dfs_tree,
calc_idoms, idoms_to_doms): Likewise.
* flow.c (update_life_info_in_dirty_blocks, free_basic_block_vars):
Likewise.
* gcse.c (gcse_main, alloc_gcse_mem, compute_local_properties,
compute_hash_table, expr_reaches_here_p, one_classic_gcse_pass,
one_cprop_pass, compute_pre_data, pre_expr_reaches_here_p,
one_pre_gcse_pass, compute_transpout, delete_null_pointer_checks_1,
delete_null_pointer_checks, compute_code_hoist_vbeinout,
hoist_expr_reaches_here_p, hoist_code, one_code_hoisting_pass,
compute_store_table, build_store_vectors): Likewise.
* haifa-sched.c (sched_init): Likewise.
* ifcvt.c (if_convert): Likewise.
* lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete,
pre_edge_lcm, compute_available, compute_nearerout,
compute_rev_insert_delete, pre_edge_rev_lcm, optimize_mode_switching):
Likewise.
* predict.c (estimate_probability, process_note_prediction,
note_prediction_to_br_prob): Likewise.
* profile.c (GCOV_INDEX_TO_BB, BB_TO_GCOV_INDEX): Likewise.
* recog.c (split_all_insns, peephole2_optimize): Likewise.
* regrename.c (copyprop_hardreg_forward): Likewise.
* resource.c (init_resource_info): Likewise.
* sched-rgn.c (build_control_flow, find_rgns, compute_trg_info,
init_regions, schedule_insns): Likewise.
* ssa-ccp.c (ssa_const_prop): Likewise.
* ssa-dce.c (ssa_eliminate_dead_code): Likewise.
* ssa.c (compute_dominance_frontiers,
compute_iterated_dominance_frontiers, convert_to_ssa): Likewise.
* df.c (df_refs_unlink): Fix FOR_EACH_BB usage (in #if 0'ed code)
* gcse.c (alloc_rd_mem, alloc_avail_expr_mem): Use n_blocks for vector
sizes consistently.
From-SVN: r53924
2002-05-27 15:45:44 +02:00
|
|
|
|
blocks = sbitmap_alloc (last_basic_block);
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
sbitmap_zero (blocks);
|
2002-03-25 01:18:10 +01:00
|
|
|
|
changed = false;
|
2000-05-27 22:23:15 +02:00
|
|
|
|
#else
|
|
|
|
|
count_or_remove_death_notes (NULL, 1);
|
|
|
|
|
#endif
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
|
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain.
* bb-reorder.c (make_reorder_chain, make_reorder_chain_1):
Use FOR_EACH_BB macros to iterate over basic block chain.
* cfg.c (clear_edges, clear_bb_flags, dump_flow_info,
alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges):
Likewise.
* cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add,
find_unreachable_blocks, create_edge_list, verify_edge_list,
remove_fake_edges, add_noreturn_fake_exit_edges,
flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute):
Likewise.
* cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks,
find_sub_basic_blocks): Likewise.
* cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks):
Likewise.
* cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps):
Likewise.
* cfgloop.c (flow_loops_cfg_dump, flow_loops_find):
Likewise.
* cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges,
commit_edge_insertions, commit_edge_insertions_watch_calls,
print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise.
* combine.c (combine_instructions, reg_dead_at_p): Likewise.
* conflict.c (conflict_graph_compute): Likewise.
* df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1,
df_modified_p, df_refs_unlink, df_dump): Likewise.
* dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise.
* final.c (compute_alignments): Likewise.
* flow.c (update_life_info, update_life_info_in_dirty_blocks,
delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data,
count_or_remove_death_notes): Likewise.
* gcse.c (oprs_unchanged_p, record_last_reg_set_info,
compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill,
classic_gcse, compute_transp, cprop, compute_pre_data,
compute_transpout, invalidate_nonnull_info,
delete_null_pointer_checks_1, delete_null_pointer_checks,
compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems,
compute_store_table, build_store_vectors, store_motion): Likewise.
* global.c (global_conflicts, mark_elimination): Likewise.
* graph.c (print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (sched_init): Likewise.
* ifcvt.c (if_convert): Likewise.
* lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete,
compute_available, compute_nearerout, compute_rev_insert_delete,
optimize_mode_switching): Likewise.
* local-alloc.c (local_alloc, update_equiv_regs): Likewise.
* predict.c (estimate_probability, note_prediction_to_br_prob,
propagate_freq, counts_to_freqs, expensive_function_p,
estimate_bb_frequencies): Likewise.
* profile.c (instrument_edges, get_exec_counts,
compute_branch_probabilities, compute_checksum, branch_prob,
find_spanning_tree): Likewise.
* recog.c (split_all_insns, peephole2_optimize): Likewise.
* reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs):
Likewise.
* regclass.c (scan_one_insn, regclass): Likewise.
* regmove.c (mark_flags_life_zones, regmove_optimize,
record_stack_memrefs): Likewise.
* regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise.
* reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise.
* resource.c (find_basic_block): Likewise.
* sched-ebb.c (schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, build_control_flow,
find_single_block_region, find_rgns, schedule_insns)
* sibcall.c (optimize_sibling_and_tail_recursive_call)
* ssa-ccp.c (optimize_unexecutable_edges,
ssa_ccp_df_delete_unreachable_insns): Likewise.
* ssa-dce.c (ssa_eliminate_dead_code): Likewise.
* ssa.c (find_evaluations, compute_dominance_frontiers_1,
rename_block, convert_to_ssa, compute_conservative_reg_partition,
compute_coalesced_reg_partition, rename_equivalent_regs,
convert_from_ssa): Likewise.
* config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue,
process_for_unwind_directive): Likewise.
* df.c (FOR_ALL_BBS): Removed.
* gcse.c (struct null_pointer_info): Type of current_block field
changed.
(struct reg_avail_info): Type of last_bb field changed.
* config/ia64/ia64.c (block_num): Removed.
(need_copy_state): Type changed.
(last_block): New.
From-SVN: r53804
2002-05-23 21:23:51 +02:00
|
|
|
|
FOR_EACH_BB_REVERSE (bb)
|
1999-08-31 22:37:09 +02:00
|
|
|
|
{
|
2000-05-27 22:23:15 +02:00
|
|
|
|
struct propagate_block_info *pbi;
|
|
|
|
|
|
|
|
|
|
/* Indicate that all slots except the last holds invalid data. */
|
|
|
|
|
for (i = 0; i < MAX_INSNS_PER_PEEP2; ++i)
|
|
|
|
|
peep2_insn_data[i].insn = NULL_RTX;
|
|
|
|
|
|
|
|
|
|
/* Indicate that the last slot contains live_after data. */
|
|
|
|
|
peep2_insn_data[MAX_INSNS_PER_PEEP2].insn = PEEP2_EOB;
|
|
|
|
|
peep2_current = MAX_INSNS_PER_PEEP2;
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
|
2000-05-27 22:23:15 +02:00
|
|
|
|
/* Start up propagation. */
|
|
|
|
|
COPY_REG_SET (live, bb->global_live_at_end);
|
|
|
|
|
COPY_REG_SET (peep2_insn_data[MAX_INSNS_PER_PEEP2].live_before, live);
|
|
|
|
|
|
|
|
|
|
#ifdef HAVE_conditional_execution
|
2000-11-27 18:50:11 +01:00
|
|
|
|
pbi = init_propagate_block_info (bb, live, NULL, NULL, 0);
|
2000-05-27 22:23:15 +02:00
|
|
|
|
#else
|
2000-11-27 18:50:11 +01:00
|
|
|
|
pbi = init_propagate_block_info (bb, live, NULL, NULL, PROP_DEATH_NOTES);
|
2000-05-27 22:23:15 +02:00
|
|
|
|
#endif
|
1999-08-31 22:37:09 +02:00
|
|
|
|
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
for (insn = bb->end; ; insn = prev)
|
|
|
|
|
{
|
|
|
|
|
prev = PREV_INSN (insn);
|
2000-05-26 01:59:45 +02:00
|
|
|
|
if (INSN_P (insn))
|
1999-08-31 22:37:09 +02:00
|
|
|
|
{
|
2002-04-12 09:52:05 +02:00
|
|
|
|
rtx try, before_try, x;
|
2000-05-27 22:23:15 +02:00
|
|
|
|
int match_len;
|
2002-03-08 21:14:04 +01:00
|
|
|
|
rtx note;
|
2002-05-14 01:00:35 +02:00
|
|
|
|
bool was_call = false;
|
2000-05-27 22:23:15 +02:00
|
|
|
|
|
|
|
|
|
/* Record this insn. */
|
|
|
|
|
if (--peep2_current < 0)
|
|
|
|
|
peep2_current = MAX_INSNS_PER_PEEP2;
|
|
|
|
|
peep2_insn_data[peep2_current].insn = insn;
|
|
|
|
|
propagate_one_insn (pbi, insn);
|
|
|
|
|
COPY_REG_SET (peep2_insn_data[peep2_current].live_before, live);
|
|
|
|
|
|
|
|
|
|
/* Match the peephole. */
|
|
|
|
|
try = peephole2_insns (PATTERN (insn), insn, &match_len);
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
if (try != NULL)
|
|
|
|
|
{
|
2001-09-19 20:32:21 +02:00
|
|
|
|
/* If we are splitting a CALL_INSN, look for the CALL_INSN
|
|
|
|
|
in SEQ and copy our CALL_INSN_FUNCTION_USAGE and other
|
|
|
|
|
cfg-related call notes. */
|
|
|
|
|
for (i = 0; i <= match_len; ++i)
|
|
|
|
|
{
|
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
2002-06-05 David S. Miller <davem@redhat.com>
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
* rtl.h (gen_sequence, emit_insns, emit_insns_before,
emit_insns_before_scope, emit_insns_after,
emit_insns_after_scope): Delete declaration.
* ada/misc.c (insert_code_for): Use emit_insn* instead of
emit_insns_foo.
* config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE.
(alpha_set_memflags): Fix comment.
(set_frame_related_p): Use get_insns instead of gen_sequence.
* config/alpha/alpha.md (setjmp receiver splitter): Avoid
emitting no insns.
* config/arm/arm.c (arm_finalize_pic): Use get_insns instead of
gen_sequence.
(arm_gen_load_multiple, arm_gen_store_multiple): Likewise.
* config/fr30/fr30.c (fr30_move_double): Likewise.
* config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr):
Likewise.
* config/ia64/ia64.c (spill_restore_mem): Likewise.
* config/ia64/ia64.md (conditional move spliiter): Avoid emitting
no insns.
* config/m32r/m32r.c (gen_split_move_double): Use get_insns
instead of gen_sequence.
* config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise.
(mips_expand_prologue, mips16_gp_pseudo_reg): Likewise.
* config/sh/sh.c (sh_need_epilogue): Likewise.
* config/sparc/sparc.md (current_function_calls_alloca, flat): New
attributes.
(setjmp pattern and split): Use them to avoid splitter which emits
no RTL.
* genattrtab.c (main): Emit include of function.h
* config/stormy16/stormy16.c (xstormy16_split_cbranch): Use
get_insns instead of gen_sequence.
* config/cris/cris.c (cris_split_movdx): Likewise.
* emit-rtl.c (emit_insns*): Kill.
(try_split): Expect insn list instead of SEQUENCE.
(make_jump_insn_raw, make_call_insn_raw): Fix comments.
(emit_*insn*): Reimplement to work with INSN lists and PATTERNs.
Make them abort if a SEQUENCE is given and RTL checking is
enabled.
(emit_*_scope): Don't forget to set scope on final insn.
(gen_sequence): Move from here...
* ssa.c (gen_sequence): To here as private function.
* builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix
comments.
(expand_builtin_return, expand_builtin_mathfn): Likewise.
(expand_builtin_strlen): Use get_insns instead of gen_sequence.
(expand_builtin_saveregs): Use emit_insn_foo, fix comments.
(expand_builtin_expect_jump): Use get_insns and fix comments.
* calls.c (try_to_integrate): Use emit_insn_foo.
(expand_call, emit_library_call_value_1): Likewise.
* expr.c (emit_queue): Handle insn lists instead of SEQUENCE.
(emit_move_insn_1): Use get_insns instead of gen_sequence.
(expand_expr): Use emit_insn_foo.
* cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo.
* except.c (build_post_landing_pads): Likewise.
* flow.c (attempt_auto_inc): Likewise.
* stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label,
expand_nl_goto_receivers, expand_decl_cleanup): Likewise.
* function.c (fixup_var_refs_insn): Use get_insns instead of
gen_sequence.
(fixup_var_refs_1): Likewise and expect insn list from gen_foo.
(fixup_memory_subreg): Use get_insns instead of gen_sequence.
(fixup_stack_1, purge_addressof_1, expand_main_function,
get_arg_pointer_save_area): Likewise.
(optimize_bit_field, instantiate_virtual_regs_1, assign_parms,
expand_function_end): Use emit_insn_foo.
(record_insns, keep_stack_depressed): Work with insn list instead
of SEQUENCE, fix comments.
* ifcvt.c (noce_emit_store_flag, noce_try_store_flag,
noce_try_store_flag_constants, noce_try_store_flag_inc,
noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith,
noce_try_minmax, noce_try_abs): Use emit_insn_foo.
(noce_process_if_block): Use get_insns instead of gen_sequence.
* optabs.c (add_equal_note): Work with insn list, fix comments.
(expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo.
(expand_unop, expand_complex_abs, expand_unop_insn,
expand_no_conflict_block): Likewise.
(gen_move_insn): Use get_insns instead of gen_sequence.
(gen_cond_trap): Likewise.
* integrate.c (copy_rtx_and_substitute): Likewise.
(emit_initial_value_sets): Use emit_insn_foo.
* reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise.
(fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently
now that RTL generators give insn lists.
* sibcall.c (replace_call_placeholder): Use emit_insn_foo.
* doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns
instead of gen_sequence.
(doloop_optimize): Work with insn lists instead of SEQUENCE rtl.
* explow.c (emit_stack_save, emit_stack_restore): Use get_insns
instead of gen_sequence.
* loop.c (move_movables, emit_prefetch_instructions,
gen_add_mult, check_dbra_loop, gen_load_of_final_value):
Likewise.
(loop_regs_update): Work with insn list instead of SEQUENCE rtl.
(product_cheap_p): Likewise, and add commentary about RTL wastage
here.
* lcm.c (optimize_mode_switching): Use get_insns instead of
gen_sequence.
* profile.c (gen_edge_profiler): Likewise.
* regmove.c (copy_src_to_dest): Likewise.
* reg-stack.c (compensate_edge): Likewise and fix comment.
* gcse.c (process_insert_insn): Likewise.
(insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl.
* jump.c (delete_prior_computation): Update comment.
* genemit.c (gen_expand, gen_split, main): Use get_insns instead
of gen_sequence, update comments to match.
* recog.c (peephole2_optimize): Work with insn lists instead of
SEQUENCE rtl.
* sched-vis.c (print_pattern): Abort on SEQUENCE.
* unroll.c (unroll_loop, find_splittable_givs, final_giv_value):
Use get_insns instead of gen_sequence.
(copy_loop_body): Likewise and don't emit dummy NOTE.
* genrecog.c: Don't mention SEQUENCE rtl in comments.
* combine.c (try_combine): Expect insn lists from split generator.
* reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by
hand.
From-SVN: r54497
2002-06-11 14:22:48 +02:00
|
|
|
|
int j;
|
2001-09-19 20:32:21 +02:00
|
|
|
|
rtx old_insn, new_insn, note;
|
|
|
|
|
|
|
|
|
|
j = i + peep2_current;
|
|
|
|
|
if (j >= MAX_INSNS_PER_PEEP2 + 1)
|
|
|
|
|
j -= MAX_INSNS_PER_PEEP2 + 1;
|
|
|
|
|
old_insn = peep2_insn_data[j].insn;
|
|
|
|
|
if (GET_CODE (old_insn) != CALL_INSN)
|
|
|
|
|
continue;
|
2002-05-14 01:00:35 +02:00
|
|
|
|
was_call = true;
|
2001-09-19 20:32:21 +02:00
|
|
|
|
|
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
2002-06-05 David S. Miller <davem@redhat.com>
Delete SEQUENCE rtl usage outside of reorg and ssa passes.
* rtl.h (gen_sequence, emit_insns, emit_insns_before,
emit_insns_before_scope, emit_insns_after,
emit_insns_after_scope): Delete declaration.
* ada/misc.c (insert_code_for): Use emit_insn* instead of
emit_insns_foo.
* config/alpha/alpha.c (alpha_set_memflags_1): Abort on SEQUENCE.
(alpha_set_memflags): Fix comment.
(set_frame_related_p): Use get_insns instead of gen_sequence.
* config/alpha/alpha.md (setjmp receiver splitter): Avoid
emitting no insns.
* config/arm/arm.c (arm_finalize_pic): Use get_insns instead of
gen_sequence.
(arm_gen_load_multiple, arm_gen_store_multiple): Likewise.
* config/fr30/fr30.c (fr30_move_double): Likewise.
* config/i386/i386.c (ix86_expand_int_movcc, ix86_expand_movstr):
Likewise.
* config/ia64/ia64.c (spill_restore_mem): Likewise.
* config/ia64/ia64.md (conditional move spliiter): Avoid emitting
no insns.
* config/m32r/m32r.c (gen_split_move_double): Use get_insns
instead of gen_sequence.
* config/mips/mips.c (embedded_pic_fnaddr_reg): Likewise.
(mips_expand_prologue, mips16_gp_pseudo_reg): Likewise.
* config/sh/sh.c (sh_need_epilogue): Likewise.
* config/sparc/sparc.md (current_function_calls_alloca, flat): New
attributes.
(setjmp pattern and split): Use them to avoid splitter which emits
no RTL.
* genattrtab.c (main): Emit include of function.h
* config/stormy16/stormy16.c (xstormy16_split_cbranch): Use
get_insns instead of gen_sequence.
* config/cris/cris.c (cris_split_movdx): Likewise.
* emit-rtl.c (emit_insns*): Kill.
(try_split): Expect insn list instead of SEQUENCE.
(make_jump_insn_raw, make_call_insn_raw): Fix comments.
(emit_*insn*): Reimplement to work with INSN lists and PATTERNs.
Make them abort if a SEQUENCE is given and RTL checking is
enabled.
(emit_*_scope): Don't forget to set scope on final insn.
(gen_sequence): Move from here...
* ssa.c (gen_sequence): To here as private function.
* builtins.c (expand_builtin_apply_args): Use emit_insn_foo, fix
comments.
(expand_builtin_return, expand_builtin_mathfn): Likewise.
(expand_builtin_strlen): Use get_insns instead of gen_sequence.
(expand_builtin_saveregs): Use emit_insn_foo, fix comments.
(expand_builtin_expect_jump): Use get_insns and fix comments.
* calls.c (try_to_integrate): Use emit_insn_foo.
(expand_call, emit_library_call_value_1): Likewise.
* expr.c (emit_queue): Handle insn lists instead of SEQUENCE.
(emit_move_insn_1): Use get_insns instead of gen_sequence.
(expand_expr): Use emit_insn_foo.
* cfgrtl.c (commit_one_edge_insertion): Use emit_insn_foo.
* except.c (build_post_landing_pads): Likewise.
* flow.c (attempt_auto_inc): Likewise.
* stmt.c (expand_fixup, fixup_gotos, expand_nl_handler_label,
expand_nl_goto_receivers, expand_decl_cleanup): Likewise.
* function.c (fixup_var_refs_insn): Use get_insns instead of
gen_sequence.
(fixup_var_refs_1): Likewise and expect insn list from gen_foo.
(fixup_memory_subreg): Use get_insns instead of gen_sequence.
(fixup_stack_1, purge_addressof_1, expand_main_function,
get_arg_pointer_save_area): Likewise.
(optimize_bit_field, instantiate_virtual_regs_1, assign_parms,
expand_function_end): Use emit_insn_foo.
(record_insns, keep_stack_depressed): Work with insn list instead
of SEQUENCE, fix comments.
* ifcvt.c (noce_emit_store_flag, noce_try_store_flag,
noce_try_store_flag_constants, noce_try_store_flag_inc,
noce_try_store_flag_mask, noce_emit_cmove, noce_try_cmove_arith,
noce_try_minmax, noce_try_abs): Use emit_insn_foo.
(noce_process_if_block): Use get_insns instead of gen_sequence.
* optabs.c (add_equal_note): Work with insn list, fix comments.
(expand_binop): Expect insn list from GEN_FCN(), use emit_insn_foo.
(expand_unop, expand_complex_abs, expand_unop_insn,
expand_no_conflict_block): Likewise.
(gen_move_insn): Use get_insns instead of gen_sequence.
(gen_cond_trap): Likewise.
* integrate.c (copy_rtx_and_substitute): Likewise.
(emit_initial_value_sets): Use emit_insn_foo.
* reload1.c (emit_output_reload_insns, emit_reload_insns): Likewise.
(fixup_abnormal_edges): Avoid losing REG_NOTES more intelligently
now that RTL generators give insn lists.
* sibcall.c (replace_call_placeholder): Use emit_insn_foo.
* doloop.c (doloop_modify, doloop_modify_runtime): Use get_insns
instead of gen_sequence.
(doloop_optimize): Work with insn lists instead of SEQUENCE rtl.
* explow.c (emit_stack_save, emit_stack_restore): Use get_insns
instead of gen_sequence.
* loop.c (move_movables, emit_prefetch_instructions,
gen_add_mult, check_dbra_loop, gen_load_of_final_value):
Likewise.
(loop_regs_update): Work with insn list instead of SEQUENCE rtl.
(product_cheap_p): Likewise, and add commentary about RTL wastage
here.
* lcm.c (optimize_mode_switching): Use get_insns instead of
gen_sequence.
* profile.c (gen_edge_profiler): Likewise.
* regmove.c (copy_src_to_dest): Likewise.
* reg-stack.c (compensate_edge): Likewise and fix comment.
* gcse.c (process_insert_insn): Likewise.
(insert_insn_end_bb): Work with insn list instead of SEQUENCE rtl.
* jump.c (delete_prior_computation): Update comment.
* genemit.c (gen_expand, gen_split, main): Use get_insns instead
of gen_sequence, update comments to match.
* recog.c (peephole2_optimize): Work with insn lists instead of
SEQUENCE rtl.
* sched-vis.c (print_pattern): Abort on SEQUENCE.
* unroll.c (unroll_loop, find_splittable_givs, final_giv_value):
Use get_insns instead of gen_sequence.
(copy_loop_body): Likewise and don't emit dummy NOTE.
* genrecog.c: Don't mention SEQUENCE rtl in comments.
* combine.c (try_combine): Expect insn lists from split generator.
* reorg.c (relax_delay_slots): Emit SEQUENCE into insn list by
hand.
From-SVN: r54497
2002-06-11 14:22:48 +02:00
|
|
|
|
new_insn = try;
|
|
|
|
|
while (new_insn != NULL_RTX)
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (new_insn) == CALL_INSN)
|
|
|
|
|
break;
|
|
|
|
|
new_insn = NEXT_INSN (new_insn);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (new_insn == NULL_RTX)
|
2001-09-19 20:32:21 +02:00
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
CALL_INSN_FUNCTION_USAGE (new_insn)
|
|
|
|
|
= CALL_INSN_FUNCTION_USAGE (old_insn);
|
|
|
|
|
|
|
|
|
|
for (note = REG_NOTES (old_insn);
|
|
|
|
|
note;
|
|
|
|
|
note = XEXP (note, 1))
|
|
|
|
|
switch (REG_NOTE_KIND (note))
|
|
|
|
|
{
|
|
|
|
|
case REG_NORETURN:
|
|
|
|
|
case REG_SETJMP:
|
|
|
|
|
case REG_ALWAYS_RETURN:
|
|
|
|
|
REG_NOTES (new_insn)
|
|
|
|
|
= gen_rtx_EXPR_LIST (REG_NOTE_KIND (note),
|
|
|
|
|
XEXP (note, 0),
|
|
|
|
|
REG_NOTES (new_insn));
|
2001-10-23 06:09:05 +02:00
|
|
|
|
default:
|
2001-10-30 16:01:50 +01:00
|
|
|
|
/* Discard all other reg notes. */
|
2001-09-19 20:32:21 +02:00
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Croak if there is another call in the sequence. */
|
|
|
|
|
while (++i <= match_len)
|
|
|
|
|
{
|
|
|
|
|
j = i + peep2_current;
|
|
|
|
|
if (j >= MAX_INSNS_PER_PEEP2 + 1)
|
|
|
|
|
j -= MAX_INSNS_PER_PEEP2 + 1;
|
|
|
|
|
old_insn = peep2_insn_data[j].insn;
|
|
|
|
|
if (GET_CODE (old_insn) == CALL_INSN)
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2000-05-27 22:23:15 +02:00
|
|
|
|
i = match_len + peep2_current;
|
|
|
|
|
if (i >= MAX_INSNS_PER_PEEP2 + 1)
|
|
|
|
|
i -= MAX_INSNS_PER_PEEP2 + 1;
|
|
|
|
|
|
2002-05-09 03:42:28 +02:00
|
|
|
|
note = find_reg_note (peep2_insn_data[i].insn,
|
2002-03-26 01:30:35 +01:00
|
|
|
|
REG_EH_REGION, NULL_RTX);
|
|
|
|
|
|
2000-05-27 22:23:15 +02:00
|
|
|
|
/* Replace the old sequence with the new. */
|
2002-06-06 23:20:43 +02:00
|
|
|
|
try = emit_insn_after_scope (try, peep2_insn_data[i].insn,
|
|
|
|
|
INSN_SCOPE (peep2_insn_data[i].insn));
|
2002-03-26 01:30:35 +01:00
|
|
|
|
before_try = PREV_INSN (insn);
|
basic-block.h (flow_delete_insn, [...]): Kill.
* basic-block.h (flow_delete_insn, flow_delete_insn_chain): Kill.
* cfg.c (delete_insn): Rename from ....; use remove_insn; do not
remove some labels.
(flow_delete_insn): This one.
(delete_insn_chain): Rename from ...; do not care labels.
(flow_delete_insn_chain): ... this one.
(flow_delete_block): Remove the insns one BB has been expunged.
(merge_blocks_nomove): Likewise.
(try_redirect_by_replacing_jump): Use delete_insn[_chain]; do not care
updating BB boundaries.
(tidy_fallthru_edge): Likewise.
(commit_one_edge_insertion): Likewise.
* cfgbuild.c (find_basic_block): Likewise.
(find_basic_blocks_1): Likewise.
* cfgcleanup.c (merge_blocks_move_predecessor_nojumps): Likewise.
(try_crossjump_to_edge): Likewise.
(try_optimize_cfg): Likewise.
* cse.c (delete_trivially_dead_insns): Likewise.
* df.c (df_insn_delete): Likewise.
* doloop.c (doloop_modify): Use delete_related_insns.
* emit-rtl.c (try_split): Likewise.
(remove_insn): Update BB boundaries.
* expect.c (connect_post_landing_pads): Use delete_related_insns.
* flow.c (delete_dead_jumptables): Use delete_insn[_chain]; do not care
updating BB boundaries.
(propagate_block_delete_insn): Likewise.
(propagate_block_delete_libcall): Likewise.
* function.c (delete_handlers): Use delete_related_insns.
(thread_prologue_and_epilogue_insns): Likewise.
* gcse.c (delete_null_pointer_checks): Use delete_related_insns.
* genpeep.c (gen_peephole): Use delete_related_insns.
* ifcvt.c (noce_process_if_block): Use delete_insn; do not care updating
BB boundaries.
(find_cond_trap): Likewise.
* integrate.c (save_for_inline): Use delete_related_insns.
(copy_insn_list): Likewise.
* jump.c (pruge_linie_number_notes): Likewise.
(duplicate_loop_exit_test): Likewise.
(delete_computation): Likewise.
(delete_related_insn): Rename from ...; use delete_insn
(delete_insn): ... this one.
(redirect_jump): Use delete_related_insns.
* loop.c (scan_loop): Likewise.
(move_movables): Likewise.
(find_and_verify_loops): Likewise.
(check_dbra_loop): Likewise.
* recog.c (peephole2_optimize): Likewise.
* reg-stack.c (delete_insn_for_stacker): Remove.
(move_for_stack_reg): Use delete_insn.
* regmove.c (combine_stack_adjustments_for_block): Likewise.
* reload1.c (delete_address_reloads): Use delete_related_insns.
(fixup_abnormal_edges): Use delete_insn.
* recog.c (emit_delay_sequence): Use delete_related_insns.
(delete_from-delay_slot): Likewise.
(delete_scheduled_jump): likewise.
(optimize_skip): Likewise.
(try_merge_delay_insns): Likewise.
(full_simple_delay_slots): Likewise.
(fill_slots_from_thread): Likewise.
(relax_delay_slots): Likewise.
(make_return_insns): Likewise.
(dbr_schedule): Likewise.
* rtl.h (delete_insn): Rename to delete_related_insns.
(delete_insn, delete_insn_chain): New prototypes.
* ssa-ccp (sse_fast_dce): Remove deleting of DEF, as it is done
by df_insn_delete already.
* ssa-dce.c (delete_insn_bb): Use delete_insn.
* ssa.c (convert_from_ssa): Use delete_related_insns.
* unroll.c (unroll_loop): Likewise.
(calculate_giv_inc): Likewise.
(copy_loop_body): Likewise.
* i386-protos.h (ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): Declare.
* i386.c (x86_64_int_parameter_registers, x86_64_int_return_registers):
new static valurables.
(x86_64_reg_class): New enum
(x86_64_reg_class_name): New array.
(classify_argument, examine_argument, construct_container,
merge_classes): New static functions.
(optimization_options): Enable flag_omit_frame_pointer and disable
flag_pcc_struct_return on 64bit.
(ix86_libcall_value, ix86_function_value,
ix86_function_arg_regno_p, ix86_function_arg_boundary,
ix86_return_in_memory, ix86_function_value): New global functions.
(init_cumulative_args): Refuse regparm on x86_64, set maybe_vaarg.
(function_arg_advance): Handle x86_64 passing conventions.
(function_arg): Likewise.
* i386.h (FUNCTION_ARG_BOUNDARY): New macro.
(RETURN_IN_MEMORY): Move offline.
(FUNCTION_VALUE, LIBCALL_VALUE): Likewise.
(FUNCTION_VALUE_REGNO_P): New macro.
(FUNCTION_ARG_REGNO_P): Move offline.
(struct ix86_args): Add maybe_vaarg.
* next.h (FUNCTION_VALUE_REGNO_P): Delete.
* unix.h (FUNCTION_VALUE_REGNO_P): Delete.
From-SVN: r45726
2001-09-21 14:55:18 +02:00
|
|
|
|
delete_insn_chain (insn, peep2_insn_data[i].insn);
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
|
2002-03-08 21:14:04 +01:00
|
|
|
|
/* Re-insert the EH_REGION notes. */
|
2002-05-14 01:00:35 +02:00
|
|
|
|
if (note || (was_call && nonlocal_goto_handler_labels))
|
2002-03-08 21:14:04 +01:00
|
|
|
|
{
|
2002-03-25 01:18:10 +01:00
|
|
|
|
edge eh_edge;
|
|
|
|
|
|
|
|
|
|
for (eh_edge = bb->succ; eh_edge
|
|
|
|
|
; eh_edge = eh_edge->succ_next)
|
2002-05-14 01:00:35 +02:00
|
|
|
|
if (eh_edge->flags & (EDGE_EH | EDGE_ABNORMAL_CALL))
|
2002-03-25 01:18:10 +01:00
|
|
|
|
break;
|
|
|
|
|
|
2002-03-26 01:30:35 +01:00
|
|
|
|
for (x = try ; x != before_try ; x = PREV_INSN (x))
|
2002-03-08 21:14:04 +01:00
|
|
|
|
if (GET_CODE (x) == CALL_INSN
|
|
|
|
|
|| (flag_non_call_exceptions
|
2002-03-26 01:30:35 +01:00
|
|
|
|
&& may_trap_p (PATTERN (x))
|
|
|
|
|
&& !find_reg_note (x, REG_EH_REGION, NULL)))
|
2002-03-25 01:18:10 +01:00
|
|
|
|
{
|
2002-05-14 01:00:35 +02:00
|
|
|
|
if (note)
|
|
|
|
|
REG_NOTES (x)
|
|
|
|
|
= gen_rtx_EXPR_LIST (REG_EH_REGION,
|
|
|
|
|
XEXP (note, 0),
|
|
|
|
|
REG_NOTES (x));
|
2002-03-25 01:18:10 +01:00
|
|
|
|
|
|
|
|
|
if (x != bb->end && eh_edge)
|
|
|
|
|
{
|
2002-03-26 01:30:35 +01:00
|
|
|
|
edge nfte, nehe;
|
|
|
|
|
int flags;
|
|
|
|
|
|
|
|
|
|
nfte = split_block (bb, x);
|
2002-05-14 01:00:35 +02:00
|
|
|
|
flags = (eh_edge->flags
|
|
|
|
|
& (EDGE_EH | EDGE_ABNORMAL));
|
2002-03-26 01:30:35 +01:00
|
|
|
|
if (GET_CODE (x) == CALL_INSN)
|
|
|
|
|
flags |= EDGE_ABNORMAL_CALL;
|
|
|
|
|
nehe = make_edge (nfte->src, eh_edge->dest,
|
|
|
|
|
flags);
|
|
|
|
|
|
2002-03-25 01:18:10 +01:00
|
|
|
|
nehe->probability = eh_edge->probability;
|
|
|
|
|
nfte->probability
|
|
|
|
|
= REG_BR_PROB_BASE - nehe->probability;
|
|
|
|
|
|
|
|
|
|
do_cleanup_cfg |= purge_dead_edges (nfte->dest);
|
|
|
|
|
#ifdef HAVE_conditional_execution
|
|
|
|
|
SET_BIT (blocks, nfte->dest->index);
|
|
|
|
|
changed = true;
|
|
|
|
|
#endif
|
|
|
|
|
bb = nfte->src;
|
2002-03-26 01:30:35 +01:00
|
|
|
|
eh_edge = nehe;
|
2002-03-25 01:18:10 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Converting possibly trapping insn to non-trapping is
|
|
|
|
|
possible. Zap dummy outgoing edges. */
|
|
|
|
|
do_cleanup_cfg |= purge_dead_edges (bb);
|
2002-03-08 21:14:04 +01:00
|
|
|
|
}
|
|
|
|
|
|
2000-05-27 22:23:15 +02:00
|
|
|
|
#ifdef HAVE_conditional_execution
|
|
|
|
|
/* With conditional execution, we cannot back up the
|
|
|
|
|
live information so easily, since the conditional
|
|
|
|
|
death data structures are not so self-contained.
|
|
|
|
|
So record that we've made a modification to this
|
|
|
|
|
block and update life information at the end. */
|
bb-reorder.c (make_reorder_chain, [...]): Use FOR_EACH_BB macros to iterate over basic block chain.
* bb-reorder.c (make_reorder_chain, make_reorder_chain_1):
Use FOR_EACH_BB macros to iterate over basic block chain.
* cfg.c (clear_edges, clear_bb_flags, dump_flow_info,
alloc_aux_for_blocks, clear_aux_for_blocks, alloc_aux_for_edges):
Likewise.
* cfganal.c (set_edge_can_fallthru_flag, flow_call_edges_add,
find_unreachable_blocks, create_edge_list, verify_edge_list,
remove_fake_edges, add_noreturn_fake_exit_edges,
flow_preorder_transversal_compute, flow_dfs_compute_reverse_execute):
Likewise.
* cfgbuild.c (make_edges, find_basic_blocks, find_many_sub_basic_blocks,
find_sub_basic_blocks): Likewise.
* cfgcleanup.c (try_optimize_cfg, delete_unreachable_blocks):
Likewise.
* cfglayout.c (record_effective_endpoints, cleanup_unconditional_jumps):
Likewise.
* cfgloop.c (flow_loops_cfg_dump, flow_loops_find):
Likewise.
* cfgrtl.c (compute_bb_for_insn, tidy_fallthru_edges,
commit_edge_insertions, commit_edge_insertions_watch_calls,
print_rtl_with_bb, verify_flow_info, purge_all_dead_edges): Likewise.
* combine.c (combine_instructions, reg_dead_at_p): Likewise.
* conflict.c (conflict_graph_compute): Likewise.
* df.c (df_bitmaps_alloc, df_bitmaps_free, df_alloc, df_analyse_1,
df_modified_p, df_refs_unlink, df_dump): Likewise.
* dominance.c (calc_dfs_tree, calculate_dominance_info): Likewise.
* final.c (compute_alignments): Likewise.
* flow.c (update_life_info, update_life_info_in_dirty_blocks,
delete_noop_moves, calculate_global_regs_live, allocate_bb_life_data,
count_or_remove_death_notes): Likewise.
* gcse.c (oprs_unchanged_p, record_last_reg_set_info,
compute_hash_table, compute_kill_rd, compute_rd, compute_ae_kill,
classic_gcse, compute_transp, cprop, compute_pre_data,
compute_transpout, invalidate_nonnull_info,
delete_null_pointer_checks_1, delete_null_pointer_checks,
compute_code_hoist_vbeinout, hoist_code, compute_ld_motion_mems,
compute_store_table, build_store_vectors, store_motion): Likewise.
* global.c (global_conflicts, mark_elimination): Likewise.
* graph.c (print_rtl_graph_with_bb): Likewise.
* haifa-sched.c (sched_init): Likewise.
* ifcvt.c (if_convert): Likewise.
* lcm.c (compute_antinout_edge, compute_laterin, compute_insert_delete,
compute_available, compute_nearerout, compute_rev_insert_delete,
optimize_mode_switching): Likewise.
* local-alloc.c (local_alloc, update_equiv_regs): Likewise.
* predict.c (estimate_probability, note_prediction_to_br_prob,
propagate_freq, counts_to_freqs, expensive_function_p,
estimate_bb_frequencies): Likewise.
* profile.c (instrument_edges, get_exec_counts,
compute_branch_probabilities, compute_checksum, branch_prob,
find_spanning_tree): Likewise.
* recog.c (split_all_insns, peephole2_optimize): Likewise.
* reg-stack.c (reg_to_stack, convert_regs_entry, convert_regs):
Likewise.
* regclass.c (scan_one_insn, regclass): Likewise.
* regmove.c (mark_flags_life_zones, regmove_optimize,
record_stack_memrefs): Likewise.
* regrename.c (regrename_optimize, copyprop_hardreg_forward): Likewise.
* reload1.c (reload, reload_combine, fixup_abnormal_edges): Likewise.
* resource.c (find_basic_block): Likewise.
* sched-ebb.c (schedule_ebbs): Likewise.
* sched-rgn.c (is_cfg_nonregular, build_control_flow,
find_single_block_region, find_rgns, schedule_insns)
* sibcall.c (optimize_sibling_and_tail_recursive_call)
* ssa-ccp.c (optimize_unexecutable_edges,
ssa_ccp_df_delete_unreachable_insns): Likewise.
* ssa-dce.c (ssa_eliminate_dead_code): Likewise.
* ssa.c (find_evaluations, compute_dominance_frontiers_1,
rename_block, convert_to_ssa, compute_conservative_reg_partition,
compute_coalesced_reg_partition, rename_equivalent_regs,
convert_from_ssa): Likewise.
* config/ia64/ia64.c (emit_predicate_relation_info, process_epilogue,
process_for_unwind_directive): Likewise.
* df.c (FOR_ALL_BBS): Removed.
* gcse.c (struct null_pointer_info): Type of current_block field
changed.
(struct reg_avail_info): Type of last_bb field changed.
* config/ia64/ia64.c (block_num): Removed.
(need_copy_state): Type changed.
(last_block): New.
From-SVN: r53804
2002-05-23 21:23:51 +02:00
|
|
|
|
SET_BIT (blocks, bb->index);
|
2002-03-25 01:18:10 +01:00
|
|
|
|
changed = true;
|
2000-05-27 22:23:15 +02:00
|
|
|
|
|
|
|
|
|
for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i)
|
|
|
|
|
peep2_insn_data[i].insn = NULL_RTX;
|
|
|
|
|
peep2_insn_data[peep2_current].insn = PEEP2_EOB;
|
|
|
|
|
#else
|
|
|
|
|
/* Back up lifetime information past the end of the
|
|
|
|
|
newly created sequence. */
|
|
|
|
|
if (++i >= MAX_INSNS_PER_PEEP2 + 1)
|
|
|
|
|
i = 0;
|
|
|
|
|
COPY_REG_SET (live, peep2_insn_data[i].live_before);
|
|
|
|
|
|
|
|
|
|
/* Update life information for the new sequence. */
|
2002-04-12 09:52:05 +02:00
|
|
|
|
x = try;
|
2000-05-27 22:23:15 +02:00
|
|
|
|
do
|
|
|
|
|
{
|
2002-04-12 09:52:05 +02:00
|
|
|
|
if (INSN_P (x))
|
2000-05-27 22:23:15 +02:00
|
|
|
|
{
|
|
|
|
|
if (--i < 0)
|
|
|
|
|
i = MAX_INSNS_PER_PEEP2;
|
2002-04-12 09:52:05 +02:00
|
|
|
|
peep2_insn_data[i].insn = x;
|
|
|
|
|
propagate_one_insn (pbi, x);
|
2000-05-27 22:23:15 +02:00
|
|
|
|
COPY_REG_SET (peep2_insn_data[i].live_before, live);
|
|
|
|
|
}
|
2002-04-12 09:52:05 +02:00
|
|
|
|
x = PREV_INSN (x);
|
2000-05-27 22:23:15 +02:00
|
|
|
|
}
|
2002-04-12 09:52:05 +02:00
|
|
|
|
while (x != prev);
|
2000-05-27 22:23:15 +02:00
|
|
|
|
|
|
|
|
|
/* ??? Should verify that LIVE now matches what we
|
|
|
|
|
had before the new sequence. */
|
|
|
|
|
|
|
|
|
|
peep2_current = i;
|
|
|
|
|
#endif
|
2002-04-12 09:52:05 +02:00
|
|
|
|
|
|
|
|
|
/* If we generated a jump instruction, it won't have
|
|
|
|
|
JUMP_LABEL set. Recompute after we're done. */
|
|
|
|
|
for (x = try; x != before_try; x = PREV_INSN (x))
|
|
|
|
|
if (GET_CODE (x) == JUMP_INSN)
|
|
|
|
|
{
|
|
|
|
|
do_rebuild_jump_labels = true;
|
|
|
|
|
break;
|
|
|
|
|
}
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
}
|
1999-08-31 22:37:09 +02:00
|
|
|
|
}
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
|
|
|
|
|
if (insn == bb->head)
|
|
|
|
|
break;
|
1999-08-31 22:37:09 +02:00
|
|
|
|
}
|
2000-05-27 22:23:15 +02:00
|
|
|
|
|
|
|
|
|
free_propagate_block_info (pbi);
|
1999-08-31 22:37:09 +02:00
|
|
|
|
}
|
|
|
|
|
|
2000-05-27 22:23:15 +02:00
|
|
|
|
for (i = 0; i < MAX_INSNS_PER_PEEP2 + 1; ++i)
|
|
|
|
|
FREE_REG_SET (peep2_insn_data[i].live_before);
|
|
|
|
|
FREE_REG_SET (live);
|
Makefile.in (flow.o): Depend on TREE_H.
* Makefile.in (flow.o): Depend on TREE_H.
* basic-block.h (REG_SET_EQUAL_P): New.
(XOR_REG_SET): New.
(n_edges): Declare.
(free_regset_vector): Remove declaration.
(flow_delete_insn_chain): Declare.
(enum update_life_extent): New.
(update_life_info, count_or_remove_death_notes): Declare.
* combine.c (distribute_notes) [REG_DEAD]: Stop search at bb->head.
Verify register live at bb->global_live_at_start before adding USE.
* flow.c (HAVE_epilogue, HAVE_prologue): Provide default.
(CLEAN_ALLOCA): New.
(n_edges): New.
(PROP_*): New flags.
(find_basic_blocks_1): Use alloc_EXPR_LIST.
(clear_edges): Zero n_edges.
(make_edge): Increment n_edges.
(split_edge): Don't allocate bb->local_set. Increment n_edges.
(flow_delete_insn_chain): Export.
(delete_block): Decrement n_edges.
(merge_blocks_nomove): Likewise.
(life_analysis): Give life_analysis_1 PROP flags.
(verify_wide_reg_1, verify_wide_reg): New.
(verify_local_live_at_start): New.
(update_life_info): Rewrite to call into propogate_block.
(mark_reg): New.
(mark_regs_live_at_end): After reload, if epilogue as rtl,
always mark stack pointer. Conditionally mark PIC register.
After reload, mark call-saved registers, return regsiters.
(life_analysis_1): Accept PROP flags not remove_dead_code.
Call mark_regs_live_at_end before zeroing regs_ever_live.
Use calculate_global_regs_live. Copy global_live_at_end before
calling final propagate_block. Zero reg_next_use on exit.
(calculate_global_regs_live): New.
(allocate_bb_life_data): Don't allocate bb->local_set.
(init_regset_vector, free_regset_vector): Remove.
(propagate_block): Accept FLAGS not FINAL or REMOVE_DEAD_CODE.
Test flags before every operation. Warn if prologue/epilogue insn
would have been deleted.
(mark_set_regs, mark_set_1): Accept and use FLAGS.
Use alloc_EXPR_LIST.
(mark_used_regs): Accept and use FLAGS, not FINAL.
Remove special handling for RETURN.
(try_pre_increment): Use alloc_EXPR_LIST.
(dump_flow_info): Dump n_edges.
(unlink_insn_chain, split_hard_reg_notes): Remove.
(maybe_add_dead_note, maybe_add_dead_note_use): Remove.
(find_insn_with_note, new_insn_dead_notes): Remove.
(update_n_sets, sets_reg_or_subreg_1, sets_reg_or_subreg): Remove.
(maybe_remove_dead_notes, prepend_reg_notes): Remove.
(replace_insns): Remove.
(count_or_remove_death_notes): New.
(verify_flow_info): Abort on error after all checks.
(remove_edge): Decrement n_edges.
(remove_fake_edges): Tweek format.
* haifa-sched.c (schedule_insns): Use split_all_insns.
* output.h (update_life_info): Remove declaration.
* recog.c (split_all_insns): From the corpse of split_block_insns,
do the whole function block by block. Use update_life_info.
(recog_last_allowed_insn): New.
(recog_next_insn): Mind it.
(peephole2_optimize): Set it. Walk backwards through blocks.
Use update_life_info.
* rtl.h (update_flow_info, replace_insns): Remove declarations.
(split_all_insns): Declare.
* toplev.c (rest_of_compilation): Thread prologue before flow2.
Use split_all_insns.
* i386.md (or -1 peep2s): Disable.
From-SVN: r29877
1999-10-09 21:47:18 +02:00
|
|
|
|
|
2002-04-12 09:52:05 +02:00
|
|
|
|
if (do_rebuild_jump_labels)
|
|
|
|
|
rebuild_jump_labels (get_insns ());
|
|
|
|
|
|
2002-03-25 01:18:10 +01:00
|
|
|
|
/* If we eliminated EH edges, we may be able to merge blocks. Further,
|
|
|
|
|
we've changed global life since exception handlers are no longer
|
|
|
|
|
reachable. */
|
|
|
|
|
if (do_cleanup_cfg)
|
|
|
|
|
{
|
|
|
|
|
cleanup_cfg (0);
|
|
|
|
|
update_life_info (0, UPDATE_LIFE_GLOBAL_RM_NOTES, PROP_DEATH_NOTES);
|
|
|
|
|
}
|
2000-05-27 22:23:15 +02:00
|
|
|
|
#ifdef HAVE_conditional_execution
|
2002-03-25 01:18:10 +01:00
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
count_or_remove_death_notes (blocks, 1);
|
|
|
|
|
update_life_info (blocks, UPDATE_LIFE_LOCAL, PROP_DEATH_NOTES);
|
|
|
|
|
}
|
2000-05-27 22:23:15 +02:00
|
|
|
|
sbitmap_free (blocks);
|
1999-08-31 22:37:09 +02:00
|
|
|
|
#endif
|
2000-05-27 22:23:15 +02:00
|
|
|
|
}
|
|
|
|
|
#endif /* HAVE_peephole2 */
|
2002-05-04 00:23:45 +02:00
|
|
|
|
|
|
|
|
|
/* Common predicates for use with define_bypass. */
|
|
|
|
|
|
|
|
|
|
/* True if the dependency between OUT_INSN and IN_INSN is on the store
|
2002-05-05 09:49:23 +02:00
|
|
|
|
data not the address operand(s) of the store. IN_INSN must be
|
|
|
|
|
single_set. OUT_INSN must be either a single_set or a PARALLEL with
|
|
|
|
|
SETs inside. */
|
2002-05-04 00:23:45 +02:00
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
store_data_bypass_p (out_insn, in_insn)
|
|
|
|
|
rtx out_insn, in_insn;
|
|
|
|
|
{
|
|
|
|
|
rtx out_set, in_set;
|
|
|
|
|
|
|
|
|
|
in_set = single_set (in_insn);
|
|
|
|
|
if (! in_set)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (SET_DEST (in_set)) != MEM)
|
|
|
|
|
return false;
|
|
|
|
|
|
2002-05-05 09:49:23 +02:00
|
|
|
|
out_set = single_set (out_insn);
|
|
|
|
|
if (out_set)
|
|
|
|
|
{
|
|
|
|
|
if (reg_mentioned_p (SET_DEST (out_set), SET_DEST (in_set)))
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rtx out_pat;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
out_pat = PATTERN (out_insn);
|
|
|
|
|
if (GET_CODE (out_pat) != PARALLEL)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < XVECLEN (out_pat, 0); i++)
|
|
|
|
|
{
|
|
|
|
|
rtx exp = XVECEXP (out_pat, 0, i);
|
|
|
|
|
|
2002-05-05 23:51:04 +02:00
|
|
|
|
if (GET_CODE (exp) == CLOBBER)
|
|
|
|
|
continue;
|
|
|
|
|
|
2002-05-05 09:49:23 +02:00
|
|
|
|
if (GET_CODE (exp) != SET)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
if (reg_mentioned_p (SET_DEST (exp), SET_DEST (in_set)))
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-05-04 00:23:45 +02:00
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2002-05-06 22:08:30 +02:00
|
|
|
|
/* True if the dependency between OUT_INSN and IN_INSN is in the IF_THEN_ELSE
|
|
|
|
|
condition, and not the THEN or ELSE branch. OUT_INSN may be either a single
|
|
|
|
|
or multiple set; IN_INSN should be single_set for truth, but for convenience
|
|
|
|
|
of insn categorization may be any JUMP or CALL insn. */
|
2002-05-04 00:23:45 +02:00
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
if_test_bypass_p (out_insn, in_insn)
|
|
|
|
|
rtx out_insn, in_insn;
|
|
|
|
|
{
|
|
|
|
|
rtx out_set, in_set;
|
|
|
|
|
|
|
|
|
|
in_set = single_set (in_insn);
|
|
|
|
|
if (! in_set)
|
2002-05-06 22:08:30 +02:00
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (in_insn) == JUMP_INSN || GET_CODE (in_insn) == CALL_INSN)
|
|
|
|
|
return false;
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
2002-05-04 00:23:45 +02:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (SET_SRC (in_set)) != IF_THEN_ELSE)
|
|
|
|
|
return false;
|
2002-05-06 22:08:30 +02:00
|
|
|
|
in_set = SET_SRC (in_set);
|
2002-05-04 00:23:45 +02:00
|
|
|
|
|
2002-05-06 22:08:30 +02:00
|
|
|
|
out_set = single_set (out_insn);
|
|
|
|
|
if (out_set)
|
|
|
|
|
{
|
|
|
|
|
if (reg_mentioned_p (SET_DEST (out_set), XEXP (in_set, 1))
|
|
|
|
|
|| reg_mentioned_p (SET_DEST (out_set), XEXP (in_set, 2)))
|
2002-05-09 03:42:28 +02:00
|
|
|
|
return false;
|
2002-05-06 22:08:30 +02:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rtx out_pat;
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
out_pat = PATTERN (out_insn);
|
|
|
|
|
if (GET_CODE (out_pat) != PARALLEL)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
for (i = 0; i < XVECLEN (out_pat, 0); i++)
|
|
|
|
|
{
|
|
|
|
|
rtx exp = XVECEXP (out_pat, 0, i);
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (exp) == CLOBBER)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (exp) != SET)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
if (reg_mentioned_p (SET_DEST (out_set), XEXP (in_set, 1))
|
|
|
|
|
|| reg_mentioned_p (SET_DEST (out_set), XEXP (in_set, 2)))
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-05-04 00:23:45 +02:00
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|