aboutsummaryrefslogtreecommitdiff
path: root/gcc/genextract.c
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-09-06 14:42:55 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1993-09-06 14:42:55 -0400
commit809ffa71e15de5579f7f36b595994b7dc82de5c8 (patch)
tree9abd8ab99f6c965ec04bd9ff1d3b1381ff454eb3 /gcc/genextract.c
parentccf5f34234559be0973687fc18c1801a467de6a2 (diff)
downloadgcc-809ffa71e15de5579f7f36b595994b7dc82de5c8.zip
gcc-809ffa71e15de5579f7f36b595994b7dc82de5c8.tar.gz
gcc-809ffa71e15de5579f7f36b595994b7dc82de5c8.tar.bz2
(insn_name_ptr): Define for debugging.
(walk_rtx, case MATCH_OP_DUP): Expand recog_dup_loc using XEXP not XVECEXP. From-SVN: r5269
Diffstat (limited to 'gcc/genextract.c')
-rw-r--r--gcc/genextract.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/gcc/genextract.c b/gcc/genextract.c
index 97ce57d..3234d4e 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, 1991, 1992 Free Software Foundation, Inc.
+ Copyright (C) 1987, 1991, 1992, 1993 Free Software Foundation, Inc.
This file is part of GNU CC.
@@ -33,6 +33,9 @@ struct obstack *rtl_obstack = &obstack;
extern void free ();
extern rtx read_rtx ();
+/* Names for patterns. Need to allow linking with print-rtl. */
+char **insn_name_ptr;
+
/* This structure contains all the information needed to describe one
set of extractions methods. Each method may be used by more than
one pattern if the operands are in the same place.
@@ -216,13 +219,28 @@ walk_rtx (x, path)
break;
case MATCH_DUP:
- case MATCH_OP_DUP:
case MATCH_PAR_DUP:
duplocs[dup_count] = copystr (path);
dupnums[dup_count] = XINT (x, 0);
dup_count++;
break;
+ case MATCH_OP_DUP:
+ duplocs[dup_count] = copystr (path);
+ dupnums[dup_count] = XINT (x, 0);
+ dup_count++;
+
+ newpath = (char *) alloca (depth + 2);
+ strcpy (newpath, path);
+ newpath[depth + 1] = 0;
+
+ for (i = XVECLEN (x, 1) - 1; i >= 0; i--)
+ {
+ newpath[depth] = '0' + i;
+ walk_rtx (XVECEXP (x, 1, i), newpath);
+ }
+ return;
+
case MATCH_OPERATOR:
oplocs[XINT (x, 0)] = copystr (path);
op_count = MAX (op_count, XINT (x, 0) + 1);