From 253149a88a983f38df62086e7e1c7f5b64c58bd6 Mon Sep 17 00:00:00 2001 From: Ethan Roseman Date: Mon, 21 Sep 2020 09:09:56 -0400 Subject: [PATCH] Applied 'gcc-2.8.1-with-naked.diff' --- bc-emit.c | 2 +- c-decl.c | 2 +- c-gperf.h | 2 +- calls.c | 2 +- cccp.c | 133 +- cexp.c | 2646 +++++++++++++++---------- cexp.y | 2 +- combine.c | 2 +- config.sub | 10 + config/i386/dgux.h | 2 +- config/m88k/dgux.h | 2 +- config/mips/mips.c | 4654 ++++++++++++++++++++++---------------------- config/mips/mips.h | 6 + config/mips/nu64.h | 132 ++ configure | 13 +- cp/tree.c | 2 +- emit-rtl.c | 2 +- final.c | 2 +- fixinc.svr4 | 2 +- gcc.c | 2 +- genattrtab.c | 2 +- mips-tfile.c | 2 +- obstack.h | 3 +- prefix.c | 8 +- protoize.c | 2 +- toplev.c | 2 +- tree.c | 2 +- 27 files changed, 4336 insertions(+), 3305 deletions(-) create mode 100644 config/mips/nu64.h diff --git a/bc-emit.c b/bc-emit.c index e67011d..407a346 100644 --- a/bc-emit.c +++ b/bc-emit.c @@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */ #ifdef __STDC__ #include #else -#include +#include #endif #include "machmode.h" #include "rtl.h" diff --git a/c-decl.c b/c-decl.c index 9691e7c..2dee353 100644 --- a/c-decl.c +++ b/c-decl.c @@ -1406,7 +1406,7 @@ duplicate_decls (newdecl, olddecl, different_binding_level) char *errmsg = 0; if (TREE_CODE_CLASS (TREE_CODE (olddecl)) == 'd') - DECL_MACHINE_ATTRIBUTES (newdecl) = DECL_MACHINE_ATTRIBUTES (olddecl); + DECL_MACHINE_ATTRIBUTES (newdecl) = merge_attributes(DECL_MACHINE_ATTRIBUTES (olddecl), DECL_MACHINE_ATTRIBUTES (newdecl)); if (TREE_CODE (newtype) == ERROR_MARK || TREE_CODE (oldtype) == ERROR_MARK) diff --git a/c-gperf.h b/c-gperf.h index 361b9d9..6e01bbd 100644 --- a/c-gperf.h +++ b/c-gperf.h @@ -165,7 +165,7 @@ static struct resword wordlist[] = #ifdef __GNUC__ inline #endif -struct resword * +static struct resword * is_reserved_word (str, len) register char *str; register unsigned int len; diff --git a/calls.c b/calls.c index bec7f34..b271164 100644 --- a/calls.c +++ b/calls.c @@ -28,7 +28,7 @@ Boston, MA 02111-1307, USA. */ #ifdef __STDC__ #include #else -#include +#include #endif #include "insn-flags.h" diff --git a/cccp.c b/cccp.c index 28ff4ca..c9c88cc 100644 --- a/cccp.c +++ b/cccp.c @@ -109,7 +109,7 @@ extern char *getenv (); # define PRINTF_DCL(msg) # define PRINTF_PROTO(ARGS, m, n) PROTO (ARGS) __attribute__ ((format (__printf__, m, n))) #else -# include +# include # define PRINTF_ALIST(msg) msg, va_alist # define PRINTF_DCL(msg) char *msg; va_dcl # define PRINTF_PROTO(ARGS, m, n) () __attribute__ ((format (__printf__, m, n))) @@ -1163,6 +1163,42 @@ safe_read (desc, ptr, len) retrying if necessary, and treating any real error as fatal. If MAX_WRITE_LEN is defined, write at most that many bytes at a time. */ +#ifdef NU64 +enum { KANJI_OFF = 0, KANJI_SJIS, KANJI_EUC }; +static n64kanji_flag = KANJI_OFF; /* by default, KANJI OFF mode */ +#define KANJIENV "N64GCC_KANJI" +static void +kanjienv_check () +{ + char *n64kanji_env; + n64kanji_env = getenv("N64GCC_KANJI"); + if ( !strcasecmp( n64kanji_env, "SJIS" ) ) { + n64kanji_flag = KANJI_SJIS; + } else if ( !strcasecmp( n64kanji_env, "EUC" ) ) { + n64kanji_flag = KANJI_EUC; + } else if ( !strcasecmp( n64kanji_env, "OFF" ) ) { + n64kanji_flag = KANJI_OFF; + } +} + +static int +iskanji1( c ) + U_CHAR c; +{ + switch ( n64kanji_flag ) { + case KANJI_OFF: + return 0; + case KANJI_EUC: + return (c >= 0xa1 && c <= 0xfe); + case KANJI_SJIS: + default: + return (c >= 0x81 && c <= 0x9f) || (c >= 0xe0 && c <= 0xfc); + } +} + +#endif /* NU64 */ + + static void safe_write (desc, ptr, len) int desc; @@ -1171,6 +1207,39 @@ safe_write (desc, ptr, len) { int wcount, written; +#ifdef NU64 + U_CHAR *rptr, *wbuf, *wptr; + int tlen, rlen = len; + + if(n64kanji_flag != KANJI_OFF) { + rptr = ptr, wptr = NULL; + while(rlen--) { + U_CHAR c = *rptr++; + if (wptr) { + int wlen = wptr - wbuf; + if (tlen <= wlen + 8) { + wbuf = (char *)realloc(wbuf, tlen += 0x1000); + wptr = wbuf + wlen; + } + } + if ( iskanji1( c ) ) { + if (!wptr) { + wbuf = (char *)malloc(tlen = len + 0x1000); + memcpy(wbuf, ptr, len - rlen -1); + wptr = wbuf + len - rlen - 1; + } + sprintf(wptr, "\\%03o", c), wptr += 4; + if (rlen--) sprintf(wptr, "\\%03o", *rptr++), wptr += 4; + } else { + if (wptr) *wptr++ = c; + } + } + if (wptr) { + ptr = wbuf; + len = wptr - wbuf; + } + } +#endif while (len > 0) { wcount = len; #ifdef MAX_WRITE_LEN @@ -1191,6 +1260,31 @@ safe_write (desc, ptr, len) } } +#ifdef NU64 +void +nu64cutcr(bufp, lenp) +char **bufp; +int *lenp; +{ + char *wptr, *rptr, *n64cutcr_env; + int wsize = *lenp; + static n64cutcr_flag = -1; + + if (n64cutcr_flag == -1) { + n64cutcr_env = getenv("N64GCC_CUTCR"); + n64cutcr_flag = (n64cutcr_env && !strcasecmp(n64cutcr_env, "ON") ? 1:0); + } + if (n64cutcr_flag) { + wptr = rptr = *bufp; + while(wsize--) { + if (*rptr == 0x0d && rptr[1] == 0x0a && wsize) rptr++, wsize--, (*lenp)--; + *wptr++ = *rptr++; + } + if ((*bufp)[(*lenp)-1] == 0x1a) (*bufp)[--(*lenp)] = '\0'; + } +} +#endif + int main (argc, argv) int argc; @@ -1876,6 +1970,10 @@ main (argc, argv) } } +#ifdef NU64 + kanjienv_check(); +#endif + append_include_chain (before_system, last_before_system); first_system_include = before_system; @@ -2107,6 +2205,9 @@ main (argc, argv) fp->buf = (U_CHAR *) xrealloc (fp->buf, bsize + 2); } fp->length = size; +#ifdef NU64 + nu64cutcr(&fp->buf, &fp->length); +#endif } else { /* Read a file whose size we can determine in advance. For the sake of VMS, st.st_size is just an upper bound. */ @@ -2116,6 +2217,9 @@ main (argc, argv) fp->buf = (U_CHAR *) xmalloc (s + 2); fp->length = safe_read (f, (char *) fp->buf, s); if (fp->length < 0) goto perror; +#ifdef NU64 + nu64cutcr(&fp->buf, &fp->length); +#endif } fp->bufp = fp->buf; fp->if_stack = if_stack; @@ -2788,6 +2892,12 @@ do { ip = &instack[indepth]; \ break; } *obp++ = *ibp; +#ifdef NU64 + if ( iskanji1(*ibp) ) { + ibp++, *obp++ = *ibp++; + continue; + } +#endif switch (*ibp++) { case '\n': ++ip->lineno; @@ -2870,7 +2980,11 @@ do { ip = &instack[indepth]; \ while (++ibp < limit) { if (*ibp == '\n') { +#ifdef NU64 + if (ibp[-1] != '\\' || iskanji1( ibp[-2] )) { +#else if (ibp[-1] != '\\') { +#endif if (put_out_comments) { bcopy ((char *) before_bp, (char *) obp, ibp - before_bp); obp += ibp - before_bp; @@ -3352,7 +3466,12 @@ randomchar: } else if (! traditional) { *obp++ = ' '; } +#ifdef NU64 + for (ibp += 2; *ibp != '\n' || ibp[-1] == '\\' || + !iskanji1( ibp[-2] ); ibp++) +#else for (ibp += 2; *ibp != '\n' || ibp[-1] == '\\'; ibp++) +#endif if (put_out_comments) *obp++ = *ibp; } else @@ -5057,6 +5176,9 @@ finclude (f, inc, op, system_header_p, dirptr) on the number of bytes we can read. */ fp->length = safe_read (f, (char *) fp->buf, s); if (fp->length < 0) goto nope; +#ifdef NU64 + nu64cutcr(&fp->buf, &fp->length); +#endif } else if (S_ISDIR (inc->st.st_mode)) { error ("directory `%s' specified in #include", fname); @@ -5084,6 +5206,9 @@ finclude (f, inc, op, system_header_p, dirptr) } fp->bufp = fp->buf; fp->length = st_size; +#ifdef NU64 + nu64cutcr(&fp->buf, &fp->length); +#endif } if ((fp->length > 0 && fp->buf[fp->length - 1] != '\n') @@ -5177,6 +5302,9 @@ check_precompiled (pcf, st, fname, limit) length = safe_read (pcf, buf, s); if (length < 0) goto nope; +#ifdef NU64 + nu64cutcr(&buf, &length); +#endif } else abort (); @@ -7645,6 +7773,9 @@ skip_to_end_of_comment (ip, line_counter, nowarn) if (*bp == '\n') { if (bp[-1] != '\\') break; +#ifdef NU64 + if ( iskanji1( bp[-2] ) ) break; +#endif if (!nowarn && warn_comments) warning ("multiline `//' comment"); if (line_counter) diff --git a/cexp.c b/cexp.c index f7c51a7..07f1f16 100644 --- a/cexp.c +++ b/cexp.c @@ -1,25 +1,72 @@ +/* A Bison parser, made by GNU Bison 3.3.2. */ -/* A Bison parser, made from cexp.y - by Bison version A2.5 (Andrew Consortium) - */ +/* Bison implementation for Yacc-like parsers in C -#define YYBISON 1 /* Identify Bison output. */ + Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation, + Inc. -#define INT 258 -#define CHAR 259 -#define NAME 260 -#define ERROR 261 -#define OR 262 -#define AND 263 -#define EQUAL 264 -#define NOTEQUAL 265 -#define LEQ 266 -#define GEQ 267 -#define LSH 268 -#define RSH 269 -#define UNARY 270 + 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 3 of the License, or + (at your option) any later version. -#line 27 "cexp.y" + 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, see . */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. + + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ + +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ + +/* All symbols defined below should begin with yy or YY, to avoid + infringing on user name space. This should be done even for local + variables, as they might otherwise be expanded by user macros. + There are some unavoidable exceptions within include files to + define necessary library symbols; they are noted "INFRINGES ON + USER NAME SPACE" below. */ + +/* Undocumented macros, especially those whose name start with YY_, + are private implementation details. Do not rely on them. */ + +/* Identify Bison output. */ +#define YYBISON 1 + +/* Bison version. */ +#define YYBISON_VERSION "3.3.2" + +/* Skeleton name. */ +#define YYSKELETON_NAME "yacc.c" + +/* Pure parsers. */ +#define YYPURE 0 + +/* Push parsers. */ +#define YYPUSH 0 + +/* Pull parsers. */ +#define YYPULL 1 + + + + +/* First part of user prologue. */ +#line 27 "cexp.y" /* yacc.c:337 */ #include "config.h" #include @@ -124,7 +171,7 @@ struct arglist { # define PRINTF_DCL(msg) # define PRINTF_PROTO(ARGS, m, n) PROTO (ARGS) __attribute__ ((format (__printf__, m, n))) #else -# include +# include # define VA_START(va_list, var) va_start (va_list) # define PRINTF_ALIST(msg) msg, va_alist # define PRINTF_DCL(msg) char *msg; va_dcl @@ -243,1161 +290,1810 @@ static void integer_overflow PROTO((void)); #define SIGNED (~0) #define UNSIGNED 0 -#line 251 "cexp.y" -typedef union { +#line 294 "cexp.c" /* yacc.c:337 */ +# ifndef YY_NULLPTR +# if defined __cplusplus +# if 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# else +# define YY_NULLPTR ((void*)0) +# endif +# endif + +/* Enabling verbose error messages. */ +#ifdef YYERROR_VERBOSE +# undef YYERROR_VERBOSE +# define YYERROR_VERBOSE 1 +#else +# define YYERROR_VERBOSE 0 +#endif + + +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int yydebug; +#endif + +/* Token type. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + enum yytokentype + { + INT = 258, + CHAR = 259, + NAME = 260, + ERROR = 261, + OR = 262, + AND = 263, + EQUAL = 264, + NOTEQUAL = 265, + LEQ = 266, + GEQ = 267, + LSH = 268, + RSH = 269, + UNARY = 270 + }; +#endif + +/* Value type. */ +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED + +union YYSTYPE +{ +#line 251 "cexp.y" /* yacc.c:352 */ + struct constant {HOST_WIDE_INT value; int signedp;} integer; struct name {U_CHAR *address; int length;} name; struct arglist *keywords; -} YYSTYPE; -#include -#ifndef __cplusplus -#ifndef __STDC__ -#define const -#endif +#line 356 "cexp.c" /* yacc.c:352 */ +}; + +typedef union YYSTYPE YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define YYSTYPE_IS_DECLARED 1 #endif +extern YYSTYPE yylval; -#define YYFINAL 77 -#define YYFLAG -32768 -#define YYNTBASE 34 +int yyparse (void); -#define YYTRANSLATE(x) ((unsigned)(x) <= 270 ? yytranslate[x] : 43) -static const char yytranslate[] = { 0, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 29, 2, 31, 2, 27, 14, 2, 32, - 33, 25, 23, 9, 24, 2, 26, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 8, 2, 17, - 2, 18, 7, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 13, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 12, 2, 30, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, - 6, 10, 11, 15, 16, 19, 20, 21, 22, 28 -}; -#if YYDEBUG != 0 -static const short yyprhs[] = { 0, - 0, 2, 4, 8, 11, 14, 17, 20, 23, 24, - 31, 35, 39, 43, 47, 51, 55, 59, 63, 67, - 71, 75, 79, 83, 87, 91, 95, 99, 100, 105, - 106, 111, 112, 113, 121, 123, 125, 127, 128, 133 -}; -static const short yyrhs[] = { 35, - 0, 36, 0, 35, 9, 36, 0, 24, 36, 0, - 29, 36, 0, 23, 36, 0, 30, 36, 0, 31, - 5, 0, 0, 31, 5, 37, 32, 42, 33, 0, - 32, 35, 33, 0, 36, 25, 36, 0, 36, 26, - 36, 0, 36, 27, 36, 0, 36, 23, 36, 0, - 36, 24, 36, 0, 36, 21, 36, 0, 36, 22, - 36, 0, 36, 15, 36, 0, 36, 16, 36, 0, - 36, 19, 36, 0, 36, 20, 36, 0, 36, 17, - 36, 0, 36, 18, 36, 0, 36, 14, 36, 0, - 36, 13, 36, 0, 36, 12, 36, 0, 0, 36, - 11, 38, 36, 0, 0, 36, 10, 39, 36, 0, - 0, 0, 36, 7, 40, 36, 8, 41, 36, 0, - 3, 0, 4, 0, 5, 0, 0, 32, 42, 33, - 42, 0, 5, 42, 0 -}; +#ifdef short +# undef short #endif -#if YYDEBUG != 0 -static const short yyrline[] = { 0, - 281, 291, 292, 299, 304, 307, 309, 312, 316, 318, - 323, 328, 341, 358, 371, 377, 383, 389, 395, 398, - 401, 408, 415, 422, 429, 432, 435, 438, 441, 444, - 447, 450, 452, 455, 458, 460, 462, 470, 472, 485 -}; +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif + +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#else +typedef signed char yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t +# else +# define YYSIZE_T unsigned +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if defined YYENABLE_NLS && YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) +# endif +# endif +# ifndef YY_ +# define YY_(Msgid) Msgid +# endif +#endif + +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(E) ((void) (E)) +#else +# define YYUSE(E) /* empty */ +#endif + +#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") +#else +# define YY_INITIAL_VALUE(Value) Value +#endif +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif -#if YYDEBUG != 0 +#if ! defined yyoverflow || YYERROR_VERBOSE -static const char * const yytname[] = { "$","error","$undefined.","INT","CHAR", -"NAME","ERROR","'?'","':'","','","OR","AND","'|'","'^'","'&'","EQUAL","NOTEQUAL", -"'<'","'>'","LEQ","GEQ","LSH","RSH","'+'","'-'","'*'","'/'","'%'","UNARY","'!'", -"'~'","'#'","'('","')'","start","exp1","exp","@1","@2","@3","@4","@5","keywords", NULL +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca +# else +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS +# include /* INFRINGES ON USER NAME SPACE */ + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# endif +# endif +# endif + +# ifdef YYSTACK_ALLOC + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif +# else +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined EXIT_SUCCESS +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined EXIT_SUCCESS +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# endif +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ + + +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + +/* A type that is properly aligned for any stack member. */ +union yyalloc +{ + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; +}; + +/* The size of the maximum gap between one aligned stack and the next. */ +# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) + +/* The size of an array large to enough to hold all stacks, each with + N elements. */ +# define YYSTACK_BYTES(N) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + + YYSTACK_GAP_MAXIMUM) + +# define YYCOPY_NEEDED 1 + +/* Relocate STACK from its old location to the new one. The + local variables YYSIZE and YYSTACKSIZE give the old and new number of + elements in the stack, and YYPTR gives the new location of the + stack. Advance YYPTR to a properly aligned location for the next + stack. */ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) + +#endif + +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 19 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 190 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 34 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 10 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 41 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 77 + +#define YYUNDEFTOK 2 +#define YYMAXUTOK 270 + +/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, with out-of-bounds checking. */ +#define YYTRANSLATE(YYX) \ + ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) + +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex. */ +static const yytype_uint8 yytranslate[] = +{ + 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 29, 2, 31, 2, 27, 14, 2, + 32, 33, 25, 23, 9, 24, 2, 26, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 8, 2, + 17, 2, 18, 7, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 13, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 12, 2, 30, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, + 5, 6, 10, 11, 15, 16, 19, 20, 21, 22, + 28 +}; + +#if YYDEBUG + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 281, 281, 291, 292, 299, 304, 307, 309, 312, + 317, 316, 323, 328, 341, 358, 371, 377, 383, 389, + 395, 398, 401, 408, 415, 422, 429, 432, 435, 439, + 438, 445, 444, 451, 453, 450, 458, 460, 462, 471, + 472, 485 }; #endif -static const short yyr1[] = { 0, - 34, 35, 35, 36, 36, 36, 36, 36, 37, 36, - 36, 36, 36, 36, 36, 36, 36, 36, 36, 36, - 36, 36, 36, 36, 36, 36, 36, 38, 36, 39, - 36, 40, 41, 36, 36, 36, 36, 42, 42, 42 +#if YYDEBUG || YYERROR_VERBOSE || 0 +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +static const char *const yytname[] = +{ + "$end", "error", "$undefined", "INT", "CHAR", "NAME", "ERROR", "'?'", + "':'", "','", "OR", "AND", "'|'", "'^'", "'&'", "EQUAL", "NOTEQUAL", + "'<'", "'>'", "LEQ", "GEQ", "LSH", "RSH", "'+'", "'-'", "'*'", "'/'", + "'%'", "UNARY", "'!'", "'~'", "'#'", "'('", "')'", "$accept", "start", + "exp1", "exp", "$@1", "$@2", "$@3", "$@4", "$@5", "keywords", YY_NULLPTR +}; +#endif + +# ifdef YYPRINT +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ +static const yytype_uint16 yytoknum[] = +{ + 0, 256, 257, 258, 259, 260, 261, 63, 58, 44, + 262, 263, 124, 94, 38, 264, 265, 60, 62, 266, + 267, 268, 269, 43, 45, 42, 47, 37, 270, 33, + 126, 35, 40, 41 +}; +# endif + +#define YYPACT_NINF -63 + +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-63))) + +#define YYTABLE_NINF -11 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = +{ + 14, -63, -63, -63, 14, 14, 14, 14, 5, 14, + 11, 6, 81, -63, -63, -63, -63, -18, 33, -63, + 14, -63, -63, -63, 14, 14, 14, 14, 14, 14, + 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, + 32, -63, 81, 14, 14, 14, 112, 126, 139, 150, + 150, 157, 157, 157, 157, 162, 162, -19, -19, -63, + -63, -63, 4, 60, 36, 97, 4, 4, -20, -63, + -63, 56, -63, 14, 4, 81, -63 }; -static const short yyr2[] = { 0, - 1, 1, 3, 2, 2, 2, 2, 2, 0, 6, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 0, 4, 0, - 4, 0, 0, 7, 1, 1, 1, 0, 4, 2 + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ +static const yytype_uint8 yydefact[] = +{ + 0, 36, 37, 38, 0, 0, 0, 0, 0, 0, + 0, 2, 3, 7, 5, 6, 8, 9, 0, 1, + 0, 33, 31, 29, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 12, 4, 0, 0, 0, 28, 27, 26, 20, + 21, 24, 25, 22, 23, 18, 19, 16, 17, 13, + 14, 15, 39, 0, 32, 30, 39, 39, 0, 34, + 41, 0, 11, 0, 39, 35, 40 }; -static const short yydefact[] = { 0, - 35, 36, 37, 0, 0, 0, 0, 0, 0, 1, - 2, 6, 4, 5, 7, 8, 0, 0, 32, 30, - 28, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 11, 3, - 0, 0, 0, 27, 26, 25, 19, 20, 23, 24, - 21, 22, 17, 18, 15, 16, 12, 13, 14, 38, - 0, 31, 29, 38, 38, 0, 33, 40, 0, 10, - 0, 38, 34, 39, 0, 0, 0 + /* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -63, -63, 181, -4, -63, -63, -63, -63, -63, -62 }; -static const short yydefgoto[] = { 75, - 10, 11, 38, 43, 42, 41, 71, 66 + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = +{ + -1, 10, 11, 12, 40, 45, 44, 43, 73, 68 }; -static const short yypact[] = { 12, --32768,-32768,-32768, 12, 12, 12, 12, 1, 12, 4, - 79,-32768,-32768,-32768,-32768, -21, 31, 12,-32768,-32768, --32768, 12, 12, 12, 12, 12, 12, 12, 12, 12, - 12, 12, 12, 12, 12, 12, 12, 30,-32768, 79, - 12, 12, 12, 110, 124, 137, 148, 148, 155, 155, - 155, 155, 160, 160, -17, -17,-32768,-32768,-32768, 2, - 58, 34, 95, 2, 2, 54,-32768,-32768, 55,-32768, - 12, 2, 79,-32768, 63, 188,-32768 + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ +static const yytype_int8 yytable[] = +{ + 13, 14, 15, 16, 70, 71, 37, 38, 39, 66, + 17, 19, 76, 72, -10, 20, 42, 1, 2, 3, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 67, 4, 5, 63, + 64, 65, 20, 6, 7, 8, 9, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 62, 0, 41, 21, 69, 75, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 21, 74, + 0, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, + 35, 36, 37, 38, 39, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 27, 28, 29, 30, 31, 32, + 33, 34, 35, 36, 37, 38, 39, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 33, 34, + 35, 36, 37, 38, 39, 35, 36, 37, 38, 39, + 18 }; -static const short yypgoto[] = {-32768, - 180, -4,-32768,-32768,-32768,-32768,-32768, -60 +static const yytype_int8 yycheck[] = +{ + 4, 5, 6, 7, 66, 67, 25, 26, 27, 5, + 5, 0, 74, 33, 32, 9, 20, 3, 4, 5, + 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, + 34, 35, 36, 37, 38, 39, 32, 23, 24, 43, + 44, 45, 9, 29, 30, 31, 32, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 32, -1, 33, 7, 8, 73, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 7, 33, + -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 21, 22, + 23, 24, 25, 26, 27, 23, 24, 25, 26, 27, + 9 +}; + + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 3, 4, 5, 23, 24, 29, 30, 31, 32, + 35, 36, 37, 37, 37, 37, 37, 5, 36, 0, + 9, 7, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 38, 33, 37, 41, 40, 39, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 32, 37, 37, 37, 5, 32, 43, 8, + 43, 43, 33, 42, 33, 37, 43 +}; + + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 34, 35, 36, 36, 37, 37, 37, 37, 37, + 38, 37, 37, 37, 37, 37, 37, 37, 37, 37, + 37, 37, 37, 37, 37, 37, 37, 37, 37, 39, + 37, 40, 37, 41, 42, 37, 37, 37, 37, 43, + 43, 43 +}; + + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 1, 3, 2, 2, 2, 2, 2, + 0, 6, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 0, + 4, 0, 4, 0, 0, 7, 1, 1, 1, 0, + 4, 2 }; -#define YYLAST 189 +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 + +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab -static const short yytable[] = { 12, - 13, 14, 15, 68, 69, 16, 64, 35, 36, 37, - -9, 74, 18, 40, 1, 2, 3, 44, 45, 46, - 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, - 57, 58, 59, 65, 4, 5, 61, 62, 63, 18, - 6, 7, 8, 9, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 60, 76, 39, 19, 67, 73, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 19, 70, 72, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 24, 25, 26, - 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 25, 26, 27, 28, 29, 30, 31, 32, 33, - 34, 35, 36, 37, 27, 28, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 31, 32, 33, 34, 35, - 36, 37, 33, 34, 35, 36, 37, 77, 17 -}; - -static const short yycheck[] = { 4, - 5, 6, 7, 64, 65, 5, 5, 25, 26, 27, - 32, 72, 9, 18, 3, 4, 5, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 32, 23, 24, 41, 42, 43, 9, - 29, 30, 31, 32, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 32, 0, 33, 7, 8, 71, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 7, 33, 33, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 21, 22, 23, 24, 25, - 26, 27, 23, 24, 25, 26, 27, 0, 9 -}; -/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ -#line 3 "/usr/share/bison.simple" - -/* Skeleton output parser for bison, - Copyright (C) 1984, 1989, 1990 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. - - 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ - -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ - -#ifndef alloca -#ifdef __GNUC__ -#define alloca __builtin_alloca -#else /* not GNU C. */ -#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) -#include -#else /* not sparc */ -#if defined (MSDOS) && !defined (__TURBOC__) -#include -#else /* not MSDOS, or __TURBOC__ */ -#if defined(_AIX) -#include - #pragma alloca -#else /* not MSDOS, __TURBOC__, or _AIX */ -#ifdef __hpux -#ifdef __cplusplus -extern "C" { -void *alloca (unsigned int); -}; -#else /* not __cplusplus */ -void *alloca (); -#endif /* not __cplusplus */ -#endif /* __hpux */ -#endif /* not _AIX */ -#endif /* not MSDOS, or __TURBOC__ */ -#endif /* not sparc. */ -#endif /* not GNU C. */ -#endif /* alloca not defined. */ - -/* This is the parser code that is written into each bison parser - when the %semantic_parser declaration is not specified in the grammar. - It was written by Richard Stallman by simplifying the hairy parser - used when %semantic_parser is specified. */ - -/* Note: there must be only one dollar sign in this file. - It is replaced by the list of actions, each action - as one case of the switch. */ - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY -2 -#define YYEOF 0 -#define YYACCEPT return(0) -#define YYABORT return(1) -#define YYERROR goto yyerrlab1 -/* Like YYERROR except do call yyerror. - This remains here temporarily to ease the - transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ -#define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(token, value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { yychar = (token), yylval = (value); \ - yychar1 = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ - goto yybackup; \ - } \ - else \ - { yyerror ("syntax error: cannot back up"); YYERROR; } \ -while (0) -#define YYTERROR 1 -#define YYERRCODE 256 +#define YYBACKUP(Token, Value) \ + do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ + yyerror (YY_("syntax error: cannot back up")); \ + YYERROR; \ + } \ + while (0) -#ifndef YYPURE -#define YYLEX yylex() +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 + + + +/* Enable debugging if requested. */ +#if YYDEBUG + +# ifndef YYFPRINTF +# include /* INFRINGES ON USER NAME SPACE */ +# define YYFPRINTF fprintf +# endif + +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) + +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif -#ifdef YYPURE -#ifdef YYLSP_NEEDED -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval, &yylloc) -#endif -#else /* not YYLSP_NEEDED */ -#ifdef YYLEX_PARAM -#define YYLEX yylex(&yylval, YYLEX_PARAM) -#else -#define YYLEX yylex(&yylval) -#endif -#endif /* not YYLSP_NEEDED */ + +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*-----------------------------------. +| Print this symbol's value on YYO. | +`-----------------------------------*/ + +static void +yy_symbol_value_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) +{ + FILE *yyoutput = yyo; + YYUSE (yyoutput); + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyo, yytoknum[yytype], *yyvaluep); +# endif + YYUSE (yytype); +} + + +/*---------------------------. +| Print this symbol on YYO. | +`---------------------------*/ + +static void +yy_symbol_print (FILE *yyo, int yytype, YYSTYPE const * const yyvaluep) +{ + YYFPRINTF (yyo, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); + + yy_symbol_value_print (yyo, yytype, yyvaluep); + YYFPRINTF (yyo, ")"); +} + +/*------------------------------------------------------------------. +| yy_stack_print -- Print the state stack from its BOTTOM up to its | +| TOP (included). | +`------------------------------------------------------------------*/ + +static void +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) +{ + YYFPRINTF (stderr, "Stack now"); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } + YYFPRINTF (stderr, "\n"); +} + +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) + + +/*------------------------------------------------. +| Report that the YYRULE is going to be reduced. | +`------------------------------------------------*/ + +static void +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) +{ + unsigned long yylno = yyrline[yyrule]; + int yynrhs = yyr2[yyrule]; + int yyi; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + YYFPRINTF (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &yyvsp[(yyi + 1) - (yynrhs)] + ); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ +} while (0) + +/* Nonzero means print parse trace. It is left uninitialized so that + multiple parsers can coexist. */ +int yydebug; +#else /* !YYDEBUG */ +# define YYDPRINTF(Args) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) +# define YY_STACK_PRINT(Bottom, Top) +# define YY_REDUCE_PRINT(Rule) +#endif /* !YYDEBUG */ + + +/* YYINITDEPTH -- initial size of the parser's stacks. */ +#ifndef YYINITDEPTH +# define YYINITDEPTH 200 #endif -/* If nonreentrant, generate the variables here */ +/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only + if the built-in stack extension method is used). -#ifndef YYPURE - -int yychar; /* the lookahead symbol */ -YYSTYPE yylval; /* the semantic value of the */ - /* lookahead symbol */ - -#ifdef YYLSP_NEEDED -YYLTYPE yylloc; /* location data for the lookahead */ - /* symbol */ -#endif - -int yynerrs; /* number of parse errors so far */ -#endif /* not YYPURE */ - -#if YYDEBUG != 0 -int yydebug; /* nonzero means print parse trace */ -/* Since this is uninitialized, it does not stop multiple parsers - from coexisting. */ -#endif - -/* YYINITDEPTH indicates the initial size of the parser's stacks */ - -#ifndef YYINITDEPTH -#define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH is the maximum size the stacks can grow to - (effective only if the built-in stack extension method is used). */ - -#if YYMAXDEPTH == 0 -#undef YYMAXDEPTH -#endif + Do not make this value too large; the results are undefined if + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) + evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH -#define YYMAXDEPTH 10000 +# define YYMAXDEPTH 10000 #endif -/* Prevent warning if -Wstrict-prototypes. */ -#ifdef __GNUC__ -int yyparse (void); -#endif - -#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ -#define __yy_memcpy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT) -#else /* not GNU C or C++ */ -#ifndef __cplusplus -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (from, to, count) - char *from; - char *to; - int count; +#if YYERROR_VERBOSE + +# ifndef yystrlen +# if defined __GLIBC__ && defined _STRING_H +# define yystrlen strlen +# else +/* Return the length of YYSTR. */ +static YYSIZE_T +yystrlen (const char *yystr) { - register char *f = from; - register char *t = to; - register int i = count; + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) + continue; + return yylen; +} +# endif +# endif - while (i-- > 0) - *t++ = *f++; +# ifndef yystpcpy +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE +# define yystpcpy stpcpy +# else +/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in + YYDEST. */ +static char * +yystpcpy (char *yydest, const char *yysrc) +{ + char *yyd = yydest; + const char *yys = yysrc; + + while ((*yyd++ = *yys++) != '\0') + continue; + + return yyd - 1; +} +# endif +# endif + +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + else + goto append; + + append: + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } + + if (! yyres) + return yystrlen (yystr); + + return (YYSIZE_T) (yystpcpy (yyres, yystr) - yyres); +} +# endif + +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) +{ + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) + { + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return 2; + } + } + } + } + + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + default: /* Avoid compiler warnings. */ + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } + + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) + yysize = yysize1; + else + return 2; + } + + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; +} +#endif /* YYERROR_VERBOSE */ + +/*-----------------------------------------------. +| Release the memory associated to this symbol. | +`-----------------------------------------------*/ + +static void +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) +{ + YYUSE (yyvaluep); + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); + + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } -#else /* __cplusplus */ -/* This is the most reliable way to avoid incompatibilities - in available built-in functions on various systems. */ -static void -__yy_memcpy (char *from, char *to, int count) -{ - register char *f = from; - register char *t = to; - register int i = count; - while (i-- > 0) - *t++ = *f++; -} -#endif -#endif - -#line 192 "/usr/share/bison.simple" +/* The lookahead symbol. */ +int yychar; -/* The user can define YYPARSE_PARAM as the name of an argument to be passed - into yyparse. The argument should have type void *. - It should actually point to an object. - Grammar actions can access the variable by casting it - to the proper pointer type. */ +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; +/* Number of syntax errors so far. */ +int yynerrs; -#ifdef YYPARSE_PARAM -#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; -#else -#define YYPARSE_PARAM -#define YYPARSE_PARAM_DECL -#endif + +/*----------. +| yyparse. | +`----------*/ int -yyparse(YYPARSE_PARAM) - YYPARSE_PARAM_DECL +yyparse (void) { - register int yystate; - register int yyn; - register short *yyssp; - register YYSTYPE *yyvsp; - int yyerrstatus; /* number of tokens to shift before error messages enabled */ - int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; - short yyssa[YYINITDEPTH]; /* the state stack */ - YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + /* The stacks and their tools: + 'yyss': related to states. + 'yyvs': related to semantic values. - short *yyss = yyssa; /* refer to the stacks thru separate pointers */ - YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + Refer to the stacks through separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ -#ifdef YYLSP_NEEDED - YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; -#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) -#else -#define YYPOPSTACK (yyvsp--, yyssp--) + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken = 0; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif - int yystacksize = YYINITDEPTH; +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) -#ifdef YYPURE - int yychar; - YYSTYPE yylval; - int yynerrs; -#ifdef YYLSP_NEEDED - YYLTYPE yylloc; -#endif -#endif + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; - YYSTYPE yyval; /* the variable used to return */ - /* semantic values from the action */ - /* routines */ + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; + yystacksize = YYINITDEPTH; - int yylen; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Starting parse\n"); -#endif + YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ + goto yysetstate; - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss - 1; - yyvsp = yyvs; -#ifdef YYLSP_NEEDED - yylsp = yyls; -#endif - -/* Push a new state, which is found in yystate . */ -/* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. */ +/*------------------------------------------------------------. +| yynewstate -- push a new state, which is found in yystate. | +`------------------------------------------------------------*/ yynewstate: + /* In all cases, when you get here, the value and location stacks + have just been pushed. So pushing a state here evens the stacks. */ + yyssp++; - *++yyssp = yystate; - if (yyssp >= yyss + yystacksize - 1) - { - /* Give user a chance to reallocate the stack */ - /* Use copies of these so that the &'s don't force the real ones into memory. */ - YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; -#ifdef YYLSP_NEEDED - YYLTYPE *yyls1 = yyls; -#endif +/*--------------------------------------------------------------------. +| yynewstate -- set current state (the top of the stack) to yystate. | +`--------------------------------------------------------------------*/ +yysetstate: + *yyssp = (yytype_int16) yystate; - /* Get the current used size of the three stacks, in elements. */ - int size = yyssp - yyss + 1; - -#ifdef yyoverflow - /* Each stack pointer address is followed by the size of - the data in use in that stack, in bytes. */ -#ifdef YYLSP_NEEDED - /* This used to be a conditional around just the two extra args, - but that might be undefined if yyoverflow is a macro. */ - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yyls1, size * sizeof (*yylsp), - &yystacksize); + if (yyss + yystacksize - 1 <= yyssp) +#if !defined yyoverflow && !defined YYSTACK_RELOCATE + goto yyexhaustedlab; #else - yyoverflow("parser stack overflow", - &yyss1, size * sizeof (*yyssp), - &yyvs1, size * sizeof (*yyvsp), - &yystacksize); -#endif + { + /* Get the current used size of the three stacks, in elements. */ + YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1); - yyss = yyss1; yyvs = yyvs1; -#ifdef YYLSP_NEEDED - yyls = yyls1; -#endif -#else /* no yyoverflow */ +# if defined yyoverflow + { + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + yyss = yyss1; + yyvs = yyvs1; + } +# else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ - if (yystacksize >= YYMAXDEPTH) - { - yyerror("parser stack overflow"); - return 2; - } + if (YYMAXDEPTH <= yystacksize) + goto yyexhaustedlab; yystacksize *= 2; - if (yystacksize > YYMAXDEPTH) - yystacksize = YYMAXDEPTH; - yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); - __yy_memcpy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp)); - yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); - __yy_memcpy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp)); -#ifdef YYLSP_NEEDED - yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); - __yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp)); -#endif -#endif /* no yyoverflow */ + if (YYMAXDEPTH < yystacksize) + yystacksize = YYMAXDEPTH; - yyssp = yyss + size - 1; - yyvsp = yyvs + size - 1; -#ifdef YYLSP_NEEDED - yylsp = yyls + size - 1; -#endif + { + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Stack size increased to %d\n", yystacksize); -#endif + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; - if (yyssp >= yyss + yystacksize - 1) - YYABORT; + YYDPRINTF ((stderr, "Stack size increased to %lu\n", + (unsigned long) yystacksize)); + + if (yyss + yystacksize - 1 <= yyssp) + YYABORT; } +#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Entering state %d\n", yystate); -#endif + YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + + if (yystate == YYFINAL) + YYACCEPT; goto yybackup; - yybackup: -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ + +/*-----------. +| yybackup. | +`-----------*/ +yybackup: + /* Do appropriate processing given the current state. Read a + lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yyn == YYFLAG) + if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ - /* yychar is either YYEMPTY or YYEOF - or a valid token in external form. */ - + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Reading a token: "); -#endif - yychar = YYLEX; + YYDPRINTF ((stderr, "Reading a token: ")); + yychar = yylex (); } - /* Convert token to internal form (in yychar1) for indexing tables with */ - - if (yychar <= 0) /* This means end of input. */ + if (yychar <= YYEOF) { - yychar1 = 0; - yychar = YYEOF; /* Don't call YYLEX any more */ - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Now at end of input.\n"); -#endif + yychar = yytoken = YYEOF; + YYDPRINTF ((stderr, "Now at end of input.\n")); } else { - yychar1 = YYTRANSLATE(yychar); - -#if YYDEBUG != 0 - if (yydebug) - { - fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); - /* Give the individual parser a way to print the precise meaning - of a token, for further debugging info. */ -#ifdef YYPRINT - YYPRINT (stderr, yychar, yylval); -#endif - fprintf (stderr, ")\n"); - } -#endif + yytoken = YYTRANSLATE (yychar); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } - yyn += yychar1; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + /* If the proper action on seeing token YYTOKEN is to reduce or to + detect an error, take that action. */ + yyn += yytoken; + if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; - yyn = yytable[yyn]; - - /* yyn is what to do for this token type in this state. - Negative => reduce, -yyn is rule number. - Positive => shift, yyn is new state. - New state is final state => don't bother to shift, - just return success. - 0, or most negative number => error. */ - - if (yyn < 0) + if (yyn <= 0) { - if (yyn == YYFLAG) - goto yyerrlab; + if (yytable_value_is_error (yyn)) + goto yyerrlab; yyn = -yyn; goto yyreduce; } - else if (yyn == 0) - goto yyerrlab; - if (yyn == YYFINAL) - YYACCEPT; + /* Count tokens shifted since error; after three, turn off error + status. */ + if (yyerrstatus) + yyerrstatus--; /* Shift the lookahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); -#endif - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif - - /* count tokens shifted since error; after three, turn off error status. */ - if (yyerrstatus) yyerrstatus--; + /* Discard the shifted token. */ + yychar = YYEMPTY; yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END + goto yynewstate; -/* Do the default action for the current state. */ -yydefault: +/*-----------------------------------------------------------. +| yydefault -- do the default action for the current state. | +`-----------------------------------------------------------*/ +yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; + goto yyreduce; -/* Do a reduction. yyn is the number of a rule to reduce with. */ + +/*-----------------------------. +| yyreduce -- do a reduction. | +`-----------------------------*/ yyreduce: + /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; - if (yylen > 0) - yyval = yyvsp[1-yylen]; /* implement default value of the action */ -#if YYDEBUG != 0 - if (yydebug) + /* If YYLEN is nonzero, implement the default value of the action: + '$$ = $1'. + + Otherwise, the following line sets YYVAL to garbage. + This behavior is undocumented and Bison + users should not rely upon it. Assigning to YYVAL + unconditionally makes the parser a bit smaller, and it avoids a + GCC warning that YYVAL may be used uninitialized. */ + yyval = yyvsp[1-yylen]; + + + YY_REDUCE_PRINT (yyn); + switch (yyn) { - int i; - - fprintf (stderr, "Reducing via rule %d (line %d), ", - yyn, yyrline[yyn]); - - /* Print the symbols being reduced, and their result. */ - for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) - fprintf (stderr, "%s ", yytname[yyrhs[i]]); - fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); - } -#endif - - - switch (yyn) { - -case 1: -#line 282 "cexp.y" -{ - expression_value = yyvsp[0].integer.value; + case 2: +#line 282 "cexp.y" /* yacc.c:1652 */ + { + expression_value = (yyvsp[0].integer).value; #ifdef TEST_EXP_READER - expression_signedp = yyvsp[0].integer.signedp; + expression_signedp = (yyvsp[0].integer).signedp; #endif - ; - break;} -case 3: -#line 293 "cexp.y" -{ if (pedantic) + } +#line 1520 "cexp.c" /* yacc.c:1652 */ + break; + + case 4: +#line 293 "cexp.y" /* yacc.c:1652 */ + { if (pedantic) pedwarn ("comma operator in operand of `#if'"); - yyval.integer = yyvsp[0].integer; ; - break;} -case 4: -#line 300 "cexp.y" -{ yyval.integer.value = - yyvsp[0].integer.value; - yyval.integer.signedp = yyvsp[0].integer.signedp; - if ((yyval.integer.value & yyvsp[0].integer.value & yyval.integer.signedp) < 0) - integer_overflow (); ; - break;} -case 5: -#line 305 "cexp.y" -{ yyval.integer.value = ! yyvsp[0].integer.value; - yyval.integer.signedp = SIGNED; ; - break;} -case 6: -#line 308 "cexp.y" -{ yyval.integer = yyvsp[0].integer; ; - break;} -case 7: -#line 310 "cexp.y" -{ yyval.integer.value = ~ yyvsp[0].integer.value; - yyval.integer.signedp = yyvsp[0].integer.signedp; ; - break;} -case 8: -#line 313 "cexp.y" -{ yyval.integer.value = check_assertion (yyvsp[0].name.address, yyvsp[0].name.length, + (yyval.integer) = (yyvsp[0].integer); } +#line 1528 "cexp.c" /* yacc.c:1652 */ + break; + + case 5: +#line 300 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).value = - (yyvsp[0].integer).value; + (yyval.integer).signedp = (yyvsp[0].integer).signedp; + if (((yyval.integer).value & (yyvsp[0].integer).value & (yyval.integer).signedp) < 0) + integer_overflow (); } +#line 1537 "cexp.c" /* yacc.c:1652 */ + break; + + case 6: +#line 305 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).value = ! (yyvsp[0].integer).value; + (yyval.integer).signedp = SIGNED; } +#line 1544 "cexp.c" /* yacc.c:1652 */ + break; + + case 7: +#line 308 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer) = (yyvsp[0].integer); } +#line 1550 "cexp.c" /* yacc.c:1652 */ + break; + + case 8: +#line 310 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).value = ~ (yyvsp[0].integer).value; + (yyval.integer).signedp = (yyvsp[0].integer).signedp; } +#line 1557 "cexp.c" /* yacc.c:1652 */ + break; + + case 9: +#line 313 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).value = check_assertion ((yyvsp[0].name).address, (yyvsp[0].name).length, 0, NULL_PTR); - yyval.integer.signedp = SIGNED; ; - break;} -case 9: -#line 317 "cexp.y" -{ keyword_parsing = 1; ; - break;} -case 10: -#line 319 "cexp.y" -{ yyval.integer.value = check_assertion (yyvsp[-4].name.address, yyvsp[-4].name.length, - 1, yyvsp[-1].keywords); + (yyval.integer).signedp = SIGNED; } +#line 1565 "cexp.c" /* yacc.c:1652 */ + break; + + case 10: +#line 317 "cexp.y" /* yacc.c:1652 */ + { keyword_parsing = 1; } +#line 1571 "cexp.c" /* yacc.c:1652 */ + break; + + case 11: +#line 319 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).value = check_assertion ((yyvsp[-4].name).address, (yyvsp[-4].name).length, + 1, (yyvsp[-1].keywords)); keyword_parsing = 0; - yyval.integer.signedp = SIGNED; ; - break;} -case 11: -#line 324 "cexp.y" -{ yyval.integer = yyvsp[-1].integer; ; - break;} -case 12: -#line 329 "cexp.y" -{ yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; - if (yyval.integer.signedp) + (yyval.integer).signedp = SIGNED; } +#line 1580 "cexp.c" /* yacc.c:1652 */ + break; + + case 12: +#line 324 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer) = (yyvsp[-1].integer); } +#line 1586 "cexp.c" /* yacc.c:1652 */ + break; + + case 13: +#line 329 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).signedp = (yyvsp[-2].integer).signedp & (yyvsp[0].integer).signedp; + if ((yyval.integer).signedp) { - yyval.integer.value = yyvsp[-2].integer.value * yyvsp[0].integer.value; - if (yyvsp[-2].integer.value - && (yyval.integer.value / yyvsp[-2].integer.value != yyvsp[0].integer.value - || (yyval.integer.value & yyvsp[-2].integer.value & yyvsp[0].integer.value) < 0)) + (yyval.integer).value = (yyvsp[-2].integer).value * (yyvsp[0].integer).value; + if ((yyvsp[-2].integer).value + && ((yyval.integer).value / (yyvsp[-2].integer).value != (yyvsp[0].integer).value + || ((yyval.integer).value & (yyvsp[-2].integer).value & (yyvsp[0].integer).value) < 0)) integer_overflow (); } else - yyval.integer.value = ((unsigned_HOST_WIDE_INT) yyvsp[-2].integer.value - * yyvsp[0].integer.value); ; - break;} -case 13: -#line 342 "cexp.y" -{ if (yyvsp[0].integer.value == 0) + (yyval.integer).value = ((unsigned_HOST_WIDE_INT) (yyvsp[-2].integer).value + * (yyvsp[0].integer).value); } +#line 1603 "cexp.c" /* yacc.c:1652 */ + break; + + case 14: +#line 342 "cexp.y" /* yacc.c:1652 */ + { if ((yyvsp[0].integer).value == 0) { if (!skip_evaluation) error ("division by zero in #if"); - yyvsp[0].integer.value = 1; + (yyvsp[0].integer).value = 1; } - yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; - if (yyval.integer.signedp) + (yyval.integer).signedp = (yyvsp[-2].integer).signedp & (yyvsp[0].integer).signedp; + if ((yyval.integer).signedp) { - yyval.integer.value = yyvsp[-2].integer.value / yyvsp[0].integer.value; - if ((yyval.integer.value & yyvsp[-2].integer.value & yyvsp[0].integer.value) < 0) + (yyval.integer).value = (yyvsp[-2].integer).value / (yyvsp[0].integer).value; + if (((yyval.integer).value & (yyvsp[-2].integer).value & (yyvsp[0].integer).value) < 0) integer_overflow (); } else - yyval.integer.value = ((unsigned_HOST_WIDE_INT) yyvsp[-2].integer.value - / yyvsp[0].integer.value); ; - break;} -case 14: -#line 359 "cexp.y" -{ if (yyvsp[0].integer.value == 0) + (yyval.integer).value = ((unsigned_HOST_WIDE_INT) (yyvsp[-2].integer).value + / (yyvsp[0].integer).value); } +#line 1624 "cexp.c" /* yacc.c:1652 */ + break; + + case 15: +#line 359 "cexp.y" /* yacc.c:1652 */ + { if ((yyvsp[0].integer).value == 0) { if (!skip_evaluation) error ("division by zero in #if"); - yyvsp[0].integer.value = 1; + (yyvsp[0].integer).value = 1; } - yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; - if (yyval.integer.signedp) - yyval.integer.value = yyvsp[-2].integer.value % yyvsp[0].integer.value; + (yyval.integer).signedp = (yyvsp[-2].integer).signedp & (yyvsp[0].integer).signedp; + if ((yyval.integer).signedp) + (yyval.integer).value = (yyvsp[-2].integer).value % (yyvsp[0].integer).value; else - yyval.integer.value = ((unsigned_HOST_WIDE_INT) yyvsp[-2].integer.value - % yyvsp[0].integer.value); ; - break;} -case 15: -#line 372 "cexp.y" -{ yyval.integer.value = yyvsp[-2].integer.value + yyvsp[0].integer.value; - yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; - if (overflow_sum_sign (yyvsp[-2].integer.value, yyvsp[0].integer.value, - yyval.integer.value, yyval.integer.signedp)) - integer_overflow (); ; - break;} -case 16: -#line 378 "cexp.y" -{ yyval.integer.value = yyvsp[-2].integer.value - yyvsp[0].integer.value; - yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; - if (overflow_sum_sign (yyval.integer.value, yyvsp[0].integer.value, - yyvsp[-2].integer.value, yyval.integer.signedp)) - integer_overflow (); ; - break;} -case 17: -#line 384 "cexp.y" -{ yyval.integer.signedp = yyvsp[-2].integer.signedp; - if ((yyvsp[0].integer.value & yyvsp[0].integer.signedp) < 0) - yyval.integer.value = right_shift (&yyvsp[-2].integer, -yyvsp[0].integer.value); + (yyval.integer).value = ((unsigned_HOST_WIDE_INT) (yyvsp[-2].integer).value + % (yyvsp[0].integer).value); } +#line 1641 "cexp.c" /* yacc.c:1652 */ + break; + + case 16: +#line 372 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).value = (yyvsp[-2].integer).value + (yyvsp[0].integer).value; + (yyval.integer).signedp = (yyvsp[-2].integer).signedp & (yyvsp[0].integer).signedp; + if (overflow_sum_sign ((yyvsp[-2].integer).value, (yyvsp[0].integer).value, + (yyval.integer).value, (yyval.integer).signedp)) + integer_overflow (); } +#line 1651 "cexp.c" /* yacc.c:1652 */ + break; + + case 17: +#line 378 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).value = (yyvsp[-2].integer).value - (yyvsp[0].integer).value; + (yyval.integer).signedp = (yyvsp[-2].integer).signedp & (yyvsp[0].integer).signedp; + if (overflow_sum_sign ((yyval.integer).value, (yyvsp[0].integer).value, + (yyvsp[-2].integer).value, (yyval.integer).signedp)) + integer_overflow (); } +#line 1661 "cexp.c" /* yacc.c:1652 */ + break; + + case 18: +#line 384 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).signedp = (yyvsp[-2].integer).signedp; + if (((yyvsp[0].integer).value & (yyvsp[0].integer).signedp) < 0) + (yyval.integer).value = right_shift (&(yyvsp[-2].integer), -(yyvsp[0].integer).value); else - yyval.integer.value = left_shift (&yyvsp[-2].integer, yyvsp[0].integer.value); ; - break;} -case 18: -#line 390 "cexp.y" -{ yyval.integer.signedp = yyvsp[-2].integer.signedp; - if ((yyvsp[0].integer.value & yyvsp[0].integer.signedp) < 0) - yyval.integer.value = left_shift (&yyvsp[-2].integer, -yyvsp[0].integer.value); + (yyval.integer).value = left_shift (&(yyvsp[-2].integer), (yyvsp[0].integer).value); } +#line 1671 "cexp.c" /* yacc.c:1652 */ + break; + + case 19: +#line 390 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).signedp = (yyvsp[-2].integer).signedp; + if (((yyvsp[0].integer).value & (yyvsp[0].integer).signedp) < 0) + (yyval.integer).value = left_shift (&(yyvsp[-2].integer), -(yyvsp[0].integer).value); else - yyval.integer.value = right_shift (&yyvsp[-2].integer, yyvsp[0].integer.value); ; - break;} -case 19: -#line 396 "cexp.y" -{ yyval.integer.value = (yyvsp[-2].integer.value == yyvsp[0].integer.value); - yyval.integer.signedp = SIGNED; ; - break;} -case 20: -#line 399 "cexp.y" -{ yyval.integer.value = (yyvsp[-2].integer.value != yyvsp[0].integer.value); - yyval.integer.signedp = SIGNED; ; - break;} -case 21: -#line 402 "cexp.y" -{ yyval.integer.signedp = SIGNED; - if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp) - yyval.integer.value = yyvsp[-2].integer.value <= yyvsp[0].integer.value; + (yyval.integer).value = right_shift (&(yyvsp[-2].integer), (yyvsp[0].integer).value); } +#line 1681 "cexp.c" /* yacc.c:1652 */ + break; + + case 20: +#line 396 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).value = ((yyvsp[-2].integer).value == (yyvsp[0].integer).value); + (yyval.integer).signedp = SIGNED; } +#line 1688 "cexp.c" /* yacc.c:1652 */ + break; + + case 21: +#line 399 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).value = ((yyvsp[-2].integer).value != (yyvsp[0].integer).value); + (yyval.integer).signedp = SIGNED; } +#line 1695 "cexp.c" /* yacc.c:1652 */ + break; + + case 22: +#line 402 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).signedp = SIGNED; + if ((yyvsp[-2].integer).signedp & (yyvsp[0].integer).signedp) + (yyval.integer).value = (yyvsp[-2].integer).value <= (yyvsp[0].integer).value; else - yyval.integer.value = ((unsigned_HOST_WIDE_INT) yyvsp[-2].integer.value - <= yyvsp[0].integer.value); ; - break;} -case 22: -#line 409 "cexp.y" -{ yyval.integer.signedp = SIGNED; - if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp) - yyval.integer.value = yyvsp[-2].integer.value >= yyvsp[0].integer.value; + (yyval.integer).value = ((unsigned_HOST_WIDE_INT) (yyvsp[-2].integer).value + <= (yyvsp[0].integer).value); } +#line 1706 "cexp.c" /* yacc.c:1652 */ + break; + + case 23: +#line 409 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).signedp = SIGNED; + if ((yyvsp[-2].integer).signedp & (yyvsp[0].integer).signedp) + (yyval.integer).value = (yyvsp[-2].integer).value >= (yyvsp[0].integer).value; else - yyval.integer.value = ((unsigned_HOST_WIDE_INT) yyvsp[-2].integer.value - >= yyvsp[0].integer.value); ; - break;} -case 23: -#line 416 "cexp.y" -{ yyval.integer.signedp = SIGNED; - if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp) - yyval.integer.value = yyvsp[-2].integer.value < yyvsp[0].integer.value; + (yyval.integer).value = ((unsigned_HOST_WIDE_INT) (yyvsp[-2].integer).value + >= (yyvsp[0].integer).value); } +#line 1717 "cexp.c" /* yacc.c:1652 */ + break; + + case 24: +#line 416 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).signedp = SIGNED; + if ((yyvsp[-2].integer).signedp & (yyvsp[0].integer).signedp) + (yyval.integer).value = (yyvsp[-2].integer).value < (yyvsp[0].integer).value; else - yyval.integer.value = ((unsigned_HOST_WIDE_INT) yyvsp[-2].integer.value - < yyvsp[0].integer.value); ; - break;} -case 24: -#line 423 "cexp.y" -{ yyval.integer.signedp = SIGNED; - if (yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp) - yyval.integer.value = yyvsp[-2].integer.value > yyvsp[0].integer.value; + (yyval.integer).value = ((unsigned_HOST_WIDE_INT) (yyvsp[-2].integer).value + < (yyvsp[0].integer).value); } +#line 1728 "cexp.c" /* yacc.c:1652 */ + break; + + case 25: +#line 423 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).signedp = SIGNED; + if ((yyvsp[-2].integer).signedp & (yyvsp[0].integer).signedp) + (yyval.integer).value = (yyvsp[-2].integer).value > (yyvsp[0].integer).value; else - yyval.integer.value = ((unsigned_HOST_WIDE_INT) yyvsp[-2].integer.value - > yyvsp[0].integer.value); ; - break;} -case 25: -#line 430 "cexp.y" -{ yyval.integer.value = yyvsp[-2].integer.value & yyvsp[0].integer.value; - yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ; - break;} -case 26: -#line 433 "cexp.y" -{ yyval.integer.value = yyvsp[-2].integer.value ^ yyvsp[0].integer.value; - yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ; - break;} -case 27: -#line 436 "cexp.y" -{ yyval.integer.value = yyvsp[-2].integer.value | yyvsp[0].integer.value; - yyval.integer.signedp = yyvsp[-2].integer.signedp & yyvsp[0].integer.signedp; ; - break;} -case 28: -#line 439 "cexp.y" -{ skip_evaluation += !yyvsp[-1].integer.value; ; - break;} -case 29: -#line 441 "cexp.y" -{ skip_evaluation -= !yyvsp[-3].integer.value; - yyval.integer.value = (yyvsp[-3].integer.value && yyvsp[0].integer.value); - yyval.integer.signedp = SIGNED; ; - break;} -case 30: -#line 445 "cexp.y" -{ skip_evaluation += !!yyvsp[-1].integer.value; ; - break;} -case 31: -#line 447 "cexp.y" -{ skip_evaluation -= !!yyvsp[-3].integer.value; - yyval.integer.value = (yyvsp[-3].integer.value || yyvsp[0].integer.value); - yyval.integer.signedp = SIGNED; ; - break;} -case 32: -#line 451 "cexp.y" -{ skip_evaluation += !yyvsp[-1].integer.value; ; - break;} -case 33: -#line 453 "cexp.y" -{ skip_evaluation += !!yyvsp[-4].integer.value - !yyvsp[-4].integer.value; ; - break;} -case 34: -#line 455 "cexp.y" -{ skip_evaluation -= !!yyvsp[-6].integer.value; - yyval.integer.value = yyvsp[-6].integer.value ? yyvsp[-3].integer.value : yyvsp[0].integer.value; - yyval.integer.signedp = yyvsp[-3].integer.signedp & yyvsp[0].integer.signedp; ; - break;} -case 35: -#line 459 "cexp.y" -{ yyval.integer = yylval.integer; ; - break;} -case 36: -#line 461 "cexp.y" -{ yyval.integer = yylval.integer; ; - break;} -case 37: -#line 463 "cexp.y" -{ if (warn_undef && !skip_evaluation) + (yyval.integer).value = ((unsigned_HOST_WIDE_INT) (yyvsp[-2].integer).value + > (yyvsp[0].integer).value); } +#line 1739 "cexp.c" /* yacc.c:1652 */ + break; + + case 26: +#line 430 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).value = (yyvsp[-2].integer).value & (yyvsp[0].integer).value; + (yyval.integer).signedp = (yyvsp[-2].integer).signedp & (yyvsp[0].integer).signedp; } +#line 1746 "cexp.c" /* yacc.c:1652 */ + break; + + case 27: +#line 433 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).value = (yyvsp[-2].integer).value ^ (yyvsp[0].integer).value; + (yyval.integer).signedp = (yyvsp[-2].integer).signedp & (yyvsp[0].integer).signedp; } +#line 1753 "cexp.c" /* yacc.c:1652 */ + break; + + case 28: +#line 436 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer).value = (yyvsp[-2].integer).value | (yyvsp[0].integer).value; + (yyval.integer).signedp = (yyvsp[-2].integer).signedp & (yyvsp[0].integer).signedp; } +#line 1760 "cexp.c" /* yacc.c:1652 */ + break; + + case 29: +#line 439 "cexp.y" /* yacc.c:1652 */ + { skip_evaluation += !(yyvsp[-1].integer).value; } +#line 1766 "cexp.c" /* yacc.c:1652 */ + break; + + case 30: +#line 441 "cexp.y" /* yacc.c:1652 */ + { skip_evaluation -= !(yyvsp[-3].integer).value; + (yyval.integer).value = ((yyvsp[-3].integer).value && (yyvsp[0].integer).value); + (yyval.integer).signedp = SIGNED; } +#line 1774 "cexp.c" /* yacc.c:1652 */ + break; + + case 31: +#line 445 "cexp.y" /* yacc.c:1652 */ + { skip_evaluation += !!(yyvsp[-1].integer).value; } +#line 1780 "cexp.c" /* yacc.c:1652 */ + break; + + case 32: +#line 447 "cexp.y" /* yacc.c:1652 */ + { skip_evaluation -= !!(yyvsp[-3].integer).value; + (yyval.integer).value = ((yyvsp[-3].integer).value || (yyvsp[0].integer).value); + (yyval.integer).signedp = SIGNED; } +#line 1788 "cexp.c" /* yacc.c:1652 */ + break; + + case 33: +#line 451 "cexp.y" /* yacc.c:1652 */ + { skip_evaluation += !(yyvsp[-1].integer).value; } +#line 1794 "cexp.c" /* yacc.c:1652 */ + break; + + case 34: +#line 453 "cexp.y" /* yacc.c:1652 */ + { skip_evaluation += !!(yyvsp[-4].integer).value - !(yyvsp[-4].integer).value; } +#line 1800 "cexp.c" /* yacc.c:1652 */ + break; + + case 35: +#line 455 "cexp.y" /* yacc.c:1652 */ + { skip_evaluation -= !!(yyvsp[-6].integer).value; + (yyval.integer).value = (yyvsp[-6].integer).value ? (yyvsp[-3].integer).value : (yyvsp[0].integer).value; + (yyval.integer).signedp = (yyvsp[-3].integer).signedp & (yyvsp[0].integer).signedp; } +#line 1808 "cexp.c" /* yacc.c:1652 */ + break; + + case 36: +#line 459 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer) = yylval.integer; } +#line 1814 "cexp.c" /* yacc.c:1652 */ + break; + + case 37: +#line 461 "cexp.y" /* yacc.c:1652 */ + { (yyval.integer) = yylval.integer; } +#line 1820 "cexp.c" /* yacc.c:1652 */ + break; + + case 38: +#line 463 "cexp.y" /* yacc.c:1652 */ + { if (warn_undef && !skip_evaluation) warning ("`%.*s' is not defined", - yyvsp[0].name.length, yyvsp[0].name.address); - yyval.integer.value = 0; - yyval.integer.signedp = SIGNED; ; - break;} -case 38: -#line 471 "cexp.y" -{ yyval.keywords = 0; ; - break;} -case 39: -#line 473 "cexp.y" -{ struct arglist *temp; - yyval.keywords = (struct arglist *) xmalloc (sizeof (struct arglist)); - yyval.keywords->next = yyvsp[-2].keywords; - yyval.keywords->name = (U_CHAR *) "("; - yyval.keywords->length = 1; - temp = yyval.keywords; + (yyvsp[0].name).length, (yyvsp[0].name).address); + (yyval.integer).value = 0; + (yyval.integer).signedp = SIGNED; } +#line 1830 "cexp.c" /* yacc.c:1652 */ + break; + + case 39: +#line 471 "cexp.y" /* yacc.c:1652 */ + { (yyval.keywords) = 0; } +#line 1836 "cexp.c" /* yacc.c:1652 */ + break; + + case 40: +#line 473 "cexp.y" /* yacc.c:1652 */ + { struct arglist *temp; + (yyval.keywords) = (struct arglist *) xmalloc (sizeof (struct arglist)); + (yyval.keywords)->next = (yyvsp[-2].keywords); + (yyval.keywords)->name = (U_CHAR *) "("; + (yyval.keywords)->length = 1; + temp = (yyval.keywords); while (temp != 0 && temp->next != 0) temp = temp->next; temp->next = (struct arglist *) xmalloc (sizeof (struct arglist)); - temp->next->next = yyvsp[0].keywords; + temp->next->next = (yyvsp[0].keywords); temp->next->name = (U_CHAR *) ")"; - temp->next->length = 1; ; - break;} -case 40: -#line 486 "cexp.y" -{ yyval.keywords = (struct arglist *) xmalloc (sizeof (struct arglist)); - yyval.keywords->name = yyvsp[-1].name.address; - yyval.keywords->length = yyvsp[-1].name.length; - yyval.keywords->next = yyvsp[0].keywords; ; - break;} -} - /* the action file gets copied in in place of this dollarsign */ -#line 487 "/usr/share/bison.simple" - - yyvsp -= yylen; - yyssp -= yylen; -#ifdef YYLSP_NEEDED - yylsp -= yylen; -#endif + temp->next->length = 1; } +#line 1853 "cexp.c" /* yacc.c:1652 */ + break; -#if YYDEBUG != 0 - if (yydebug) - { - short *ssp1 = yyss - 1; - fprintf (stderr, "state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); + case 41: +#line 486 "cexp.y" /* yacc.c:1652 */ + { (yyval.keywords) = (struct arglist *) xmalloc (sizeof (struct arglist)); + (yyval.keywords)->name = (yyvsp[-1].name).address; + (yyval.keywords)->length = (yyvsp[-1].name).length; + (yyval.keywords)->next = (yyvsp[0].keywords); } +#line 1862 "cexp.c" /* yacc.c:1652 */ + break; + + +#line 1866 "cexp.c" /* yacc.c:1652 */ + default: break; } -#endif + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; -#ifdef YYLSP_NEEDED - yylsp++; - if (yylen == 0) - { - yylsp->first_line = yylloc.first_line; - yylsp->first_column = yylloc.first_column; - yylsp->last_line = (yylsp-1)->last_line; - yylsp->last_column = (yylsp-1)->last_column; - yylsp->text = 0; - } - else - { - yylsp->last_line = (yylsp+yylen-1)->last_line; - yylsp->last_column = (yylsp+yylen-1)->last_column; - } -#endif - - /* Now "shift" the result of the reduction. - Determine what state that goes to, - based on the state we popped back to - and the rule number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTBASE] + *yyssp; - if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTBASE]; + /* Now 'shift' the result of the reduction. Determine what state + that goes to, based on the state we popped back to and the rule + number reduced by. */ + { + const int yylhs = yyr1[yyn] - YYNTOKENS; + const int yyi = yypgoto[yylhs] + *yyssp; + yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp + ? yytable[yyi] + : yydefgoto[yylhs]); + } goto yynewstate; -yyerrlab: /* here on detecting error */ - if (! yyerrstatus) - /* If not already recovering from an error, report this error. */ +/*--------------------------------------. +| yyerrlab -- here on detecting error. | +`--------------------------------------*/ +yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + + /* If not already recovering from an error, report this error. */ + if (!yyerrstatus) { ++yynerrs; - -#ifdef YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (yyn > YYFLAG && yyn < YYLAST) - { - int size = 0; - char *msg; - int x, count; - - count = 0; - /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - size += strlen(yytname[x]) + 15, count++; - msg = (char *) malloc(size + 15); - if (msg != 0) - { - strcpy(msg, "parse error"); - - if (count < 5) - { - count = 0; - for (x = (yyn < 0 ? -yyn : 0); - x < (sizeof(yytname) / sizeof(char *)); x++) - if (yycheck[x + yyn] == x) - { - strcat(msg, count == 0 ? ", expecting `" : " or `"); - strcat(msg, yytname[x]); - strcat(msg, "'"); - count++; - } - } - yyerror(msg); - free(msg); - } - else - yyerror ("parse error; also virtual memory exceeded"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror("parse error"); +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) + { + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; + } +# undef YYSYNTAX_ERROR +#endif } - goto yyerrlab1; -yyerrlab1: /* here on error raised explicitly by an action */ + if (yyerrstatus == 3) { - /* if just tried and failed to reuse lookahead token after an error, discard it. */ + /* If just tried and failed to reuse lookahead token after an + error, discard it. */ - /* return failure if at end of input */ - if (yychar == YYEOF) - YYABORT; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); -#endif - - yychar = YYEMPTY; + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } - /* Else will try to reuse lookahead token - after shifting the error token. */ + /* Else will try to reuse lookahead token after shifting the error + token. */ + goto yyerrlab1; - yyerrstatus = 3; /* Each real token shifted decrements this */ - goto yyerrhandle; +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + /* Pacify compilers when the user code never invokes YYERROR and the + label yyerrorlab therefore never appears in user code. */ + if (0) + YYERROR; -yyerrdefault: /* current state does not do anything special for the error token. */ + /* Do not reclaim the symbols of the rule whose action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; -#if 0 - /* This is wrong; only states that explicitly want error tokens - should shift them. */ - yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ - if (yyn) goto yydefault; -#endif -yyerrpop: /* pop the current state because it cannot handle the error token */ +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: + yyerrstatus = 3; /* Each real token shifted decrements this. */ - if (yyssp == yyss) YYABORT; - yyvsp--; - yystate = *--yyssp; -#ifdef YYLSP_NEEDED - yylsp--; -#endif - -#if YYDEBUG != 0 - if (yydebug) + for (;;) { - short *ssp1 = yyss - 1; - fprintf (stderr, "Error: state stack now"); - while (ssp1 != yyssp) - fprintf (stderr, " %d", *++ssp1); - fprintf (stderr, "\n"); + yyn = yypact[yystate]; + if (!yypact_value_is_default (yyn)) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } + + /* Pop the current state because it cannot handle the error token. */ + if (yyssp == yyss) + YYABORT; + + + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); } -#endif - -yyerrhandle: - - yyn = yypact[yystate]; - if (yyn == YYFLAG) - goto yyerrdefault; - - yyn += YYTERROR; - if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) - goto yyerrdefault; - - yyn = yytable[yyn]; - if (yyn < 0) - { - if (yyn == YYFLAG) - goto yyerrpop; - yyn = -yyn; - goto yyreduce; - } - else if (yyn == 0) - goto yyerrpop; - - if (yyn == YYFINAL) - YYACCEPT; - -#if YYDEBUG != 0 - if (yydebug) - fprintf(stderr, "Shifting error token, "); -#endif + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; -#ifdef YYLSP_NEEDED - *++yylsp = yylloc; -#endif + YY_IGNORE_MAYBE_UNINITIALIZED_END + + + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); yystate = yyn; goto yynewstate; + + +/*-------------------------------------. +| yyacceptlab -- YYACCEPT comes here. | +`-------------------------------------*/ +yyacceptlab: + yyresult = 0; + goto yyreturn; + + +/*-----------------------------------. +| yyabortlab -- YYABORT comes here. | +`-----------------------------------*/ +yyabortlab: + yyresult = 1; + goto yyreturn; + + +#if !defined yyoverflow || YYERROR_VERBOSE +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + + +/*-----------------------------------------------------. +| yyreturn -- parsing is finished, return the result. | +`-----------------------------------------------------*/ +yyreturn: + if (yychar != YYEMPTY) + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + } + /* Do not reclaim the symbols of the rule whose action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } +#ifndef yyoverflow + if (yyss != yyssa) + YYSTACK_FREE (yyss); +#endif +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + return yyresult; } -#line 491 "cexp.y" +#line 491 "cexp.y" /* yacc.c:1918 */ /* During parsing of a C expression, the pointer to the next character diff --git a/cexp.y b/cexp.y index 5269c5b..1fbecf6 100644 --- a/cexp.y +++ b/cexp.y @@ -128,7 +128,7 @@ struct arglist { # define PRINTF_DCL(msg) # define PRINTF_PROTO(ARGS, m, n) PROTO (ARGS) __attribute__ ((format (__printf__, m, n))) #else -# include +# include # define VA_START(va_list, var) va_start (va_list) # define PRINTF_ALIST(msg) msg, va_alist # define PRINTF_DCL(msg) char *msg; va_dcl diff --git a/combine.c b/combine.c index cd84315..d794f32 100644 --- a/combine.c +++ b/combine.c @@ -78,7 +78,7 @@ Boston, MA 02111-1307, USA. */ #ifdef __STDC__ #include #else -#include +#include #endif /* Must precede rtl.h for FFS. */ diff --git a/config.sub b/config.sub index e24b850..ea27e0c 100644 --- a/config.sub +++ b/config.sub @@ -616,6 +616,10 @@ case $basic_machine in xps | xps100) basic_machine=xps100-honeywell ;; + nu64) + basic_machine=mips-nintendo + os=-nu64 + ;; none) basic_machine=none-none os=-none @@ -775,6 +779,9 @@ case $os in -xenix) os=-xenix ;; + -nu64) + os=-nu64 + ;; -none) ;; *) @@ -893,6 +900,9 @@ case $basic_machine in f301-fujitsu) os=-uxpv ;; + *-nu64) + os=-nu64 + ;; *) os=-none ;; diff --git a/config/i386/dgux.h b/config/i386/dgux.h index f453213..47d678f 100644 --- a/config/i386/dgux.h +++ b/config/i386/dgux.h @@ -139,7 +139,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define MD_STARTFILE_PREFIX "/usr/lib/" /* Macros to be automatically defined. - __CLASSIFY_TYPE__ is used in the and header + __CLASSIFY_TYPE__ is used in the and header files with DG/UX revision 5.40 and later. This allows GNU CC to operate without installing the header files. */ diff --git a/config/m88k/dgux.h b/config/m88k/dgux.h index 3b94f4a..8710e30 100644 --- a/config/m88k/dgux.h +++ b/config/m88k/dgux.h @@ -70,7 +70,7 @@ Boston, MA 02111-1307, USA. */ #define CPU_DEFAULT MASK_88000 /* Macros to be automatically defined. __svr4__ is our extension. - __CLASSIFY_TYPE__ is used in the and header + __CLASSIFY_TYPE__ is used in the and header files with DG/UX revision 5.40 and later. This allows GNU CC to operate without installing the header files. */ diff --git a/config/mips/mips.c b/config/mips/mips.c index 79b022b..2d18f59 100644 --- a/config/mips/mips.c +++ b/config/mips/mips.c @@ -42,7 +42,7 @@ Boston, MA 02111-1307, USA. */ #include "recog.h" #include "output.h" -#undef MAX /* sys/param.h may also define these */ +#undef MAX /* sys/param.h may also define these */ #undef MIN #include @@ -137,9 +137,9 @@ FILE *asm_out_text_file; the program with an appropriate .comm or initialization. */ struct extern_list { - struct extern_list *next; /* next external */ - char *name; /* name of the external */ - int size; /* size in bytes */ + struct extern_list *next; /* next external */ + char *name; /* name of the external */ + int size; /* size in bytes */ } *extern_head = 0; /* Name of the file containing the current function. */ @@ -201,9 +201,9 @@ enum mips_abi_type mips_abi; #endif /* Strings to hold which cpu and instruction set architecture to use. */ -char *mips_cpu_string; /* for -mcpu= */ -char *mips_isa_string; /* for -mips{1,2,3,4} */ -char *mips_abi_string; /* for -mabi={o32,32,n32,n64,64,eabi} */ +char *mips_cpu_string; /* for -mcpu= */ +char *mips_isa_string; /* for -mips{1,2,3,4} */ +char *mips_abi_string; /* for -mabi={o32,32,n32,n64,64,eabi} */ /* If TRUE, we split addresses into their high and low parts in the RTL. */ int mips_split_addresses; @@ -282,94 +282,94 @@ char mips_sw_reg_names[][8] = /* Map hard register number to register class */ enum reg_class mips_regno_to_class[] = { - GR_REGS, GR_REGS, GR_REGS, GR_REGS, - GR_REGS, GR_REGS, GR_REGS, GR_REGS, - GR_REGS, GR_REGS, GR_REGS, GR_REGS, - GR_REGS, GR_REGS, GR_REGS, GR_REGS, - GR_REGS, GR_REGS, GR_REGS, GR_REGS, - GR_REGS, GR_REGS, GR_REGS, GR_REGS, - GR_REGS, GR_REGS, GR_REGS, GR_REGS, - GR_REGS, GR_REGS, GR_REGS, GR_REGS, - FP_REGS, FP_REGS, FP_REGS, FP_REGS, - FP_REGS, FP_REGS, FP_REGS, FP_REGS, - FP_REGS, FP_REGS, FP_REGS, FP_REGS, - FP_REGS, FP_REGS, FP_REGS, FP_REGS, - FP_REGS, FP_REGS, FP_REGS, FP_REGS, - FP_REGS, FP_REGS, FP_REGS, FP_REGS, - FP_REGS, FP_REGS, FP_REGS, FP_REGS, - FP_REGS, FP_REGS, FP_REGS, FP_REGS, - HI_REG, LO_REG, HILO_REG, ST_REGS, - ST_REGS, ST_REGS, ST_REGS, ST_REGS, - ST_REGS, ST_REGS, ST_REGS, GR_REGS + GR_REGS, GR_REGS, GR_REGS, GR_REGS, + GR_REGS, GR_REGS, GR_REGS, GR_REGS, + GR_REGS, GR_REGS, GR_REGS, GR_REGS, + GR_REGS, GR_REGS, GR_REGS, GR_REGS, + GR_REGS, GR_REGS, GR_REGS, GR_REGS, + GR_REGS, GR_REGS, GR_REGS, GR_REGS, + GR_REGS, GR_REGS, GR_REGS, GR_REGS, + GR_REGS, GR_REGS, GR_REGS, GR_REGS, + FP_REGS, FP_REGS, FP_REGS, FP_REGS, + FP_REGS, FP_REGS, FP_REGS, FP_REGS, + FP_REGS, FP_REGS, FP_REGS, FP_REGS, + FP_REGS, FP_REGS, FP_REGS, FP_REGS, + FP_REGS, FP_REGS, FP_REGS, FP_REGS, + FP_REGS, FP_REGS, FP_REGS, FP_REGS, + FP_REGS, FP_REGS, FP_REGS, FP_REGS, + FP_REGS, FP_REGS, FP_REGS, FP_REGS, + HI_REG, LO_REG, HILO_REG, ST_REGS, + ST_REGS, ST_REGS, ST_REGS, ST_REGS, + ST_REGS, ST_REGS, ST_REGS, GR_REGS }; /* Map register constraint character to register class. */ enum reg_class mips_char_to_class[256] = { - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, - NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, + NO_REGS, NO_REGS, NO_REGS, NO_REGS, }; @@ -439,13 +439,13 @@ large_int (op, mode) return FALSE; value = INTVAL (op); - if ((value & ~0x0000ffff) == 0) /* ior reg,$r0,value */ + if ((value & ~0x0000ffff) == 0) /* ior reg,$r0,value */ return FALSE; - if (((unsigned long)(value + 32768)) <= 32767) /* subu reg,$r0,value */ + if (((unsigned long)(value + 32768)) <= 32767) /* subu reg,$r0,value */ return FALSE; - if ((value & 0x0000ffff) == 0) /* lui reg,value>>16 */ + if ((value & 0x0000ffff) == 0) /* lui reg,value>>16 */ return FALSE; return TRUE; @@ -468,7 +468,7 @@ reg_or_0_operand (op, mode) case CONST_DOUBLE: if (op != CONST0_RTX (mode)) - return FALSE; + return FALSE; return TRUE; @@ -516,14 +516,14 @@ mips_const_double_ok (op, mode) if (mode == DFmode) { if (REAL_VALUES_LESS (d, dfhigh) - && REAL_VALUES_LESS (dflow, d)) - return TRUE; + && REAL_VALUES_LESS (dflow, d)) + return TRUE; } else { if (REAL_VALUES_LESS (d, sfhigh) - && REAL_VALUES_LESS (sflow, d)) - return TRUE; + && REAL_VALUES_LESS (sflow, d)) + return TRUE; } return FALSE; @@ -602,42 +602,42 @@ simple_memory_operand (op, mode) plus0 = XEXP (addr, 0); plus1 = XEXP (addr, 1); if (GET_CODE (plus0) == REG - && GET_CODE (plus1) == CONST_INT - && SMALL_INT (plus1)) - return TRUE; + && GET_CODE (plus1) == CONST_INT + && SMALL_INT (plus1)) + return TRUE; else if (GET_CODE (plus1) == REG - && GET_CODE (plus0) == CONST_INT - && SMALL_INT (plus0)) - return TRUE; + && GET_CODE (plus0) == CONST_INT + && SMALL_INT (plus0)) + return TRUE; else - return FALSE; + return FALSE; #if 0 /* We used to allow small symbol refs here (ie, stuff in .sdata - or .sbss), but this causes some bugs in G++. Also, it won't - interfere if the MIPS linker rewrites the store instruction - because the function is PIC. */ + or .sbss), but this causes some bugs in G++. Also, it won't + interfere if the MIPS linker rewrites the store instruction + because the function is PIC. */ - case LABEL_REF: /* never gp relative */ + case LABEL_REF: /* never gp relative */ break; case CONST: /* If -G 0, we can never have a GP relative memory operation. - Also, save some time if not optimizing. */ + Also, save some time if not optimizing. */ if (!TARGET_GP_OPT) - return FALSE; + return FALSE; { - rtx offset = const0_rtx; - addr = eliminate_constant_term (XEXP (addr, 0), &offset); - if (GET_CODE (op) != SYMBOL_REF) - return FALSE; + rtx offset = const0_rtx; + addr = eliminate_constant_term (XEXP (addr, 0), &offset); + if (GET_CODE (op) != SYMBOL_REF) + return FALSE; - /* let's be paranoid.... */ - if (! SMALL_INT (offset)) - return FALSE; + /* let's be paranoid.... */ + if (! SMALL_INT (offset)) + return FALSE; } /* fall through */ @@ -703,8 +703,8 @@ call_insn_operand (op, mode) { if (CONSTANT_ADDRESS_P (op) || (GET_CODE (op) == REG && op != arg_pointer_rtx - && ! (REGNO (op) >= FIRST_PSEUDO_REGISTER - && REGNO (op) <= LAST_VIRTUAL_REGISTER))) + && ! (REGNO (op) >= FIRST_PSEUDO_REGISTER + && REGNO (op) <= LAST_VIRTUAL_REGISTER))) return 1; return 0; } @@ -721,11 +721,11 @@ move_operand (op, mode) avoids losing if reload does an in-place replacement of a register with a SYMBOL_REF or CONST. */ return (general_operand (op, mode) - && (! (mips_split_addresses && mips_check_split (op, mode)) - || reload_in_progress - || reload_completed)); - - + && (! (mips_split_addresses && mips_check_split (op, mode)) + || reload_in_progress + || reload_completed)); + + } /* Return true if OPERAND is valid as a source operand for movdi. @@ -744,10 +744,10 @@ movdi_operand (op, mode) && GET_CODE (op) == SIGN_EXTEND && GET_MODE (op) == DImode && (GET_MODE (XEXP (op, 0)) == SImode - || (GET_CODE (XEXP (op, 0)) == CONST_INT - && GET_MODE (XEXP (op, 0)) == VOIDmode)) + || (GET_CODE (XEXP (op, 0)) == CONST_INT + && GET_MODE (XEXP (op, 0)) == VOIDmode)) && (register_operand (XEXP (op, 0), SImode) - || immediate_operand (XEXP (op, 0), SImode))) + || immediate_operand (XEXP (op, 0), SImode))) return 1; return general_operand (op, mode); @@ -901,8 +901,8 @@ mips_check_split (address, mode) if ((GET_CODE (address) == SYMBOL_REF && ! SYMBOL_REF_FLAG (address)) || (GET_CODE (address) == CONST - && GET_CODE (XEXP (XEXP (address, 0), 0)) == SYMBOL_REF - && ! SYMBOL_REF_FLAG (XEXP (XEXP (address, 0), 0))) + && GET_CODE (XEXP (XEXP (address, 0), 0)) == SYMBOL_REF + && ! SYMBOL_REF_FLAG (XEXP (XEXP (address, 0), 0))) || GET_CODE (address) == LABEL_REF) return 1; @@ -923,14 +923,14 @@ mips_check_split (address, mode) char * mips_fill_delay_slot (ret, type, operands, cur_insn) - char *ret; /* normal string to return */ - enum delay_type type; /* type of delay */ - rtx operands[]; /* operands to use */ - rtx cur_insn; /* current insn */ + char *ret; /* normal string to return */ + enum delay_type type; /* type of delay */ + rtx operands[]; /* operands to use */ + rtx cur_insn; /* current insn */ { register rtx set_reg; register enum machine_mode mode; - register rtx next_insn = (cur_insn) ? NEXT_INSN (cur_insn) : (rtx)0; + register rtx next_insn = (cur_insn) ? NEXT_INSN (cur_insn) : (rtx)0; register int num_nops; if (type == DELAY_LOAD || type == DELAY_FCMP) @@ -1025,80 +1025,80 @@ mips_count_memory_refs (op, num) { looping = FALSE; switch (GET_CODE (addr)) - { - default: - break; + { + default: + break; - case REG: - case CONST_INT: - case LO_SUM: - break; + case REG: + case CONST_INT: + case LO_SUM: + break; - case PLUS: - plus0 = XEXP (addr, 0); - plus1 = XEXP (addr, 1); - code0 = GET_CODE (plus0); - code1 = GET_CODE (plus1); + case PLUS: + plus0 = XEXP (addr, 0); + plus1 = XEXP (addr, 1); + code0 = GET_CODE (plus0); + code1 = GET_CODE (plus1); - if (code0 == REG) - { - additional++; - addr = plus1; - looping = TRUE; - continue; - } + if (code0 == REG) + { + additional++; + addr = plus1; + looping = TRUE; + continue; + } - if (code0 == CONST_INT) - { - addr = plus1; - looping = TRUE; - continue; - } + if (code0 == CONST_INT) + { + addr = plus1; + looping = TRUE; + continue; + } - if (code1 == REG) - { - additional++; - addr = plus0; - looping = TRUE; - continue; - } + if (code1 == REG) + { + additional++; + addr = plus0; + looping = TRUE; + continue; + } - if (code1 == CONST_INT) - { - addr = plus0; - looping = TRUE; - continue; - } + if (code1 == CONST_INT) + { + addr = plus0; + looping = TRUE; + continue; + } - if (code0 == SYMBOL_REF || code0 == LABEL_REF || code0 == CONST) - { - addr = plus0; - looping = TRUE; - continue; - } + if (code0 == SYMBOL_REF || code0 == LABEL_REF || code0 == CONST) + { + addr = plus0; + looping = TRUE; + continue; + } - if (code1 == SYMBOL_REF || code1 == LABEL_REF || code1 == CONST) - { - addr = plus1; - looping = TRUE; - continue; - } + if (code1 == SYMBOL_REF || code1 == LABEL_REF || code1 == CONST) + { + addr = plus1; + looping = TRUE; + continue; + } - break; + break; - case LABEL_REF: - n_words = 2; /* always 2 words */ - break; + case LABEL_REF: + n_words = 2; /* always 2 words */ + break; - case CONST: - addr = XEXP (addr, 0); - looping = TRUE; - continue; + case CONST: + addr = XEXP (addr, 0); + looping = TRUE; + continue; - case SYMBOL_REF: - n_words = SYMBOL_REF_FLAG (addr) ? 1 : 2; - break; - } + case SYMBOL_REF: + n_words = SYMBOL_REF_FLAG (addr) ? 1 : 2; + break; + } } while (looping); @@ -1128,15 +1128,15 @@ embedded_pic_offset (x) /* Output code at function start to initialize the pseudo-reg. */ /* ??? We used to do this in FINALIZE_PIC, but that does not work for - inline functions, because it is called after RTL for the function - has been copied. The pseudo-reg in embedded_pic_fnaddr_rtx however - does not get copied, and ends up not matching the rest of the RTL. - This solution works, but means that we get unnecessary code to - initialize this value every time a function is inlined into another - function. */ + inline functions, because it is called after RTL for the function + has been copied. The pseudo-reg in embedded_pic_fnaddr_rtx however + does not get copied, and ends up not matching the rest of the RTL. + This solution works, but means that we get unnecessary code to + initialize this value every time a function is inlined into another + function. */ start_sequence (); emit_insn (gen_get_fnaddr (embedded_pic_fnaddr_rtx, - XEXP (DECL_RTL (current_function_decl), 0))); + XEXP (DECL_RTL (current_function_decl), 0))); seq = gen_sequence (); end_sequence (); push_topmost_sequence (); @@ -1145,8 +1145,8 @@ embedded_pic_offset (x) } return gen_rtx (CONST, Pmode, - gen_rtx (MINUS, Pmode, x, - XEXP (DECL_RTL (current_function_decl), 0))); + gen_rtx (MINUS, Pmode, x, + XEXP (DECL_RTL (current_function_decl), 0))); } /* Return the appropriate instructions to move one operand to another. */ @@ -1190,314 +1190,314 @@ mips_move_1word (operands, insn, unsignedp) int regno0 = REGNO (op0) + subreg_word0; if (code1 == REG) - { - int regno1 = REGNO (op1) + subreg_word1; + { + int regno1 = REGNO (op1) + subreg_word1; - /* Just in case, don't do anything for assigning a register - to itself, unless we are filling a delay slot. */ - if (regno0 == regno1 && set_nomacro == 0) - ret = ""; + /* Just in case, don't do anything for assigning a register + to itself, unless we are filling a delay slot. */ + if (regno0 == regno1 && set_nomacro == 0) + ret = ""; - else if (GP_REG_P (regno0)) - { - if (GP_REG_P (regno1)) - ret = "move\t%0,%1"; + else if (GP_REG_P (regno0)) + { + if (GP_REG_P (regno1)) + ret = "move\t%0,%1"; - else if (MD_REG_P (regno1)) - { - delay = DELAY_HILO; - if (regno1 != HILO_REGNUM) - ret = "mf%1\t%0"; - else - ret = "mflo\t%0"; - } + else if (MD_REG_P (regno1)) + { + delay = DELAY_HILO; + if (regno1 != HILO_REGNUM) + ret = "mf%1\t%0"; + else + ret = "mflo\t%0"; + } - else if (ST_REG_P (regno1) && mips_isa >= 4) - ret = "li\t%0,1\n\tmovf\t%0,%.,%1"; + else if (ST_REG_P (regno1) && mips_isa >= 4) + ret = "li\t%0,1\n\tmovf\t%0,%.,%1"; - else - { - delay = DELAY_LOAD; - if (FP_REG_P (regno1)) - ret = "mfc1\t%0,%1"; + else + { + delay = DELAY_LOAD; + if (FP_REG_P (regno1)) + ret = "mfc1\t%0,%1"; - else if (regno1 == FPSW_REGNUM && mips_isa < 4) - ret = "cfc1\t%0,$31"; - } - } + else if (regno1 == FPSW_REGNUM && mips_isa < 4) + ret = "cfc1\t%0,$31"; + } + } - else if (FP_REG_P (regno0)) - { - if (GP_REG_P (regno1)) - { - delay = DELAY_LOAD; - ret = "mtc1\t%1,%0"; - } + else if (FP_REG_P (regno0)) + { + if (GP_REG_P (regno1)) + { + delay = DELAY_LOAD; + ret = "mtc1\t%1,%0"; + } - if (FP_REG_P (regno1)) - ret = "mov.s\t%0,%1"; - } + if (FP_REG_P (regno1)) + ret = "mov.s\t%0,%1"; + } - else if (MD_REG_P (regno0)) - { - if (GP_REG_P (regno1)) - { - delay = DELAY_HILO; - if (regno0 != HILO_REGNUM) - ret = "mt%0\t%1"; - } - } + else if (MD_REG_P (regno0)) + { + if (GP_REG_P (regno1)) + { + delay = DELAY_HILO; + if (regno0 != HILO_REGNUM) + ret = "mt%0\t%1"; + } + } - else if (regno0 == FPSW_REGNUM && mips_isa < 4) - { - if (GP_REG_P (regno1)) - { - delay = DELAY_LOAD; - ret = "ctc1\t%0,$31"; - } - } - } + else if (regno0 == FPSW_REGNUM && mips_isa < 4) + { + if (GP_REG_P (regno1)) + { + delay = DELAY_LOAD; + ret = "ctc1\t%0,$31"; + } + } + } else if (code1 == MEM) - { - delay = DELAY_LOAD; + { + delay = DELAY_LOAD; - if (TARGET_STATS) - mips_count_memory_refs (op1, 1); + if (TARGET_STATS) + mips_count_memory_refs (op1, 1); - if (GP_REG_P (regno0)) - { - /* For loads, use the mode of the memory item, instead of the - target, so zero/sign extend can use this code as well. */ - switch (GET_MODE (op1)) - { - default: - break; - case SFmode: - ret = "lw\t%0,%1"; - break; - case SImode: - case CCmode: - ret = ((unsignedp && TARGET_64BIT) - ? "lwu\t%0,%1" - : "lw\t%0,%1"); - break; - case HImode: - ret = (unsignedp) ? "lhu\t%0,%1" : "lh\t%0,%1"; - break; - case QImode: - ret = (unsignedp) ? "lbu\t%0,%1" : "lb\t%0,%1"; - break; - } - } + if (GP_REG_P (regno0)) + { + /* For loads, use the mode of the memory item, instead of the + target, so zero/sign extend can use this code as well. */ + switch (GET_MODE (op1)) + { + default: + break; + case SFmode: + ret = "lw\t%0,%1"; + break; + case SImode: + case CCmode: + ret = ((unsignedp && TARGET_64BIT) + ? "lwu\t%0,%1" + : "lw\t%0,%1"); + break; + case HImode: + ret = (unsignedp) ? "lhu\t%0,%1" : "lh\t%0,%1"; + break; + case QImode: + ret = (unsignedp) ? "lbu\t%0,%1" : "lb\t%0,%1"; + break; + } + } - else if (FP_REG_P (regno0) && (mode == SImode || mode == SFmode)) - ret = "l.s\t%0,%1"; + else if (FP_REG_P (regno0) && (mode == SImode || mode == SFmode)) + ret = "l.s\t%0,%1"; - if (ret != (char *)0 && MEM_VOLATILE_P (op1)) - { - int i = strlen (ret); - if (i > sizeof (volatile_buffer) - sizeof ("%{%}")) - abort (); + if (ret != (char *)0 && MEM_VOLATILE_P (op1)) + { + int i = strlen (ret); + if (i > sizeof (volatile_buffer) - sizeof ("%{%}")) + abort (); - sprintf (volatile_buffer, "%%{%s%%}", ret); - ret = volatile_buffer; - } - } + sprintf (volatile_buffer, "%%{%s%%}", ret); + ret = volatile_buffer; + } + } else if (code1 == CONST_INT - || (code1 == CONST_DOUBLE - && GET_MODE (op1) == VOIDmode)) - { - if (code1 == CONST_DOUBLE) - { - /* This can happen when storing constants into long long + || (code1 == CONST_DOUBLE + && GET_MODE (op1) == VOIDmode)) + { + if (code1 == CONST_DOUBLE) + { + /* This can happen when storing constants into long long bitfields. Just store the least significant word of the value. */ - operands[1] = op1 = GEN_INT (CONST_DOUBLE_LOW (op1)); - } + operands[1] = op1 = GEN_INT (CONST_DOUBLE_LOW (op1)); + } - if (INTVAL (op1) == 0) - { - if (GP_REG_P (regno0)) - ret = "move\t%0,%z1"; + if (INTVAL (op1) == 0) + { + if (GP_REG_P (regno0)) + ret = "move\t%0,%z1"; - else if (FP_REG_P (regno0)) - { - delay = DELAY_LOAD; - ret = "mtc1\t%z1,%0"; - } + else if (FP_REG_P (regno0)) + { + delay = DELAY_LOAD; + ret = "mtc1\t%z1,%0"; + } - else if (MD_REG_P (regno0)) - { - delay = DELAY_HILO; - ret = "mt%0\t%."; - } - } + else if (MD_REG_P (regno0)) + { + delay = DELAY_HILO; + ret = "mt%0\t%."; + } + } - else if (GP_REG_P (regno0)) - /* Don't use X format, because that will give out of range - numbers for 64 bit host and 32 bit target. */ - ret = "li\t%0,%1\t\t\t# %X1"; - } + else if (GP_REG_P (regno0)) + /* Don't use X format, because that will give out of range + numbers for 64 bit host and 32 bit target. */ + ret = "li\t%0,%1\t\t\t# %X1"; + } else if (code1 == CONST_DOUBLE && mode == SFmode) - { - if (op1 == CONST0_RTX (SFmode)) - { - if (GP_REG_P (regno0)) - ret = "move\t%0,%."; + { + if (op1 == CONST0_RTX (SFmode)) + { + if (GP_REG_P (regno0)) + ret = "move\t%0,%."; - else if (FP_REG_P (regno0)) - { - delay = DELAY_LOAD; - ret = "mtc1\t%.,%0"; - } - } + else if (FP_REG_P (regno0)) + { + delay = DELAY_LOAD; + ret = "mtc1\t%.,%0"; + } + } - else - { - delay = DELAY_LOAD; - ret = "li.s\t%0,%1"; - } - } + else + { + delay = DELAY_LOAD; + ret = "li.s\t%0,%1"; + } + } else if (code1 == LABEL_REF) - { - if (TARGET_STATS) - mips_count_memory_refs (op1, 1); + { + if (TARGET_STATS) + mips_count_memory_refs (op1, 1); - ret = "la\t%0,%a1"; - } + ret = "la\t%0,%a1"; + } else if (code1 == SYMBOL_REF || code1 == CONST) - { - if (HALF_PIC_P () && CONSTANT_P (op1) && HALF_PIC_ADDRESS_P (op1)) - { - rtx offset = const0_rtx; + { + if (HALF_PIC_P () && CONSTANT_P (op1) && HALF_PIC_ADDRESS_P (op1)) + { + rtx offset = const0_rtx; - if (GET_CODE (op1) == CONST) - op1 = eliminate_constant_term (XEXP (op1, 0), &offset); + if (GET_CODE (op1) == CONST) + op1 = eliminate_constant_term (XEXP (op1, 0), &offset); - if (GET_CODE (op1) == SYMBOL_REF) - { - operands[2] = HALF_PIC_PTR (op1); + if (GET_CODE (op1) == SYMBOL_REF) + { + operands[2] = HALF_PIC_PTR (op1); - if (TARGET_STATS) - mips_count_memory_refs (operands[2], 1); + if (TARGET_STATS) + mips_count_memory_refs (operands[2], 1); - if (INTVAL (offset) == 0) - { - delay = DELAY_LOAD; - ret = (unsignedp && TARGET_64BIT - ? "lwu\t%0,%2" - : "lw\t%0,%2"); - } - else - { - dslots_load_total++; - operands[3] = offset; - if (unsignedp && TARGET_64BIT) - ret = (SMALL_INT (offset)) - ? "lwu\t%0,%2%#\n\tadd\t%0,%0,%3" - : "lwu\t%0,%2%#\n\t%[li\t%@,%3\n\tadd\t%0,%0,%@%]"; - else - ret = (SMALL_INT (offset)) - ? "lw\t%0,%2%#\n\tadd\t%0,%0,%3" - : "lw\t%0,%2%#\n\t%[li\t%@,%3\n\tadd\t%0,%0,%@%]"; - } - } - } - else - { - if (TARGET_STATS) - mips_count_memory_refs (op1, 1); + if (INTVAL (offset) == 0) + { + delay = DELAY_LOAD; + ret = (unsignedp && TARGET_64BIT + ? "lwu\t%0,%2" + : "lw\t%0,%2"); + } + else + { + dslots_load_total++; + operands[3] = offset; + if (unsignedp && TARGET_64BIT) + ret = (SMALL_INT (offset)) + ? "lwu\t%0,%2%#\n\tadd\t%0,%0,%3" + : "lwu\t%0,%2%#\n\t%[li\t%@,%3\n\tadd\t%0,%0,%@%]"; + else + ret = (SMALL_INT (offset)) + ? "lw\t%0,%2%#\n\tadd\t%0,%0,%3" + : "lw\t%0,%2%#\n\t%[li\t%@,%3\n\tadd\t%0,%0,%@%]"; + } + } + } + else + { + if (TARGET_STATS) + mips_count_memory_refs (op1, 1); - ret = "la\t%0,%a1"; - } - } + ret = "la\t%0,%a1"; + } + } else if (code1 == PLUS) - { - rtx add_op0 = XEXP (op1, 0); - rtx add_op1 = XEXP (op1, 1); + { + rtx add_op0 = XEXP (op1, 0); + rtx add_op1 = XEXP (op1, 1); - if (GET_CODE (XEXP (op1, 1)) == REG && GET_CODE (XEXP (op1, 0)) == CONST_INT) - { - add_op0 = XEXP (op1, 1); /* reverse operands */ - add_op1 = XEXP (op1, 0); - } + if (GET_CODE (XEXP (op1, 1)) == REG && GET_CODE (XEXP (op1, 0)) == CONST_INT) + { + add_op0 = XEXP (op1, 1); /* reverse operands */ + add_op1 = XEXP (op1, 0); + } - operands[2] = add_op0; - operands[3] = add_op1; - ret = "add%:\t%0,%2,%3"; - } + operands[2] = add_op0; + operands[3] = add_op1; + ret = "add%:\t%0,%2,%3"; + } else if (code1 == HIGH) - { - operands[1] = XEXP (op1, 0); - ret = "lui\t%0,%%hi(%1)"; - } + { + operands[1] = XEXP (op1, 0); + ret = "lui\t%0,%%hi(%1)"; + } } else if (code0 == MEM) { if (TARGET_STATS) - mips_count_memory_refs (op0, 1); + mips_count_memory_refs (op0, 1); if (code1 == REG) - { - int regno1 = REGNO (op1) + subreg_word1; + { + int regno1 = REGNO (op1) + subreg_word1; - if (GP_REG_P (regno1)) - { - switch (mode) - { - default: break; - case SFmode: ret = "sw\t%1,%0"; break; - case SImode: ret = "sw\t%1,%0"; break; - case HImode: ret = "sh\t%1,%0"; break; - case QImode: ret = "sb\t%1,%0"; break; - } - } + if (GP_REG_P (regno1)) + { + switch (mode) + { + default: break; + case SFmode: ret = "sw\t%1,%0"; break; + case SImode: ret = "sw\t%1,%0"; break; + case HImode: ret = "sh\t%1,%0"; break; + case QImode: ret = "sb\t%1,%0"; break; + } + } - else if (FP_REG_P (regno1) && (mode == SImode || mode == SFmode)) - ret = "s.s\t%1,%0"; - } + else if (FP_REG_P (regno1) && (mode == SImode || mode == SFmode)) + ret = "s.s\t%1,%0"; + } else if (code1 == CONST_INT && INTVAL (op1) == 0) - { - switch (mode) - { - default: break; - case SFmode: ret = "sw\t%z1,%0"; break; - case SImode: ret = "sw\t%z1,%0"; break; - case HImode: ret = "sh\t%z1,%0"; break; - case QImode: ret = "sb\t%z1,%0"; break; - } - } + { + switch (mode) + { + default: break; + case SFmode: ret = "sw\t%z1,%0"; break; + case SImode: ret = "sw\t%z1,%0"; break; + case HImode: ret = "sh\t%z1,%0"; break; + case QImode: ret = "sb\t%z1,%0"; break; + } + } else if (code1 == CONST_DOUBLE && op1 == CONST0_RTX (mode)) - { - switch (mode) - { - default: break; - case SFmode: ret = "sw\t%.,%0"; break; - case SImode: ret = "sw\t%.,%0"; break; - case HImode: ret = "sh\t%.,%0"; break; - case QImode: ret = "sb\t%.,%0"; break; - } - } + { + switch (mode) + { + default: break; + case SFmode: ret = "sw\t%.,%0"; break; + case SImode: ret = "sw\t%.,%0"; break; + case HImode: ret = "sh\t%.,%0"; break; + case QImode: ret = "sb\t%.,%0"; break; + } + } if (ret != (char *)0 && MEM_VOLATILE_P (op0)) - { - int i = strlen (ret); - if (i > sizeof (volatile_buffer) - sizeof ("%{%}")) - abort (); - - sprintf (volatile_buffer, "%%{%s%%}", ret); - ret = volatile_buffer; - } + { + int i = strlen (ret); + if (i > sizeof (volatile_buffer) - sizeof ("%{%}")) + abort (); + + sprintf (volatile_buffer, "%%{%s%%}", ret); + ret = volatile_buffer; + } } if (ret == (char *)0) @@ -1554,7 +1554,7 @@ mips_move_2words (operands, insn) && code1 != REG && code1 != CONST_INT /* The following three can happen as the result of a questionable - cast. */ + cast. */ && code1 != LABEL_REF && code1 != SYMBOL_REF && code1 != CONST) @@ -1565,322 +1565,322 @@ mips_move_2words (operands, insn) int regno0 = REGNO (op0) + subreg_word0; if (code1 == REG) - { - int regno1 = REGNO (op1) + subreg_word1; + { + int regno1 = REGNO (op1) + subreg_word1; - /* Just in case, don't do anything for assigning a register - to itself, unless we are filling a delay slot. */ - if (regno0 == regno1 && set_nomacro == 0) - ret = ""; + /* Just in case, don't do anything for assigning a register + to itself, unless we are filling a delay slot. */ + if (regno0 == regno1 && set_nomacro == 0) + ret = ""; - else if (FP_REG_P (regno0)) - { - if (FP_REG_P (regno1)) - ret = "mov.d\t%0,%1"; + else if (FP_REG_P (regno0)) + { + if (FP_REG_P (regno1)) + ret = "mov.d\t%0,%1"; - else - { - delay = DELAY_LOAD; - if (TARGET_FLOAT64) - { - if (!TARGET_64BIT) - abort_with_insn (insn, "Bad move"); + else + { + delay = DELAY_LOAD; + if (TARGET_FLOAT64) + { + if (!TARGET_64BIT) + abort_with_insn (insn, "Bad move"); #ifdef TARGET_FP_CALL_32 - if (FP_CALL_GP_REG_P (regno1)) - ret = "dsll\t%1,32\n\tor\t%1,%D1\n\tdmtc1\t%1,%0"; - else + if (FP_CALL_GP_REG_P (regno1)) + ret = "dsll\t%1,32\n\tor\t%1,%D1\n\tdmtc1\t%1,%0"; + else #endif - ret = "dmtc1\t%1,%0"; - } - else - ret = "mtc1\t%L1,%0\n\tmtc1\t%M1,%D0"; - } - } + ret = "dmtc1\t%1,%0"; + } + else + ret = "mtc1\t%L1,%0\n\tmtc1\t%M1,%D0"; + } + } - else if (FP_REG_P (regno1)) - { - delay = DELAY_LOAD; - if (TARGET_FLOAT64) - { - if (!TARGET_64BIT) - abort_with_insn (insn, "Bad move"); + else if (FP_REG_P (regno1)) + { + delay = DELAY_LOAD; + if (TARGET_FLOAT64) + { + if (!TARGET_64BIT) + abort_with_insn (insn, "Bad move"); #ifdef TARGET_FP_CALL_32 - if (FP_CALL_GP_REG_P (regno0)) - ret = "dmfc1\t%0,%1\n\tmfc1\t%D0,%1\n\tdsrl\t%0,32"; - else + if (FP_CALL_GP_REG_P (regno0)) + ret = "dmfc1\t%0,%1\n\tmfc1\t%D0,%1\n\tdsrl\t%0,32"; + else #endif - ret = "dmfc1\t%0,%1"; - } - else - ret = "mfc1\t%L0,%1\n\tmfc1\t%M0,%D1"; - } + ret = "dmfc1\t%0,%1"; + } + else + ret = "mfc1\t%L0,%1\n\tmfc1\t%M0,%D1"; + } - else if (MD_REG_P (regno0) && GP_REG_P (regno1)) - { - delay = DELAY_HILO; - if (TARGET_64BIT) - { - if (regno0 != HILO_REGNUM) - ret = "mt%0\t%1"; - else if (regno1 == 0) - ret = "mtlo\t%.\n\tmthi\t%."; - } - else - ret = "mthi\t%M1\n\tmtlo\t%L1"; - } + else if (MD_REG_P (regno0) && GP_REG_P (regno1)) + { + delay = DELAY_HILO; + if (TARGET_64BIT) + { + if (regno0 != HILO_REGNUM) + ret = "mt%0\t%1"; + else if (regno1 == 0) + ret = "mtlo\t%.\n\tmthi\t%."; + } + else + ret = "mthi\t%M1\n\tmtlo\t%L1"; + } - else if (GP_REG_P (regno0) && MD_REG_P (regno1)) - { - delay = DELAY_HILO; - if (TARGET_64BIT) - { - if (regno1 != HILO_REGNUM) - ret = "mf%1\t%0"; - } - else - ret = "mfhi\t%M0\n\tmflo\t%L0"; - } + else if (GP_REG_P (regno0) && MD_REG_P (regno1)) + { + delay = DELAY_HILO; + if (TARGET_64BIT) + { + if (regno1 != HILO_REGNUM) + ret = "mf%1\t%0"; + } + else + ret = "mfhi\t%M0\n\tmflo\t%L0"; + } - else if (TARGET_64BIT) - ret = "move\t%0,%1"; + else if (TARGET_64BIT) + ret = "move\t%0,%1"; - else if (regno0 != (regno1+1)) - ret = "move\t%0,%1\n\tmove\t%D0,%D1"; + else if (regno0 != (regno1+1)) + ret = "move\t%0,%1\n\tmove\t%D0,%D1"; - else - ret = "move\t%D0,%D1\n\tmove\t%0,%1"; - } + else + ret = "move\t%D0,%D1\n\tmove\t%0,%1"; + } else if (code1 == CONST_DOUBLE) - { - /* Move zero from $0 unless !TARGET_64BIT and recipient - is 64-bit fp reg, in which case generate a constant. */ - if (op1 != CONST0_RTX (GET_MODE (op1)) - || (TARGET_FLOAT64 && !TARGET_64BIT && FP_REG_P (regno0))) - { - if (GET_MODE (op1) == DFmode) - { - delay = DELAY_LOAD; + { + /* Move zero from $0 unless !TARGET_64BIT and recipient + is 64-bit fp reg, in which case generate a constant. */ + if (op1 != CONST0_RTX (GET_MODE (op1)) + || (TARGET_FLOAT64 && !TARGET_64BIT && FP_REG_P (regno0))) + { + if (GET_MODE (op1) == DFmode) + { + delay = DELAY_LOAD; #ifdef TARGET_FP_CALL_32 - if (FP_CALL_GP_REG_P (regno0)) - { - if (TARGET_FLOAT64 && !TARGET_64BIT) - { - split_double (op1, operands + 2, operands + 3); - ret = "li\t%0,%2\n\tli\t%D0,%3"; - } - else - ret = "li.d\t%0,%1\n\tdsll\t%D0,%0,32\n\tdsrl\t%D0,32\n\tdsrl\t%0,32"; - } - else + if (FP_CALL_GP_REG_P (regno0)) + { + if (TARGET_FLOAT64 && !TARGET_64BIT) + { + split_double (op1, operands + 2, operands + 3); + ret = "li\t%0,%2\n\tli\t%D0,%3"; + } + else + ret = "li.d\t%0,%1\n\tdsll\t%D0,%0,32\n\tdsrl\t%D0,32\n\tdsrl\t%0,32"; + } + else #endif - ret = "li.d\t%0,%1"; - } + ret = "li.d\t%0,%1"; + } - else if (TARGET_64BIT) - ret = "dli\t%0,%1"; + else if (TARGET_64BIT) + ret = "dli\t%0,%1"; - else - { - split_double (op1, operands + 2, operands + 3); - ret = "li\t%0,%2\n\tli\t%D0,%3"; - } - } + else + { + split_double (op1, operands + 2, operands + 3); + ret = "li\t%0,%2\n\tli\t%D0,%3"; + } + } - else - { - if (GP_REG_P (regno0)) - ret = (TARGET_64BIT + else + { + if (GP_REG_P (regno0)) + ret = (TARGET_64BIT #ifdef TARGET_FP_CALL_32 - && ! FP_CALL_GP_REG_P (regno0) + && ! FP_CALL_GP_REG_P (regno0) #endif - ) - ? "move\t%0,%." - : "move\t%0,%.\n\tmove\t%D0,%."; + ) + ? "move\t%0,%." + : "move\t%0,%.\n\tmove\t%D0,%."; - else if (FP_REG_P (regno0)) - { - delay = DELAY_LOAD; - ret = (TARGET_64BIT) - ? "dmtc1\t%.,%0" - : "mtc1\t%.,%0\n\tmtc1\t%.,%D0"; - } - } - } + else if (FP_REG_P (regno0)) + { + delay = DELAY_LOAD; + ret = (TARGET_64BIT) + ? "dmtc1\t%.,%0" + : "mtc1\t%.,%0\n\tmtc1\t%.,%D0"; + } + } + } else if (code1 == CONST_INT && INTVAL (op1) == 0) - { - if (GP_REG_P (regno0)) - ret = (TARGET_64BIT) - ? "move\t%0,%." - : "move\t%0,%.\n\tmove\t%D0,%."; - - else if (FP_REG_P (regno0)) - { - delay = DELAY_LOAD; - ret = (TARGET_64BIT) - ? "dmtc1\t%.,%0" - : (TARGET_FLOAT64 - ? "li.d\t%0,%1" - : "mtc1\t%.,%0\n\tmtc1\t%.,%D0"); - } - else if (MD_REG_P (regno0)) - { - delay = DELAY_HILO; - if (regno0 != HILO_REGNUM) - ret = "mt%0\t%.\n"; - else - ret = "mtlo\t%.\n\tmthi\t%."; - } - } - + { + if (GP_REG_P (regno0)) + ret = (TARGET_64BIT) + ? "move\t%0,%." + : "move\t%0,%.\n\tmove\t%D0,%."; + + else if (FP_REG_P (regno0)) + { + delay = DELAY_LOAD; + ret = (TARGET_64BIT) + ? "dmtc1\t%.,%0" + : (TARGET_FLOAT64 + ? "li.d\t%0,%1" + : "mtc1\t%.,%0\n\tmtc1\t%.,%D0"); + } + else if (MD_REG_P (regno0)) + { + delay = DELAY_HILO; + if (regno0 != HILO_REGNUM) + ret = "mt%0\t%.\n"; + else + ret = "mtlo\t%.\n\tmthi\t%."; + } + } + else if (code1 == CONST_INT && GET_MODE (op0) == DImode && GP_REG_P (regno0)) - { - if (TARGET_64BIT) - { - if (GET_CODE (operands[1]) == SIGN_EXTEND) - ret = "li\t%0,%1\t\t# %X1"; - else if (HOST_BITS_PER_WIDE_INT < 64) - /* We can't use 'X' for negative numbers, because then we won't - get the right value for the upper 32 bits. */ - ret = ((INTVAL (op1) < 0) ? "dli\t%0,%1\t\t\t# %X1" - : "dli\t%0,%X1\t\t# %1"); - else - /* We must use 'X', because otherwise LONG_MIN will print as - a number that the assembler won't accept. */ - ret = "dli\t%0,%X1\t\t# %1"; - } - else if (HOST_BITS_PER_WIDE_INT < 64) - { - operands[2] = GEN_INT (INTVAL (operands[1]) >= 0 ? 0 : -1); - ret = "li\t%M0,%2\n\tli\t%L0,%1"; - } - else - { - /* We use multiple shifts here, to avoid warnings about out - of range shifts on 32 bit hosts. */ - operands[2] = GEN_INT (INTVAL (operands[1]) >> 16 >> 16); - operands[1] = GEN_INT (INTVAL (operands[1]) << 16 << 16 >> 16 >> 16); - ret = "li\t%M0,%2\n\tli\t%L0,%1"; - } - } + { + if (TARGET_64BIT) + { + if (GET_CODE (operands[1]) == SIGN_EXTEND) + ret = "li\t%0,%1\t\t# %X1"; + else if (HOST_BITS_PER_WIDE_INT < 64) + /* We can't use 'X' for negative numbers, because then we won't + get the right value for the upper 32 bits. */ + ret = ((INTVAL (op1) < 0) ? "dli\t%0,%1\t\t\t# %X1" + : "dli\t%0,%X1\t\t# %1"); + else + /* We must use 'X', because otherwise LONG_MIN will print as + a number that the assembler won't accept. */ + ret = "dli\t%0,%X1\t\t# %1"; + } + else if (HOST_BITS_PER_WIDE_INT < 64) + { + operands[2] = GEN_INT (INTVAL (operands[1]) >= 0 ? 0 : -1); + ret = "li\t%M0,%2\n\tli\t%L0,%1"; + } + else + { + /* We use multiple shifts here, to avoid warnings about out + of range shifts on 32 bit hosts. */ + operands[2] = GEN_INT (INTVAL (operands[1]) >> 16 >> 16); + operands[1] = GEN_INT (INTVAL (operands[1]) << 16 << 16 >> 16 >> 16); + ret = "li\t%M0,%2\n\tli\t%L0,%1"; + } + } else if (code1 == MEM) - { - delay = DELAY_LOAD; + { + delay = DELAY_LOAD; - if (TARGET_STATS) - mips_count_memory_refs (op1, 2); + if (TARGET_STATS) + mips_count_memory_refs (op1, 2); - if (FP_REG_P (regno0)) - ret = "l.d\t%0,%1"; + if (FP_REG_P (regno0)) + ret = "l.d\t%0,%1"; - else if (TARGET_64BIT) - { + else if (TARGET_64BIT) + { #ifdef TARGET_FP_CALL_32 - if (FP_CALL_GP_REG_P (regno0)) - { + if (FP_CALL_GP_REG_P (regno0)) + { if (offsettable_address_p (FALSE, SImode, op1)) ret = "lwu\t%0,%1\n\tlwu\t%D0,4+%1"; else ret = "ld\t%0,%1\n\tdsll\t%D0,%0,32\n\tdsrl\t%D0,32\n\tdsrl\t%0,32"; - } - else + } + else #endif - ret = "ld\t%0,%1"; - } + ret = "ld\t%0,%1"; + } - else if (offsettable_address_p (1, DFmode, XEXP (op1, 0))) - { - operands[2] = adj_offsettable_operand (op1, 4); - if (reg_mentioned_p (op0, op1)) - ret = "lw\t%D0,%2\n\tlw\t%0,%1"; - else - ret = "lw\t%0,%1\n\tlw\t%D0,%2"; - } + else if (offsettable_address_p (1, DFmode, XEXP (op1, 0))) + { + operands[2] = adj_offsettable_operand (op1, 4); + if (reg_mentioned_p (op0, op1)) + ret = "lw\t%D0,%2\n\tlw\t%0,%1"; + else + ret = "lw\t%0,%1\n\tlw\t%D0,%2"; + } - if (ret != (char *)0 && MEM_VOLATILE_P (op1)) - { - int i = strlen (ret); - if (i > sizeof (volatile_buffer) - sizeof ("%{%}")) - abort (); + if (ret != (char *)0 && MEM_VOLATILE_P (op1)) + { + int i = strlen (ret); + if (i > sizeof (volatile_buffer) - sizeof ("%{%}")) + abort (); - sprintf (volatile_buffer, "%%{%s%%}", ret); - ret = volatile_buffer; - } - } + sprintf (volatile_buffer, "%%{%s%%}", ret); + ret = volatile_buffer; + } + } else if (code1 == LABEL_REF - || code1 == SYMBOL_REF - || code1 == CONST) - { - if (TARGET_STATS) - mips_count_memory_refs (op1, 2); + || code1 == SYMBOL_REF + || code1 == CONST) + { + if (TARGET_STATS) + mips_count_memory_refs (op1, 2); - if (GET_CODE (operands[1]) == SIGN_EXTEND) - /* We deliberately remove the 'a' from '%1', so that we don't - have to add SIGN_EXTEND support to print_operand_address. - print_operand will just call print_operand_address in this - case, so there is no problem. */ - ret = "la\t%0,%1"; - else - ret = "dla\t%0,%a1"; - } + if (GET_CODE (operands[1]) == SIGN_EXTEND) + /* We deliberately remove the 'a' from '%1', so that we don't + have to add SIGN_EXTEND support to print_operand_address. + print_operand will just call print_operand_address in this + case, so there is no problem. */ + ret = "la\t%0,%1"; + else + ret = "dla\t%0,%a1"; + } } else if (code0 == MEM) { if (code1 == REG) - { - int regno1 = REGNO (op1) + subreg_word1; + { + int regno1 = REGNO (op1) + subreg_word1; - if (FP_REG_P (regno1)) - ret = "s.d\t%1,%0"; + if (FP_REG_P (regno1)) + ret = "s.d\t%1,%0"; - else if (TARGET_64BIT) - { + else if (TARGET_64BIT) + { #ifdef TARGET_FP_CALL_32 - if (FP_CALL_GP_REG_P (regno1)) - ret = "dsll\t%1,32\n\tor\t%1,%D1\n\tsd\t%1,%0"; - else + if (FP_CALL_GP_REG_P (regno1)) + ret = "dsll\t%1,32\n\tor\t%1,%D1\n\tsd\t%1,%0"; + else #endif - ret = "sd\t%1,%0"; - } + ret = "sd\t%1,%0"; + } - else if (offsettable_address_p (1, DFmode, XEXP (op0, 0))) - { - operands[2] = adj_offsettable_operand (op0, 4); - ret = "sw\t%1,%0\n\tsw\t%D1,%2"; - } - } + else if (offsettable_address_p (1, DFmode, XEXP (op0, 0))) + { + operands[2] = adj_offsettable_operand (op0, 4); + ret = "sw\t%1,%0\n\tsw\t%D1,%2"; + } + } else if (((code1 == CONST_INT && INTVAL (op1) == 0) - || (code1 == CONST_DOUBLE - && op1 == CONST0_RTX (GET_MODE (op1)))) - && (TARGET_64BIT - || offsettable_address_p (1, DFmode, XEXP (op0, 0)))) - { - if (TARGET_64BIT) - ret = "sd\t%.,%0"; - else - { - operands[2] = adj_offsettable_operand (op0, 4); - ret = "sw\t%.,%0\n\tsw\t%.,%2"; - } - } + || (code1 == CONST_DOUBLE + && op1 == CONST0_RTX (GET_MODE (op1)))) + && (TARGET_64BIT + || offsettable_address_p (1, DFmode, XEXP (op0, 0)))) + { + if (TARGET_64BIT) + ret = "sd\t%.,%0"; + else + { + operands[2] = adj_offsettable_operand (op0, 4); + ret = "sw\t%.,%0\n\tsw\t%.,%2"; + } + } if (TARGET_STATS) - mips_count_memory_refs (op0, 2); + mips_count_memory_refs (op0, 2); if (ret != (char *)0 && MEM_VOLATILE_P (op0)) - { - int i = strlen (ret); - if (i > sizeof (volatile_buffer) - sizeof ("%{%}")) - abort (); - - sprintf (volatile_buffer, "%%{%s%%}", ret); - ret = volatile_buffer; - } + { + int i = strlen (ret); + if (i > sizeof (volatile_buffer) - sizeof ("%{%}")) + abort (); + + sprintf (volatile_buffer, "%%{%s%%}", ret); + ret = volatile_buffer; + } } if (ret == (char *)0) @@ -1916,16 +1916,16 @@ mips_address_cost (addr) case CONST: { - rtx offset = const0_rtx; - addr = eliminate_constant_term (XEXP (addr, 0), &offset); - if (GET_CODE (addr) == LABEL_REF) - return 2; + rtx offset = const0_rtx; + addr = eliminate_constant_term (XEXP (addr, 0), &offset); + if (GET_CODE (addr) == LABEL_REF) + return 2; - if (GET_CODE (addr) != SYMBOL_REF) - return 4; + if (GET_CODE (addr) != SYMBOL_REF) + return 4; - if (! SMALL_INT (offset)) - return 2; + if (! SMALL_INT (offset)) + return 2; } /* fall through */ @@ -1934,33 +1934,33 @@ mips_address_cost (addr) case PLUS: { - register rtx plus0 = XEXP (addr, 0); - register rtx plus1 = XEXP (addr, 1); + register rtx plus0 = XEXP (addr, 0); + register rtx plus1 = XEXP (addr, 1); - if (GET_CODE (plus0) != REG && GET_CODE (plus1) == REG) - { - plus0 = XEXP (addr, 1); - plus1 = XEXP (addr, 0); - } + if (GET_CODE (plus0) != REG && GET_CODE (plus1) == REG) + { + plus0 = XEXP (addr, 1); + plus1 = XEXP (addr, 0); + } - if (GET_CODE (plus0) != REG) - break; + if (GET_CODE (plus0) != REG) + break; - switch (GET_CODE (plus1)) - { - default: - break; + switch (GET_CODE (plus1)) + { + default: + break; - case CONST_INT: - return (SMALL_INT (plus1) ? 1 : 2); + case CONST_INT: + return (SMALL_INT (plus1) ? 1 : 2); - case CONST: - case SYMBOL_REF: - case LABEL_REF: - case HIGH: - case LO_SUM: - return mips_address_cost (plus1) + 1; - } + case CONST: + case SYMBOL_REF: + case LABEL_REF: + case HIGH: + case LO_SUM: + return mips_address_cost (plus1) + 1; + } } } @@ -1994,7 +1994,7 @@ map_test_to_internal_test (test_code) switch (test_code) { - default: break; + default: break; case EQ: test = ITEST_EQ; break; case NE: test = ITEST_NE; break; case GT: test = ITEST_GT; break; @@ -2012,8 +2012,8 @@ map_test_to_internal_test (test_code) /* Generate the code to compare two integer values. The return value is: - (reg:SI xx) The pseudo register the comparison is in - (rtx)0 No register, generate a simple branch. + (reg:SI xx) The pseudo register the comparison is in + (rtx)0 No register, generate a simple branch. ??? This is called with result nonzero by the Scond patterns in mips.md. These patterns are called with a target in the mode of @@ -2034,36 +2034,36 @@ map_test_to_internal_test (test_code) rtx gen_int_relational (test_code, result, cmp0, cmp1, p_invert) - enum rtx_code test_code; /* relational test (EQ, etc) */ - rtx result; /* result to store comp. or 0 if branch */ - rtx cmp0; /* first operand to compare */ - rtx cmp1; /* second operand to compare */ - int *p_invert; /* NULL or ptr to hold whether branch needs */ - /* to reverse its test */ + enum rtx_code test_code; /* relational test (EQ, etc) */ + rtx result; /* result to store comp. or 0 if branch */ + rtx cmp0; /* first operand to compare */ + rtx cmp1; /* second operand to compare */ + int *p_invert; /* NULL or ptr to hold whether branch needs */ + /* to reverse its test */ { struct cmp_info { - enum rtx_code test_code; /* code to use in instruction (LT vs. LTU) */ - int const_low; /* low bound of constant we can accept */ - int const_high; /* high bound of constant we can accept */ - int const_add; /* constant to add (convert LE -> LT) */ - int reverse_regs; /* reverse registers in test */ - int invert_const; /* != 0 if invert value if cmp1 is constant */ - int invert_reg; /* != 0 if invert value if cmp1 is register */ - int unsignedp; /* != 0 for unsigned comparisons. */ + enum rtx_code test_code; /* code to use in instruction (LT vs. LTU) */ + int const_low; /* low bound of constant we can accept */ + int const_high; /* high bound of constant we can accept */ + int const_add; /* constant to add (convert LE -> LT) */ + int reverse_regs; /* reverse registers in test */ + int invert_const; /* != 0 if invert value if cmp1 is constant */ + int invert_reg; /* != 0 if invert value if cmp1 is register */ + int unsignedp; /* != 0 for unsigned comparisons. */ }; static struct cmp_info info[ (int)ITEST_MAX ] = { - { XOR, 0, 65535, 0, 0, 0, 0, 0 }, /* EQ */ - { XOR, 0, 65535, 0, 0, 1, 1, 0 }, /* NE */ - { LT, -32769, 32766, 1, 1, 1, 0, 0 }, /* GT */ - { LT, -32768, 32767, 0, 0, 1, 1, 0 }, /* GE */ - { LT, -32768, 32767, 0, 0, 0, 0, 0 }, /* LT */ - { LT, -32769, 32766, 1, 1, 0, 1, 0 }, /* LE */ - { LTU, -32769, 32766, 1, 1, 1, 0, 1 }, /* GTU */ - { LTU, -32768, 32767, 0, 0, 1, 1, 1 }, /* GEU */ - { LTU, -32768, 32767, 0, 0, 0, 0, 1 }, /* LTU */ - { LTU, -32769, 32766, 1, 1, 0, 1, 1 }, /* LEU */ + { XOR, 0, 65535, 0, 0, 0, 0, 0 }, /* EQ */ + { XOR, 0, 65535, 0, 0, 1, 1, 0 }, /* NE */ + { LT, -32769, 32766, 1, 1, 1, 0, 0 }, /* GT */ + { LT, -32768, 32767, 0, 0, 1, 1, 0 }, /* GE */ + { LT, -32768, 32767, 0, 0, 0, 0, 0 }, /* LT */ + { LT, -32769, 32766, 1, 1, 0, 1, 0 }, /* LE */ + { LTU, -32769, 32766, 1, 1, 1, 0, 1 }, /* GTU */ + { LTU, -32768, 32767, 0, 0, 1, 1, 1 }, /* GEU */ + { LTU, -32768, 32767, 0, 0, 0, 0, 1 }, /* LTU */ + { LTU, -32769, 32766, 1, 1, 0, 1, 1 }, /* LEU */ }; enum internal_test test; @@ -2091,15 +2091,15 @@ gen_int_relational (test_code, result, cmp0, cmp1, p_invert) if (branch_p) { if (GET_CODE (cmp0) == REG || GET_CODE (cmp0) == SUBREG) - { - /* Comparisons against zero are simple branches */ - if (GET_CODE (cmp1) == CONST_INT && INTVAL (cmp1) == 0) - return (rtx)0; + { + /* Comparisons against zero are simple branches */ + if (GET_CODE (cmp1) == CONST_INT && INTVAL (cmp1) == 0) + return (rtx)0; - /* Test for beq/bne. */ - if (eqne_p) - return (rtx)0; - } + /* Test for beq/bne. */ + if (eqne_p) + return (rtx)0; + } /* allocate a pseudo to calculate the value in. */ result = gen_reg_rtx (mode); @@ -2113,23 +2113,23 @@ gen_int_relational (test_code, result, cmp0, cmp1, p_invert) { HOST_WIDE_INT value = INTVAL (cmp1); if (value < p_info->const_low - || value > p_info->const_high - /* ??? Why? And why wasn't the similar code below modified too? */ - || (TARGET_64BIT - && HOST_BITS_PER_WIDE_INT < 64 - && p_info->const_add != 0 - && ((p_info->unsignedp - ? ((unsigned HOST_WIDE_INT) (value + p_info->const_add) - > INTVAL (cmp1)) - : (value + p_info->const_add) > INTVAL (cmp1)) - != (p_info->const_add > 0)))) - cmp1 = force_reg (mode, cmp1); + || value > p_info->const_high + /* ??? Why? And why wasn't the similar code below modified too? */ + || (TARGET_64BIT + && HOST_BITS_PER_WIDE_INT < 64 + && p_info->const_add != 0 + && ((p_info->unsignedp + ? ((unsigned HOST_WIDE_INT) (value + p_info->const_add) + > INTVAL (cmp1)) + : (value + p_info->const_add) > INTVAL (cmp1)) + != (p_info->const_add > 0)))) + cmp1 = force_reg (mode, cmp1); } /* See if we need to invert the result. */ invert = (GET_CODE (cmp1) == CONST_INT) - ? p_info->invert_const - : p_info->invert_reg; + ? p_info->invert_const + : p_info->invert_reg; if (p_invert != (int *)0) { @@ -2142,25 +2142,25 @@ gen_int_relational (test_code, result, cmp0, cmp1, p_invert) if (GET_CODE (cmp1) == CONST_INT) { if (p_info->const_add != 0) - { - HOST_WIDE_INT new = INTVAL (cmp1) + p_info->const_add; - /* If modification of cmp1 caused overflow, - we would get the wrong answer if we follow the usual path; - thus, x > 0xffffffffU would turn into x > 0U. */ - if ((p_info->unsignedp - ? (unsigned HOST_WIDE_INT) new > INTVAL (cmp1) - : new > INTVAL (cmp1)) - != (p_info->const_add > 0)) - { - /* This test is always true, but if INVERT is true then - the result of the test needs to be inverted so 0 should - be returned instead. */ - emit_move_insn (result, invert ? const0_rtx : const_true_rtx); - return result; - } - else - cmp1 = GEN_INT (new); - } + { + HOST_WIDE_INT new = INTVAL (cmp1) + p_info->const_add; + /* If modification of cmp1 caused overflow, + we would get the wrong answer if we follow the usual path; + thus, x > 0xffffffffU would turn into x > 0U. */ + if ((p_info->unsignedp + ? (unsigned HOST_WIDE_INT) new > INTVAL (cmp1) + : new > INTVAL (cmp1)) + != (p_info->const_add > 0)) + { + /* This test is always true, but if INVERT is true then + the result of the test needs to be inverted so 0 should + be returned instead. */ + emit_move_insn (result, invert ? const0_rtx : const_true_rtx); + return result; + } + else + cmp1 = GEN_INT (new); + } } else if (p_info->reverse_regs) { @@ -2225,34 +2225,34 @@ gen_conditional_branch (operands, test_code) invert = FALSE; reg = gen_int_relational (test_code, NULL_RTX, cmp0, cmp1, &invert); if (reg) - { - cmp0 = reg; - cmp1 = const0_rtx; - test_code = NE; - } + { + cmp0 = reg; + cmp1 = const0_rtx; + test_code = NE; + } else if (GET_CODE (cmp1) == CONST_INT && INTVAL (cmp1) != 0) - { - /* We don't want to build a comparison against a non-zero + { + /* We don't want to build a comparison against a non-zero constant. */ - cmp1 = force_reg (mode, cmp1); - } + cmp1 = force_reg (mode, cmp1); + } break; case CMP_SF: case CMP_DF: if (mips_isa < 4) - reg = gen_rtx (REG, CCmode, FPSW_REGNUM); + reg = gen_rtx (REG, CCmode, FPSW_REGNUM); else - reg = gen_reg_rtx (CCmode); + reg = gen_reg_rtx (CCmode); /* For cmp0 != cmp1, build cmp0 == cmp1, and test for result == 0 in the instruction built below. The MIPS FPU handles inequality testing by testing for equality and looking for a false result. */ emit_insn (gen_rtx (SET, VOIDmode, - reg, - gen_rtx (test_code == NE ? EQ : test_code, - CCmode, cmp0, cmp1))); + reg, + gen_rtx (test_code == NE ? EQ : test_code, + CCmode, cmp0, cmp1))); test_code = test_code == NE ? EQ : NE; mode = CCmode; @@ -2274,11 +2274,11 @@ gen_conditional_branch (operands, test_code) } emit_jump_insn (gen_rtx (SET, VOIDmode, - pc_rtx, - gen_rtx (IF_THEN_ELSE, VOIDmode, - gen_rtx (test_code, mode, cmp0, cmp1), - label1, - label2))); + pc_rtx, + gen_rtx (IF_THEN_ELSE, VOIDmode, + gen_rtx (test_code, mode, cmp0, cmp1), + label1, + label2))); } /* Emit the common code for conditional moves. OPERANDS is the array @@ -2300,61 +2300,61 @@ gen_conditional_move (operands) if (GET_MODE_CLASS (mode) != MODE_FLOAT) { switch (cmp_code) - { - case EQ: - cmp_code = XOR; - move_code = EQ; - break; - case NE: - cmp_code = XOR; - break; - case LT: - break; - case GE: - cmp_code = LT; - move_code = EQ; - break; - case GT: - cmp_code = LT; - op0 = force_reg (mode, branch_cmp[1]); - op1 = branch_cmp[0]; - break; - case LE: - cmp_code = LT; - op0 = force_reg (mode, branch_cmp[1]); - op1 = branch_cmp[0]; - move_code = EQ; - break; - case LTU: - break; - case GEU: - cmp_code = LTU; - move_code = EQ; - break; - case GTU: - cmp_code = LTU; - op0 = force_reg (mode, branch_cmp[1]); - op1 = branch_cmp[0]; - break; - case LEU: - cmp_code = LTU; - op0 = force_reg (mode, branch_cmp[1]); - op1 = branch_cmp[0]; - move_code = EQ; - break; - default: - abort (); - } + { + case EQ: + cmp_code = XOR; + move_code = EQ; + break; + case NE: + cmp_code = XOR; + break; + case LT: + break; + case GE: + cmp_code = LT; + move_code = EQ; + break; + case GT: + cmp_code = LT; + op0 = force_reg (mode, branch_cmp[1]); + op1 = branch_cmp[0]; + break; + case LE: + cmp_code = LT; + op0 = force_reg (mode, branch_cmp[1]); + op1 = branch_cmp[0]; + move_code = EQ; + break; + case LTU: + break; + case GEU: + cmp_code = LTU; + move_code = EQ; + break; + case GTU: + cmp_code = LTU; + op0 = force_reg (mode, branch_cmp[1]); + op1 = branch_cmp[0]; + break; + case LEU: + cmp_code = LTU; + op0 = force_reg (mode, branch_cmp[1]); + op1 = branch_cmp[0]; + move_code = EQ; + break; + default: + abort (); + } } else { if (cmp_code == NE) - { - cmp_code = EQ; - move_code = EQ; - } + { + cmp_code = EQ; + move_code = EQ; + } } - + if (mode == SImode || mode == DImode) cmp_mode = mode; else if (mode == SFmode || mode == DFmode) @@ -2364,16 +2364,16 @@ gen_conditional_move (operands) cmp_reg = gen_reg_rtx (cmp_mode); emit_insn (gen_rtx (SET, cmp_mode, - cmp_reg, - gen_rtx (cmp_code, cmp_mode, op0, op1))); + cmp_reg, + gen_rtx (cmp_code, cmp_mode, op0, op1))); emit_insn (gen_rtx (SET, op_mode, - operands[0], - gen_rtx (IF_THEN_ELSE, op_mode, - gen_rtx (move_code, VOIDmode, - cmp_reg, - CONST0_RTX (SImode)), - operands[2], - operands[3]))); + operands[0], + gen_rtx (IF_THEN_ELSE, op_mode, + gen_rtx (move_code, VOIDmode, + cmp_reg, + CONST0_RTX (SImode)), + operands[2], + operands[3]))); } /* Write a loop to move a constant number of bytes. Generate load/stores as follows: @@ -2403,16 +2403,16 @@ gen_conditional_move (operands) static void block_move_loop (dest_reg, src_reg, bytes, align, orig_dest, orig_src) - rtx dest_reg; /* register holding destination address */ - rtx src_reg; /* register holding source address */ - int bytes; /* # bytes to move */ - int align; /* alignment */ - rtx orig_dest; /* original dest for change_address */ - rtx orig_src; /* original source for making a reg note */ + rtx dest_reg; /* register holding destination address */ + rtx src_reg; /* register holding source address */ + int bytes; /* # bytes to move */ + int align; /* alignment */ + rtx orig_dest; /* original dest for change_address */ + rtx orig_src; /* original source for making a reg note */ { - rtx dest_mem = change_address (orig_dest, BLKmode, dest_reg); - rtx src_mem = change_address (orig_src, BLKmode, src_reg); - rtx align_rtx = GEN_INT (align); + rtx dest_mem = change_address (orig_dest, BLKmode, dest_reg); + rtx src_mem = change_address (orig_src, BLKmode, src_reg); + rtx align_rtx = GEN_INT (align); rtx label; rtx final_src; rtx bytes_rtx; @@ -2431,22 +2431,22 @@ block_move_loop (dest_reg, src_reg, bytes, align, orig_dest, orig_src) if (bytes > 0x7fff) { if (TARGET_LONG64) - { - emit_insn (gen_movdi (final_src, bytes_rtx)); - emit_insn (gen_adddi3 (final_src, final_src, src_reg)); - } + { + emit_insn (gen_movdi (final_src, bytes_rtx)); + emit_insn (gen_adddi3 (final_src, final_src, src_reg)); + } else - { - emit_insn (gen_movsi (final_src, bytes_rtx)); - emit_insn (gen_addsi3 (final_src, final_src, src_reg)); - } + { + emit_insn (gen_movsi (final_src, bytes_rtx)); + emit_insn (gen_addsi3 (final_src, final_src, src_reg)); + } } else { if (TARGET_LONG64) - emit_insn (gen_adddi3 (final_src, src_reg, bytes_rtx)); + emit_insn (gen_adddi3 (final_src, src_reg, bytes_rtx)); else - emit_insn (gen_addsi3 (final_src, src_reg, bytes_rtx)); + emit_insn (gen_addsi3 (final_src, src_reg, bytes_rtx)); } emit_label (label); @@ -2469,8 +2469,8 @@ block_move_loop (dest_reg, src_reg, bytes, align, orig_dest, orig_src) if (leftover) emit_insn (gen_movstrsi_internal (dest_mem, src_mem, - GEN_INT (leftover), - align_rtx)); + GEN_INT (leftover), + align_rtx)); } /* Use a library function to move some bytes. */ @@ -2489,21 +2489,21 @@ block_move_call (dest_reg, src_reg, bytes_rtx) #ifdef TARGET_MEM_FUNCTIONS emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "memcpy"), 0, - VOIDmode, 3, - dest_reg, Pmode, - src_reg, Pmode, - convert_to_mode (TYPE_MODE (sizetype), bytes_rtx, - TREE_UNSIGNED (sizetype)), - TYPE_MODE (sizetype)); + VOIDmode, 3, + dest_reg, Pmode, + src_reg, Pmode, + convert_to_mode (TYPE_MODE (sizetype), bytes_rtx, + TREE_UNSIGNED (sizetype)), + TYPE_MODE (sizetype)); #else emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "bcopy"), 0, - VOIDmode, 3, - src_reg, Pmode, - dest_reg, Pmode, - convert_to_mode (TYPE_MODE (integer_type_node), - bytes_rtx, - TREE_UNSIGNED (integer_type_node)), - TYPE_MODE (integer_type_node)); + VOIDmode, 3, + src_reg, Pmode, + dest_reg, Pmode, + convert_to_mode (TYPE_MODE (integer_type_node), + bytes_rtx, + TREE_UNSIGNED (integer_type_node)), + TYPE_MODE (integer_type_node)); #endif } @@ -2519,13 +2519,13 @@ void expand_block_move (operands) rtx operands[]; { - rtx bytes_rtx = operands[2]; + rtx bytes_rtx = operands[2]; rtx align_rtx = operands[3]; - int constp = (GET_CODE (bytes_rtx) == CONST_INT); - int bytes = (constp ? INTVAL (bytes_rtx) : 0); - int align = INTVAL (align_rtx); - rtx orig_src = operands[1]; - rtx orig_dest = operands[0]; + int constp = (GET_CODE (bytes_rtx) == CONST_INT); + int bytes = (constp ? INTVAL (bytes_rtx) : 0); + int align = INTVAL (align_rtx); + rtx orig_src = operands[1]; + rtx orig_dest = operands[0]; rtx src_reg; rtx dest_reg; @@ -2544,10 +2544,10 @@ expand_block_move (operands) else if (constp && bytes <= 2*MAX_MOVE_BYTES) emit_insn (gen_movstrsi_internal (change_address (orig_dest, BLKmode, - dest_reg), - change_address (orig_src, BLKmode, - src_reg), - bytes_rtx, align_rtx)); + dest_reg), + change_address (orig_src, BLKmode, + src_reg), + bytes_rtx, align_rtx)); else if (constp && align >= UNITS_PER_WORD && optimize) block_move_loop (dest_reg, src_reg, bytes, align, orig_dest, orig_src); @@ -2555,28 +2555,28 @@ expand_block_move (operands) else if (constp && optimize) { /* If the alignment is not word aligned, generate a test at - runtime, to see whether things wound up aligned, and we - can use the faster lw/sw instead ulw/usw. */ + runtime, to see whether things wound up aligned, and we + can use the faster lw/sw instead ulw/usw. */ - rtx temp = gen_reg_rtx (Pmode); + rtx temp = gen_reg_rtx (Pmode); rtx aligned_label = gen_label_rtx (); - rtx join_label = gen_label_rtx (); - int leftover = bytes % MAX_MOVE_BYTES; + rtx join_label = gen_label_rtx (); + int leftover = bytes % MAX_MOVE_BYTES; bytes -= leftover; if (TARGET_LONG64) - { - emit_insn (gen_iordi3 (temp, src_reg, dest_reg)); - emit_insn (gen_anddi3 (temp, temp, GEN_INT (UNITS_PER_WORD-1))); - emit_insn (gen_cmpdi (temp, const0_rtx)); - } + { + emit_insn (gen_iordi3 (temp, src_reg, dest_reg)); + emit_insn (gen_anddi3 (temp, temp, GEN_INT (UNITS_PER_WORD-1))); + emit_insn (gen_cmpdi (temp, const0_rtx)); + } else - { - emit_insn (gen_iorsi3 (temp, src_reg, dest_reg)); - emit_insn (gen_andsi3 (temp, temp, GEN_INT (UNITS_PER_WORD-1))); - emit_insn (gen_cmpsi (temp, const0_rtx)); - } + { + emit_insn (gen_iorsi3 (temp, src_reg, dest_reg)); + emit_insn (gen_andsi3 (temp, temp, GEN_INT (UNITS_PER_WORD-1))); + emit_insn (gen_cmpsi (temp, const0_rtx)); + } emit_jump_insn (gen_beq (aligned_label)); /* Unaligned loop. */ @@ -2587,17 +2587,17 @@ expand_block_move (operands) /* Aligned loop. */ emit_label (aligned_label); block_move_loop (dest_reg, src_reg, bytes, UNITS_PER_WORD, orig_dest, - orig_src); + orig_src); emit_label (join_label); /* Bytes at the end of the loop. */ if (leftover) - emit_insn (gen_movstrsi_internal (change_address (orig_dest, BLKmode, - dest_reg), - change_address (orig_src, BLKmode, - src_reg), - GEN_INT (leftover), - GEN_INT (align))); + emit_insn (gen_movstrsi_internal (change_address (orig_dest, BLKmode, + dest_reg), + change_address (orig_src, BLKmode, + src_reg), + GEN_INT (leftover), + GEN_INT (align))); } else @@ -2617,9 +2617,9 @@ expand_block_move (operands) operands[3+num_regs] is the last temp register. The block move type can be one of the following: - BLOCK_MOVE_NORMAL Do all of the block move. - BLOCK_MOVE_NOT_LAST Do all but the last store. - BLOCK_MOVE_LAST Do just the last store. */ + BLOCK_MOVE_NORMAL Do all of the block move. + BLOCK_MOVE_NOT_LAST Do all but the last store. + BLOCK_MOVE_LAST Do just the last store. */ char * output_block_move (insn, operands, num_regs, move_type) @@ -2628,26 +2628,26 @@ output_block_move (insn, operands, num_regs, move_type) int num_regs; enum block_move_type move_type; { - rtx dest_reg = XEXP (operands[0], 0); - rtx src_reg = XEXP (operands[1], 0); - int bytes = INTVAL (operands[2]); - int align = INTVAL (operands[3]); - int num = 0; - int offset = 0; - int use_lwl_lwr = FALSE; - int last_operand = num_regs+4; - int safe_regs = 4; + rtx dest_reg = XEXP (operands[0], 0); + rtx src_reg = XEXP (operands[1], 0); + int bytes = INTVAL (operands[2]); + int align = INTVAL (operands[3]); + int num = 0; + int offset = 0; + int use_lwl_lwr = FALSE; + int last_operand = num_regs+4; + int safe_regs = 4; int i; rtx xoperands[10]; struct { - char *load; /* load insn without nop */ - char *load_nop; /* load insn with trailing nop */ - char *store; /* store insn */ - char *final; /* if last_store used: NULL or swr */ - char *last_store; /* last store instruction */ - int offset; /* current offset */ - enum machine_mode mode; /* mode to use on (MEM) */ + char *load; /* load insn without nop */ + char *load_nop; /* load insn with trailing nop */ + char *store; /* store insn */ + char *final; /* if last_store used: NULL or swr */ + char *last_store; /* last store instruction */ + int offset; /* current offset */ + enum machine_mode mode; /* mode to use on (MEM) */ } load_store[4]; /* Detect a bug in GCC, where it can give us a register @@ -2658,9 +2658,9 @@ output_block_move (insn, operands, num_regs, move_type) i++) { if (!reg_mentioned_p (operands[i], operands[0]) - && !reg_mentioned_p (operands[i], operands[1])) + && !reg_mentioned_p (operands[i], operands[1])) - xoperands[safe_regs++] = operands[i]; + xoperands[safe_regs++] = operands[i]; } if (safe_regs < last_operand) @@ -2680,41 +2680,41 @@ output_block_move (insn, operands, num_regs, move_type) constant addresses into registers when generating N32/N64 code, just in case we might emit an unaligned load instruction. */ if (num_regs > 2 && (bytes > 2*align || move_type != BLOCK_MOVE_NORMAL - || mips_abi == ABI_N32 || mips_abi == ABI_64)) + || mips_abi == ABI_N32 || mips_abi == ABI_64)) { if (CONSTANT_P (src_reg)) - { - if (TARGET_STATS) - mips_count_memory_refs (operands[1], 1); + { + if (TARGET_STATS) + mips_count_memory_refs (operands[1], 1); - src_reg = operands[ 3 + num_regs-- ]; - if (move_type != BLOCK_MOVE_LAST) - { - xoperands[1] = operands[1]; - xoperands[0] = src_reg; - if (Pmode == DImode) - output_asm_insn ("dla\t%0,%1", xoperands); - else - output_asm_insn ("la\t%0,%1", xoperands); - } - } + src_reg = operands[ 3 + num_regs-- ]; + if (move_type != BLOCK_MOVE_LAST) + { + xoperands[1] = operands[1]; + xoperands[0] = src_reg; + if (Pmode == DImode) + output_asm_insn ("dla\t%0,%1", xoperands); + else + output_asm_insn ("la\t%0,%1", xoperands); + } + } if (CONSTANT_P (dest_reg)) - { - if (TARGET_STATS) - mips_count_memory_refs (operands[0], 1); + { + if (TARGET_STATS) + mips_count_memory_refs (operands[0], 1); - dest_reg = operands[ 3 + num_regs-- ]; - if (move_type != BLOCK_MOVE_LAST) - { - xoperands[1] = operands[0]; - xoperands[0] = dest_reg; - if (Pmode == DImode) - output_asm_insn ("dla\t%0,%1", xoperands); - else - output_asm_insn ("la\t%0,%1", xoperands); - } - } + dest_reg = operands[ 3 + num_regs-- ]; + if (move_type != BLOCK_MOVE_LAST) + { + xoperands[1] = operands[0]; + xoperands[0] = dest_reg; + if (Pmode == DImode) + output_asm_insn ("dla\t%0,%1", xoperands); + else + output_asm_insn ("la\t%0,%1", xoperands); + } + } } /* ??? We really shouldn't get any LO_SUM addresses here, because they @@ -2727,30 +2727,30 @@ output_block_move (insn, operands, num_regs, move_type) { src_reg = operands[ 3 + num_regs-- ]; if (move_type != BLOCK_MOVE_LAST) - { - xoperands[2] = XEXP (XEXP (operands[1], 0), 1); - xoperands[1] = XEXP (XEXP (operands[1], 0), 0); - xoperands[0] = src_reg; - if (Pmode == DImode) - output_asm_insn ("daddiu\t%0,%1,%%lo(%2)", xoperands); - else - output_asm_insn ("addiu\t%0,%1,%%lo(%2)", xoperands); - } + { + xoperands[2] = XEXP (XEXP (operands[1], 0), 1); + xoperands[1] = XEXP (XEXP (operands[1], 0), 0); + xoperands[0] = src_reg; + if (Pmode == DImode) + output_asm_insn ("daddiu\t%0,%1,%%lo(%2)", xoperands); + else + output_asm_insn ("addiu\t%0,%1,%%lo(%2)", xoperands); + } } if (GET_CODE (dest_reg) == LO_SUM) { dest_reg = operands[ 3 + num_regs-- ]; if (move_type != BLOCK_MOVE_LAST) - { - xoperands[2] = XEXP (XEXP (operands[0], 0), 1); - xoperands[1] = XEXP (XEXP (operands[0], 0), 0); - xoperands[0] = dest_reg; - if (Pmode == DImode) - output_asm_insn ("daddiu\t%0,%1,%%lo(%2)", xoperands); - else - output_asm_insn ("addiu\t%0,%1,%%lo(%2)", xoperands); - } + { + xoperands[2] = XEXP (XEXP (operands[0], 0), 1); + xoperands[1] = XEXP (XEXP (operands[0], 0), 0); + xoperands[0] = dest_reg; + if (Pmode == DImode) + output_asm_insn ("daddiu\t%0,%1,%%lo(%2)", xoperands); + else + output_asm_insn ("addiu\t%0,%1,%%lo(%2)", xoperands); + } } if (num_regs > (sizeof (load_store) / sizeof (load_store[0]))) @@ -2764,196 +2764,196 @@ output_block_move (insn, operands, num_regs, move_type) load_store[num].offset = offset; if (TARGET_64BIT && bytes >= 8 && align >= 8) - { - load_store[num].load = "ld\t%0,%1"; - load_store[num].load_nop = "ld\t%0,%1%#"; - load_store[num].store = "sd\t%0,%1"; - load_store[num].last_store = "sd\t%0,%1"; - load_store[num].final = (char *)0; - load_store[num].mode = DImode; - offset += 8; - bytes -= 8; - } + { + load_store[num].load = "ld\t%0,%1"; + load_store[num].load_nop = "ld\t%0,%1%#"; + load_store[num].store = "sd\t%0,%1"; + load_store[num].last_store = "sd\t%0,%1"; + load_store[num].final = (char *)0; + load_store[num].mode = DImode; + offset += 8; + bytes -= 8; + } else if (TARGET_64BIT && bytes >= 8) - { - if (BYTES_BIG_ENDIAN) - { - load_store[num].load = "ldl\t%0,%1\n\tldr\t%0,%2"; - load_store[num].load_nop = "ldl\t%0,%1\n\tldr\t%0,%2%#"; - load_store[num].store = "sdl\t%0,%1\n\tsdr\t%0,%2"; - load_store[num].last_store = "sdr\t%0,%2"; - load_store[num].final = "sdl\t%0,%1"; - } - else - { - load_store[num].load = "ldl\t%0,%2\n\tldr\t%0,%1"; - load_store[num].load_nop = "ldl\t%0,%2\n\tldr\t%0,%1%#"; - load_store[num].store = "sdl\t%0,%2\n\tsdr\t%0,%1"; - load_store[num].last_store = "sdr\t%0,%1"; - load_store[num].final = "sdl\t%0,%2"; - } - load_store[num].mode = DImode; - offset += 8; - bytes -= 8; - use_lwl_lwr = TRUE; - } + { + if (BYTES_BIG_ENDIAN) + { + load_store[num].load = "ldl\t%0,%1\n\tldr\t%0,%2"; + load_store[num].load_nop = "ldl\t%0,%1\n\tldr\t%0,%2%#"; + load_store[num].store = "sdl\t%0,%1\n\tsdr\t%0,%2"; + load_store[num].last_store = "sdr\t%0,%2"; + load_store[num].final = "sdl\t%0,%1"; + } + else + { + load_store[num].load = "ldl\t%0,%2\n\tldr\t%0,%1"; + load_store[num].load_nop = "ldl\t%0,%2\n\tldr\t%0,%1%#"; + load_store[num].store = "sdl\t%0,%2\n\tsdr\t%0,%1"; + load_store[num].last_store = "sdr\t%0,%1"; + load_store[num].final = "sdl\t%0,%2"; + } + load_store[num].mode = DImode; + offset += 8; + bytes -= 8; + use_lwl_lwr = TRUE; + } else if (bytes >= 4 && align >= 4) - { - load_store[num].load = "lw\t%0,%1"; - load_store[num].load_nop = "lw\t%0,%1%#"; - load_store[num].store = "sw\t%0,%1"; - load_store[num].last_store = "sw\t%0,%1"; - load_store[num].final = (char *)0; - load_store[num].mode = SImode; - offset += 4; - bytes -= 4; - } + { + load_store[num].load = "lw\t%0,%1"; + load_store[num].load_nop = "lw\t%0,%1%#"; + load_store[num].store = "sw\t%0,%1"; + load_store[num].last_store = "sw\t%0,%1"; + load_store[num].final = (char *)0; + load_store[num].mode = SImode; + offset += 4; + bytes -= 4; + } else if (bytes >= 4) - { - if (BYTES_BIG_ENDIAN) - { - load_store[num].load = "lwl\t%0,%1\n\tlwr\t%0,%2"; - load_store[num].load_nop = "lwl\t%0,%1\n\tlwr\t%0,%2%#"; - load_store[num].store = "swl\t%0,%1\n\tswr\t%0,%2"; - load_store[num].last_store = "swr\t%0,%2"; - load_store[num].final = "swl\t%0,%1"; - } - else - { - load_store[num].load = "lwl\t%0,%2\n\tlwr\t%0,%1"; - load_store[num].load_nop = "lwl\t%0,%2\n\tlwr\t%0,%1%#"; - load_store[num].store = "swl\t%0,%2\n\tswr\t%0,%1"; - load_store[num].last_store = "swr\t%0,%1"; - load_store[num].final = "swl\t%0,%2"; - } - load_store[num].mode = SImode; - offset += 4; - bytes -= 4; - use_lwl_lwr = TRUE; - } + { + if (BYTES_BIG_ENDIAN) + { + load_store[num].load = "lwl\t%0,%1\n\tlwr\t%0,%2"; + load_store[num].load_nop = "lwl\t%0,%1\n\tlwr\t%0,%2%#"; + load_store[num].store = "swl\t%0,%1\n\tswr\t%0,%2"; + load_store[num].last_store = "swr\t%0,%2"; + load_store[num].final = "swl\t%0,%1"; + } + else + { + load_store[num].load = "lwl\t%0,%2\n\tlwr\t%0,%1"; + load_store[num].load_nop = "lwl\t%0,%2\n\tlwr\t%0,%1%#"; + load_store[num].store = "swl\t%0,%2\n\tswr\t%0,%1"; + load_store[num].last_store = "swr\t%0,%1"; + load_store[num].final = "swl\t%0,%2"; + } + load_store[num].mode = SImode; + offset += 4; + bytes -= 4; + use_lwl_lwr = TRUE; + } else if (bytes >= 2 && align >= 2) - { - load_store[num].load = "lh\t%0,%1"; - load_store[num].load_nop = "lh\t%0,%1%#"; - load_store[num].store = "sh\t%0,%1"; - load_store[num].last_store = "sh\t%0,%1"; - load_store[num].final = (char *)0; - load_store[num].mode = HImode; - offset += 2; - bytes -= 2; - } + { + load_store[num].load = "lh\t%0,%1"; + load_store[num].load_nop = "lh\t%0,%1%#"; + load_store[num].store = "sh\t%0,%1"; + load_store[num].last_store = "sh\t%0,%1"; + load_store[num].final = (char *)0; + load_store[num].mode = HImode; + offset += 2; + bytes -= 2; + } else - { - load_store[num].load = "lb\t%0,%1"; - load_store[num].load_nop = "lb\t%0,%1%#"; - load_store[num].store = "sb\t%0,%1"; - load_store[num].last_store = "sb\t%0,%1"; - load_store[num].final = (char *)0; - load_store[num].mode = QImode; - offset++; - bytes--; - } + { + load_store[num].load = "lb\t%0,%1"; + load_store[num].load_nop = "lb\t%0,%1%#"; + load_store[num].store = "sb\t%0,%1"; + load_store[num].last_store = "sb\t%0,%1"; + load_store[num].final = (char *)0; + load_store[num].mode = QImode; + offset++; + bytes--; + } if (TARGET_STATS && move_type != BLOCK_MOVE_LAST) - { - dslots_load_total++; - dslots_load_filled++; + { + dslots_load_total++; + dslots_load_filled++; - if (CONSTANT_P (src_reg)) - mips_count_memory_refs (src_reg, 1); + if (CONSTANT_P (src_reg)) + mips_count_memory_refs (src_reg, 1); - if (CONSTANT_P (dest_reg)) - mips_count_memory_refs (dest_reg, 1); - } + if (CONSTANT_P (dest_reg)) + mips_count_memory_refs (dest_reg, 1); + } /* Emit load/stores now if we have run out of registers or are - at the end of the move. */ + at the end of the move. */ if (++num == num_regs || bytes == 0) - { - /* If only load/store, we need a NOP after the load. */ - if (num == 1) - { - load_store[0].load = load_store[0].load_nop; - if (TARGET_STATS && move_type != BLOCK_MOVE_LAST) - dslots_load_filled--; - } + { + /* If only load/store, we need a NOP after the load. */ + if (num == 1) + { + load_store[0].load = load_store[0].load_nop; + if (TARGET_STATS && move_type != BLOCK_MOVE_LAST) + dslots_load_filled--; + } - if (move_type != BLOCK_MOVE_LAST) - { - for (i = 0; i < num; i++) - { - int offset; + if (move_type != BLOCK_MOVE_LAST) + { + for (i = 0; i < num; i++) + { + int offset; - if (!operands[i+4]) - abort (); + if (!operands[i+4]) + abort (); - if (GET_MODE (operands[i+4]) != load_store[i].mode) - operands[i+4] = gen_rtx (REG, load_store[i].mode, REGNO (operands[i+4])); + if (GET_MODE (operands[i+4]) != load_store[i].mode) + operands[i+4] = gen_rtx (REG, load_store[i].mode, REGNO (operands[i+4])); - offset = load_store[i].offset; - xoperands[0] = operands[i+4]; - xoperands[1] = gen_rtx (MEM, load_store[i].mode, - plus_constant (src_reg, offset)); + offset = load_store[i].offset; + xoperands[0] = operands[i+4]; + xoperands[1] = gen_rtx (MEM, load_store[i].mode, + plus_constant (src_reg, offset)); - if (use_lwl_lwr) - { - int extra_offset; - extra_offset = GET_MODE_SIZE (load_store[i].mode) - 1; - xoperands[2] = gen_rtx (MEM, load_store[i].mode, - plus_constant (src_reg, - extra_offset - + offset)); - } + if (use_lwl_lwr) + { + int extra_offset; + extra_offset = GET_MODE_SIZE (load_store[i].mode) - 1; + xoperands[2] = gen_rtx (MEM, load_store[i].mode, + plus_constant (src_reg, + extra_offset + + offset)); + } - output_asm_insn (load_store[i].load, xoperands); - } - } + output_asm_insn (load_store[i].load, xoperands); + } + } - for (i = 0; i < num; i++) - { - int last_p = (i == num-1 && bytes == 0); - int offset = load_store[i].offset; + for (i = 0; i < num; i++) + { + int last_p = (i == num-1 && bytes == 0); + int offset = load_store[i].offset; - xoperands[0] = operands[i+4]; - xoperands[1] = gen_rtx (MEM, load_store[i].mode, - plus_constant (dest_reg, offset)); + xoperands[0] = operands[i+4]; + xoperands[1] = gen_rtx (MEM, load_store[i].mode, + plus_constant (dest_reg, offset)); - if (use_lwl_lwr) - { - int extra_offset; - extra_offset = GET_MODE_SIZE (load_store[i].mode) - 1; - xoperands[2] = gen_rtx (MEM, load_store[i].mode, - plus_constant (dest_reg, - extra_offset - + offset)); - } + if (use_lwl_lwr) + { + int extra_offset; + extra_offset = GET_MODE_SIZE (load_store[i].mode) - 1; + xoperands[2] = gen_rtx (MEM, load_store[i].mode, + plus_constant (dest_reg, + extra_offset + + offset)); + } - if (move_type == BLOCK_MOVE_NORMAL) - output_asm_insn (load_store[i].store, xoperands); + if (move_type == BLOCK_MOVE_NORMAL) + output_asm_insn (load_store[i].store, xoperands); - else if (move_type == BLOCK_MOVE_NOT_LAST) - { - if (!last_p) - output_asm_insn (load_store[i].store, xoperands); + else if (move_type == BLOCK_MOVE_NOT_LAST) + { + if (!last_p) + output_asm_insn (load_store[i].store, xoperands); - else if (load_store[i].final != (char *)0) - output_asm_insn (load_store[i].final, xoperands); - } + else if (load_store[i].final != (char *)0) + output_asm_insn (load_store[i].final, xoperands); + } - else if (last_p) - output_asm_insn (load_store[i].last_store, xoperands); - } + else if (last_p) + output_asm_insn (load_store[i].last_store, xoperands); + } - num = 0; /* reset load_store */ - use_lwl_lwr = FALSE; - } + num = 0; /* reset load_store */ + use_lwl_lwr = FALSE; + } } return ""; @@ -2966,9 +2966,9 @@ output_block_move (insn, operands, num_regs, move_type) void init_cumulative_args (cum, fntype, libname) - CUMULATIVE_ARGS *cum; /* argument info to initialize */ - tree fntype; /* tree ptr for function decl */ - rtx libname; /* SYMBOL_REF of library name or 0 */ + CUMULATIVE_ARGS *cum; /* argument info to initialize */ + tree fntype; /* tree ptr for function decl */ + rtx libname; /* SYMBOL_REF of library name or 0 */ { static CUMULATIVE_ARGS zero_cum; tree param, next_param; @@ -2977,15 +2977,15 @@ init_cumulative_args (cum, fntype, libname) { fprintf (stderr, "\ninit_cumulative_args, fntype = 0x%.8lx", (long)fntype); if (!fntype) - fputc ('\n', stderr); + fputc ('\n', stderr); else - { - tree ret_type = TREE_TYPE (fntype); - fprintf (stderr, ", fntype code = %s, ret code = %s\n", - tree_code_name[ (int)TREE_CODE (fntype) ], - tree_code_name[ (int)TREE_CODE (ret_type) ]); - } + { + tree ret_type = TREE_TYPE (fntype); + fprintf (stderr, ", fntype code = %s, ret code = %s\n", + tree_code_name[ (int)TREE_CODE (fntype) ], + tree_code_name[ (int)TREE_CODE (ret_type) ]); + } } *cum = zero_cum; @@ -3002,7 +3002,7 @@ init_cumulative_args (cum, fntype, libname) { next_param = TREE_CHAIN (param); if (next_param == (tree)0 && TREE_VALUE (param) != void_type_node) - cum->gp_reg_found = 1; + cum->gp_reg_found = 1; } } @@ -3010,16 +3010,16 @@ init_cumulative_args (cum, fntype, libname) void function_arg_advance (cum, mode, type, named) - CUMULATIVE_ARGS *cum; /* current arg information */ - enum machine_mode mode; /* current arg mode */ - tree type; /* type of the argument or 0 if lib support */ - int named; /* whether or not the argument was named */ + CUMULATIVE_ARGS *cum; /* current arg information */ + enum machine_mode mode; /* current arg mode */ + tree type; /* type of the argument or 0 if lib support */ + int named; /* whether or not the argument was named */ { if (TARGET_DEBUG_E_MODE) fprintf (stderr, - "function_adv( {gp reg found = %d, arg # = %2d, words = %2d}, %4s, 0x%.8x, %d )\n\n", - cum->gp_reg_found, cum->arg_number, cum->arg_words, GET_MODE_NAME (mode), - type, named); + "function_adv( {gp reg found = %d, arg # = %2d, words = %2d}, %4s, 0x%.8x, %d )\n\n", + cum->gp_reg_found, cum->arg_number, cum->arg_words, GET_MODE_NAME (mode), + type, named); cum->arg_number++; switch (mode) @@ -3029,31 +3029,31 @@ function_arg_advance (cum, mode, type, named) default: if (GET_MODE_CLASS (mode) != MODE_COMPLEX_INT - && GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT) - abort (); + && GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT) + abort (); cum->gp_reg_found = 1; cum->arg_words += ((GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) - / UNITS_PER_WORD); + / UNITS_PER_WORD); break; case BLKmode: cum->gp_reg_found = 1; cum->arg_words += ((int_size_in_bytes (type) + UNITS_PER_WORD - 1) - / UNITS_PER_WORD); + / UNITS_PER_WORD); break; case SFmode: if (mips_abi == ABI_EABI && ! TARGET_SOFT_FLOAT) - cum->fp_arg_words++; + cum->fp_arg_words++; else - cum->arg_words++; + cum->arg_words++; break; case DFmode: if (mips_abi == ABI_EABI && ! TARGET_SOFT_FLOAT && ! TARGET_SINGLE_FLOAT) - cum->fp_arg_words += (TARGET_64BIT ? 1 : 2); + cum->fp_arg_words += (TARGET_64BIT ? 1 : 2); else - cum->arg_words += (TARGET_64BIT ? 1 : 2); + cum->arg_words += (TARGET_64BIT ? 1 : 2); break; case DImode: @@ -3075,94 +3075,94 @@ function_arg_advance (cum, mode, type, named) struct rtx_def * function_arg (cum, mode, type, named) - CUMULATIVE_ARGS *cum; /* current arg information */ - enum machine_mode mode; /* current arg mode */ - tree type; /* type of the argument or 0 if lib support */ - int named; /* != 0 for normal args, == 0 for ... args */ + CUMULATIVE_ARGS *cum; /* current arg information */ + enum machine_mode mode; /* current arg mode */ + tree type; /* type of the argument or 0 if lib support */ + int named; /* != 0 for normal args, == 0 for ... args */ { rtx ret; int regbase = -1; int bias = 0; int *arg_words = &cum->arg_words; int struct_p = ((type != (tree)0) - && (TREE_CODE (type) == RECORD_TYPE - || TREE_CODE (type) == UNION_TYPE)); + && (TREE_CODE (type) == RECORD_TYPE + || TREE_CODE (type) == UNION_TYPE)); if (TARGET_DEBUG_E_MODE) fprintf (stderr, - "function_arg( {gp reg found = %d, arg # = %2d, words = %2d}, %4s, 0x%.8x, %d ) = ", - cum->gp_reg_found, cum->arg_number, cum->arg_words, GET_MODE_NAME (mode), - type, named); + "function_arg( {gp reg found = %d, arg # = %2d, words = %2d}, %4s, 0x%.8x, %d ) = ", + cum->gp_reg_found, cum->arg_number, cum->arg_words, GET_MODE_NAME (mode), + type, named); cum->last_arg_fp = 0; switch (mode) { case SFmode: if (mips_abi == ABI_32) - { - if (cum->gp_reg_found || cum->arg_number >= 2 || TARGET_SOFT_FLOAT) - regbase = GP_ARG_FIRST; - else - { - regbase = FP_ARG_FIRST; - /* If the first arg was a float in a floating point register, - then set bias to align this float arg properly. */ - if (cum->arg_words == 1) - bias = 1; - } - } + { + if (cum->gp_reg_found || cum->arg_number >= 2 || TARGET_SOFT_FLOAT) + regbase = GP_ARG_FIRST; + else + { + regbase = FP_ARG_FIRST; + /* If the first arg was a float in a floating point register, + then set bias to align this float arg properly. */ + if (cum->arg_words == 1) + bias = 1; + } + } else if (mips_abi == ABI_EABI && ! TARGET_SOFT_FLOAT) - { - if (! TARGET_64BIT) - cum->fp_arg_words += cum->fp_arg_words & 1; - cum->last_arg_fp = 1; - arg_words = &cum->fp_arg_words; - regbase = FP_ARG_FIRST; - } + { + if (! TARGET_64BIT) + cum->fp_arg_words += cum->fp_arg_words & 1; + cum->last_arg_fp = 1; + arg_words = &cum->fp_arg_words; + regbase = FP_ARG_FIRST; + } else - regbase = (TARGET_SOFT_FLOAT || ! named ? GP_ARG_FIRST : FP_ARG_FIRST); + regbase = (TARGET_SOFT_FLOAT || ! named ? GP_ARG_FIRST : FP_ARG_FIRST); break; case DFmode: if (! TARGET_64BIT) - { - if (mips_abi == ABI_EABI - && ! TARGET_SOFT_FLOAT - && ! TARGET_SINGLE_FLOAT) - cum->fp_arg_words += cum->fp_arg_words & 1; - else - cum->arg_words += cum->arg_words & 1; - } + { + if (mips_abi == ABI_EABI + && ! TARGET_SOFT_FLOAT + && ! TARGET_SINGLE_FLOAT) + cum->fp_arg_words += cum->fp_arg_words & 1; + else + cum->arg_words += cum->arg_words & 1; + } if (mips_abi == ABI_32) - regbase = ((cum->gp_reg_found - || TARGET_SOFT_FLOAT - || TARGET_SINGLE_FLOAT - || cum->arg_number >= 2) - ? GP_ARG_FIRST - : FP_ARG_FIRST); + regbase = ((cum->gp_reg_found + || TARGET_SOFT_FLOAT + || TARGET_SINGLE_FLOAT + || cum->arg_number >= 2) + ? GP_ARG_FIRST + : FP_ARG_FIRST); else if (mips_abi == ABI_EABI - && ! TARGET_SOFT_FLOAT - && ! TARGET_SINGLE_FLOAT) - { - cum->last_arg_fp = 1; - arg_words = &cum->fp_arg_words; - regbase = FP_ARG_FIRST; - } + && ! TARGET_SOFT_FLOAT + && ! TARGET_SINGLE_FLOAT) + { + cum->last_arg_fp = 1; + arg_words = &cum->fp_arg_words; + regbase = FP_ARG_FIRST; + } else - regbase = (TARGET_SOFT_FLOAT || TARGET_SINGLE_FLOAT || ! named - ? GP_ARG_FIRST : FP_ARG_FIRST); + regbase = (TARGET_SOFT_FLOAT || TARGET_SINGLE_FLOAT || ! named + ? GP_ARG_FIRST : FP_ARG_FIRST); break; default: if (GET_MODE_CLASS (mode) != MODE_COMPLEX_INT - && GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT) - abort (); + && GET_MODE_CLASS (mode) != MODE_COMPLEX_FLOAT) + abort (); /* Drops through. */ case BLKmode: if (type != (tree)0 && TYPE_ALIGN (type) > BITS_PER_WORD - && ! TARGET_64BIT && mips_abi != ABI_EABI) - cum->arg_words += (cum->arg_words & 1); + && ! TARGET_64BIT && mips_abi != ABI_EABI) + cum->arg_words += (cum->arg_words & 1); regbase = GP_ARG_FIRST; break; @@ -3175,130 +3175,130 @@ function_arg (cum, mode, type, named) case DImode: if (! TARGET_64BIT) - cum->arg_words += (cum->arg_words & 1); + cum->arg_words += (cum->arg_words & 1); regbase = GP_ARG_FIRST; } if (*arg_words >= MAX_ARGS_IN_REGISTERS) { if (TARGET_DEBUG_E_MODE) - fprintf (stderr, "%s\n", struct_p ? ", [struct]" : ""); + fprintf (stderr, "%s\n", struct_p ? ", [struct]" : ""); ret = (rtx)0; } else { if (regbase == -1) - abort (); + abort (); if (! type || TREE_CODE (type) != RECORD_TYPE || mips_abi == ABI_32 - || mips_abi == ABI_EABI || ! named) - ret = gen_rtx (REG, mode, regbase + *arg_words + bias); + || mips_abi == ABI_EABI || ! named) + ret = gen_rtx (REG, mode, regbase + *arg_words + bias); else - { - /* The Irix 6 n32/n64 ABIs say that if any 64 bit chunk of the - structure contains a double in its entirety, then that 64 bit - chunk is passed in a floating point register. */ - tree field; + { + /* The Irix 6 n32/n64 ABIs say that if any 64 bit chunk of the + structure contains a double in its entirety, then that 64 bit + chunk is passed in a floating point register. */ + tree field; - /* First check to see if there is any such field. */ - for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) - if (TREE_CODE (field) == FIELD_DECL - && TREE_CODE (TREE_TYPE (field)) == REAL_TYPE - && TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD - && (TREE_INT_CST_LOW (DECL_FIELD_BITPOS (field)) - % BITS_PER_WORD == 0)) - break; + /* First check to see if there is any such field. */ + for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field)) + if (TREE_CODE (field) == FIELD_DECL + && TREE_CODE (TREE_TYPE (field)) == REAL_TYPE + && TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD + && (TREE_INT_CST_LOW (DECL_FIELD_BITPOS (field)) + % BITS_PER_WORD == 0)) + break; - /* If the whole struct fits a DFmode register, - we don't need the PARALLEL. */ - if (! field || mode == DFmode) - ret = gen_rtx (REG, mode, regbase + *arg_words + bias); - else - { - /* Now handle the special case by returning a PARALLEL - indicating where each 64 bit chunk goes. */ - int chunks; - int bitpos; - int regno; - int i; + /* If the whole struct fits a DFmode register, + we don't need the PARALLEL. */ + if (! field || mode == DFmode) + ret = gen_rtx (REG, mode, regbase + *arg_words + bias); + else + { + /* Now handle the special case by returning a PARALLEL + indicating where each 64 bit chunk goes. */ + int chunks; + int bitpos; + int regno; + int i; - /* ??? If this is a packed structure, then the last hunk won't - be 64 bits. */ + /* ??? If this is a packed structure, then the last hunk won't + be 64 bits. */ - chunks = TREE_INT_CST_LOW (TYPE_SIZE (type)) / BITS_PER_WORD; - if (chunks + *arg_words + bias > MAX_ARGS_IN_REGISTERS) - chunks = MAX_ARGS_IN_REGISTERS - *arg_words - bias; + chunks = TREE_INT_CST_LOW (TYPE_SIZE (type)) / BITS_PER_WORD; + if (chunks + *arg_words + bias > MAX_ARGS_IN_REGISTERS) + chunks = MAX_ARGS_IN_REGISTERS - *arg_words - bias; - /* assign_parms checks the mode of ENTRY_PARM, so we must - use the actual mode here. */ - ret = gen_rtx (PARALLEL, mode, rtvec_alloc (chunks)); + /* assign_parms checks the mode of ENTRY_PARM, so we must + use the actual mode here. */ + ret = gen_rtx (PARALLEL, mode, rtvec_alloc (chunks)); - bitpos = 0; - regno = regbase + *arg_words + bias; - field = TYPE_FIELDS (type); - for (i = 0; i < chunks; i++) - { - rtx reg; + bitpos = 0; + regno = regbase + *arg_words + bias; + field = TYPE_FIELDS (type); + for (i = 0; i < chunks; i++) + { + rtx reg; - for (; field; field = TREE_CHAIN (field)) - if (TREE_CODE (field) == FIELD_DECL - && (TREE_INT_CST_LOW (DECL_FIELD_BITPOS (field)) - >= bitpos)) - break; + for (; field; field = TREE_CHAIN (field)) + if (TREE_CODE (field) == FIELD_DECL + && (TREE_INT_CST_LOW (DECL_FIELD_BITPOS (field)) + >= bitpos)) + break; - if (field - && TREE_INT_CST_LOW (DECL_FIELD_BITPOS (field)) == bitpos - && TREE_CODE (TREE_TYPE (field)) == REAL_TYPE - && TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD) - reg = gen_rtx (REG, DFmode, - regno + FP_ARG_FIRST - GP_ARG_FIRST); - else - reg = gen_rtx (REG, word_mode, regno); + if (field + && TREE_INT_CST_LOW (DECL_FIELD_BITPOS (field)) == bitpos + && TREE_CODE (TREE_TYPE (field)) == REAL_TYPE + && TYPE_PRECISION (TREE_TYPE (field)) == BITS_PER_WORD) + reg = gen_rtx (REG, DFmode, + regno + FP_ARG_FIRST - GP_ARG_FIRST); + else + reg = gen_rtx (REG, word_mode, regno); - XVECEXP (ret, 0, i) = gen_rtx (EXPR_LIST, VOIDmode, reg, - GEN_INT (bitpos / BITS_PER_UNIT)); + XVECEXP (ret, 0, i) = gen_rtx (EXPR_LIST, VOIDmode, reg, + GEN_INT (bitpos / BITS_PER_UNIT)); - bitpos += 64; - regno++; - } - } - } + bitpos += 64; + regno++; + } + } + } if (TARGET_DEBUG_E_MODE) - fprintf (stderr, "%s%s\n", reg_names[regbase + *arg_words + bias], - struct_p ? ", [struct]" : ""); + fprintf (stderr, "%s%s\n", reg_names[regbase + *arg_words + bias], + struct_p ? ", [struct]" : ""); /* The following is a hack in order to pass 1 byte structures - the same way that the MIPS compiler does (namely by passing - the structure in the high byte or half word of the register). - This also makes varargs work. If we have such a structure, - we save the adjustment RTL, and the call define expands will - emit them. For the VOIDmode argument (argument after the - last real argument), pass back a parallel vector holding each - of the adjustments. */ + the same way that the MIPS compiler does (namely by passing + the structure in the high byte or half word of the register). + This also makes varargs work. If we have such a structure, + we save the adjustment RTL, and the call define expands will + emit them. For the VOIDmode argument (argument after the + last real argument), pass back a parallel vector holding each + of the adjustments. */ /* ??? function_arg can be called more than once for each argument. - As a result, we compute more adjustments than we need here. - See the CUMULATIVE_ARGS definition in mips.h. */ + As a result, we compute more adjustments than we need here. + See the CUMULATIVE_ARGS definition in mips.h. */ /* ??? This scheme requires everything smaller than the word size to - shifted to the left, but when TARGET_64BIT and ! TARGET_INT64, - that would mean every int needs to be shifted left, which is very - inefficient. Let's not carry this compatibility to the 64 bit - calling convention for now. */ + shifted to the left, but when TARGET_64BIT and ! TARGET_INT64, + that would mean every int needs to be shifted left, which is very + inefficient. Let's not carry this compatibility to the 64 bit + calling convention for now. */ if (struct_p && int_size_in_bytes (type) < UNITS_PER_WORD - && ! TARGET_64BIT && mips_abi != ABI_EABI) - { - rtx amount = GEN_INT (BITS_PER_WORD - - int_size_in_bytes (type) * BITS_PER_UNIT); - rtx reg = gen_rtx (REG, word_mode, regbase + *arg_words + bias); - if (TARGET_64BIT) - cum->adjust[ cum->num_adjusts++ ] = gen_ashldi3 (reg, reg, amount); - else - cum->adjust[ cum->num_adjusts++ ] = gen_ashlsi3 (reg, reg, amount); - } + && ! TARGET_64BIT && mips_abi != ABI_EABI) + { + rtx amount = GEN_INT (BITS_PER_WORD + - int_size_in_bytes (type) * BITS_PER_UNIT); + rtx reg = gen_rtx (REG, word_mode, regbase + *arg_words + bias); + if (TARGET_64BIT) + cum->adjust[ cum->num_adjusts++ ] = gen_ashldi3 (reg, reg, amount); + else + cum->adjust[ cum->num_adjusts++ ] = gen_ashlsi3 (reg, reg, amount); + } } if (mode == VOIDmode && cum->num_adjusts > 0) @@ -3310,10 +3310,10 @@ function_arg (cum, mode, type, named) int function_arg_partial_nregs (cum, mode, type, named) - CUMULATIVE_ARGS *cum; /* current arg information */ - enum machine_mode mode; /* current arg mode */ - tree type; /* type of the argument or 0 if lib support */ - int named; /* != 0 for normal args, == 0 for ... args */ + CUMULATIVE_ARGS *cum; /* current arg information */ + enum machine_mode mode; /* current arg mode */ + tree type; /* type of the argument or 0 if lib support */ + int named; /* != 0 for normal args, == 0 for ... args */ { if ((mode == BLKmode || GET_MODE_CLASS (mode) != MODE_COMPLEX_INT @@ -3323,27 +3323,27 @@ function_arg_partial_nregs (cum, mode, type, named) { int words; if (mode == BLKmode) - words = ((int_size_in_bytes (type) + UNITS_PER_WORD - 1) - / UNITS_PER_WORD); + words = ((int_size_in_bytes (type) + UNITS_PER_WORD - 1) + / UNITS_PER_WORD); else - words = (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + words = (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; if (words + cum->arg_words <= MAX_ARGS_IN_REGISTERS) - return 0; /* structure fits in registers */ + return 0; /* structure fits in registers */ if (TARGET_DEBUG_E_MODE) - fprintf (stderr, "function_arg_partial_nregs = %d\n", - MAX_ARGS_IN_REGISTERS - cum->arg_words); + fprintf (stderr, "function_arg_partial_nregs = %d\n", + MAX_ARGS_IN_REGISTERS - cum->arg_words); return MAX_ARGS_IN_REGISTERS - cum->arg_words; } else if (mode == DImode && cum->arg_words == MAX_ARGS_IN_REGISTERS-1 - && ! TARGET_64BIT - && mips_abi != ABI_EABI) + && ! TARGET_64BIT + && mips_abi != ABI_EABI) { if (TARGET_DEBUG_E_MODE) - fprintf (stderr, "function_arg_partial_nregs = 1\n"); + fprintf (stderr, "function_arg_partial_nregs = 1\n"); return 1; } @@ -3381,8 +3381,8 @@ siginfo (signo) int signo; { fprintf (stderr, "compiling '%s' in '%s'\n", - (current_function_name != (char *)0) ? current_function_name : "", - (current_function_file != (char *)0) ? current_function_file : ""); + (current_function_name != (char *)0) ? current_function_name : "", + (current_function_file != (char *)0) ? current_function_file : ""); fflush (stderr); } #endif /* SIGINFO */ @@ -3419,10 +3419,10 @@ override_options () { mips_isa = atoi (mips_isa_string); if (mips_isa < 1 || mips_isa > 4) - { - error ("-mips%d not supported", mips_isa); - mips_isa = 1; - } + { + error ("-mips%d not supported", mips_isa); + mips_isa = 1; + } } else @@ -3436,12 +3436,12 @@ override_options () if (mips_abi_string == (char *) 0) mips_abi = MIPS_ABI_DEFAULT; else if (! strcmp (mips_abi_string, "32") - || ! strcmp (mips_abi_string, "o32")) + || ! strcmp (mips_abi_string, "o32")) mips_abi = ABI_32; else if (! strcmp (mips_abi_string, "n32")) mips_abi = ABI_N32; else if (! strcmp (mips_abi_string, "64") - || ! strcmp (mips_abi_string, "n64")) + || ! strcmp (mips_abi_string, "n64")) mips_abi = ABI_64; else if (! strcmp (mips_abi_string, "eabi")) mips_abi = ABI_EABI; @@ -3452,26 +3452,26 @@ override_options () if (mips_abi_string == 0 && mips_isa_string && mips_abi != ABI_EABI) { if (mips_isa <= 2) - mips_abi = ABI_32; + mips_abi = ABI_32; else - mips_abi = ABI_64; + mips_abi = ABI_64; } /* A specified ABI defaults the ISA if it was not specified. */ else if (mips_isa_string == 0 && mips_abi_string && mips_abi != ABI_EABI) { if (mips_abi == ABI_32) - mips_isa = 1; + mips_isa = 1; else if (mips_abi == ABI_N32) - mips_isa = 3; + mips_isa = 3; else - mips_isa = 4; + mips_isa = 4; } /* If both ABI and ISA were specified, check for conflicts. */ else if (mips_isa_string && mips_abi_string) { if ((mips_isa <= 2 && (mips_abi == ABI_N32 || mips_abi == ABI_64)) - || (mips_isa >= 3 && mips_abi == ABI_32)) - error ("-mabi=%s does not support -mips%d", mips_abi_string, mips_isa); + || (mips_isa >= 3 && mips_abi == ABI_32)) + error ("-mabi=%s does not support -mips%d", mips_abi_string, mips_isa); } /* Override TARGET_DEFAULT if necessary. */ @@ -3507,24 +3507,24 @@ override_options () || !strcmp (mips_cpu_string, "DEFAULT")) { switch (mips_isa) - { - default: - mips_cpu_string = "3000"; - mips_cpu = PROCESSOR_R3000; - break; - case 2: - mips_cpu_string = "6000"; - mips_cpu = PROCESSOR_R6000; - break; - case 3: - mips_cpu_string = "4000"; - mips_cpu = PROCESSOR_R4000; - break; - case 4: - mips_cpu_string = "8000"; - mips_cpu = PROCESSOR_R8000; - break; - } + { + default: + mips_cpu_string = "3000"; + mips_cpu = PROCESSOR_R3000; + break; + case 2: + mips_cpu_string = "6000"; + mips_cpu = PROCESSOR_R6000; + break; + case 3: + mips_cpu_string = "4000"; + mips_cpu = PROCESSOR_R4000; + break; + case 4: + mips_cpu_string = "8000"; + mips_cpu = PROCESSOR_R8000; + break; + } } else @@ -3533,88 +3533,88 @@ override_options () int seen_v = FALSE; /* We need to cope with the various "vr" prefixes for the NEC 4300 - and 4100 processors. */ + and 4100 processors. */ if (*p == 'v' || *p == 'V') - { - seen_v = TRUE; - p++; + { + seen_v = TRUE; + p++; } if (*p == 'r' || *p == 'R') - p++; + p++; /* Since there is no difference between a R2000 and R3000 in - terms of the scheduler, we collapse them into just an R3000. */ + terms of the scheduler, we collapse them into just an R3000. */ mips_cpu = PROCESSOR_DEFAULT; switch (*p) - { - case '2': - if (!strcmp (p, "2000") || !strcmp (p, "2k") || !strcmp (p, "2K")) - mips_cpu = PROCESSOR_R3000; - break; + { + case '2': + if (!strcmp (p, "2000") || !strcmp (p, "2k") || !strcmp (p, "2K")) + mips_cpu = PROCESSOR_R3000; + break; - case '3': - if (!strcmp (p, "3000") || !strcmp (p, "3k") || !strcmp (p, "3K")) - mips_cpu = PROCESSOR_R3000; - else if (!strcmp (p, "3900")) - mips_cpu = PROCESSOR_R3900; - break; + case '3': + if (!strcmp (p, "3000") || !strcmp (p, "3k") || !strcmp (p, "3K")) + mips_cpu = PROCESSOR_R3000; + else if (!strcmp (p, "3900")) + mips_cpu = PROCESSOR_R3900; + break; - case '4': - if (!strcmp (p, "4000") || !strcmp (p, "4k") || !strcmp (p, "4K")) - mips_cpu = PROCESSOR_R4000; + case '4': + if (!strcmp (p, "4000") || !strcmp (p, "4k") || !strcmp (p, "4K")) + mips_cpu = PROCESSOR_R4000; /* The vr4100 is a non-FP ISA III processor with some extra instructions. */ - else if (!strcmp (p, "4100")) { + else if (!strcmp (p, "4100")) { mips_cpu = PROCESSOR_R4100; target_flags |= MASK_SOFT_FLOAT ; } - /* The vr4300 is a standard ISA III processor, but with a different - pipeline. */ - else if (!strcmp (p, "4300")) + /* The vr4300 is a standard ISA III processor, but with a different + pipeline. */ + else if (!strcmp (p, "4300")) mips_cpu = PROCESSOR_R4300; - /* The r4400 is exactly the same as the r4000 from the compiler's - viewpoint. */ - else if (!strcmp (p, "4400")) - mips_cpu = PROCESSOR_R4000; - else if (!strcmp (p, "4600")) - mips_cpu = PROCESSOR_R4600; - else if (!strcmp (p, "4650")) - mips_cpu = PROCESSOR_R4650; - break; + /* The r4400 is exactly the same as the r4000 from the compiler's + viewpoint. */ + else if (!strcmp (p, "4400")) + mips_cpu = PROCESSOR_R4000; + else if (!strcmp (p, "4600")) + mips_cpu = PROCESSOR_R4600; + else if (!strcmp (p, "4650")) + mips_cpu = PROCESSOR_R4650; + break; - case '5': - if (!strcmp (p, "5000") || !strcmp (p, "5k") || !strcmp (p, "5K")) - mips_cpu = PROCESSOR_R5000; - break; + case '5': + if (!strcmp (p, "5000") || !strcmp (p, "5k") || !strcmp (p, "5K")) + mips_cpu = PROCESSOR_R5000; + break; - case '6': - if (!strcmp (p, "6000") || !strcmp (p, "6k") || !strcmp (p, "6K")) - mips_cpu = PROCESSOR_R6000; - break; + case '6': + if (!strcmp (p, "6000") || !strcmp (p, "6k") || !strcmp (p, "6K")) + mips_cpu = PROCESSOR_R6000; + break; - case '8': - if (!strcmp (p, "8000")) - mips_cpu = PROCESSOR_R8000; - break; + case '8': + if (!strcmp (p, "8000")) + mips_cpu = PROCESSOR_R8000; + break; - case 'o': - if (!strcmp (p, "orion")) - mips_cpu = PROCESSOR_R4600; - break; - } + case 'o': + if (!strcmp (p, "orion")) + mips_cpu = PROCESSOR_R4600; + break; + } if (seen_v - && mips_cpu != PROCESSOR_R4300 - && mips_cpu != PROCESSOR_R4100 - && mips_cpu != PROCESSOR_R5000) - mips_cpu = PROCESSOR_DEFAULT; + && mips_cpu != PROCESSOR_R4300 + && mips_cpu != PROCESSOR_R4100 + && mips_cpu != PROCESSOR_R5000) + mips_cpu = PROCESSOR_DEFAULT; if (mips_cpu == PROCESSOR_DEFAULT) - { - error ("bad value (%s) for -mcpu= switch", mips_cpu_string); - mips_cpu_string = "default"; - } + { + error ("bad value (%s) for -mcpu= switch", mips_cpu_string); + mips_cpu_string = "default"; + } } if ((mips_cpu == PROCESSOR_R3000 && mips_isa > 1) @@ -3622,25 +3622,25 @@ override_options () || ((mips_cpu == PROCESSOR_R4000 || mips_cpu == PROCESSOR_R4100 || mips_cpu == PROCESSOR_R4300 - || mips_cpu == PROCESSOR_R4600 - || mips_cpu == PROCESSOR_R4650) - && mips_isa > 3)) + || mips_cpu == PROCESSOR_R4600 + || mips_cpu == PROCESSOR_R4650) + && mips_isa > 3)) error ("-mcpu=%s does not support -mips%d", mips_cpu_string, mips_isa); /* make sure sizes of ints/longs/etc. are ok */ if (mips_isa < 3) { if (TARGET_INT64) - fatal ("Only MIPS-III or MIPS-IV CPUs can support 64 bit ints"); + fatal ("Only MIPS-III or MIPS-IV CPUs can support 64 bit ints"); else if (TARGET_LONG64) - fatal ("Only MIPS-III or MIPS-IV CPUs can support 64 bit longs"); + fatal ("Only MIPS-III or MIPS-IV CPUs can support 64 bit longs"); else if (TARGET_FLOAT64) - fatal ("Only MIPS-III or MIPS-IV CPUs can support 64 bit fp registers"); + fatal ("Only MIPS-III or MIPS-IV CPUs can support 64 bit fp registers"); else if (TARGET_64BIT) - fatal ("Only MIPS-III or MIPS-IV CPUs can support 64 bit gp registers"); + fatal ("Only MIPS-III or MIPS-IV CPUs can support 64 bit gp registers"); } if (mips_abi != ABI_32) @@ -3659,7 +3659,7 @@ override_options () mips_abicalls = MIPS_ABICALLS_YES; flag_pic = 1; if (mips_section_threshold > 0) - warning ("-G is incompatible with PIC code which is the default"); + warning ("-G is incompatible with PIC code which is the default"); } else mips_abicalls = MIPS_ABICALLS_NO; @@ -3675,14 +3675,14 @@ override_options () { flag_pic = 1; if (TARGET_ABICALLS) - warning ("-membedded-pic and -mabicalls are incompatible"); + warning ("-membedded-pic and -mabicalls are incompatible"); if (g_switch_set) - warning ("-G and -membedded-pic are incompatible"); + warning ("-G and -membedded-pic are incompatible"); /* Setting mips_section_threshold is not required, because gas - will force everything to be GP addressable anyhow, but - setting it will cause gcc to make better estimates of the - number of instructions required to access a particular data - item. */ + will force everything to be GP addressable anyhow, but + setting it will cause gcc to make better estimates of the + number of instructions required to access a particular data + item. */ mips_section_threshold = 0x7fffffff; } @@ -3788,46 +3788,65 @@ override_options () mode != MAX_MACHINE_MODE; mode = (enum machine_mode)((int)mode + 1)) { - register int size = GET_MODE_SIZE (mode); + register int size = GET_MODE_SIZE (mode); register enum mode_class class = GET_MODE_CLASS (mode); for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++) - { - register int temp; + { + register int temp; - if (mode == CCmode) - { - if (mips_isa < 4) - temp = (regno == FPSW_REGNUM); - else - temp = (ST_REG_P (regno) - || GP_REG_P (regno) - || FP_REG_P (regno)); - } + if (mode == CCmode) + { + if (mips_isa < 4) + temp = (regno == FPSW_REGNUM); + else + temp = (ST_REG_P (regno) + || GP_REG_P (regno) + || FP_REG_P (regno)); + } - else if (GP_REG_P (regno)) - temp = ((regno & 1) == 0 || (size <= UNITS_PER_WORD)); + else if (GP_REG_P (regno)) + temp = ((regno & 1) == 0 || (size <= UNITS_PER_WORD)); - else if (FP_REG_P (regno)) - temp = ((TARGET_FLOAT64 || ((regno & 1) == 0)) - && (class == MODE_FLOAT - || class == MODE_COMPLEX_FLOAT - || (TARGET_DEBUG_H_MODE && class == MODE_INT)) - && (! TARGET_SINGLE_FLOAT || size <= 4)); + else if (FP_REG_P (regno)) + temp = ((TARGET_FLOAT64 || ((regno & 1) == 0)) + && (class == MODE_FLOAT + || class == MODE_COMPLEX_FLOAT + || (TARGET_DEBUG_H_MODE && class == MODE_INT)) + && (! TARGET_SINGLE_FLOAT || size <= 4)); - else if (MD_REG_P (regno)) - temp = (class == MODE_INT - && (size <= UNITS_PER_WORD - || (regno == MD_REG_FIRST && size == 2 * UNITS_PER_WORD))); + else if (MD_REG_P (regno)) + temp = (class == MODE_INT + && (size <= UNITS_PER_WORD + || (regno == MD_REG_FIRST && size == 2 * UNITS_PER_WORD))); - else - temp = FALSE; + else + temp = FALSE; - mips_hard_regno_mode_ok[(int)mode][regno] = temp; - } + mips_hard_regno_mode_ok[(int)mode][regno] = temp; + } } } +/* Return nonzero if ATTR is a valid attribute for DECL. + ATTRIBUTES are any existing attributes and ARGS are the arguments + supplied with ATTR. + Supported attributes: + naked: don't output any prologue or epilogue code, the user is assumed + to do the right thing. + */ +int +mips_valid_machine_decl_attribute(tree decl, tree attributes, tree attr, tree args) +{ + if (args != NULL_TREE) + return 0; + + if (is_attribute_p("naked", attr)) + return TREE_CODE(decl) == FUNCTION_DECL; + + return 0; +} + /* * The MIPS debug format wants all automatic variables and arguments @@ -3854,8 +3873,8 @@ mips_debugger_offset (addr, offset) if (reg == stack_pointer_rtx || reg == frame_pointer_rtx) { int frame_size = (!current_frame_info.initialized) - ? compute_frame_size (get_frame_size ()) - : current_frame_info.total_size; + ? compute_frame_size (get_frame_size ()) + : current_frame_info.total_size; offset = offset - frame_size; } @@ -3894,7 +3913,7 @@ mips_debugger_offset (addr, offset) 'X' X is CONST_INT, prints 32 bits in hexadecimal format = "0x%08x", 'x' X is CONST_INT, prints 16 bits in hexadecimal format = "0x%04x", 'd' output integer constant in decimal, - 'z' if the operand is 0, use $0 instead of normal operand. + 'z' if the operand is 0, use $0 instead of normal operand. 'D' print second register of double-word register operand. 'L' print low-order register of double-word register operand. 'M' print high-order register of double-word register operand. @@ -3906,142 +3925,142 @@ mips_debugger_offset (addr, offset) 'T' print 'f' for EQ, 't' for NE 't' print 't' for EQ, 'f' for NE 'Z' print register and a comma, but print nothing for $fcc0 - '(' Turn on .set noreorder - ')' Turn on .set reorder - '[' Turn on .set noat - ']' Turn on .set at - '<' Turn on .set nomacro - '>' Turn on .set macro - '{' Turn on .set volatile (not GAS) - '}' Turn on .set novolatile (not GAS) - '&' Turn on .set noreorder if filling delay slots - '*' Turn on both .set noreorder and .set nomacro if filling delay slots - '!' Turn on .set nomacro if filling delay slots - '#' Print nop if in a .set noreorder section. - '?' Print 'l' if we are to use a branch likely instead of normal branch. - '@' Print the name of the assembler temporary register (at or $1). - '.' Print the name of the register with a hard-wired zero (zero or $0). - '^' Print the name of the pic call-through register (t9 or $25). */ + '(' Turn on .set noreorder + ')' Turn on .set reorder + '[' Turn on .set noat + ']' Turn on .set at + '<' Turn on .set nomacro + '>' Turn on .set macro + '{' Turn on .set volatile (not GAS) + '}' Turn on .set novolatile (not GAS) + '&' Turn on .set noreorder if filling delay slots + '*' Turn on both .set noreorder and .set nomacro if filling delay slots + '!' Turn on .set nomacro if filling delay slots + '#' Print nop if in a .set noreorder section. + '?' Print 'l' if we are to use a branch likely instead of normal branch. + '@' Print the name of the assembler temporary register (at or $1). + '.' Print the name of the register with a hard-wired zero (zero or $0). + '^' Print the name of the pic call-through register (t9 or $25). */ void print_operand (file, op, letter) - FILE *file; /* file to write to */ - rtx op; /* operand to print */ - int letter; /* % or 0 */ + FILE *file; /* file to write to */ + rtx op; /* operand to print */ + int letter; /* % or 0 */ { register enum rtx_code code; if (PRINT_OPERAND_PUNCT_VALID_P (letter)) { switch (letter) - { - default: - error ("PRINT_OPERAND: Unknown punctuation '%c'", letter); - break; + { + default: + error ("PRINT_OPERAND: Unknown punctuation '%c'", letter); + break; - case '?': - if (mips_branch_likely) - putc ('l', file); - break; + case '?': + if (mips_branch_likely) + putc ('l', file); + break; - case '@': - fputs (reg_names [GP_REG_FIRST + 1], file); - break; + case '@': + fputs (reg_names [GP_REG_FIRST + 1], file); + break; - case '^': - fputs (reg_names [PIC_FUNCTION_ADDR_REGNUM], file); - break; + case '^': + fputs (reg_names [PIC_FUNCTION_ADDR_REGNUM], file); + break; - case '.': - fputs (reg_names [GP_REG_FIRST + 0], file); - break; + case '.': + fputs (reg_names [GP_REG_FIRST + 0], file); + break; - case '&': - if (final_sequence != 0 && set_noreorder++ == 0) - fputs (".set\tnoreorder\n\t", file); - break; + case '&': + if (final_sequence != 0 && set_noreorder++ == 0) + fputs (".set\tnoreorder\n\t", file); + break; - case '*': - if (final_sequence != 0) - { - if (set_noreorder++ == 0) - fputs (".set\tnoreorder\n\t", file); + case '*': + if (final_sequence != 0) + { + if (set_noreorder++ == 0) + fputs (".set\tnoreorder\n\t", file); - if (set_nomacro++ == 0) - fputs (".set\tnomacro\n\t", file); - } - break; + if (set_nomacro++ == 0) + fputs (".set\tnomacro\n\t", file); + } + break; - case '!': - if (final_sequence != 0 && set_nomacro++ == 0) - fputs ("\n\t.set\tnomacro", file); - break; + case '!': + if (final_sequence != 0 && set_nomacro++ == 0) + fputs ("\n\t.set\tnomacro", file); + break; - case '#': - if (set_noreorder != 0) - fputs ("\n\tnop", file); + case '#': + if (set_noreorder != 0) + fputs ("\n\tnop", file); - else if (TARGET_STATS) - fputs ("\n\t#nop", file); + else if (TARGET_STATS) + fputs ("\n\t#nop", file); - break; + break; - case '(': - if (set_noreorder++ == 0) - fputs (".set\tnoreorder\n\t", file); - break; + case '(': + if (set_noreorder++ == 0) + fputs (".set\tnoreorder\n\t", file); + break; - case ')': - if (set_noreorder == 0) - error ("internal error: %%) found without a %%( in assembler pattern"); + case ')': + if (set_noreorder == 0) + error ("internal error: %%) found without a %%( in assembler pattern"); - else if (--set_noreorder == 0) - fputs ("\n\t.set\treorder", file); + else if (--set_noreorder == 0) + fputs ("\n\t.set\treorder", file); - break; + break; - case '[': - if (set_noat++ == 0) - fputs (".set\tnoat\n\t", file); - break; + case '[': + if (set_noat++ == 0) + fputs (".set\tnoat\n\t", file); + break; - case ']': - if (set_noat == 0) - error ("internal error: %%] found without a %%[ in assembler pattern"); + case ']': + if (set_noat == 0) + error ("internal error: %%] found without a %%[ in assembler pattern"); - else if (--set_noat == 0) - fputs ("\n\t.set\tat", file); + else if (--set_noat == 0) + fputs ("\n\t.set\tat", file); - break; + break; - case '<': - if (set_nomacro++ == 0) - fputs (".set\tnomacro\n\t", file); - break; + case '<': + if (set_nomacro++ == 0) + fputs (".set\tnomacro\n\t", file); + break; - case '>': - if (set_nomacro == 0) - error ("internal error: %%> found without a %%< in assembler pattern"); + case '>': + if (set_nomacro == 0) + error ("internal error: %%> found without a %%< in assembler pattern"); - else if (--set_nomacro == 0) - fputs ("\n\t.set\tmacro", file); + else if (--set_nomacro == 0) + fputs ("\n\t.set\tmacro", file); - break; + break; - case '{': - if (set_volatile++ == 0) - fprintf (file, "%s.set\tvolatile\n\t", (TARGET_MIPS_AS) ? "" : "#"); - break; + case '{': + if (set_volatile++ == 0) + fprintf (file, "%s.set\tvolatile\n\t", (TARGET_MIPS_AS) ? "" : "#"); + break; - case '}': - if (set_volatile == 0) - error ("internal error: %%} found without a %%{ in assembler pattern"); + case '}': + if (set_volatile == 0) + error ("internal error: %%} found without a %%{ in assembler pattern"); - else if (--set_volatile == 0) - fprintf (file, "\n\t%s.set\tnovolatile", (TARGET_MIPS_AS) ? "" : "#"); + else if (--set_volatile == 0) + fprintf (file, "\n\t%s.set\tnovolatile", (TARGET_MIPS_AS) ? "" : "#"); - break; - } + break; + } return; } @@ -4062,37 +4081,37 @@ print_operand (file, op, letter) if (letter == 'C') switch (code) { - case EQ: fputs ("eq", file); break; - case NE: fputs ("ne", file); break; - case GT: fputs ("gt", file); break; - case GE: fputs ("ge", file); break; - case LT: fputs ("lt", file); break; - case LE: fputs ("le", file); break; + case EQ: fputs ("eq", file); break; + case NE: fputs ("ne", file); break; + case GT: fputs ("gt", file); break; + case GE: fputs ("ge", file); break; + case LT: fputs ("lt", file); break; + case LE: fputs ("le", file); break; case GTU: fputs ("gtu", file); break; case GEU: fputs ("geu", file); break; case LTU: fputs ("ltu", file); break; case LEU: fputs ("leu", file); break; default: - abort_with_insn (op, "PRINT_OPERAND, invalid insn for %%C"); + abort_with_insn (op, "PRINT_OPERAND, invalid insn for %%C"); } else if (letter == 'N') switch (code) { - case EQ: fputs ("ne", file); break; - case NE: fputs ("eq", file); break; - case GT: fputs ("le", file); break; - case GE: fputs ("lt", file); break; - case LT: fputs ("ge", file); break; - case LE: fputs ("gt", file); break; + case EQ: fputs ("ne", file); break; + case NE: fputs ("eq", file); break; + case GT: fputs ("le", file); break; + case GE: fputs ("lt", file); break; + case LT: fputs ("ge", file); break; + case LE: fputs ("gt", file); break; case GTU: fputs ("leu", file); break; case GEU: fputs ("ltu", file); break; case LTU: fputs ("geu", file); break; case LEU: fputs ("gtu", file); break; default: - abort_with_insn (op, "PRINT_OPERAND, invalid insn for %%N"); + abort_with_insn (op, "PRINT_OPERAND, invalid insn for %%N"); } else if (letter == 'S') @@ -4108,12 +4127,12 @@ print_operand (file, op, letter) register int regnum; if (code != REG) - abort (); + abort (); regnum = REGNO (op); if (! ST_REG_P (regnum)) - abort (); + abort (); if (regnum != ST_REG_FIRST) - fprintf (file, "%s,", reg_names[regnum]); + fprintf (file, "%s,", reg_names[regnum]); } else if (code == REG || code == SUBREG) @@ -4121,14 +4140,14 @@ print_operand (file, op, letter) register int regnum; if (code == REG) - regnum = REGNO (op); + regnum = REGNO (op); else - regnum = true_regnum (op); + regnum = true_regnum (op); if ((letter == 'M' && ! WORDS_BIG_ENDIAN) - || (letter == 'L' && WORDS_BIG_ENDIAN) - || letter == 'D') - regnum++; + || (letter == 'L' && WORDS_BIG_ENDIAN) + || letter == 'D') + regnum++; fprintf (file, "%s", reg_names[regnum]); } @@ -4137,7 +4156,7 @@ print_operand (file, op, letter) output_address (XEXP (op, 0)); else if (code == CONST_DOUBLE - && GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT) + && GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT) { REAL_VALUE_TYPE d; char s[30]; @@ -4151,19 +4170,19 @@ print_operand (file, op, letter) fprintf (file, "0x%04x", 0xffff & (INTVAL(op))); else if ((letter == 'X') && (GET_CODE(op) == CONST_INT) - && HOST_BITS_PER_WIDE_INT == 32) + && HOST_BITS_PER_WIDE_INT == 32) fprintf (file, "0x%08x", INTVAL(op)); else if ((letter == 'X') && (GET_CODE(op) == CONST_INT) - && HOST_BITS_PER_WIDE_INT == 64) + && HOST_BITS_PER_WIDE_INT == 64) fprintf (file, "0x%016lx", INTVAL(op)); else if ((letter == 'd') && (GET_CODE(op) == CONST_INT)) fprintf (file, "%d", (INTVAL(op))); else if (letter == 'z' - && (GET_CODE (op) == CONST_INT) - && INTVAL (op) == 0) + && (GET_CODE (op) == CONST_INT) + && INTVAL (op) == 0) fputs (reg_names[GP_REG_FIRST], file); else if (letter == 'd' || letter == 'x' || letter == 'X') @@ -4204,77 +4223,77 @@ print_operand_address (file, addr) switch (GET_CODE (addr)) { default: - abort_with_insn (addr, "PRINT_OPERAND_ADDRESS, invalid insn #1"); - break; + abort_with_insn (addr, "PRINT_OPERAND_ADDRESS, invalid insn #1"); + break; case REG: - if (REGNO (addr) == ARG_POINTER_REGNUM) - abort_with_insn (addr, "Arg pointer not eliminated."); + if (REGNO (addr) == ARG_POINTER_REGNUM) + abort_with_insn (addr, "Arg pointer not eliminated."); - fprintf (file, "0(%s)", reg_names [REGNO (addr)]); - break; + fprintf (file, "0(%s)", reg_names [REGNO (addr)]); + break; case LO_SUM: - { - register rtx arg0 = XEXP (addr, 0); - register rtx arg1 = XEXP (addr, 1); + { + register rtx arg0 = XEXP (addr, 0); + register rtx arg1 = XEXP (addr, 1); - if (! mips_split_addresses) - abort_with_insn (addr, "PRINT_OPERAND_ADDRESS, Spurious LO_SUM."); + if (! mips_split_addresses) + abort_with_insn (addr, "PRINT_OPERAND_ADDRESS, Spurious LO_SUM."); - if (GET_CODE (arg0) != REG) - abort_with_insn (addr, "PRINT_OPERAND_ADDRESS, LO_SUM with #1 not REG."); + if (GET_CODE (arg0) != REG) + abort_with_insn (addr, "PRINT_OPERAND_ADDRESS, LO_SUM with #1 not REG."); - fprintf (file, "%%lo("); - print_operand_address (file, arg1); - fprintf (file, ")(%s)", reg_names [REGNO (arg0)]); - } - break; + fprintf (file, "%%lo("); + print_operand_address (file, arg1); + fprintf (file, ")(%s)", reg_names [REGNO (arg0)]); + } + break; case PLUS: - { - register rtx reg = (rtx)0; - register rtx offset = (rtx)0; - register rtx arg0 = XEXP (addr, 0); - register rtx arg1 = XEXP (addr, 1); + { + register rtx reg = (rtx)0; + register rtx offset = (rtx)0; + register rtx arg0 = XEXP (addr, 0); + register rtx arg1 = XEXP (addr, 1); - if (GET_CODE (arg0) == REG) - { - reg = arg0; - offset = arg1; - if (GET_CODE (offset) == REG) - abort_with_insn (addr, "PRINT_OPERAND_ADDRESS, 2 regs"); - } - else if (GET_CODE (arg1) == REG) - { - reg = arg1; - offset = arg0; - } - else if (CONSTANT_P (arg0) && CONSTANT_P (arg1)) - { - output_addr_const (file, addr); - break; - } - else - abort_with_insn (addr, "PRINT_OPERAND_ADDRESS, no regs"); + if (GET_CODE (arg0) == REG) + { + reg = arg0; + offset = arg1; + if (GET_CODE (offset) == REG) + abort_with_insn (addr, "PRINT_OPERAND_ADDRESS, 2 regs"); + } + else if (GET_CODE (arg1) == REG) + { + reg = arg1; + offset = arg0; + } + else if (CONSTANT_P (arg0) && CONSTANT_P (arg1)) + { + output_addr_const (file, addr); + break; + } + else + abort_with_insn (addr, "PRINT_OPERAND_ADDRESS, no regs"); - if (!CONSTANT_P (offset)) - abort_with_insn (addr, "PRINT_OPERAND_ADDRESS, invalid insn #2"); + if (!CONSTANT_P (offset)) + abort_with_insn (addr, "PRINT_OPERAND_ADDRESS, invalid insn #2"); - if (REGNO (reg) == ARG_POINTER_REGNUM) - abort_with_insn (addr, "Arg pointer not eliminated."); + if (REGNO (reg) == ARG_POINTER_REGNUM) + abort_with_insn (addr, "Arg pointer not eliminated."); - output_addr_const (file, offset); - fprintf (file, "(%s)", reg_names [REGNO (reg)]); - } - break; + output_addr_const (file, offset); + fprintf (file, "(%s)", reg_names [REGNO (reg)]); + } + break; case LABEL_REF: case SYMBOL_REF: case CONST_INT: case CONST: - output_addr_const (file, addr); - break; + output_addr_const (file, addr); + break; } } @@ -4306,8 +4325,8 @@ mips_output_external (file, decl, name) && ((TREE_CODE (decl)) != FUNCTION_DECL) && ((len = int_size_in_bytes (TREE_TYPE (decl))) > 0) && (((section_name = DECL_SECTION_NAME (decl)) == NULL) - || strcmp (TREE_STRING_POINTER (section_name), ".sbss") == 0 - || strcmp (TREE_STRING_POINTER (section_name), ".sdata") == 0)) + || strcmp (TREE_STRING_POINTER (section_name), ".sbss") == 0 + || strcmp (TREE_STRING_POINTER (section_name), ".sdata") == 0)) { p = (struct extern_list *)permalloc ((long) sizeof (struct extern_list)); p->next = extern_head; @@ -4319,10 +4338,10 @@ mips_output_external (file, decl, name) #ifdef ASM_OUTPUT_UNDEF_FUNCTION if (TREE_CODE (decl) == FUNCTION_DECL /* ??? Don't include alloca, since gcc will always expand it - inline. If we don't do this, the C++ library fails to build. */ + inline. If we don't do this, the C++ library fails to build. */ && strcmp (name, "alloca") /* ??? Don't include __builtin_next_arg, because then gcc will not - bootstrap under Irix 5.1. */ + bootstrap under Irix 5.1. */ && strcmp (name, "__builtin_next_arg")) { p = (struct extern_list *)permalloc ((long) sizeof (struct extern_list)); @@ -4376,13 +4395,13 @@ make_temp_file () { #ifdef P_tmpdir if (access (P_tmpdir, R_OK | W_OK) == 0) - base = P_tmpdir; + base = P_tmpdir; else #endif - if (access ("/usr/tmp", R_OK | W_OK) == 0) - base = "/usr/tmp/"; - else - base = "/tmp/"; + if (access ("/usr/tmp", R_OK | W_OK) == 0) + base = "/usr/tmp/"; + else + base = "/tmp/"; } len = strlen (base); @@ -4429,7 +4448,7 @@ mips_output_filename (stream, name) ASM_OUTPUT_FILENAME (stream, num_source_filenames, name); /* This tells mips-tfile that stabs will follow. */ if (!TARGET_GAS && write_symbols == DBX_DEBUG) - fprintf (stream, "\t#@stabs\n"); + fprintf (stream, "\t#@stabs\n"); } else if (write_symbols == DBX_DEBUG) @@ -4444,20 +4463,20 @@ mips_output_filename (stream, name) && strcmp (name, current_function_file) != 0) { if (inside_function && !TARGET_GAS) - { - if (!file_in_function_warning) - { - file_in_function_warning = TRUE; - ignore_line_number = TRUE; - warning ("MIPS ECOFF format does not allow changing filenames within functions with #line"); - } - } + { + if (!file_in_function_warning) + { + file_in_function_warning = TRUE; + ignore_line_number = TRUE; + warning ("MIPS ECOFF format does not allow changing filenames within functions with #line"); + } + } else - { - SET_FILE_NUMBER (); - current_function_file = name; - ASM_OUTPUT_FILENAME (stream, num_source_filenames, name); - } + { + SET_FILE_NUMBER (); + current_function_file = name; + ASM_OUTPUT_FILENAME (stream, num_source_filenames, name); + } } } @@ -4476,15 +4495,15 @@ mips_output_lineno (stream, line) { ++sym_lineno; fprintf (stream, "%sLM%d:\n\t%s %d,0,%d,%sLM%d\n", - LOCAL_LABEL_PREFIX, sym_lineno, ASM_STABN_OP, N_SLINE, line, - LOCAL_LABEL_PREFIX, sym_lineno); + LOCAL_LABEL_PREFIX, sym_lineno, ASM_STABN_OP, N_SLINE, line, + LOCAL_LABEL_PREFIX, sym_lineno); } else { fprintf (stream, "\n\t%s.loc\t%d %d\n", - (ignore_line_number) ? "#" : "", - num_source_filenames, line); + (ignore_line_number) ? "#" : "", + num_source_filenames, line); LABEL_AFTER_LOC (stream); } @@ -4522,17 +4541,17 @@ final_prescan_insn (insn, opvec, noperands) /* Do we need to emit a NOP? */ if (length == 0 - || (mips_load_reg != (rtx)0 && reg_mentioned_p (mips_load_reg, pattern)) - || (mips_load_reg2 != (rtx)0 && reg_mentioned_p (mips_load_reg2, pattern)) - || (mips_load_reg3 != (rtx)0 && reg_mentioned_p (mips_load_reg3, pattern)) - || (mips_load_reg4 != (rtx)0 && reg_mentioned_p (mips_load_reg4, pattern))) - fputs ("\t#nop\n", asm_out_file); + || (mips_load_reg != (rtx)0 && reg_mentioned_p (mips_load_reg, pattern)) + || (mips_load_reg2 != (rtx)0 && reg_mentioned_p (mips_load_reg2, pattern)) + || (mips_load_reg3 != (rtx)0 && reg_mentioned_p (mips_load_reg3, pattern)) + || (mips_load_reg4 != (rtx)0 && reg_mentioned_p (mips_load_reg4, pattern))) + fputs ("\t#nop\n", asm_out_file); else - dslots_load_filled++; + dslots_load_filled++; while (--dslots_number_nops > 0) - fputs ("\t#nop\n", asm_out_file); + fputs ("\t#nop\n", asm_out_file); mips_load_reg = (rtx)0; mips_load_reg2 = (rtx)0; @@ -4544,7 +4563,7 @@ final_prescan_insn (insn, opvec, noperands) { enum rtx_code code = GET_CODE (insn); if (code == JUMP_INSN || code == CALL_INSN) - dslots_jump_total++; + dslots_jump_total++; } } @@ -4597,8 +4616,8 @@ mips_asm_file_start (stream) if (flag_verbose_asm) fprintf (stream, "\n%s -G value = %d, Cpu = %s, ISA = %d\n", - ASM_COMMENT_START, - mips_section_threshold, mips_cpu_string, mips_isa); + ASM_COMMENT_START, + mips_section_threshold, mips_cpu_string, mips_isa); } @@ -4625,25 +4644,25 @@ mips_asm_file_end (file) fputs ("\n", file); for (p = extern_head; p != 0; p = p->next) - { - name_tree = get_identifier (p->name); + { + name_tree = get_identifier (p->name); - /* Positively ensure only one .extern for any given symbol. */ - if (! TREE_ASM_WRITTEN (name_tree)) - { - TREE_ASM_WRITTEN (name_tree) = 1; + /* Positively ensure only one .extern for any given symbol. */ + if (! TREE_ASM_WRITTEN (name_tree)) + { + TREE_ASM_WRITTEN (name_tree) = 1; #ifdef ASM_OUTPUT_UNDEF_FUNCTION - if (p->size == -1) - ASM_OUTPUT_UNDEF_FUNCTION (file, p->name); - else + if (p->size == -1) + ASM_OUTPUT_UNDEF_FUNCTION (file, p->name); + else #endif - { - fputs ("\t.extern\t", file); - assemble_name (file, p->name); - fprintf (file, ", %d\n", p->size); - } - } - } + { + fputs ("\t.extern\t", file); + assemble_name (file, p->name); + fprintf (file, ", %d\n", p->size); + } + } + } } if (TARGET_FILE_SWITCHING) @@ -4651,17 +4670,17 @@ mips_asm_file_end (file) fprintf (file, "\n\t.text\n"); rewind (asm_out_text_file); if (ferror (asm_out_text_file)) - fatal_io_error (temp_filename); + fatal_io_error (temp_filename); while ((len = fread (buffer, 1, sizeof (buffer), asm_out_text_file)) > 0) - if (fwrite (buffer, 1, len, file) != len) - pfatal_with_name (asm_file_name); + if (fwrite (buffer, 1, len, file) != len) + pfatal_with_name (asm_file_name); if (len < 0) - pfatal_with_name (temp_filename); + pfatal_with_name (temp_filename); if (fclose (asm_out_text_file) != 0) - pfatal_with_name (temp_filename); + pfatal_with_name (temp_filename); #ifdef __MSDOS__ unlink (temp_filename); @@ -4682,9 +4701,9 @@ mips_declare_object (stream, name, init_string, final_string, size) char *final_string; int size; { - fputs (init_string, stream); /* "", "\t.comm\t", or "\t.lcomm\t" */ + fputs (init_string, stream); /* "", "\t.comm\t", or "\t.lcomm\t" */ assemble_name (stream, name); - fprintf (stream, final_string, size); /* ":\n", ",%u\n", ",%u\n" */ + fprintf (stream, final_string, size); /* ":\n", ",%u\n", ",%u\n" */ if (TARGET_GP_OPT) { @@ -4707,7 +4726,7 @@ mips_output_double (stream, value) REAL_VALUE_TO_TARGET_DOUBLE (value, value_long); fprintf (stream, "\t.word\t0x%08lx\t\t# %.20g\n\t.word\t0x%08lx\n", - value_long[0], value, value_long[1]); + value_long[0], value, value_long[1]); #else fprintf (stream, "\t.double\t%.20g\n", value); #endif @@ -4738,78 +4757,78 @@ mips_output_float (stream, value) Mips stack frames look like: - Before call After call - +-----------------------+ +-----------------------+ - high | | | | - mem. | | | | - | caller's temps. | | caller's temps. | - | | | | - +-----------------------+ +-----------------------+ - | | | | - | arguments on stack. | | arguments on stack. | - | | | | - +-----------------------+ +-----------------------+ - | 4 words to save | | 4 words to save | - | arguments passed | | arguments passed | - | in registers, even | | in registers, even | - SP->| if not passed. | VFP->| if not passed. | - +-----------------------+ +-----------------------+ - | | + Before call After call + +-----------------------+ +-----------------------+ + high | | | | + mem. | | | | + | caller's temps. | | caller's temps. | + | | | | + +-----------------------+ +-----------------------+ + | | | | + | arguments on stack. | | arguments on stack. | + | | | | + +-----------------------+ +-----------------------+ + | 4 words to save | | 4 words to save | + | arguments passed | | arguments passed | + | in registers, even | | in registers, even | + SP->| if not passed. | VFP->| if not passed. | + +-----------------------+ +-----------------------+ + | | | fp register save | - | | - +-----------------------+ - | | + | | + +-----------------------+ + | | | gp register save | - | | - +-----------------------+ - | | - | local variables | - | | - +-----------------------+ - | | + | | + +-----------------------+ + | | + | local variables | + | | + +-----------------------+ + | | | alloca allocations | - | | - +-----------------------+ - | | - | GP save for V.4 abi | - | | - +-----------------------+ - | | + | | + +-----------------------+ + | | + | GP save for V.4 abi | + | | + +-----------------------+ + | | | arguments on stack | - | | - +-----------------------+ + | | + +-----------------------+ | 4 words to save | - | arguments passed | + | arguments passed | | in registers, even | low SP->| if not passed. | - memory +-----------------------+ + memory +-----------------------+ */ long compute_frame_size (size) - int size; /* # of var. bytes allocated */ + int size; /* # of var. bytes allocated */ { int regno; - long total_size; /* # bytes that the entire frame takes up */ - long var_size; /* # bytes that variables take up */ - long args_size; /* # bytes that outgoing arguments take up */ - long extra_size; /* # extra bytes */ - long gp_reg_rounded; /* # bytes needed to store gp after rounding */ - long gp_reg_size; /* # bytes needed to store gp regs */ - long fp_reg_size; /* # bytes needed to store fp regs */ - long mask; /* mask of saved gp registers */ - long fmask; /* mask of saved fp registers */ - int fp_inc; /* 1 or 2 depending on the size of fp regs */ - long fp_bits; /* bitmask to use for each fp register */ + long total_size; /* # bytes that the entire frame takes up */ + long var_size; /* # bytes that variables take up */ + long args_size; /* # bytes that outgoing arguments take up */ + long extra_size; /* # extra bytes */ + long gp_reg_rounded; /* # bytes needed to store gp after rounding */ + long gp_reg_size; /* # bytes needed to store gp regs */ + long fp_reg_size; /* # bytes needed to store fp regs */ + long mask; /* mask of saved gp registers */ + long fmask; /* mask of saved fp registers */ + int fp_inc; /* 1 or 2 depending on the size of fp regs */ + long fp_bits; /* bitmask to use for each fp register */ - gp_reg_size = 0; - fp_reg_size = 0; - mask = 0; - fmask = 0; - extra_size = MIPS_STACK_ALIGN (((TARGET_ABICALLS) ? UNITS_PER_WORD : 0)); - var_size = MIPS_STACK_ALIGN (size); - args_size = MIPS_STACK_ALIGN (current_function_outgoing_args_size); + gp_reg_size = 0; + fp_reg_size = 0; + mask = 0; + fmask = 0; + extra_size = MIPS_STACK_ALIGN (((TARGET_ABICALLS) ? UNITS_PER_WORD : 0)); + var_size = MIPS_STACK_ALIGN (size); + args_size = MIPS_STACK_ALIGN (current_function_outgoing_args_size); /* The MIPS 3.0 linker does not like functions that dynamically allocate the stack and have 0 for STACK_DYNAMIC_OFFSET, since it @@ -4825,10 +4844,10 @@ compute_frame_size (size) for (regno = GP_REG_FIRST; regno <= GP_REG_LAST; regno++) { if (MUST_SAVE_REGISTER (regno)) - { - gp_reg_size += UNITS_PER_WORD; - mask |= 1L << (regno - GP_REG_FIRST); - } + { + gp_reg_size += UNITS_PER_WORD; + mask |= 1L << (regno - GP_REG_FIRST); + } } /* Calculate space needed for fp registers. */ @@ -4846,10 +4865,10 @@ compute_frame_size (size) for (regno = FP_REG_FIRST; regno <= FP_REG_LAST; regno += fp_inc) { if (regs_ever_live[regno] && !call_used_regs[regno]) - { - fp_reg_size += fp_inc * UNITS_PER_FPREG; - fmask |= fp_bits << (regno - FP_REG_FIRST); - } + { + fp_reg_size += fp_inc * UNITS_PER_FPREG; + fmask |= fp_bits << (regno - FP_REG_FIRST); + } } gp_reg_rounded = MIPS_STACK_ALIGN (gp_reg_size); @@ -4885,16 +4904,16 @@ compute_frame_size (size) current_frame_info.extra_size = extra_size; current_frame_info.gp_reg_size = gp_reg_size; current_frame_info.fp_reg_size = fp_reg_size; - current_frame_info.mask = mask; - current_frame_info.fmask = fmask; + current_frame_info.mask = mask; + current_frame_info.fmask = fmask; current_frame_info.initialized = reload_completed; - current_frame_info.num_gp = gp_reg_size / UNITS_PER_WORD; - current_frame_info.num_fp = fp_reg_size / (fp_inc * UNITS_PER_FPREG); + current_frame_info.num_gp = gp_reg_size / UNITS_PER_WORD; + current_frame_info.num_fp = fp_reg_size / (fp_inc * UNITS_PER_FPREG); if (mask) { unsigned long offset = (args_size + extra_size + var_size - + gp_reg_size - UNITS_PER_WORD); + + gp_reg_size - UNITS_PER_WORD); current_frame_info.gp_sp_offset = offset; current_frame_info.gp_save_offset = offset - total_size; } @@ -4908,8 +4927,8 @@ compute_frame_size (size) if (fmask) { unsigned long offset = (args_size + extra_size + var_size - + gp_reg_rounded + fp_reg_size - - fp_inc * UNITS_PER_FPREG); + + gp_reg_rounded + fp_reg_size + - fp_inc * UNITS_PER_FPREG); current_frame_info.fp_sp_offset = offset; current_frame_info.fp_save_offset = offset - total_size; } @@ -4934,13 +4953,13 @@ compute_frame_size (size) static void save_restore_insns (store_p, large_reg, large_offset, file) - int store_p; /* true if this is prologue */ - rtx large_reg; /* register holding large offset constant or NULL */ - long large_offset; /* large constant offset value */ - FILE *file; /* file to write instructions to instead of making RTL */ + int store_p; /* true if this is prologue */ + rtx large_reg; /* register holding large offset constant or NULL */ + long large_offset; /* large constant offset value */ + FILE *file; /* file to write instructions to instead of making RTL */ { - long mask = current_frame_info.mask; - long fmask = current_frame_info.fmask; + long mask = current_frame_info.mask; + long fmask = current_frame_info.fmask; int regno; rtx base_reg_rtx; long base_offset; @@ -4964,137 +4983,137 @@ save_restore_insns (store_p, large_reg, large_offset, file) if (mask) { /* Pick which pointer to use as a base register. For small - frames, just use the stack pointer. Otherwise, use a - temporary register. Save 2 cycles if the save area is near - the end of a large frame, by reusing the constant created in - the prologue/epilogue to adjust the stack frame. */ + frames, just use the stack pointer. Otherwise, use a + temporary register. Save 2 cycles if the save area is near + the end of a large frame, by reusing the constant created in + the prologue/epilogue to adjust the stack frame. */ gp_offset = current_frame_info.gp_sp_offset; end_offset = gp_offset - (current_frame_info.gp_reg_size - UNITS_PER_WORD); if (gp_offset < 0 || end_offset < 0) - fatal ("gp_offset (%ld) or end_offset (%ld) is less than zero.", - gp_offset, end_offset); + fatal ("gp_offset (%ld) or end_offset (%ld) is less than zero.", + gp_offset, end_offset); else if (gp_offset < 32768) - { - base_reg_rtx = stack_pointer_rtx; - base_offset = 0; - } + { + base_reg_rtx = stack_pointer_rtx; + base_offset = 0; + } else if (large_reg != (rtx)0 - && (((unsigned long)(large_offset - gp_offset)) < 32768) - && (((unsigned long)(large_offset - end_offset)) < 32768)) - { - base_reg_rtx = gen_rtx (REG, Pmode, MIPS_TEMP2_REGNUM); - base_offset = large_offset; - if (file == (FILE *)0) - { - if (TARGET_LONG64) - insn = emit_insn (gen_adddi3 (base_reg_rtx, large_reg, stack_pointer_rtx)); - else - insn = emit_insn (gen_addsi3 (base_reg_rtx, large_reg, stack_pointer_rtx)); - if (store_p) - RTX_FRAME_RELATED_P (insn) = 1; - } - else - fprintf (file, "\t%s\t%s,%s,%s\n", - TARGET_LONG64 ? "daddu" : "addu", - reg_names[MIPS_TEMP2_REGNUM], - reg_names[REGNO (large_reg)], - reg_names[STACK_POINTER_REGNUM]); - } + && (((unsigned long)(large_offset - gp_offset)) < 32768) + && (((unsigned long)(large_offset - end_offset)) < 32768)) + { + base_reg_rtx = gen_rtx (REG, Pmode, MIPS_TEMP2_REGNUM); + base_offset = large_offset; + if (file == (FILE *)0) + { + if (TARGET_LONG64) + insn = emit_insn (gen_adddi3 (base_reg_rtx, large_reg, stack_pointer_rtx)); + else + insn = emit_insn (gen_addsi3 (base_reg_rtx, large_reg, stack_pointer_rtx)); + if (store_p) + RTX_FRAME_RELATED_P (insn) = 1; + } + else + fprintf (file, "\t%s\t%s,%s,%s\n", + TARGET_LONG64 ? "daddu" : "addu", + reg_names[MIPS_TEMP2_REGNUM], + reg_names[REGNO (large_reg)], + reg_names[STACK_POINTER_REGNUM]); + } else - { - base_reg_rtx = gen_rtx (REG, Pmode, MIPS_TEMP2_REGNUM); - base_offset = gp_offset; - if (file == (FILE *)0) - { - rtx gp_offset_rtx = GEN_INT (gp_offset); + { + base_reg_rtx = gen_rtx (REG, Pmode, MIPS_TEMP2_REGNUM); + base_offset = gp_offset; + if (file == (FILE *)0) + { + rtx gp_offset_rtx = GEN_INT (gp_offset); - /* Instruction splitting doesn't preserve the RTX_FRAME_RELATED_P - bit, so make sure that we don't emit anything that can be - split. */ - /* ??? There is no DImode ori immediate pattern, so we can only - do this for 32 bit code. */ - if (large_int (gp_offset_rtx) - && GET_MODE (base_reg_rtx) == SImode) - { - insn = emit_move_insn (base_reg_rtx, - GEN_INT (gp_offset & 0xffff0000)); - if (store_p) - RTX_FRAME_RELATED_P (insn) = 1; - insn = emit_insn (gen_iorsi3 (base_reg_rtx, base_reg_rtx, - GEN_INT (gp_offset & 0x0000ffff))); - if (store_p) - RTX_FRAME_RELATED_P (insn) = 1; - } - else - { - insn = emit_move_insn (base_reg_rtx, gp_offset_rtx); - if (store_p) - RTX_FRAME_RELATED_P (insn) = 1; - } + /* Instruction splitting doesn't preserve the RTX_FRAME_RELATED_P + bit, so make sure that we don't emit anything that can be + split. */ + /* ??? There is no DImode ori immediate pattern, so we can only + do this for 32 bit code. */ + if (large_int (gp_offset_rtx) + && GET_MODE (base_reg_rtx) == SImode) + { + insn = emit_move_insn (base_reg_rtx, + GEN_INT (gp_offset & 0xffff0000)); + if (store_p) + RTX_FRAME_RELATED_P (insn) = 1; + insn = emit_insn (gen_iorsi3 (base_reg_rtx, base_reg_rtx, + GEN_INT (gp_offset & 0x0000ffff))); + if (store_p) + RTX_FRAME_RELATED_P (insn) = 1; + } + else + { + insn = emit_move_insn (base_reg_rtx, gp_offset_rtx); + if (store_p) + RTX_FRAME_RELATED_P (insn) = 1; + } - if (TARGET_LONG64) - insn = emit_insn (gen_adddi3 (base_reg_rtx, base_reg_rtx, stack_pointer_rtx)); - else - insn = emit_insn (gen_addsi3 (base_reg_rtx, base_reg_rtx, stack_pointer_rtx)); - if (store_p) - RTX_FRAME_RELATED_P (insn) = 1; - } - else - fprintf (file, "\tli\t%s,0x%.08lx\t# %ld\n\t%s\t%s,%s,%s\n", - reg_names[MIPS_TEMP2_REGNUM], - (long)base_offset, - (long)base_offset, - TARGET_LONG64 ? "daddu" : "addu", - reg_names[MIPS_TEMP2_REGNUM], - reg_names[MIPS_TEMP2_REGNUM], - reg_names[STACK_POINTER_REGNUM]); - } + if (TARGET_LONG64) + insn = emit_insn (gen_adddi3 (base_reg_rtx, base_reg_rtx, stack_pointer_rtx)); + else + insn = emit_insn (gen_addsi3 (base_reg_rtx, base_reg_rtx, stack_pointer_rtx)); + if (store_p) + RTX_FRAME_RELATED_P (insn) = 1; + } + else + fprintf (file, "\tli\t%s,0x%.08lx\t# %ld\n\t%s\t%s,%s,%s\n", + reg_names[MIPS_TEMP2_REGNUM], + (long)base_offset, + (long)base_offset, + TARGET_LONG64 ? "daddu" : "addu", + reg_names[MIPS_TEMP2_REGNUM], + reg_names[MIPS_TEMP2_REGNUM], + reg_names[STACK_POINTER_REGNUM]); + } for (regno = GP_REG_LAST; regno >= GP_REG_FIRST; regno--) - { - if (BITSET_P (mask, regno - GP_REG_FIRST)) - { - if (file == (FILE *)0) - { - rtx reg_rtx = gen_rtx (REG, word_mode, regno); - rtx mem_rtx = gen_rtx (MEM, word_mode, - gen_rtx (PLUS, Pmode, base_reg_rtx, - GEN_INT (gp_offset - base_offset))); + { + if (BITSET_P (mask, regno - GP_REG_FIRST)) + { + if (file == (FILE *)0) + { + rtx reg_rtx = gen_rtx (REG, word_mode, regno); + rtx mem_rtx = gen_rtx (MEM, word_mode, + gen_rtx (PLUS, Pmode, base_reg_rtx, + GEN_INT (gp_offset - base_offset))); - if (store_p) - { - insn = emit_move_insn (mem_rtx, reg_rtx); - RTX_FRAME_RELATED_P (insn) = 1; - } - else if (!TARGET_ABICALLS || mips_abi != ABI_32 - || regno != (PIC_OFFSET_TABLE_REGNUM - GP_REG_FIRST)) - emit_move_insn (reg_rtx, mem_rtx); - } - else - { - if (store_p || !TARGET_ABICALLS || mips_abi != ABI_32 - || regno != (PIC_OFFSET_TABLE_REGNUM - GP_REG_FIRST)) - fprintf (file, "\t%s\t%s,%ld(%s)\n", - (TARGET_64BIT - ? (store_p) ? "sd" : "ld" - : (store_p) ? "sw" : "lw"), - reg_names[regno], - gp_offset - base_offset, - reg_names[REGNO(base_reg_rtx)]); + if (store_p) + { + insn = emit_move_insn (mem_rtx, reg_rtx); + RTX_FRAME_RELATED_P (insn) = 1; + } + else if (!TARGET_ABICALLS || mips_abi != ABI_32 + || regno != (PIC_OFFSET_TABLE_REGNUM - GP_REG_FIRST)) + emit_move_insn (reg_rtx, mem_rtx); + } + else + { + if (store_p || !TARGET_ABICALLS || mips_abi != ABI_32 + || regno != (PIC_OFFSET_TABLE_REGNUM - GP_REG_FIRST)) + fprintf (file, "\t%s\t%s,%ld(%s)\n", + (TARGET_64BIT + ? (store_p) ? "sd" : "ld" + : (store_p) ? "sw" : "lw"), + reg_names[regno], + gp_offset - base_offset, + reg_names[REGNO(base_reg_rtx)]); - } - gp_offset -= UNITS_PER_WORD; - } - } + } + gp_offset -= UNITS_PER_WORD; + } + } } else { - base_reg_rtx = (rtx)0; /* Make sure these are initialized */ + base_reg_rtx = (rtx)0; /* Make sure these are initialized */ base_offset = 0; } @@ -5109,132 +5128,144 @@ save_restore_insns (store_p, large_reg, large_offset, file) end_offset = fp_offset - (current_frame_info.fp_reg_size - fp_size); if (fp_offset < 0 || end_offset < 0) - fatal ("fp_offset (%ld) or end_offset (%ld) is less than zero.", - fp_offset, end_offset); + fatal ("fp_offset (%ld) or end_offset (%ld) is less than zero.", + fp_offset, end_offset); else if (fp_offset < 32768) - { - base_reg_rtx = stack_pointer_rtx; - base_offset = 0; - } + { + base_reg_rtx = stack_pointer_rtx; + base_offset = 0; + } else if (base_reg_rtx != (rtx)0 - && (((unsigned long)(base_offset - fp_offset)) < 32768) - && (((unsigned long)(base_offset - end_offset)) < 32768)) - { - ; /* already set up for gp registers above */ - } + && (((unsigned long)(base_offset - fp_offset)) < 32768) + && (((unsigned long)(base_offset - end_offset)) < 32768)) + { + ; /* already set up for gp registers above */ + } else if (large_reg != (rtx)0 - && (((unsigned long)(large_offset - fp_offset)) < 32768) - && (((unsigned long)(large_offset - end_offset)) < 32768)) - { - base_reg_rtx = gen_rtx (REG, Pmode, MIPS_TEMP2_REGNUM); - base_offset = large_offset; - if (file == (FILE *)0) - { - if (TARGET_LONG64) - insn = emit_insn (gen_adddi3 (base_reg_rtx, large_reg, stack_pointer_rtx)); - else - insn = emit_insn (gen_addsi3 (base_reg_rtx, large_reg, stack_pointer_rtx)); - if (store_p) - RTX_FRAME_RELATED_P (insn) = 1; - } - else - fprintf (file, "\t%s\t%s,%s,%s\n", - TARGET_LONG64 ? "daddu" : "addu", - reg_names[MIPS_TEMP2_REGNUM], - reg_names[REGNO (large_reg)], - reg_names[STACK_POINTER_REGNUM]); - } + && (((unsigned long)(large_offset - fp_offset)) < 32768) + && (((unsigned long)(large_offset - end_offset)) < 32768)) + { + base_reg_rtx = gen_rtx (REG, Pmode, MIPS_TEMP2_REGNUM); + base_offset = large_offset; + if (file == (FILE *)0) + { + if (TARGET_LONG64) + insn = emit_insn (gen_adddi3 (base_reg_rtx, large_reg, stack_pointer_rtx)); + else + insn = emit_insn (gen_addsi3 (base_reg_rtx, large_reg, stack_pointer_rtx)); + if (store_p) + RTX_FRAME_RELATED_P (insn) = 1; + } + else + fprintf (file, "\t%s\t%s,%s,%s\n", + TARGET_LONG64 ? "daddu" : "addu", + reg_names[MIPS_TEMP2_REGNUM], + reg_names[REGNO (large_reg)], + reg_names[STACK_POINTER_REGNUM]); + } else - { - base_reg_rtx = gen_rtx (REG, Pmode, MIPS_TEMP2_REGNUM); - base_offset = fp_offset; - if (file == (FILE *)0) - { - rtx fp_offset_rtx = GEN_INT (fp_offset); + { + base_reg_rtx = gen_rtx (REG, Pmode, MIPS_TEMP2_REGNUM); + base_offset = fp_offset; + if (file == (FILE *)0) + { + rtx fp_offset_rtx = GEN_INT (fp_offset); - /* Instruction splitting doesn't preserve the RTX_FRAME_RELATED_P - bit, so make sure that we don't emit anything that can be - split. */ - /* ??? There is no DImode ori immediate pattern, so we can only - do this for 32 bit code. */ - if (large_int (fp_offset_rtx) - && GET_MODE (base_reg_rtx) == SImode) - { - insn = emit_move_insn (base_reg_rtx, - GEN_INT (fp_offset & 0xffff0000)); - if (store_p) - RTX_FRAME_RELATED_P (insn) = 1; - insn = emit_insn (gen_iorsi3 (base_reg_rtx, base_reg_rtx, - GEN_INT (fp_offset & 0x0000ffff))); - if (store_p) - RTX_FRAME_RELATED_P (insn) = 1; - } - else - { - insn = emit_move_insn (base_reg_rtx, fp_offset_rtx); - if (store_p) - RTX_FRAME_RELATED_P (insn) = 1; - } + /* Instruction splitting doesn't preserve the RTX_FRAME_RELATED_P + bit, so make sure that we don't emit anything that can be + split. */ + /* ??? There is no DImode ori immediate pattern, so we can only + do this for 32 bit code. */ + if (large_int (fp_offset_rtx) + && GET_MODE (base_reg_rtx) == SImode) + { + insn = emit_move_insn (base_reg_rtx, + GEN_INT (fp_offset & 0xffff0000)); + if (store_p) + RTX_FRAME_RELATED_P (insn) = 1; + insn = emit_insn (gen_iorsi3 (base_reg_rtx, base_reg_rtx, + GEN_INT (fp_offset & 0x0000ffff))); + if (store_p) + RTX_FRAME_RELATED_P (insn) = 1; + } + else + { + insn = emit_move_insn (base_reg_rtx, fp_offset_rtx); + if (store_p) + RTX_FRAME_RELATED_P (insn) = 1; + } - if (store_p) - RTX_FRAME_RELATED_P (insn) = 1; - if (TARGET_LONG64) - insn = emit_insn (gen_adddi3 (base_reg_rtx, base_reg_rtx, stack_pointer_rtx)); - else - insn = emit_insn (gen_addsi3 (base_reg_rtx, base_reg_rtx, stack_pointer_rtx)); - if (store_p) - RTX_FRAME_RELATED_P (insn) = 1; - } - else - fprintf (file, "\tli\t%s,0x%.08lx\t# %ld\n\t%s\t%s,%s,%s\n", - reg_names[MIPS_TEMP2_REGNUM], - (long)base_offset, - (long)base_offset, - TARGET_LONG64 ? "daddu" : "addu", - reg_names[MIPS_TEMP2_REGNUM], - reg_names[MIPS_TEMP2_REGNUM], - reg_names[STACK_POINTER_REGNUM]); - } + if (store_p) + RTX_FRAME_RELATED_P (insn) = 1; + if (TARGET_LONG64) + insn = emit_insn (gen_adddi3 (base_reg_rtx, base_reg_rtx, stack_pointer_rtx)); + else + insn = emit_insn (gen_addsi3 (base_reg_rtx, base_reg_rtx, stack_pointer_rtx)); + if (store_p) + RTX_FRAME_RELATED_P (insn) = 1; + } + else + fprintf (file, "\tli\t%s,0x%.08lx\t# %ld\n\t%s\t%s,%s,%s\n", + reg_names[MIPS_TEMP2_REGNUM], + (long)base_offset, + (long)base_offset, + TARGET_LONG64 ? "daddu" : "addu", + reg_names[MIPS_TEMP2_REGNUM], + reg_names[MIPS_TEMP2_REGNUM], + reg_names[STACK_POINTER_REGNUM]); + } for (regno = FP_REG_LAST-1; regno >= FP_REG_FIRST; regno -= fp_inc) - { - if (BITSET_P (fmask, regno - FP_REG_FIRST)) - { - if (file == (FILE *)0) - { - enum machine_mode sz = - TARGET_SINGLE_FLOAT ? SFmode : DFmode; - rtx reg_rtx = gen_rtx (REG, sz, regno); - rtx mem_rtx = gen_rtx (MEM, sz, - gen_rtx (PLUS, Pmode, base_reg_rtx, - GEN_INT (fp_offset - base_offset))); + { + if (BITSET_P (fmask, regno - FP_REG_FIRST)) + { + if (file == (FILE *)0) + { + enum machine_mode sz = + TARGET_SINGLE_FLOAT ? SFmode : DFmode; + rtx reg_rtx = gen_rtx (REG, sz, regno); + rtx mem_rtx = gen_rtx (MEM, sz, + gen_rtx (PLUS, Pmode, base_reg_rtx, + GEN_INT (fp_offset - base_offset))); - if (store_p) - { - insn = emit_move_insn (mem_rtx, reg_rtx); - RTX_FRAME_RELATED_P (insn) = 1; - } - else - emit_move_insn (reg_rtx, mem_rtx); - } - else - fprintf (file, "\t%s\t%s,%ld(%s)\n", - (TARGET_SINGLE_FLOAT - ? ((store_p) ? "s.s" : "l.s") - : ((store_p) ? "s.d" : "l.d")), - reg_names[regno], - fp_offset - base_offset, - reg_names[REGNO(base_reg_rtx)]); - - - fp_offset -= fp_size; - } - } + if (store_p) + { + insn = emit_move_insn (mem_rtx, reg_rtx); + RTX_FRAME_RELATED_P (insn) = 1; + } + else + emit_move_insn (reg_rtx, mem_rtx); } + else + fprintf (file, "\t%s\t%s,%ld(%s)\n", + (TARGET_SINGLE_FLOAT + ? ((store_p) ? "s.s" : "l.s") + : ((store_p) ? "s.d" : "l.d")), + reg_names[regno], + fp_offset - base_offset, + reg_names[REGNO(base_reg_rtx)]); + + + fp_offset -= fp_size; + } + } + } +} + +static int +mips_naked_function_p(tree func) +{ + tree a; + + if (TREE_CODE(func) != FUNCTION_DECL) + abort(); + + a = lookup_attribute("naked", DECL_MACHINE_ATTRIBUTES(func)); + return a != NULL_TREE; } @@ -5277,20 +5308,20 @@ function_prologue (file, size) if (!flag_inhibit_size_directive) { fprintf (file, "\t.frame\t%s,%d,%s\t\t# vars= %d, regs= %d/%d, args= %d, extra= %d\n", - reg_names[ (frame_pointer_needed) ? FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM ], - tsize, - reg_names[31 + GP_REG_FIRST], - current_frame_info.var_size, - current_frame_info.num_gp, - current_frame_info.num_fp, - current_function_outgoing_args_size, - current_frame_info.extra_size); + reg_names[ (frame_pointer_needed) ? FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM ], + tsize, + reg_names[31 + GP_REG_FIRST], + current_frame_info.var_size, + current_frame_info.num_gp, + current_frame_info.num_fp, + current_function_outgoing_args_size, + current_frame_info.extra_size); fprintf (file, "\t.mask\t0x%08lx,%d\n\t.fmask\t0x%08lx,%d\n", - current_frame_info.mask, - current_frame_info.gp_save_offset, - current_frame_info.fmask, - current_frame_info.fp_save_offset); + current_frame_info.mask, + current_frame_info.gp_save_offset, + current_frame_info.fmask, + current_frame_info.fp_save_offset); } if (TARGET_ABICALLS && mips_abi == ABI_32) @@ -5298,17 +5329,17 @@ function_prologue (file, size) char *sp_str = reg_names[STACK_POINTER_REGNUM]; fprintf (file, "\t.set\tnoreorder\n\t.cpload\t%s\n\t.set\treorder\n", - reg_names[PIC_FUNCTION_ADDR_REGNUM]); + reg_names[PIC_FUNCTION_ADDR_REGNUM]); if (tsize > 0) - { - fprintf (file, "\t%s\t%s,%s,%d\n", - (TARGET_LONG64 ? "dsubu" : "subu"), - sp_str, sp_str, tsize); - fprintf (file, "\t.cprestore %d\n", current_frame_info.args_size); - } + { + fprintf (file, "\t%s\t%s,%s,%d\n", + (TARGET_LONG64 ? "dsubu" : "subu"), + sp_str, sp_str, tsize); + fprintf (file, "\t.cprestore %d\n", current_frame_info.args_size); + } if (dwarf2out_do_frame ()) - dwarf2out_def_cfa ("", STACK_POINTER_REGNUM, tsize); + dwarf2out_def_cfa ("", STACK_POINTER_REGNUM, tsize); } } @@ -5320,17 +5351,20 @@ mips_expand_prologue () { int regno; long tsize; - rtx tmp_rtx = (rtx)0; + rtx tmp_rtx = (rtx)0; char *arg_name = (char *)0; - tree fndecl = current_function_decl; - tree fntype = TREE_TYPE (fndecl); - tree fnargs = DECL_ARGUMENTS (fndecl); + tree fndecl = current_function_decl; + tree fntype = TREE_TYPE (fndecl); + tree fnargs = DECL_ARGUMENTS (fndecl); rtx next_arg_reg; int i; tree next_arg; tree cur_arg; CUMULATIVE_ARGS args_so_far; + if (mips_naked_function_p(current_function_decl)) + return; + /* If struct value address is treated as the first argument, make it so. */ if (aggregate_value_p (DECL_RESULT (fndecl)) && ! current_function_returns_pcc_struct @@ -5355,41 +5389,41 @@ mips_expand_prologue () rtx entry_parm; if (TREE_ADDRESSABLE (passed_type)) - { - passed_type = build_pointer_type (passed_type); - passed_mode = Pmode; - } + { + passed_type = build_pointer_type (passed_type); + passed_mode = Pmode; + } entry_parm = FUNCTION_ARG (args_so_far, passed_mode, passed_type, 1); if (entry_parm) - { - int words; + { + int words; - /* passed in a register, so will get homed automatically */ - if (GET_MODE (entry_parm) == BLKmode) - words = (int_size_in_bytes (passed_type) + 3) / 4; - else - words = (GET_MODE_SIZE (GET_MODE (entry_parm)) + 3) / 4; + /* passed in a register, so will get homed automatically */ + if (GET_MODE (entry_parm) == BLKmode) + words = (int_size_in_bytes (passed_type) + 3) / 4; + else + words = (GET_MODE_SIZE (GET_MODE (entry_parm)) + 3) / 4; - regno = REGNO (entry_parm) + words - 1; - } + regno = REGNO (entry_parm) + words - 1; + } else - { - regno = GP_ARG_LAST+1; - break; - } + { + regno = GP_ARG_LAST+1; + break; + } FUNCTION_ARG_ADVANCE (args_so_far, passed_mode, passed_type, 1); next_arg = TREE_CHAIN (cur_arg); if (next_arg == (tree)0) - { - if (DECL_NAME (cur_arg)) - arg_name = IDENTIFIER_POINTER (DECL_NAME (cur_arg)); + { + if (DECL_NAME (cur_arg)) + arg_name = IDENTIFIER_POINTER (DECL_NAME (cur_arg)); - break; - } + break; + } } /* In order to pass small structures by value in registers @@ -5406,15 +5440,15 @@ mips_expand_prologue () int num = GET_NUM_ELEM (adjust); for (i = 0; i < num; i++) - { - rtx pattern = RTVEC_ELT (adjust, i); - if (GET_CODE (pattern) != SET - || GET_CODE (SET_SRC (pattern)) != ASHIFT) - abort_with_insn (pattern, "Insn is not a shift"); + { + rtx pattern = RTVEC_ELT (adjust, i); + if (GET_CODE (pattern) != SET + || GET_CODE (SET_SRC (pattern)) != ASHIFT) + abort_with_insn (pattern, "Insn is not a shift"); - PUT_CODE (SET_SRC (pattern), ASHIFTRT); - emit_insn (pattern); - } + PUT_CODE (SET_SRC (pattern), ASHIFTRT); + emit_insn (pattern); + } } tsize = compute_frame_size (get_frame_size ()); @@ -5423,26 +5457,26 @@ mips_expand_prologue () would normally hold arguments ($4 - $7) on the stack. */ if (mips_abi == ABI_32 && ((TYPE_ARG_TYPES (fntype) != 0 - && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype))) != void_type_node)) - || (arg_name != (char *)0 - && ((arg_name[0] == '_' && strcmp (arg_name, "__builtin_va_alist") == 0) - || (arg_name[0] == 'v' && strcmp (arg_name, "va_alist") == 0))))) + && (TREE_VALUE (tree_last (TYPE_ARG_TYPES (fntype))) != void_type_node)) + || (arg_name != (char *)0 + && ((arg_name[0] == '_' && strcmp (arg_name, "__builtin_va_alist") == 0) + || (arg_name[0] == 'v' && strcmp (arg_name, "va_alist") == 0))))) { int offset = (regno - GP_ARG_FIRST) * UNITS_PER_WORD; rtx ptr = stack_pointer_rtx; /* If we are doing svr4-abi, sp has already been decremented by tsize. */ if (TARGET_ABICALLS) - offset += tsize; + offset += tsize; for (; regno <= GP_ARG_LAST; regno++) - { - if (offset != 0) - ptr = gen_rtx (PLUS, Pmode, stack_pointer_rtx, GEN_INT (offset)); - emit_move_insn (gen_rtx (MEM, word_mode, ptr), - gen_rtx (REG, word_mode, regno)); - offset += UNITS_PER_WORD; - } + { + if (offset != 0) + ptr = gen_rtx (PLUS, Pmode, stack_pointer_rtx, GEN_INT (offset)); + emit_move_insn (gen_rtx (MEM, word_mode, ptr), + gen_rtx (REG, word_mode, regno)); + offset += UNITS_PER_WORD; + } } if (tsize > 0) @@ -5451,63 +5485,63 @@ mips_expand_prologue () /* If we are doing svr4-abi, sp move is done by function_prologue. */ if (!TARGET_ABICALLS || mips_abi != ABI_32) - { - rtx insn; + { + rtx insn; - if (tsize > 32767) - { - tmp_rtx = gen_rtx (REG, Pmode, MIPS_TEMP1_REGNUM); + if (tsize > 32767) + { + tmp_rtx = gen_rtx (REG, Pmode, MIPS_TEMP1_REGNUM); - /* Instruction splitting doesn't preserve the RTX_FRAME_RELATED_P - bit, so make sure that we don't emit anything that can be - split. */ - /* ??? There is no DImode ori immediate pattern, so we can only - do this for 32 bit code. */ - if (large_int (tsize_rtx) && GET_MODE (tmp_rtx) == SImode) - { - insn = emit_move_insn (tmp_rtx, - GEN_INT (tsize & 0xffff0000)); - RTX_FRAME_RELATED_P (insn) = 1; - insn = emit_insn (gen_iorsi3 (tmp_rtx, tmp_rtx, - GEN_INT (tsize & 0x0000ffff))); - RTX_FRAME_RELATED_P (insn) = 1; - } - else - { - insn = emit_move_insn (tmp_rtx, tsize_rtx); - RTX_FRAME_RELATED_P (insn) = 1; - } + /* Instruction splitting doesn't preserve the RTX_FRAME_RELATED_P + bit, so make sure that we don't emit anything that can be + split. */ + /* ??? There is no DImode ori immediate pattern, so we can only + do this for 32 bit code. */ + if (large_int (tsize_rtx) && GET_MODE (tmp_rtx) == SImode) + { + insn = emit_move_insn (tmp_rtx, + GEN_INT (tsize & 0xffff0000)); + RTX_FRAME_RELATED_P (insn) = 1; + insn = emit_insn (gen_iorsi3 (tmp_rtx, tmp_rtx, + GEN_INT (tsize & 0x0000ffff))); + RTX_FRAME_RELATED_P (insn) = 1; + } + else + { + insn = emit_move_insn (tmp_rtx, tsize_rtx); + RTX_FRAME_RELATED_P (insn) = 1; + } - tsize_rtx = tmp_rtx; - } + tsize_rtx = tmp_rtx; + } - if (TARGET_LONG64) - insn = emit_insn (gen_subdi3 (stack_pointer_rtx, stack_pointer_rtx, - tsize_rtx)); - else - insn = emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx, - tsize_rtx)); + if (TARGET_LONG64) + insn = emit_insn (gen_subdi3 (stack_pointer_rtx, stack_pointer_rtx, + tsize_rtx)); + else + insn = emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx, + tsize_rtx)); - RTX_FRAME_RELATED_P (insn) = 1; - } + RTX_FRAME_RELATED_P (insn) = 1; + } save_restore_insns (TRUE, tmp_rtx, tsize, (FILE *)0); if (frame_pointer_needed) - { - rtx insn; + { + rtx insn; - if (TARGET_64BIT) - insn= emit_insn (gen_movdi (frame_pointer_rtx, stack_pointer_rtx)); - else - insn= emit_insn (gen_movsi (frame_pointer_rtx, stack_pointer_rtx)); + if (TARGET_64BIT) + insn= emit_insn (gen_movdi (frame_pointer_rtx, stack_pointer_rtx)); + else + insn= emit_insn (gen_movsi (frame_pointer_rtx, stack_pointer_rtx)); - RTX_FRAME_RELATED_P (insn) = 1; - } + RTX_FRAME_RELATED_P (insn) = 1; + } if (TARGET_ABICALLS && mips_abi != ABI_32) - emit_insn (gen_loadgp (XEXP (DECL_RTL (current_function_decl), 0), - gen_rtx (REG, DImode, 25))); + emit_insn (gen_loadgp (XEXP (DECL_RTL (current_function_decl), 0), + gen_rtx (REG, DImode, 25))); } /* If we are profiling, make sure no instructions are scheduled before @@ -5520,7 +5554,7 @@ mips_expand_prologue () /* Do any necessary cleanup after a function to restore stack, frame, and regs. */ -#define RA_MASK ((long) 0x80000000) /* 1 << 31 */ +#define RA_MASK ((long) 0x80000000) /* 1 << 31 */ #define PIC_OFFSET_TABLE_MASK (1 << (PIC_OFFSET_TABLE_REGNUM - GP_REG_FIRST)) void @@ -5544,6 +5578,8 @@ function_epilogue (file, size) } #endif + if(!mips_naked_function_p(current_function_decl)) + { if (TARGET_STATS) { int num_gp_regs = current_frame_info.gp_reg_size / 4; @@ -5552,38 +5588,39 @@ function_epilogue (file, size) char *name = fnname; if (name[0] == '*') - name++; + name++; dslots_load_total += num_regs; fprintf (stderr, - "%-20s fp=%c leaf=%c alloca=%c setjmp=%c stack=%4ld arg=%3ld reg=%2d/%d delay=%3d/%3dL %3d/%3dJ refs=%3d/%3d/%3d", - name, - (frame_pointer_needed) ? 'y' : 'n', - ((current_frame_info.mask & RA_MASK) != 0) ? 'n' : 'y', - (current_function_calls_alloca) ? 'y' : 'n', - (current_function_calls_setjmp) ? 'y' : 'n', - (long)current_frame_info.total_size, - (long)current_function_outgoing_args_size, - num_gp_regs, num_fp_regs, - dslots_load_total, dslots_load_filled, - dslots_jump_total, dslots_jump_filled, - num_refs[0], num_refs[1], num_refs[2]); + "%-20s fp=%c leaf=%c alloca=%c setjmp=%c stack=%4ld arg=%3ld reg=%2d/%d delay=%3d/%3dL %3d/%3dJ refs=%3d/%3d/%3d", + name, + (frame_pointer_needed) ? 'y' : 'n', + ((current_frame_info.mask & RA_MASK) != 0) ? 'n' : 'y', + (current_function_calls_alloca) ? 'y' : 'n', + (current_function_calls_setjmp) ? 'y' : 'n', + (long)current_frame_info.total_size, + (long)current_function_outgoing_args_size, + num_gp_regs, num_fp_regs, + dslots_load_total, dslots_load_filled, + dslots_jump_total, dslots_jump_filled, + num_refs[0], num_refs[1], num_refs[2]); if (HALF_PIC_NUMBER_PTRS > prev_half_pic_ptrs) - { - fprintf (stderr, " half-pic=%3d", HALF_PIC_NUMBER_PTRS - prev_half_pic_ptrs); - prev_half_pic_ptrs = HALF_PIC_NUMBER_PTRS; - } + { + fprintf (stderr, " half-pic=%3d", HALF_PIC_NUMBER_PTRS - prev_half_pic_ptrs); + prev_half_pic_ptrs = HALF_PIC_NUMBER_PTRS; + } if (HALF_PIC_NUMBER_REFS > prev_half_pic_refs) - { - fprintf (stderr, " pic-ref=%3d", HALF_PIC_NUMBER_REFS - prev_half_pic_refs); - prev_half_pic_refs = HALF_PIC_NUMBER_REFS; - } + { + fprintf (stderr, " pic-ref=%3d", HALF_PIC_NUMBER_REFS - prev_half_pic_refs); + prev_half_pic_refs = HALF_PIC_NUMBER_REFS; + } fputc ('\n', stderr); } + } /* Reset state info for each function. */ inside_function = FALSE; @@ -5592,9 +5629,9 @@ function_epilogue (file, size) dslots_jump_total = 0; dslots_load_filled = 0; dslots_jump_filled = 0; - num_refs[0] = 0; - num_refs[1] = 0; - num_refs[2] = 0; + num_refs[0] = 0; + num_refs[1] = 0; + num_refs[2] = 0; mips_load_reg = (rtx)0; mips_load_reg2 = (rtx)0; current_frame_info = zero_frame_info; @@ -5618,45 +5655,48 @@ mips_expand_epilogue () rtx tmp_rtx = (rtx)0; if (mips_can_use_return_insn ()) - { - emit_insn (gen_return ()); - return; - } + { + emit_insn (gen_return ()); + return; + } + + if(mips_naked_function_p(current_function_decl)) + return; if (tsize > 32767) - { - tmp_rtx = gen_rtx (REG, Pmode, MIPS_TEMP1_REGNUM); - emit_move_insn (tmp_rtx, tsize_rtx); - tsize_rtx = tmp_rtx; - } + { + tmp_rtx = gen_rtx (REG, Pmode, MIPS_TEMP1_REGNUM); + emit_move_insn (tmp_rtx, tsize_rtx); + tsize_rtx = tmp_rtx; + } if (tsize > 0) + { + if (frame_pointer_needed) { - if (frame_pointer_needed) - { - emit_insn (gen_blockage ()); - if (TARGET_LONG64) - emit_insn (gen_movdi (stack_pointer_rtx, frame_pointer_rtx)); - else - emit_insn (gen_movsi (stack_pointer_rtx, frame_pointer_rtx)); - } + emit_insn (gen_blockage ()); + if (TARGET_LONG64) + emit_insn (gen_movdi (stack_pointer_rtx, frame_pointer_rtx)); + else + emit_insn (gen_movsi (stack_pointer_rtx, frame_pointer_rtx)); + } /* The GP/PIC register is implicitly used by all SYMBOL_REFs, so if we - are going to restore it, then we must emit a blockage insn to - prevent the scheduler from moving the restore out of the epilogue. */ + are going to restore it, then we must emit a blockage insn to + prevent the scheduler from moving the restore out of the epilogue. */ else if (TARGET_ABICALLS && mips_abi != ABI_32 - && (current_frame_info.mask - & (1L << (PIC_OFFSET_TABLE_REGNUM - GP_REG_FIRST)))) - emit_insn (gen_blockage ()); + && (current_frame_info.mask + & (1L << (PIC_OFFSET_TABLE_REGNUM - GP_REG_FIRST)))) + emit_insn (gen_blockage ()); save_restore_insns (FALSE, tmp_rtx, tsize, (FILE *)0); emit_insn (gen_blockage ()); if (TARGET_LONG64) - emit_insn (gen_adddi3 (stack_pointer_rtx, stack_pointer_rtx, - tsize_rtx)); + emit_insn (gen_adddi3 (stack_pointer_rtx, stack_pointer_rtx, + tsize_rtx)); else - emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, - tsize_rtx)); + emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, + tsize_rtx)); } emit_jump_insn (gen_return_internal ()); @@ -5670,6 +5710,9 @@ mips_expand_epilogue () int mips_can_use_return_insn () { + if (mips_naked_function_p(current_function_decl)) + return FALSE; + if (!reload_completed) return 0; @@ -5681,6 +5724,7 @@ mips_can_use_return_insn () return (compute_frame_size (get_frame_size ())) == 0; } + /* Choose the section to use for the constant rtx expression X that has mode MODE. */ @@ -5692,19 +5736,19 @@ mips_select_rtx_section (mode, x) if (TARGET_EMBEDDED_DATA) { /* For embedded applications, always put constants in read-only data, - in order to reduce RAM usage. */ + in order to reduce RAM usage. */ READONLY_DATA_SECTION (); } else { /* For hosted applications, always put constants in small data if - possible, as this gives the best performance. */ + possible, as this gives the best performance. */ if (GET_MODE_SIZE (mode) <= mips_section_threshold - && mips_section_threshold > 0) - SMALL_DATA_SECTION (); + && mips_section_threshold > 0) + SMALL_DATA_SECTION (); else - READONLY_DATA_SECTION (); + READONLY_DATA_SECTION (); } } @@ -5722,52 +5766,52 @@ mips_select_section (decl, reloc) && !flag_writable_strings) { /* For embedded position independent code, put constant strings - in the text section, because the data section is limited to - 64K in size. */ + in the text section, because the data section is limited to + 64K in size. */ text_section (); } else if (TARGET_EMBEDDED_DATA) { /* For embedded applications, always put an object in read-only data - if possible, in order to reduce RAM usage. */ + if possible, in order to reduce RAM usage. */ if (((TREE_CODE (decl) == VAR_DECL - && TREE_READONLY (decl) && !TREE_SIDE_EFFECTS (decl) - && DECL_INITIAL (decl) - && (DECL_INITIAL (decl) == error_mark_node - || TREE_CONSTANT (DECL_INITIAL (decl)))) - /* Deal with calls from output_constant_def_contents. */ - || (TREE_CODE (decl) != VAR_DECL - && (TREE_CODE (decl) != STRING_CST - || !flag_writable_strings))) - && ! (flag_pic && reloc)) - READONLY_DATA_SECTION (); + && TREE_READONLY (decl) && !TREE_SIDE_EFFECTS (decl) + && DECL_INITIAL (decl) + && (DECL_INITIAL (decl) == error_mark_node + || TREE_CONSTANT (DECL_INITIAL (decl)))) + /* Deal with calls from output_constant_def_contents. */ + || (TREE_CODE (decl) != VAR_DECL + && (TREE_CODE (decl) != STRING_CST + || !flag_writable_strings))) + && ! (flag_pic && reloc)) + READONLY_DATA_SECTION (); else if (size > 0 && size <= mips_section_threshold) - SMALL_DATA_SECTION (); + SMALL_DATA_SECTION (); else - data_section (); + data_section (); } else { /* For hosted applications, always put an object in small data if - possible, as this gives the best performance. */ + possible, as this gives the best performance. */ if (size > 0 && size <= mips_section_threshold) - SMALL_DATA_SECTION (); + SMALL_DATA_SECTION (); else if (((TREE_CODE (decl) == VAR_DECL - && TREE_READONLY (decl) && !TREE_SIDE_EFFECTS (decl) - && DECL_INITIAL (decl) - && (DECL_INITIAL (decl) == error_mark_node - || TREE_CONSTANT (DECL_INITIAL (decl)))) - /* Deal with calls from output_constant_def_contents. */ - || (TREE_CODE (decl) != VAR_DECL - && (TREE_CODE (decl) != STRING_CST - || !flag_writable_strings))) - && ! (flag_pic && reloc)) - READONLY_DATA_SECTION (); + && TREE_READONLY (decl) && !TREE_SIDE_EFFECTS (decl) + && DECL_INITIAL (decl) + && (DECL_INITIAL (decl) == error_mark_node + || TREE_CONSTANT (DECL_INITIAL (decl)))) + /* Deal with calls from output_constant_def_contents. */ + || (TREE_CODE (decl) != VAR_DECL + && (TREE_CODE (decl) != STRING_CST + || !flag_writable_strings))) + && ! (flag_pic && reloc)) + READONLY_DATA_SECTION (); else - data_section (); + data_section (); } } @@ -5790,69 +5834,69 @@ mips_function_value (valtype, func) if (mclass == MODE_FLOAT || mclass == MODE_COMPLEX_FLOAT) { if (TARGET_SINGLE_FLOAT - && (mclass == MODE_FLOAT - ? GET_MODE_SIZE (mode) > 4 - : GET_MODE_SIZE (mode) / 2 > 4)) - reg = GP_RETURN; + && (mclass == MODE_FLOAT + ? GET_MODE_SIZE (mode) > 4 + : GET_MODE_SIZE (mode) / 2 > 4)) + reg = GP_RETURN; else - reg = FP_RETURN; + reg = FP_RETURN; } else if (TREE_CODE (valtype) == RECORD_TYPE - && mips_abi != ABI_32 && mips_abi != ABI_EABI) + && mips_abi != ABI_32 && mips_abi != ABI_EABI) { /* A struct with only one or two floating point fields is returned in - the floating point registers. */ + the floating point registers. */ tree field, fields[2]; int i; for (i = 0, field = TYPE_FIELDS (valtype); field; - field = TREE_CHAIN (field)) - { - if (TREE_CODE (field) != FIELD_DECL) - continue; - if (TREE_CODE (TREE_TYPE (field)) != REAL_TYPE || i >= 2) - break; + field = TREE_CHAIN (field)) + { + if (TREE_CODE (field) != FIELD_DECL) + continue; + if (TREE_CODE (TREE_TYPE (field)) != REAL_TYPE || i >= 2) + break; - fields[i++] = field; - } - + fields[i++] = field; + } + /* Must check i, so that we reject structures with no elements. */ if (! field) - { - if (i == 1) - { - /* The structure has DImode, but we don't allow DImode values - in FP registers, so we use a PARALLEL even though it isn't - strictly necessary. */ - enum machine_mode field_mode = TYPE_MODE (TREE_TYPE (fields[0])); + { + if (i == 1) + { + /* The structure has DImode, but we don't allow DImode values + in FP registers, so we use a PARALLEL even though it isn't + strictly necessary. */ + enum machine_mode field_mode = TYPE_MODE (TREE_TYPE (fields[0])); - return gen_rtx (PARALLEL, mode, - gen_rtvec (1, - gen_rtx (EXPR_LIST, VOIDmode, - gen_rtx (REG, field_mode, FP_RETURN), - const0_rtx))); - } - else if (i == 2) - { - enum machine_mode first_mode - = TYPE_MODE (TREE_TYPE (fields[0])); - enum machine_mode second_mode - = TYPE_MODE (TREE_TYPE (fields[1])); - int first_offset - = TREE_INT_CST_LOW (DECL_FIELD_BITPOS (fields[0])); - int second_offset - = TREE_INT_CST_LOW (DECL_FIELD_BITPOS (fields[1])); + return gen_rtx (PARALLEL, mode, + gen_rtvec (1, + gen_rtx (EXPR_LIST, VOIDmode, + gen_rtx (REG, field_mode, FP_RETURN), + const0_rtx))); + } + else if (i == 2) + { + enum machine_mode first_mode + = TYPE_MODE (TREE_TYPE (fields[0])); + enum machine_mode second_mode + = TYPE_MODE (TREE_TYPE (fields[1])); + int first_offset + = TREE_INT_CST_LOW (DECL_FIELD_BITPOS (fields[0])); + int second_offset + = TREE_INT_CST_LOW (DECL_FIELD_BITPOS (fields[1])); - return gen_rtx (PARALLEL, mode, - gen_rtvec (2, - gen_rtx (EXPR_LIST, VOIDmode, - gen_rtx (REG, first_mode, FP_RETURN), - GEN_INT (first_offset / BITS_PER_UNIT)), - gen_rtx (EXPR_LIST, VOIDmode, - gen_rtx (REG, second_mode, FP_RETURN + 2), - GEN_INT (second_offset / BITS_PER_UNIT)))); - } - } + return gen_rtx (PARALLEL, mode, + gen_rtvec (2, + gen_rtx (EXPR_LIST, VOIDmode, + gen_rtx (REG, first_mode, FP_RETURN), + GEN_INT (first_offset / BITS_PER_UNIT)), + gen_rtx (EXPR_LIST, VOIDmode, + gen_rtx (REG, second_mode, FP_RETURN + 2), + GEN_INT (second_offset / BITS_PER_UNIT)))); + } + } } return gen_rtx (REG, mode, reg); @@ -5905,19 +5949,19 @@ mips_secondary_reload_class (class, mode, x, in_p) x = XEXP (x, 0); /* We may be called with reg_renumber NULL from regclass. - ??? This is probably a bug. */ + ??? This is probably a bug. */ if (reg_renumber) - regno = true_regnum (x); + regno = true_regnum (x); else - { - while (GET_CODE (x) == SUBREG) - { - off += SUBREG_WORD (x); - x = SUBREG_REG (x); - } - if (GET_CODE (x) == REG) - regno = REGNO (x) + off; - } + { + while (GET_CODE (x) == SUBREG) + { + off += SUBREG_WORD (x); + x = SUBREG_REG (x); + } + if (GET_CODE (x) == REG) + regno = REGNO (x) + off; + } } else if (GET_CODE (x) == REG || GET_CODE (x) == SUBREG) regno = true_regnum (x); @@ -5928,17 +5972,17 @@ mips_secondary_reload_class (class, mode, x, in_p) if (class == HILO_REG && regno != GP_REG_FIRST + 0) { if (! in_p - && GP_REG_P (regno) - && GET_MODE_SIZE (mode) <= GET_MODE_SIZE (SImode)) - return NO_REGS; + && GP_REG_P (regno) + && GET_MODE_SIZE (mode) <= GET_MODE_SIZE (SImode)) + return NO_REGS; return GR_REGS; } if (regno == HILO_REGNUM) { if (in_p - && class == GR_REGS - && GET_MODE_SIZE (mode) <= GET_MODE_SIZE (SImode)) - return NO_REGS; + && class == GR_REGS + && GET_MODE_SIZE (mode) <= GET_MODE_SIZE (SImode)) + return NO_REGS; return GR_REGS; } @@ -5947,13 +5991,13 @@ mips_secondary_reload_class (class, mode, x, in_p) if (class == HI_REG || class == LO_REG || class == MD_REGS) { if (GP_REG_P (regno)) - return NO_REGS; + return NO_REGS; return GR_REGS; } if (MD_REG_P (regno)) { if (class == GR_REGS) - return NO_REGS; + return NO_REGS; return GR_REGS; } @@ -5964,17 +6008,17 @@ mips_secondary_reload_class (class, mode, x, in_p) if (class == ST_REGS) { if (in_p) - return FP_REGS; + return FP_REGS; if (GP_REG_P (regno)) - return NO_REGS; + return NO_REGS; return GR_REGS; } if (ST_REG_P (regno)) { if (! in_p) - return FP_REGS; + return FP_REGS; if (class == GR_REGS) - return NO_REGS; + return NO_REGS; return GR_REGS; } diff --git a/config/mips/mips.h b/config/mips/mips.h index 557fb09..e1def4f 100644 --- a/config/mips/mips.h +++ b/config/mips/mips.h @@ -3514,6 +3514,12 @@ while (0) See mips.c for the MIPS specific codes. */ +/* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS + is a valid machine specific attribute for DECL. + The attributes in ATTRIBUTES have previously been assigned to DECL. */ +#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \ + mips_valid_machine_decl_attribute(DECL, ATTRIBUTES, IDENTIFIER, ARGS) + #define PRINT_OPERAND(FILE, X, CODE) print_operand (FILE, X, CODE) /* A C expression which evaluates to true if CODE is a valid diff --git a/config/mips/nu64.h b/config/mips/nu64.h new file mode 100644 index 0000000..2d0823b --- /dev/null +++ b/config/mips/nu64.h @@ -0,0 +1,132 @@ +/* Definitions of target machine for GNU compiler. MIPS GNU Hurd version. + Copyright (C) 1995, 1996 Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +#include +#include + +#define MIPS_ISA_DEFAULT 3 +#define MIPS_CPU_STRING_DEFAULT "4300" +#undef TARGET_DEFAULT +#define TARGET_DEFAULT ( MASK_GAS | MASK_4300_MUL_FIX ) + +#undef CPP_PREDEFINES +#define CPP_PREDEFINES GNU_CPP_PREDEFINES("mips") \ +" -DMIPSEB -DR4000 -DR4300 -D_MIPSEB -D_R4000 -D_R4300 \ +-D_MIPS_SZINT=32 -D_MIPS_SZLONG=32 -D_MIPS_SZPTR=32" + +#undef LOCAL_LABEL_PREFIX +#define LOCAL_LABEL_PREFIX "." + +/* Enable debugging. */ + +#undef ASM_FILE_END +#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END + +#undef PREFERRED_DEBUGGING_TYPE +#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG + +#undef DWARF_DEBUGGING_INFO +#define DBX_DEBUGGING_INFO +#if 0 +#define SDB_DEBUGGING_INFO +#define MIPS_DEBUGGING_INFO +/* GNU as does handle DWARF2 directives. */ +#undef DWARF2_UNWIND_INFO +#define DWARF2_UNWIND_INFO 1 + +#undef ASM_OUTPUT_SOURCE_LINE +#define ASM_OUTPUT_SOURCE_LINE(STREAM, LINE) \ + mips_output_lineno (STREAM, LINE) +#endif + +#undef EXTRA_SECTIONS +#define EXTRA_SECTIONS in_const, in_ctors, in_dtors, in_sdata + +#undef EXTRA_SECTION_FUNCTIONS +#define EXTRA_SECTION_FUNCTIONS \ + CONST_SECTION_FUNCTION \ + CTORS_SECTION_FUNCTION \ + DTORS_SECTION_FUNCTION \ + SDATA_SECTION_FUNCTION + +#define SDATA_SECTION_FUNCTION \ +void \ +sdata_section () \ +{ \ + if (in_section != in_sdata) \ + { \ + fprintf (asm_out_file, "%s\n", SDATA_SECTION_ASM_OP); \ + in_section = in_sdata; \ + } \ +} + +/* ASM_SPEC is the set of arguments to pass to the assembler. */ +#undef ASM_SPEC +#define ASM_SPEC "\ +%{G*} %{EB} %{EL} %{mips1} %{mips2} %{mips3} %{mips4} \ +%(subtarget_asm_optimizing_spec) \ +%(subtarget_asm_debugging_spec) \ +%{membedded-pic} \ +%{mabi=32:-32}%{mabi=o32:-32}%{mabi=n32:-n32}%{mabi=64:-64}%{mabi=n64:-64} \ +%(target_asm_spec) \ +%(subtarget_asm_spec)" + +#undef LINK_SPEC +#define LINK_SPEC "" + +#undef CC1_SPEC +#define CC1_SPEC "\ +%{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1}}}}} \ +%{mips1:-mfp32 -mgp32} %{mips2:-mfp32 -mgp32} %{mips3:-mfp32 -mgp32} \ +%{mips4:%{!msingle-float:%{!m4650:-mfp64}} -mgp64} \ +%{mfp64:%{msingle-float:%emay not use both -mfp64 and -msingle-float}} \ +%{mfp64:%{m4650:%emay not use both -mfp64 and -m4650}} \ +%{m4650:-mcpu=r4650} \ +%{m3900:-mips1 -mcpu=r3900 -mfp32 -mgp32} \ +%{G*} %{EB:-meb} %{EL:-mel} %{EB:%{EL:%emay not use both -EB and -EL}} \ +%{pic-none: -mno-half-pic} \ +%{pic-lib: -mhalf-pic} \ +%{pic-extern: -mhalf-pic} \ +%{pic-calls: -mhalf-pic} \ +%{save-temps: } \ +%(subtarget_cc1_spec) " + +#undef CPP_SPEC +#define CPP_SPEC "\ +%{.cc: -D__LANGUAGE_C_PLUS_PLUS -D_LANGUAGE_C_PLUS_PLUS} \ +%{.cxx: -D__LANGUAGE_C_PLUS_PLUS -D_LANGUAGE_C_PLUS_PLUS} \ +%{.C: -D__LANGUAGE_C_PLUS_PLUS -D_LANGUAGE_C_PLUS_PLUS} \ +%{.m: -D__LANGUAGE_OBJECTIVE_C -D_LANGUAGE_OBJECTIVE_C -D__LANGUAGE_C -D_LANGUAGE_C} \ +%{.S: -D__LANGUAGE_ASSEMBLY -D_LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \ +%{.s: -D__LANGUAGE_ASSEMBLY -D_LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \ +%{!.S: %{!.s: %{!.cc: %{!.cxx: %{!.C: %{!.m: -D__LANGUAGE_C -D_LANGUAGE_C %{!ansi:-DLANGUAGE_C}}}}}}} \ +%(subtarget_cpp_size_spec) \ +%{mips3:-U__mips -D__mips=3} \ +%{mips4:-U__mips -D__mips=4 -D__mips64} \ +%{mgp32:-U__mips64} %{mgp64:-D__mips64} \ +%{msingle-float:%{!msoft-float:-D__mips_single_float}} \ +%{m4650:%{!msoft-float:-D__mips_single_float}} \ +%{msoft-float:-D__mips_soft_float} \ +%{mabi=eabi:-D__mips_eabi} \ +%{EB:-UMIPSEL -U_MIPSEL -U__MIPSEL -U__MIPSEL__ -D_MIPSEB -D__MIPSEB -D__MIPSEB__ %{!ansi:-DMIPSEB}} \ +%{EL:-UMIPSEB -U_MIPSEB -U__MIPSEB -U__MIPSEB__ -D_MIPSEL -D__MIPSEL -D__MIPSEL__ %{!ansi:-DMIPSEL}} \ +%(long_max_spec) \ +%(subtarget_cpp_spec) " + diff --git a/configure b/configure index dfece4c..134cc05 100644 --- a/configure +++ b/configure @@ -67,6 +67,7 @@ mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= +DEFS= # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 @@ -4483,6 +4484,16 @@ for machine in $build $host $target; do ;; mips-*-gnu*) ;; + mips-nintendo-nu64) # Nintendo NU64 + xm_file=mips/xm-sysv.h + tm_file=mips/nu64.h + elf=yes + gnu_ld=yes + gas=yes + xmake_file=mips/x-sysv + tmake_file=mips/t-mips-gas + DEFS=-DNU64 + ;; mipsel-*-ecoff*) tm_file=mips/ecoffl.h if [ x$stabs = xyes ]; then @@ -5810,7 +5821,7 @@ fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 -DEFS=-DHAVE_CONFIG_H +DEFS="-DHAVE_CONFIG_H $DEFS" # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} diff --git a/cp/tree.c b/cp/tree.c index 98b1a6d..5e89f9c 100644 --- a/cp/tree.c +++ b/cp/tree.c @@ -29,7 +29,7 @@ Boston, MA 02111-1307, USA. */ #ifdef __STDC__ #include #else -#include +#include #endif #ifdef HAVE_STDLIB_H diff --git a/emit-rtl.c b/emit-rtl.c index d9a78d7..18da1f0 100644 --- a/emit-rtl.c +++ b/emit-rtl.c @@ -39,7 +39,7 @@ Boston, MA 02111-1307, USA. */ #ifdef __STDC__ #include #else -#include +#include #endif #include "rtl.h" #include "tree.h" diff --git a/final.c b/final.c index 05edac0..c946e98 100644 --- a/final.c +++ b/final.c @@ -48,7 +48,7 @@ Boston, MA 02111-1307, USA. */ #ifdef __STDC__ #include #else -#include +#include #endif #include #include diff --git a/fixinc.svr4 b/fixinc.svr4 index 46e07ce..0b7f145 100644 --- a/fixinc.svr4 +++ b/fixinc.svr4 @@ -1416,7 +1416,7 @@ if [ -r ${INPUT}/$file ]; then #ifdef __STDC__ #include #else -#include +#include #endif #endif /* _SYS_VARARGS_H */ diff --git a/gcc.c b/gcc.c index c548d7f..849f67f 100644 --- a/gcc.c +++ b/gcc.c @@ -49,7 +49,7 @@ compilation is specified by a string called a "spec". */ #ifdef __STDC__ #include #else -#include +#include #endif #include diff --git a/genattrtab.c b/genattrtab.c index c29f370..739f9b4 100644 --- a/genattrtab.c +++ b/genattrtab.c @@ -100,7 +100,7 @@ Boston, MA 02111-1307, USA. */ #ifdef __STDC__ #include #else -#include +#include #endif #include #include "rtl.h" diff --git a/mips-tfile.c b/mips-tfile.c index 9f12c38..b4625a3 100644 --- a/mips-tfile.c +++ b/mips-tfile.c @@ -603,7 +603,7 @@ Boston, MA 02111-1307, USA. */ #ifdef __STDC__ #include #else -#include +#include #endif #include diff --git a/obstack.h b/obstack.h index c056f11..808b4d7 100644 --- a/obstack.h +++ b/obstack.h @@ -418,7 +418,8 @@ __extension__ \ ({ struct obstack *__o = (OBSTACK); \ if (__o->next_free + sizeof (void *) > __o->chunk_limit) \ _obstack_newchunk (__o, sizeof (void *)); \ - *((void **)__o->next_free)++ = ((void *)datum); \ + *((void **)__o->next_free) = ((void *)datum); \ + __o->next_free += sizeof (void *); \ (void) 0; }) # define obstack_int_grow(OBSTACK,datum) \ diff --git a/prefix.c b/prefix.c index aa6cf51..6f8cd45 100644 --- a/prefix.c +++ b/prefix.c @@ -68,7 +68,7 @@ Boston, MA 02111-1307, USA. */ #ifdef __STDC__ #include #else -#include +#include #endif #ifdef _WIN32 @@ -80,7 +80,7 @@ static char *translate_name PROTO((char *)); static char *concat PVPROTO((char *, ...)); static char *save_string PROTO((char *, int)); -#ifdef _WIN32 +#if (defined(_WIN32) && !defined(__CYGWIN32__)) static char *lookup_key PROTO((char *)); static HKEY reg_key = (HKEY) INVALID_HANDLE_VALUE; #endif @@ -95,7 +95,7 @@ get_key_value (key) { char *prefix = 0; -#ifdef _WIN32 +#if (defined(_WIN32) && !defined(__CYGWIN32__)) prefix = lookup_key (key); #endif @@ -175,7 +175,7 @@ save_string (s, len) return result; } -#ifdef _WIN32 +#if (defined(_WIN32) && !defined(__CYGWIN32__)) /* Look up "key" in the registry, as above. */ diff --git a/protoize.c b/protoize.c index 34f8fe5..cb4c029 100644 --- a/protoize.c +++ b/protoize.c @@ -57,7 +57,7 @@ Boston, MA 02111-1307, USA. */ #define _POSIX_SOURCE #endif -#include +#include /* On some systems stdio.h includes stdarg.h; we must bring in varargs.h first. */ #include diff --git a/toplev.c b/toplev.c index 45831c0..e461f36 100644 --- a/toplev.c +++ b/toplev.c @@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. */ #ifdef __STDC__ #include #else -#include +#include #endif #include #include diff --git a/tree.c b/tree.c index b989344..2f86c47 100644 --- a/tree.c +++ b/tree.c @@ -43,7 +43,7 @@ Boston, MA 02111-1307, USA. */ #ifdef __STDC__ #include #else -#include +#include #endif #include