1992-03-11 23:26:55 +01:00
|
|
|
|
/* Subroutines for manipulating rtx's in semantically interesting ways.
|
2000-02-26 07:04:48 +01:00
|
|
|
|
Copyright (C) 1987, 1991, 1994, 1995, 1996, 1997, 1998,
|
|
|
|
|
1999, 2000 Free Software Foundation, Inc.
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
|
|
|
|
This file is part of GNU CC.
|
|
|
|
|
|
|
|
|
|
GNU CC is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
|
any later version.
|
|
|
|
|
|
|
|
|
|
GNU CC is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with GNU CC; see the file COPYING. If not, write to
|
1995-06-15 13:33:25 +02:00
|
|
|
|
the Free Software Foundation, 59 Temple Place - Suite 330,
|
|
|
|
|
Boston, MA 02111-1307, USA. */
|
1992-03-11 23:26:55 +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"
|
c-aux-info.c, [...]: Include toplev.h for real declaration of trim_filename.
1999-04-17 20:11 -0400 Zack Weinberg <zack@rabi.columbia.edu>
* c-aux-info.c, emit-rtl.c, explow.c, expmed.c, gcse.c,
haifa-sched.c, optabs.c, reorg.c, resource.c, sched.c: Include
toplev.h for real declaration of trim_filename.
* Makefile.in: Update dependencies.
From-SVN: r26523
1999-04-17 19:14:58 +02:00
|
|
|
|
#include "toplev.h"
|
1992-03-11 23:26:55 +01:00
|
|
|
|
#include "rtl.h"
|
|
|
|
|
#include "tree.h"
|
1999-09-20 12:00:03 +02:00
|
|
|
|
#include "tm_p.h"
|
1992-03-11 23:26:55 +01:00
|
|
|
|
#include "flags.h"
|
1999-08-09 16:00:21 +02:00
|
|
|
|
#include "function.h"
|
1992-03-11 23:26:55 +01:00
|
|
|
|
#include "expr.h"
|
|
|
|
|
#include "hard-reg-set.h"
|
|
|
|
|
#include "insn-config.h"
|
|
|
|
|
#include "recog.h"
|
|
|
|
|
#include "insn-flags.h"
|
|
|
|
|
#include "insn-codes.h"
|
|
|
|
|
|
1998-11-19 23:47:55 +01:00
|
|
|
|
#if !defined PREFERRED_STACK_BOUNDARY && defined STACK_BOUNDARY
|
|
|
|
|
#define PREFERRED_STACK_BOUNDARY STACK_BOUNDARY
|
|
|
|
|
#endif
|
|
|
|
|
|
2000-01-14 18:14:43 +01:00
|
|
|
|
static rtx break_out_memory_refs PARAMS ((rtx));
|
|
|
|
|
static void emit_stack_probe PARAMS ((rtx));
|
1999-07-23 03:21:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* Truncate and perhaps sign-extend C as appropriate for MODE. */
|
|
|
|
|
|
|
|
|
|
HOST_WIDE_INT
|
|
|
|
|
trunc_int_for_mode (c, mode)
|
|
|
|
|
HOST_WIDE_INT c;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
|
|
|
|
int width = GET_MODE_BITSIZE (mode);
|
|
|
|
|
|
|
|
|
|
/* We clear out all bits that don't belong in MODE, unless they and our
|
|
|
|
|
sign bit are all one. So we get either a reasonable negative
|
|
|
|
|
value or a reasonable unsigned value. */
|
|
|
|
|
|
|
|
|
|
if (width < HOST_BITS_PER_WIDE_INT
|
|
|
|
|
&& ((c & ((HOST_WIDE_INT) (-1) << (width - 1)))
|
|
|
|
|
!= ((HOST_WIDE_INT) (-1) << (width - 1))))
|
|
|
|
|
c &= ((HOST_WIDE_INT) 1 << width) - 1;
|
|
|
|
|
|
|
|
|
|
/* If this would be an entire word for the target, but is not for
|
|
|
|
|
the host, then sign-extend on the host so that the number will look
|
|
|
|
|
the same way on the host that it would on the target.
|
|
|
|
|
|
|
|
|
|
For example, when building a 64 bit alpha hosted 32 bit sparc
|
|
|
|
|
targeted compiler, then we want the 32 bit unsigned value -1 to be
|
|
|
|
|
represented as a 64 bit value -1, and not as 0x00000000ffffffff.
|
|
|
|
|
The later confuses the sparc backend. */
|
|
|
|
|
|
|
|
|
|
if (BITS_PER_WORD < HOST_BITS_PER_WIDE_INT
|
|
|
|
|
&& BITS_PER_WORD == width
|
|
|
|
|
&& (c & ((HOST_WIDE_INT) 1 << (width - 1))))
|
|
|
|
|
c |= ((HOST_WIDE_INT) (-1) << width);
|
|
|
|
|
|
|
|
|
|
return c;
|
|
|
|
|
}
|
|
|
|
|
|
1992-07-06 22:04:10 +02:00
|
|
|
|
/* Return an rtx for the sum of X and the integer C.
|
|
|
|
|
|
1993-01-10 21:12:31 +01:00
|
|
|
|
This function should be used via the `plus_constant' macro. */
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
|
|
|
|
rtx
|
1992-07-06 22:04:10 +02:00
|
|
|
|
plus_constant_wide (x, c)
|
1992-03-11 23:26:55 +01:00
|
|
|
|
register rtx x;
|
1992-07-06 22:04:10 +02:00
|
|
|
|
register HOST_WIDE_INT c;
|
1992-03-11 23:26:55 +01:00
|
|
|
|
{
|
|
|
|
|
register RTX_CODE code;
|
|
|
|
|
register enum machine_mode mode;
|
|
|
|
|
register rtx tem;
|
|
|
|
|
int all_constant = 0;
|
|
|
|
|
|
|
|
|
|
if (c == 0)
|
|
|
|
|
return x;
|
|
|
|
|
|
|
|
|
|
restart:
|
|
|
|
|
|
|
|
|
|
code = GET_CODE (x);
|
|
|
|
|
mode = GET_MODE (x);
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case CONST_INT:
|
1992-07-06 22:04:10 +02:00
|
|
|
|
return GEN_INT (INTVAL (x) + c);
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
|
|
|
|
case CONST_DOUBLE:
|
|
|
|
|
{
|
2000-05-04 23:15:05 +02:00
|
|
|
|
unsigned HOST_WIDE_INT l1 = CONST_DOUBLE_LOW (x);
|
1992-07-06 22:04:10 +02:00
|
|
|
|
HOST_WIDE_INT h1 = CONST_DOUBLE_HIGH (x);
|
2000-05-04 23:15:05 +02:00
|
|
|
|
unsigned HOST_WIDE_INT l2 = c;
|
1992-07-06 22:04:10 +02:00
|
|
|
|
HOST_WIDE_INT h2 = c < 0 ? ~0 : 0;
|
2000-05-04 23:15:05 +02:00
|
|
|
|
unsigned HOST_WIDE_INT lv;
|
|
|
|
|
HOST_WIDE_INT hv;
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
|
|
|
|
add_double (l1, h1, l2, h2, &lv, &hv);
|
|
|
|
|
|
|
|
|
|
return immed_double_const (lv, hv, VOIDmode);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case MEM:
|
|
|
|
|
/* If this is a reference to the constant pool, try replacing it with
|
|
|
|
|
a reference to a new constant. If the resulting address isn't
|
|
|
|
|
valid, don't return it because we have no way to validize it. */
|
|
|
|
|
if (GET_CODE (XEXP (x, 0)) == SYMBOL_REF
|
|
|
|
|
&& CONSTANT_POOL_ADDRESS_P (XEXP (x, 0)))
|
|
|
|
|
{
|
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
|
|
|
|
/* Any rtl we create here must go in a saveable obstack, since
|
|
|
|
|
we might have been called from within combine. */
|
|
|
|
|
push_obstacks_nochange ();
|
|
|
|
|
rtl_in_saveable_obstack ();
|
1992-03-11 23:26:55 +01:00
|
|
|
|
tem
|
|
|
|
|
= force_const_mem (GET_MODE (x),
|
|
|
|
|
plus_constant (get_pool_constant (XEXP (x, 0)),
|
|
|
|
|
c));
|
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
|
|
|
|
pop_obstacks ();
|
1992-03-11 23:26:55 +01:00
|
|
|
|
if (memory_address_p (GET_MODE (tem), XEXP (tem, 0)))
|
|
|
|
|
return tem;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CONST:
|
|
|
|
|
/* If adding to something entirely constant, set a flag
|
|
|
|
|
so that we can add a CONST around the result. */
|
|
|
|
|
x = XEXP (x, 0);
|
|
|
|
|
all_constant = 1;
|
|
|
|
|
goto restart;
|
|
|
|
|
|
|
|
|
|
case SYMBOL_REF:
|
|
|
|
|
case LABEL_REF:
|
|
|
|
|
all_constant = 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PLUS:
|
|
|
|
|
/* The interesting case is adding the integer to a sum.
|
|
|
|
|
Look for constant term in the sum and combine
|
|
|
|
|
with C. For an integer constant term, we make a combined
|
|
|
|
|
integer. For a constant term that is not an explicit integer,
|
1992-06-25 12:13:31 +02:00
|
|
|
|
we cannot really combine, but group them together anyway.
|
|
|
|
|
|
1998-12-08 15:35:18 +01:00
|
|
|
|
Restart or use a recursive call in case the remaining operand is
|
|
|
|
|
something that we handle specially, such as a SYMBOL_REF.
|
|
|
|
|
|
|
|
|
|
We may not immediately return from the recursive call here, lest
|
|
|
|
|
all_constant gets lost. */
|
1992-06-25 12:13:31 +02:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (XEXP (x, 1)) == CONST_INT)
|
1998-12-08 15:35:18 +01:00
|
|
|
|
{
|
|
|
|
|
c += INTVAL (XEXP (x, 1));
|
1999-07-23 03:21:31 +02:00
|
|
|
|
|
|
|
|
|
if (GET_MODE (x) != VOIDmode)
|
|
|
|
|
c = trunc_int_for_mode (c, GET_MODE (x));
|
|
|
|
|
|
1998-12-08 15:35:18 +01:00
|
|
|
|
x = XEXP (x, 0);
|
|
|
|
|
goto restart;
|
|
|
|
|
}
|
1992-03-11 23:26:55 +01:00
|
|
|
|
else if (CONSTANT_P (XEXP (x, 0)))
|
1998-12-08 15:35:18 +01:00
|
|
|
|
{
|
|
|
|
|
x = gen_rtx_PLUS (mode,
|
|
|
|
|
plus_constant (XEXP (x, 0), c),
|
|
|
|
|
XEXP (x, 1));
|
|
|
|
|
c = 0;
|
|
|
|
|
}
|
1992-03-11 23:26:55 +01:00
|
|
|
|
else if (CONSTANT_P (XEXP (x, 1)))
|
1998-12-08 15:35:18 +01:00
|
|
|
|
{
|
|
|
|
|
x = gen_rtx_PLUS (mode,
|
|
|
|
|
XEXP (x, 0),
|
|
|
|
|
plus_constant (XEXP (x, 1), c));
|
|
|
|
|
c = 0;
|
|
|
|
|
}
|
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
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
1992-03-11 23:26:55 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (c != 0)
|
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
|
|
|
|
x = gen_rtx_PLUS (mode, x, GEN_INT (c));
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF)
|
|
|
|
|
return x;
|
|
|
|
|
else if (all_constant)
|
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
|
|
|
|
return gen_rtx_CONST (mode, x);
|
1992-03-11 23:26:55 +01:00
|
|
|
|
else
|
|
|
|
|
return x;
|
|
|
|
|
}
|
|
|
|
|
|
1992-07-06 22:04:10 +02:00
|
|
|
|
/* This is the same as `plus_constant', except that it handles LO_SUM.
|
|
|
|
|
|
|
|
|
|
This function should be used via the `plus_constant_for_output' macro. */
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
|
|
|
|
rtx
|
1992-07-06 22:04:10 +02:00
|
|
|
|
plus_constant_for_output_wide (x, c)
|
1992-03-11 23:26:55 +01:00
|
|
|
|
register rtx x;
|
1992-07-06 22:04:10 +02:00
|
|
|
|
register HOST_WIDE_INT c;
|
1992-03-11 23:26:55 +01:00
|
|
|
|
{
|
|
|
|
|
register enum machine_mode mode = GET_MODE (x);
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (x) == LO_SUM)
|
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
|
|
|
|
return gen_rtx_LO_SUM (mode, XEXP (x, 0),
|
1999-09-07 07:49:18 +02:00
|
|
|
|
plus_constant_for_output (XEXP (x, 1), c));
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
return plus_constant (x, c);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If X is a sum, return a new sum like X but lacking any constant terms.
|
|
|
|
|
Add all the removed constant terms into *CONSTPTR.
|
|
|
|
|
X itself is not altered. The result != X if and only if
|
|
|
|
|
it is not isomorphic to X. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
eliminate_constant_term (x, constptr)
|
|
|
|
|
rtx x;
|
|
|
|
|
rtx *constptr;
|
|
|
|
|
{
|
|
|
|
|
register rtx x0, x1;
|
|
|
|
|
rtx tem;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (x) != PLUS)
|
|
|
|
|
return x;
|
|
|
|
|
|
|
|
|
|
/* First handle constants appearing at this level explicitly. */
|
|
|
|
|
if (GET_CODE (XEXP (x, 1)) == CONST_INT
|
|
|
|
|
&& 0 != (tem = simplify_binary_operation (PLUS, GET_MODE (x), *constptr,
|
|
|
|
|
XEXP (x, 1)))
|
|
|
|
|
&& GET_CODE (tem) == CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
*constptr = tem;
|
|
|
|
|
return eliminate_constant_term (XEXP (x, 0), constptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
tem = const0_rtx;
|
|
|
|
|
x0 = eliminate_constant_term (XEXP (x, 0), &tem);
|
|
|
|
|
x1 = eliminate_constant_term (XEXP (x, 1), &tem);
|
|
|
|
|
if ((x1 != XEXP (x, 1) || x0 != XEXP (x, 0))
|
|
|
|
|
&& 0 != (tem = simplify_binary_operation (PLUS, GET_MODE (x),
|
|
|
|
|
*constptr, tem))
|
|
|
|
|
&& GET_CODE (tem) == CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
*constptr = tem;
|
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
|
|
|
|
return gen_rtx_PLUS (GET_MODE (x), x0, x1);
|
1992-03-11 23:26:55 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return x;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Returns the insn that next references REG after INSN, or 0
|
|
|
|
|
if REG is clobbered before next referenced or we cannot find
|
|
|
|
|
an insn that references REG in a straight-line piece of code. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
find_next_ref (reg, insn)
|
|
|
|
|
rtx reg;
|
|
|
|
|
rtx insn;
|
|
|
|
|
{
|
|
|
|
|
rtx next;
|
|
|
|
|
|
|
|
|
|
for (insn = NEXT_INSN (insn); insn; insn = next)
|
|
|
|
|
{
|
|
|
|
|
next = NEXT_INSN (insn);
|
|
|
|
|
if (GET_CODE (insn) == NOTE)
|
|
|
|
|
continue;
|
|
|
|
|
if (GET_CODE (insn) == CODE_LABEL
|
|
|
|
|
|| GET_CODE (insn) == BARRIER)
|
|
|
|
|
return 0;
|
|
|
|
|
if (GET_CODE (insn) == INSN
|
|
|
|
|
|| GET_CODE (insn) == JUMP_INSN
|
|
|
|
|
|| GET_CODE (insn) == CALL_INSN)
|
|
|
|
|
{
|
|
|
|
|
if (reg_set_p (reg, insn))
|
|
|
|
|
return 0;
|
|
|
|
|
if (reg_mentioned_p (reg, PATTERN (insn)))
|
|
|
|
|
return insn;
|
|
|
|
|
if (GET_CODE (insn) == JUMP_INSN)
|
|
|
|
|
{
|
combine.c (try_combine): Use any_condjump_p...
* combine.c (try_combine): Use any_condjump_p, any_uncondjump_p
and pc_set at the place of simplejump_p and condjump_p.
* cse.c (record_jump_equiv): Likewise.
* emit-rtl.c (emit): Likewise.
* explow.c (find_next_ref): Likewise.
* flow.c (tidy_fallthru_edge): Likewise.
(init_propagate_block_info): Likewise.
* gcse.c (delete_null_pointer_checks): Likewise.
* ifcvt.c (cond_exec_get_condition, noce_get_condition,
dead_or_predicable): Likewise.
* integrate.c (copy_insn_list): Likewise.
* loop.c (scan_loop, verify_dominator, find_and_verify_loops,
for_each_insn_in_loop, check_dbra_loop, get_condition,
insert_bct, load_mems): Likewise.
* resource.c (find_dead_or_set_registers): Likewise.
* sibcalls.c (simplejump_p): Likewise.
* unroll.c (copy_loop_body, reg_dead_after_loop): Likewise.
From-SVN: r34175
2000-05-25 23:38:49 +02:00
|
|
|
|
if (any_uncondjump_p (insn))
|
1992-03-11 23:26:55 +01:00
|
|
|
|
next = JUMP_LABEL (insn);
|
|
|
|
|
else
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
if (GET_CODE (insn) == CALL_INSN
|
|
|
|
|
&& REGNO (reg) < FIRST_PSEUDO_REGISTER
|
|
|
|
|
&& call_used_regs[REGNO (reg)])
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return an rtx for the size in bytes of the value of EXP. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
expr_size (exp)
|
|
|
|
|
tree exp;
|
|
|
|
|
{
|
1993-10-04 02:46:46 +01:00
|
|
|
|
tree size = size_in_bytes (TREE_TYPE (exp));
|
|
|
|
|
|
|
|
|
|
if (TREE_CODE (size) != INTEGER_CST
|
|
|
|
|
&& contains_placeholder_p (size))
|
|
|
|
|
size = build (WITH_RECORD_EXPR, sizetype, size, exp);
|
|
|
|
|
|
1997-08-02 19:16:45 +02:00
|
|
|
|
return expand_expr (size, NULL_RTX, TYPE_MODE (sizetype),
|
|
|
|
|
EXPAND_MEMORY_USE_BAD);
|
1992-03-11 23:26:55 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return a copy of X in which all memory references
|
|
|
|
|
and all constants that involve symbol refs
|
|
|
|
|
have been replaced with new temporary registers.
|
|
|
|
|
Also emit code to load the memory locations and constants
|
|
|
|
|
into those registers.
|
|
|
|
|
|
|
|
|
|
If X contains no such constants or memory references,
|
|
|
|
|
X itself (not a copy) is returned.
|
|
|
|
|
|
|
|
|
|
If a constant is found in the address that is not a legitimate constant
|
|
|
|
|
in an insn, it is left alone in the hope that it might be valid in the
|
|
|
|
|
address.
|
|
|
|
|
|
|
|
|
|
X may contain no arithmetic except addition, subtraction and multiplication.
|
|
|
|
|
Values returned by expand_expr with 1 for sum_ok fit this constraint. */
|
|
|
|
|
|
|
|
|
|
static rtx
|
|
|
|
|
break_out_memory_refs (x)
|
|
|
|
|
register rtx x;
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (x) == MEM
|
1993-02-26 19:58:20 +01:00
|
|
|
|
|| (CONSTANT_P (x) && CONSTANT_ADDRESS_P (x)
|
1992-03-11 23:26:55 +01:00
|
|
|
|
&& GET_MODE (x) != VOIDmode))
|
1994-03-08 22:12:01 +01:00
|
|
|
|
x = force_reg (GET_MODE (x), x);
|
1992-03-11 23:26:55 +01:00
|
|
|
|
else if (GET_CODE (x) == PLUS || GET_CODE (x) == MINUS
|
|
|
|
|
|| GET_CODE (x) == MULT)
|
|
|
|
|
{
|
|
|
|
|
register rtx op0 = break_out_memory_refs (XEXP (x, 0));
|
|
|
|
|
register rtx op1 = break_out_memory_refs (XEXP (x, 1));
|
1994-03-08 22:12:01 +01:00
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
if (op0 != XEXP (x, 0) || op1 != XEXP (x, 1))
|
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
|
|
|
|
x = gen_rtx_fmt_ee (GET_CODE (x), Pmode, op0, op1);
|
1992-03-11 23:26:55 +01:00
|
|
|
|
}
|
1994-03-08 22:12:01 +01:00
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
return x;
|
|
|
|
|
}
|
|
|
|
|
|
1995-04-04 00:12:15 +02:00
|
|
|
|
#ifdef POINTERS_EXTEND_UNSIGNED
|
|
|
|
|
|
|
|
|
|
/* Given X, a memory address in ptr_mode, convert it to an address
|
1995-04-07 18:35:25 +02:00
|
|
|
|
in Pmode, or vice versa (TO_MODE says which way). We take advantage of
|
|
|
|
|
the fact that pointers are not allowed to overflow by commuting arithmetic
|
|
|
|
|
operations over conversions so that address arithmetic insns can be
|
|
|
|
|
used. */
|
1995-04-04 00:12:15 +02:00
|
|
|
|
|
1995-04-07 18:35:25 +02:00
|
|
|
|
rtx
|
|
|
|
|
convert_memory_address (to_mode, x)
|
|
|
|
|
enum machine_mode to_mode;
|
1995-04-04 00:12:15 +02:00
|
|
|
|
rtx x;
|
|
|
|
|
{
|
1996-06-18 12:33:10 +02:00
|
|
|
|
enum machine_mode from_mode = to_mode == ptr_mode ? Pmode : ptr_mode;
|
1995-04-07 18:35:25 +02:00
|
|
|
|
rtx temp;
|
|
|
|
|
|
1996-06-18 12:33:10 +02:00
|
|
|
|
/* Here we handle some special cases. If none of them apply, fall through
|
|
|
|
|
to the default case. */
|
1995-04-04 00:12:15 +02:00
|
|
|
|
switch (GET_CODE (x))
|
|
|
|
|
{
|
|
|
|
|
case CONST_INT:
|
|
|
|
|
case CONST_DOUBLE:
|
1995-04-07 18:35:25 +02:00
|
|
|
|
return x;
|
|
|
|
|
|
1995-04-04 00:12:15 +02:00
|
|
|
|
case LABEL_REF:
|
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
|
|
|
|
temp = gen_rtx_LABEL_REF (to_mode, XEXP (x, 0));
|
|
|
|
|
LABEL_REF_NONLOCAL_P (temp) = LABEL_REF_NONLOCAL_P (x);
|
|
|
|
|
return temp;
|
1995-04-07 18:35:25 +02:00
|
|
|
|
|
1995-04-04 00:12:15 +02:00
|
|
|
|
case SYMBOL_REF:
|
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
|
|
|
|
temp = gen_rtx_SYMBOL_REF (to_mode, XSTR (x, 0));
|
1995-04-07 18:35:25 +02:00
|
|
|
|
SYMBOL_REF_FLAG (temp) = SYMBOL_REF_FLAG (x);
|
1997-01-19 20:04:45 +01:00
|
|
|
|
CONSTANT_POOL_ADDRESS_P (temp) = CONSTANT_POOL_ADDRESS_P (x);
|
1995-04-07 18:35:25 +02:00
|
|
|
|
return temp;
|
1995-04-04 00:12:15 +02:00
|
|
|
|
|
1995-04-07 18:35:25 +02:00
|
|
|
|
case CONST:
|
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
|
|
|
|
return gen_rtx_CONST (to_mode,
|
|
|
|
|
convert_memory_address (to_mode, XEXP (x, 0)));
|
1995-04-04 00:12:15 +02:00
|
|
|
|
|
1996-06-18 12:33:10 +02:00
|
|
|
|
case PLUS:
|
|
|
|
|
case MULT:
|
|
|
|
|
/* For addition the second operand is a small constant, we can safely
|
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
|
|
|
|
permute the conversion and addition operation. We can always safely
|
1996-06-29 11:44:27 +02:00
|
|
|
|
permute them if we are making the address narrower. In addition,
|
|
|
|
|
always permute the operations if this is a constant. */
|
1996-06-18 12:33:10 +02:00
|
|
|
|
if (GET_MODE_SIZE (to_mode) < GET_MODE_SIZE (from_mode)
|
|
|
|
|
|| (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT
|
1996-06-29 11:44:27 +02:00
|
|
|
|
&& (INTVAL (XEXP (x, 1)) + 20000 < 40000
|
|
|
|
|
|| CONSTANT_P (XEXP (x, 0)))))
|
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
|
|
|
|
return gen_rtx_fmt_ee (GET_CODE (x), to_mode,
|
|
|
|
|
convert_memory_address (to_mode, XEXP (x, 0)),
|
|
|
|
|
convert_memory_address (to_mode, XEXP (x, 1)));
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
1995-04-04 00:12:15 +02:00
|
|
|
|
}
|
1996-06-18 12:33:10 +02:00
|
|
|
|
|
|
|
|
|
return convert_modes (to_mode, from_mode,
|
|
|
|
|
x, POINTERS_EXTEND_UNSIGNED);
|
1995-04-04 00:12:15 +02:00
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
/* Given a memory address or facsimile X, construct a new address,
|
|
|
|
|
currently equivalent, that is stable: future stores won't change it.
|
|
|
|
|
|
|
|
|
|
X must be composed of constants, register and memory references
|
|
|
|
|
combined with addition, subtraction and multiplication:
|
|
|
|
|
in other words, just what you can get from expand_expr if sum_ok is 1.
|
|
|
|
|
|
|
|
|
|
Works by making copies of all regs and memory locations used
|
|
|
|
|
by X and combining them the same way X does.
|
|
|
|
|
You could also stabilize the reference to this address
|
|
|
|
|
by copying the address to a register with copy_to_reg;
|
|
|
|
|
but then you wouldn't get indexed addressing in the reference. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
copy_all_regs (x)
|
|
|
|
|
register rtx x;
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (x) == REG)
|
|
|
|
|
{
|
1993-09-24 21:39:56 +02:00
|
|
|
|
if (REGNO (x) != FRAME_POINTER_REGNUM
|
|
|
|
|
#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
|
|
|
|
|
&& REGNO (x) != HARD_FRAME_POINTER_REGNUM
|
|
|
|
|
#endif
|
|
|
|
|
)
|
1992-03-11 23:26:55 +01:00
|
|
|
|
x = copy_to_reg (x);
|
|
|
|
|
}
|
|
|
|
|
else if (GET_CODE (x) == MEM)
|
|
|
|
|
x = copy_to_reg (x);
|
|
|
|
|
else if (GET_CODE (x) == PLUS || GET_CODE (x) == MINUS
|
|
|
|
|
|| GET_CODE (x) == MULT)
|
|
|
|
|
{
|
|
|
|
|
register rtx op0 = copy_all_regs (XEXP (x, 0));
|
|
|
|
|
register rtx op1 = copy_all_regs (XEXP (x, 1));
|
|
|
|
|
if (op0 != XEXP (x, 0) || op1 != XEXP (x, 1))
|
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
|
|
|
|
x = gen_rtx_fmt_ee (GET_CODE (x), Pmode, op0, op1);
|
1992-03-11 23:26:55 +01:00
|
|
|
|
}
|
|
|
|
|
return x;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return something equivalent to X but valid as a memory address
|
|
|
|
|
for something of mode MODE. When X is not itself valid, this
|
|
|
|
|
works by copying X or subexpressions of it into registers. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
memory_address (mode, x)
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
register rtx x;
|
|
|
|
|
{
|
1994-02-07 02:01:09 +01:00
|
|
|
|
register rtx oldx = x;
|
1992-03-11 23:26:55 +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 (x) == ADDRESSOF)
|
|
|
|
|
return x;
|
|
|
|
|
|
1995-04-04 00:12:15 +02:00
|
|
|
|
#ifdef POINTERS_EXTEND_UNSIGNED
|
|
|
|
|
if (GET_MODE (x) == ptr_mode)
|
1995-04-07 18:35:25 +02:00
|
|
|
|
x = convert_memory_address (Pmode, x);
|
1995-04-04 00:12:15 +02:00
|
|
|
|
#endif
|
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
/* By passing constant addresses thru registers
|
|
|
|
|
we get a chance to cse them. */
|
1993-02-26 19:58:20 +01:00
|
|
|
|
if (! cse_not_expected && CONSTANT_P (x) && CONSTANT_ADDRESS_P (x))
|
1994-02-07 02:01:09 +01:00
|
|
|
|
x = force_reg (Pmode, x);
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
|
|
|
|
/* Accept a QUEUED that refers to a REG
|
|
|
|
|
even though that isn't a valid address.
|
|
|
|
|
On attempting to put this in an insn we will call protect_from_queue
|
|
|
|
|
which will turn it into a REG, which is valid. */
|
1994-02-07 02:01:09 +01:00
|
|
|
|
else if (GET_CODE (x) == QUEUED
|
1992-03-11 23:26:55 +01:00
|
|
|
|
&& GET_CODE (QUEUED_VAR (x)) == REG)
|
1994-02-07 02:01:09 +01:00
|
|
|
|
;
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
|
|
|
|
/* We get better cse by rejecting indirect addressing at this stage.
|
|
|
|
|
Let the combiner create indirect addresses where appropriate.
|
|
|
|
|
For now, generate the code so that the subexpressions useful to share
|
|
|
|
|
are visible. But not if cse won't be done! */
|
1994-02-07 02:01:09 +01:00
|
|
|
|
else
|
1992-03-11 23:26:55 +01:00
|
|
|
|
{
|
1994-02-07 02:01:09 +01:00
|
|
|
|
if (! cse_not_expected && GET_CODE (x) != REG)
|
|
|
|
|
x = break_out_memory_refs (x);
|
|
|
|
|
|
|
|
|
|
/* At this point, any valid address is accepted. */
|
|
|
|
|
GO_IF_LEGITIMATE_ADDRESS (mode, x, win);
|
|
|
|
|
|
|
|
|
|
/* If it was valid before but breaking out memory refs invalidated it,
|
|
|
|
|
use it the old way. */
|
|
|
|
|
if (memory_address_p (mode, oldx))
|
|
|
|
|
goto win2;
|
|
|
|
|
|
|
|
|
|
/* Perform machine-dependent transformations on X
|
|
|
|
|
in certain cases. This is not necessary since the code
|
|
|
|
|
below can handle all possible cases, but machine-dependent
|
|
|
|
|
transformations can make better code. */
|
|
|
|
|
LEGITIMIZE_ADDRESS (x, oldx, mode, win);
|
|
|
|
|
|
|
|
|
|
/* PLUS and MULT can appear in special ways
|
|
|
|
|
as the result of attempts to make an address usable for indexing.
|
|
|
|
|
Usually they are dealt with by calling force_operand, below.
|
|
|
|
|
But a sum containing constant terms is special
|
|
|
|
|
if removing them makes the sum a valid address:
|
|
|
|
|
then we generate that address in a register
|
|
|
|
|
and index off of it. We do this because it often makes
|
|
|
|
|
shorter code, and because the addresses thus generated
|
|
|
|
|
in registers often become common subexpressions. */
|
|
|
|
|
if (GET_CODE (x) == PLUS)
|
|
|
|
|
{
|
|
|
|
|
rtx constant_term = const0_rtx;
|
|
|
|
|
rtx y = eliminate_constant_term (x, &constant_term);
|
|
|
|
|
if (constant_term == const0_rtx
|
|
|
|
|
|| ! memory_address_p (mode, y))
|
|
|
|
|
x = force_operand (x, NULL_RTX);
|
|
|
|
|
else
|
|
|
|
|
{
|
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
|
|
|
|
y = gen_rtx_PLUS (GET_MODE (x), copy_to_reg (y), constant_term);
|
1994-02-07 02:01:09 +01:00
|
|
|
|
if (! memory_address_p (mode, y))
|
|
|
|
|
x = force_operand (x, NULL_RTX);
|
|
|
|
|
else
|
|
|
|
|
x = y;
|
|
|
|
|
}
|
|
|
|
|
}
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
1995-02-23 00:46:44 +01:00
|
|
|
|
else if (GET_CODE (x) == MULT || GET_CODE (x) == MINUS)
|
1994-02-07 02:01:09 +01:00
|
|
|
|
x = force_operand (x, NULL_RTX);
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
1994-02-07 02:01:09 +01:00
|
|
|
|
/* If we have a register that's an invalid address,
|
|
|
|
|
it must be a hard reg of the wrong class. Copy it to a pseudo. */
|
|
|
|
|
else if (GET_CODE (x) == REG)
|
|
|
|
|
x = copy_to_reg (x);
|
|
|
|
|
|
|
|
|
|
/* Last resort: copy the value to a register, since
|
|
|
|
|
the register is a valid address. */
|
|
|
|
|
else
|
|
|
|
|
x = force_reg (Pmode, x);
|
|
|
|
|
|
|
|
|
|
goto done;
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
1994-02-10 14:49:33 +01:00
|
|
|
|
win2:
|
|
|
|
|
x = oldx;
|
|
|
|
|
win:
|
|
|
|
|
if (flag_force_addr && ! cse_not_expected && GET_CODE (x) != REG
|
|
|
|
|
/* Don't copy an addr via a reg if it is one of our stack slots. */
|
|
|
|
|
&& ! (GET_CODE (x) == PLUS
|
|
|
|
|
&& (XEXP (x, 0) == virtual_stack_vars_rtx
|
|
|
|
|
|| XEXP (x, 0) == virtual_incoming_args_rtx)))
|
|
|
|
|
{
|
|
|
|
|
if (general_operand (x, Pmode))
|
|
|
|
|
x = force_reg (Pmode, x);
|
|
|
|
|
else
|
|
|
|
|
x = force_operand (x, NULL_RTX);
|
|
|
|
|
}
|
1992-03-11 23:26:55 +01:00
|
|
|
|
}
|
1994-02-07 02:01:09 +01:00
|
|
|
|
|
|
|
|
|
done:
|
|
|
|
|
|
1994-03-08 22:12:01 +01:00
|
|
|
|
/* If we didn't change the address, we are done. Otherwise, mark
|
|
|
|
|
a reg as a pointer if we have REG or REG + CONST_INT. */
|
|
|
|
|
if (oldx == x)
|
|
|
|
|
return x;
|
|
|
|
|
else if (GET_CODE (x) == REG)
|
2000-03-30 15:46:05 +02:00
|
|
|
|
mark_reg_pointer (x, BITS_PER_UNIT);
|
1994-03-08 22:12:01 +01:00
|
|
|
|
else if (GET_CODE (x) == PLUS
|
|
|
|
|
&& GET_CODE (XEXP (x, 0)) == REG
|
|
|
|
|
&& GET_CODE (XEXP (x, 1)) == CONST_INT)
|
2000-03-30 15:46:05 +02:00
|
|
|
|
mark_reg_pointer (XEXP (x, 0), BITS_PER_UNIT);
|
1994-03-08 22:12:01 +01:00
|
|
|
|
|
1994-02-07 02:01:09 +01:00
|
|
|
|
/* OLDX may have been the address on a temporary. Update the address
|
|
|
|
|
to indicate that X is now used. */
|
|
|
|
|
update_temp_slot_address (oldx, x);
|
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
return x;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Like `memory_address' but pretend `flag_force_addr' is 0. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
memory_address_noforce (mode, x)
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
rtx x;
|
|
|
|
|
{
|
|
|
|
|
int ambient_force_addr = flag_force_addr;
|
|
|
|
|
rtx val;
|
|
|
|
|
|
|
|
|
|
flag_force_addr = 0;
|
|
|
|
|
val = memory_address (mode, x);
|
|
|
|
|
flag_force_addr = ambient_force_addr;
|
|
|
|
|
return val;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Convert a mem ref into one with a valid memory address.
|
|
|
|
|
Pass through anything else unchanged. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
validize_mem (ref)
|
|
|
|
|
rtx ref;
|
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (ref) != MEM)
|
|
|
|
|
return ref;
|
|
|
|
|
if (memory_address_p (GET_MODE (ref), XEXP (ref, 0)))
|
|
|
|
|
return ref;
|
|
|
|
|
/* Don't alter REF itself, since that is probably a stack slot. */
|
|
|
|
|
return change_address (ref, GET_MODE (ref), XEXP (ref, 0));
|
|
|
|
|
}
|
|
|
|
|
|
2000-06-06 05:37:50 +02:00
|
|
|
|
/* Given REF, either a MEM or a REG, and T, either the type of X or
|
|
|
|
|
the expression corresponding to REF, set RTX_UNCHANGING_P if
|
|
|
|
|
appropriate. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
maybe_set_unchanging (ref, t)
|
|
|
|
|
rtx ref;
|
|
|
|
|
tree t;
|
|
|
|
|
{
|
|
|
|
|
/* We can set RTX_UNCHANGING_P from TREE_READONLY for decls whose
|
|
|
|
|
initialization is only executed once, or whose initializer always
|
|
|
|
|
has the same value. Currently we simplify this to PARM_DECLs in the
|
|
|
|
|
first case, and decls with TREE_CONSTANT initializers in the second. */
|
|
|
|
|
if ((TREE_READONLY (t) && DECL_P (t)
|
|
|
|
|
&& (TREE_CODE (t) == PARM_DECL
|
|
|
|
|
|| DECL_INITIAL (t) == NULL_TREE
|
|
|
|
|
|| TREE_CONSTANT (DECL_INITIAL (t))))
|
|
|
|
|
|| TREE_CODE_CLASS (TREE_CODE (t)) == 'c')
|
|
|
|
|
RTX_UNCHANGING_P (ref) = 1;
|
|
|
|
|
}
|
|
|
|
|
|
Makefile.in (c-decl.o): Depend on rtl.h and expr.h.
* Makefile.in (c-decl.o): Depend on rtl.h and expr.h.
* alias.c (struct alias_entry): alias_set is HOST_WIDE_INT.
(REG_BASE_VALUE): Remove unneeded cast to unsigned.
(get_alias_set_entry): ALIAS_SET arg is HOST_WIDE_INT.
(find_base_decl): New function, from c_find_base_decl in c-common.c.
(new_alias_set): Moved from tree.c; return is HOST_WIDE_INT.
(get_alias_set): Likewise.
Major rework to do more things and allow language-specific code
to just handle special-cases.
(record_alias_subset): Args are HOST_WIDE_INT.
(record_component_alias): Local vars are HOST_WIDE_INT.
Don't handle COMPLEX_EXPR.
(get_varargs_alias_set): Moved from builtins.c.
(get_frame_alias_set): New function.
* builtins.c (expand_builtin_return_address): Use frame alias set.
(expand_builtin_setjmp, expand_builtin_longjmp): Use alias set
for setjmp buffer.
(get_memory_rtx): Rework to use set_mem_attributes.
(get_varargs_alias_set): Deleted from here.
* c-common.c (c_apply_type_quals_to_decl): Alias sets now HOST_WIDE_INT.
(c_find_base_decl): Deleted from here.
(c_get_alias_set): Remove many cases and rework to just handle
C-specific cases.
* c-common.h (c_get_alias_set): Returns HOST_WIDE_INT.
* c-decl.c (rtl.h, expr.h): Now included.
(init_decl_processing): Call record_component_aliases on array types.
(grokdeclarator): Likewise.
Set TREE_ADDRESSABLE for all fields that are not bitfields.
* c-typeck.c (common_type): Call record_component_aliases for array.
* caller-save.c (setup_save_areas): Rework register loop for unsigned.
Set all save areas to the frame alias set.
* calls.c (initialie_argument_information): Call set_mem_attributes.
(compute_argument_addresses, expand_call): Likewise.
* explow.c (set_mem_attributes): New function.
(stabilize): Use MEM_COPY_ATTRIBUTES and force_reg.
* expr.c (struct move_by_pieces): Remove {to,from}_{struct,readonly}.
LEN and OFFSET now HOST_WIDE_INT.
(clear_by_pieces): Similar changes.
(move_by_pieces): LEN now HOST_WIDE_INT; don't set deleted fields.
(move_by_pieces_ninsns): Now returns unsigned HOST_WIDE_INT.
(move_by_pieces_1): Don't use deleted fields, use MEM_COPY_ATTRIBUTES.
(clear_by_pieces_1): Likewise.
(emit_push_insn): Call set_mem_attributes.
(expand_expr, case INDIRECT_REF): Likewise.
(expand_expr, case VAR_DECL): Call change_address.
* expr.h (ADD_PARM_SIZE, SUB_PARM_SIZE): Use host_integerp and
tree_low_cst.
(get_varargs_alias_set, get_frame_alias_set): New decls.
(record_base_value, record_alias_subset, lang_get_alias_set): Likewise.
(new_alias_set, set_mem_attributes): Likewse.
* function.c (struct temp_slot): ALIAS_SET is HOST_WIDE_INT.
(assign_stack_temp_for_type): Likewise.
Can split slot even if alias set since can copy.
Set MEM_ALIAS_SET and MEM_SET_IN_STRUCT_P.
(assign_temp): Use host_integerp and tree_low_cst.
(put_var_into_stack): Properly handle SAVE_EXPR.
(put_addressof_into_stack): Likewise.
(assign_parms): Call set_mem_attributes.
Delete #if 0 code.
(fix_lexical_address): Put reference to chain into frame alias set.
(expand_function_start): Call set_mem_attributes.
* integrate.c (expand_inline_function): Likewise.
* recog.c (adj_offsettable_operand): Use MEM_COPY_ATTRIBUTES.
* regmove.c (try_apply_stack_adjustment): Likewise.
* reload.c (push_reload, make_memloc): Likewise.
* reload1.c (alter_reg): Make alias sets for spilled pseudos.
* rtl.def (MEM): Update comment.
* rtl.h (MEM_ALIAS_SET): Now uses XCWINT.
(move_by_pieces): Change length to HOST_WIDE_INT.
(record_base_value, record_alias_subset): Delete from here.
* stmt.c (expand_decl): Call set_mem_attributes.
* stor-layout.c (finish_record_layout): Call record_component_aliases.i
* toplev.c (compile_file): Call init_alias_once earlier.
* tree.c (lang_get_alias_set, get_alias_set, new_alias_set): Deleted
from here: now in alias.c.
* tree.h (struct tree_type): alias_set is HOST_WIDE_INT.
(struct tree_decl): Likewise.
(get_alias_set, new_alias_set, lang_get_alias_set): Deleted from here.
* varasm.c (make_function_rtl, make_decl_rtl): Call set_mem_attributes.
(output_constant_def, force_const_mem): Likewise.
* cp/Makefile.in (decl.o): Include ../expr.h.
* cp/decl.c (expr.h): Include.
(init_decl_processing): Call record_component_aliases for arrays.
(grokdeclarator): Likewise.
Set TREE_ADDRESSABLE for fields that aren't bitfields.
* cp/tree.c (build_cplus_array_type_1): Call record_component_aliases.
From-SVN: r34305
2000-05-31 20:37:31 +02:00
|
|
|
|
/* Given REF, a MEM, and T, either the type of X or the expression
|
|
|
|
|
corresponding to REF, set the memory attributes. OBJECTP is nonzero
|
|
|
|
|
if we are making a new object of this type. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
set_mem_attributes (ref, t, objectp)
|
|
|
|
|
rtx ref;
|
|
|
|
|
tree t;
|
|
|
|
|
int objectp;
|
|
|
|
|
{
|
2000-06-13 23:16:24 +02:00
|
|
|
|
tree type;
|
|
|
|
|
|
|
|
|
|
/* It can happen that type_for_mode was given a mode for which there
|
|
|
|
|
is no language-level type. In which case it returns NULL, which
|
|
|
|
|
we can see here. */
|
|
|
|
|
if (t == NULL_TREE)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
type = TYPE_P (t) ? t : TREE_TYPE (t);
|
Makefile.in (c-decl.o): Depend on rtl.h and expr.h.
* Makefile.in (c-decl.o): Depend on rtl.h and expr.h.
* alias.c (struct alias_entry): alias_set is HOST_WIDE_INT.
(REG_BASE_VALUE): Remove unneeded cast to unsigned.
(get_alias_set_entry): ALIAS_SET arg is HOST_WIDE_INT.
(find_base_decl): New function, from c_find_base_decl in c-common.c.
(new_alias_set): Moved from tree.c; return is HOST_WIDE_INT.
(get_alias_set): Likewise.
Major rework to do more things and allow language-specific code
to just handle special-cases.
(record_alias_subset): Args are HOST_WIDE_INT.
(record_component_alias): Local vars are HOST_WIDE_INT.
Don't handle COMPLEX_EXPR.
(get_varargs_alias_set): Moved from builtins.c.
(get_frame_alias_set): New function.
* builtins.c (expand_builtin_return_address): Use frame alias set.
(expand_builtin_setjmp, expand_builtin_longjmp): Use alias set
for setjmp buffer.
(get_memory_rtx): Rework to use set_mem_attributes.
(get_varargs_alias_set): Deleted from here.
* c-common.c (c_apply_type_quals_to_decl): Alias sets now HOST_WIDE_INT.
(c_find_base_decl): Deleted from here.
(c_get_alias_set): Remove many cases and rework to just handle
C-specific cases.
* c-common.h (c_get_alias_set): Returns HOST_WIDE_INT.
* c-decl.c (rtl.h, expr.h): Now included.
(init_decl_processing): Call record_component_aliases on array types.
(grokdeclarator): Likewise.
Set TREE_ADDRESSABLE for all fields that are not bitfields.
* c-typeck.c (common_type): Call record_component_aliases for array.
* caller-save.c (setup_save_areas): Rework register loop for unsigned.
Set all save areas to the frame alias set.
* calls.c (initialie_argument_information): Call set_mem_attributes.
(compute_argument_addresses, expand_call): Likewise.
* explow.c (set_mem_attributes): New function.
(stabilize): Use MEM_COPY_ATTRIBUTES and force_reg.
* expr.c (struct move_by_pieces): Remove {to,from}_{struct,readonly}.
LEN and OFFSET now HOST_WIDE_INT.
(clear_by_pieces): Similar changes.
(move_by_pieces): LEN now HOST_WIDE_INT; don't set deleted fields.
(move_by_pieces_ninsns): Now returns unsigned HOST_WIDE_INT.
(move_by_pieces_1): Don't use deleted fields, use MEM_COPY_ATTRIBUTES.
(clear_by_pieces_1): Likewise.
(emit_push_insn): Call set_mem_attributes.
(expand_expr, case INDIRECT_REF): Likewise.
(expand_expr, case VAR_DECL): Call change_address.
* expr.h (ADD_PARM_SIZE, SUB_PARM_SIZE): Use host_integerp and
tree_low_cst.
(get_varargs_alias_set, get_frame_alias_set): New decls.
(record_base_value, record_alias_subset, lang_get_alias_set): Likewise.
(new_alias_set, set_mem_attributes): Likewse.
* function.c (struct temp_slot): ALIAS_SET is HOST_WIDE_INT.
(assign_stack_temp_for_type): Likewise.
Can split slot even if alias set since can copy.
Set MEM_ALIAS_SET and MEM_SET_IN_STRUCT_P.
(assign_temp): Use host_integerp and tree_low_cst.
(put_var_into_stack): Properly handle SAVE_EXPR.
(put_addressof_into_stack): Likewise.
(assign_parms): Call set_mem_attributes.
Delete #if 0 code.
(fix_lexical_address): Put reference to chain into frame alias set.
(expand_function_start): Call set_mem_attributes.
* integrate.c (expand_inline_function): Likewise.
* recog.c (adj_offsettable_operand): Use MEM_COPY_ATTRIBUTES.
* regmove.c (try_apply_stack_adjustment): Likewise.
* reload.c (push_reload, make_memloc): Likewise.
* reload1.c (alter_reg): Make alias sets for spilled pseudos.
* rtl.def (MEM): Update comment.
* rtl.h (MEM_ALIAS_SET): Now uses XCWINT.
(move_by_pieces): Change length to HOST_WIDE_INT.
(record_base_value, record_alias_subset): Delete from here.
* stmt.c (expand_decl): Call set_mem_attributes.
* stor-layout.c (finish_record_layout): Call record_component_aliases.i
* toplev.c (compile_file): Call init_alias_once earlier.
* tree.c (lang_get_alias_set, get_alias_set, new_alias_set): Deleted
from here: now in alias.c.
* tree.h (struct tree_type): alias_set is HOST_WIDE_INT.
(struct tree_decl): Likewise.
(get_alias_set, new_alias_set, lang_get_alias_set): Deleted from here.
* varasm.c (make_function_rtl, make_decl_rtl): Call set_mem_attributes.
(output_constant_def, force_const_mem): Likewise.
* cp/Makefile.in (decl.o): Include ../expr.h.
* cp/decl.c (expr.h): Include.
(init_decl_processing): Call record_component_aliases for arrays.
(grokdeclarator): Likewise.
Set TREE_ADDRESSABLE for fields that aren't bitfields.
* cp/tree.c (build_cplus_array_type_1): Call record_component_aliases.
From-SVN: r34305
2000-05-31 20:37:31 +02:00
|
|
|
|
|
|
|
|
|
/* Get the alias set from the expression or type (perhaps using a
|
|
|
|
|
front-end routine) and then copy bits from the type. */
|
2000-06-06 05:37:50 +02:00
|
|
|
|
|
|
|
|
|
/* It is incorrect to set RTX_UNCHANGING_P from TREE_READONLY (type)
|
|
|
|
|
here, because, in C and C++, the fact that a location is accessed
|
|
|
|
|
through a const expression does not mean that the value there can
|
|
|
|
|
never change. */
|
Makefile.in (c-decl.o): Depend on rtl.h and expr.h.
* Makefile.in (c-decl.o): Depend on rtl.h and expr.h.
* alias.c (struct alias_entry): alias_set is HOST_WIDE_INT.
(REG_BASE_VALUE): Remove unneeded cast to unsigned.
(get_alias_set_entry): ALIAS_SET arg is HOST_WIDE_INT.
(find_base_decl): New function, from c_find_base_decl in c-common.c.
(new_alias_set): Moved from tree.c; return is HOST_WIDE_INT.
(get_alias_set): Likewise.
Major rework to do more things and allow language-specific code
to just handle special-cases.
(record_alias_subset): Args are HOST_WIDE_INT.
(record_component_alias): Local vars are HOST_WIDE_INT.
Don't handle COMPLEX_EXPR.
(get_varargs_alias_set): Moved from builtins.c.
(get_frame_alias_set): New function.
* builtins.c (expand_builtin_return_address): Use frame alias set.
(expand_builtin_setjmp, expand_builtin_longjmp): Use alias set
for setjmp buffer.
(get_memory_rtx): Rework to use set_mem_attributes.
(get_varargs_alias_set): Deleted from here.
* c-common.c (c_apply_type_quals_to_decl): Alias sets now HOST_WIDE_INT.
(c_find_base_decl): Deleted from here.
(c_get_alias_set): Remove many cases and rework to just handle
C-specific cases.
* c-common.h (c_get_alias_set): Returns HOST_WIDE_INT.
* c-decl.c (rtl.h, expr.h): Now included.
(init_decl_processing): Call record_component_aliases on array types.
(grokdeclarator): Likewise.
Set TREE_ADDRESSABLE for all fields that are not bitfields.
* c-typeck.c (common_type): Call record_component_aliases for array.
* caller-save.c (setup_save_areas): Rework register loop for unsigned.
Set all save areas to the frame alias set.
* calls.c (initialie_argument_information): Call set_mem_attributes.
(compute_argument_addresses, expand_call): Likewise.
* explow.c (set_mem_attributes): New function.
(stabilize): Use MEM_COPY_ATTRIBUTES and force_reg.
* expr.c (struct move_by_pieces): Remove {to,from}_{struct,readonly}.
LEN and OFFSET now HOST_WIDE_INT.
(clear_by_pieces): Similar changes.
(move_by_pieces): LEN now HOST_WIDE_INT; don't set deleted fields.
(move_by_pieces_ninsns): Now returns unsigned HOST_WIDE_INT.
(move_by_pieces_1): Don't use deleted fields, use MEM_COPY_ATTRIBUTES.
(clear_by_pieces_1): Likewise.
(emit_push_insn): Call set_mem_attributes.
(expand_expr, case INDIRECT_REF): Likewise.
(expand_expr, case VAR_DECL): Call change_address.
* expr.h (ADD_PARM_SIZE, SUB_PARM_SIZE): Use host_integerp and
tree_low_cst.
(get_varargs_alias_set, get_frame_alias_set): New decls.
(record_base_value, record_alias_subset, lang_get_alias_set): Likewise.
(new_alias_set, set_mem_attributes): Likewse.
* function.c (struct temp_slot): ALIAS_SET is HOST_WIDE_INT.
(assign_stack_temp_for_type): Likewise.
Can split slot even if alias set since can copy.
Set MEM_ALIAS_SET and MEM_SET_IN_STRUCT_P.
(assign_temp): Use host_integerp and tree_low_cst.
(put_var_into_stack): Properly handle SAVE_EXPR.
(put_addressof_into_stack): Likewise.
(assign_parms): Call set_mem_attributes.
Delete #if 0 code.
(fix_lexical_address): Put reference to chain into frame alias set.
(expand_function_start): Call set_mem_attributes.
* integrate.c (expand_inline_function): Likewise.
* recog.c (adj_offsettable_operand): Use MEM_COPY_ATTRIBUTES.
* regmove.c (try_apply_stack_adjustment): Likewise.
* reload.c (push_reload, make_memloc): Likewise.
* reload1.c (alter_reg): Make alias sets for spilled pseudos.
* rtl.def (MEM): Update comment.
* rtl.h (MEM_ALIAS_SET): Now uses XCWINT.
(move_by_pieces): Change length to HOST_WIDE_INT.
(record_base_value, record_alias_subset): Delete from here.
* stmt.c (expand_decl): Call set_mem_attributes.
* stor-layout.c (finish_record_layout): Call record_component_aliases.i
* toplev.c (compile_file): Call init_alias_once earlier.
* tree.c (lang_get_alias_set, get_alias_set, new_alias_set): Deleted
from here: now in alias.c.
* tree.h (struct tree_type): alias_set is HOST_WIDE_INT.
(struct tree_decl): Likewise.
(get_alias_set, new_alias_set, lang_get_alias_set): Deleted from here.
* varasm.c (make_function_rtl, make_decl_rtl): Call set_mem_attributes.
(output_constant_def, force_const_mem): Likewise.
* cp/Makefile.in (decl.o): Include ../expr.h.
* cp/decl.c (expr.h): Include.
(init_decl_processing): Call record_component_aliases for arrays.
(grokdeclarator): Likewise.
Set TREE_ADDRESSABLE for fields that aren't bitfields.
* cp/tree.c (build_cplus_array_type_1): Call record_component_aliases.
From-SVN: r34305
2000-05-31 20:37:31 +02:00
|
|
|
|
MEM_ALIAS_SET (ref) = get_alias_set (t);
|
|
|
|
|
MEM_VOLATILE_P (ref) = TYPE_VOLATILE (type);
|
|
|
|
|
MEM_IN_STRUCT_P (ref) = AGGREGATE_TYPE_P (type);
|
|
|
|
|
|
|
|
|
|
/* If we are making an object of this type, we know that it is a scalar if
|
|
|
|
|
the type is not an aggregate. */
|
|
|
|
|
if (objectp && ! AGGREGATE_TYPE_P (type))
|
|
|
|
|
MEM_SCALAR_P (ref) = 1;
|
|
|
|
|
|
|
|
|
|
/* If T is a type, this is all we can do. Otherwise, we may be able
|
|
|
|
|
to deduce some more information about the expression. */
|
|
|
|
|
if (TYPE_P (t))
|
|
|
|
|
return;
|
|
|
|
|
|
2000-06-06 05:37:50 +02:00
|
|
|
|
maybe_set_unchanging (ref, t);
|
Makefile.in (c-decl.o): Depend on rtl.h and expr.h.
* Makefile.in (c-decl.o): Depend on rtl.h and expr.h.
* alias.c (struct alias_entry): alias_set is HOST_WIDE_INT.
(REG_BASE_VALUE): Remove unneeded cast to unsigned.
(get_alias_set_entry): ALIAS_SET arg is HOST_WIDE_INT.
(find_base_decl): New function, from c_find_base_decl in c-common.c.
(new_alias_set): Moved from tree.c; return is HOST_WIDE_INT.
(get_alias_set): Likewise.
Major rework to do more things and allow language-specific code
to just handle special-cases.
(record_alias_subset): Args are HOST_WIDE_INT.
(record_component_alias): Local vars are HOST_WIDE_INT.
Don't handle COMPLEX_EXPR.
(get_varargs_alias_set): Moved from builtins.c.
(get_frame_alias_set): New function.
* builtins.c (expand_builtin_return_address): Use frame alias set.
(expand_builtin_setjmp, expand_builtin_longjmp): Use alias set
for setjmp buffer.
(get_memory_rtx): Rework to use set_mem_attributes.
(get_varargs_alias_set): Deleted from here.
* c-common.c (c_apply_type_quals_to_decl): Alias sets now HOST_WIDE_INT.
(c_find_base_decl): Deleted from here.
(c_get_alias_set): Remove many cases and rework to just handle
C-specific cases.
* c-common.h (c_get_alias_set): Returns HOST_WIDE_INT.
* c-decl.c (rtl.h, expr.h): Now included.
(init_decl_processing): Call record_component_aliases on array types.
(grokdeclarator): Likewise.
Set TREE_ADDRESSABLE for all fields that are not bitfields.
* c-typeck.c (common_type): Call record_component_aliases for array.
* caller-save.c (setup_save_areas): Rework register loop for unsigned.
Set all save areas to the frame alias set.
* calls.c (initialie_argument_information): Call set_mem_attributes.
(compute_argument_addresses, expand_call): Likewise.
* explow.c (set_mem_attributes): New function.
(stabilize): Use MEM_COPY_ATTRIBUTES and force_reg.
* expr.c (struct move_by_pieces): Remove {to,from}_{struct,readonly}.
LEN and OFFSET now HOST_WIDE_INT.
(clear_by_pieces): Similar changes.
(move_by_pieces): LEN now HOST_WIDE_INT; don't set deleted fields.
(move_by_pieces_ninsns): Now returns unsigned HOST_WIDE_INT.
(move_by_pieces_1): Don't use deleted fields, use MEM_COPY_ATTRIBUTES.
(clear_by_pieces_1): Likewise.
(emit_push_insn): Call set_mem_attributes.
(expand_expr, case INDIRECT_REF): Likewise.
(expand_expr, case VAR_DECL): Call change_address.
* expr.h (ADD_PARM_SIZE, SUB_PARM_SIZE): Use host_integerp and
tree_low_cst.
(get_varargs_alias_set, get_frame_alias_set): New decls.
(record_base_value, record_alias_subset, lang_get_alias_set): Likewise.
(new_alias_set, set_mem_attributes): Likewse.
* function.c (struct temp_slot): ALIAS_SET is HOST_WIDE_INT.
(assign_stack_temp_for_type): Likewise.
Can split slot even if alias set since can copy.
Set MEM_ALIAS_SET and MEM_SET_IN_STRUCT_P.
(assign_temp): Use host_integerp and tree_low_cst.
(put_var_into_stack): Properly handle SAVE_EXPR.
(put_addressof_into_stack): Likewise.
(assign_parms): Call set_mem_attributes.
Delete #if 0 code.
(fix_lexical_address): Put reference to chain into frame alias set.
(expand_function_start): Call set_mem_attributes.
* integrate.c (expand_inline_function): Likewise.
* recog.c (adj_offsettable_operand): Use MEM_COPY_ATTRIBUTES.
* regmove.c (try_apply_stack_adjustment): Likewise.
* reload.c (push_reload, make_memloc): Likewise.
* reload1.c (alter_reg): Make alias sets for spilled pseudos.
* rtl.def (MEM): Update comment.
* rtl.h (MEM_ALIAS_SET): Now uses XCWINT.
(move_by_pieces): Change length to HOST_WIDE_INT.
(record_base_value, record_alias_subset): Delete from here.
* stmt.c (expand_decl): Call set_mem_attributes.
* stor-layout.c (finish_record_layout): Call record_component_aliases.i
* toplev.c (compile_file): Call init_alias_once earlier.
* tree.c (lang_get_alias_set, get_alias_set, new_alias_set): Deleted
from here: now in alias.c.
* tree.h (struct tree_type): alias_set is HOST_WIDE_INT.
(struct tree_decl): Likewise.
(get_alias_set, new_alias_set, lang_get_alias_set): Deleted from here.
* varasm.c (make_function_rtl, make_decl_rtl): Call set_mem_attributes.
(output_constant_def, force_const_mem): Likewise.
* cp/Makefile.in (decl.o): Include ../expr.h.
* cp/decl.c (expr.h): Include.
(init_decl_processing): Call record_component_aliases for arrays.
(grokdeclarator): Likewise.
Set TREE_ADDRESSABLE for fields that aren't bitfields.
* cp/tree.c (build_cplus_array_type_1): Call record_component_aliases.
From-SVN: r34305
2000-05-31 20:37:31 +02:00
|
|
|
|
if (TREE_THIS_VOLATILE (t))
|
|
|
|
|
MEM_VOLATILE_P (ref) = 1;
|
|
|
|
|
|
|
|
|
|
/* Now see if we can say more about whether it's an aggregate or
|
|
|
|
|
scalar. If we already know it's an aggregate, don't bother. */
|
|
|
|
|
if (MEM_IN_STRUCT_P (ref))
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
/* Now remove any NOPs: they don't change what the underlying object is.
|
|
|
|
|
Likewise for SAVE_EXPR. */
|
|
|
|
|
while (TREE_CODE (t) == NOP_EXPR || TREE_CODE (t) == CONVERT_EXPR
|
|
|
|
|
|| TREE_CODE (t) == NON_LVALUE_EXPR || TREE_CODE (t) == SAVE_EXPR)
|
|
|
|
|
t = TREE_OPERAND (t, 0);
|
|
|
|
|
|
|
|
|
|
/* Since we already know the type isn't an aggregate, if this is a decl,
|
|
|
|
|
it must be a scalar. Or if it is a reference into an aggregate,
|
|
|
|
|
this is part of an aggregate. Otherwise we don't know. */
|
|
|
|
|
if (DECL_P (t))
|
|
|
|
|
MEM_SCALAR_P (ref) = 1;
|
|
|
|
|
else if (TREE_CODE (t) == COMPONENT_REF || TREE_CODE (t) == ARRAY_REF
|
|
|
|
|
|| TREE_CODE (t) == BIT_FIELD_REF)
|
|
|
|
|
MEM_IN_STRUCT_P (ref) = 1;
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
/* Return a modified copy of X with its memory address copied
|
|
|
|
|
into a temporary register to protect it from side effects.
|
|
|
|
|
If X is not a MEM, it is returned unchanged (and not copied).
|
|
|
|
|
Perhaps even if it is a MEM, if there is no need to change it. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
stabilize (x)
|
|
|
|
|
rtx x;
|
|
|
|
|
{
|
|
|
|
|
register rtx addr;
|
Makefile.in (c-decl.o): Depend on rtl.h and expr.h.
* Makefile.in (c-decl.o): Depend on rtl.h and expr.h.
* alias.c (struct alias_entry): alias_set is HOST_WIDE_INT.
(REG_BASE_VALUE): Remove unneeded cast to unsigned.
(get_alias_set_entry): ALIAS_SET arg is HOST_WIDE_INT.
(find_base_decl): New function, from c_find_base_decl in c-common.c.
(new_alias_set): Moved from tree.c; return is HOST_WIDE_INT.
(get_alias_set): Likewise.
Major rework to do more things and allow language-specific code
to just handle special-cases.
(record_alias_subset): Args are HOST_WIDE_INT.
(record_component_alias): Local vars are HOST_WIDE_INT.
Don't handle COMPLEX_EXPR.
(get_varargs_alias_set): Moved from builtins.c.
(get_frame_alias_set): New function.
* builtins.c (expand_builtin_return_address): Use frame alias set.
(expand_builtin_setjmp, expand_builtin_longjmp): Use alias set
for setjmp buffer.
(get_memory_rtx): Rework to use set_mem_attributes.
(get_varargs_alias_set): Deleted from here.
* c-common.c (c_apply_type_quals_to_decl): Alias sets now HOST_WIDE_INT.
(c_find_base_decl): Deleted from here.
(c_get_alias_set): Remove many cases and rework to just handle
C-specific cases.
* c-common.h (c_get_alias_set): Returns HOST_WIDE_INT.
* c-decl.c (rtl.h, expr.h): Now included.
(init_decl_processing): Call record_component_aliases on array types.
(grokdeclarator): Likewise.
Set TREE_ADDRESSABLE for all fields that are not bitfields.
* c-typeck.c (common_type): Call record_component_aliases for array.
* caller-save.c (setup_save_areas): Rework register loop for unsigned.
Set all save areas to the frame alias set.
* calls.c (initialie_argument_information): Call set_mem_attributes.
(compute_argument_addresses, expand_call): Likewise.
* explow.c (set_mem_attributes): New function.
(stabilize): Use MEM_COPY_ATTRIBUTES and force_reg.
* expr.c (struct move_by_pieces): Remove {to,from}_{struct,readonly}.
LEN and OFFSET now HOST_WIDE_INT.
(clear_by_pieces): Similar changes.
(move_by_pieces): LEN now HOST_WIDE_INT; don't set deleted fields.
(move_by_pieces_ninsns): Now returns unsigned HOST_WIDE_INT.
(move_by_pieces_1): Don't use deleted fields, use MEM_COPY_ATTRIBUTES.
(clear_by_pieces_1): Likewise.
(emit_push_insn): Call set_mem_attributes.
(expand_expr, case INDIRECT_REF): Likewise.
(expand_expr, case VAR_DECL): Call change_address.
* expr.h (ADD_PARM_SIZE, SUB_PARM_SIZE): Use host_integerp and
tree_low_cst.
(get_varargs_alias_set, get_frame_alias_set): New decls.
(record_base_value, record_alias_subset, lang_get_alias_set): Likewise.
(new_alias_set, set_mem_attributes): Likewse.
* function.c (struct temp_slot): ALIAS_SET is HOST_WIDE_INT.
(assign_stack_temp_for_type): Likewise.
Can split slot even if alias set since can copy.
Set MEM_ALIAS_SET and MEM_SET_IN_STRUCT_P.
(assign_temp): Use host_integerp and tree_low_cst.
(put_var_into_stack): Properly handle SAVE_EXPR.
(put_addressof_into_stack): Likewise.
(assign_parms): Call set_mem_attributes.
Delete #if 0 code.
(fix_lexical_address): Put reference to chain into frame alias set.
(expand_function_start): Call set_mem_attributes.
* integrate.c (expand_inline_function): Likewise.
* recog.c (adj_offsettable_operand): Use MEM_COPY_ATTRIBUTES.
* regmove.c (try_apply_stack_adjustment): Likewise.
* reload.c (push_reload, make_memloc): Likewise.
* reload1.c (alter_reg): Make alias sets for spilled pseudos.
* rtl.def (MEM): Update comment.
* rtl.h (MEM_ALIAS_SET): Now uses XCWINT.
(move_by_pieces): Change length to HOST_WIDE_INT.
(record_base_value, record_alias_subset): Delete from here.
* stmt.c (expand_decl): Call set_mem_attributes.
* stor-layout.c (finish_record_layout): Call record_component_aliases.i
* toplev.c (compile_file): Call init_alias_once earlier.
* tree.c (lang_get_alias_set, get_alias_set, new_alias_set): Deleted
from here: now in alias.c.
* tree.h (struct tree_type): alias_set is HOST_WIDE_INT.
(struct tree_decl): Likewise.
(get_alias_set, new_alias_set, lang_get_alias_set): Deleted from here.
* varasm.c (make_function_rtl, make_decl_rtl): Call set_mem_attributes.
(output_constant_def, force_const_mem): Likewise.
* cp/Makefile.in (decl.o): Include ../expr.h.
* cp/decl.c (expr.h): Include.
(init_decl_processing): Call record_component_aliases for arrays.
(grokdeclarator): Likewise.
Set TREE_ADDRESSABLE for fields that aren't bitfields.
* cp/tree.c (build_cplus_array_type_1): Call record_component_aliases.
From-SVN: r34305
2000-05-31 20:37:31 +02:00
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
if (GET_CODE (x) != MEM)
|
|
|
|
|
return x;
|
Makefile.in (c-decl.o): Depend on rtl.h and expr.h.
* Makefile.in (c-decl.o): Depend on rtl.h and expr.h.
* alias.c (struct alias_entry): alias_set is HOST_WIDE_INT.
(REG_BASE_VALUE): Remove unneeded cast to unsigned.
(get_alias_set_entry): ALIAS_SET arg is HOST_WIDE_INT.
(find_base_decl): New function, from c_find_base_decl in c-common.c.
(new_alias_set): Moved from tree.c; return is HOST_WIDE_INT.
(get_alias_set): Likewise.
Major rework to do more things and allow language-specific code
to just handle special-cases.
(record_alias_subset): Args are HOST_WIDE_INT.
(record_component_alias): Local vars are HOST_WIDE_INT.
Don't handle COMPLEX_EXPR.
(get_varargs_alias_set): Moved from builtins.c.
(get_frame_alias_set): New function.
* builtins.c (expand_builtin_return_address): Use frame alias set.
(expand_builtin_setjmp, expand_builtin_longjmp): Use alias set
for setjmp buffer.
(get_memory_rtx): Rework to use set_mem_attributes.
(get_varargs_alias_set): Deleted from here.
* c-common.c (c_apply_type_quals_to_decl): Alias sets now HOST_WIDE_INT.
(c_find_base_decl): Deleted from here.
(c_get_alias_set): Remove many cases and rework to just handle
C-specific cases.
* c-common.h (c_get_alias_set): Returns HOST_WIDE_INT.
* c-decl.c (rtl.h, expr.h): Now included.
(init_decl_processing): Call record_component_aliases on array types.
(grokdeclarator): Likewise.
Set TREE_ADDRESSABLE for all fields that are not bitfields.
* c-typeck.c (common_type): Call record_component_aliases for array.
* caller-save.c (setup_save_areas): Rework register loop for unsigned.
Set all save areas to the frame alias set.
* calls.c (initialie_argument_information): Call set_mem_attributes.
(compute_argument_addresses, expand_call): Likewise.
* explow.c (set_mem_attributes): New function.
(stabilize): Use MEM_COPY_ATTRIBUTES and force_reg.
* expr.c (struct move_by_pieces): Remove {to,from}_{struct,readonly}.
LEN and OFFSET now HOST_WIDE_INT.
(clear_by_pieces): Similar changes.
(move_by_pieces): LEN now HOST_WIDE_INT; don't set deleted fields.
(move_by_pieces_ninsns): Now returns unsigned HOST_WIDE_INT.
(move_by_pieces_1): Don't use deleted fields, use MEM_COPY_ATTRIBUTES.
(clear_by_pieces_1): Likewise.
(emit_push_insn): Call set_mem_attributes.
(expand_expr, case INDIRECT_REF): Likewise.
(expand_expr, case VAR_DECL): Call change_address.
* expr.h (ADD_PARM_SIZE, SUB_PARM_SIZE): Use host_integerp and
tree_low_cst.
(get_varargs_alias_set, get_frame_alias_set): New decls.
(record_base_value, record_alias_subset, lang_get_alias_set): Likewise.
(new_alias_set, set_mem_attributes): Likewse.
* function.c (struct temp_slot): ALIAS_SET is HOST_WIDE_INT.
(assign_stack_temp_for_type): Likewise.
Can split slot even if alias set since can copy.
Set MEM_ALIAS_SET and MEM_SET_IN_STRUCT_P.
(assign_temp): Use host_integerp and tree_low_cst.
(put_var_into_stack): Properly handle SAVE_EXPR.
(put_addressof_into_stack): Likewise.
(assign_parms): Call set_mem_attributes.
Delete #if 0 code.
(fix_lexical_address): Put reference to chain into frame alias set.
(expand_function_start): Call set_mem_attributes.
* integrate.c (expand_inline_function): Likewise.
* recog.c (adj_offsettable_operand): Use MEM_COPY_ATTRIBUTES.
* regmove.c (try_apply_stack_adjustment): Likewise.
* reload.c (push_reload, make_memloc): Likewise.
* reload1.c (alter_reg): Make alias sets for spilled pseudos.
* rtl.def (MEM): Update comment.
* rtl.h (MEM_ALIAS_SET): Now uses XCWINT.
(move_by_pieces): Change length to HOST_WIDE_INT.
(record_base_value, record_alias_subset): Delete from here.
* stmt.c (expand_decl): Call set_mem_attributes.
* stor-layout.c (finish_record_layout): Call record_component_aliases.i
* toplev.c (compile_file): Call init_alias_once earlier.
* tree.c (lang_get_alias_set, get_alias_set, new_alias_set): Deleted
from here: now in alias.c.
* tree.h (struct tree_type): alias_set is HOST_WIDE_INT.
(struct tree_decl): Likewise.
(get_alias_set, new_alias_set, lang_get_alias_set): Deleted from here.
* varasm.c (make_function_rtl, make_decl_rtl): Call set_mem_attributes.
(output_constant_def, force_const_mem): Likewise.
* cp/Makefile.in (decl.o): Include ../expr.h.
* cp/decl.c (expr.h): Include.
(init_decl_processing): Call record_component_aliases for arrays.
(grokdeclarator): Likewise.
Set TREE_ADDRESSABLE for fields that aren't bitfields.
* cp/tree.c (build_cplus_array_type_1): Call record_component_aliases.
From-SVN: r34305
2000-05-31 20:37:31 +02:00
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
addr = XEXP (x, 0);
|
|
|
|
|
if (rtx_unstable_p (addr))
|
|
|
|
|
{
|
Makefile.in (c-decl.o): Depend on rtl.h and expr.h.
* Makefile.in (c-decl.o): Depend on rtl.h and expr.h.
* alias.c (struct alias_entry): alias_set is HOST_WIDE_INT.
(REG_BASE_VALUE): Remove unneeded cast to unsigned.
(get_alias_set_entry): ALIAS_SET arg is HOST_WIDE_INT.
(find_base_decl): New function, from c_find_base_decl in c-common.c.
(new_alias_set): Moved from tree.c; return is HOST_WIDE_INT.
(get_alias_set): Likewise.
Major rework to do more things and allow language-specific code
to just handle special-cases.
(record_alias_subset): Args are HOST_WIDE_INT.
(record_component_alias): Local vars are HOST_WIDE_INT.
Don't handle COMPLEX_EXPR.
(get_varargs_alias_set): Moved from builtins.c.
(get_frame_alias_set): New function.
* builtins.c (expand_builtin_return_address): Use frame alias set.
(expand_builtin_setjmp, expand_builtin_longjmp): Use alias set
for setjmp buffer.
(get_memory_rtx): Rework to use set_mem_attributes.
(get_varargs_alias_set): Deleted from here.
* c-common.c (c_apply_type_quals_to_decl): Alias sets now HOST_WIDE_INT.
(c_find_base_decl): Deleted from here.
(c_get_alias_set): Remove many cases and rework to just handle
C-specific cases.
* c-common.h (c_get_alias_set): Returns HOST_WIDE_INT.
* c-decl.c (rtl.h, expr.h): Now included.
(init_decl_processing): Call record_component_aliases on array types.
(grokdeclarator): Likewise.
Set TREE_ADDRESSABLE for all fields that are not bitfields.
* c-typeck.c (common_type): Call record_component_aliases for array.
* caller-save.c (setup_save_areas): Rework register loop for unsigned.
Set all save areas to the frame alias set.
* calls.c (initialie_argument_information): Call set_mem_attributes.
(compute_argument_addresses, expand_call): Likewise.
* explow.c (set_mem_attributes): New function.
(stabilize): Use MEM_COPY_ATTRIBUTES and force_reg.
* expr.c (struct move_by_pieces): Remove {to,from}_{struct,readonly}.
LEN and OFFSET now HOST_WIDE_INT.
(clear_by_pieces): Similar changes.
(move_by_pieces): LEN now HOST_WIDE_INT; don't set deleted fields.
(move_by_pieces_ninsns): Now returns unsigned HOST_WIDE_INT.
(move_by_pieces_1): Don't use deleted fields, use MEM_COPY_ATTRIBUTES.
(clear_by_pieces_1): Likewise.
(emit_push_insn): Call set_mem_attributes.
(expand_expr, case INDIRECT_REF): Likewise.
(expand_expr, case VAR_DECL): Call change_address.
* expr.h (ADD_PARM_SIZE, SUB_PARM_SIZE): Use host_integerp and
tree_low_cst.
(get_varargs_alias_set, get_frame_alias_set): New decls.
(record_base_value, record_alias_subset, lang_get_alias_set): Likewise.
(new_alias_set, set_mem_attributes): Likewse.
* function.c (struct temp_slot): ALIAS_SET is HOST_WIDE_INT.
(assign_stack_temp_for_type): Likewise.
Can split slot even if alias set since can copy.
Set MEM_ALIAS_SET and MEM_SET_IN_STRUCT_P.
(assign_temp): Use host_integerp and tree_low_cst.
(put_var_into_stack): Properly handle SAVE_EXPR.
(put_addressof_into_stack): Likewise.
(assign_parms): Call set_mem_attributes.
Delete #if 0 code.
(fix_lexical_address): Put reference to chain into frame alias set.
(expand_function_start): Call set_mem_attributes.
* integrate.c (expand_inline_function): Likewise.
* recog.c (adj_offsettable_operand): Use MEM_COPY_ATTRIBUTES.
* regmove.c (try_apply_stack_adjustment): Likewise.
* reload.c (push_reload, make_memloc): Likewise.
* reload1.c (alter_reg): Make alias sets for spilled pseudos.
* rtl.def (MEM): Update comment.
* rtl.h (MEM_ALIAS_SET): Now uses XCWINT.
(move_by_pieces): Change length to HOST_WIDE_INT.
(record_base_value, record_alias_subset): Delete from here.
* stmt.c (expand_decl): Call set_mem_attributes.
* stor-layout.c (finish_record_layout): Call record_component_aliases.i
* toplev.c (compile_file): Call init_alias_once earlier.
* tree.c (lang_get_alias_set, get_alias_set, new_alias_set): Deleted
from here: now in alias.c.
* tree.h (struct tree_type): alias_set is HOST_WIDE_INT.
(struct tree_decl): Likewise.
(get_alias_set, new_alias_set, lang_get_alias_set): Deleted from here.
* varasm.c (make_function_rtl, make_decl_rtl): Call set_mem_attributes.
(output_constant_def, force_const_mem): Likewise.
* cp/Makefile.in (decl.o): Include ../expr.h.
* cp/decl.c (expr.h): Include.
(init_decl_processing): Call record_component_aliases for arrays.
(grokdeclarator): Likewise.
Set TREE_ADDRESSABLE for fields that aren't bitfields.
* cp/tree.c (build_cplus_array_type_1): Call record_component_aliases.
From-SVN: r34305
2000-05-31 20:37:31 +02:00
|
|
|
|
rtx temp = force_reg (Pmode, copy_all_regs (addr));
|
|
|
|
|
rtx mem = gen_rtx_MEM (GET_MODE (x), temp);
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
1999-01-19 11:32:33 +01:00
|
|
|
|
MEM_COPY_ATTRIBUTES (mem, x);
|
1992-03-11 23:26:55 +01:00
|
|
|
|
return mem;
|
|
|
|
|
}
|
|
|
|
|
return x;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Copy the value or contents of X to a new temp reg and return that reg. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
copy_to_reg (x)
|
|
|
|
|
rtx x;
|
|
|
|
|
{
|
|
|
|
|
register rtx temp = gen_reg_rtx (GET_MODE (x));
|
|
|
|
|
|
|
|
|
|
/* If not an operand, must be an address with PLUS and MULT so
|
|
|
|
|
do the computation. */
|
|
|
|
|
if (! general_operand (x, VOIDmode))
|
|
|
|
|
x = force_operand (x, temp);
|
|
|
|
|
|
|
|
|
|
if (x != temp)
|
|
|
|
|
emit_move_insn (temp, x);
|
|
|
|
|
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Like copy_to_reg but always give the new register mode Pmode
|
|
|
|
|
in case X is a constant. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
copy_addr_to_reg (x)
|
|
|
|
|
rtx x;
|
|
|
|
|
{
|
|
|
|
|
return copy_to_mode_reg (Pmode, x);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Like copy_to_reg but always give the new register mode MODE
|
|
|
|
|
in case X is a constant. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
copy_to_mode_reg (mode, x)
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
rtx x;
|
|
|
|
|
{
|
|
|
|
|
register rtx temp = gen_reg_rtx (mode);
|
|
|
|
|
|
|
|
|
|
/* If not an operand, must be an address with PLUS and MULT so
|
|
|
|
|
do the computation. */
|
|
|
|
|
if (! general_operand (x, VOIDmode))
|
|
|
|
|
x = force_operand (x, temp);
|
|
|
|
|
|
|
|
|
|
if (GET_MODE (x) != mode && GET_MODE (x) != VOIDmode)
|
|
|
|
|
abort ();
|
|
|
|
|
if (x != temp)
|
|
|
|
|
emit_move_insn (temp, x);
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Load X into a register if it is not already one.
|
|
|
|
|
Use mode MODE for the register.
|
|
|
|
|
X should be valid for mode MODE, but it may be a constant which
|
|
|
|
|
is valid for all integer modes; that's why caller must specify MODE.
|
|
|
|
|
|
|
|
|
|
The caller must not alter the value in the register we return,
|
|
|
|
|
since we mark it as a "constant" register. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
force_reg (mode, x)
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
rtx x;
|
|
|
|
|
{
|
1994-07-14 15:42:18 +02:00
|
|
|
|
register rtx temp, insn, set;
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
|
|
|
|
if (GET_CODE (x) == REG)
|
|
|
|
|
return x;
|
1999-08-02 10:40:22 +02:00
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
temp = gen_reg_rtx (mode);
|
1999-08-02 10:40:22 +02:00
|
|
|
|
|
|
|
|
|
if (! general_operand (x, mode))
|
|
|
|
|
x = force_operand (x, NULL_RTX);
|
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
insn = emit_move_insn (temp, x);
|
1994-07-14 15:42:18 +02:00
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
/* Let optimizers know that TEMP's value never changes
|
1994-07-14 15:42:18 +02:00
|
|
|
|
and that X can be substituted for it. Don't get confused
|
|
|
|
|
if INSN set something else (such as a SUBREG of TEMP). */
|
|
|
|
|
if (CONSTANT_P (x)
|
|
|
|
|
&& (set = single_set (insn)) != 0
|
|
|
|
|
&& SET_DEST (set) == temp)
|
1992-03-11 23:26:55 +01:00
|
|
|
|
{
|
1992-07-06 22:04:10 +02:00
|
|
|
|
rtx note = find_reg_note (insn, REG_EQUAL, NULL_RTX);
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
|
|
|
|
if (note)
|
|
|
|
|
XEXP (note, 0) = x;
|
|
|
|
|
else
|
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
|
|
|
|
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_EQUAL, x, REG_NOTES (insn));
|
1992-03-11 23:26:55 +01:00
|
|
|
|
}
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If X is a memory ref, copy its contents to a new temp reg and return
|
|
|
|
|
that reg. Otherwise, return X. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
force_not_mem (x)
|
|
|
|
|
rtx x;
|
|
|
|
|
{
|
|
|
|
|
register rtx temp;
|
2000-07-23 19:12:04 +02:00
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
if (GET_CODE (x) != MEM || GET_MODE (x) == BLKmode)
|
|
|
|
|
return x;
|
2000-07-23 19:12:04 +02:00
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
temp = gen_reg_rtx (GET_MODE (x));
|
|
|
|
|
emit_move_insn (temp, x);
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Copy X to TARGET (if it's nonzero and a reg)
|
|
|
|
|
or to a new temp reg and return that reg.
|
|
|
|
|
MODE is the mode to use for X in case it is a constant. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
copy_to_suggested_reg (x, target, mode)
|
|
|
|
|
rtx x, target;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
|
|
|
|
register rtx temp;
|
|
|
|
|
|
|
|
|
|
if (target && GET_CODE (target) == REG)
|
|
|
|
|
temp = target;
|
|
|
|
|
else
|
|
|
|
|
temp = gen_reg_rtx (mode);
|
|
|
|
|
|
|
|
|
|
emit_move_insn (temp, x);
|
|
|
|
|
return temp;
|
|
|
|
|
}
|
|
|
|
|
|
1994-04-18 20:50:18 +02:00
|
|
|
|
/* Return the mode to use to store a scalar of TYPE and MODE.
|
|
|
|
|
PUNSIGNEDP points to the signedness of the type and may be adjusted
|
|
|
|
|
to show what signedness to use on extension operations.
|
|
|
|
|
|
|
|
|
|
FOR_CALL is non-zero if this call is promoting args for a call. */
|
|
|
|
|
|
|
|
|
|
enum machine_mode
|
|
|
|
|
promote_mode (type, mode, punsignedp, for_call)
|
|
|
|
|
tree type;
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
int *punsignedp;
|
1998-10-13 17:25:25 +02:00
|
|
|
|
int for_call ATTRIBUTE_UNUSED;
|
1994-04-18 20:50:18 +02:00
|
|
|
|
{
|
|
|
|
|
enum tree_code code = TREE_CODE (type);
|
|
|
|
|
int unsignedp = *punsignedp;
|
|
|
|
|
|
|
|
|
|
#ifdef PROMOTE_FOR_CALL_ONLY
|
|
|
|
|
if (! for_call)
|
|
|
|
|
return mode;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
#ifdef PROMOTE_MODE
|
|
|
|
|
case INTEGER_TYPE: case ENUMERAL_TYPE: case BOOLEAN_TYPE:
|
|
|
|
|
case CHAR_TYPE: case REAL_TYPE: case OFFSET_TYPE:
|
|
|
|
|
PROMOTE_MODE (mode, unsignedp, type);
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
|
1995-04-04 00:12:15 +02:00
|
|
|
|
#ifdef POINTERS_EXTEND_UNSIGNED
|
1996-09-24 03:23:23 +02:00
|
|
|
|
case REFERENCE_TYPE:
|
1994-04-18 20:50:18 +02:00
|
|
|
|
case POINTER_TYPE:
|
1995-04-04 00:12:15 +02:00
|
|
|
|
mode = Pmode;
|
|
|
|
|
unsignedp = POINTERS_EXTEND_UNSIGNED;
|
1994-04-18 20:50:18 +02:00
|
|
|
|
break;
|
1995-04-04 00:12:15 +02:00
|
|
|
|
#endif
|
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;
|
1994-04-18 20:50:18 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
*punsignedp = unsignedp;
|
|
|
|
|
return mode;
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
/* Adjust the stack pointer by ADJUST (an rtx for a number of bytes).
|
|
|
|
|
This pops when ADJUST is positive. ADJUST need not be constant. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
adjust_stack (adjust)
|
|
|
|
|
rtx adjust;
|
|
|
|
|
{
|
|
|
|
|
rtx temp;
|
|
|
|
|
adjust = protect_from_queue (adjust, 0);
|
|
|
|
|
|
|
|
|
|
if (adjust == const0_rtx)
|
|
|
|
|
return;
|
|
|
|
|
|
2000-04-01 02:09:22 +02:00
|
|
|
|
/* We expect all variable sized adjustments to be multiple of
|
|
|
|
|
PREFERRED_STACK_BOUNDARY. */
|
|
|
|
|
if (GET_CODE (adjust) == CONST_INT)
|
|
|
|
|
stack_pointer_delta -= INTVAL (adjust);
|
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
temp = expand_binop (Pmode,
|
|
|
|
|
#ifdef STACK_GROWS_DOWNWARD
|
|
|
|
|
add_optab,
|
|
|
|
|
#else
|
|
|
|
|
sub_optab,
|
|
|
|
|
#endif
|
|
|
|
|
stack_pointer_rtx, adjust, stack_pointer_rtx, 0,
|
|
|
|
|
OPTAB_LIB_WIDEN);
|
|
|
|
|
|
|
|
|
|
if (temp != stack_pointer_rtx)
|
|
|
|
|
emit_move_insn (stack_pointer_rtx, temp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Adjust the stack pointer by minus ADJUST (an rtx for a number of bytes).
|
|
|
|
|
This pushes when ADJUST is positive. ADJUST need not be constant. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
anti_adjust_stack (adjust)
|
|
|
|
|
rtx adjust;
|
|
|
|
|
{
|
|
|
|
|
rtx temp;
|
|
|
|
|
adjust = protect_from_queue (adjust, 0);
|
|
|
|
|
|
|
|
|
|
if (adjust == const0_rtx)
|
|
|
|
|
return;
|
|
|
|
|
|
2000-04-01 02:09:22 +02:00
|
|
|
|
/* We expect all variable sized adjustments to be multiple of
|
|
|
|
|
PREFERRED_STACK_BOUNDARY. */
|
|
|
|
|
if (GET_CODE (adjust) == CONST_INT)
|
|
|
|
|
stack_pointer_delta += INTVAL (adjust);
|
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
temp = expand_binop (Pmode,
|
|
|
|
|
#ifdef STACK_GROWS_DOWNWARD
|
|
|
|
|
sub_optab,
|
|
|
|
|
#else
|
|
|
|
|
add_optab,
|
|
|
|
|
#endif
|
|
|
|
|
stack_pointer_rtx, adjust, stack_pointer_rtx, 0,
|
|
|
|
|
OPTAB_LIB_WIDEN);
|
|
|
|
|
|
|
|
|
|
if (temp != stack_pointer_rtx)
|
|
|
|
|
emit_move_insn (stack_pointer_rtx, temp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Round the size of a block to be pushed up to the boundary required
|
|
|
|
|
by this machine. SIZE is the desired size, which need not be constant. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
round_push (size)
|
|
|
|
|
rtx size;
|
|
|
|
|
{
|
1998-11-19 23:47:55 +01:00
|
|
|
|
#ifdef PREFERRED_STACK_BOUNDARY
|
|
|
|
|
int align = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT;
|
1992-03-11 23:26:55 +01:00
|
|
|
|
if (align == 1)
|
|
|
|
|
return size;
|
|
|
|
|
if (GET_CODE (size) == CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
int new = (INTVAL (size) + align - 1) / align * align;
|
|
|
|
|
if (INTVAL (size) != new)
|
1992-07-06 22:04:10 +02:00
|
|
|
|
size = GEN_INT (new);
|
1992-03-11 23:26:55 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
1994-07-12 15:07:53 +02:00
|
|
|
|
/* CEIL_DIV_EXPR needs to worry about the addition overflowing,
|
1996-07-04 00:07:53 +02:00
|
|
|
|
but we know it can't. So add ourselves and then do
|
|
|
|
|
TRUNC_DIV_EXPR. */
|
1994-07-12 15:07:53 +02:00
|
|
|
|
size = expand_binop (Pmode, add_optab, size, GEN_INT (align - 1),
|
|
|
|
|
NULL_RTX, 1, OPTAB_LIB_WIDEN);
|
|
|
|
|
size = expand_divmod (0, TRUNC_DIV_EXPR, Pmode, size, GEN_INT (align),
|
1992-07-06 22:04:10 +02:00
|
|
|
|
NULL_RTX, 1);
|
|
|
|
|
size = expand_mult (Pmode, size, GEN_INT (align), NULL_RTX, 1);
|
1992-03-11 23:26:55 +01:00
|
|
|
|
}
|
1998-11-19 23:47:55 +01:00
|
|
|
|
#endif /* PREFERRED_STACK_BOUNDARY */
|
1992-03-11 23:26:55 +01:00
|
|
|
|
return size;
|
|
|
|
|
}
|
|
|
|
|
|
1992-05-06 13:35:29 +02:00
|
|
|
|
/* Save the stack pointer for the purpose in SAVE_LEVEL. PSAVE is a pointer
|
|
|
|
|
to a previously-created save area. If no save area has been allocated,
|
|
|
|
|
this function will allocate one. If a save area is specified, it
|
|
|
|
|
must be of the proper mode.
|
|
|
|
|
|
|
|
|
|
The insns are emitted after insn AFTER, if nonzero, otherwise the insns
|
|
|
|
|
are emitted at the current position. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
emit_stack_save (save_level, psave, after)
|
|
|
|
|
enum save_level save_level;
|
|
|
|
|
rtx *psave;
|
|
|
|
|
rtx after;
|
|
|
|
|
{
|
|
|
|
|
rtx sa = *psave;
|
|
|
|
|
/* The default is that we use a move insn and save in a Pmode object. */
|
2000-01-14 18:14:43 +01:00
|
|
|
|
rtx (*fcn) PARAMS ((rtx, rtx)) = gen_move_insn;
|
tree.c (get_inner_array_type): New function.
Thu Jun 4 14:35:27 1998 David Edelsohn <edelsohn@mhpcc.edu>
* tree.c (get_inner_array_type): New function.
* tree.h (get_inner_array_type): Prototype.
* expr.h (STACK_SAVEAREA_MODE): New macro.
* expr.c (expand_builtin_setjmp): Initialize sa_mode using
STACK_SAVEAREA_MODE.
(expand_builtin_longjmp): Likewise.
* explow.c (emit_stack_save): Likewise.
(allocate_dynamic_stack_space): Use Pmode not insn_operand_mode.
* rs6000/aix41.h (ASM_CPU_SPEC): Define relative to ASM_DEFAULT_SPEC.
(CPP_CPU_SPEC): Define relative to CPU_DEFAULT_SPEC.
* rs6000/aix43.h: New file.
* rs6000/t-aix43: New file.
* rs6000/x-aix41: New file.
* rs6000/x-aix43: New file.
* configure.in (rs6000-ibm-aix*): Use them.
* rs6000/powerpc.h: Delete.
* rs6000/sysv4.h: Move necessary powerpc.h definitions to here.
* rs6000/netware.h: and here.
* rs6000/win-nt.h: and here.
* rs6000/rs6000.c (processor_target_table, 620): Do not affect
MASK_POWERPC64.
(rs6000_override_options): Ignore flag_pic for AIX.
(rs6000_immed_double_const): Delete.
(u_short_cint_operand): Don't assume 32-bit CONST_INT.
(reg_or_u_short_operand): Don't assume 32-bit CONST_INT.
(num_insns_constant): mask64_operand() is 2 insns.
(logical_operand): Don't assume 32-bit CONST_INT.
(non_logical_cint_operand): Don't assume 32-bit CONST_INT.
(easy_fp_constant): Any CONST_DOUBLE_HIGH is okay for 64-bit.
(mask_constant): HOST_WIDE_INT parameter.
(non_and_cint_operand): Delete.
(mask64_operand): New function.
(and64_operand): New function.
(function_arg_advance): DImode arguments do not need special
alignment when 64-bit.
(function_arg): Likewise.
(setup_incoming_varargs): Reverse reg_size assignment.
(print_operand): HOST_WIDE_INT second parameter.
(print_operand, 'B'): New case.
(print_operand, 'M'): Fix typo in lossage string.
(print_operandm 'S'): New case.
(rs6000_stack_info): Reverse reg_size assignment. Use total_raw_size
to compute AIX push_p. Use reg_size to compute {cr,lr}_save_offset.
(rs6000_output_load_toc_table): Reverse init_ptr assignment. Use
TARGET_64BIT not TARGET_POWERPC64. Convert fprintf to fputs.
Load GOT highpart, don't add it. Add lowpart with {cal|la}.
(rs6000_allocate_stack_space): Use {cal|la}.
(output_epilog): Use {cal|la}
(output_function_profiler): Add call glue to mcount call.
Load GOT highpart, don't add it. Add lowpart with {cal|la}.
* rs6000/rs6000.h (TARGET_SWITCHES): Add powerpc64.
(STACK_BOUNDARY): Depend on TARGET_32BIT.
(ADJUST_FIELD_ALIGN): Calculate array alignment using innermost type.
(CONST_OK_FOR_LETTER_P): Don't assume 32-bit CONST_INT.
(EXTRA_CONSTRAINTS): Remove NT 'S' and 'T'. Replace 'S' with
64-bit mask operand.
(RS6000_SAVE_TOC): Depend on TARGET_32BIT.
(STACK_SAVEAREA_MODE): New macro.
(LEGITIMATE_CONSTANT_P): DImode okay for 64bit.
(LEGITIMIZE_RELOAD_ADDRESS): New macro.
(RTX_COSTS, AND/IOR/XOR): Reflect current machine description.
(ASM_FILE_START): Emit 64-bit ABI directive.
(ASM_DECLARE_FUNCTION_NAME): Align CSECT on doubleword in 64-bit mode.
(ASM_OUTPUT_SPECIAL_POOL_ENTRY): DImode okay for 64-bit.
(PREDICATE_CODES): Add "and64_operand" and "mask64_operand".
Delete "non_and_cint_operand". "input_operand" includes CONST_DOUBLE.
* rs6000/rs6000.md (iorsi3, xorsi3): Use HOST_WIDE_INT for mask.
Restore define_splits.
(floatsidf2, floatunssidf2): Remove !TARGET_POWERPC64 final constraint.
(floatsidf2_internal, floatunssidf2_internal2): Likewise.
Do not specify base register operand mode.
(floatsidf2_loadaddr): Do not specify base register operand mode.
(floatsidf2_store1, floatsidf2_store2): Operand 1 must be base
register; do not specify mode. Remove !TARGET_POWERPC64 final
constraint.
(floatsidf2_load): Do not specify base register operand mode. Remove
!TARGET_POWERPC64 final constraint.
(fix_truncdfsi2_internal, fix_truncdfsi2_{store,load}): Do not specify
base register operand mode.
(adddi3): Split large constants early.
(absdi3): Shift by 63, not 31.
(*mulsidi3_ppc64): New pattern.
(rotldi3): Add masking combiner patterns.
(anddi3): Add rldic{r,l} masking. Remove split of large constants
because PPC insns zero-extend.
(iordi3, xordi3): Split large constants early.
(movsi matcher): Remove S and T constraints.
(movsf const_double): create SImode constant from TARGET_DOUBLE.
(movdf_hardfloat32): Add default abort() case.
(movdf easy_fp_const): create DImode constant from TARGET_DOUBLE.
(movdi): Remove 64-bit constant generator. Try to convert
CONST_DOUBLE to CONST_INT. Handle TOC memory constants.
(movdi_32): Add default abort() case.
(movdi_64): Add numerous ways to split 64-bit constants.
Make catch-all define_split more optimal and never FAIL.
(movti_ppc64): Add default abort() case.
(allocate_stack): Remove operand modes. Use Pmode.
(restore_stack_block): Remove operand modes. Generate Pmode
temporary.
(save_stack_nonlocal, restore_stack_nonlocal): Generate Pmode
temporary. Save area is double Pmode.
(call_indirect_aix64, call_value_indirect_aix64): New patterns.
(call, call_value): Do not specify address operand mode. Choose
appropriate AIX ABI.
(*call_local64, *ret_call_local64): New patterns.
(*call_nonlocal_aix64, *ret_call_nonlocal_aix64): New patterns.
(*ret_call_nonlocal_aix32): Use call_value_indirect for REG.
(compare): Materialize DImode truthvalues.
From-SVN: r20229
1998-06-04 13:47:15 +02:00
|
|
|
|
enum machine_mode mode = STACK_SAVEAREA_MODE (save_level);
|
1992-05-06 13:35:29 +02:00
|
|
|
|
|
|
|
|
|
/* See if this machine has anything special to do for this kind of save. */
|
|
|
|
|
switch (save_level)
|
|
|
|
|
{
|
|
|
|
|
#ifdef HAVE_save_stack_block
|
|
|
|
|
case SAVE_BLOCK:
|
|
|
|
|
if (HAVE_save_stack_block)
|
tree.c (get_inner_array_type): New function.
Thu Jun 4 14:35:27 1998 David Edelsohn <edelsohn@mhpcc.edu>
* tree.c (get_inner_array_type): New function.
* tree.h (get_inner_array_type): Prototype.
* expr.h (STACK_SAVEAREA_MODE): New macro.
* expr.c (expand_builtin_setjmp): Initialize sa_mode using
STACK_SAVEAREA_MODE.
(expand_builtin_longjmp): Likewise.
* explow.c (emit_stack_save): Likewise.
(allocate_dynamic_stack_space): Use Pmode not insn_operand_mode.
* rs6000/aix41.h (ASM_CPU_SPEC): Define relative to ASM_DEFAULT_SPEC.
(CPP_CPU_SPEC): Define relative to CPU_DEFAULT_SPEC.
* rs6000/aix43.h: New file.
* rs6000/t-aix43: New file.
* rs6000/x-aix41: New file.
* rs6000/x-aix43: New file.
* configure.in (rs6000-ibm-aix*): Use them.
* rs6000/powerpc.h: Delete.
* rs6000/sysv4.h: Move necessary powerpc.h definitions to here.
* rs6000/netware.h: and here.
* rs6000/win-nt.h: and here.
* rs6000/rs6000.c (processor_target_table, 620): Do not affect
MASK_POWERPC64.
(rs6000_override_options): Ignore flag_pic for AIX.
(rs6000_immed_double_const): Delete.
(u_short_cint_operand): Don't assume 32-bit CONST_INT.
(reg_or_u_short_operand): Don't assume 32-bit CONST_INT.
(num_insns_constant): mask64_operand() is 2 insns.
(logical_operand): Don't assume 32-bit CONST_INT.
(non_logical_cint_operand): Don't assume 32-bit CONST_INT.
(easy_fp_constant): Any CONST_DOUBLE_HIGH is okay for 64-bit.
(mask_constant): HOST_WIDE_INT parameter.
(non_and_cint_operand): Delete.
(mask64_operand): New function.
(and64_operand): New function.
(function_arg_advance): DImode arguments do not need special
alignment when 64-bit.
(function_arg): Likewise.
(setup_incoming_varargs): Reverse reg_size assignment.
(print_operand): HOST_WIDE_INT second parameter.
(print_operand, 'B'): New case.
(print_operand, 'M'): Fix typo in lossage string.
(print_operandm 'S'): New case.
(rs6000_stack_info): Reverse reg_size assignment. Use total_raw_size
to compute AIX push_p. Use reg_size to compute {cr,lr}_save_offset.
(rs6000_output_load_toc_table): Reverse init_ptr assignment. Use
TARGET_64BIT not TARGET_POWERPC64. Convert fprintf to fputs.
Load GOT highpart, don't add it. Add lowpart with {cal|la}.
(rs6000_allocate_stack_space): Use {cal|la}.
(output_epilog): Use {cal|la}
(output_function_profiler): Add call glue to mcount call.
Load GOT highpart, don't add it. Add lowpart with {cal|la}.
* rs6000/rs6000.h (TARGET_SWITCHES): Add powerpc64.
(STACK_BOUNDARY): Depend on TARGET_32BIT.
(ADJUST_FIELD_ALIGN): Calculate array alignment using innermost type.
(CONST_OK_FOR_LETTER_P): Don't assume 32-bit CONST_INT.
(EXTRA_CONSTRAINTS): Remove NT 'S' and 'T'. Replace 'S' with
64-bit mask operand.
(RS6000_SAVE_TOC): Depend on TARGET_32BIT.
(STACK_SAVEAREA_MODE): New macro.
(LEGITIMATE_CONSTANT_P): DImode okay for 64bit.
(LEGITIMIZE_RELOAD_ADDRESS): New macro.
(RTX_COSTS, AND/IOR/XOR): Reflect current machine description.
(ASM_FILE_START): Emit 64-bit ABI directive.
(ASM_DECLARE_FUNCTION_NAME): Align CSECT on doubleword in 64-bit mode.
(ASM_OUTPUT_SPECIAL_POOL_ENTRY): DImode okay for 64-bit.
(PREDICATE_CODES): Add "and64_operand" and "mask64_operand".
Delete "non_and_cint_operand". "input_operand" includes CONST_DOUBLE.
* rs6000/rs6000.md (iorsi3, xorsi3): Use HOST_WIDE_INT for mask.
Restore define_splits.
(floatsidf2, floatunssidf2): Remove !TARGET_POWERPC64 final constraint.
(floatsidf2_internal, floatunssidf2_internal2): Likewise.
Do not specify base register operand mode.
(floatsidf2_loadaddr): Do not specify base register operand mode.
(floatsidf2_store1, floatsidf2_store2): Operand 1 must be base
register; do not specify mode. Remove !TARGET_POWERPC64 final
constraint.
(floatsidf2_load): Do not specify base register operand mode. Remove
!TARGET_POWERPC64 final constraint.
(fix_truncdfsi2_internal, fix_truncdfsi2_{store,load}): Do not specify
base register operand mode.
(adddi3): Split large constants early.
(absdi3): Shift by 63, not 31.
(*mulsidi3_ppc64): New pattern.
(rotldi3): Add masking combiner patterns.
(anddi3): Add rldic{r,l} masking. Remove split of large constants
because PPC insns zero-extend.
(iordi3, xordi3): Split large constants early.
(movsi matcher): Remove S and T constraints.
(movsf const_double): create SImode constant from TARGET_DOUBLE.
(movdf_hardfloat32): Add default abort() case.
(movdf easy_fp_const): create DImode constant from TARGET_DOUBLE.
(movdi): Remove 64-bit constant generator. Try to convert
CONST_DOUBLE to CONST_INT. Handle TOC memory constants.
(movdi_32): Add default abort() case.
(movdi_64): Add numerous ways to split 64-bit constants.
Make catch-all define_split more optimal and never FAIL.
(movti_ppc64): Add default abort() case.
(allocate_stack): Remove operand modes. Use Pmode.
(restore_stack_block): Remove operand modes. Generate Pmode
temporary.
(save_stack_nonlocal, restore_stack_nonlocal): Generate Pmode
temporary. Save area is double Pmode.
(call_indirect_aix64, call_value_indirect_aix64): New patterns.
(call, call_value): Do not specify address operand mode. Choose
appropriate AIX ABI.
(*call_local64, *ret_call_local64): New patterns.
(*call_nonlocal_aix64, *ret_call_nonlocal_aix64): New patterns.
(*ret_call_nonlocal_aix32): Use call_value_indirect for REG.
(compare): Materialize DImode truthvalues.
From-SVN: r20229
1998-06-04 13:47:15 +02:00
|
|
|
|
fcn = gen_save_stack_block;
|
1992-05-06 13:35:29 +02:00
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_save_stack_function
|
|
|
|
|
case SAVE_FUNCTION:
|
|
|
|
|
if (HAVE_save_stack_function)
|
tree.c (get_inner_array_type): New function.
Thu Jun 4 14:35:27 1998 David Edelsohn <edelsohn@mhpcc.edu>
* tree.c (get_inner_array_type): New function.
* tree.h (get_inner_array_type): Prototype.
* expr.h (STACK_SAVEAREA_MODE): New macro.
* expr.c (expand_builtin_setjmp): Initialize sa_mode using
STACK_SAVEAREA_MODE.
(expand_builtin_longjmp): Likewise.
* explow.c (emit_stack_save): Likewise.
(allocate_dynamic_stack_space): Use Pmode not insn_operand_mode.
* rs6000/aix41.h (ASM_CPU_SPEC): Define relative to ASM_DEFAULT_SPEC.
(CPP_CPU_SPEC): Define relative to CPU_DEFAULT_SPEC.
* rs6000/aix43.h: New file.
* rs6000/t-aix43: New file.
* rs6000/x-aix41: New file.
* rs6000/x-aix43: New file.
* configure.in (rs6000-ibm-aix*): Use them.
* rs6000/powerpc.h: Delete.
* rs6000/sysv4.h: Move necessary powerpc.h definitions to here.
* rs6000/netware.h: and here.
* rs6000/win-nt.h: and here.
* rs6000/rs6000.c (processor_target_table, 620): Do not affect
MASK_POWERPC64.
(rs6000_override_options): Ignore flag_pic for AIX.
(rs6000_immed_double_const): Delete.
(u_short_cint_operand): Don't assume 32-bit CONST_INT.
(reg_or_u_short_operand): Don't assume 32-bit CONST_INT.
(num_insns_constant): mask64_operand() is 2 insns.
(logical_operand): Don't assume 32-bit CONST_INT.
(non_logical_cint_operand): Don't assume 32-bit CONST_INT.
(easy_fp_constant): Any CONST_DOUBLE_HIGH is okay for 64-bit.
(mask_constant): HOST_WIDE_INT parameter.
(non_and_cint_operand): Delete.
(mask64_operand): New function.
(and64_operand): New function.
(function_arg_advance): DImode arguments do not need special
alignment when 64-bit.
(function_arg): Likewise.
(setup_incoming_varargs): Reverse reg_size assignment.
(print_operand): HOST_WIDE_INT second parameter.
(print_operand, 'B'): New case.
(print_operand, 'M'): Fix typo in lossage string.
(print_operandm 'S'): New case.
(rs6000_stack_info): Reverse reg_size assignment. Use total_raw_size
to compute AIX push_p. Use reg_size to compute {cr,lr}_save_offset.
(rs6000_output_load_toc_table): Reverse init_ptr assignment. Use
TARGET_64BIT not TARGET_POWERPC64. Convert fprintf to fputs.
Load GOT highpart, don't add it. Add lowpart with {cal|la}.
(rs6000_allocate_stack_space): Use {cal|la}.
(output_epilog): Use {cal|la}
(output_function_profiler): Add call glue to mcount call.
Load GOT highpart, don't add it. Add lowpart with {cal|la}.
* rs6000/rs6000.h (TARGET_SWITCHES): Add powerpc64.
(STACK_BOUNDARY): Depend on TARGET_32BIT.
(ADJUST_FIELD_ALIGN): Calculate array alignment using innermost type.
(CONST_OK_FOR_LETTER_P): Don't assume 32-bit CONST_INT.
(EXTRA_CONSTRAINTS): Remove NT 'S' and 'T'. Replace 'S' with
64-bit mask operand.
(RS6000_SAVE_TOC): Depend on TARGET_32BIT.
(STACK_SAVEAREA_MODE): New macro.
(LEGITIMATE_CONSTANT_P): DImode okay for 64bit.
(LEGITIMIZE_RELOAD_ADDRESS): New macro.
(RTX_COSTS, AND/IOR/XOR): Reflect current machine description.
(ASM_FILE_START): Emit 64-bit ABI directive.
(ASM_DECLARE_FUNCTION_NAME): Align CSECT on doubleword in 64-bit mode.
(ASM_OUTPUT_SPECIAL_POOL_ENTRY): DImode okay for 64-bit.
(PREDICATE_CODES): Add "and64_operand" and "mask64_operand".
Delete "non_and_cint_operand". "input_operand" includes CONST_DOUBLE.
* rs6000/rs6000.md (iorsi3, xorsi3): Use HOST_WIDE_INT for mask.
Restore define_splits.
(floatsidf2, floatunssidf2): Remove !TARGET_POWERPC64 final constraint.
(floatsidf2_internal, floatunssidf2_internal2): Likewise.
Do not specify base register operand mode.
(floatsidf2_loadaddr): Do not specify base register operand mode.
(floatsidf2_store1, floatsidf2_store2): Operand 1 must be base
register; do not specify mode. Remove !TARGET_POWERPC64 final
constraint.
(floatsidf2_load): Do not specify base register operand mode. Remove
!TARGET_POWERPC64 final constraint.
(fix_truncdfsi2_internal, fix_truncdfsi2_{store,load}): Do not specify
base register operand mode.
(adddi3): Split large constants early.
(absdi3): Shift by 63, not 31.
(*mulsidi3_ppc64): New pattern.
(rotldi3): Add masking combiner patterns.
(anddi3): Add rldic{r,l} masking. Remove split of large constants
because PPC insns zero-extend.
(iordi3, xordi3): Split large constants early.
(movsi matcher): Remove S and T constraints.
(movsf const_double): create SImode constant from TARGET_DOUBLE.
(movdf_hardfloat32): Add default abort() case.
(movdf easy_fp_const): create DImode constant from TARGET_DOUBLE.
(movdi): Remove 64-bit constant generator. Try to convert
CONST_DOUBLE to CONST_INT. Handle TOC memory constants.
(movdi_32): Add default abort() case.
(movdi_64): Add numerous ways to split 64-bit constants.
Make catch-all define_split more optimal and never FAIL.
(movti_ppc64): Add default abort() case.
(allocate_stack): Remove operand modes. Use Pmode.
(restore_stack_block): Remove operand modes. Generate Pmode
temporary.
(save_stack_nonlocal, restore_stack_nonlocal): Generate Pmode
temporary. Save area is double Pmode.
(call_indirect_aix64, call_value_indirect_aix64): New patterns.
(call, call_value): Do not specify address operand mode. Choose
appropriate AIX ABI.
(*call_local64, *ret_call_local64): New patterns.
(*call_nonlocal_aix64, *ret_call_nonlocal_aix64): New patterns.
(*ret_call_nonlocal_aix32): Use call_value_indirect for REG.
(compare): Materialize DImode truthvalues.
From-SVN: r20229
1998-06-04 13:47:15 +02:00
|
|
|
|
fcn = gen_save_stack_function;
|
1992-05-06 13:35:29 +02:00
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_save_stack_nonlocal
|
|
|
|
|
case SAVE_NONLOCAL:
|
|
|
|
|
if (HAVE_save_stack_nonlocal)
|
tree.c (get_inner_array_type): New function.
Thu Jun 4 14:35:27 1998 David Edelsohn <edelsohn@mhpcc.edu>
* tree.c (get_inner_array_type): New function.
* tree.h (get_inner_array_type): Prototype.
* expr.h (STACK_SAVEAREA_MODE): New macro.
* expr.c (expand_builtin_setjmp): Initialize sa_mode using
STACK_SAVEAREA_MODE.
(expand_builtin_longjmp): Likewise.
* explow.c (emit_stack_save): Likewise.
(allocate_dynamic_stack_space): Use Pmode not insn_operand_mode.
* rs6000/aix41.h (ASM_CPU_SPEC): Define relative to ASM_DEFAULT_SPEC.
(CPP_CPU_SPEC): Define relative to CPU_DEFAULT_SPEC.
* rs6000/aix43.h: New file.
* rs6000/t-aix43: New file.
* rs6000/x-aix41: New file.
* rs6000/x-aix43: New file.
* configure.in (rs6000-ibm-aix*): Use them.
* rs6000/powerpc.h: Delete.
* rs6000/sysv4.h: Move necessary powerpc.h definitions to here.
* rs6000/netware.h: and here.
* rs6000/win-nt.h: and here.
* rs6000/rs6000.c (processor_target_table, 620): Do not affect
MASK_POWERPC64.
(rs6000_override_options): Ignore flag_pic for AIX.
(rs6000_immed_double_const): Delete.
(u_short_cint_operand): Don't assume 32-bit CONST_INT.
(reg_or_u_short_operand): Don't assume 32-bit CONST_INT.
(num_insns_constant): mask64_operand() is 2 insns.
(logical_operand): Don't assume 32-bit CONST_INT.
(non_logical_cint_operand): Don't assume 32-bit CONST_INT.
(easy_fp_constant): Any CONST_DOUBLE_HIGH is okay for 64-bit.
(mask_constant): HOST_WIDE_INT parameter.
(non_and_cint_operand): Delete.
(mask64_operand): New function.
(and64_operand): New function.
(function_arg_advance): DImode arguments do not need special
alignment when 64-bit.
(function_arg): Likewise.
(setup_incoming_varargs): Reverse reg_size assignment.
(print_operand): HOST_WIDE_INT second parameter.
(print_operand, 'B'): New case.
(print_operand, 'M'): Fix typo in lossage string.
(print_operandm 'S'): New case.
(rs6000_stack_info): Reverse reg_size assignment. Use total_raw_size
to compute AIX push_p. Use reg_size to compute {cr,lr}_save_offset.
(rs6000_output_load_toc_table): Reverse init_ptr assignment. Use
TARGET_64BIT not TARGET_POWERPC64. Convert fprintf to fputs.
Load GOT highpart, don't add it. Add lowpart with {cal|la}.
(rs6000_allocate_stack_space): Use {cal|la}.
(output_epilog): Use {cal|la}
(output_function_profiler): Add call glue to mcount call.
Load GOT highpart, don't add it. Add lowpart with {cal|la}.
* rs6000/rs6000.h (TARGET_SWITCHES): Add powerpc64.
(STACK_BOUNDARY): Depend on TARGET_32BIT.
(ADJUST_FIELD_ALIGN): Calculate array alignment using innermost type.
(CONST_OK_FOR_LETTER_P): Don't assume 32-bit CONST_INT.
(EXTRA_CONSTRAINTS): Remove NT 'S' and 'T'. Replace 'S' with
64-bit mask operand.
(RS6000_SAVE_TOC): Depend on TARGET_32BIT.
(STACK_SAVEAREA_MODE): New macro.
(LEGITIMATE_CONSTANT_P): DImode okay for 64bit.
(LEGITIMIZE_RELOAD_ADDRESS): New macro.
(RTX_COSTS, AND/IOR/XOR): Reflect current machine description.
(ASM_FILE_START): Emit 64-bit ABI directive.
(ASM_DECLARE_FUNCTION_NAME): Align CSECT on doubleword in 64-bit mode.
(ASM_OUTPUT_SPECIAL_POOL_ENTRY): DImode okay for 64-bit.
(PREDICATE_CODES): Add "and64_operand" and "mask64_operand".
Delete "non_and_cint_operand". "input_operand" includes CONST_DOUBLE.
* rs6000/rs6000.md (iorsi3, xorsi3): Use HOST_WIDE_INT for mask.
Restore define_splits.
(floatsidf2, floatunssidf2): Remove !TARGET_POWERPC64 final constraint.
(floatsidf2_internal, floatunssidf2_internal2): Likewise.
Do not specify base register operand mode.
(floatsidf2_loadaddr): Do not specify base register operand mode.
(floatsidf2_store1, floatsidf2_store2): Operand 1 must be base
register; do not specify mode. Remove !TARGET_POWERPC64 final
constraint.
(floatsidf2_load): Do not specify base register operand mode. Remove
!TARGET_POWERPC64 final constraint.
(fix_truncdfsi2_internal, fix_truncdfsi2_{store,load}): Do not specify
base register operand mode.
(adddi3): Split large constants early.
(absdi3): Shift by 63, not 31.
(*mulsidi3_ppc64): New pattern.
(rotldi3): Add masking combiner patterns.
(anddi3): Add rldic{r,l} masking. Remove split of large constants
because PPC insns zero-extend.
(iordi3, xordi3): Split large constants early.
(movsi matcher): Remove S and T constraints.
(movsf const_double): create SImode constant from TARGET_DOUBLE.
(movdf_hardfloat32): Add default abort() case.
(movdf easy_fp_const): create DImode constant from TARGET_DOUBLE.
(movdi): Remove 64-bit constant generator. Try to convert
CONST_DOUBLE to CONST_INT. Handle TOC memory constants.
(movdi_32): Add default abort() case.
(movdi_64): Add numerous ways to split 64-bit constants.
Make catch-all define_split more optimal and never FAIL.
(movti_ppc64): Add default abort() case.
(allocate_stack): Remove operand modes. Use Pmode.
(restore_stack_block): Remove operand modes. Generate Pmode
temporary.
(save_stack_nonlocal, restore_stack_nonlocal): Generate Pmode
temporary. Save area is double Pmode.
(call_indirect_aix64, call_value_indirect_aix64): New patterns.
(call, call_value): Do not specify address operand mode. Choose
appropriate AIX ABI.
(*call_local64, *ret_call_local64): New patterns.
(*call_nonlocal_aix64, *ret_call_nonlocal_aix64): New patterns.
(*ret_call_nonlocal_aix32): Use call_value_indirect for REG.
(compare): Materialize DImode truthvalues.
From-SVN: r20229
1998-06-04 13:47:15 +02:00
|
|
|
|
fcn = gen_save_stack_nonlocal;
|
1992-05-06 13:35:29 +02:00
|
|
|
|
break;
|
|
|
|
|
#endif
|
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;
|
1992-05-06 13:35:29 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* If there is no save area and we have to allocate one, do so. Otherwise
|
|
|
|
|
verify the save area is the proper mode. */
|
|
|
|
|
|
|
|
|
|
if (sa == 0)
|
|
|
|
|
{
|
|
|
|
|
if (mode != VOIDmode)
|
|
|
|
|
{
|
|
|
|
|
if (save_level == SAVE_NONLOCAL)
|
|
|
|
|
*psave = sa = assign_stack_local (mode, GET_MODE_SIZE (mode), 0);
|
|
|
|
|
else
|
|
|
|
|
*psave = sa = gen_reg_rtx (mode);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (mode == VOIDmode || GET_MODE (sa) != mode)
|
|
|
|
|
abort ();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (after)
|
1992-05-26 00:26:27 +02:00
|
|
|
|
{
|
|
|
|
|
rtx seq;
|
|
|
|
|
|
|
|
|
|
start_sequence ();
|
1993-04-12 21:48:02 +02:00
|
|
|
|
/* We must validize inside the sequence, to ensure that any instructions
|
|
|
|
|
created by the validize call also get moved to the right place. */
|
|
|
|
|
if (sa != 0)
|
|
|
|
|
sa = validize_mem (sa);
|
1992-05-29 22:14:01 +02:00
|
|
|
|
emit_insn (fcn (sa, stack_pointer_rtx));
|
1992-05-26 00:26:27 +02:00
|
|
|
|
seq = gen_sequence ();
|
|
|
|
|
end_sequence ();
|
|
|
|
|
emit_insn_after (seq, after);
|
|
|
|
|
}
|
1992-05-06 13:35:29 +02:00
|
|
|
|
else
|
1993-04-12 21:48:02 +02:00
|
|
|
|
{
|
|
|
|
|
if (sa != 0)
|
|
|
|
|
sa = validize_mem (sa);
|
|
|
|
|
emit_insn (fcn (sa, stack_pointer_rtx));
|
|
|
|
|
}
|
1992-05-06 13:35:29 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Restore the stack pointer for the purpose in SAVE_LEVEL. SA is the save
|
|
|
|
|
area made by emit_stack_save. If it is zero, we have nothing to do.
|
|
|
|
|
|
|
|
|
|
Put any emitted insns after insn AFTER, if nonzero, otherwise at
|
|
|
|
|
current position. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
emit_stack_restore (save_level, sa, after)
|
|
|
|
|
enum save_level save_level;
|
|
|
|
|
rtx after;
|
|
|
|
|
rtx sa;
|
|
|
|
|
{
|
|
|
|
|
/* The default is that we use a move insn. */
|
2000-01-14 18:14:43 +01:00
|
|
|
|
rtx (*fcn) PARAMS ((rtx, rtx)) = gen_move_insn;
|
1992-05-06 13:35:29 +02:00
|
|
|
|
|
|
|
|
|
/* See if this machine has anything special to do for this kind of save. */
|
|
|
|
|
switch (save_level)
|
|
|
|
|
{
|
|
|
|
|
#ifdef HAVE_restore_stack_block
|
|
|
|
|
case SAVE_BLOCK:
|
|
|
|
|
if (HAVE_restore_stack_block)
|
|
|
|
|
fcn = gen_restore_stack_block;
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_restore_stack_function
|
|
|
|
|
case SAVE_FUNCTION:
|
|
|
|
|
if (HAVE_restore_stack_function)
|
|
|
|
|
fcn = gen_restore_stack_function;
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
#ifdef HAVE_restore_stack_nonlocal
|
|
|
|
|
case SAVE_NONLOCAL:
|
|
|
|
|
if (HAVE_restore_stack_nonlocal)
|
|
|
|
|
fcn = gen_restore_stack_nonlocal;
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
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;
|
1992-05-06 13:35:29 +02:00
|
|
|
|
}
|
|
|
|
|
|
1992-05-29 22:14:01 +02:00
|
|
|
|
if (sa != 0)
|
|
|
|
|
sa = validize_mem (sa);
|
|
|
|
|
|
1992-05-06 13:35:29 +02:00
|
|
|
|
if (after)
|
1992-05-26 00:26:27 +02:00
|
|
|
|
{
|
|
|
|
|
rtx seq;
|
|
|
|
|
|
|
|
|
|
start_sequence ();
|
1992-05-29 22:14:01 +02:00
|
|
|
|
emit_insn (fcn (stack_pointer_rtx, sa));
|
1992-05-26 00:26:27 +02:00
|
|
|
|
seq = gen_sequence ();
|
|
|
|
|
end_sequence ();
|
|
|
|
|
emit_insn_after (seq, after);
|
|
|
|
|
}
|
1992-05-06 13:35:29 +02:00
|
|
|
|
else
|
1992-05-29 22:14:01 +02:00
|
|
|
|
emit_insn (fcn (stack_pointer_rtx, sa));
|
1992-05-06 13:35:29 +02:00
|
|
|
|
}
|
|
|
|
|
|
1998-01-17 23:39:10 +01:00
|
|
|
|
#ifdef SETJMP_VIA_SAVE_AREA
|
|
|
|
|
/* Optimize RTL generated by allocate_dynamic_stack_space for targets
|
|
|
|
|
where SETJMP_VIA_SAVE_AREA is true. The problem is that on these
|
|
|
|
|
platforms, the dynamic stack space used can corrupt the original
|
|
|
|
|
frame, thus causing a crash if a longjmp unwinds to it. */
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
optimize_save_area_alloca (insns)
|
|
|
|
|
rtx insns;
|
|
|
|
|
{
|
|
|
|
|
rtx insn;
|
|
|
|
|
|
|
|
|
|
for (insn = insns; insn; insn = NEXT_INSN(insn))
|
|
|
|
|
{
|
|
|
|
|
rtx note;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (insn) != INSN)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
for (note = REG_NOTES (insn); note; note = XEXP (note, 1))
|
|
|
|
|
{
|
|
|
|
|
if (REG_NOTE_KIND (note) != REG_SAVE_AREA)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if (!current_function_calls_setjmp)
|
|
|
|
|
{
|
|
|
|
|
rtx pat = PATTERN (insn);
|
|
|
|
|
|
|
|
|
|
/* If we do not see the note in a pattern matching
|
|
|
|
|
these precise characteristics, we did something
|
|
|
|
|
entirely wrong in allocate_dynamic_stack_space.
|
|
|
|
|
|
1998-05-06 23:09:07 +02:00
|
|
|
|
Note, one way this could happen is if SETJMP_VIA_SAVE_AREA
|
1998-01-17 23:39:10 +01:00
|
|
|
|
was defined on a machine where stacks grow towards higher
|
|
|
|
|
addresses.
|
|
|
|
|
|
|
|
|
|
Right now only supported port with stack that grow upward
|
|
|
|
|
is the HPPA and it does not define SETJMP_VIA_SAVE_AREA. */
|
|
|
|
|
if (GET_CODE (pat) != SET
|
|
|
|
|
|| SET_DEST (pat) != stack_pointer_rtx
|
|
|
|
|
|| GET_CODE (SET_SRC (pat)) != MINUS
|
|
|
|
|
|| XEXP (SET_SRC (pat), 0) != stack_pointer_rtx)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
/* This will now be transformed into a (set REG REG)
|
|
|
|
|
so we can just blow away all the other notes. */
|
|
|
|
|
XEXP (SET_SRC (pat), 1) = XEXP (note, 0);
|
|
|
|
|
REG_NOTES (insn) = NULL_RTX;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* setjmp was called, we must remove the REG_SAVE_AREA
|
|
|
|
|
note so that later passes do not get confused by its
|
|
|
|
|
presence. */
|
|
|
|
|
if (note == REG_NOTES (insn))
|
|
|
|
|
{
|
|
|
|
|
REG_NOTES (insn) = XEXP (note, 1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rtx srch;
|
|
|
|
|
|
|
|
|
|
for (srch = REG_NOTES (insn); srch; srch = XEXP (srch, 1))
|
|
|
|
|
if (XEXP (srch, 1) == note)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
if (srch == NULL_RTX)
|
|
|
|
|
abort();
|
|
|
|
|
|
|
|
|
|
XEXP (srch, 1) = XEXP (note, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
/* Once we've seen the note of interest, we need not look at
|
|
|
|
|
the rest of them. */
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif /* SETJMP_VIA_SAVE_AREA */
|
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
/* Return an rtx representing the address of an area of memory dynamically
|
|
|
|
|
pushed on the stack. This region of memory is always aligned to
|
|
|
|
|
a multiple of BIGGEST_ALIGNMENT.
|
|
|
|
|
|
|
|
|
|
Any required stack pointer alignment is preserved.
|
|
|
|
|
|
|
|
|
|
SIZE is an rtx representing the size of the area.
|
1992-04-03 12:33:45 +02:00
|
|
|
|
TARGET is a place in which the address can be placed.
|
|
|
|
|
|
|
|
|
|
KNOWN_ALIGN is the alignment (in bits) that we know SIZE has. */
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
|
|
|
|
rtx
|
1992-04-03 12:33:45 +02:00
|
|
|
|
allocate_dynamic_stack_space (size, target, known_align)
|
1992-03-11 23:26:55 +01:00
|
|
|
|
rtx size;
|
|
|
|
|
rtx target;
|
1992-04-03 12:33:45 +02:00
|
|
|
|
int known_align;
|
1992-03-11 23:26:55 +01:00
|
|
|
|
{
|
1998-01-17 23:39:10 +01:00
|
|
|
|
#ifdef SETJMP_VIA_SAVE_AREA
|
|
|
|
|
rtx setjmpless_size = NULL_RTX;
|
|
|
|
|
#endif
|
|
|
|
|
|
1994-05-06 19:44:29 +02:00
|
|
|
|
/* If we're asking for zero bytes, it doesn't matter what we point
|
1995-05-16 14:39:54 +02:00
|
|
|
|
to since we can't dereference it. But return a reasonable
|
1994-05-06 19:44:29 +02:00
|
|
|
|
address anyway. */
|
|
|
|
|
if (size == const0_rtx)
|
|
|
|
|
return virtual_stack_dynamic_rtx;
|
|
|
|
|
|
|
|
|
|
/* Otherwise, show we're calling alloca or equivalent. */
|
|
|
|
|
current_function_calls_alloca = 1;
|
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
/* Ensure the size is in the proper mode. */
|
|
|
|
|
if (GET_MODE (size) != VOIDmode && GET_MODE (size) != Pmode)
|
|
|
|
|
size = convert_to_mode (Pmode, size, 1);
|
|
|
|
|
|
2000-02-07 18:39:40 +01:00
|
|
|
|
/* We can't attempt to minimize alignment necessary, because we don't
|
|
|
|
|
know the final value of preferred_stack_boundary yet while executing
|
|
|
|
|
this code. */
|
|
|
|
|
#ifdef PREFERRED_STACK_BOUNDARY
|
|
|
|
|
cfun->preferred_stack_boundary = PREFERRED_STACK_BOUNDARY;
|
|
|
|
|
#endif
|
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
/* We will need to ensure that the address we return is aligned to
|
|
|
|
|
BIGGEST_ALIGNMENT. If STACK_DYNAMIC_OFFSET is defined, we don't
|
|
|
|
|
always know its final value at this point in the compilation (it
|
|
|
|
|
might depend on the size of the outgoing parameter lists, for
|
|
|
|
|
example), so we must align the value to be returned in that case.
|
|
|
|
|
(Note that STACK_DYNAMIC_OFFSET will have a default non-zero value if
|
|
|
|
|
STACK_POINTER_OFFSET or ACCUMULATE_OUTGOING_ARGS are defined).
|
|
|
|
|
We must also do an alignment operation on the returned value if
|
|
|
|
|
the stack pointer alignment is less strict that BIGGEST_ALIGNMENT.
|
|
|
|
|
|
|
|
|
|
If we have to align, we must leave space in SIZE for the hole
|
|
|
|
|
that might result from the alignment operation. */
|
|
|
|
|
|
1998-11-19 23:47:55 +01:00
|
|
|
|
#if defined (STACK_DYNAMIC_OFFSET) || defined (STACK_POINTER_OFFSET) || ! defined (PREFERRED_STACK_BOUNDARY)
|
1995-03-31 01:14:37 +02:00
|
|
|
|
#define MUST_ALIGN 1
|
|
|
|
|
#else
|
1998-11-19 23:47:55 +01:00
|
|
|
|
#define MUST_ALIGN (PREFERRED_STACK_BOUNDARY < BIGGEST_ALIGNMENT)
|
1992-03-11 23:26:55 +01:00
|
|
|
|
#endif
|
|
|
|
|
|
1995-03-31 01:14:37 +02:00
|
|
|
|
if (MUST_ALIGN)
|
1992-05-25 12:28:09 +02:00
|
|
|
|
{
|
|
|
|
|
if (GET_CODE (size) == CONST_INT)
|
1992-07-06 22:04:10 +02:00
|
|
|
|
size = GEN_INT (INTVAL (size)
|
|
|
|
|
+ (BIGGEST_ALIGNMENT / BITS_PER_UNIT - 1));
|
1992-05-25 12:28:09 +02:00
|
|
|
|
else
|
|
|
|
|
size = expand_binop (Pmode, add_optab, size,
|
1992-07-06 22:04:10 +02:00
|
|
|
|
GEN_INT (BIGGEST_ALIGNMENT / BITS_PER_UNIT - 1),
|
|
|
|
|
NULL_RTX, 1, OPTAB_LIB_WIDEN);
|
1992-05-25 12:28:09 +02:00
|
|
|
|
}
|
1992-10-01 08:55:51 +01:00
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
#ifdef SETJMP_VIA_SAVE_AREA
|
|
|
|
|
/* If setjmp restores regs from a save area in the stack frame,
|
|
|
|
|
avoid clobbering the reg save area. Note that the offset of
|
|
|
|
|
virtual_incoming_args_rtx includes the preallocated stack args space.
|
|
|
|
|
It would be no problem to clobber that, but it's on the wrong side
|
|
|
|
|
of the old save area. */
|
|
|
|
|
{
|
|
|
|
|
rtx dynamic_offset
|
|
|
|
|
= expand_binop (Pmode, sub_optab, virtual_stack_dynamic_rtx,
|
1992-07-06 22:04:10 +02:00
|
|
|
|
stack_pointer_rtx, NULL_RTX, 1, OPTAB_LIB_WIDEN);
|
1998-01-17 23:39:10 +01:00
|
|
|
|
|
|
|
|
|
if (!current_function_calls_setjmp)
|
|
|
|
|
{
|
1998-11-19 23:47:55 +01:00
|
|
|
|
int align = PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT;
|
1998-01-17 23:39:10 +01:00
|
|
|
|
|
|
|
|
|
/* See optimize_save_area_alloca to understand what is being
|
|
|
|
|
set up here. */
|
|
|
|
|
|
1998-11-19 23:47:55 +01:00
|
|
|
|
#if !defined(PREFERRED_STACK_BOUNDARY) || !defined(MUST_ALIGN) || (PREFERRED_STACK_BOUNDARY != BIGGEST_ALIGNMENT)
|
1998-01-17 23:39:10 +01:00
|
|
|
|
/* If anyone creates a target with these characteristics, let them
|
|
|
|
|
know that our optimization cannot work correctly in such a case. */
|
|
|
|
|
abort();
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (size) == CONST_INT)
|
|
|
|
|
{
|
|
|
|
|
int new = INTVAL (size) / align * align;
|
|
|
|
|
|
|
|
|
|
if (INTVAL (size) != new)
|
|
|
|
|
setjmpless_size = GEN_INT (new);
|
|
|
|
|
else
|
|
|
|
|
setjmpless_size = size;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
/* Since we know overflow is not possible, we avoid using
|
|
|
|
|
CEIL_DIV_EXPR and use TRUNC_DIV_EXPR instead. */
|
|
|
|
|
setjmpless_size = expand_divmod (0, TRUNC_DIV_EXPR, Pmode, size,
|
|
|
|
|
GEN_INT (align), NULL_RTX, 1);
|
|
|
|
|
setjmpless_size = expand_mult (Pmode, setjmpless_size,
|
|
|
|
|
GEN_INT (align), NULL_RTX, 1);
|
|
|
|
|
}
|
|
|
|
|
/* Our optimization works based upon being able to perform a simple
|
|
|
|
|
transformation of this RTL into a (set REG REG) so make sure things
|
|
|
|
|
did in fact end up in a REG. */
|
1999-01-21 03:21:28 +01:00
|
|
|
|
if (!register_operand (setjmpless_size, Pmode))
|
1998-01-17 23:39:10 +01:00
|
|
|
|
setjmpless_size = force_reg (Pmode, setjmpless_size);
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
size = expand_binop (Pmode, add_optab, size, dynamic_offset,
|
1992-07-06 22:04:10 +02:00
|
|
|
|
NULL_RTX, 1, OPTAB_LIB_WIDEN);
|
1992-03-11 23:26:55 +01:00
|
|
|
|
}
|
|
|
|
|
#endif /* SETJMP_VIA_SAVE_AREA */
|
|
|
|
|
|
|
|
|
|
/* Round the size to a multiple of the required stack alignment.
|
|
|
|
|
Since the stack if presumed to be rounded before this allocation,
|
|
|
|
|
this will maintain the required alignment.
|
|
|
|
|
|
|
|
|
|
If the stack grows downward, we could save an insn by subtracting
|
|
|
|
|
SIZE from the stack pointer and then aligning the stack pointer.
|
|
|
|
|
The problem with this is that the stack pointer may be unaligned
|
|
|
|
|
between the execution of the subtraction and alignment insns and
|
|
|
|
|
some machines do not allow this. Even on those that do, some
|
|
|
|
|
signal handlers malfunction if a signal should occur between those
|
|
|
|
|
insns. Since this is an extremely rare event, we have no reliable
|
|
|
|
|
way of knowing which systems have this problem. So we avoid even
|
|
|
|
|
momentarily mis-aligning the stack. */
|
|
|
|
|
|
1998-11-19 23:47:55 +01:00
|
|
|
|
#ifdef PREFERRED_STACK_BOUNDARY
|
1992-10-05 07:27:12 +01:00
|
|
|
|
/* If we added a variable amount to SIZE,
|
|
|
|
|
we can no longer assume it is aligned. */
|
1995-03-31 01:14:37 +02:00
|
|
|
|
#if !defined (SETJMP_VIA_SAVE_AREA)
|
1998-11-19 23:47:55 +01:00
|
|
|
|
if (MUST_ALIGN || known_align % PREFERRED_STACK_BOUNDARY != 0)
|
1992-07-17 06:25:27 +02:00
|
|
|
|
#endif
|
1992-04-03 12:33:45 +02:00
|
|
|
|
size = round_push (size);
|
1992-04-03 23:42:58 +02:00
|
|
|
|
#endif
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
|
|
|
|
do_pending_stack_adjust ();
|
|
|
|
|
|
2000-04-01 02:09:22 +02:00
|
|
|
|
/* We ought to be called always on the toplevel and stack ought to be aligned
|
|
|
|
|
propertly. */
|
|
|
|
|
#ifdef PREFERRED_STACK_BOUNDARY
|
|
|
|
|
if (stack_pointer_delta % (PREFERRED_STACK_BOUNDARY / BITS_PER_UNIT))
|
|
|
|
|
abort ();
|
|
|
|
|
#endif
|
|
|
|
|
|
1997-07-17 17:25:37 +02:00
|
|
|
|
/* If needed, check that we have the required amount of stack. Take into
|
|
|
|
|
account what has already been checked. */
|
|
|
|
|
if (flag_stack_check && ! STACK_CHECK_BUILTIN)
|
|
|
|
|
probe_stack_range (STACK_CHECK_MAX_FRAME_SIZE + STACK_CHECK_PROTECT, size);
|
|
|
|
|
|
1992-04-03 12:33:45 +02:00
|
|
|
|
/* Don't use a TARGET that isn't a pseudo. */
|
|
|
|
|
if (target == 0 || GET_CODE (target) != REG
|
|
|
|
|
|| REGNO (target) < FIRST_PSEUDO_REGISTER)
|
1992-03-11 23:26:55 +01:00
|
|
|
|
target = gen_reg_rtx (Pmode);
|
|
|
|
|
|
2000-03-30 15:46:05 +02:00
|
|
|
|
mark_reg_pointer (target, known_align);
|
1992-05-22 00:05:37 +02:00
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
/* Perform the required allocation from the stack. Some systems do
|
|
|
|
|
this differently than simply incrementing/decrementing from the
|
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
|
|
|
|
stack pointer, such as acquiring the space by calling malloc(). */
|
1992-03-11 23:26:55 +01:00
|
|
|
|
#ifdef HAVE_allocate_stack
|
|
|
|
|
if (HAVE_allocate_stack)
|
|
|
|
|
{
|
1998-07-02 13:53:24 +02:00
|
|
|
|
enum machine_mode mode = STACK_SIZE_MODE;
|
1999-09-12 14:46:08 +02:00
|
|
|
|
insn_operand_predicate_fn pred;
|
1998-07-02 13:53:24 +02:00
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
pred = insn_data[(int) CODE_FOR_allocate_stack].operand[0].predicate;
|
|
|
|
|
if (pred && ! ((*pred) (target, Pmode)))
|
1999-04-14 21:43:02 +02:00
|
|
|
|
#ifdef POINTERS_EXTEND_UNSIGNED
|
|
|
|
|
target = convert_memory_address (Pmode, target);
|
|
|
|
|
#else
|
|
|
|
|
target = copy_to_mode_reg (Pmode, target);
|
|
|
|
|
#endif
|
1999-09-07 07:49:18 +02:00
|
|
|
|
|
|
|
|
|
if (mode == VOIDmode)
|
|
|
|
|
mode = Pmode;
|
|
|
|
|
|
1998-07-02 13:53:24 +02:00
|
|
|
|
size = convert_modes (mode, ptr_mode, size, 1);
|
1999-09-12 14:46:08 +02:00
|
|
|
|
pred = insn_data[(int) CODE_FOR_allocate_stack].operand[1].predicate;
|
|
|
|
|
if (pred && ! ((*pred) (size, mode)))
|
1998-07-02 13:53:24 +02:00
|
|
|
|
size = copy_to_mode_reg (mode, size);
|
1992-03-11 23:26:55 +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
|
|
|
|
emit_insn (gen_allocate_stack (target, size));
|
1992-03-11 23:26:55 +01:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
#endif
|
1995-04-04 00:12:15 +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
|
|
|
|
#ifndef STACK_GROWS_DOWNWARD
|
|
|
|
|
emit_move_insn (target, virtual_stack_dynamic_rtx);
|
|
|
|
|
#endif
|
1995-04-04 00:12:15 +02:00
|
|
|
|
size = convert_modes (Pmode, ptr_mode, size, 1);
|
1999-12-04 04:00:04 +01:00
|
|
|
|
|
|
|
|
|
/* Check stack bounds if necessary. */
|
|
|
|
|
if (current_function_limit_stack)
|
|
|
|
|
{
|
|
|
|
|
rtx available;
|
|
|
|
|
rtx space_available = gen_label_rtx ();
|
|
|
|
|
#ifdef STACK_GROWS_DOWNWARD
|
|
|
|
|
available = expand_binop (Pmode, sub_optab,
|
|
|
|
|
stack_pointer_rtx, stack_limit_rtx,
|
|
|
|
|
NULL_RTX, 1, OPTAB_WIDEN);
|
|
|
|
|
#else
|
|
|
|
|
available = expand_binop (Pmode, sub_optab,
|
|
|
|
|
stack_limit_rtx, stack_pointer_rtx,
|
|
|
|
|
NULL_RTX, 1, OPTAB_WIDEN);
|
|
|
|
|
#endif
|
|
|
|
|
emit_cmp_and_jump_insns (available, size, GEU, NULL_RTX, Pmode, 1,
|
|
|
|
|
0, space_available);
|
|
|
|
|
#ifdef HAVE_trap
|
|
|
|
|
if (HAVE_trap)
|
|
|
|
|
emit_insn (gen_trap ());
|
|
|
|
|
else
|
|
|
|
|
#endif
|
|
|
|
|
error ("stack limits not supported on this target");
|
|
|
|
|
emit_barrier ();
|
|
|
|
|
emit_label (space_available);
|
|
|
|
|
}
|
|
|
|
|
|
1995-04-04 00:12:15 +02:00
|
|
|
|
anti_adjust_stack (size);
|
1998-01-17 23:39:10 +01:00
|
|
|
|
#ifdef SETJMP_VIA_SAVE_AREA
|
|
|
|
|
if (setjmpless_size != NULL_RTX)
|
|
|
|
|
{
|
|
|
|
|
rtx note_target = get_last_insn ();
|
|
|
|
|
|
1998-06-24 16:49:51 +02:00
|
|
|
|
REG_NOTES (note_target)
|
|
|
|
|
= gen_rtx_EXPR_LIST (REG_SAVE_AREA, setjmpless_size,
|
|
|
|
|
REG_NOTES (note_target));
|
1998-01-17 23:39:10 +01:00
|
|
|
|
}
|
|
|
|
|
#endif /* SETJMP_VIA_SAVE_AREA */
|
1992-03-11 23:26:55 +01:00
|
|
|
|
#ifdef STACK_GROWS_DOWNWARD
|
|
|
|
|
emit_move_insn (target, virtual_stack_dynamic_rtx);
|
|
|
|
|
#endif
|
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
|
|
|
|
}
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
1995-03-31 01:14:37 +02:00
|
|
|
|
if (MUST_ALIGN)
|
1992-04-03 12:33:45 +02:00
|
|
|
|
{
|
1994-07-12 15:07:53 +02:00
|
|
|
|
/* CEIL_DIV_EXPR needs to worry about the addition overflowing,
|
1996-07-04 00:07:53 +02:00
|
|
|
|
but we know it can't. So add ourselves and then do
|
|
|
|
|
TRUNC_DIV_EXPR. */
|
1994-07-12 19:10:25 +02:00
|
|
|
|
target = expand_binop (Pmode, add_optab, target,
|
1994-07-12 15:07:53 +02:00
|
|
|
|
GEN_INT (BIGGEST_ALIGNMENT / BITS_PER_UNIT - 1),
|
|
|
|
|
NULL_RTX, 1, OPTAB_LIB_WIDEN);
|
|
|
|
|
target = expand_divmod (0, TRUNC_DIV_EXPR, Pmode, target,
|
1992-07-06 22:04:10 +02:00
|
|
|
|
GEN_INT (BIGGEST_ALIGNMENT / BITS_PER_UNIT),
|
|
|
|
|
NULL_RTX, 1);
|
1992-04-03 12:33:45 +02:00
|
|
|
|
target = expand_mult (Pmode, target,
|
1992-07-06 22:04:10 +02:00
|
|
|
|
GEN_INT (BIGGEST_ALIGNMENT / BITS_PER_UNIT),
|
|
|
|
|
NULL_RTX, 1);
|
1992-04-03 12:33:45 +02:00
|
|
|
|
}
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
|
|
|
|
/* Some systems require a particular insn to refer to the stack
|
|
|
|
|
to make the pages exist. */
|
|
|
|
|
#ifdef HAVE_probe
|
|
|
|
|
if (HAVE_probe)
|
|
|
|
|
emit_insn (gen_probe ());
|
|
|
|
|
#endif
|
|
|
|
|
|
1994-05-06 19:44:29 +02:00
|
|
|
|
/* Record the new stack level for nonlocal gotos. */
|
1998-11-20 08:37:42 +01:00
|
|
|
|
if (nonlocal_goto_handler_slots != 0)
|
1994-05-06 19:44:29 +02:00
|
|
|
|
emit_stack_save (SAVE_NONLOCAL, &nonlocal_goto_stack_level, NULL_RTX);
|
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
return target;
|
|
|
|
|
}
|
|
|
|
|
|
[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
|
|
|
|
/* A front end may want to override GCC's stack checking by providing a
|
|
|
|
|
run-time routine to call to check the stack, so provide a mechanism for
|
|
|
|
|
calling that routine. */
|
|
|
|
|
|
|
|
|
|
static rtx stack_check_libfunc;
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
set_stack_check_libfunc (libfunc)
|
|
|
|
|
rtx libfunc;
|
|
|
|
|
{
|
|
|
|
|
stack_check_libfunc = libfunc;
|
|
|
|
|
}
|
|
|
|
|
|
1997-07-17 17:25:37 +02:00
|
|
|
|
/* Emit one stack probe at ADDRESS, an address within the stack. */
|
|
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
emit_stack_probe (address)
|
|
|
|
|
rtx address;
|
|
|
|
|
{
|
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
|
|
|
|
rtx memref = gen_rtx_MEM (word_mode, address);
|
1997-07-17 17:25:37 +02:00
|
|
|
|
|
|
|
|
|
MEM_VOLATILE_P (memref) = 1;
|
|
|
|
|
|
|
|
|
|
if (STACK_CHECK_PROBE_LOAD)
|
|
|
|
|
emit_move_insn (gen_reg_rtx (word_mode), memref);
|
|
|
|
|
else
|
|
|
|
|
emit_move_insn (memref, const0_rtx);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Probe a range of stack addresses from FIRST to FIRST+SIZE, inclusive.
|
|
|
|
|
FIRST is a constant and size is a Pmode RTX. These are offsets from the
|
|
|
|
|
current stack pointer. STACK_GROWS_DOWNWARD says whether to add or
|
|
|
|
|
subtract from the stack. If SIZE is constant, this is done
|
|
|
|
|
with a fixed number of probes. Otherwise, we must make a loop. */
|
|
|
|
|
|
|
|
|
|
#ifdef STACK_GROWS_DOWNWARD
|
|
|
|
|
#define STACK_GROW_OP MINUS
|
|
|
|
|
#else
|
|
|
|
|
#define STACK_GROW_OP PLUS
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
void
|
|
|
|
|
probe_stack_range (first, size)
|
|
|
|
|
HOST_WIDE_INT first;
|
|
|
|
|
rtx size;
|
|
|
|
|
{
|
[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
|
|
|
|
/* First see if the front end has set up a function for us to call to
|
|
|
|
|
check the stack. */
|
|
|
|
|
if (stack_check_libfunc != 0)
|
|
|
|
|
emit_library_call (stack_check_libfunc, 0, VOIDmode, 1,
|
|
|
|
|
memory_address (QImode,
|
|
|
|
|
gen_rtx (STACK_GROW_OP, Pmode,
|
|
|
|
|
stack_pointer_rtx,
|
|
|
|
|
plus_constant (size, first))),
|
|
|
|
|
ptr_mode);
|
|
|
|
|
|
|
|
|
|
/* Next see if we have an insn to check the stack. Use it if so. */
|
1997-07-17 17:25:37 +02:00
|
|
|
|
#ifdef HAVE_check_stack
|
[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
|
|
|
|
else if (HAVE_check_stack)
|
1997-07-17 17:25:37 +02:00
|
|
|
|
{
|
1999-09-12 14:46:08 +02:00
|
|
|
|
insn_operand_predicate_fn pred;
|
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
|
|
|
|
rtx last_addr
|
|
|
|
|
= force_operand (gen_rtx_STACK_GROW_OP (Pmode,
|
|
|
|
|
stack_pointer_rtx,
|
|
|
|
|
plus_constant (size, first)),
|
|
|
|
|
NULL_RTX);
|
1997-07-17 17:25:37 +02:00
|
|
|
|
|
1999-09-12 14:46:08 +02:00
|
|
|
|
pred = insn_data[(int) CODE_FOR_check_stack].operand[0].predicate;
|
|
|
|
|
if (pred && ! ((*pred) (last_addr, Pmode)))
|
1999-09-07 07:49:18 +02:00
|
|
|
|
last_addr = copy_to_mode_reg (Pmode, last_addr);
|
1997-07-17 17:25:37 +02:00
|
|
|
|
|
1999-09-07 07:49:18 +02:00
|
|
|
|
emit_insn (gen_check_stack (last_addr));
|
1997-07-17 17:25:37 +02:00
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/* If we have to generate explicit probes, see if we have a constant
|
1997-07-27 18:09:00 +02:00
|
|
|
|
small number of them to generate. If so, that's the easy case. */
|
[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
|
|
|
|
else if (GET_CODE (size) == CONST_INT
|
|
|
|
|
&& INTVAL (size) < 10 * STACK_CHECK_PROBE_INTERVAL)
|
1997-07-17 17:25:37 +02:00
|
|
|
|
{
|
|
|
|
|
HOST_WIDE_INT offset;
|
|
|
|
|
|
|
|
|
|
/* Start probing at FIRST + N * STACK_CHECK_PROBE_INTERVAL
|
|
|
|
|
for values of N from 1 until it exceeds LAST. If only one
|
|
|
|
|
probe is needed, this will not generate any code. Then probe
|
|
|
|
|
at LAST. */
|
|
|
|
|
for (offset = first + STACK_CHECK_PROBE_INTERVAL;
|
|
|
|
|
offset < INTVAL (size);
|
|
|
|
|
offset = offset + STACK_CHECK_PROBE_INTERVAL)
|
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
|
|
|
|
emit_stack_probe (gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
|
|
|
|
|
stack_pointer_rtx,
|
|
|
|
|
GEN_INT (offset)));
|
1997-07-17 17:25: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
|
|
|
|
emit_stack_probe (gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
|
|
|
|
|
stack_pointer_rtx,
|
|
|
|
|
plus_constant (size, first)));
|
1997-07-17 17:25:37 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* In the variable case, do the same as above, but in a loop. We emit loop
|
|
|
|
|
notes so that loop optimization can be done. */
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
rtx test_addr
|
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
|
|
|
|
= force_operand (gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
|
|
|
|
|
stack_pointer_rtx,
|
|
|
|
|
GEN_INT (first + STACK_CHECK_PROBE_INTERVAL)),
|
1997-07-17 17:25:37 +02:00
|
|
|
|
NULL_RTX);
|
|
|
|
|
rtx last_addr
|
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
|
|
|
|
= force_operand (gen_rtx_fmt_ee (STACK_GROW_OP, Pmode,
|
|
|
|
|
stack_pointer_rtx,
|
|
|
|
|
plus_constant (size, first)),
|
1997-07-17 17:25:37 +02:00
|
|
|
|
NULL_RTX);
|
|
|
|
|
rtx incr = GEN_INT (STACK_CHECK_PROBE_INTERVAL);
|
|
|
|
|
rtx loop_lab = gen_label_rtx ();
|
|
|
|
|
rtx test_lab = gen_label_rtx ();
|
|
|
|
|
rtx end_lab = gen_label_rtx ();
|
|
|
|
|
rtx temp;
|
|
|
|
|
|
|
|
|
|
if (GET_CODE (test_addr) != REG
|
|
|
|
|
|| REGNO (test_addr) < FIRST_PSEUDO_REGISTER)
|
|
|
|
|
test_addr = force_reg (Pmode, test_addr);
|
|
|
|
|
|
|
|
|
|
emit_note (NULL_PTR, NOTE_INSN_LOOP_BEG);
|
|
|
|
|
emit_jump (test_lab);
|
|
|
|
|
|
|
|
|
|
emit_label (loop_lab);
|
|
|
|
|
emit_stack_probe (test_addr);
|
|
|
|
|
|
|
|
|
|
emit_note (NULL_PTR, NOTE_INSN_LOOP_CONT);
|
|
|
|
|
|
|
|
|
|
#ifdef STACK_GROWS_DOWNWARD
|
|
|
|
|
#define CMP_OPCODE GTU
|
|
|
|
|
temp = expand_binop (Pmode, sub_optab, test_addr, incr, test_addr,
|
|
|
|
|
1, OPTAB_WIDEN);
|
|
|
|
|
#else
|
|
|
|
|
#define CMP_OPCODE LTU
|
|
|
|
|
temp = expand_binop (Pmode, add_optab, test_addr, incr, test_addr,
|
|
|
|
|
1, OPTAB_WIDEN);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
if (temp != test_addr)
|
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
emit_label (test_lab);
|
1999-02-14 21:08:39 +01:00
|
|
|
|
emit_cmp_and_jump_insns (test_addr, last_addr, CMP_OPCODE,
|
|
|
|
|
NULL_RTX, Pmode, 1, 0, loop_lab);
|
1997-07-17 17:25:37 +02:00
|
|
|
|
emit_jump (end_lab);
|
|
|
|
|
emit_note (NULL_PTR, NOTE_INSN_LOOP_END);
|
|
|
|
|
emit_label (end_lab);
|
|
|
|
|
|
|
|
|
|
emit_stack_probe (last_addr);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-11 23:26:55 +01:00
|
|
|
|
/* Return an rtx representing the register or memory location
|
|
|
|
|
in which a scalar value of data type VALTYPE
|
|
|
|
|
was returned by a function call to function FUNC.
|
|
|
|
|
FUNC is a FUNCTION_DECL node if the precise function is known,
|
1999-11-16 18:43:40 +01:00
|
|
|
|
otherwise 0.
|
|
|
|
|
OUTGOING is 1 if on a machine with register windows this function
|
|
|
|
|
should return the register in which the function will put its result
|
|
|
|
|
and 0 otherwise. */
|
1992-03-11 23:26:55 +01:00
|
|
|
|
|
|
|
|
|
rtx
|
1999-11-16 18:43:40 +01:00
|
|
|
|
hard_function_value (valtype, func, outgoing)
|
1992-03-11 23:26:55 +01:00
|
|
|
|
tree valtype;
|
1999-03-19 09:50:14 +01:00
|
|
|
|
tree func ATTRIBUTE_UNUSED;
|
1999-11-16 18:43:40 +01:00
|
|
|
|
int outgoing ATTRIBUTE_UNUSED;
|
1992-03-11 23:26:55 +01:00
|
|
|
|
{
|
1999-11-16 18:43:40 +01:00
|
|
|
|
rtx val;
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
|
1999-11-16 18:43:40 +01:00
|
|
|
|
#ifdef FUNCTION_OUTGOING_VALUE
|
|
|
|
|
if (outgoing)
|
|
|
|
|
val = FUNCTION_OUTGOING_VALUE (valtype, func);
|
|
|
|
|
else
|
|
|
|
|
#endif
|
|
|
|
|
val = FUNCTION_VALUE (valtype, func);
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
|
1994-11-29 06:45:16 +01:00
|
|
|
|
if (GET_CODE (val) == REG
|
|
|
|
|
&& GET_MODE (val) == BLKmode)
|
|
|
|
|
{
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
unsigned HOST_WIDE_INT bytes = int_size_in_bytes (valtype);
|
1994-11-29 06:45:16 +01:00
|
|
|
|
enum machine_mode tmpmode;
|
* Rework fields used to describe positions of bitfields and
modify sizes to be unsigned and use HOST_WIDE_INT.
* alias.c (reg_known_value_size): Now unsigned.
* c-typeck.c (build_unary_op, case ADDR_EXPR): Use byte_position.
(really_start_incremental_init): Use bitsize_zero_node.
(push_init_level, pop_init_level, output_init_element): Likewise.
Use bitsize_unit_node and bitsize_one_node.
(output_pending_init_elements, process_init_element): Likewise.
* combine.c (combine_max_regno, reg_sign_bit_copies): Now unsigned.
(make_extraction): Position and length HOST_WIDE_INT and unsigned
HOST_WIDE_INT, respectively.
(get_pos_from_mask): Passed in value is unsigned HOST_WIDE_INT.
(num_sign_bit_copies): Returns unsigned.
BITWIDTH now unsigned; rework arithmetic.
Remove recursive call from arg to MAX.
(combine_instructions, init_reg_last_arrays): NREGS now unsigned.
(setup_incoming_promotions, can_combine_p, try_combine, simplify_set):
REGNO now unsigned.
(set_nonzero_bit_and_sign_copies): NUM now unsigned.
(find_split_point, expand_compound_operation, make_extraction): LEN
now unsigned HOST_WIDE_INT, POS now HOST_WIDE_INT.
(make_field_assignment): Likewise.
(combine_simplify_rtx): Add cast.
(expand_compound_operation): MODEWIDTH now unsigned; rework arithmetic.
(force_to_mode): WIDTH now unsigned; add cast.
(if_then_else_cond): SIZE now unsigned.
(nonzero_bits): MODE_WIDTH, RESULT_WIDTH, and WIDTH now unsigned.
(extended_count): Now returns unsigned.
(simplify_shift_const): COUNT unsigned; arg is now INPUT_COUNT.
Add SIGNED_COUNT variable; MODE_WORDS and FIRST_COUNT now unsigned.
(simplify_comparison): MODE_WIDTH now unsigned.
(update_table_tick): REGNO and ENDREGNO now unsigned; new var R.
(mark_used_regs_combine): Likewise; rework arithmetic.
(record_value_for_reg): REGNO, ENDREGNO, and I now unsigned.
(record_dead_and_set_regs, reg_dead_at_p, distribute_notes): Likewise.
(record_promoted_value): REGNO now unsigned.
(get_last_value_validate): REGNO, ENDREGNO, and J now unsigned.
(get_last_value): REGNO now unsigned.
(use_crosses_set_p): REGNO and ENDREGNO now unsigned.
(reg_dead_regno, reg_dead_endregno): Now unsigned.
(remove_death): Arg REGNO now unsigned.
(move_deaths): REGNO, DEADREGNO, DEADEND, OUREND, and I now unsigned.
(reg_bitfield_target_p): REGNO, REGNO, ENDREGNO, and ENDTREGNO
now unsigned.
* convert.c (convert_to_integer): INPREC and OUTPREC now unsigned.
* cse.c (struct qty_table_elem): FIRST_REG and LAST_REG now unsigned.
(struct cse_reg_info): REGNO now unsigned.
(cached_regno): Now unsigned.
(REGNO_QTY_VALID_P): Add cast.
(make_new_qty, make_regs_eqv, delete_reg_eqiv): Regno args unsigned.
(remove_invalid_regs): Likewise.
(remove_invalid_subreg_refs): Likewise; arg WORD also unsigned
as are variables END and I.
(get_cse_reg_info, insert): Likewise.
(mention_regs, invalidate_for_call): REGNO, ENDREGNO, and I unsigned.
(canon_hash): Likewise.
(insert_regs, lookup_for_remove): REGNO now unsigned.
(invalidate): REGNO, ENDREGNO, TREGNO, and TENDREGNO now unsigned.
New variable RN.
* dbxout.c (dbxout_parms, dbxout_reg_parms): Don't check for REGNO < 0.
* dwarf2out.c (dwarf2ou_frame_debug_expr): Remove cast.
* emit-rtl.c (subreg_realpart_p): Add cast.
(operand_subword): Arg I is now unsigned as is var PARTWORDS.
(operand_subword_force): Arg I is now unsigned.
* except.c (eh_regs): Variable I is now unsigned.
* explow.c (hard_function_value): BYTES is unsigned HOST_WIDE_INT.
* expmed.c (store_fixed_bit_field): Position is HOST_WIDE_INT;
length is unsigned HOST_WIDE_INT; likewise for internal variables.
(store_split_bit_field, extract_fixed_bit_field): Likewise.
(extract_split_bit_field, store_bit_field, extract_bit_field):
Likewise.
* expr.c (store_constructor_fields, store_constructor, store_field):
Positions are HOST_WIDE_INT and lengths are unsigned HOST_WIDE_INT.
(expand_assignment, expand_expr, expand_expr_unaligned): Likewise.
(do_jump): Likewise.
(move_by_pieces, move_by_pieces_ninsns, clear_by_pieces):
MAX_SIZE is now unsigned.
(emit_group_load): BYTEPOS is HOST_WIDE_INT; BYTELEN is unsigned.
(emit_group_store): Likewise.
(emit_move_insn): I now unsigned.
(store_constructor): Use host_integerp, tree_low_cst, and
bitsize_unit_node.
(get_inner_reference): Return bitpos and bitsize as HOST_WIDE_INT.
Rework all calculations to use trees and new fields.
* expr.h (promoted_input_arg): Regno now unsigned.
(store_bit_field, extract_bit_field): Adjust types of pos and size.
(mark_seen_cases): Arg is HOST_WIDE_INT.
* flow.c (verify_wide_reg_1): REGNO now unsigned.
* fold-const.c (decode_field_reference): Size and pos HOST_WIDE_INT;
precisions and alignments are unsigned.
(optimize_bit_field_compare, fold_truthop): Likewise.
(int_const_binop): Adjust threshold for size_int_type_wide call.
(fold_convert): Likewise.
(size_int_type_wide): Make table larger and fix thinko that only
had half of table used.
(all_ones_mask_p, fold): Precisions are unsigned.
* function.c (put_reg_info_stack): REGNO is unsigned.
(instantiate_decl): Size is HOST_WIDE_INT.
(instantiate_virtual_regs): I is unsigned.
(assign_parms): REGNO, REGNOI, and REGNOR are unsigned.
(promoted_input_arg): REGNO is unsigned.
* function.h (struct function): x_max_parm_reg is now unsigned.
* gcse.c (max_gcse_regno): Now unsigned.
(struct null_pointer_info): min_reg and max_reg now unsigned.
(lookup_set, next_set): REGNO arg now unsigned.
(compute_hash_table): REGNO and I now unsigned.
(handle_avail_expr): regnum_for_replacing now unsigned.
(cprop_insn): REGNO now unsigned.
(delete_null_pointer_checks_1): BLOCK_REG now pointer to unsigned.
* ggc-common.c (ggc_mark_tree_children, case FIELD_DECL): New case.
* global.c (set_preference): SRC_REGNO, DEST_REGNO, and I now unsigned.
* hard-reg-set.h (reg_class_size): Now unsigned.
* integrate.c (mark_stores): LAST_REG and I now unsigned; new UREGNO.
* jump.c (mark_modified_reg): I now unsigned; add cast.
(rtx_equal_for_thread_p): Add cast.
* loop.c (max_reg_before_loop): Now unsigned.
(struct_movable): REGNO now unsigned.
(try_copy_prop): REGNO arg unsigned.
(regs_match_p): XN and YN now unsigned.
(consec_sets_invariant_p, maybe_eliminate_biv): REGNO now unsigned.
(strength_reduce): Likewise; NREGS also unsigned.
(first_increment_giv, last_increment_giv unsigned): Now unsigned.
* loop.h (struct iv_class): REGNO now unsigned.
(max_reg_before_loop, first_increment_giv, last_increment_giv):
Now unsigned.
* machmode.h (mode_size, mode_unit_size): Now unsigned.
(mode_for_size, smallest_mode_for_size): Pass size as unsigned.
* optabs.c (expand_binop): I and NWORDS now unsigned.
(expand_unop): I now unsigned.
* print-tree.c (print_node): Don't print DECL_FIELD_BITPOS, but do
print DECL_FIELD_OFFSET and DECL_FIELD_BIT_OFFSET.
* real.c (significand_size): Now returns unsigned.
* real.h (significand_size): Likewise.
* regclass.c (reg_class_size): Now unsigned.
(choose_hard_reg_mode): Both operands now unsigned.
(record_reg_classes): REGNO and NR now unsigned.
(reg_scan): NREGS now unsigned.
(reg_scan_update): old_max_regno now unsigned.
(reg_scan_mark_refs): Arg MIN_REGNO and var REGNO now unsigned.
* reload.c (find_valid_class): BEST_SIZE now unsigned.
(find_dummy_reload): REGNO, NWORDS, and I now unsigned.
(hard_reg_set_here_p): Args BEG_REGNO and END_REGNO now unsigned.
Likewise for variable R.
(refers_to_regno_for_reload_p): Args REGNO and END_REGNO now unsigned,
as are variables INNER_REGNO and INNER_ENDREGNO; add new variable R.
(find_equiv_reg): Add casts.
(regno_clobbered_p): Arg REGNO now unsigned.
* reload.h (struct reload): NREGS now unsigned.
(refers_to_regno_for_reload_p): Regno args are unsigned.
(regno_clobbered_p): Likewise.
* reload1.c (reg_max_ref_width, spill_stack_slot_width): Now unsigned.
(compute_use_by_pseudos): REGNO now unsigned.
(find_reg): I and J now unsigned, new variable K, and change loop
variables accordingly; THIS_NREGS now unsigned.
(alter_reg): INHERENT_SIZE and TOTAL_SIZE now unsigned.
(spill_hard_reg): REGNO arg now unsigned; add casts.
(forget_old_reloads_1): REGNO, NR, and I now unsigned.
(mark_reload_reg_in_use): Arg REGNO and vars NREGS and I now unsigned.
(clear_reload_reg_in_use): Arg REGNO and vars NREGS, START_REGNO,
END_REGNO, CONFLICT_START, and CONFLICT_END now unsigned.
(reload_reg_free_p, reload_reg_reaches_end_p): Arg REGNO now unsigned.
(choose_reload_regs): MAX_GROUP_SIZE now unsigned.
(emit_reload_insns): REGNO now unsigned.
(reload_cse_move2add): Add cast.
(move2add_note_store): REGNO and I now unsigned; new variable ENDREGNO
and rework loop.
* resource.c (mark_referenced_resources, mark_set_resources): New
variable R; REGNO and LAST_REGNO now unsigned.
(mark_target_live_regs): J and REGNO now unsigned.
* rtl.c (mode_size, mode_unit_size): Now unsigned.
* rtl.h (union rtunion_def): New field rtuint.
(XCUINT): New macro.
(ADDRESSOF_REGNO, REGNO, SUBREG_WORD): New XCUINT.
(operand_subword, operand_subword_force): Word number is unsigned.
(choose_hard_reg_mode): Operands are unsigned.
(refers_to-regno_p, dead_or_set_regno_p): Regno arg is unsigned.
(find_regno_note, find_regno_fusage, replace_regs): Likewise.
(regno_use_in, combine_instructions, remove_death): Likewise.
(reg_scan, reg_scan_update): Likewise.
(extended_count): Return is unsigned.
* rtlanal.c (refers_to_regno_p): Args REGNO and ENDREGNO and vars I,
INNER_REGNO, and INNER_ENDREGNO now unsigned; new variable X_REGNO.
(reg_overlap_mentioned_p): REGNO and ENDREGNO now unsigned.
(reg_set_last_first_regno, reg_set_last_last_regno): Now unsigned.
(reg_reg_last_1): FIRS and LAST now unsigned.
(dead_or_set_p): REGNO, LAST_REGNO, and I now unsigned.
(dead_or_set_regno_p): Arg TEST_REGNO and vars REGNO and ENDREGNO
now unsigned.
(find_regno_note, regno_use_in): Arg REGNO now unsigned.
(find_regno_fusage): Likewise; also var REGNOTE now unsigned.
(find_reg_fusage): Variables REGNO, END_REGNO, and I now unsigned.
(replace_regs): Arg NREGS now unsigned.
* sdbout.c (sdbout_parms, sdbout_reg_parms): Don't check REGNO < 0.
* simplify-rtx.c (simplify_unary_operation): WIDTH now unsigned.
(simplify_binary_operation): Likewise.
(cselib_invalidate_regno): Arg REGNO and variables ENDREGNO, I, and
THIS_LAST now unsigned.
(cselib_record_set): Add cast.
* ssa.c (ssa_max_reg_num): Now unsigned.
(rename_block): REGNO now unsigned.
* stmt.c (expand_return): Bit positions unsigned HOST_WIDE_INT;
sizes now unsigned.
(all_cases_count): Just return -1 not -2.
COUNT, MINVAL, and LASTVAL now HOST_WIDE_INT.
Rework tests to use trees whenever possible.
Use host_integerp and tree_low_cst.
(mark_seen_cases): COUNT arg now HOST_WIDE_INT;
Likewise variable NEXT_NODE_OFFSET; XLO now unsigned.
(check_for_full_enumeration_handing): BYTES_NEEDED, I to HOST_WIDE_INT.
* stor-layout.c (mode_for_size): SIZE arg now unsigned.
(smallest_mode_for_size): Likewise.
(layout_decl): Simplify handing of a specified DECL_SIZE_UNIT.
KNOWN_ALIGN is now an alignment, so simplify code.
Don't turn off DECL_BIT_FIELD if field is BLKmode, but not type.
(start_record_layout): Renamed from new_record_layout_info.
Update to new fields.
(debug_rli, normalize_rli, rli_size_unit_so_far, rli_size_so_far):
New functions.
(place_union_field): Renamed from layout_union_field.
Update to use new fields in rli.
(place_field): Renamed from layout_field.
Major rewrite to use new fields in rli; pass alignment to layout_decl.
(finalize_record_size): Rework to use new fields in rli and handle
union.
(compute_record_mode): Rework to simplify and to use new DECL fields.
(finalize_type_size): Make rounding more consistent.
(finish_union_layout): Deleted.
(layout_type, case VOID_TYPE): Don't set TYPE_SIZE_UNIT either.
(layout_type, case RECORD_TYPE): Call new function names.
(initialize_sizetypes): Set TYPE_IS_SIZETYPE.
(set_sizetype): Set TYPE_IS_SIZETYPE earlier.
(get_best_mode): UNIT is now unsigned; remove casts.
* tree.c (bit_position): Compute from new fields.
(byte_position, int_byte_position): New functions.
(print_type_hash_statistics): Cast to remove warning.
(build_range_type): Use host_integerp and tree_low_cst to try to hash.
(build_index_type): Likewise; make subtype of sizetype.
(build_index_2_type): Pass sizetype to build_range_type.
(build_common_tree_nodes): Use size_int and bitsize_int to
initialize nodes; add bitsize_{zero,one,unit}_node.
* tree.h (DECL_FIELD_CONTEXT): Use FIELD_DECL_CHECK.
(DECL_BIT_FIELD_TYPE, DECL_QUALIFIER, DECL_FCONTEXT): Likewise.
(DECL_PACKED, DECL_BIT_FIELD): Likewise.
(DECL_FIELD_BITPOS): Deleted.
(DECL_FIELD_OFFSET, DECL_FIELD_BIT_OFFSET): New fields.
(DECL_RESULT, DECL_SAVED_INSNS): Use FUNCTION_DECL_CHECK.
(DECL_FRAME_SIZE, DECL_FUNCTION_CODE, DECL_NO_STATIC_CHAIN): Likewise.
(DECL_INLINE, DECL_BUILT_IN_NONANSI, DECL_IS_MALLOC): Likewise.
(DECL_BUILT_IN_CLASS, DECL_STATIC_CONSTRUCTOR): Likewise.
(DECL_STATIC_DESTRUCTOR, DECL_NO_CHECK_MEMORY_USAGE): Likewise.
(DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT, DECL_NO_LIMIT_STACK) Likewise.
(DECL_ORIGINAL_TYPE, TYPE_DECL_SUPPRESS_DEBUG): Use TYPE_DECL_CHECK.
(DECL_ARG_TYPE_AS_WRITEN, DECL_ARG_TYPE): Use PARM_DECL_CHECK.
(DECL_INCOMING_RTL, DECL_TRANSPARENT_UNION): Likewise.
(DECL_ALIGN): Adjust to new field in union.
(DECL_OFFSET_ALIGN): New field.
(DECL_ERROR_ISSUED, DECL_TOO_LATE): Use LABEL_DECL_CHECK.
(DECL_IN_TEXT_SECTION): Use VAR_DECL_CHECK.
(union tree_decl): Add struct for both aligns.
(enum tree_index): Add TI_BITSIZE_{ZERO,ONE,UNIT}.
(bitsize_zero_node, bitsize_one_node, bitsize_unit_node): Added.
(struct record_layout_info): Rework fields to have offset
alignment and byte and bit position.
(start_record_layout, place_field): Renamed from old names.
(rli_size_so_far, rli_size_unit_so_far, normalize_rli): New decls.
(byte_position, int_byte_position): Likewise.
(get_inner_reference): Change types of position and length.
* unroll.c (unroll_loop): New variable R; use for some loops.
MAX_LOCAL_REGNUM and MAXREGNUM now unsigned.
(calculate_giv_inc): Arg REGNO now unsigned.
(copy_loop_body): REGNO and SRC_REGNO now unsigned.
* varasm.c (assemble_variable): Clean up handling of size using
host_integerp and tree_low_cst.
(decode_addr_const): Use byte, not bit, position.
(output_constructor): bitpos and offsets are HOST_WIDE_INT;
use tree_low_cst and int_bit_position.
* objc/objc-act.c (build_ivar_list_initializer): Use byte_position.
* ch/actions.c (check_missing_cases): BYTES_NEEDED is HOST_WIDE_INT.
* ch/typeck.c (expand_constant_to_buffer): Use int_byte_position.
(extract_constant_from_buffer): Likewise.
* cp/class.c (build_vbase_pointer_fields): layout_field now
place_field.
(get_vfield_offset): Use byte_position.
(set_rtti_entry): Set OFFSET to ssizetype zero.
(get_binfo_offset_as_int): Deleted.
(dfs_record_base_offsets): Use tree_low_cst.
(dfs_search_base_offsets): Likewise.
(layout_nonempty_base_or_field): Reflect changes in RLI format
and call byte_position.
(layout_empty_base): Convert offset to ssizetype.
(build_base_field): use rli_size_unit_so_far.
(dfs_propagate_binfo_offsets): Do computation in proper type.
(layout_virtual_bases): Pass ssizetype to propagate_binfo_offsets.
(layout_class_type): Reflect changes in RLI names and fields.
(finish_struct_1): Set DECL_FIELD_OFFSET.
* cp/dump.c (dequeue_and_dump): Call bit_position.
* cp/expr.c (cplus_expand_constant): Use byte_position.
* cp/rtti.c (expand_class_desc): Use bitsize_one_node.
* cp/typeck.c (build_component_addr): Use byte_position and don't
special case for zero offset.
* f/com.c (ffecom_tree_canonize_ptr_): Use bitsize_zero_node.
(ffecom_tree_canonize_ref_): Likewise.
* java/class.c (make_field_value): Use byte_position.
* java/expr.c (JAVA_ARRAY_LENGTH_OFFSET): Use byte_position.
(java_array_data_offset): Likewise.
* java/java-tree.h (MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC): Add case to
bzero call.
From-SVN: r32742
2000-03-25 19:34:13 +01:00
|
|
|
|
|
1994-11-29 06:45:16 +01:00
|
|
|
|
for (tmpmode = GET_CLASS_NARROWEST_MODE (MODE_INT);
|
1999-08-15 22:08:12 +02:00
|
|
|
|
tmpmode != VOIDmode;
|
1994-11-29 06:45:16 +01:00
|
|
|
|
tmpmode = GET_MODE_WIDER_MODE (tmpmode))
|
|
|
|
|
{
|
|
|
|
|
/* Have we found a large enough mode? */
|
|
|
|
|
if (GET_MODE_SIZE (tmpmode) >= bytes)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* No suitable mode found. */
|
1999-08-15 22:08:12 +02:00
|
|
|
|
if (tmpmode == VOIDmode)
|
1994-11-29 06:45:16 +01:00
|
|
|
|
abort ();
|
|
|
|
|
|
|
|
|
|
PUT_MODE (val, tmpmode);
|
|
|
|
|
}
|
|
|
|
|
return val;
|
1992-03-11 23:26:55 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Return an rtx representing the register or memory location
|
|
|
|
|
in which a scalar value of mode MODE was returned by a library call. */
|
|
|
|
|
|
|
|
|
|
rtx
|
|
|
|
|
hard_libcall_value (mode)
|
|
|
|
|
enum machine_mode mode;
|
|
|
|
|
{
|
|
|
|
|
return LIBCALL_VALUE (mode);
|
|
|
|
|
}
|
1993-03-31 07:54:18 +02:00
|
|
|
|
|
|
|
|
|
/* Look up the tree code for a given rtx code
|
|
|
|
|
to provide the arithmetic operation for REAL_ARITHMETIC.
|
|
|
|
|
The function returns an int because the caller may not know
|
|
|
|
|
what `enum tree_code' means. */
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
rtx_to_tree_code (code)
|
|
|
|
|
enum rtx_code code;
|
|
|
|
|
{
|
|
|
|
|
enum tree_code tcode;
|
|
|
|
|
|
|
|
|
|
switch (code)
|
|
|
|
|
{
|
|
|
|
|
case PLUS:
|
|
|
|
|
tcode = PLUS_EXPR;
|
|
|
|
|
break;
|
|
|
|
|
case MINUS:
|
|
|
|
|
tcode = MINUS_EXPR;
|
|
|
|
|
break;
|
|
|
|
|
case MULT:
|
|
|
|
|
tcode = MULT_EXPR;
|
|
|
|
|
break;
|
|
|
|
|
case DIV:
|
|
|
|
|
tcode = RDIV_EXPR;
|
|
|
|
|
break;
|
|
|
|
|
case SMIN:
|
|
|
|
|
tcode = MIN_EXPR;
|
|
|
|
|
break;
|
|
|
|
|
case SMAX:
|
|
|
|
|
tcode = MAX_EXPR;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
tcode = LAST_AND_UNUSED_TREE_CODE;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return ((int) tcode);
|
|
|
|
|
}
|