This commit is contained in:
YamaArashi
2016-02-14 16:49:50 -08:00
parent 30da3665d6
commit ee6378488b
23 changed files with 90 additions and 387 deletions

View File

@@ -376,7 +376,7 @@ COMPILERS = cc1$(exeext) @all_compilers@
# List of things which should already be built whenever we try to use xgcc
# to compile anything (without linking).
GCC_PASSES=xgcc$(exeext) cc1$(exeext) cpp$(exeext) $(EXTRA_PASSES)
GCC_PASSES=xgcc$(exeext) cc1$(exeext) $(EXTRA_PASSES)
# List of things which should already be built whenever we try to use xgcc
# to link anything.
@@ -600,8 +600,6 @@ OBJS = toplev.o version.o tree.o print-tree.o stor-layout.o fold-const.o \
GEN= genemit genoutput genrecog genextract genflags gencodes genconfig \
genpeep gengenrtl gencheck
CCCP=@cpp_main@
# Files to be copied away after each stage in building.
STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
insn-output.c insn-recog.c insn-emit.c insn-extract.c insn-peep.c \
@@ -616,7 +614,7 @@ STAGESTUFF = *$(objext) insn-flags.h insn-config.h insn-codes.h \
gencheck$(build_exeext) \
xgcc$(exeext) cc1$(exeext) cpp$(exeext) $(EXTRA_PASSES) \
$(EXTRA_PROGRAMS) gcc-cross$(exeext) \
$(CCCP)$(exeext) cc1obj$(exeext) enquire$(exeext) \
cc1obj$(exeext) enquire$(exeext) \
specs underscore.c \
*.greg *.lreg *.combine *.flow *.cse *.jump *.rtl *.tree *.loop \
*.dbr *.jump2 *.sched *.cse2 *.sched2 *.stack *.gcse \
@@ -761,7 +759,7 @@ start.encap: native xgcc$(exeext) specs $(LIBGCC1) lang.start.encap
rest.encap: $(LIBGCC) lang.rest.encap
# This is what is made with the host's compiler
# whether making a cross compiler or not.
native: config.status auto-host.h cpp$(exeext) $(LANGUAGES) \
native: config.status auto-host.h $(LANGUAGES) \
$(EXTRA_PASSES) $(EXTRA_PROGRAMS)
# Define the names for selecting languages in LANGUAGES.
@@ -1736,30 +1734,6 @@ $(HOST_PREFIX_1):
#
# Remake cpp.
# Making the preprocessor
cpp$(exeext): $(CCCP)$(exeext)
-rm -f cpp$(exeext)
$(LN) $(CCCP)$(exeext) cpp$(exeext)
cccp$(exeext): cccp.o cexp.o version.o prefix.o mbchar.o @extra_cpp_objs@ $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ cccp.o cexp.o prefix.o mbchar.o \
version.o @extra_cpp_objs@ $(LIBS)
# CYGNUS LOCAL: built in build directory
cexp.o: cexp.c $(CONFIG_H) system.h
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) -c cexp.c
cexp.c: $(srcdir)/cexp.y
$(BISON) $(BISONFLAGS) $(srcdir)/cexp.y -o cexp.c
# We use $(libsubdir)/$(unlibsubdir) to match the
# -iprefix argument which gcc will pass if GCC_EXEC_PREFIX is used.
cccp.o: cccp.c $(CONFIG_H) pcp.h version.c config.status system.h \
mbchar.h prefix.h Makefile
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
-DGCC_INCLUDE_DIR=\"$(libsubdir)/include\" \
-DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
-DLOCAL_INCLUDE_DIR=\"$(includedir)\" \
-DCROSS_INCLUDE_DIR=\"$(gcc_tooldir)/sys-include\" \
-DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
-c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
LIBCPP_OBJS = cpplib.o cpphash.o cppalloc.o cpperror.o cppexp.o cppfiles.o \
cppulp.o prefix.o version.o \
mbchar.o
@@ -1771,12 +1745,6 @@ libcpp.a: $(LIBCPP_OBJS)
$(AR) $(AR_FLAGS) libcpp.a $(LIBCPP_OBJS)
if $(RANLIB_TEST) ; then $(RANLIB) libcpp.a ; else true ; fi
cppmain$(exeext): cppmain.o libcpp.a $(LIBDEPS)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o cppmain$(exeext) cppmain.o \
libcpp.a $(LIBS)
cppmain.o: cppmain.c $(CONFIG_H) cpplib.h machmode.h system.h
cpplib.o: cpplib.c $(CONFIG_H) cpplib.h machmode.h cpphash.h config.status \
system.h prefix.h Makefile
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
@@ -2215,10 +2183,6 @@ uninstall: lang.uninstall
-rm -rf $(bindir)/$(GCC_CROSS_NAME)$(exeext)
-rm -rf $(man1dir)/$(GCC_INSTALL_NAME)$(manext)
-rm -rf $(man1dir)/$(GCC_CROSS_NAME)$(manext)
-rm -rf $(man1dir)/cccp$(manext)
# CYGNUS LOCAL: We install cpp.1.
-rm -rf $(man1dir)/cpp$(manext)
-rm -f $(infodir)/cpp.info* $(infodir)/gcc.info*
#
# These targets are for the dejagnu testsuites. The file site.exp
# contains global variables that all the testsuites will use.

