dummy commit before merge
From-SVN: r18980
This commit is contained in:
parent
732dcb6f2a
commit
31031eddac
@ -20,7 +20,7 @@ IF YOU THINK YOU MIGHT COMPILE X FOR SOLARIS 2, then you really don't
|
||||
need this patch: get /contrib/R5.SunOS5.patch.tar.Z from
|
||||
export.lcs.mit.edu instead. It has everything you need to do the
|
||||
build for Solaris 2, sets you up to everything with GCC, and is
|
||||
backward compatible with Sunos 4.*. Get the the README
|
||||
backward compatible with SunOS 4.*. Get the the README
|
||||
(/contrib/R5.SunOS5.patch.README at export) for more info.
|
||||
|
||||
If you see undefined symbols _dlopen, _dlsym, or _dlclose when linking
|
||||
|
11
gcc/c-tree.h
11
gcc/c-tree.h
@ -177,7 +177,7 @@ extern tree convert_and_check PROTO((tree, tree));
|
||||
extern void overflow_warning PROTO((tree));
|
||||
extern void unsigned_conversion_warning PROTO((tree, tree));
|
||||
/* Read the rest of the current #-directive line. */
|
||||
extern char *get_directive_line STDIO_PROTO((FILE *));
|
||||
extern char *get_directive_line PROTO((FILE *));
|
||||
/* Subroutine of build_binary_op, used for comparison operations.
|
||||
See if the operands have both been converted from subword integer types
|
||||
and, if so, perhaps change them both back to their original type. */
|
||||
@ -288,12 +288,9 @@ extern void pending_xref_error PROTO((void));
|
||||
extern void pop_c_function_context PROTO((void));
|
||||
extern void pop_label_level PROTO((void));
|
||||
extern tree poplevel PROTO((int, int, int));
|
||||
extern void print_lang_decl STDIO_PROTO((FILE *, tree,
|
||||
int));
|
||||
extern void print_lang_identifier STDIO_PROTO((FILE *, tree,
|
||||
int));
|
||||
extern void print_lang_type STDIO_PROTO((FILE *, tree,
|
||||
int));
|
||||
extern void print_lang_decl PROTO((FILE *, tree, int));
|
||||
extern void print_lang_identifier PROTO((FILE *, tree, int));
|
||||
extern void print_lang_type PROTO((FILE *, tree, int));
|
||||
extern void push_c_function_context PROTO((void));
|
||||
extern void push_label_level PROTO((void));
|
||||
extern void push_parm_decl PROTO((tree));
|
||||
|
170
gcc/cexp.y
170
gcc/cexp.y
@ -29,29 +29,19 @@ Boston, MA 02111-1307, USA.
|
||||
#include <setjmp.h>
|
||||
/* #define YYDEBUG 1 */
|
||||
|
||||
/* The following symbols should be autoconfigured:
|
||||
HAVE_STDLIB_H
|
||||
STDC_HEADERS
|
||||
In the mean time, we'll get by with approximations based
|
||||
on existing GCC configuration symbols. */
|
||||
|
||||
#ifdef POSIX
|
||||
# ifndef HAVE_STDLIB_H
|
||||
# define HAVE_STDLIB_H 1
|
||||
# endif
|
||||
# ifndef STDC_HEADERS
|
||||
# define STDC_HEADERS 1
|
||||
# endif
|
||||
#endif /* defined (POSIX) */
|
||||
|
||||
#if STDC_HEADERS
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_STDLIB_H || defined (MULTIBYTE_CHARS)
|
||||
#ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
# include <limits.h>
|
||||
#endif
|
||||
|
||||
#ifdef MULTIBYTE_CHARS
|
||||
#include <locale.h>
|
||||
#endif
|
||||
@ -87,18 +77,36 @@ struct arglist {
|
||||
#endif
|
||||
|
||||
/* Find the largest host integer type and set its size and type.
|
||||
Don't blindly use `long'; on some crazy hosts it is shorter than `int'. */
|
||||
Watch out: on some crazy hosts `long' is shorter than `int'. */
|
||||
|
||||
#ifndef HOST_BITS_PER_WIDE_INT
|
||||
|
||||
#if HOST_BITS_PER_LONG > HOST_BITS_PER_INT
|
||||
#define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG
|
||||
#define HOST_WIDE_INT long
|
||||
#else
|
||||
#define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_INT
|
||||
#define HOST_WIDE_INT int
|
||||
#ifndef HOST_WIDE_INT
|
||||
# if HAVE_INTTYPES_H
|
||||
# include <inttypes.h>
|
||||
# define HOST_WIDE_INT intmax_t
|
||||
# define unsigned_HOST_WIDE_INT uintmax_t
|
||||
# else
|
||||
# if (HOST_BITS_PER_LONG <= HOST_BITS_PER_INT && HOST_BITS_PER_LONGLONG <= HOST_BITS_PER_INT)
|
||||
# define HOST_WIDE_INT int
|
||||
# else
|
||||
# if (HOST_BITS_PER_LONGLONG <= HOST_BITS_PER_LONG || ! (defined LONG_LONG_MAX || defined LLONG_MAX))
|
||||
# define HOST_WIDE_INT long
|
||||
# else
|
||||
# define HOST_WIDE_INT long long
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef unsigned_HOST_WIDE_INT
|
||||
#define unsigned_HOST_WIDE_INT unsigned HOST_WIDE_INT
|
||||
#endif
|
||||
|
||||
#ifndef CHAR_BIT
|
||||
#define CHAR_BIT 8
|
||||
#endif
|
||||
|
||||
#ifndef HOST_BITS_PER_WIDE_INT
|
||||
#define HOST_BITS_PER_WIDE_INT (CHAR_BIT * sizeof (HOST_WIDE_INT))
|
||||
#endif
|
||||
|
||||
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
|
||||
@ -137,11 +145,14 @@ struct arglist {
|
||||
|
||||
#define PRINTF_PROTO_1(ARGS) PRINTF_PROTO(ARGS, 1, 2)
|
||||
|
||||
HOST_WIDE_INT parse_c_expression PROTO((char *));
|
||||
HOST_WIDE_INT parse_c_expression PROTO((char *, int));
|
||||
|
||||
static int yylex PROTO((void));
|
||||
static void yyerror PROTO((char *)) __attribute__ ((noreturn));
|
||||
static HOST_WIDE_INT expression_value;
|
||||
#ifdef TEST_EXP_READER
|
||||
static int expression_signedp;
|
||||
#endif
|
||||
|
||||
static jmp_buf parse_return_error;
|
||||
|
||||
@ -152,6 +163,9 @@ static int keyword_parsing = 0;
|
||||
This is a count, since unevaluated expressions can nest. */
|
||||
static int skip_evaluation;
|
||||
|
||||
/* Nonzero means warn if undefined identifiers are evaluated. */
|
||||
static int warn_undef;
|
||||
|
||||
/* some external tables of character types */
|
||||
extern unsigned char is_idstart[], is_idchar[], is_space[];
|
||||
|
||||
@ -164,9 +178,6 @@ extern int traditional;
|
||||
/* Flag for -lang-c89. */
|
||||
extern int c89;
|
||||
|
||||
/* Flag for -Wundef. */
|
||||
extern int warn_undef;
|
||||
|
||||
#ifndef CHAR_TYPE_SIZE
|
||||
#define CHAR_TYPE_SIZE BITS_PER_UNIT
|
||||
#endif
|
||||
@ -199,17 +210,13 @@ extern int warn_undef;
|
||||
#define MAX_WCHAR_TYPE_SIZE WCHAR_TYPE_SIZE
|
||||
#endif
|
||||
|
||||
#if MAX_CHAR_TYPE_SIZE < HOST_BITS_PER_WIDE_INT
|
||||
#define MAX_CHAR_TYPE_MASK (~ (~ (HOST_WIDE_INT) 0 << MAX_CHAR_TYPE_SIZE))
|
||||
#else
|
||||
#define MAX_CHAR_TYPE_MASK (~ (HOST_WIDE_INT) 0)
|
||||
#endif
|
||||
#define MAX_CHAR_TYPE_MASK (MAX_CHAR_TYPE_SIZE < HOST_BITS_PER_WIDE_INT \
|
||||
? (~ (~ (HOST_WIDE_INT) 0 << MAX_CHAR_TYPE_SIZE)) \
|
||||
: ~ (HOST_WIDE_INT) 0)
|
||||
|
||||
#if MAX_WCHAR_TYPE_SIZE < HOST_BITS_PER_WIDE_INT
|
||||
#define MAX_WCHAR_TYPE_MASK (~ (~ (HOST_WIDE_INT) 0 << MAX_WCHAR_TYPE_SIZE))
|
||||
#else
|
||||
#define MAX_WCHAR_TYPE_MASK (~ (HOST_WIDE_INT) 0)
|
||||
#endif
|
||||
#define MAX_WCHAR_TYPE_MASK (MAX_WCHAR_TYPE_SIZE < HOST_BITS_PER_WIDE_INT \
|
||||
? ~ (~ (HOST_WIDE_INT) 0 << MAX_WCHAR_TYPE_SIZE) \
|
||||
: ~ (HOST_WIDE_INT) 0)
|
||||
|
||||
/* Suppose A1 + B1 = SUM1, using 2's complement arithmetic ignoring overflow.
|
||||
Suppose A, B and SUM have the same respective signs as A1, B1, and SUM1.
|
||||
@ -232,8 +239,8 @@ void pedwarn PRINTF_PROTO_1((char *, ...));
|
||||
void warning PRINTF_PROTO_1((char *, ...));
|
||||
|
||||
static int parse_number PROTO((int));
|
||||
static HOST_WIDE_INT left_shift PROTO((struct constant *, unsigned HOST_WIDE_INT));
|
||||
static HOST_WIDE_INT right_shift PROTO((struct constant *, unsigned HOST_WIDE_INT));
|
||||
static HOST_WIDE_INT left_shift PROTO((struct constant *, unsigned_HOST_WIDE_INT));
|
||||
static HOST_WIDE_INT right_shift PROTO((struct constant *, unsigned_HOST_WIDE_INT));
|
||||
static void integer_overflow PROTO((void));
|
||||
|
||||
/* `signedp' values */
|
||||
@ -272,7 +279,12 @@ static void integer_overflow PROTO((void));
|
||||
%%
|
||||
|
||||
start : exp1
|
||||
{ expression_value = $1.value; }
|
||||
{
|
||||
expression_value = $1.value;
|
||||
#ifdef TEST_EXP_READER
|
||||
expression_signedp = $1.signedp;
|
||||
#endif
|
||||
}
|
||||
;
|
||||
|
||||
/* Expressions, including the comma operator. */
|
||||
@ -324,7 +336,7 @@ exp : exp '*' exp
|
||||
integer_overflow ();
|
||||
}
|
||||
else
|
||||
$$.value = ((unsigned HOST_WIDE_INT) $1.value
|
||||
$$.value = ((unsigned_HOST_WIDE_INT) $1.value
|
||||
* $3.value); }
|
||||
| exp '/' exp
|
||||
{ if ($3.value == 0)
|
||||
@ -341,7 +353,7 @@ exp : exp '*' exp
|
||||
integer_overflow ();
|
||||
}
|
||||
else
|
||||
$$.value = ((unsigned HOST_WIDE_INT) $1.value
|
||||
$$.value = ((unsigned_HOST_WIDE_INT) $1.value
|
||||
/ $3.value); }
|
||||
| exp '%' exp
|
||||
{ if ($3.value == 0)
|
||||
@ -354,7 +366,7 @@ exp : exp '*' exp
|
||||
if ($$.signedp)
|
||||
$$.value = $1.value % $3.value;
|
||||
else
|
||||
$$.value = ((unsigned HOST_WIDE_INT) $1.value
|
||||
$$.value = ((unsigned_HOST_WIDE_INT) $1.value
|
||||
% $3.value); }
|
||||
| exp '+' exp
|
||||
{ $$.value = $1.value + $3.value;
|
||||
@ -391,28 +403,28 @@ exp : exp '*' exp
|
||||
if ($1.signedp & $3.signedp)
|
||||
$$.value = $1.value <= $3.value;
|
||||
else
|
||||
$$.value = ((unsigned HOST_WIDE_INT) $1.value
|
||||
$$.value = ((unsigned_HOST_WIDE_INT) $1.value
|
||||
<= $3.value); }
|
||||
| exp GEQ exp
|
||||
{ $$.signedp = SIGNED;
|
||||
if ($1.signedp & $3.signedp)
|
||||
$$.value = $1.value >= $3.value;
|
||||
else
|
||||
$$.value = ((unsigned HOST_WIDE_INT) $1.value
|
||||
$$.value = ((unsigned_HOST_WIDE_INT) $1.value
|
||||
>= $3.value); }
|
||||
| exp '<' exp
|
||||
{ $$.signedp = SIGNED;
|
||||
if ($1.signedp & $3.signedp)
|
||||
$$.value = $1.value < $3.value;
|
||||
else
|
||||
$$.value = ((unsigned HOST_WIDE_INT) $1.value
|
||||
$$.value = ((unsigned_HOST_WIDE_INT) $1.value
|
||||
< $3.value); }
|
||||
| exp '>' exp
|
||||
{ $$.signedp = SIGNED;
|
||||
if ($1.signedp & $3.signedp)
|
||||
$$.value = $1.value > $3.value;
|
||||
else
|
||||
$$.value = ((unsigned HOST_WIDE_INT) $1.value
|
||||
$$.value = ((unsigned_HOST_WIDE_INT) $1.value
|
||||
> $3.value); }
|
||||
| exp '&' exp
|
||||
{ $$.value = $1.value & $3.value;
|
||||
@ -495,7 +507,7 @@ parse_number (olen)
|
||||
{
|
||||
register char *p = lexptr;
|
||||
register int c;
|
||||
register unsigned HOST_WIDE_INT n = 0, nd, max_over_base;
|
||||
register unsigned_HOST_WIDE_INT n = 0, nd, max_over_base;
|
||||
register int base = 10;
|
||||
register int len = olen;
|
||||
register int overflow = 0;
|
||||
@ -513,7 +525,7 @@ parse_number (olen)
|
||||
}
|
||||
}
|
||||
|
||||
max_over_base = (unsigned HOST_WIDE_INT) -1 / base;
|
||||
max_over_base = (unsigned_HOST_WIDE_INT) -1 / base;
|
||||
|
||||
for (; len > 0; len--) {
|
||||
c = *p++;
|
||||
@ -684,7 +696,7 @@ yylex ()
|
||||
It is mostly copied from c-lex.c. */
|
||||
{
|
||||
register HOST_WIDE_INT result = 0;
|
||||
register num_chars = 0;
|
||||
register int num_chars = 0;
|
||||
unsigned width = MAX_CHAR_TYPE_SIZE;
|
||||
int max_chars;
|
||||
char *token_buffer;
|
||||
@ -751,11 +763,11 @@ yylex ()
|
||||
sizeof ("__CHAR_UNSIGNED__") - 1, -1)
|
||||
|| ((result >> (num_bits - 1)) & 1) == 0)
|
||||
yylval.integer.value
|
||||
= result & (~ (unsigned HOST_WIDE_INT) 0
|
||||
= result & (~ (unsigned_HOST_WIDE_INT) 0
|
||||
>> (HOST_BITS_PER_WIDE_INT - num_bits));
|
||||
else
|
||||
yylval.integer.value
|
||||
= result | ~(~ (unsigned HOST_WIDE_INT) 0
|
||||
= result | ~(~ (unsigned_HOST_WIDE_INT) 0
|
||||
>> (HOST_BITS_PER_WIDE_INT - num_bits));
|
||||
}
|
||||
else
|
||||
@ -962,7 +974,7 @@ parse_escape (string_ptr, result_mask)
|
||||
}
|
||||
case 'x':
|
||||
{
|
||||
register unsigned HOST_WIDE_INT i = 0, overflow = 0;
|
||||
register unsigned_HOST_WIDE_INT i = 0, overflow = 0;
|
||||
register int digits_found = 0, digit;
|
||||
for (;;)
|
||||
{
|
||||
@ -1015,7 +1027,7 @@ integer_overflow ()
|
||||
static HOST_WIDE_INT
|
||||
left_shift (a, b)
|
||||
struct constant *a;
|
||||
unsigned HOST_WIDE_INT b;
|
||||
unsigned_HOST_WIDE_INT b;
|
||||
{
|
||||
/* It's unclear from the C standard whether shifts can overflow.
|
||||
The following code ignores overflow; perhaps a C standard
|
||||
@ -1023,36 +1035,39 @@ left_shift (a, b)
|
||||
if (b >= HOST_BITS_PER_WIDE_INT)
|
||||
return 0;
|
||||
else
|
||||
return (unsigned HOST_WIDE_INT) a->value << b;
|
||||
return (unsigned_HOST_WIDE_INT) a->value << b;
|
||||
}
|
||||
|
||||
static HOST_WIDE_INT
|
||||
right_shift (a, b)
|
||||
struct constant *a;
|
||||
unsigned HOST_WIDE_INT b;
|
||||
unsigned_HOST_WIDE_INT b;
|
||||
{
|
||||
if (b >= HOST_BITS_PER_WIDE_INT)
|
||||
return a->signedp ? a->value >> (HOST_BITS_PER_WIDE_INT - 1) : 0;
|
||||
else if (a->signedp)
|
||||
return a->value >> b;
|
||||
else
|
||||
return (unsigned HOST_WIDE_INT) a->value >> b;
|
||||
return (unsigned_HOST_WIDE_INT) a->value >> b;
|
||||
}
|
||||
|
||||
/* This page contains the entry point to this file. */
|
||||
|
||||
/* Parse STRING as an expression, and complain if this fails
|
||||
to use up all of the contents of STRING. */
|
||||
/* STRING may contain '\0' bytes; it is terminated by the first '\n'
|
||||
outside a string constant, so that we can diagnose '\0' properly. */
|
||||
/* We do not support C comments. They should be removed before
|
||||
to use up all of the contents of STRING.
|
||||
STRING may contain '\0' bytes; it is terminated by the first '\n'
|
||||
outside a string constant, so that we can diagnose '\0' properly.
|
||||
If WARN_UNDEFINED is nonzero, warn if undefined identifiers are evaluated.
|
||||
We do not support C comments. They should be removed before
|
||||
this function is called. */
|
||||
|
||||
HOST_WIDE_INT
|
||||
parse_c_expression (string)
|
||||
parse_c_expression (string, warn_undefined)
|
||||
char *string;
|
||||
int warn_undefined;
|
||||
{
|
||||
lexptr = string;
|
||||
warn_undef = warn_undefined;
|
||||
|
||||
/* if there is some sort of scanning error, just return 0 and assume
|
||||
the parsing routine has printed an error message somewhere.
|
||||
@ -1080,6 +1095,7 @@ int traditional;
|
||||
|
||||
int main PROTO((int, char **));
|
||||
static void initialize_random_junk PROTO((void));
|
||||
static void print_unsigned_host_wide_int PROTO((unsigned_HOST_WIDE_INT));
|
||||
|
||||
/* Main program for testing purposes. */
|
||||
int
|
||||
@ -1089,6 +1105,7 @@ main (argc, argv)
|
||||
{
|
||||
int n, c;
|
||||
char buf[1024];
|
||||
unsigned_HOST_WIDE_INT u;
|
||||
|
||||
pedantic = 1 < argc;
|
||||
traditional = 2 < argc;
|
||||
@ -1104,12 +1121,35 @@ main (argc, argv)
|
||||
n++;
|
||||
if (c == EOF)
|
||||
break;
|
||||
printf ("parser returned %ld\n", (long) parse_c_expression (buf));
|
||||
parse_c_expression (buf, 1);
|
||||
printf ("parser returned ");
|
||||
u = (unsigned_HOST_WIDE_INT) expression_value;
|
||||
if (expression_value < 0 && expression_signedp) {
|
||||
u = -u;
|
||||
printf ("-");
|
||||
}
|
||||
if (u == 0)
|
||||
printf ("0");
|
||||
else
|
||||
print_unsigned_host_wide_int (u);
|
||||
if (! expression_signedp)
|
||||
printf("u");
|
||||
printf ("\n");
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
print_unsigned_host_wide_int (u)
|
||||
unsigned_HOST_WIDE_INT u;
|
||||
{
|
||||
if (u) {
|
||||
print_unsigned_host_wide_int (u / 10);
|
||||
putchar ('0' + (int) (u % 10));
|
||||
}
|
||||
}
|
||||
|
||||
/* table to tell if char can be part of a C identifier. */
|
||||
unsigned char is_idchar[256];
|
||||
/* table to tell if char can be first char of a c identifier. */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Utility routines for data type conversion for GNU C.
|
||||
Copyright (C) 1987, 88, 91, 92, 94, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987, 88, 91, 92, 94, 95, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU C.
|
||||
|
||||
@ -397,7 +397,10 @@ convert_to_integer (type, expr)
|
||||
convert (type, TREE_OPERAND (expr, 2))));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return build1 (NOP_EXPR, type, expr);
|
||||
|
23
gcc/cpp.texi
23
gcc/cpp.texi
@ -881,6 +881,14 @@ This macro expands to the constant 1, to signify that this is ANSI
|
||||
Standard C@. (Whether that is actually true depends on what C compiler
|
||||
will operate on the output from the preprocessor.)
|
||||
|
||||
On some hosts, system include files use a different convention, where
|
||||
@samp{__STDC__} is normally 0, but is 1 if the user specifies strict
|
||||
conformance to the C Standard. The preprocessor follows the host convention
|
||||
when processing system include files, but when processing user files it follows
|
||||
the usual GNU C convention.
|
||||
|
||||
This macro is not defined if the @samp{-traditional} option is used.
|
||||
|
||||
@item __STDC_VERSION__
|
||||
@findex __STDC_VERSION__
|
||||
This macro expands to the C Standard's version number,
|
||||
@ -891,6 +899,8 @@ Like @samp{__STDC__}, whether this version number is accurate
|
||||
for the entire implementation depends on what C compiler
|
||||
will operate on the output from the preprocessor.
|
||||
|
||||
This macro is not defined if the @samp{-traditional} option is used.
|
||||
|
||||
@item __GNUC__
|
||||
@findex __GNUC__
|
||||
This macro is defined if and only if this is GNU C@. This macro is
|
||||
@ -2679,6 +2689,15 @@ Do not search for header files in the C++-specific standard directories,
|
||||
but do still search the other standard directories.
|
||||
(This option is used when building libg++.)
|
||||
|
||||
@item -remap
|
||||
@findex -remap
|
||||
When searching for a header file in a directory, remap file names if a
|
||||
file named @file{header.gcc} exists in that directory. This can be used
|
||||
to work around limitations of file systems with file name restrictions.
|
||||
The @file{header.gcc} file should contain a series of lines with two
|
||||
tokens on each line: the first token is the name to map, and the second
|
||||
token is the actual name to use.
|
||||
|
||||
@item -D @var{name}
|
||||
@findex -D
|
||||
Predefine @var{name} as a macro, with definition @samp{1}.
|
||||
@ -2733,6 +2752,10 @@ predefined macros, and it outputs @emph{both} the @samp{#define}
|
||||
directives and the result of preprocessing. Both kinds of output go to
|
||||
the standard output file.
|
||||
|
||||
@item -dI
|
||||
@findex -dI
|
||||
Output @samp{#include} directives in addition to the result of preprocessing.
|
||||
|
||||
@item -M [-MG]
|
||||
@findex -M
|
||||
Instead of outputting the result of preprocessing, output a rule
|
||||
|
14
gcc/cpplib.h
14
gcc/cpplib.h
@ -69,7 +69,7 @@ enum cpp_token {
|
||||
};
|
||||
|
||||
#ifndef PARAMS
|
||||
#ifdef __STDC
|
||||
#ifdef __STDC__
|
||||
#define PARAMS(P) P
|
||||
#else
|
||||
#define PARAMS(P) ()
|
||||
@ -94,7 +94,7 @@ extern void parse_goto_mark PARAMS((struct parse_marker *, cpp_reader *));
|
||||
extern void parse_move_mark PARAMS((struct parse_marker *, cpp_reader *));
|
||||
|
||||
extern int cpp_handle_options PARAMS ((cpp_reader *, int, char **));
|
||||
extern enum cpp_token cpp_get_token PARAMS ((struct parse_marker *));
|
||||
extern enum cpp_token cpp_get_token PARAMS ((cpp_reader *));
|
||||
extern void cpp_skip_hspace PARAMS((cpp_reader *));
|
||||
extern enum cpp_token cpp_get_non_space_token PARAMS ((cpp_reader *));
|
||||
|
||||
@ -179,7 +179,7 @@ struct cpp_reader {
|
||||
|
||||
/* A buffer used for both for cpp_get_token's output, and also internally. */
|
||||
unsigned char *token_buffer;
|
||||
/* Alocated size of token_buffer. CPP_RESERVE allocates space. */
|
||||
/* Allocated size of token_buffer. CPP_RESERVE allocates space. */
|
||||
int token_buffer_size;
|
||||
/* End of the written part of token_buffer. */
|
||||
unsigned char *limit;
|
||||
@ -410,6 +410,10 @@ struct cpp_options {
|
||||
|
||||
char no_output;
|
||||
|
||||
/* Nonzero means we should look for header.gcc files that remap file
|
||||
names. */
|
||||
char remap;
|
||||
|
||||
/* Nonzero means don't output line number information. */
|
||||
|
||||
char no_line_commands;
|
||||
@ -486,6 +490,10 @@ struct cpp_options {
|
||||
where they are defined. */
|
||||
int debug_output;
|
||||
|
||||
/* Nonzero means pass #include lines through to the output,
|
||||
even if they are ifdefed out. */
|
||||
int dump_includes;
|
||||
|
||||
/* Pending -D, -U and -A options, in reverse order. */
|
||||
struct cpp_pending *pending;
|
||||
|
||||
|
14
gcc/expmed.c
14
gcc/expmed.c
@ -1992,10 +1992,16 @@ synth_mult (alg_out, t, cost_limit)
|
||||
|
||||
for (w = 1; (w & t) != 0; w <<= 1)
|
||||
;
|
||||
if (w > 2
|
||||
/* Reject the case where t is 3.
|
||||
Thus we prefer addition in that case. */
|
||||
&& t != 3)
|
||||
/* If T was -1, then W will be zero after the loop. This is another
|
||||
case where T ends with ...111. Handling this with (T + 1) and
|
||||
subtract 1 produces slightly better code and results in algorithm
|
||||
selection much faster than treating it like the ...0111 case
|
||||
below. */
|
||||
if (w == 0
|
||||
|| (w > 2
|
||||
/* Reject the case where t is 3.
|
||||
Thus we prefer addition in that case. */
|
||||
&& t != 3))
|
||||
{
|
||||
/* T ends with ...111. Multiply by (T + 1) and subtract 1. */
|
||||
|
||||
|
@ -195,7 +195,7 @@ if [ \! -z "$file_to_fix" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# /usr/include/sys/mc_param.h has an embedded asm for the cpuid intruction
|
||||
# /usr/include/sys/mc_param.h has an embedded asm for the cpuid instruction
|
||||
# on the P5. This is not used by anything else so we ifdef it out.
|
||||
file=sys/mc_param.h
|
||||
if [ -r ${LIB}/$file ]; then
|
||||
@ -224,7 +224,7 @@ if [ \! -z "$file_to_fix" ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# /usr/include/sys/mc_param.h has an embedded asm for the cpuid intruction
|
||||
# /usr/include/sys/mc_param.h has an embedded asm for the cpuid instruction
|
||||
# on the P5. This is not used by anything else so we ifdef it out.
|
||||
file=sys/mc_param.h
|
||||
if [ -r ${LIB}/$file ]; then
|
||||
|
@ -737,7 +737,7 @@ __divdf3 (double a1, double a2)
|
||||
if (__dcmp(x1m1,x1m2,x2m1,x2m2) < 0) {
|
||||
|
||||
/* if x1's mantissa is less than x2's shift it left one and decrement */
|
||||
/* the exponent to accomodate the change in the mantissa */
|
||||
/* the exponent to accommodate the change in the mantissa */
|
||||
|
||||
x1m1 <<= 1; /* */
|
||||
bit_bucket = x1m2 >> 31; /* Shift mantissa left one */
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
# Generates multilib.h.
|
||||
# Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||
|
||||
#This file is part of GNU CC.
|
||||
|
||||
@ -243,7 +243,7 @@ echo "NULL"
|
||||
echo "};"
|
||||
|
||||
# Output all of the matches now as option and that is the same as that, with
|
||||
# a semicolan trailer. Include all of the normal options as well.
|
||||
# a semicolon trailer. Include all of the normal options as well.
|
||||
# Note, the format of the matches is reversed compared
|
||||
# to what we want, so switch them around.
|
||||
echo ""
|
||||
|
30
gcc/getopt.h
30
gcc/getopt.h
@ -1,23 +1,23 @@
|
||||
/* Declarations for getopt.
|
||||
Copyright (C) 1989,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@prep.ai.mit.edu.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
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
|
||||
later version.
|
||||
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
|
||||
later version.
|
||||
|
||||
This program 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.
|
||||
This program 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 this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
#ifndef _GETOPT_H
|
||||
#define _GETOPT_H 1
|
||||
@ -130,4 +130,4 @@ extern int _getopt_internal ();
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _GETOPT_H */
|
||||
#endif /* getopt.h */
|
||||
|
@ -1,23 +1,23 @@
|
||||
/* getopt_long and getopt_long_only entry points for GNU getopt.
|
||||
Copyright (C) 1987,88,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@prep.ai.mit.edu.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
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
|
||||
later version.
|
||||
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
|
||||
later version.
|
||||
|
||||
This program 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.
|
||||
This program 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 this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* OSF/rose half-pic support definitions.
|
||||
Copyright (C) 1992, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1996, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@ -20,24 +20,7 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
#ifndef NO_HALF_PIC
|
||||
|
||||
/* Add prototype support. */
|
||||
/* ??? It would be nice to use gansidecl.h here but there's an extra
|
||||
complication with NO_STDIO_H that must be dealt with. */
|
||||
#ifndef PROTO
|
||||
#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
|
||||
#define PROTO(ARGS) ARGS
|
||||
#else
|
||||
#define PROTO(ARGS) ()
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if !defined(STDIO_PROTO) && !defined(NO_STDIO_H)
|
||||
#ifndef BUFSIZ
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#define STDIO_PROTO(ARGS) PROTO(ARGS)
|
||||
#endif
|
||||
#include "gansidecl.h"
|
||||
|
||||
#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
|
||||
union tree_node; /* forward reference */
|
||||
@ -64,9 +47,8 @@ extern void half_pic_external PROTO((char *)); /* declare object external */
|
||||
extern void half_pic_init PROTO((void)); /* half_pic initialization */
|
||||
extern int half_pic_address_p PROTO((struct rtx_def *)); /* true if an address is half-pic */
|
||||
extern struct rtx_def *half_pic_ptr PROTO((struct rtx_def *)); /* return RTX for half-pic pointer */
|
||||
#ifdef STDIO_PROTO
|
||||
extern void half_pic_finish STDIO_PROTO((FILE *)); /* half_pic termination */
|
||||
#endif
|
||||
/* Can't use prototype since FILE isn't defined yet. */
|
||||
extern void half_pic_finish (/* FILE * */); /* half_pic termination */
|
||||
|
||||
/* Macros to provide access to the half-pic stuff (so they can easily
|
||||
be stubbed out. */
|
||||
|
@ -1,7 +1,6 @@
|
||||
/* Declarations for variables relating to reading the source file.
|
||||
Used by parsers, lexical analyzers, and error message routines.
|
||||
|
||||
Copyright (C) 1993 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@ -37,6 +36,7 @@ struct file_stack
|
||||
char *name;
|
||||
struct file_stack *next;
|
||||
int line;
|
||||
int indent_level;
|
||||
};
|
||||
|
||||
/* Stack of currently pending input files.
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/bin/sh
|
||||
# $Id: just-fixinc,v 1.1 1997/08/11 15:57:11 law Exp $
|
||||
# $Id: just-fixinc,v 1.2 1998/04/03 16:35:58 law Exp $
|
||||
# This script exists for use after installing
|
||||
# the GCC binaries from a distribution tape/CD-ROM.
|
||||
# Use it *after* copying the directory of binaries
|
||||
|
@ -32,7 +32,7 @@
|
||||
# mc68030 for Motorola 68030 (Sun-3, ..)
|
||||
# sparc for SPARC (SUN-4, ..)
|
||||
# i386 for i386 (Sun i386, ...)
|
||||
# i386-linux for i386 (Linux, ...)
|
||||
# i386-gnu-linux for i386 (GNU/Linux, ...)
|
||||
|
||||
# Guess what kind of objects we are creating and thus what type of assembler
|
||||
# symbols to look for
|
||||
@ -62,7 +62,7 @@ cd $WD
|
||||
# MYSYS=mc68030
|
||||
# MYSYS=sparc
|
||||
# MYSYS=i386
|
||||
# MYSYS=i386-linux
|
||||
# MYSYS=i386-gnu-linux
|
||||
# MYSYS=`mach` # this will work on Suns with SunOS > 4.0.0
|
||||
# MYSYS=elf
|
||||
# MYSYS=coff
|
||||
@ -103,7 +103,7 @@ BEGIN {
|
||||
line_delimiter = ",";
|
||||
line_offset = 0;
|
||||
}
|
||||
else if (sys == "mc68020" || sys == "mc68030" || sys == "i386-linux") {
|
||||
else if (sys == "mc68020" || sys == "mc68030" || sys == "i386-gnu-linux") {
|
||||
line_hint = "^[ \t]*\.stabd.*"
|
||||
line_field = 3;
|
||||
line_delimiter = ",";
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* This file contains the definitions and documentation for the
|
||||
machine modes used in the the GNU compiler.
|
||||
Copyright (C) 1987, 1992, 1994 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987, 1992, 1994, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@ -84,6 +84,8 @@ DEF_MACHMODE (XFmode, "XF", MODE_FLOAT, 12, 12, TFmode) /* IEEE extended */
|
||||
DEF_MACHMODE (TFmode, "TF", MODE_FLOAT, 16, 16, VOIDmode)
|
||||
|
||||
/* Complex modes. */
|
||||
DEF_MACHMODE (QCmode, "QC", MODE_COMPLEX_FLOAT, 2, 1, HCmode)
|
||||
DEF_MACHMODE (HCmode, "HC", MODE_COMPLEX_FLOAT, 4, 2, SCmode)
|
||||
DEF_MACHMODE (SCmode, "SC", MODE_COMPLEX_FLOAT, 8, 4, DCmode)
|
||||
DEF_MACHMODE (DCmode, "DC", MODE_COMPLEX_FLOAT, 16, 8, XCmode)
|
||||
DEF_MACHMODE (XCmode, "XC", MODE_COMPLEX_FLOAT, 24, 12, TCmode)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Read and manage MIPS symbol tables from object modules.
|
||||
Copyright (C) 1991, 1994, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1991, 1994, 1995, 1997 Free Software Foundation, Inc.
|
||||
Contributed by hartzell@boulder.colorado.edu,
|
||||
Rewritten by meissner@osf.org.
|
||||
|
||||
@ -20,13 +20,13 @@ 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 "config.h"
|
||||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/file.h>
|
||||
#include <time.h>
|
||||
#include <fcntl.h>
|
||||
#include <errno.h>
|
||||
#include "config.h"
|
||||
|
||||
#ifdef index
|
||||
#undef index
|
||||
|
161
gcc/obstack.c
161
gcc/obstack.c
@ -1,19 +1,29 @@
|
||||
/* obstack.c - subroutines used implicitly by object stack macros
|
||||
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988,89,90,91,92,93,94,96,97 Free Software Foundation, Inc.
|
||||
|
||||
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
|
||||
later version.
|
||||
the C library, however. The master source lives in /gd/gnu/lib.
|
||||
|
||||
This program 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.
|
||||
NOTE: The canonical source of this file is maintained with the GNU C Library.
|
||||
Bugs can be reported to bug-glibc@prep.ai.mit.edu.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program; if not, write to the Free Software
|
||||
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
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
|
||||
later version.
|
||||
|
||||
This program 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 this program; if not, write to the Free Software
|
||||
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
|
||||
USA. */
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "obstack.h"
|
||||
|
||||
@ -67,6 +77,28 @@ union fooround {long x; double d;};
|
||||
#define COPYING_UNIT int
|
||||
#endif
|
||||
|
||||
|
||||
/* The functions allocating more room by calling `obstack_chunk_alloc'
|
||||
jump to the handler pointed to by `obstack_alloc_failed_handler'.
|
||||
This variable by default points to the internal function
|
||||
`print_and_abort'. */
|
||||
#if defined (__STDC__) && __STDC__
|
||||
static void print_and_abort (void);
|
||||
void (*obstack_alloc_failed_handler) (void) = print_and_abort;
|
||||
#else
|
||||
static void print_and_abort ();
|
||||
void (*obstack_alloc_failed_handler) () = print_and_abort;
|
||||
#endif
|
||||
|
||||
/* Exit value used when `print_and_abort' is used. */
|
||||
#if defined __GNU_LIBRARY__ || defined HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifndef EXIT_FAILURE
|
||||
#define EXIT_FAILURE 1
|
||||
#endif
|
||||
int obstack_exit_failure = EXIT_FAILURE;
|
||||
|
||||
/* The non-GNU-C macros copy the obstack into this global variable
|
||||
to avoid multiple evaluation. */
|
||||
|
||||
@ -78,6 +110,20 @@ struct obstack *_obstack;
|
||||
For free, do not use ?:, since some compilers, like the MIPS compilers,
|
||||
do not allow (expr) ? void : void. */
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
#define CALL_CHUNKFUN(h, size) \
|
||||
(((h) -> use_extra_arg) \
|
||||
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
|
||||
: (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size)))
|
||||
|
||||
#define CALL_FREEFUN(h, old_chunk) \
|
||||
do { \
|
||||
if ((h) -> use_extra_arg) \
|
||||
(*(h)->freefun) ((h)->extra_arg, (old_chunk)); \
|
||||
else \
|
||||
(*(void (*) (void *)) (h)->freefun) ((old_chunk)); \
|
||||
} while (0)
|
||||
#else
|
||||
#define CALL_CHUNKFUN(h, size) \
|
||||
(((h) -> use_extra_arg) \
|
||||
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
|
||||
@ -90,6 +136,7 @@ struct obstack *_obstack;
|
||||
else \
|
||||
(*(void (*) ()) (h)->freefun) ((old_chunk)); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
|
||||
/* Initialize an obstack H for use. Specify chunk size SIZE (0 means default).
|
||||
@ -106,13 +153,18 @@ _obstack_begin (h, size, alignment, chunkfun, freefun)
|
||||
struct obstack *h;
|
||||
int size;
|
||||
int alignment;
|
||||
#if defined (__STDC__) && __STDC__
|
||||
POINTER (*chunkfun) (long);
|
||||
void (*freefun) (void *);
|
||||
#else
|
||||
POINTER (*chunkfun) ();
|
||||
void (*freefun) ();
|
||||
#endif
|
||||
{
|
||||
register struct _obstack_chunk *chunk; /* points to new chunk */
|
||||
|
||||
if (alignment == 0)
|
||||
alignment = DEFAULT_ALIGNMENT;
|
||||
alignment = (int) DEFAULT_ALIGNMENT;
|
||||
if (size == 0)
|
||||
/* Default size is what GNU malloc can fit in a 4096-byte block. */
|
||||
{
|
||||
@ -130,25 +182,27 @@ _obstack_begin (h, size, alignment, chunkfun, freefun)
|
||||
size = 4096 - extra;
|
||||
}
|
||||
|
||||
#if defined (__STDC__) && __STDC__
|
||||
h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun;
|
||||
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
|
||||
#else
|
||||
h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
|
||||
h->freefun = freefun;
|
||||
#endif
|
||||
h->chunk_size = size;
|
||||
h->alignment_mask = alignment - 1;
|
||||
h->use_extra_arg = 0;
|
||||
|
||||
chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
|
||||
if (!chunk)
|
||||
{
|
||||
h->alloc_failed = 1;
|
||||
return 0;
|
||||
}
|
||||
h->alloc_failed = 0;
|
||||
(*obstack_alloc_failed_handler) ();
|
||||
h->next_free = h->object_base = chunk->contents;
|
||||
h->chunk_limit = chunk->limit
|
||||
= (char *) chunk + h->chunk_size;
|
||||
chunk->prev = 0;
|
||||
/* The initial chunk now contains no empty object. */
|
||||
h->maybe_empty_object = 0;
|
||||
h->alloc_failed = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -157,14 +211,19 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
|
||||
struct obstack *h;
|
||||
int size;
|
||||
int alignment;
|
||||
#if defined (__STDC__) && __STDC__
|
||||
POINTER (*chunkfun) (POINTER, long);
|
||||
void (*freefun) (POINTER, POINTER);
|
||||
#else
|
||||
POINTER (*chunkfun) ();
|
||||
void (*freefun) ();
|
||||
#endif
|
||||
POINTER arg;
|
||||
{
|
||||
register struct _obstack_chunk *chunk; /* points to new chunk */
|
||||
|
||||
if (alignment == 0)
|
||||
alignment = DEFAULT_ALIGNMENT;
|
||||
alignment = (int) DEFAULT_ALIGNMENT;
|
||||
if (size == 0)
|
||||
/* Default size is what GNU malloc can fit in a 4096-byte block. */
|
||||
{
|
||||
@ -182,8 +241,13 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
|
||||
size = 4096 - extra;
|
||||
}
|
||||
|
||||
#if defined(__STDC__) && __STDC__
|
||||
h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun;
|
||||
h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun;
|
||||
#else
|
||||
h->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
|
||||
h->freefun = freefun;
|
||||
#endif
|
||||
h->chunk_size = size;
|
||||
h->alignment_mask = alignment - 1;
|
||||
h->extra_arg = arg;
|
||||
@ -191,17 +255,14 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
|
||||
|
||||
chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
|
||||
if (!chunk)
|
||||
{
|
||||
h->alloc_failed = 1;
|
||||
return 0;
|
||||
}
|
||||
h->alloc_failed = 0;
|
||||
(*obstack_alloc_failed_handler) ();
|
||||
h->next_free = h->object_base = chunk->contents;
|
||||
h->chunk_limit = chunk->limit
|
||||
= (char *) chunk + h->chunk_size;
|
||||
chunk->prev = 0;
|
||||
/* The initial chunk now contains no empty object. */
|
||||
h->maybe_empty_object = 0;
|
||||
h->alloc_failed = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
@ -219,9 +280,9 @@ _obstack_newchunk (h, length)
|
||||
register struct _obstack_chunk *old_chunk = h->chunk;
|
||||
register struct _obstack_chunk *new_chunk;
|
||||
register long new_size;
|
||||
register int obj_size = h->next_free - h->object_base;
|
||||
register int i;
|
||||
int already;
|
||||
register long obj_size = h->next_free - h->object_base;
|
||||
register long i;
|
||||
long already;
|
||||
|
||||
/* Compute size for new chunk. */
|
||||
new_size = (obj_size + length) + (obj_size >> 3) + 100;
|
||||
@ -231,11 +292,7 @@ _obstack_newchunk (h, length)
|
||||
/* Allocate and initialize the new chunk. */
|
||||
new_chunk = CALL_CHUNKFUN (h, new_size);
|
||||
if (!new_chunk)
|
||||
{
|
||||
h->alloc_failed = 1;
|
||||
return;
|
||||
}
|
||||
h->alloc_failed = 0;
|
||||
(*obstack_alloc_failed_handler) ();
|
||||
h->chunk = new_chunk;
|
||||
new_chunk->prev = old_chunk;
|
||||
new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size;
|
||||
@ -379,6 +436,39 @@ obstack_free (h, obj)
|
||||
abort ();
|
||||
}
|
||||
|
||||
int
|
||||
_obstack_memory_used (h)
|
||||
struct obstack *h;
|
||||
{
|
||||
register struct _obstack_chunk* lp;
|
||||
register int nbytes = 0;
|
||||
|
||||
for (lp = h->chunk; lp != 0; lp = lp->prev)
|
||||
{
|
||||
nbytes += lp->limit - (char *) lp;
|
||||
}
|
||||
return nbytes;
|
||||
}
|
||||
|
||||
/* Define the error handler. */
|
||||
#ifndef _
|
||||
# ifdef HAVE_LIBINTL_H
|
||||
# include <libintl.h>
|
||||
# ifndef _
|
||||
# define _(Str) gettext (Str)
|
||||
# endif
|
||||
# else
|
||||
# define _(Str) (Str)
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static void
|
||||
print_and_abort ()
|
||||
{
|
||||
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. */
|
||||
@ -417,6 +507,13 @@ int (obstack_room) (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;
|
||||
|
62
gcc/recog.h
62
gcc/recog.h
@ -1,5 +1,5 @@
|
||||
/* Declarations for interface to insn recognizer and insn-output.c.
|
||||
Copyright (C) 1987, 1996 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987, 1996, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@ -20,37 +20,49 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "gansidecl.h"
|
||||
|
||||
/* Recognize an insn and return its insn-code,
|
||||
which is the sequence number of the DEFINE_INSN that it matches.
|
||||
If the insn does not match, return -1. */
|
||||
extern void init_recog PROTO((void));
|
||||
extern void init_recog_no_volatile PROTO((void));
|
||||
extern int recog_memoized PROTO((rtx));
|
||||
extern int check_asm_operands PROTO((rtx));
|
||||
extern int validate_change PROTO((rtx, rtx *, rtx, int));
|
||||
extern int apply_change_group PROTO((void));
|
||||
extern int num_validated_changes PROTO((void));
|
||||
extern void cancel_changes PROTO((int));
|
||||
extern int constrain_operands PROTO((int, int));
|
||||
extern int memory_address_p PROTO((enum machine_mode, rtx));
|
||||
extern int strict_memory_address_p PROTO((enum machine_mode, rtx));
|
||||
extern int validate_replace_rtx PROTO((rtx, rtx, rtx));
|
||||
extern int reg_fits_class_p PROTO((rtx, enum reg_class, int,
|
||||
enum machine_mode));
|
||||
extern rtx *find_single_use PROTO((rtx, rtx, rtx *));
|
||||
|
||||
extern int recog_memoized PROTO((rtx));
|
||||
extern int general_operand PROTO((rtx, enum machine_mode));
|
||||
extern int address_operand PROTO((rtx, enum machine_mode));
|
||||
extern int register_operand PROTO((rtx, enum machine_mode));
|
||||
extern int scratch_operand PROTO((rtx, enum machine_mode));
|
||||
extern int immediate_operand PROTO((rtx, enum machine_mode));
|
||||
extern int const_int_operand PROTO((rtx, enum machine_mode));
|
||||
extern int cosnt_double_operand PROTO((rtx, enum machine_mode));
|
||||
extern int nonimmediate_operand PROTO((rtx, enum machine_mode));
|
||||
extern int nonmemory_operand PROTO((rtx, enum machine_mode));
|
||||
extern int push_operand PROTO((rtx, enum machine_mode));
|
||||
extern int memory_operand PROTO((rtx, enum machine_mode));
|
||||
extern int indirect_operand PROTO((rtx, enum machine_mode));
|
||||
extern int mode_independent_operand PROTO((rtx, enum machine_mode));
|
||||
extern int comparison_operator PROTO((rtx, enum machine_mode));
|
||||
|
||||
/* Determine whether a proposed change to an insn or MEM will make it
|
||||
invalid. Make the change if not. */
|
||||
extern int offsettable_memref_p PROTO((rtx));
|
||||
extern int offsettable_nonstrict_memref_p PROTO((rtx));
|
||||
extern int offsettable_address_p PROTO((int, enum machine_mode, rtx));
|
||||
extern int mode_dependent_address_p PROTO((rtx));
|
||||
|
||||
extern int validate_change PROTO((rtx, rtx *, rtx, int));
|
||||
|
||||
/* Apply a group of changes if valid. */
|
||||
|
||||
extern int apply_change_group PROTO((void));
|
||||
|
||||
/* Return the number of changes so far in the current group. */
|
||||
|
||||
extern int num_validated_changes PROTO((void));
|
||||
|
||||
/* Retract some changes. */
|
||||
|
||||
extern void cancel_changes PROTO((int));
|
||||
extern int recog PROTO((rtx, rtx, int *));
|
||||
extern void add_clobbers PROTO((rtx, int));
|
||||
extern void insn_extract PROTO((rtx));
|
||||
|
||||
/* Nonzero means volatile operands are recognized. */
|
||||
|
||||
extern int volatile_ok;
|
||||
|
||||
/* Extract the operands from an insn that has been recognized. */
|
||||
|
||||
extern void insn_extract PROTO((rtx));
|
||||
|
||||
/* The following vectors hold the results from insn_extract. */
|
||||
|
||||
/* Indexed by N, gives value of operand N. */
|
||||
|
@ -29,6 +29,10 @@ Boston, MA 02111-1307, USA. */
|
||||
#define REG_SIZE(R) \
|
||||
((mode_size[(int) GET_MODE (R)] + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
|
||||
|
||||
#ifndef SMALL_REGISTER_CLASSES
|
||||
#define SMALL_REGISTER_CLASSES 0
|
||||
#endif
|
||||
|
||||
/* Maximum register number used in this function, plus one. */
|
||||
|
||||
extern int max_regno;
|
||||
|
@ -1,5 +1,5 @@
|
||||
%% TeX macros to handle Texinfo files.
|
||||
%% $Id: texinfo.tex,v 1.1 1997/08/11 15:57:14 law Exp $
|
||||
%% $Id: texinfo.tex,v 1.1.1.2 1998/01/14 19:38:23 law Exp $
|
||||
|
||||
% Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
|
||||
% 94, 95, 96, 97 Free Software Foundation, Inc.
|
||||
@ -36,7 +36,7 @@
|
||||
|
||||
% This automatically updates the version number based on RCS.
|
||||
\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
|
||||
\deftexinfoversion$Revision: 1.1 $
|
||||
\deftexinfoversion$Revision: 1.1.1.2 $
|
||||
\message{Loading texinfo package [Version \texinfoversion]:}
|
||||
|
||||
% If in a .fmt file, print the version number
|
||||
@ -441,14 +441,11 @@
|
||||
% @. is an end-of-sentence period.
|
||||
\def\.{.\spacefactor=3000 }
|
||||
|
||||
% @enddots{} is an end-of-sentence ellipsis.
|
||||
\gdef\enddots{$\mathinner{\ldotp\ldotp\ldotp\ldotp}$\spacefactor=3000}
|
||||
|
||||
% @! is an end-of-sentence bang.
|
||||
\gdef\!{!\spacefactor=3000 }
|
||||
\def\!{!\spacefactor=3000 }
|
||||
|
||||
% @? is an end-of-sentence query.
|
||||
\gdef\?{?\spacefactor=3000 }
|
||||
\def\?{?\spacefactor=3000 }
|
||||
|
||||
% @w prevents a word break. Without the \leavevmode, @w at the
|
||||
% beginning of a paragraph, when TeX is still in vertical mode, would
|
||||
@ -573,9 +570,27 @@ where each line of input produces a line of output.}
|
||||
|
||||
\let\br = \par
|
||||
|
||||
% @dots{} output some dots
|
||||
% @dots{} output an ellipsis using the current font.
|
||||
% We do .5em per period so that it has the same spacing in a typewriter
|
||||
% font as three actual period characters.
|
||||
%
|
||||
\def\dots{\hbox to 1.5em{%
|
||||
\hskip 0pt plus 0.25fil minus 0.25fil
|
||||
.\hss.\hss.%
|
||||
\hskip 0pt plus 0.5fil minus 0.5fil
|
||||
}}
|
||||
|
||||
% @enddots{} is an end-of-sentence ellipsis.
|
||||
%
|
||||
\def\enddots{%
|
||||
\hbox to 2em{%
|
||||
\hskip 0pt plus 0.25fil minus 0.25fil
|
||||
.\hss.\hss.\hss.%
|
||||
\hskip 0pt plus 0.5fil minus 0.5fil
|
||||
}%
|
||||
\spacefactor=3000
|
||||
}
|
||||
|
||||
\def\dots{$\ldots$}
|
||||
|
||||
% @page forces the start of a new page
|
||||
|
||||
@ -1236,7 +1251,7 @@ where each line of input produces a line of output.}
|
||||
\let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
|
||||
\let\tenttsl=\titlettsl
|
||||
\resetmathfonts \setleading{25pt}}
|
||||
\def\titlefont#1{{\titlefonts #1}}
|
||||
\def\titlefont#1{{\titlefonts\rm #1}}
|
||||
\def\chapfonts{%
|
||||
\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
|
||||
\let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
|
||||
@ -4617,7 +4632,7 @@ width0pt\relax} \fi
|
||||
% Check for and read epsf.tex up front. If we read it only at @image
|
||||
% time, we might be inside a group, and then its definitions would get
|
||||
% undone and the next image would fail.
|
||||
\openin 1 = xepsf.tex
|
||||
\openin 1 = epsf.tex
|
||||
\ifeof 1 \else
|
||||
\closein 1
|
||||
\def\epsfannounce{\toks0 = }% do not bother showing banner
|
||||
|
Loading…
Reference in New Issue
Block a user