summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1992-01-17 23:03:50 +0000
committerrms <rms@138bc75d-0d04-0410-961f-82ee72b054a4>1992-01-17 23:03:50 +0000
commit8bf9bd333d35a4bdd3b47450921a6175d03d14a2 (patch)
tree55c5364cf46fdb47a98f24372966492f05023481 /gcc
parent66d433c7be147672fb1da1afd42a311d79cb0531 (diff)
downloadgcc-8bf9bd333d35a4bdd3b47450921a6175d03d14a2.tar.gz
*** empty log message ***
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@202 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/genattr.c2
-rw-r--r--gcc/genattrtab.c74
-rw-r--r--gcc/gencodes.c2
-rw-r--r--gcc/genconfig.c2
-rw-r--r--gcc/genemit.c2
-rw-r--r--gcc/genextract.c2
-rw-r--r--gcc/genflags.c2
-rw-r--r--gcc/genoutput.c2
-rw-r--r--gcc/genpeep.c2
9 files changed, 55 insertions, 35 deletions
diff --git a/gcc/genattr.c b/gcc/genattr.c
index 47ff2ccb66f..11c872659a3 100644
--- a/gcc/genattr.c
+++ b/gcc/genattr.c
@@ -1,5 +1,5 @@
/* Generate attribute information (insn-attr.h) from machine description.
- Copyright (C) 1989 Free Software Foundation, Inc.
+ Copyright (C) 1991 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@nyu.edu)
This file is part of GNU CC.
diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c
index 1fbdc5db53a..ede60498c09 100644
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -1,5 +1,5 @@
/* Generate code from machine description to compute values of attributes.
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ Copyright (C) 1992 Free Software Foundation, Inc.
Contributed by Richard Kenner (kenner@nyu.edu)
This file is part of GNU CC.
@@ -1072,12 +1072,12 @@ fill_attr (attr)
}
}
-/* Given an expression EXP, see if it is a COND that has a test that checks
- relative positions of insns (uses MATCH_DUP or PC). If so, replace it
- with what is obtained by passing the expression to ADDRESS_FN. If not
- but it is a COND, call this routine recursively on each value (including
- the default value). Otherwise, return the value returned by NO_ADDRESS_FN
- applied to EXP. */
+/* Given an expression EXP, see if it is a COND or IF_THEN_ELSE that has a
+ test that checks relative positions of insns (uses MATCH_DUP or PC).
+ If so, replace it with what is obtained by passing the expression to
+ ADDRESS_FN. If not but it is a COND or IF_THEN_ELSE, call this routine
+ recursively on each value (including the default value). Otherwise,
+ return the value returned by NO_ADDRESS_FN applied to EXP. */
static rtx
substitute_address (exp, no_address_fn, address_fn)
@@ -1088,32 +1088,52 @@ substitute_address (exp, no_address_fn, address_fn)
int i;
rtx newexp;
- if (GET_CODE (exp) != COND)
- return (*no_address_fn) (exp);
+ if (GET_CODE (exp) == COND)
+ {
+ /* See if any tests use addresses. */
+ address_used = 0;
+ for (i = 0; i < XVECLEN (exp, 0); i += 2)
+ walk_attr_value (XVECEXP (exp, 0, i));
- /* See if any tests use addresses. */
- address_used = 0;
- for (i = 0; i < XVECLEN (exp, 0); i += 2)
- walk_attr_value (XVECEXP (exp, 0, i));
+ if (address_used)
+ return (*address_fn) (exp);
- if (address_used)
- return (*address_fn) (exp);
+ /* Make a new copy of this COND, replacing each element. */
+ newexp = rtx_alloc (COND);
+ XVEC (newexp, 0) = rtvec_alloc (XVECLEN (exp, 0));
+ for (i = 0; i < XVECLEN (exp, 0); i += 2)
+ {
+ XVECEXP (newexp, 0, i) = XVECEXP (exp, 0, i);
+ XVECEXP (newexp, 0, i + 1)
+ = substitute_address (XVECEXP (exp, 0, i + 1),
+ no_address_fn, address_fn);
+ }
- /* Make a new copy of this COND, replacing each element. */
- newexp = rtx_alloc (COND);
- XVEC (newexp, 0) = rtvec_alloc (XVECLEN (exp, 0));
- for (i = 0; i < XVECLEN (exp, 0); i += 2)
- {
- XVECEXP (newexp, 0, i) = XVECEXP (exp, 0, i);
- XVECEXP (newexp, 0, i + 1) = substitute_address (XVECEXP (exp, 0, i + 1),
- no_address_fn,
- address_fn);
+ XEXP (newexp, 1) = substitute_address (XEXP (exp, 1),
+ no_address_fn, address_fn);
+
+ return newexp;
}
- XEXP (newexp, 1) = substitute_address (XEXP (exp, 1),
- no_address_fn, address_fn);
+ else if (GET_CODE (exp) == IF_THEN_ELSE)
+ {
+ address_used = 0;
+ walk_attr_value (XEXP (exp, 0));
+ if (address_used)
+ return (*address_fn) (exp);
- return newexp;
+ newexp = rtx_alloc (IF_THEN_ELSE);
+ XEXP (newexp, 0) = substitute_address (XEXP (exp, 0),
+ no_address_fn, address_fn);
+ XEXP (newexp, 1) = substitute_address (XEXP (exp, 1),
+ no_address_fn, address_fn);
+ XEXP (newexp, 2) = substitute_address (XEXP (exp, 2),
+ no_address_fn, address_fn);
+
+ return newexp;
+ }
+
+ return (*no_address_fn) (exp);
}
/* Make new attributes from the `length' attribute. The following are made,
diff --git a/gcc/gencodes.c b/gcc/gencodes.c
index 4d06b80dbdf..28ad673cbe8 100644
--- a/gcc/gencodes.c
+++ b/gcc/gencodes.c
@@ -2,7 +2,7 @@
- some macros CODE_FOR_... giving the insn_code_number value
for each of the defined standard insn names.
- Copyright (C) 1987 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1991 Free Software Foundation, Inc.
This file is part of GNU CC.
diff --git a/gcc/genconfig.c b/gcc/genconfig.c
index f49ad75a7b3..55f79fc587d 100644
--- a/gcc/genconfig.c
+++ b/gcc/genconfig.c
@@ -1,7 +1,7 @@
/* Generate from machine description:
- some #define configuration flags.
- Copyright (C) 1987 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1991 Free Software Foundation, Inc.
This file is part of GNU CC.
diff --git a/gcc/genemit.c b/gcc/genemit.c
index 2f4d85619c9..849c585e166 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -1,5 +1,5 @@
/* Generate code from machine description to emit insns as rtl.
- Copyright (C) 1987-1991 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 1992 Free Software Foundation, Inc.
This file is part of GNU CC.
diff --git a/gcc/genextract.c b/gcc/genextract.c
index 11538d99ba3..bab8bf9173a 100644
--- a/gcc/genextract.c
+++ b/gcc/genextract.c
@@ -1,5 +1,5 @@
/* Generate code from machine description to extract operands from insn as rtl.
- Copyright (C) 1987 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1991 Free Software Foundation, Inc.
This file is part of GNU CC.
diff --git a/gcc/genflags.c b/gcc/genflags.c
index 3d87b59fc41..d4a220d3302 100644
--- a/gcc/genflags.c
+++ b/gcc/genflags.c
@@ -2,7 +2,7 @@
- some flags HAVE_... saying which simple standard instructions are
available for this machine.
- Copyright (C) 1987 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1991 Free Software Foundation, Inc.
This file is part of GNU CC.
diff --git a/gcc/genoutput.c b/gcc/genoutput.c
index a3c7979d01b..24b6c9fff9b 100644
--- a/gcc/genoutput.c
+++ b/gcc/genoutput.c
@@ -1,5 +1,5 @@
/* Generate code from to output assembler insns as recognized from rtl.
- Copyright (C) 1987, 1988, 1991 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1988, 1992 Free Software Foundation, Inc.
This file is part of GNU CC.
diff --git a/gcc/genpeep.c b/gcc/genpeep.c
index 26099458abb..b60b142a982 100644
--- a/gcc/genpeep.c
+++ b/gcc/genpeep.c
@@ -1,5 +1,5 @@
/* Generate code from machine description to perform peephole optimizations.
- Copyright (C) 1987, 1989 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1989, 1992 Free Software Foundation, Inc.
This file is part of GNU CC.