Commit 31031edd by Jeff Law

dummy commit before merge

From-SVN: r18980
parent 732dcb6f
...@@ -20,7 +20,7 @@ IF YOU THINK YOU MIGHT COMPILE X FOR SOLARIS 2, then you really don't ...@@ -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 need this patch: get /contrib/R5.SunOS5.patch.tar.Z from
export.lcs.mit.edu instead. It has everything you need to do the 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 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. (/contrib/R5.SunOS5.patch.README at export) for more info.
If you see undefined symbols _dlopen, _dlsym, or _dlclose when linking If you see undefined symbols _dlopen, _dlsym, or _dlclose when linking
......
...@@ -177,7 +177,7 @@ extern tree convert_and_check PROTO((tree, tree)); ...@@ -177,7 +177,7 @@ extern tree convert_and_check PROTO((tree, tree));
extern void overflow_warning PROTO((tree)); extern void overflow_warning PROTO((tree));
extern void unsigned_conversion_warning PROTO((tree, tree)); extern void unsigned_conversion_warning PROTO((tree, tree));
/* Read the rest of the current #-directive line. */ /* 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. /* Subroutine of build_binary_op, used for comparison operations.
See if the operands have both been converted from subword integer types See if the operands have both been converted from subword integer types
and, if so, perhaps change them both back to their original type. */ and, if so, perhaps change them both back to their original type. */
...@@ -288,12 +288,9 @@ extern void pending_xref_error PROTO((void)); ...@@ -288,12 +288,9 @@ extern void pending_xref_error PROTO((void));
extern void pop_c_function_context PROTO((void)); extern void pop_c_function_context PROTO((void));
extern void pop_label_level PROTO((void)); extern void pop_label_level PROTO((void));
extern tree poplevel PROTO((int, int, int)); extern tree poplevel PROTO((int, int, int));
extern void print_lang_decl STDIO_PROTO((FILE *, tree, extern void print_lang_decl PROTO((FILE *, tree, int));
int)); extern void print_lang_identifier PROTO((FILE *, tree, int));
extern void print_lang_identifier STDIO_PROTO((FILE *, tree, extern void print_lang_type PROTO((FILE *, tree, int));
int));
extern void print_lang_type STDIO_PROTO((FILE *, tree,
int));
extern void push_c_function_context PROTO((void)); extern void push_c_function_context PROTO((void));
extern void push_label_level PROTO((void)); extern void push_label_level PROTO((void));
extern void push_parm_decl PROTO((tree)); extern void push_parm_decl PROTO((tree));
......
...@@ -29,29 +29,19 @@ Boston, MA 02111-1307, USA. ...@@ -29,29 +29,19 @@ Boston, MA 02111-1307, USA.
#include <setjmp.h> #include <setjmp.h>
/* #define YYDEBUG 1 */ /* #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> # include <string.h>
#endif #endif
#if HAVE_STDLIB_H || defined (MULTIBYTE_CHARS) #ifdef HAVE_STDLIB_H
# include <stdlib.h> # include <stdlib.h>
#endif #endif
#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif
#ifdef MULTIBYTE_CHARS #ifdef MULTIBYTE_CHARS
#include <locale.h> #include <locale.h>
#endif #endif
...@@ -87,18 +77,36 @@ struct arglist { ...@@ -87,18 +77,36 @@ struct arglist {
#endif #endif
/* Find the largest host integer type and set its size and type. /* 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 #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
#if HOST_BITS_PER_LONG > HOST_BITS_PER_INT #ifndef unsigned_HOST_WIDE_INT
#define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_LONG #define unsigned_HOST_WIDE_INT unsigned HOST_WIDE_INT
#define HOST_WIDE_INT long
#else
#define HOST_BITS_PER_WIDE_INT HOST_BITS_PER_INT
#define HOST_WIDE_INT int
#endif #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 #endif
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) #if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
...@@ -137,11 +145,14 @@ struct arglist { ...@@ -137,11 +145,14 @@ struct arglist {
#define PRINTF_PROTO_1(ARGS) PRINTF_PROTO(ARGS, 1, 2) #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 int yylex PROTO((void));
static void yyerror PROTO((char *)) __attribute__ ((noreturn)); static void yyerror PROTO((char *)) __attribute__ ((noreturn));
static HOST_WIDE_INT expression_value; static HOST_WIDE_INT expression_value;
#ifdef TEST_EXP_READER
static int expression_signedp;
#endif
static jmp_buf parse_return_error; static jmp_buf parse_return_error;
...@@ -152,6 +163,9 @@ static int keyword_parsing = 0; ...@@ -152,6 +163,9 @@ static int keyword_parsing = 0;
This is a count, since unevaluated expressions can nest. */ This is a count, since unevaluated expressions can nest. */
static int skip_evaluation; static int skip_evaluation;
/* Nonzero means warn if undefined identifiers are evaluated. */
static int warn_undef;
/* some external tables of character types */ /* some external tables of character types */
extern unsigned char is_idstart[], is_idchar[], is_space[]; extern unsigned char is_idstart[], is_idchar[], is_space[];
...@@ -164,9 +178,6 @@ extern int traditional; ...@@ -164,9 +178,6 @@ extern int traditional;
/* Flag for -lang-c89. */ /* Flag for -lang-c89. */
extern int c89; extern int c89;
/* Flag for -Wundef. */
extern int warn_undef;
#ifndef CHAR_TYPE_SIZE #ifndef CHAR_TYPE_SIZE
#define CHAR_TYPE_SIZE BITS_PER_UNIT #define CHAR_TYPE_SIZE BITS_PER_UNIT
#endif #endif
...@@ -199,17 +210,13 @@ extern int warn_undef; ...@@ -199,17 +210,13 @@ extern int warn_undef;
#define MAX_WCHAR_TYPE_SIZE WCHAR_TYPE_SIZE #define MAX_WCHAR_TYPE_SIZE WCHAR_TYPE_SIZE
#endif #endif
#if MAX_CHAR_TYPE_SIZE < HOST_BITS_PER_WIDE_INT #define MAX_CHAR_TYPE_MASK (MAX_CHAR_TYPE_SIZE < HOST_BITS_PER_WIDE_INT \
#define MAX_CHAR_TYPE_MASK (~ (~ (HOST_WIDE_INT) 0 << MAX_CHAR_TYPE_SIZE)) ? (~ (~ (HOST_WIDE_INT) 0 << MAX_CHAR_TYPE_SIZE)) \
#else : ~ (HOST_WIDE_INT) 0)
#define MAX_CHAR_TYPE_MASK (~ (HOST_WIDE_INT) 0)
#endif
#if MAX_WCHAR_TYPE_SIZE < HOST_BITS_PER_WIDE_INT #define MAX_WCHAR_TYPE_MASK (MAX_WCHAR_TYPE_SIZE < HOST_BITS_PER_WIDE_INT \
#define MAX_WCHAR_TYPE_MASK (~ (~ (HOST_WIDE_INT) 0 << MAX_WCHAR_TYPE_SIZE)) ? ~ (~ (HOST_WIDE_INT) 0 << MAX_WCHAR_TYPE_SIZE) \
#else : ~ (HOST_WIDE_INT) 0)
#define MAX_WCHAR_TYPE_MASK (~ (HOST_WIDE_INT) 0)
#endif
/* Suppose A1 + B1 = SUM1, using 2's complement arithmetic ignoring overflow. /* 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. 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 *, ...)); ...@@ -232,8 +239,8 @@ void pedwarn PRINTF_PROTO_1((char *, ...));
void warning PRINTF_PROTO_1((char *, ...)); void warning PRINTF_PROTO_1((char *, ...));
static int parse_number PROTO((int)); static int parse_number PROTO((int));
static HOST_WIDE_INT left_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 HOST_WIDE_INT right_shift PROTO((struct constant *, unsigned_HOST_WIDE_INT));
static void integer_overflow PROTO((void)); static void integer_overflow PROTO((void));
/* `signedp' values */ /* `signedp' values */
...@@ -272,7 +279,12 @@ static void integer_overflow PROTO((void)); ...@@ -272,7 +279,12 @@ static void integer_overflow PROTO((void));
%% %%
start : exp1 start : exp1
{ expression_value = $1.value; } {
expression_value = $1.value;
#ifdef TEST_EXP_READER
expression_signedp = $1.signedp;
#endif
}
; ;
/* Expressions, including the comma operator. */ /* Expressions, including the comma operator. */
...@@ -324,7 +336,7 @@ exp : exp '*' exp ...@@ -324,7 +336,7 @@ exp : exp '*' exp
integer_overflow (); integer_overflow ();
} }
else else
$$.value = ((unsigned HOST_WIDE_INT) $1.value $$.value = ((unsigned_HOST_WIDE_INT) $1.value
* $3.value); } * $3.value); }
| exp '/' exp | exp '/' exp
{ if ($3.value == 0) { if ($3.value == 0)
...@@ -341,7 +353,7 @@ exp : exp '*' exp ...@@ -341,7 +353,7 @@ exp : exp '*' exp
integer_overflow (); integer_overflow ();
} }
else else
$$.value = ((unsigned HOST_WIDE_INT) $1.value $$.value = ((unsigned_HOST_WIDE_INT) $1.value
/ $3.value); } / $3.value); }
| exp '%' exp | exp '%' exp
{ if ($3.value == 0) { if ($3.value == 0)
...@@ -354,7 +366,7 @@ exp : exp '*' exp ...@@ -354,7 +366,7 @@ exp : exp '*' exp
if ($$.signedp) if ($$.signedp)
$$.value = $1.value % $3.value; $$.value = $1.value % $3.value;
else else
$$.value = ((unsigned HOST_WIDE_INT) $1.value $$.value = ((unsigned_HOST_WIDE_INT) $1.value
% $3.value); } % $3.value); }
| exp '+' exp | exp '+' exp
{ $$.value = $1.value + $3.value; { $$.value = $1.value + $3.value;
...@@ -391,28 +403,28 @@ exp : exp '*' exp ...@@ -391,28 +403,28 @@ exp : exp '*' exp
if ($1.signedp & $3.signedp) if ($1.signedp & $3.signedp)
$$.value = $1.value <= $3.value; $$.value = $1.value <= $3.value;
else else
$$.value = ((unsigned HOST_WIDE_INT) $1.value $$.value = ((unsigned_HOST_WIDE_INT) $1.value
<= $3.value); } <= $3.value); }
| exp GEQ exp | exp GEQ exp
{ $$.signedp = SIGNED; { $$.signedp = SIGNED;
if ($1.signedp & $3.signedp) if ($1.signedp & $3.signedp)
$$.value = $1.value >= $3.value; $$.value = $1.value >= $3.value;
else else
$$.value = ((unsigned HOST_WIDE_INT) $1.value $$.value = ((unsigned_HOST_WIDE_INT) $1.value
>= $3.value); } >= $3.value); }
| exp '<' exp | exp '<' exp
{ $$.signedp = SIGNED; { $$.signedp = SIGNED;
if ($1.signedp & $3.signedp) if ($1.signedp & $3.signedp)
$$.value = $1.value < $3.value; $$.value = $1.value < $3.value;
else else
$$.value = ((unsigned HOST_WIDE_INT) $1.value $$.value = ((unsigned_HOST_WIDE_INT) $1.value
< $3.value); } < $3.value); }
| exp '>' exp | exp '>' exp
{ $$.signedp = SIGNED; { $$.signedp = SIGNED;
if ($1.signedp & $3.signedp) if ($1.signedp & $3.signedp)
$$.value = $1.value > $3.value; $$.value = $1.value > $3.value;
else else
$$.value = ((unsigned HOST_WIDE_INT) $1.value $$.value = ((unsigned_HOST_WIDE_INT) $1.value
> $3.value); } > $3.value); }
| exp '&' exp | exp '&' exp
{ $$.value = $1.value & $3.value; { $$.value = $1.value & $3.value;
...@@ -495,7 +507,7 @@ parse_number (olen) ...@@ -495,7 +507,7 @@ parse_number (olen)
{ {
register char *p = lexptr; register char *p = lexptr;
register int c; 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 base = 10;
register int len = olen; register int len = olen;
register int overflow = 0; register int overflow = 0;
...@@ -513,7 +525,7 @@ parse_number (olen) ...@@ -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--) { for (; len > 0; len--) {
c = *p++; c = *p++;
...@@ -684,7 +696,7 @@ yylex () ...@@ -684,7 +696,7 @@ yylex ()
It is mostly copied from c-lex.c. */ It is mostly copied from c-lex.c. */
{ {
register HOST_WIDE_INT result = 0; register HOST_WIDE_INT result = 0;
register num_chars = 0; register int num_chars = 0;
unsigned width = MAX_CHAR_TYPE_SIZE; unsigned width = MAX_CHAR_TYPE_SIZE;
int max_chars; int max_chars;
char *token_buffer; char *token_buffer;
...@@ -751,11 +763,11 @@ yylex () ...@@ -751,11 +763,11 @@ yylex ()
sizeof ("__CHAR_UNSIGNED__") - 1, -1) sizeof ("__CHAR_UNSIGNED__") - 1, -1)
|| ((result >> (num_bits - 1)) & 1) == 0) || ((result >> (num_bits - 1)) & 1) == 0)
yylval.integer.value yylval.integer.value
= result & (~ (unsigned HOST_WIDE_INT) 0 = result & (~ (unsigned_HOST_WIDE_INT) 0
>> (HOST_BITS_PER_WIDE_INT - num_bits)); >> (HOST_BITS_PER_WIDE_INT - num_bits));
else else
yylval.integer.value yylval.integer.value
= result | ~(~ (unsigned HOST_WIDE_INT) 0 = result | ~(~ (unsigned_HOST_WIDE_INT) 0
>> (HOST_BITS_PER_WIDE_INT - num_bits)); >> (HOST_BITS_PER_WIDE_INT - num_bits));
} }
else else
...@@ -962,7 +974,7 @@ parse_escape (string_ptr, result_mask) ...@@ -962,7 +974,7 @@ parse_escape (string_ptr, result_mask)
} }
case 'x': 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; register int digits_found = 0, digit;
for (;;) for (;;)
{ {
...@@ -1015,7 +1027,7 @@ integer_overflow () ...@@ -1015,7 +1027,7 @@ integer_overflow ()
static HOST_WIDE_INT static HOST_WIDE_INT
left_shift (a, b) left_shift (a, b)
struct constant *a; struct constant *a;
unsigned HOST_WIDE_INT b; unsigned_HOST_WIDE_INT b;
{ {
/* It's unclear from the C standard whether shifts can overflow. /* It's unclear from the C standard whether shifts can overflow.
The following code ignores overflow; perhaps a C standard The following code ignores overflow; perhaps a C standard
...@@ -1023,36 +1035,39 @@ left_shift (a, b) ...@@ -1023,36 +1035,39 @@ left_shift (a, b)
if (b >= HOST_BITS_PER_WIDE_INT) if (b >= HOST_BITS_PER_WIDE_INT)
return 0; return 0;
else else
return (unsigned HOST_WIDE_INT) a->value << b; return (unsigned_HOST_WIDE_INT) a->value << b;
} }
static HOST_WIDE_INT static HOST_WIDE_INT
right_shift (a, b) right_shift (a, b)
struct constant *a; struct constant *a;
unsigned HOST_WIDE_INT b; unsigned_HOST_WIDE_INT b;
{ {
if (b >= HOST_BITS_PER_WIDE_INT) if (b >= HOST_BITS_PER_WIDE_INT)
return a->signedp ? a->value >> (HOST_BITS_PER_WIDE_INT - 1) : 0; return a->signedp ? a->value >> (HOST_BITS_PER_WIDE_INT - 1) : 0;
else if (a->signedp) else if (a->signedp)
return a->value >> b; return a->value >> b;
else 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. */ /* This page contains the entry point to this file. */
/* Parse STRING as an expression, and complain if this fails /* Parse STRING as an expression, and complain if this fails
to use up all of the contents of STRING. */ to use up all of the contents of STRING.
/* STRING may contain '\0' bytes; it is terminated by the first '\n' STRING may contain '\0' bytes; it is terminated by the first '\n'
outside a string constant, so that we can diagnose '\0' properly. */ outside a string constant, so that we can diagnose '\0' properly.
/* We do not support C comments. They should be removed before 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. */ this function is called. */
HOST_WIDE_INT HOST_WIDE_INT
parse_c_expression (string) parse_c_expression (string, warn_undefined)
char *string; char *string;
int warn_undefined;
{ {
lexptr = string; lexptr = string;
warn_undef = warn_undefined;
/* if there is some sort of scanning error, just return 0 and assume /* if there is some sort of scanning error, just return 0 and assume
the parsing routine has printed an error message somewhere. the parsing routine has printed an error message somewhere.
...@@ -1080,6 +1095,7 @@ int traditional; ...@@ -1080,6 +1095,7 @@ int traditional;
int main PROTO((int, char **)); int main PROTO((int, char **));
static void initialize_random_junk PROTO((void)); static void initialize_random_junk PROTO((void));
static void print_unsigned_host_wide_int PROTO((unsigned_HOST_WIDE_INT));
/* Main program for testing purposes. */ /* Main program for testing purposes. */
int int
...@@ -1089,6 +1105,7 @@ main (argc, argv) ...@@ -1089,6 +1105,7 @@ main (argc, argv)
{ {
int n, c; int n, c;
char buf[1024]; char buf[1024];
unsigned_HOST_WIDE_INT u;
pedantic = 1 < argc; pedantic = 1 < argc;
traditional = 2 < argc; traditional = 2 < argc;
...@@ -1104,12 +1121,35 @@ main (argc, argv) ...@@ -1104,12 +1121,35 @@ main (argc, argv)
n++; n++;
if (c == EOF) if (c == EOF)
break; 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; 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. */ /* table to tell if char can be part of a C identifier. */
unsigned char is_idchar[256]; unsigned char is_idchar[256];
/* table to tell if char can be first char of a c identifier. */ /* table to tell if char can be first char of a c identifier. */
......
/* Utility routines for data type conversion for GNU C. /* 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. This file is part of GNU C.
...@@ -397,7 +397,10 @@ convert_to_integer (type, expr) ...@@ -397,7 +397,10 @@ convert_to_integer (type, expr)
convert (type, TREE_OPERAND (expr, 2)))); convert (type, TREE_OPERAND (expr, 2))));
} }
} }
break;
default:
break;
} }
return build1 (NOP_EXPR, type, expr); return build1 (NOP_EXPR, type, expr);
......
...@@ -881,6 +881,14 @@ This macro expands to the constant 1, to signify that this is ANSI ...@@ -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 Standard C@. (Whether that is actually true depends on what C compiler
will operate on the output from the preprocessor.) 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__ @item __STDC_VERSION__
@findex __STDC_VERSION__ @findex __STDC_VERSION__
This macro expands to the C Standard's version number, This macro expands to the C Standard's version number,
...@@ -891,6 +899,8 @@ Like @samp{__STDC__}, whether this version number is accurate ...@@ -891,6 +899,8 @@ Like @samp{__STDC__}, whether this version number is accurate
for the entire implementation depends on what C compiler for the entire implementation depends on what C compiler
will operate on the output from the preprocessor. will operate on the output from the preprocessor.
This macro is not defined if the @samp{-traditional} option is used.
@item __GNUC__ @item __GNUC__
@findex __GNUC__ @findex __GNUC__
This macro is defined if and only if this is GNU C@. This macro is 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, ...@@ -2679,6 +2689,15 @@ Do not search for header files in the C++-specific standard directories,
but do still search the other standard directories. but do still search the other standard directories.
(This option is used when building libg++.) (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} @item -D @var{name}
@findex -D @findex -D
Predefine @var{name} as a macro, with definition @samp{1}. Predefine @var{name} as a macro, with definition @samp{1}.
...@@ -2733,6 +2752,10 @@ predefined macros, and it outputs @emph{both} the @samp{#define} ...@@ -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 directives and the result of preprocessing. Both kinds of output go to
the standard output file. the standard output file.
@item -dI
@findex -dI
Output @samp{#include} directives in addition to the result of preprocessing.
@item -M [-MG] @item -M [-MG]
@findex -M @findex -M
Instead of outputting the result of preprocessing, output a rule Instead of outputting the result of preprocessing, output a rule
......
...@@ -69,7 +69,7 @@ enum cpp_token { ...@@ -69,7 +69,7 @@ enum cpp_token {
}; };
#ifndef PARAMS #ifndef PARAMS
#ifdef __STDC #ifdef __STDC__
#define PARAMS(P) P #define PARAMS(P) P
#else #else
#define PARAMS(P) () #define PARAMS(P) ()
...@@ -94,7 +94,7 @@ extern void parse_goto_mark PARAMS((struct parse_marker *, cpp_reader *)); ...@@ -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 void parse_move_mark PARAMS((struct parse_marker *, cpp_reader *));
extern int cpp_handle_options PARAMS ((cpp_reader *, int, char **)); 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 void cpp_skip_hspace PARAMS((cpp_reader *));
extern enum cpp_token cpp_get_non_space_token PARAMS ((cpp_reader *)); extern enum cpp_token cpp_get_non_space_token PARAMS ((cpp_reader *));
...@@ -179,7 +179,7 @@ struct cpp_reader { ...@@ -179,7 +179,7 @@ struct cpp_reader {
/* A buffer used for both for cpp_get_token's output, and also internally. */ /* A buffer used for both for cpp_get_token's output, and also internally. */
unsigned char *token_buffer; 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; int token_buffer_size;
/* End of the written part of token_buffer. */ /* End of the written part of token_buffer. */
unsigned char *limit; unsigned char *limit;
...@@ -410,6 +410,10 @@ struct cpp_options { ...@@ -410,6 +410,10 @@ struct cpp_options {
char no_output; 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. */ /* Nonzero means don't output line number information. */
char no_line_commands; char no_line_commands;
...@@ -486,6 +490,10 @@ struct cpp_options { ...@@ -486,6 +490,10 @@ struct cpp_options {
where they are defined. */ where they are defined. */
int debug_output; 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. */ /* Pending -D, -U and -A options, in reverse order. */
struct cpp_pending *pending; struct cpp_pending *pending;
......
...@@ -1992,10 +1992,16 @@ synth_mult (alg_out, t, cost_limit) ...@@ -1992,10 +1992,16 @@ synth_mult (alg_out, t, cost_limit)
for (w = 1; (w & t) != 0; w <<= 1) for (w = 1; (w & t) != 0; w <<= 1)
; ;
if (w > 2 /* 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. /* Reject the case where t is 3.
Thus we prefer addition in that case. */ Thus we prefer addition in that case. */
&& t != 3) && t != 3))
{ {
/* T ends with ...111. Multiply by (T + 1) and subtract 1. */ /* T ends with ...111. Multiply by (T + 1) and subtract 1. */
......
...@@ -195,7 +195,7 @@ if [ \! -z "$file_to_fix" ]; then ...@@ -195,7 +195,7 @@ if [ \! -z "$file_to_fix" ]; then
fi fi
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. # on the P5. This is not used by anything else so we ifdef it out.
file=sys/mc_param.h file=sys/mc_param.h
if [ -r ${LIB}/$file ]; then if [ -r ${LIB}/$file ]; then
...@@ -224,7 +224,7 @@ if [ \! -z "$file_to_fix" ]; then ...@@ -224,7 +224,7 @@ if [ \! -z "$file_to_fix" ]; then
fi fi
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. # on the P5. This is not used by anything else so we ifdef it out.
file=sys/mc_param.h file=sys/mc_param.h
if [ -r ${LIB}/$file ]; then if [ -r ${LIB}/$file ]; then
......
...@@ -737,7 +737,7 @@ __divdf3 (double a1, double a2) ...@@ -737,7 +737,7 @@ __divdf3 (double a1, double a2)
if (__dcmp(x1m1,x1m2,x2m1,x2m2) < 0) { if (__dcmp(x1m1,x1m2,x2m1,x2m2) < 0) {
/* if x1's mantissa is less than x2's shift it left one and decrement */ /* 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; /* */ x1m1 <<= 1; /* */
bit_bucket = x1m2 >> 31; /* Shift mantissa left one */ bit_bucket = x1m2 >> 31; /* Shift mantissa left one */
......
#!/bin/sh #!/bin/sh
# Generates multilib.h. # 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. #This file is part of GNU CC.
...@@ -243,7 +243,7 @@ echo "NULL" ...@@ -243,7 +243,7 @@ echo "NULL"
echo "};" echo "};"
# Output all of the matches now as option and that is the same as that, with # 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 # Note, the format of the matches is reversed compared
# to what we want, so switch them around. # to what we want, so switch them around.
echo "" echo ""
......
/* Declarations for getopt. /* Declarations for getopt.
Copyright (C) 1989,90,91,92,93,94,96,97 Free Software Foundation, Inc. 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. 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. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
This program is free software; you can redistribute it and/or modify it 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 under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any Free Software Foundation; either version 2, or (at your option) any
later version. later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */ USA. */
#ifndef _GETOPT_H #ifndef _GETOPT_H
#define _GETOPT_H 1 #define _GETOPT_H 1
...@@ -130,4 +130,4 @@ extern int _getopt_internal (); ...@@ -130,4 +130,4 @@ extern int _getopt_internal ();
} }
#endif #endif
#endif /* _GETOPT_H */ #endif /* getopt.h */
/* getopt_long and getopt_long_only entry points for GNU getopt. /* 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. 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. 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. Bugs can be reported to bug-glibc@prep.ai.mit.edu.
This program is free software; you can redistribute it and/or modify it 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 under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2, or (at your option) any Free Software Foundation; either version 2, or (at your option) any
later version. later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
USA. */ USA. */
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include <config.h> #include <config.h>
......
/* OSF/rose half-pic support definitions. /* 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. This file is part of GNU CC.
...@@ -20,24 +20,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -20,24 +20,7 @@ Boston, MA 02111-1307, USA. */
#ifndef NO_HALF_PIC #ifndef NO_HALF_PIC
/* Add prototype support. */ #include "gansidecl.h"
/* ??? 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
#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__) #if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
union tree_node; /* forward reference */ union tree_node; /* forward reference */
...@@ -64,9 +47,8 @@ extern void half_pic_external PROTO((char *)); /* declare object external */ ...@@ -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 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 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 */ extern struct rtx_def *half_pic_ptr PROTO((struct rtx_def *)); /* return RTX for half-pic pointer */
#ifdef STDIO_PROTO /* Can't use prototype since FILE isn't defined yet. */
extern void half_pic_finish STDIO_PROTO((FILE *)); /* half_pic termination */ extern void half_pic_finish (/* FILE * */); /* half_pic termination */
#endif
/* Macros to provide access to the half-pic stuff (so they can easily /* Macros to provide access to the half-pic stuff (so they can easily
be stubbed out. */ be stubbed out. */
......
/* Declarations for variables relating to reading the source file. /* Declarations for variables relating to reading the source file.
Used by parsers, lexical analyzers, and error message routines. Used by parsers, lexical analyzers, and error message routines.
Copyright (C) 1993, 1997 Free Software Foundation, Inc.
Copyright (C) 1993 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -37,6 +36,7 @@ struct file_stack ...@@ -37,6 +36,7 @@ struct file_stack
char *name; char *name;
struct file_stack *next; struct file_stack *next;
int line; int line;
int indent_level;
}; };
/* Stack of currently pending input files. /* Stack of currently pending input files.
......
#!/bin/sh #!/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 # This script exists for use after installing
# the GCC binaries from a distribution tape/CD-ROM. # the GCC binaries from a distribution tape/CD-ROM.
# Use it *after* copying the directory of binaries # Use it *after* copying the directory of binaries
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
# mc68030 for Motorola 68030 (Sun-3, ..) # mc68030 for Motorola 68030 (Sun-3, ..)
# sparc for SPARC (SUN-4, ..) # sparc for SPARC (SUN-4, ..)
# i386 for i386 (Sun i386, ...) # 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 # Guess what kind of objects we are creating and thus what type of assembler
# symbols to look for # symbols to look for
...@@ -62,7 +62,7 @@ cd $WD ...@@ -62,7 +62,7 @@ cd $WD
# MYSYS=mc68030 # MYSYS=mc68030
# MYSYS=sparc # MYSYS=sparc
# MYSYS=i386 # MYSYS=i386
# MYSYS=i386-linux # MYSYS=i386-gnu-linux
# MYSYS=`mach` # this will work on Suns with SunOS > 4.0.0 # MYSYS=`mach` # this will work on Suns with SunOS > 4.0.0
# MYSYS=elf # MYSYS=elf
# MYSYS=coff # MYSYS=coff
...@@ -103,7 +103,7 @@ BEGIN { ...@@ -103,7 +103,7 @@ BEGIN {
line_delimiter = ","; line_delimiter = ",";
line_offset = 0; 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_hint = "^[ \t]*\.stabd.*"
line_field = 3; line_field = 3;
line_delimiter = ","; line_delimiter = ",";
......
/* This file contains the definitions and documentation for the /* This file contains the definitions and documentation for the
machine modes used in the the GNU compiler. 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. This file is part of GNU CC.
...@@ -84,6 +84,8 @@ DEF_MACHMODE (XFmode, "XF", MODE_FLOAT, 12, 12, TFmode) /* IEEE extended */ ...@@ -84,6 +84,8 @@ DEF_MACHMODE (XFmode, "XF", MODE_FLOAT, 12, 12, TFmode) /* IEEE extended */
DEF_MACHMODE (TFmode, "TF", MODE_FLOAT, 16, 16, VOIDmode) DEF_MACHMODE (TFmode, "TF", MODE_FLOAT, 16, 16, VOIDmode)
/* Complex modes. */ /* 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 (SCmode, "SC", MODE_COMPLEX_FLOAT, 8, 4, DCmode)
DEF_MACHMODE (DCmode, "DC", MODE_COMPLEX_FLOAT, 16, 8, XCmode) DEF_MACHMODE (DCmode, "DC", MODE_COMPLEX_FLOAT, 16, 8, XCmode)
DEF_MACHMODE (XCmode, "XC", MODE_COMPLEX_FLOAT, 24, 12, TCmode) DEF_MACHMODE (XCmode, "XC", MODE_COMPLEX_FLOAT, 24, 12, TCmode)
......
/* Read and manage MIPS symbol tables from object modules. /* 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, Contributed by hartzell@boulder.colorado.edu,
Rewritten by meissner@osf.org. Rewritten by meissner@osf.org.
...@@ -20,13 +20,13 @@ along with GNU CC; see the file COPYING. If not, write to ...@@ -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, the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#include "config.h"
#include <stdio.h> #include <stdio.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/file.h> #include <sys/file.h>
#include <time.h> #include <time.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>
#include "config.h"
#ifdef index #ifdef index
#undef index #undef index
......
/* obstack.c - subroutines used implicitly by object stack macros /* 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 the C library, however. The master source lives in /gd/gnu/lib.
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, NOTE: The canonical source of this file is maintained with the GNU C Library.
but WITHOUT ANY WARRANTY; without even the implied warranty of Bugs can be reported to bug-glibc@prep.ai.mit.edu.
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 This program is free software; you can redistribute it and/or modify it
along with this program; if not, write to the Free Software under the terms of the GNU General Public License as published by the
Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ 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" #include "obstack.h"
...@@ -67,6 +77,28 @@ union fooround {long x; double d;}; ...@@ -67,6 +77,28 @@ union fooround {long x; double d;};
#define COPYING_UNIT int #define COPYING_UNIT int
#endif #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 /* The non-GNU-C macros copy the obstack into this global variable
to avoid multiple evaluation. */ to avoid multiple evaluation. */
...@@ -78,6 +110,20 @@ struct obstack *_obstack; ...@@ -78,6 +110,20 @@ struct obstack *_obstack;
For free, do not use ?:, since some compilers, like the MIPS compilers, For free, do not use ?:, since some compilers, like the MIPS compilers,
do not allow (expr) ? void : void. */ 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) \ #define CALL_CHUNKFUN(h, size) \
(((h) -> use_extra_arg) \ (((h) -> use_extra_arg) \
? (*(h)->chunkfun) ((h)->extra_arg, (size)) \ ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \
...@@ -90,6 +136,7 @@ struct obstack *_obstack; ...@@ -90,6 +136,7 @@ struct obstack *_obstack;
else \ else \
(*(void (*) ()) (h)->freefun) ((old_chunk)); \ (*(void (*) ()) (h)->freefun) ((old_chunk)); \
} while (0) } while (0)
#endif
/* Initialize an obstack H for use. Specify chunk size SIZE (0 means default). /* Initialize an obstack H for use. Specify chunk size SIZE (0 means default).
...@@ -106,13 +153,18 @@ _obstack_begin (h, size, alignment, chunkfun, freefun) ...@@ -106,13 +153,18 @@ _obstack_begin (h, size, alignment, chunkfun, freefun)
struct obstack *h; struct obstack *h;
int size; int size;
int alignment; int alignment;
#if defined (__STDC__) && __STDC__
POINTER (*chunkfun) (long);
void (*freefun) (void *);
#else
POINTER (*chunkfun) (); POINTER (*chunkfun) ();
void (*freefun) (); void (*freefun) ();
#endif
{ {
register struct _obstack_chunk *chunk; /* points to new chunk */ register struct _obstack_chunk *chunk; /* points to new chunk */
if (alignment == 0) if (alignment == 0)
alignment = DEFAULT_ALIGNMENT; alignment = (int) DEFAULT_ALIGNMENT;
if (size == 0) if (size == 0)
/* Default size is what GNU malloc can fit in a 4096-byte block. */ /* Default size is what GNU malloc can fit in a 4096-byte block. */
{ {
...@@ -130,25 +182,27 @@ _obstack_begin (h, size, alignment, chunkfun, freefun) ...@@ -130,25 +182,27 @@ _obstack_begin (h, size, alignment, chunkfun, freefun)
size = 4096 - extra; 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->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
h->freefun = freefun; h->freefun = freefun;
#endif
h->chunk_size = size; h->chunk_size = size;
h->alignment_mask = alignment - 1; h->alignment_mask = alignment - 1;
h->use_extra_arg = 0; h->use_extra_arg = 0;
chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size); chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
if (!chunk) if (!chunk)
{ (*obstack_alloc_failed_handler) ();
h->alloc_failed = 1;
return 0;
}
h->alloc_failed = 0;
h->next_free = h->object_base = chunk->contents; h->next_free = h->object_base = chunk->contents;
h->chunk_limit = chunk->limit h->chunk_limit = chunk->limit
= (char *) chunk + h->chunk_size; = (char *) chunk + h->chunk_size;
chunk->prev = 0; chunk->prev = 0;
/* The initial chunk now contains no empty object. */ /* The initial chunk now contains no empty object. */
h->maybe_empty_object = 0; h->maybe_empty_object = 0;
h->alloc_failed = 0;
return 1; return 1;
} }
...@@ -157,14 +211,19 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg) ...@@ -157,14 +211,19 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
struct obstack *h; struct obstack *h;
int size; int size;
int alignment; int alignment;
#if defined (__STDC__) && __STDC__
POINTER (*chunkfun) (POINTER, long);
void (*freefun) (POINTER, POINTER);
#else
POINTER (*chunkfun) (); POINTER (*chunkfun) ();
void (*freefun) (); void (*freefun) ();
#endif
POINTER arg; POINTER arg;
{ {
register struct _obstack_chunk *chunk; /* points to new chunk */ register struct _obstack_chunk *chunk; /* points to new chunk */
if (alignment == 0) if (alignment == 0)
alignment = DEFAULT_ALIGNMENT; alignment = (int) DEFAULT_ALIGNMENT;
if (size == 0) if (size == 0)
/* Default size is what GNU malloc can fit in a 4096-byte block. */ /* 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) ...@@ -182,8 +241,13 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
size = 4096 - extra; 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->chunkfun = (struct _obstack_chunk * (*)()) chunkfun;
h->freefun = freefun; h->freefun = freefun;
#endif
h->chunk_size = size; h->chunk_size = size;
h->alignment_mask = alignment - 1; h->alignment_mask = alignment - 1;
h->extra_arg = arg; h->extra_arg = arg;
...@@ -191,17 +255,14 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg) ...@@ -191,17 +255,14 @@ _obstack_begin_1 (h, size, alignment, chunkfun, freefun, arg)
chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size); chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size);
if (!chunk) if (!chunk)
{ (*obstack_alloc_failed_handler) ();
h->alloc_failed = 1;
return 0;
}
h->alloc_failed = 0;
h->next_free = h->object_base = chunk->contents; h->next_free = h->object_base = chunk->contents;
h->chunk_limit = chunk->limit h->chunk_limit = chunk->limit
= (char *) chunk + h->chunk_size; = (char *) chunk + h->chunk_size;
chunk->prev = 0; chunk->prev = 0;
/* The initial chunk now contains no empty object. */ /* The initial chunk now contains no empty object. */
h->maybe_empty_object = 0; h->maybe_empty_object = 0;
h->alloc_failed = 0;
return 1; return 1;
} }
...@@ -219,9 +280,9 @@ _obstack_newchunk (h, length) ...@@ -219,9 +280,9 @@ _obstack_newchunk (h, length)
register struct _obstack_chunk *old_chunk = h->chunk; register struct _obstack_chunk *old_chunk = h->chunk;
register struct _obstack_chunk *new_chunk; register struct _obstack_chunk *new_chunk;
register long new_size; register long new_size;
register int obj_size = h->next_free - h->object_base; register long obj_size = h->next_free - h->object_base;
register int i; register long i;
int already; long already;
/* Compute size for new chunk. */ /* Compute size for new chunk. */
new_size = (obj_size + length) + (obj_size >> 3) + 100; new_size = (obj_size + length) + (obj_size >> 3) + 100;
...@@ -231,11 +292,7 @@ _obstack_newchunk (h, length) ...@@ -231,11 +292,7 @@ _obstack_newchunk (h, length)
/* Allocate and initialize the new chunk. */ /* Allocate and initialize the new chunk. */
new_chunk = CALL_CHUNKFUN (h, new_size); new_chunk = CALL_CHUNKFUN (h, new_size);
if (!new_chunk) if (!new_chunk)
{ (*obstack_alloc_failed_handler) ();
h->alloc_failed = 1;
return;
}
h->alloc_failed = 0;
h->chunk = new_chunk; h->chunk = new_chunk;
new_chunk->prev = old_chunk; new_chunk->prev = old_chunk;
new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size; new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size;
...@@ -379,6 +436,39 @@ obstack_free (h, obj) ...@@ -379,6 +436,39 @@ obstack_free (h, obj)
abort (); 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 #if 0
/* These are now turned off because the applications do not use it /* These are now turned off because the applications do not use it
and it uses bcopy via obstack_grow, which causes trouble on sysV. */ and it uses bcopy via obstack_grow, which causes trouble on sysV. */
...@@ -417,6 +507,13 @@ int (obstack_room) (obstack) ...@@ -417,6 +507,13 @@ int (obstack_room) (obstack)
return 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) void (obstack_grow) (obstack, pointer, length)
struct obstack *obstack; struct obstack *obstack;
POINTER pointer; POINTER pointer;
......
/* Declarations for interface to insn recognizer and insn-output.c. /* 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. This file is part of GNU CC.
...@@ -20,37 +20,49 @@ Boston, MA 02111-1307, USA. */ ...@@ -20,37 +20,49 @@ Boston, MA 02111-1307, USA. */
#include "gansidecl.h" #include "gansidecl.h"
/* Recognize an insn and return its insn-code, extern void init_recog PROTO((void));
which is the sequence number of the DEFINE_INSN that it matches. extern void init_recog_no_volatile PROTO((void));
If the insn does not match, return -1. */
extern int recog_memoized PROTO((rtx)); extern int recog_memoized PROTO((rtx));
extern int check_asm_operands PROTO((rtx));
/* Determine whether a proposed change to an insn or MEM will make it
invalid. Make the change if not. */
extern int validate_change PROTO((rtx, rtx *, rtx, int)); extern int validate_change PROTO((rtx, rtx *, rtx, int));
/* Apply a group of changes if valid. */
extern int apply_change_group PROTO((void)); 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)); extern int num_validated_changes PROTO((void));
/* Retract some changes. */
extern void cancel_changes PROTO((int)); 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 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));
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 recog PROTO((rtx, rtx, int *));
extern void add_clobbers PROTO((rtx, int));
extern void insn_extract PROTO((rtx));
/* Nonzero means volatile operands are recognized. */ /* Nonzero means volatile operands are recognized. */
extern int volatile_ok; 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. */ /* The following vectors hold the results from insn_extract. */
/* Indexed by N, gives value of operand N. */ /* Indexed by N, gives value of operand N. */
......
...@@ -29,6 +29,10 @@ Boston, MA 02111-1307, USA. */ ...@@ -29,6 +29,10 @@ Boston, MA 02111-1307, USA. */
#define REG_SIZE(R) \ #define REG_SIZE(R) \
((mode_size[(int) GET_MODE (R)] + UNITS_PER_WORD - 1) / UNITS_PER_WORD) ((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. */ /* Maximum register number used in this function, plus one. */
extern int max_regno; extern int max_regno;
......
%% TeX macros to handle Texinfo files. %% 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, % Copyright (C) 1985, 86, 88, 90, 91, 92, 93,
% 94, 95, 96, 97 Free Software Foundation, Inc. % 94, 95, 96, 97 Free Software Foundation, Inc.
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
% This automatically updates the version number based on RCS. % This automatically updates the version number based on RCS.
\def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}} \def\deftexinfoversion$#1: #2 ${\def\texinfoversion{#2}}
\deftexinfoversion$Revision: 1.1 $ \deftexinfoversion$Revision: 1.1.1.2 $
\message{Loading texinfo package [Version \texinfoversion]:} \message{Loading texinfo package [Version \texinfoversion]:}
% If in a .fmt file, print the version number % If in a .fmt file, print the version number
...@@ -441,14 +441,11 @@ ...@@ -441,14 +441,11 @@
% @. is an end-of-sentence period. % @. is an end-of-sentence period.
\def\.{.\spacefactor=3000 } \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. % @! is an end-of-sentence bang.
\gdef\!{!\spacefactor=3000 } \def\!{!\spacefactor=3000 }
% @? is an end-of-sentence query. % @? is an end-of-sentence query.
\gdef\?{?\spacefactor=3000 } \def\?{?\spacefactor=3000 }
% @w prevents a word break. Without the \leavevmode, @w at the % @w prevents a word break. Without the \leavevmode, @w at the
% beginning of a paragraph, when TeX is still in vertical mode, would % 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.} ...@@ -573,9 +570,27 @@ where each line of input produces a line of output.}
\let\br = \par \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 % @page forces the start of a new page
...@@ -1236,7 +1251,7 @@ where each line of input produces a line of output.} ...@@ -1236,7 +1251,7 @@ where each line of input produces a line of output.}
\let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy
\let\tenttsl=\titlettsl \let\tenttsl=\titlettsl
\resetmathfonts \setleading{25pt}} \resetmathfonts \setleading{25pt}}
\def\titlefont#1{{\titlefonts #1}} \def\titlefont#1{{\titlefonts\rm #1}}
\def\chapfonts{% \def\chapfonts{%
\let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl
\let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc
...@@ -4617,7 +4632,7 @@ width0pt\relax} \fi ...@@ -4617,7 +4632,7 @@ width0pt\relax} \fi
% Check for and read epsf.tex up front. If we read it only at @image % 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 % time, we might be inside a group, and then its definitions would get
% undone and the next image would fail. % undone and the next image would fail.
\openin 1 = xepsf.tex \openin 1 = epsf.tex
\ifeof 1 \else \ifeof 1 \else
\closein 1 \closein 1
\def\epsfannounce{\toks0 = }% do not bother showing banner \def\epsfannounce{\toks0 = }% do not bother showing banner
......
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