View File

@@ -1098,7 +1098,7 @@
(define_expand "epilogue"
[(unspec_volatile [(const_int 0)] 1)]
"! thumb_trivial_epilogue ()"
""
"
thumb_expand_epilogue ();
")

View File

@@ -33,10 +33,6 @@ Boston, MA 02111-1307, USA. */
#define HOST_BITS_PER_LONG 32
#define HOST_BITS_PER_LONGLONG 64
/* Arguments to use with `exit'. */
#define SUCCESS_EXIT_CODE 0
#define FATAL_EXIT_CODE 33
/* target machine dependencies.
tm.h is a symbolic link to the actual target specific file. */

View File

@@ -32,7 +32,7 @@ static void
memory_full ()
{
fprintf (stderr, "%s: Memory exhausted.\n", progname);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
PTR

View File

@@ -163,5 +163,5 @@ cpp_pfatal_with_name (pfile, name)
const char *name;
{
cpp_perror_with_name (pfile, name);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}

View File

@@ -44,7 +44,7 @@ fatal (s)
char *s;
{
fputs (s, stderr);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
void
@@ -77,12 +77,12 @@ main (argc, argv)
if (argi < argc && ! CPP_FATAL_ERRORS (&parse_in))
cpp_fatal (&parse_in, "Invalid option `%s'", argv[argi]);
if (CPP_FATAL_ERRORS (&parse_in))
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
parse_in.show_column = 1;
if (! cpp_start_read (&parse_in, opts->in_fname))
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
/* Now that we know the input file is valid, open the output. */
@@ -107,6 +107,6 @@ main (argc, argv)
cpp_finish (&parse_in);
if (parse_in.errors)
exit (FATAL_EXIT_CODE);
exit (SUCCESS_EXIT_CODE);
exit (EXIT_FAILURE);
exit (EXIT_SUCCESS);
}

View File

@@ -212,5 +212,5 @@ fatal (s)
char *s;
{
fprintf (stderr, "%s: %s\n", "gen-protos", s);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}

View File

@@ -242,7 +242,7 @@ fatal VPROTO ((const char *format, ...))
vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
/* More 'friendly' abort that prints the line and file.
@@ -286,7 +286,7 @@ main (argc, argv)
if (infile == 0)
{
perror (argv[1]);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
init_rtl ();
@@ -440,7 +440,7 @@ from the machine description file `md'. */\n\n");
printf("#define ATTR_FLAG_very_unlikely\t0x20\n");
fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
exit (ferror (stdout) != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
/* NOTREACHED */
return 0;
}

View File

@@ -5835,7 +5835,7 @@ fatal VPROTO ((const char *format, ...))
vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
/* More 'friendly' abort that prints the line and file.
@@ -5909,7 +5909,7 @@ main (argc, argv)
if (infile == 0)
{
perror (argv[1]);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
init_rtl ();
@@ -6059,7 +6059,7 @@ from the machine description file `md'. */\n\n");
write_length_unit_log ();
fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
exit (ferror (stdout) != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
/* NOTREACHED */
return 0;
}

View File

@@ -18,67 +18,27 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "hconfig.h"
#include "system.h"
#include <stdio.h>
#define DEFTREECODE(SYM, NAME, TYPE, LEN) STRINGIFY(SYM),
#define DEFTREECODE(SYM, NAME, TYPE, LEN) #SYM,
const char *tree_codes[] = {
const char *tree_codes[] =
{
#include "tree.def"
#include "gencheck.h"
(char*)0
};
void usage ()
int main()
{
fprintf (stderr,"Usage: gencheck\n");
}
printf ("/* This file is generated using gencheck. Do not edit. */\n");
int main (argc, argv)
int argc;
char *argv[] ATTRIBUTE_UNUSED;
{
int i;
switch (argc)
for (int i = 0; tree_codes[i]; i++)
{
case 1:
break;
default:
usage ();
exit (1);
printf("#define %s_CHECK(t)\tTREE_CHECK (t, %s)\n",
tree_codes[i], tree_codes[i]);
printf("#define %s_CHECK1(t)\tTREE_CHECK1 (t, %s)\n",
tree_codes[i], tree_codes[i]);
}
printf ("/* This file is generated using gencheck. Do not edit. */\n");
for (i = 0; tree_codes[i]; i++)
{
printf ("#define %s_CHECK(t)\tTREE_CHECK (t, %s)\n",
tree_codes[i], tree_codes[i]);
printf ("#define %s_CHECK1(t)\tTREE_CHECK1 (t, %s)\n",
tree_codes[i], tree_codes[i]);
}
return 0;
return 0;
}
#if defined(USE_C_ALLOCA)
/* FIXME: We only need an xmalloc definition because we are forced to
link with alloca.o on some platforms. This should go away if/when
we link against libiberty.a. (ghazi@caip.rutgers.edu 6/3/98) */
PTR
xmalloc (nbytes)
size_t nbytes;
{
register PTR tmp = (PTR) malloc (nbytes);
if (!tmp)
{
fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n",
nbytes);
exit (FATAL_EXIT_CODE);
}
return tmp;
}
#endif /* USE_C_ALLOCA */

View File

@@ -100,7 +100,7 @@ fatal VPROTO ((const char *format, ...))
vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
/* More 'friendly' abort that prints the line and file.
@@ -130,7 +130,7 @@ main (argc, argv)
if (infile == 0)
{
perror (argv[1]);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
init_rtl ();
@@ -172,7 +172,7 @@ from the machine description file `md'. */\n\n");
printf ("#endif /* MAX_INSN_CODE */\n");
fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
exit (ferror (stdout) != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
/* NOTREACHED */
return 0;
}

View File

@@ -313,7 +313,7 @@ fatal VPROTO ((const char *format, ...))
vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
/* More 'friendly' abort that prints the line and file.
@@ -343,7 +343,7 @@ main (argc, argv)
if (infile == 0)
{
perror (argv[1]);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
init_rtl ();
@@ -402,7 +402,7 @@ from the machine description file `md'. */\n\n");
printf ("#define HAVE_lo_sum\n");
fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
exit (ferror (stdout) != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
/* NOTREACHED */
return 0;
}

View File

@@ -723,7 +723,7 @@ fatal VPROTO ((const char *format, ...))
vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
/* More 'friendly' abort that prints the line and file.
@@ -753,7 +753,7 @@ main (argc, argv)
if (infile == 0)
{
perror (argv[1]);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
init_rtl ();
@@ -823,7 +823,7 @@ from the machine description file `md'. */\n\n");
output_init_mov_optab ();
fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
exit (ferror (stdout) != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
/* NOTREACHED */
return 0;
}

View File

@@ -390,7 +390,7 @@ fatal VPROTO ((const char *format, ...))
vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
/* More 'friendly' abort that prints the line and file.
@@ -446,7 +446,7 @@ main (argc, argv)
if (infile == 0)
{
perror (argv[1]);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
init_rtl ();
@@ -569,7 +569,7 @@ from the machine description file `md'. */\n\n");
printf (" }\n}\n");
fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
exit (ferror (stdout) != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
/* NOTREACHED */
return 0;
}

View File

@@ -220,7 +220,7 @@ fatal VPROTO ((const char *format, ...))
vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
/* More 'friendly' abort that prints the line and file.
@@ -256,7 +256,7 @@ main (argc, argv)
if (infile == 0)
{
perror (argv[1]);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
init_rtl ();
@@ -309,7 +309,7 @@ from the machine description file `md'. */\n\n");
printf ("#endif /* NO_MD_PROTOTYPES */\n");
fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
exit (ferror (stdout) != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
/* NOTREACHED */
return 0;
}

View File

@@ -286,7 +286,7 @@ xmalloc (nbytes)
{
fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n",
nbytes);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
return tmp;

View File

@@ -328,7 +328,7 @@ fatal VPROTO ((const char *format, ...))
vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
/* More 'friendly' abort that prints the line and file.
@@ -358,7 +358,7 @@ main (argc, argv)
if (infile == 0)
{
perror (argv[1]);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
init_rtl ();
@@ -396,7 +396,7 @@ from the machine description file `md'. */\n\n");
printf ("}\n");
fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
exit (ferror (stdout) != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
/* NOTREACHED */
return 0;
}

View File

@@ -967,7 +967,7 @@ fatal VPROTO ((const char *format, ...))
vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
/* More 'friendly' abort that prints the line and file.
@@ -1019,7 +1019,7 @@ main (argc, argv)
if (infile == 0)
{
perror (argv[1]);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
init_rtl ();
@@ -1054,7 +1054,7 @@ main (argc, argv)
fflush (stdout);
exit (ferror (stdout) != 0 || have_error
? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
? EXIT_FAILURE : EXIT_SUCCESS);
/* NOTREACHED */
return 0;

View File

@@ -428,7 +428,7 @@ fatal VPROTO ((const char *format, ...))
vfprintf (stderr, format, ap);
va_end (ap);
fprintf (stderr, "\n");
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
/* More 'friendly' abort that prints the line and file.
@@ -460,7 +460,7 @@ main (argc, argv)
if (infile == 0)
{
perror (argv[1]);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
init_rtl ();
@@ -520,7 +520,7 @@ from the machine description file `md'. */\n\n");
printf ("rtx peep_operand[%d];\n", max_opno + 1);
fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
exit (ferror (stdout) != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
/* NOTREACHED */
return 0;
}

View File

@@ -132,7 +132,6 @@ static int next_index;
allocate in each subroutine we make. */
static int max_depth;
/* This table contains a list of the rtl codes that can possibly match a
predicate defined in recog.c. The function `not_both_true' uses it to
deduce that there are no expressions that can be matches by certain pairs
@@ -199,16 +198,13 @@ static void mybcopy PROTO((char *, char *, unsigned));
static void fatal PVPROTO((const char *, ...))
ATTRIBUTE_PRINTF_1 ATTRIBUTE_NORETURN;
void fancy_abort PROTO((void)) ATTRIBUTE_NORETURN;
/* Construct and return a sequence of decisions
that will recognize INSN.
TYPE says what type of routine we are recognizing (RECOG or SPLIT). */
static struct decision_head
make_insn_sequence (insn, type)
rtx insn;
enum routine_type type;
make_insn_sequence(rtx insn, enum routine_type type)
{
rtx x;
char *c_test = XSTR (insn, type == RECOG ? 2 : 1);
@@ -312,7 +308,6 @@ make_insn_sequence (insn, type)
return head;
}
/* Create a chain of nodes to verify that an rtl expression matches
PATTERN.
@@ -324,10 +319,7 @@ make_insn_sequence (insn, type)
A pointer to the final node in the chain is returned. */
static struct decision *
add_to_sequence (pattern, last, position)
rtx pattern;
struct decision_head *last;
const char *position;
add_to_sequence(rtx pattern, struct decision_head *last, const char *position)
{
register RTX_CODE code;
register struct decision *new
@@ -607,7 +599,6 @@ add_to_sequence (pattern, last, position)
}
return new;
}
/* Return 1 if we can prove that there is no RTL that can match both
D1 and D2. Otherwise, return 0 (it may be that there is an RTL that
can match both or just that we couldn't prove there wasn't such an RTL).
@@ -616,9 +607,7 @@ add_to_sequence (pattern, last, position)
recursively descend. */
static int
not_both_true (d1, d2, toplevel)
struct decision *d1, *d2;
int toplevel;
not_both_true(struct decision *d1, struct decision *d2, int toplevel)
{
struct decision *p1, *p2;
@@ -705,7 +694,6 @@ not_both_true (d1, d2, toplevel)
return 1;
}
/* Assuming that we can reorder all the alternatives at a specific point in
the tree (see discussion in merge_trees), we would prefer an ordering of
nodes where groups of consecutive nodes test the same mode and, within each
@@ -723,10 +711,7 @@ not_both_true (d1, d2, toplevel)
of the list. */
static int
position_merit (p, mode, code)
struct decision *p;
enum machine_mode mode;
enum rtx_code code;
position_merit(struct decision *p, enum machine_mode mode, enum rtx_code code)
{
enum machine_mode p_mode;
@@ -774,13 +759,11 @@ position_merit (p, mode, code)
/* Otherwise, we have the worst case. */
return 3;
}
/* Merge two decision tree listheads OLDH and ADDH,
modifying OLDH destructively, and return the merged tree. */
static struct decision_head
merge_trees (oldh, addh)
register struct decision_head oldh, addh;
merge_trees(struct decision_head oldh, struct decision_head addh)
{
struct decision *add, *next;
@@ -994,7 +977,6 @@ merge_trees (oldh, addh)
return oldh;
}
/* Count the number of subnodes of HEAD. If the number is high enough,
make the first node in HEAD start a separate subroutine in the C code
that is generated.
@@ -1005,10 +987,7 @@ merge_trees (oldh, addh)
it out here. */
static int
break_out_subroutines (head, type, initial)
struct decision_head head;
enum routine_type type;
int initial;
break_out_subroutines(struct decision_head head, enum routine_type type, int initial)
{
int size = 0;
struct decision *sub;
@@ -1024,14 +1003,11 @@ break_out_subroutines (head, type, initial)
}
return size;
}
/* Write out a subroutine of type TYPE to do comparisons starting at node
TREE. */
static void
write_subroutine (tree, type)
struct decision *tree;
enum routine_type type;
write_subroutine(struct decision *tree, enum routine_type type)
{
int i;
@@ -1066,7 +1042,6 @@ write_subroutine (tree, type)
write_tree (tree, "", NULL_PTR, 1, type);
printf (" ret0: return %d;\n}\n\n", type == SPLIT ? 0 : -1);
}
/* This table is used to indent the recog_* functions when we are inside
conditions or switch statements. We only support small indentations
and always indent at least two spaces. */
@@ -1098,11 +1073,7 @@ static const char *indents[]
or code. */
static void
write_tree_1 (tree, prevpos, afterward, type)
struct decision *tree;
const char *prevpos;
struct decision *afterward;
enum routine_type type;
write_tree_1(struct decision *tree, const char *prevpos, struct decision *afterward, enum routine_type type)
{
register struct decision *p, *p1;
register int depth = tree ? strlen (tree->position) : 0;
@@ -1528,8 +1499,7 @@ write_tree_1 (tree, prevpos, afterward, type)
}
static void
print_code (code)
enum rtx_code code;
print_code(enum rtx_code code)
{
register char *p1;
for (p1 = GET_RTX_NAME (code); *p1; p1++)
@@ -1542,9 +1512,7 @@ print_code (code)
}
static int
same_codes (p, code)
register struct decision *p;
register enum rtx_code code;
same_codes(register struct decision *p, register enum rtx_code code)
{
for (; p; p = p->next)
if (p->code != code)
@@ -1554,17 +1522,14 @@ same_codes (p, code)
}
static void
clear_codes (p)
register struct decision *p;
clear_codes(register struct decision *p)
{
for (; p; p = p->next)
p->ignore_code = 1;
}
static int
same_modes (p, mode)
register struct decision *p;
register enum machine_mode mode;
same_modes(register struct decision *p, register enum machine_mode mode)
{
for (; p; p = p->next)
if ((p->enforce_mode ? p->mode : VOIDmode) != mode)
@@ -1574,13 +1539,11 @@ same_modes (p, mode)
}
static void
clear_modes (p)
register struct decision *p;
clear_modes(register struct decision *p)
{
for (; p; p = p->next)
p->enforce_mode = 0;
}
/* Write out the decision tree starting at TREE for a subroutine of type TYPE.
PREVPOS is the position at the node that branched to this node.
@@ -1590,12 +1553,7 @@ clear_modes (p)
If all nodes are false, branch to the node AFTERWARD. */
static void
write_tree (tree, prevpos, afterward, initial, type)
struct decision *tree;
const char *prevpos;
struct decision *afterward;
int initial;
enum routine_type type;
write_tree(struct decision *tree, const char *prevpos, struct decision *afterward, int initial, enum routine_type type)
{
register struct decision *p;
const char *name_prefix = (type == SPLIT ? "split" : "recog");
@@ -1630,17 +1588,13 @@ write_tree (tree, prevpos, afterward, initial, type)
p->afterward ? p->afterward : afterward, 0, type);
}
/* Assuming that the state of argument is denoted by OLDPOS, take whatever
actions are necessary to move to NEWPOS.
INDENT says how many blanks to place at the front of lines. */
static void
change_state (oldpos, newpos, indent)
const char *oldpos;
const char *newpos;
int indent;
change_state(const char *oldpos, const char *newpos, int indent)
{
int odepth = strlen (oldpos);
int depth = odepth;
@@ -1664,10 +1618,8 @@ change_state (oldpos, newpos, indent)
++depth;
}
}
static char *
copystr (s1)
const char *s1;
copystr(const char *s1)
{
register char *tem;
@@ -1681,27 +1633,21 @@ copystr (s1)
}
static void
mybzero (b, length)
register char *b;
register unsigned length;
mybzero(char *b, unsigned length)
{
while (length-- > 0)
*b++ = 0;
}
static void
mybcopy (in, out, length)
register char *in, *out;
register unsigned length;
mybcopy(char *in, char *out, unsigned length)
{
while (length-- > 0)
*out++ = *in++;
}
PTR
xrealloc (old, size)
PTR old;
size_t size;
xrealloc(PTR old, size_t size)
{
register PTR ptr;
if (old)
@@ -1714,8 +1660,7 @@ xrealloc (old, size)
}
PTR
xmalloc (size)
size_t size;
xmalloc(size_t size)
{
register PTR val = (PTR) malloc (size);
@@ -1743,22 +1688,19 @@ fatal VPROTO ((const char *format, ...))
va_end (ap);
fprintf (stderr, "\n");
fprintf (stderr, "after %d definitions\n", next_index);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
/* More 'friendly' abort that prints the line and file.
config.h can #define abort fancy_abort if you like that sort of thing. */
void
fancy_abort ()
fancy_abort()
{
fatal ("Internal gcc abort.");
}
int
main (argc, argv)
int argc;
char **argv;
main(int argc, char **argv)
{
rtx desc;
struct decision_head recog_tree;
@@ -1776,7 +1718,7 @@ main (argc, argv)
if (infile == 0)
{
perror (argv[1]);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
init_rtl ();
@@ -1855,7 +1797,7 @@ from the machine description file `md'. */\n\n");
write_subroutine (split_tree.first, SPLIT);
fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
exit (ferror (stdout) != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
/* NOTREACHED */
return 0;
}

View File

@@ -188,7 +188,7 @@ Boston, MA 02111-1307, USA. */
#define abort() \
(fprintf (stderr, "%s:%d: Internal compiler error\n", __FILE__, __LINE__), \
exit (FATAL_EXIT_CODE))
exit (EXIT_FAILURE))
#define STRINGIFY(STRING) #STRING

View File

@@ -1260,7 +1260,7 @@ pfatal_with_name (name)
{
fprintf (stderr, "%s: ", progname);
perror (name);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
void
@@ -1268,7 +1268,7 @@ fatal_io_error (name)
char *name;
{
fprintf (stderr, "%s: %s: I/O error\n", progname, name);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
/* Called to give a better error message for a bad insn rather than
@@ -1690,7 +1690,7 @@ vfatal (s, ap)
va_list ap;
{
verror (s, ap);
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
}
void
@@ -4901,10 +4901,10 @@ main (argc, argv)
compile_file (filename);
if (errorcount)
exit (FATAL_EXIT_CODE);
exit (EXIT_FAILURE);
if (sorrycount)
exit (FATAL_EXIT_CODE);
exit (SUCCESS_EXIT_CODE);
exit (EXIT_FAILURE);
exit (EXIT_SUCCESS);
return 0;
}

View File

@@ -1,10 +1,6 @@
/* obstack.c - subroutines used implicitly by object stack macros
Copyright (C) 1988,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
NOTE: The canonical source of this file is maintained with the GNU C Library.
Bugs can be reported to bug-glibc@gnu.org.
This program 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
@@ -20,37 +16,10 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include "obstack.h"
/* NOTE BEFORE MODIFYING THIS FILE: This version number must be
incremented whenever callers compiled using an old obstack.h can no
longer properly call the functions in this obstack.c. */
#define OBSTACK_INTERFACE_VERSION 1
/* Comment out all this code if we are using the GNU C Library, and are not
actually compiling the library itself, and the installed library
supports the same library interface we do. This code is part of the GNU
C Library, but also included in many other GNU distributions. Compiling
and linking in this code is a waste when using the GNU C library
(especially if it is a shared library). Rather than having every GNU
program understand `configure --with-gnu-libc' and omit the object
files, it is simpler to just do this in the source for each such file. */
#include <stdio.h> /* Random thing to get __GNU_LIBRARY__. */
#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
#include <gnu-versions.h>
#if _GNU_OBSTACK_INTERFACE_VERSION == OBSTACK_INTERFACE_VERSION
#define ELIDE_CODE
#endif
#endif
#ifndef ELIDE_CODE
#if defined (__STDC__) && __STDC__
#define POINTER void *
@@ -450,137 +419,9 @@ _obstack_memory_used (h)
}
/* Define the error handler. */
#ifndef _
#define _(Str) (Str)
#endif
static void
print_and_abort ()
{
fputs (_("memory exhausted\n"), stderr);
fputs ("memory exhausted\n", stderr);
exit (obstack_exit_failure);
}
#if 0
/* These are now turned off because the applications do not use it
and it uses bcopy via obstack_grow, which causes trouble on sysV. */
/* Now define the functional versions of the obstack macros.
Define them to simply use the corresponding macros to do the job. */
#if defined (__STDC__) && __STDC__
/* These function definitions do not work with non-ANSI preprocessors;
they won't pass through the macro names in parentheses. */
/* The function names appear in parentheses in order to prevent
the macro-definitions of the names from being expanded there. */
POINTER (obstack_base) (obstack)
struct obstack *obstack;
{
return obstack_base (obstack);
}
POINTER (obstack_next_free) (obstack)
struct obstack *obstack;
{
return obstack_next_free (obstack);
}
int (obstack_object_size) (obstack)
struct obstack *obstack;
{
return obstack_object_size (obstack);
}
int (obstack_room) (obstack)
struct obstack *obstack;
{
return obstack_room (obstack);
}
int (obstack_make_room) (obstack, length)
struct obstack *obstack;
int length;
{
return obstack_make_room (obstack, length);
}
void (obstack_grow) (obstack, pointer, length)
struct obstack *obstack;
POINTER pointer;
int length;
{
obstack_grow (obstack, pointer, length);
}
void (obstack_grow0) (obstack, pointer, length)
struct obstack *obstack;
POINTER pointer;
int length;
{
obstack_grow0 (obstack, pointer, length);
}
void (obstack_1grow) (obstack, character)
struct obstack *obstack;
int character;
{
obstack_1grow (obstack, character);
}
void (obstack_blank) (obstack, length)
struct obstack *obstack;
int length;
{
obstack_blank (obstack, length);
}
void (obstack_1grow_fast) (obstack, character)
struct obstack *obstack;
int character;
{
obstack_1grow_fast (obstack, character);
}
void (obstack_blank_fast) (obstack, length)
struct obstack *obstack;
int length;
{
obstack_blank_fast (obstack, length);
}
POINTER (obstack_finish) (obstack)
struct obstack *obstack;
{
return obstack_finish (obstack);
}
POINTER (obstack_alloc) (obstack, length)
struct obstack *obstack;
int length;
{
return obstack_alloc (obstack, length);
}
POINTER (obstack_copy) (obstack, pointer, length)
struct obstack *obstack;
POINTER pointer;
int length;
{
return obstack_copy (obstack, pointer, length);
}
POINTER (obstack_copy0) (obstack, pointer, length)
struct obstack *obstack;
POINTER pointer;
int length;
{
return obstack_copy0 (obstack, pointer, length);
}
#endif /* __STDC__ */
#endif /* 0 */
#endif /* !ELIDE_CODE */