Commit b93a436e by Jeffrey A Law Committed by Jeff Law

Makefile.in: Remove all bytecode support.

        * Makefile.in: Remove all bytecode support.
        (OBJS): Make sure last entry is a real object file, not EXTRA_OBJS.
        * emit-rtl.c: Remove all bytecode support.
        * expr.c, expr.h function.c, integrate.c: Likewise.
        * output.h, regclass.c, rtl.h, stmt.c, toplev.c: Likewise.
        * tree.h, varasm.c: Likewise.
        * bi-*, bc-*: Delete bytecode related files.
Bytecode suppors disappears :-)

From-SVN: r17432
parent 6885fc87
Tue Jan 20 09:29:09 1998 Jeffrey A Law (law@cygnus.com)
* Makefile.in: Remove all bytecode support.
(OBJS): Make sure last entry is a real object file, not EXTRA_OBJS.
* emit-rtl.c: Remove all bytecode support.
* expr.c, expr.h function.c, integrate.c: Likewise.
* output.h, regclass.c, rtl.h, stmt.c, toplev.c: Likewise.
* tree.h, varasm.c: Likewise.
* bi-*, bc-*: Delete bytecode related files.
Tue Jan 20 09:02:31 1998 Gavin Koch (gavin@cygnus.com)
* mips/mips.md (divsi3,divdi3,modsi3,moddi3,udivsi3,udivdi3,
......
/* bc-emit.h - declare entry points for producing object files of bytecodes. */
/* Internal format of symbol table for the object file. */
struct bc_sym
{
/* Private copy separately malloc'd. */
char *name;
/* Symbol has a defined value. */
unsigned int defined:1;
/* Symbol has been globalized. */
unsigned int global:1;
/* Symbol is common. */
unsigned int common:1;
/* Value if defined. */
unsigned long int val;
/* Used in internal symbol table structure. */
struct bc_sym *next;
};
/* List of symbols defined in a particular segment. */
struct bc_segsym
{
struct bc_sym *sym;
struct bc_segsym *next;
};
/* List of relocations needed in a particular segment. */
struct bc_segreloc
{
/* Offset of datum to be relocated. */
unsigned int offset;
/* Symbol to be relocated by. */
struct bc_sym *sym;
struct bc_segreloc *next;
};
/* Segment of an object file. */
struct bc_seg
{
/* Size allocated to contents. */
unsigned int alloc;
/* Pointer to base of contents. */
char *data;
/* Actual size of contents. */
unsigned int size;
/* List of symbols defined in this segment. */
struct bc_segsym *syms;
/* List of relocations for this segment. */
struct bc_segreloc *relocs;
};
/* Anonymous bytecode label within a single function. */
struct bc_label
{
/* Offset of label from start of segment. */
unsigned int offset;
/* True when offset is valid. */
unsigned int defined:1;
/* Unique bytecode ID, used to determine innermost
block containment */
int uid;
/* Next node in list */
struct bc_label *next;
};
/* Reference to a bc_label; a list of all such references is kept for
the function, then when it is finished they are backpatched to
contain the correct values. */
struct bc_labelref
{
/* Label referenced. */
struct bc_label *label;
/* Code offset of reference. */
unsigned int offset;
/* Next labelref in list */
struct bc_labelref *next;
};
extern void bc_initialize();
extern int bc_begin_function();
extern char *bc_emit_trampoline();
extern void bc_emit_bytecode();
extern void bc_emit_bytecode_const();
extern struct bc_label *bc_get_bytecode_label();
extern int bc_emit_bytecode_labeldef();
extern void bc_emit_bytecode_labelref();
extern void bc_emit_code_labelref();
extern char *bc_end_function();
extern void bc_align_const();
extern void bc_emit_const();
extern void bc_emit_const_skip();
extern int bc_emit_const_labeldef();
extern void bc_emit_const_labelref();
extern void bc_align_data();
extern void bc_emit_data();
extern void bc_emit_data_skip();
extern int bc_emit_data_labeldef();
extern void bc_emit_data_labelref();
extern int bc_define_pointer ();
extern int bc_emit_common();
extern void bc_globalize_label();
extern void bc_text();
extern void bc_data();
extern void bc_align();
extern void bc_emit();
extern void bc_emit_skip();
extern int bc_emit_labeldef();
extern void bc_emit_labelref();
extern void bc_write_file();
/* Bytecode token definitions for GNU C-compiler.
Copyright (C) 1993 Free Software Foundation, Inc.
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
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
extern void bc_expand_conversion ();
extern void bc_expand_truth_conversion ();
extern void bc_expand_binary_operation ();
extern void bc_expand_unary_operation ();
struct binary_operator
{
enum bytecode_opcode opcode;
enum typecode result;
enum typecode arg0;
enum typecode arg1;
};
extern struct binary_operator optab_plus_expr[];
extern struct binary_operator optab_minus_expr[];
extern struct binary_operator optab_mult_expr[];
extern struct binary_operator optab_trunc_div_expr[];
extern struct binary_operator optab_trunc_mod_expr[];
extern struct binary_operator optab_rdiv_expr[];
extern struct binary_operator optab_bit_and_expr[];
extern struct binary_operator optab_bit_ior_expr[];
extern struct binary_operator optab_bit_xor_expr[];
extern struct binary_operator optab_lshift_expr[];
extern struct binary_operator optab_rshift_expr[];
extern struct binary_operator optab_truth_and_expr[];
extern struct binary_operator optab_truth_or_expr[];
extern struct binary_operator optab_lt_expr[];
extern struct binary_operator optab_le_expr[];
extern struct binary_operator optab_ge_expr[];
extern struct binary_operator optab_gt_expr[];
extern struct binary_operator optab_eq_expr[];
extern struct binary_operator optab_ne_expr[];
struct unary_operator
{
enum bytecode_opcode opcode;
enum typecode result;
enum typecode arg0;
};
extern struct unary_operator optab_negate_expr[];
extern struct unary_operator optab_bit_not_expr[];
extern struct unary_operator optab_truth_not_expr[];
struct increment_operator
{
enum bytecode_opcode opcode;
enum typecode arg;
};
extern struct increment_operator optab_predecrement_expr[];
extern struct increment_operator optab_preincrement_expr[];
extern struct increment_operator optab_postdecrement_expr[];
extern struct increment_operator optab_postincrement_expr[];
/* Typecodes used by the interpreter and their related
machine modes and types.
The last argument is used for retrieving the given
type from a varargs list. Due to a bug in varargs,
the type has to be the generic machine type of
larger. */
DEFTYPECODE (QIcode, "QI", QImode, SItype)
DEFTYPECODE (QUcode, "QU", QImode, SUtype)
DEFTYPECODE (HIcode, "HI", HImode, SItype)
DEFTYPECODE (HUcode, "HU", HImode, SUtype)
DEFTYPECODE (SIcode, "SI", SImode, SItype)
DEFTYPECODE (SUcode, "SU", SImode, SUtype)
DEFTYPECODE (DIcode, "DI", DImode, DItype)
DEFTYPECODE (DUcode, "DU", DImode, DUtype)
DEFTYPECODE (SFcode, "SF", SFmode, SFtype)
DEFTYPECODE (DFcode, "DF", DFmode, DFtype)
DEFTYPECODE (XFcode, "XF", XFmode, XFtype)
DEFTYPECODE (Pcode, "P", PSImode, Ptype)
DEFTYPECODE (Tcode, "T", SImode, SItype)
/* Typecode definitions for Bytecode Interpreter.
Copyright (C) 1993 Free Software Foundation, Inc.
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
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef TYPECODE_H
#define TYPECODE_H
enum typecode
{
#define DEFTYPECODE(CODE, NAME, MACHMODE, TYPE) CODE,
#include "bc-typecd.def"
#undef DEFTYPECODE
LAST_AND_UNUSED_TYPECODE
};
/* Determine if a given type is integer. */
#define TYPECODE_INTEGER_P(TYPECODE) ((int) (TYPECODE) < (int) SFcode)
/* Determine if a given type is unsigned. */
#define TYPECODE_UNSIGNED_P(TYPECODE) \
(TYPECODE_INTEGER_P(TYPECODE) && (int) (TYPECODE) & 1)
/* Determine if a given type is signed. */
#define TYPECODE_SIGNED_P(TYPECODE) \
(TYPECODE_INTEGER_P(TYPECODE) && !((int) (TYPECODE) & 1))
/* Determine if a given type is floating. */
#define TYPECODE_FLOAT_P(TYPECODE) \
((int) (TYPECODE) < (int) Pcode && !TYPECODE_INTEGER_P(TYPECODE))
/* Determine if the given type is arithmetic. */
#define TYPECODE_ARITH_P(TYPECODE) \
(TYPECODE_INTEGER_P(TYPECODE) || TYPECODE_FLOAT_P(TYPECODE))
#define NUM_TYPECODES ((int) LAST_AND_UNUSED_TYPECODE)
#endif
/* Bytecode Interpreter utility to generate arity table.
Copyright (C) 1993 Free Software Foundation, Inc.
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
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include "hconfig.h"
#include "bi-defs.h"
int
length (n)
struct node *n;
{
int k;
for (k = 0; n; n = n->next)
++k;
return k;
}
int
main ()
{
struct def *d;
struct variation *v;
struct node *n;
yyparse ();
reverse ();
for (d = defs; d; d = d->next)
for (v = d->variations; v; v = v->next)
{
printf ("{ %d, %d, %d, {", length (v->inputs),
length (v->outputs), length (v->literals));
for (n = v->literals; n; n = n->next)
printf ("(char) %scode, ", n->text);
if (v->literals == 0)
printf ("0");
printf ("}},\n");
}
fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
/* NOTREACHED */
return 0;
}
/* Safely allocate NBYTES bytes of memory. Returns pointer to block of
memory. */
char *
xmalloc (nbytes)
int nbytes;
{
char *tmp = (char *) malloc (nbytes);
if (!tmp)
{
fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n", nbytes);
exit (FATAL_EXIT_CODE);
}
return tmp;
}
/* 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 ()
{
fprintf (stderr, "Internal gcc abort.\n");
exit (FATAL_EXIT_CODE);
}
/* Definitions for Bytecode Interpreter.
Copyright (C) 1993 Free Software Foundation, Inc.
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
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
struct node
{
char *text;
struct node *next;
};
struct variation
{
char *name;
int code;
struct node *inputs;
struct node *outputs;
struct node *literals;
struct variation *next;
};
struct def
{
char *basename;
char *template;
struct variation *variations;
struct def *next;
};
extern struct def *defs;
extern int ndefs;
extern void reverse();
/* Lexer for scanner of bytecode definition file.
Copyright (C) 1993, 1995 Free Software Foundation, Inc.
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
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include "hconfig.h"
#include "bi-parser.h"
/* Safely allocate NBYTES bytes of memory. Returns pointer to block of
memory. */
static char *
xmalloc (nbytes)
int nbytes;
{
char *tmp = (char *) malloc (nbytes);
if (!tmp)
{
fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n", nbytes);
exit (FATAL_EXIT_CODE);
}
return tmp;
}
/* Safely reallocate BLOCK so its size becomes NBYTES.
The block returned may be different from the one supplied. */
static char *
xrealloc (block, nbytes)
char *block;
int nbytes;
{
char *tmp = (block
? (char *) realloc (block, nbytes)
: (char *) malloc (nbytes));
if (!tmp)
{
fprintf (stderr, "can't reallocate %d bytes (out of virtual memory)\n", nbytes);
exit (FATAL_EXIT_CODE);
}
return tmp;
}
/* Scan for string token on standard input. A string is, for our
purposes here, a sequence of characters that starts with the regexp
``[^ #\t\n(),]'' and is then followed by the regexp ``[^#(),]*''. Any
character is accepted if preceded by a backslash, "\\". It is assumed
that the first character has already been checked by the main loop. */
static char *
scan_string ()
{
char *buffer = NULL;
char *point = NULL;
int buffer_size = 0;
int c;
while ((c = getc (stdin)) != EOF
&& c != '#' && c != '(' && c != ')' && c != ',')
{
/* Extend buffer, if necessary (minus two so there's room for the NUL
trailer as well as another character if this one is a backslash). */
if (!buffer_size || (point - buffer >= buffer_size-2))
{
int previous_point_index = point - buffer;
buffer_size = (!buffer_size ? 32 : buffer_size * 2);
if (!buffer)
buffer = xmalloc (buffer_size);
else
buffer = xrealloc (buffer, buffer_size);
point = buffer + previous_point_index;
}
*point++ = c & 0xff;
if (c == '\\')
{
c = getc (stdin);
/* Catch special case: backslash at end of file */
if (c == EOF)
break;
*point++ = c;
}
}
*point = 0;
if (c != EOF)
ungetc (c, stdin);
return buffer;
}
int
yylex ()
{
int c;
char *token;
/* First char determines what token we're looking at */
for (;;)
{
c = getc (stdin);
switch (c)
{
case EOF:
return 0;
case ' ':
case '\t':
case '\n':
/* Ignore whitespace */
continue;
case '#':
/* Comments advance to next line */
while ((c = getc (stdin)) != '\n' && c != EOF);
continue;
default:
if (c != '(' && c != ')' && c != '\\' && c != ',')
{
ungetc (c, stdin);
yylval.string = scan_string ();
/* Check if string is "define_operator"; if so, return
a DEFOP token instead. */
if (!strcmp (yylval.string, "define_operator"))
{
free (yylval.string);
yylval.string = 0;
return DEFOP;
}
return STRING;
}
return c & 0xff;
}
}
}
/* Utility to generate opcode list from bytecode definition.
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
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
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include "hconfig.h"
#include "bi-defs.h"
int
main(argc, argv)
int argc;
char **argv;
{
struct def *d;
struct variation *v;
int i;
yyparse();
reverse();
printf ("/* This file is automatically generated from bytecode.def,\n");
printf ("do not make any changes here. Instead edit bytecode.def. */\n\n");
printf ("enum bytecode_opcode\n{");
i = 0;
for (d = defs; d; d = d->next)
for (v = d->variations; v; v = v->next)
{
printf (" %s%s,\n", d->basename, v->name);
++i;
}
puts (" LAST_AND_UNUSED_OPCODE\n};");
if (i > 256)
fprintf (stderr, "%s: warning, number of opcodes is %d\n", *argv, i);
else
fprintf (stderr, "(Number of opcodes is %d)\n", i);
fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
/* NOTREACHED */
return 0;
}
/* Safely allocate NBYTES bytes of memory. Returns pointer to block of
memory. */
char *
xmalloc (nbytes)
int nbytes;
{
char *tmp = (char *) malloc (nbytes);
if (!tmp)
{
fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n", nbytes);
exit (FATAL_EXIT_CODE);
}
return tmp;
}
/* 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 ()
{
fprintf (stderr, "Internal gcc abort.\n");
exit (FATAL_EXIT_CODE);
}
/* Utility to generate opcode name list from bytecode definition file.
Copyright (C) 1993 Free Software Foundation, Inc.
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
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include "hconfig.h"
#include "bi-defs.h"
int
main()
{
struct def *d;
struct variation *v;
yyparse();
reverse();
for (d = defs; d; d = d->next)
for (v = d->variations; v; v = v->next)
printf("\"%s%s\",\n", d->basename, v->name);
fflush (stdout);
exit (ferror (stdout) != 0 ? FATAL_EXIT_CODE : SUCCESS_EXIT_CODE);
/* NOTREACHED */
return 0;
}
/* Safely allocate NBYTES bytes of memory. Returns pointer to block of
memory. */
char *
xmalloc (nbytes)
int nbytes;
{
char *tmp = (char *) malloc (nbytes);
if (!tmp)
{
fprintf (stderr, "can't allocate %d bytes (out of virtual memory)\n", nbytes);
exit (FATAL_EXIT_CODE);
}
return tmp;
}
/* 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 ()
{
fprintf (stderr, "Internal gcc abort.\n");
exit (FATAL_EXIT_CODE);
}
typedef union
{
char *string;
struct def *def;
struct variation *variation;
struct node *node;
} YYSTYPE;
#define DEFOP 258
#define STRING 259
extern YYSTYPE yylval;
/* Bytecode definition file parser.
Copyright (C) 1993 Free Software Foundation, Inc.
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
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
%{
#include <stdio.h>
#include "hconfig.h"
#include "bi-defs.h"
extern char yytext[];
extern int yyleng;
/* Chain of all defs built by the parser. */
struct def *defs;
int ndefs;
static struct node *makenode ();
static struct variation *makevar ();
static struct def *makedef ();
void yyerror ();
%}
%union
{
char *string;
struct def *def;
struct variation *variation;
struct node *node;
}
%token <string> DEFOP STRING
%type <string> opt_string
%type <def> defs def
%type <variation> variations variation
%type <node> list items item
%%
top:
defs
{ defs = $1; }
;
defs:
def
| defs def
{ $2->next = $1; $$ = $2; }
;
def:
DEFOP '(' STRING ',' opt_string ',' '(' variations ')' ')'
{ $$ = makedef ($3, $5, $8); }
;
variations:
variation
| variations ',' variation
{ $3->next = $1; $$ = $3; }
;
variation:
'(' opt_string ')'
{ $$ = makevar ($2, (struct node *) NULL, (struct node *) NULL, (struct node *) NULL); }
| '(' opt_string ',' list ')'
{ $$ = makevar ($2, $4, (struct node *) NULL, (struct node *) NULL); }
| '(' opt_string ',' list ',' list ')'
{ $$ = makevar ($2, $4, $6, (struct node *) NULL); }
| '(' opt_string ',' list ',' list ',' list ')'
{ $$ = makevar ($2, $4, $6, $8); }
;
opt_string:
/* empty */ { $$ = ""; }
| STRING { $$ = $1; }
;
list:
'(' items ')'
{ $$ = $2; }
| /* empty */
{ $$ = NULL; }
;
items:
item
/* Note right recursion. */
| item ',' items
{ $1->next = $3; $$ = $1; }
;
item:
STRING
{ $$ = makenode ($1); }
;
%%
static struct node *
makenode (s)
char *s;
{
struct node *n;
n = (struct node *) malloc (sizeof (struct node));
n->text = s;
n->next = NULL;
return n;
}
static struct variation *
makevar (name, inputs, outputs, literals)
char *name;
struct node *inputs, *outputs, *literals;
{
struct variation *v;
v = (struct variation *) malloc (sizeof (struct variation));
v->name = name;
v->code = ndefs++;
v->inputs = inputs;
v->outputs = outputs;
v->literals = literals;
v->next = NULL;
return v;
}
static struct def *
makedef (name, template, vars)
char *name, *template;
struct variation *vars;
{
struct def *d;
d = (struct def *) malloc (sizeof (struct def));
d->basename = name;
d->template = template;
d->variations = vars;
d->next = NULL;
return d;
}
void
yyerror (s)
char *s;
{
fprintf (stderr, "syntax error in input\n");
exit (FATAL_EXIT_CODE);
}
/* Reverse order of definitions obtained from bytecode definition file.
Copyright (C) 1993 Free Software Foundation, Inc.
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
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#include "hconfig.h"
#include "bi-defs.h"
void
reverse()
{
struct def *dp, *d, *dn;
struct variation *vp, *v, *vn;
dp = defs;
if (dp)
{
vp = dp->variations;
if (vp)
{
for (v = vp->next, vp->next = 0; v; vp = v, v = vn)
{
vn = v->next;
v->next = vp;
}
dp->variations = vp;
}
for (d = dp->next, dp->next = 0; d; dp = d, d = dn)
{
vp = d->variations;
if (vp)
{
for (v = vp->next, vp->next = 0; v; vp = v, v = vn)
{
vn = v->next;
v->next = vp;
}
d->variations = vp;
}
dn = d->next;
d->next = dp;
}
defs = dp;
}
}
/* Definitions for Bytecode Interpreter.
Copyright (C) 1993, 1994 Free Software Foundation, Inc.
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
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#define MAXLITERALS 5
struct arityvec
{
char ninputs;
char noutputs;
char nliterals;
char literals[MAXLITERALS];
};
struct argtype
{
int modealign; /* Argument mode:alignment */
int size; /* Argument size, in bytes */
};
struct callinfo
{
int nargs; /* Number of arguments in call */
struct argtype retvaltype; /* Type of return value */
struct argtype argtypes[1]; /* Argument types */
};
/* Structure describing a bytecode function. If this changes, we also
need to change expand_function_end () in bc-trans.c */
struct bytecode
{
int stacksize; /* Depth required of evaluation stack. */
int localsize; /* Size in bytes of local variables. */
unsigned char *pc0; /* Initial program counter. */
void **ptrlit; /* Vector of (relocatable) pointer literals. */
struct callinfo *callinfo; /* Vector of procedure call type info. */
};
#define INTERP_BPC 8 /* Bits per char */
#define INTERP_BPI \
(sizeof (int) * INTERP_BPC) /* Bits per int */
#ifndef min
#define min(L, R) ((L) < (R) ? (L) : (R))
#endif
/* bit field operations. */
/* Low (high) mask: int with low (high) N bits set */
#define LM(N) ((1 << (N)) - 1)
#define HM(N) ((~LM (INTERP_BPI - (N))))
/* Sign-extend SIZE low bits of VALUE to integer (typeof VALUE)
Signed bitfields are loaded from memory by the sxloadBI instruction,
which first retrieves the bitfield with XFIELD and then sign extends
it to an SItype. */
#define EXTEND(SIZE, VALUE) \
({ SUtype value = (SUtype) (VALUE); \
(value & (1 << ((SIZE) - 1)) ? value | ~LM (SIZE) : value); })
/* Given OFFSET:SIZE for a bitfield, calculate:
[1] BYTE_OFFSET = the byte offset of the bit field.
[2] BIT_OFFSET = the bit offset of the bit field (less than INTERP_BPC).
[3] NBYTES = the number of integral bytes in the bit field.
[4] TRAILING_BITS= the number of trailing bits (less than INTERP_BPC).
, , , , , (memory bytes)
---------------- (bitfield)
| | || | | (divisions)
^ ^ ^ ^
| | | |__ [4] (bits)
| | |_________ [3] (bytes)
| |_________________ [2] (bits)
|___________________________ [1] (bytes)
The above applies to BYTE_LOW_ENDIAN machines. In BYTE_BIG_ENDIAN machines, the
bit numbering is reversed (i.e. bit 0 is the sign bit).
(All right, so I drew this to keep my tongue in cheek while writing the code below,
not because I'm into ASCII art.) */
#define BI_PARAMS(OFFSET, SIZE, BYTE_OFFSET, BIT_OFFSET, NBYTES, TRAILING_BITS) \
{ BYTE_OFFSET = (OFFSET) / (INTERP_BPC); \
BIT_OFFSET = (OFFSET) % (INTERP_BPC); \
NBYTES = ((SIZE) - (INTERP_BPC - (BIT_OFFSET))) / INTERP_BPC; \
if ((NBYTES) < 0 || ((NBYTES) > 64)) \
NBYTES = 0; \
if ((SIZE) + (BIT_OFFSET) <= INTERP_BPC) \
TRAILING_BITS = 0; \
else \
TRAILING_BITS = ((SIZE) - (INTERP_BPC - (BIT_OFFSET))) % INTERP_BPC; }
/* SHIFT_IN_BITS retrieves NBITS bits from SOURCE and shifts into
DEST. The bit field starts OFFSET bits into SOURCE.
OR_IN_BITS copies the NBITS low bits from VALUE into a the bitfield in
DEST offset by OFFSET bits. */
#define SHIFT_IN_BITS(DEST, SOURCE, OFFSET, NBITS) \
(DEST = ((DEST) << (NBITS)) \
| (LM ((NBITS)) \
& ((SOURCE) \
>> (BYTES_BIG_ENDIAN \
? (INTERP_BPC - (OFFSET) - (NBITS)) \
: (OFFSET)))))
#define OR_IN_BITS(DEST, VALUE, OFFSET, NBITS) \
(DEST = ((DEST) & ~(LM ((NBITS)) \
<< (BIG_ENDIAN \
? (INTERP_BPC - (OFFSET) - (NBITS)) \
: (OFFSET))) \
| (((VALUE) & LM ((NBITS))) \
<< (BIG_ENDIAN \
? (INTERP_BPC - (OFFSET) - (NBITS)) \
: (OFFSET)))))
/* Procedure call; arguments are a pointer to the function to be called,
a pointer to a place to store the return value, a pointer to a vector
describing the type of procedure call, and the interpreter's stack pointer,
which will point to the first of the arguments at this point. */
#define CALL(FUNC, CALLDESC, RETVAL, SP) __call(FUNC, CALLDESC, RETVAL, SP)
/* Procedure return; arguments are a pointer to the calldesc for this
function, and a pointer to the place where the value to be returned
may be found. Generally the MACHARGS above contain a machine dependent
cookie that is used to determine where to jump to. */
#define PROCRET(CALLDESC, RETVAL) return
......@@ -53,23 +53,7 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "obstack.h"
#include "bytecode.h"
#include "machmode.h"
#include "bc-opcode.h"
#include "bc-typecd.h"
#include "bc-optab.h"
#include "bc-emit.h"
/* Opcode names */
#ifdef BCDEBUG_PRINT_CODE
char *opcode_name[] =
{
#include "bc-opname.h"
"***END***"
};
#endif
/* Commonly used modes. */
......@@ -1451,11 +1435,8 @@ gen_label_rtx ()
{
register rtx label;
label = (output_bytecode
? gen_rtx_CODE_LABEL (VOIDmode, 0, bc_get_bytecode_label (),
NULL_RTX, 0, NULL_PTR)
: gen_rtx_CODE_LABEL (VOIDmode, 0, NULL_RTX,
NULL_RTX, label_num++, NULL_PTR));
label = gen_rtx_CODE_LABEL (VOIDmode, 0, NULL_RTX,
NULL_RTX, label_num++, NULL_PTR);
LABEL_NUSES (label) = 0;
return label;
......@@ -2937,13 +2918,6 @@ emit_line_note (file, line)
char *file;
int line;
{
if (output_bytecode)
{
/* FIXME: for now we do nothing, but eventually we will have to deal with
debugging information. */
return 0;
}
emit_filename = file;
emit_lineno = line;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -936,19 +936,7 @@ extern rtx (*lang_expand_expr) PROTO ((union tree_node *, rtx,
enum machine_mode,
enum expand_modifier modifier));
#ifdef TREE_CODE
/* Build bytecode call descriptor for function SUBR. */
extern rtx bc_build_calldesc PROTO((tree));
/* Emit a type code to be used by the runtime support in handling
parameter passing. The type code consists of the machine mode
plus the minimal alignment shifted left 8 bits. */
extern tree bc_runtime_type_code PROTO((tree));
#endif
extern void init_all_optabs PROTO ((void));
extern void init_mov_optab PROTO ((void));
extern void bc_adjust_stack PROTO ((int));
extern void bc_load_localaddr PROTO ((rtx));
extern void do_jump_by_parts_greater_rtx PROTO ((enum machine_mode, int,
rtx, rtx, rtx, rtx));
......@@ -55,8 +55,6 @@ Boston, MA 02111-1307, USA. */
#include "output.h"
#include "basic-block.h"
#include "obstack.h"
#include "bytecode.h"
#include "bc-emit.h"
#ifndef TRAMPOLINE_ALIGNMENT
#define TRAMPOLINE_ALIGNMENT FUNCTION_BOUNDARY
......@@ -388,19 +386,12 @@ static tree this_function_decl;
/* Callinfo pointer for the current function. */
static rtx this_function_callinfo;
/* The label in the bytecode file of this function's actual bytecode.
Not an rtx. */
static char *this_function_bytecode;
/* The call description vector for the current function. */
static rtx this_function_calldesc;
/* Size of the local variables allocated for the current function. */
int local_vars_size;
/* Current depth of the bytecode evaluation stack. */
int stack_depth;
/* Maximum depth of the evaluation stack in this function. */
int max_stack_depth;
......@@ -1312,9 +1303,6 @@ put_var_into_stack (decl)
tree context;
int can_use_addressof;
if (output_bytecode)
return;
context = decl_function_context (decl);
/* Get the current rtl used for this object and it's original mode. */
......@@ -5153,50 +5141,6 @@ all_blocks (block, vector)
return n_blocks;
}
/* Build bytecode call descriptor for function SUBR. */
rtx
bc_build_calldesc (subr)
tree subr;
{
tree calldesc = 0, arg;
int nargs = 0;
/* Build the argument description vector in reverse order. */
DECL_ARGUMENTS (subr) = nreverse (DECL_ARGUMENTS (subr));
nargs = 0;
for (arg = DECL_ARGUMENTS (subr); arg; arg = TREE_CHAIN (arg))
{
++nargs;
calldesc = tree_cons ((tree) 0, size_in_bytes (TREE_TYPE (arg)), calldesc);
calldesc = tree_cons ((tree) 0, bc_runtime_type_code (TREE_TYPE (arg)), calldesc);
}
DECL_ARGUMENTS (subr) = nreverse (DECL_ARGUMENTS (subr));
/* Prepend the function's return type. */
calldesc = tree_cons ((tree) 0,
size_in_bytes (TREE_TYPE (TREE_TYPE (subr))),
calldesc);
calldesc = tree_cons ((tree) 0,
bc_runtime_type_code (TREE_TYPE (TREE_TYPE (subr))),
calldesc);
/* Prepend the arg count. */
calldesc = tree_cons ((tree) 0, build_int_2 (nargs, 0), calldesc);
/* Output the call description vector and get its address. */
calldesc = build_nt (CONSTRUCTOR, (tree) 0, calldesc);
TREE_TYPE (calldesc) = build_array_type (integer_type_node,
build_index_type (build_int_2 (nargs * 2, 0)));
return output_constant_def (calldesc);
}
/* Generate RTL for the start of the function SUBR (a FUNCTION_DECL tree node)
and initialize static variables for generating RTL for the statements
of the function. */
......@@ -5207,17 +5151,6 @@ init_function_start (subr, filename, line)
char *filename;
int line;
{
if (output_bytecode)
{
this_function_decl = subr;
this_function_calldesc = bc_build_calldesc (subr);
local_vars_size = 0;
stack_depth = 0;
max_stack_depth = 0;
stmt_expr_depth = 0;
return;
}
init_stmt_for_function ();
cse_not_expected = ! optimize;
......@@ -5371,99 +5304,14 @@ mark_varargs ()
void
expand_main_function ()
{
if (!output_bytecode)
{
/* The zero below avoids a possible parse error */
0;
#if !defined (HAS_INIT_SECTION)
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, NAME__MAIN), 0,
VOIDmode, 0);
emit_library_call (gen_rtx_SYMBOL_REF (Pmode, NAME__MAIN), 0,
VOIDmode, 0);
#endif /* not HAS_INIT_SECTION */
}
}
extern struct obstack permanent_obstack;
/* Expand start of bytecode function. See comment at
expand_function_start below for details. */
void
bc_expand_function_start (subr, parms_have_cleanups)
tree subr;
int parms_have_cleanups;
{
char label[20], *name;
static int nlab;
tree thisarg;
int argsz;
if (TREE_PUBLIC (subr))
bc_globalize_label (IDENTIFIER_POINTER (DECL_NAME (subr)));
#ifdef DEBUG_PRINT_CODE
fprintf (stderr, "\n<func %s>\n", IDENTIFIER_POINTER (DECL_NAME (subr)));
#endif
for (argsz = 0, thisarg = DECL_ARGUMENTS (subr); thisarg; thisarg = TREE_CHAIN (thisarg))
{
if (DECL_RTL (thisarg))
abort (); /* Should be NULL here I think. */
else if (TREE_CONSTANT (DECL_SIZE (thisarg)))
{
DECL_RTL (thisarg) = bc_gen_rtx ((char *) 0, argsz, (struct bc_label *) 0);
argsz += TREE_INT_CST_LOW (DECL_SIZE (thisarg));
}
else
{
/* Variable-sized objects are pointers to their storage. */
DECL_RTL (thisarg) = bc_gen_rtx ((char *) 0, argsz, (struct bc_label *) 0);
argsz += POINTER_SIZE;
}
}
bc_begin_function (xstrdup (IDENTIFIER_POINTER (DECL_NAME (subr))));
ASM_GENERATE_INTERNAL_LABEL (label, "LX", nlab);
++nlab;
name = (char *) obstack_copy0 (&permanent_obstack, label, strlen (label));
this_function_callinfo = bc_gen_rtx (name, 0, (struct bc_label *) 0);
this_function_bytecode
= bc_emit_trampoline (BYTECODE_LABEL (this_function_callinfo));
}
/* Expand end of bytecode function. See details the comment of
expand_function_end(), below. */
void
bc_expand_function_end ()
{
char *ptrconsts;
expand_null_return ();
/* Emit any fixup code. This must be done before the call to
to BC_END_FUNCTION (), since that will cause the bytecode
segment to be finished off and closed. */
expand_fixups (NULL_RTX);
ptrconsts = bc_end_function ();
bc_align_const (2 /* INT_ALIGN */);
/* If this changes also make sure to change bc-interp.h! */
bc_emit_const_labeldef (BYTECODE_LABEL (this_function_callinfo));
bc_emit_const ((char *) &max_stack_depth, sizeof max_stack_depth);
bc_emit_const ((char *) &local_vars_size, sizeof local_vars_size);
bc_emit_const_labelref (this_function_bytecode, 0);
bc_emit_const_labelref (ptrconsts, 0);
bc_emit_const_labelref (BYTECODE_LABEL (this_function_calldesc), 0);
}
/* Start the RTL for a new function, and set variables used for
emitting RTL.
SUBR is the FUNCTION_DECL node.
......@@ -5479,12 +5327,6 @@ expand_function_start (subr, parms_have_cleanups)
tree tem;
rtx last_ptr;
if (output_bytecode)
{
bc_expand_function_start (subr, parms_have_cleanups);
return;
}
/* Make sure volatile mem refs aren't considered
valid operands of arithmetic insns. */
init_recog_no_volatile ();
......@@ -5719,12 +5561,6 @@ expand_function_end (filename, line, end_bindings)
static rtx initial_trampoline;
#endif
if (output_bytecode)
{
bc_expand_function_end ();
return;
}
#ifdef NON_SAVING_SETJMP
/* Don't put any variables in registers if we call setjmp
on a machine that fails to restore the registers. */
......
......@@ -35,7 +35,6 @@ Boston, MA 02111-1307, USA. */
#include "real.h"
#include "except.h"
#include "function.h"
#include "bytecode.h"
#include "obstack.h"
#define obstack_chunk_alloc xmalloc
......@@ -3273,12 +3272,6 @@ output_inline_function (fndecl)
rtx head;
rtx last;
if (output_bytecode)
{
warning ("`inline' ignored for bytecode output");
return;
}
/* Things we allocate from here on are part of this function, not
permanent. */
temporary_allocation ();
......
......@@ -56,20 +56,20 @@ extern void shorten_branches PROTO((rtx));
for the new function. The label for the function and associated
assembler pseudo-ops have already been output in
`assemble_start_function'. */
extern void final_start_function STDIO_PROTO((rtx, FILE *, int));
extern void final_start_function PROTO((rtx, FILE *, int));
/* Output assembler code for the end of a function.
For clarity, args are same as those of `final_start_function'
even though not all of them are needed. */
extern void final_end_function STDIO_PROTO((rtx, FILE *, int));
extern void final_end_function PROTO((rtx, FILE *, int));
/* Output assembler code for some insns: all or part of a function. */
extern void final STDIO_PROTO((rtx, FILE *, int, int));
extern void final PROTO((rtx, FILE *, int, int));
/* The final scan for one insn, INSN. Args are same as in `final', except
that INSN is the insn being scanned. Value returned is the next insn to
be scanned. */
extern rtx final_scan_insn STDIO_PROTO((rtx, FILE *, int, int, int));
extern rtx final_scan_insn PROTO((rtx, FILE *, int, int, int));
/* Replace a SUBREG with a REG or a MEM, based on the thing it is a
subreg of. */
......@@ -93,12 +93,11 @@ extern void output_address PROTO((rtx));
/* Print an integer constant expression in assembler syntax.
Addition and subtraction are the only arithmetic
that may appear in these expressions. */
extern void output_addr_const STDIO_PROTO((FILE *, rtx));
extern void output_addr_const PROTO((FILE *, rtx));
/* Output a string of assembler code, substituting numbers, strings
and fixed syntactic prefixes. */
extern void asm_fprintf STDIO_PROTO(PVPROTO((FILE *file,
char *p, ...)));
extern void asm_fprintf PROTO(PVPROTO((FILE *file, char *p, ...)));
/* Split up a CONST_DOUBLE or integer constant rtx into two rtx's for single
words. */
......@@ -119,8 +118,8 @@ extern void leaf_renumber_regs_insn PROTO((rtx));
extern void allocate_for_life_analysis PROTO((void));
extern int regno_uninitialized PROTO((int));
extern int regno_clobbered_at_setjmp PROTO((int));
extern void dump_flow_info STDIO_PROTO((FILE *));
extern void flow_analysis STDIO_PROTO((rtx, int, FILE *));
extern void dump_flow_info PROTO((FILE *));
extern void flow_analysis PROTO((rtx, int, FILE *));
#endif
/* Functions in varasm.c. */
......@@ -229,12 +228,6 @@ extern void assemble_string PROTO((char *, int));
initial value (that will be done by the caller). */
extern void assemble_variable PROTO((tree, int, int, int));
/* Output text storage for constructor CONSTR. */
extern void bc_output_constructor PROTO((tree, int));
/* Create storage for constructor CONSTR. */
extern void bc_output_data_constructor PROTO((tree));
/* Output something to declare an external symbol to the assembler.
(Most assemblers don't need this, so we normally output nothing.)
Do nothing if DECL is not external. */
......@@ -257,7 +250,7 @@ extern void assemble_label PROTO((char *));
Otherwise NAME is transformed in an implementation-defined way
(usually by the addition of an underscore).
Many macros in the tm file are defined to call this function. */
extern void assemble_name STDIO_PROTO((FILE *, char *));
extern void assemble_name PROTO((FILE *, char *));
#ifdef RTX_CODE
/* Assemble the integer constant X into an object of SIZE bytes.
......
......@@ -34,7 +34,6 @@ Boston, MA 02111-1307, USA. */
#include "recog.h"
#include "reload.h"
#include "real.h"
#include "bytecode.h"
#ifndef REGISTER_MOVE_COST
#define REGISTER_MOVE_COST(x, y) 2
......@@ -424,8 +423,7 @@ init_regs ()
{
/* This finishes what was started by init_reg_sets, but couldn't be done
until after register usage was specified. */
if (!output_bytecode)
init_reg_sets_1 ();
init_reg_sets_1 ();
init_reg_modes ();
}
......@@ -483,13 +481,6 @@ fix_register (name, fixed, call_used)
{
int i;
if (output_bytecode)
{
warning ("request to mark `%s' as %s ignored by bytecode compiler",
name, call_used ? "call-used" : "fixed");
return;
}
/* Decode the name and update the primary form of
the register info. */
......
......@@ -439,17 +439,6 @@ extern char *note_insn_name[];
of LABEL_REFs that point at it, so unused labels can be deleted. */
#define LABEL_NUSES(LABEL) ((LABEL)->fld[5].rtint)
/* The rest is used instead of the above, in a CODE_LABEL,
if bytecode is being output.
We make the slightly kludgy assumption that a LABEL has enough slots
to hold these things. That happens to be true. */
/* For static or external objects. */
#define BYTECODE_LABEL(X) (XSTR ((X), 0))
/* For goto labels inside bytecode functions. */
#define BYTECODE_BC_LABEL(X) (*(struct bc_label **) &XEXP ((X), 1))
/* The original regno this ADDRESSOF was built for. */
#define ADDRESSOF_REGNO(RTX) ((RTX)->fld[1].rtint)
......@@ -681,10 +670,6 @@ extern int ceil_log2 PROTO((unsigned HOST_WIDE_INT));
extern rtx plus_constant_wide PROTO((rtx, HOST_WIDE_INT));
extern rtx plus_constant_for_output_wide PROTO((rtx, HOST_WIDE_INT));
struct bc_label;
extern rtx bc_gen_rtx PROTO ((char *, int,
struct bc_label *));
extern rtx gen_rtx PVPROTO((enum rtx_code,
enum machine_mode, ...));
extern rtvec gen_rtvec PVPROTO((int, ...));
......@@ -1254,7 +1239,6 @@ extern void emit_jump PROTO ((rtx));
extern int preserve_subexpressions_p PROTO ((void));
/* In expr.c */
extern rtx bc_allocate_local PROTO ((int, int));
extern void init_expr_once PROTO ((void));
/* In stupid.c */
......
......@@ -72,8 +72,6 @@ Boston, MA 02111-1307, USA. */
#include "insn-attr.h"
#include "defaults.h"
#include "output.h"
#include "bytecode.h"
#include "bc-emit.h"
#include "except.h"
#ifdef XCOFF_DEBUGGING_INFO
......@@ -306,9 +304,6 @@ int errorcount = 0;
int warningcount = 0;
int sorrycount = 0;
/* Flag to output bytecode instead of native assembler */
int output_bytecode = 0;
/* Pointer to function to compute the name to use to print a declaration.
DECL is the declaration in question.
VERBOSITY determines what information will be printed:
......@@ -751,7 +746,6 @@ struct { char *string; int *variable; int on_value;} f_options[] =
{"regmove", &flag_regmove, 1},
{"pack-struct", &flag_pack_struct, 1},
{"stack-check", &flag_stack_check, 1},
{"bytecode", &output_bytecode, 1},
{"argument-alias", &flag_argument_noalias, 0},
{"argument-noalias", &flag_argument_noalias, 1},
{"argument-noalias-global", &flag_argument_noalias, 2},
......@@ -1111,11 +1105,8 @@ fatal_insn (message, insn)
char *message;
rtx insn;
{
if (!output_bytecode)
{
error (message);
debug_rtx (insn);
}
error (message);
debug_rtx (insn);
if (asm_out_file)
fflush (asm_out_file);
if (aux_info_file)
......@@ -2262,8 +2253,6 @@ compile_file (name)
#else
init_lex ();
#endif
/* Some of these really don't need to be called when generating bytecode,
but the options would have to be parsed first to know that. -bson */
init_rtl ();
init_emit_once (debug_info_level == DINFO_LEVEL_NORMAL
|| debug_info_level == DINFO_LEVEL_VERBOSE
......@@ -2431,36 +2420,27 @@ compile_file (name)
if (main_input_filename == 0)
main_input_filename = name;
if (!output_bytecode)
{
ASM_FILE_START (asm_out_file);
ASM_FILE_START (asm_out_file);
#ifdef ASM_COMMENT_START
if (flag_verbose_asm)
{
/* Print the list of options in effect. */
print_version (asm_out_file, ASM_COMMENT_START);
print_switch_values (asm_out_file, 0, MAX_LINE,
if (flag_verbose_asm)
{
/* Print the list of options in effect. */
print_version (asm_out_file, ASM_COMMENT_START);
print_switch_values (asm_out_file, 0, MAX_LINE,
ASM_COMMENT_START, " ", "\n");
/* Add a blank line here so it appears in assembler output but not
screen output. */
fprintf (asm_out_file, "\n");
}
#endif
/* Add a blank line here so it appears in assembler output but not
screen output. */
fprintf (asm_out_file, "\n");
}
#endif
/* Output something to inform GDB that this compilation was by GCC. Also
serves to tell GDB file consists of bytecodes. */
if (output_bytecode)
fprintf (asm_out_file, "bc_gcc2_compiled.:\n");
else
{
/* Output something to inform GDB that this compilation was by GCC. */
#ifndef ASM_IDENTIFY_GCC
fprintf (asm_out_file, "gcc2_compiled.:\n");
fprintf (asm_out_file, "gcc2_compiled.:\n");
#else
ASM_IDENTIFY_GCC (asm_out_file);
ASM_IDENTIFY_GCC (asm_out_file);
#endif
}
/* Output something to identify which front-end produced this file. */
#ifdef ASM_IDENTIFY_LANGUAGE
......@@ -2485,28 +2465,20 @@ compile_file (name)
if (flag_function_sections && write_symbols != NO_DEBUG)
warning ("-ffunction-sections may affect debugging on some targets.");
if (output_bytecode)
{
if (profile_flag || profile_block_flag)
error ("profiling not supported in bytecode compilation");
}
else
{
/* ??? Note: There used to be a conditional here
to call assemble_zeros without fail if DBX_DEBUGGING_INFO is defined.
This was to guarantee separation between gcc_compiled. and
the first function, for the sake of dbx on Suns.
However, having the extra zero here confused the Emacs
code for unexec, and might confuse other programs too.
Therefore, I took out that change.
In future versions we should find another way to solve
that dbx problem. -- rms, 23 May 93. */
/* ??? Note: There used to be a conditional here
to call assemble_zeros without fail if DBX_DEBUGGING_INFO is defined.
This was to guarantee separation between gcc_compiled. and
the first function, for the sake of dbx on Suns.
However, having the extra zero here confused the Emacs
code for unexec, and might confuse other programs too.
Therefore, I took out that change.
In future versions we should find another way to solve
that dbx problem. -- rms, 23 May 93. */
/* Don't let the first function fall at the same address
as gcc_compiled., if profiling. */
if (profile_flag || profile_block_flag)
assemble_zeros (UNITS_PER_WORD);
}
/* Don't let the first function fall at the same address
as gcc_compiled., if profiling. */
if (profile_flag || profile_block_flag)
assemble_zeros (UNITS_PER_WORD);
/* If dbx symbol table desired, initialize writing it
and output the predefined types. */
......@@ -2535,8 +2507,7 @@ compile_file (name)
/* Initialize yet another pass. */
if (!output_bytecode)
init_final (main_input_filename);
init_final (main_input_filename);
init_branch_prob (dump_base_name);
start_time = get_run_time ();
......@@ -2792,23 +2763,17 @@ compile_file (name)
/* Output some stuff at end of file if nec. */
if (!output_bytecode)
{
end_final (dump_base_name);
end_branch_prob (branch_prob_dump_file);
end_final (dump_base_name);
end_branch_prob (branch_prob_dump_file);
#ifdef ASM_FILE_END
ASM_FILE_END (asm_out_file);
ASM_FILE_END (asm_out_file);
#endif
}
/* Language-specific end of compilation actions. */
lang_finish ();
if (output_bytecode)
bc_write_file (asm_out_file);
/* Close the dump files. */
if (flag_gen_aux_info)
......@@ -2893,29 +2858,26 @@ compile_file (name)
fprintf (stderr,"\n");
print_time ("parse", parse_time);
if (!output_bytecode)
{
print_time ("integration", integration_time);
print_time ("jump", jump_time);
print_time ("cse", cse_time);
print_time ("loop", loop_time);
print_time ("cse2", cse2_time);
print_time ("branch-prob", branch_prob_time);
print_time ("flow", flow_time);
print_time ("combine", combine_time);
print_time ("regmove", regmove_time);
print_time ("sched", sched_time);
print_time ("local-alloc", local_alloc_time);
print_time ("global-alloc", global_alloc_time);
print_time ("sched2", sched2_time);
print_time ("dbranch", dbr_sched_time);
print_time ("shorten-branch", shorten_branch_time);
print_time ("stack-reg", stack_reg_time);
print_time ("final", final_time);
print_time ("varconst", varconst_time);
print_time ("symout", symout_time);
print_time ("dump", dump_time);
}
print_time ("integration", integration_time);
print_time ("jump", jump_time);
print_time ("cse", cse_time);
print_time ("loop", loop_time);
print_time ("cse2", cse2_time);
print_time ("branch-prob", branch_prob_time);
print_time ("flow", flow_time);
print_time ("combine", combine_time);
print_time ("regmove", regmove_time);
print_time ("sched", sched_time);
print_time ("local-alloc", local_alloc_time);
print_time ("global-alloc", global_alloc_time);
print_time ("sched2", sched2_time);
print_time ("dbranch", dbr_sched_time);
print_time ("shorten-branch", shorten_branch_time);
print_time ("stack-reg", stack_reg_time);
print_time ("final", final_time);
print_time ("varconst", varconst_time);
print_time ("symout", symout_time);
print_time ("dump", dump_time);
}
}
......@@ -2966,8 +2928,7 @@ rest_of_decl_compilation (decl, asmspec, top_level, at_end)
&& (DECL_INITIAL (decl) == 0
|| DECL_INITIAL (decl) == error_mark_node)))
assemble_variable (decl, top_level, at_end, 0);
if (!output_bytecode
&& decl == last_assemble_variable_decl)
if (decl == last_assemble_variable_decl)
{
ASM_FINISH_DECLARE_OBJECT (asm_out_file, decl,
top_level, at_end);
......@@ -3033,9 +2994,6 @@ rest_of_compilation (decl)
tree saved_arguments = 0;
int failure = 0;
if (output_bytecode)
return;
/* If we are reconsidering an inline function
at the end of compilation, skip the stuff for making it inline. */
......@@ -4392,18 +4350,6 @@ main (argc, argv, envp)
if (flag_check_memory_usage)
flag_omit_frame_pointer = 0;
/* Initialize for bytecode output. A good idea to do this as soon as
possible after the "-f" options have been parsed. */
if (output_bytecode)
{
#ifndef TARGET_SUPPORTS_BYTECODE
/* Just die with a fatal error if not supported */
fatal ("-fbytecode not supported for this target");
#else
bc_initialize ();
#endif
}
if (optimize == 0)
{
/* Inlining does not work if not optimizing,
......
......@@ -1964,8 +1964,6 @@ extern tree reorder_blocks PROTO ((tree *, tree,
extern void free_temps_for_rtl_expr PROTO ((tree));
extern void instantiate_virtual_regs PROTO ((tree, struct rtx_def *));
extern int max_parm_reg_num PROTO ((void));
extern void bc_expand_function_start PROTO ((tree, int));
extern void bc_expand_function_end PROTO ((void));
extern void push_function_context PROTO ((void));
extern void pop_function_context PROTO ((void));
extern void push_function_context_to PROTO ((tree));
......@@ -1987,8 +1985,6 @@ extern void indent_to PROTO ((FILE *, int));
/* In expr.c */
extern void emit_queue PROTO ((void));
extern int apply_args_register_offset PROTO ((int));
extern char * bc_gen_constr_label PROTO ((void));
extern struct rtx_def *bc_allocate_variable_array PROTO ((tree));
extern struct rtx_def *expand_builtin_return_addr
PROTO ((enum built_in_function, int, struct rtx_def *));
extern void do_pending_stack_adjust PROTO ((void));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment