OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* collect2.c (find_a_file): Use HAVE_DOS_BASED_FILE_SYSTEM in place
[pf3gnuchains/gcc-fork.git]
/
gcc
/
genextract.c
diff --git
a/gcc/genextract.c
b/gcc/genextract.c
index
e8efcd2
..
dc5cbd3
100644
(file)
--- a/
gcc/genextract.c
+++ b/
gcc/genextract.c
@@
-1,5
+1,5
@@
/* Generate code from machine description to extract operands from insn as rtl.
/* Generate code from machine description to extract operands from insn as rtl.
- Copyright (C) 1987, 91
, 92, 93, 97, 1998
Free Software Foundation, Inc.
+ Copyright (C) 1987, 91
-93, 97-98, 1999
Free Software Foundation, Inc.
This file is part of GNU CC.
This file is part of GNU CC.
@@
-100,8
+100,6
@@
static void walk_rtx PROTO ((rtx, const char *));
static void print_path PROTO ((char *));
static void fatal PVPROTO ((const char *, ...))
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
static void print_path PROTO ((char *));
static void fatal PVPROTO ((const char *, ...))
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
-static char *copystr PROTO ((const char *));
-static void mybzero ();
void fancy_abort PROTO ((void)) ATTRIBUTE_NORETURN;
\f
static void
void fancy_abort PROTO ((void)) ATTRIBUTE_NORETURN;
\f
static void
@@
-116,7
+114,7
@@
gen_insn (insn)
dup_count = 0;
/* No operands seen so far in this pattern. */
dup_count = 0;
/* No operands seen so far in this pattern. */
- m
ybzero (oplocs
, sizeof oplocs);
+ m
emset (oplocs, 0
, sizeof oplocs);
/* Walk the insn's pattern, remembering at all times the path
down to the walking point. */
/* Walk the insn's pattern, remembering at all times the path
down to the walking point. */
@@
-211,19
+209,19
@@
walk_rtx (x, path)
case MATCH_OPERAND:
case MATCH_SCRATCH:
case MATCH_OPERAND:
case MATCH_SCRATCH:
- oplocs[XINT (x, 0)] =
copystr
(path);
+ oplocs[XINT (x, 0)] =
xstrdup
(path);
op_count = MAX (op_count, XINT (x, 0) + 1);
break;
case MATCH_DUP:
case MATCH_PAR_DUP:
op_count = MAX (op_count, XINT (x, 0) + 1);
break;
case MATCH_DUP:
case MATCH_PAR_DUP:
- duplocs[dup_count] =
copystr
(path);
+ duplocs[dup_count] =
xstrdup
(path);
dupnums[dup_count] = XINT (x, 0);
dup_count++;
break;
case MATCH_OP_DUP:
dupnums[dup_count] = XINT (x, 0);
dup_count++;
break;
case MATCH_OP_DUP:
- duplocs[dup_count] =
copystr
(path);
+ duplocs[dup_count] =
xstrdup
(path);
dupnums[dup_count] = XINT (x, 0);
dup_count++;
dupnums[dup_count] = XINT (x, 0);
dup_count++;
@@
-239,7
+237,7
@@
walk_rtx (x, path)
return;
case MATCH_OPERATOR:
return;
case MATCH_OPERATOR:
- oplocs[XINT (x, 0)] =
copystr
(path);
+ oplocs[XINT (x, 0)] =
xstrdup
(path);
op_count = MAX (op_count, XINT (x, 0) + 1);
newpath = (char *) alloca (depth + 2);
op_count = MAX (op_count, XINT (x, 0) + 1);
newpath = (char *) alloca (depth + 2);
@@
-254,7
+252,7
@@
walk_rtx (x, path)
return;
case MATCH_PARALLEL:
return;
case MATCH_PARALLEL:
- oplocs[XINT (x, 0)] =
copystr
(path);
+ oplocs[XINT (x, 0)] =
xstrdup
(path);
op_count = MAX (op_count, XINT (x, 0) + 1);
newpath = (char *) alloca (depth + 2);
op_count = MAX (op_count, XINT (x, 0) + 1);
newpath = (char *) alloca (depth + 2);
@@
-358,14
+356,18
@@
xmalloc (size)
}
PTR
}
PTR
-xrealloc (
ptr
, size)
- PTR
ptr
;
+xrealloc (
old
, size)
+ PTR
old
;
size_t size;
{
size_t size;
{
- register PTR result = (PTR) realloc (ptr, size);
- if (!result)
+ register PTR ptr;
+ if (old)
+ ptr = (PTR) realloc (old, size);
+ else
+ ptr = (PTR) malloc (size);
+ if (!ptr)
fatal ("virtual memory exhausted");
fatal ("virtual memory exhausted");
- return
result
;
+ return
ptr
;
}
static void
}
static void
@@
-398,28
+400,14
@@
fancy_abort ()
fatal ("Internal gcc abort.");
}
fatal ("Internal gcc abort.");
}
-static char *
-copystr (s1)
- const char *s1;
-{
- register char *tem;
-
- if (s1 == 0)
- return 0;
-
- tem = (char *) xmalloc (strlen (s1) + 1);
- strcpy (tem, s1);
-
- return tem;
-}
-
-static void
-mybzero (b, length)
- register char *b;
- register unsigned length;
+char *
+xstrdup (input)
+ const char *input;
{
{
- while (length-- > 0)
- *b++ = 0;
+ register size_t len = strlen (input) + 1;
+ register char *output = xmalloc (len);
+ memcpy (output, input, len);
+ return output;
}
\f
int
}
\f
int
@@
-473,6
+461,8
@@
from the machine description file `md'. */\n\n");
printf (" register rtx **ro_loc = recog_operand_loc;\n");
printf (" rtx pat = PATTERN (insn);\n");
printf (" int i ATTRIBUTE_UNUSED;\n\n");
printf (" register rtx **ro_loc = recog_operand_loc;\n");
printf (" rtx pat = PATTERN (insn);\n");
printf (" int i ATTRIBUTE_UNUSED;\n\n");
+ printf (" memset (ro, 0, sizeof (*ro) * MAX_RECOG_OPERANDS);\n");
+ printf (" memset (ro_loc, 0, sizeof (*ro_loc) * MAX_RECOG_OPERANDS);\n");
printf (" switch (INSN_CODE (insn))\n");
printf (" {\n");
printf (" case -1:\n");
printf (" switch (INSN_CODE (insn))\n");
printf (" {\n");
printf (" case -1:\n");