From f50ec635fc7b60d4c95b13750991c3ba8b77bc04 Mon Sep 17 00:00:00 2001 From: "Kaveh R. Ghazi" Date: Wed, 19 Jan 2000 22:25:21 +0000 Subject: [PATCH] i370-protos.h: New file. * i370-protos.h: New file. * i370.c: Include tm_p.h. Fix compile time warnings. * i370.h: Move prototypes to i370-protos.h. Fix compile time warnings. * i370.md: Likewise. From-SVN: r31519 --- gcc/ChangeLog | 11 +++++ gcc/config/i370/i370-protos.h | 48 +++++++++++++++++++ gcc/config/i370/i370.c | 89 +++++++++++++++++------------------ gcc/config/i370/i370.h | 12 +++-- gcc/config/i370/i370.md | 9 ++-- 5 files changed, 113 insertions(+), 56 deletions(-) create mode 100644 gcc/config/i370/i370-protos.h diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 5762f64d316..1e8acd87049 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2000-01-19 Kaveh R. Ghazi + + * i370-protos.h: New file. + + * i370.c: Include tm_p.h. Fix compile time warnings. + + * i370.h: Move prototypes to i370-protos.h. Fix compile time + warnings. + + * i370.md: Likewise. + 2000-01-19 Kaveh R. Ghazi * real.c (enan, einan, eiisnan, eiisneg, make_nan): Wrap in NANS. diff --git a/gcc/config/i370/i370-protos.h b/gcc/config/i370/i370-protos.h new file mode 100644 index 00000000000..7e64acd8ed2 --- /dev/null +++ b/gcc/config/i370/i370-protos.h @@ -0,0 +1,48 @@ +/* Definitions of target machine for GNU compiler. System/370 version. + Copyright (C) 2000 Free Software Foundation, Inc. + Contributed by Jan Stein (jan@cd.chalmers.se). + Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com) + Hacked for Linux-ELF/390 by Linas Vepstas (linas@linas.org) + +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. */ + +#ifdef RTX_CODE +extern int i370_branch_dest PARAMS ((rtx)); +extern int i370_branch_length PARAMS ((rtx)); +extern int i370_short_branch PARAMS ((rtx)); +extern int s_operand PARAMS ((rtx, enum machine_mode)); +extern int r_or_s_operand PARAMS ((rtx, enum machine_mode)); +extern int unsigned_jump_follows_p PARAMS ((rtx)); +#endif /* RTX_CODE */ + +#ifdef TREE_CODE +extern int handle_pragma PARAMS ((int (*)(void), void (*)(int), const char *)); +#endif /* TREE_CODE */ + +extern char mvs_map_char PARAMS ((int)); +extern void mvs_add_label PARAMS ((int)); +extern int mvs_check_label PARAMS ((int)); +extern int mvs_check_page PARAMS ((FILE *, int, int)); +extern int mvs_function_check PARAMS ((const char *)); +extern void mvs_add_alias PARAMS ((const char *, const char *, int)); +extern int mvs_need_alias PARAMS ((const char *)); +extern int mvs_get_alias PARAMS ((const char *, char *)); +extern int mvs_check_alias PARAMS ((const char *, char *)); +extern void i370_function_prolog PARAMS ((FILE *, int)); +extern void check_label_emit PARAMS ((void)); +extern void mvs_free_label_list PARAMS ((void)); diff --git a/gcc/config/i370/i370.c b/gcc/config/i370/i370.c index 6957b5de06e..9d4eb3d4e17 100644 --- a/gcc/config/i370/i370.c +++ b/gcc/config/i370/i370.c @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for System/370. - Copyright (C) 1989, 93, 95, 97, 98, 1999 Free Software Foundation, Inc. + Copyright (C) 1989, 93, 95, 97-99, 2000 Free Software Foundation, Inc. Contributed by Jan Stein (jan@cd.chalmers.se). Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com) Hacked for Linux-ELF/390 by Linas Vepstas (linas@linas.org) @@ -37,6 +37,7 @@ Boston, MA 02111-1307, USA. */ #include "flags.h" #include "recog.h" #include "toplev.h" +#include "tm_p.h" extern FILE *asm_out_file; @@ -92,7 +93,8 @@ static label_node_t *free_anchor = 0; /* Assembler source file descriptor. */ static FILE *assembler_source = 0; -label_node_t * mvs_get_label (); +static label_node_t * mvs_get_label PARAMS ((int)); +static void i370_label_scan PARAMS ((void)); /* ===================================================== */ /* defines and functions specific to the HLASM assembler */ @@ -121,14 +123,16 @@ alias_node_t; static alias_node_t *alias_anchor = 0; /* Alias number */ -static alias_number = 0; +#ifdef LONGEXTERNAL +static int alias_number = 0; +#endif /* Define the length of the internal MVS function table. */ #define MVS_FUNCTION_TABLE_LENGTH 32 /* C/370 internal function table. These functions use non-standard linkage and must handled in a special manner. */ -static char *mvs_function_table[MVS_FUNCTION_TABLE_LENGTH] = +static const char *const mvs_function_table[MVS_FUNCTION_TABLE_LENGTH] = { #if defined(HOST_EBCDIC) /* Changed for EBCDIC collating sequence */ "ceil", "edc_acos", "edc_asin", "edc_atan", "edc_ata2", "edc_cos", @@ -151,7 +155,7 @@ static char *mvs_function_table[MVS_FUNCTION_TABLE_LENGTH] = /* ===================================================== */ /* ASCII to EBCDIC conversion table. */ -static unsigned char ascebc[256] = +static const unsigned char ascebc[256] = { /*00 NL SH SX EX ET NQ AK BL */ 0x00, 0x01, 0x02, 0x03, 0x37, 0x2D, 0x2E, 0x2F, @@ -204,7 +208,7 @@ static unsigned char ascebc[256] = }; /* EBCDIC to ASCII conversion table. */ -unsigned char ebcasc[256] = +static const unsigned char ebcasc[256] = { /*00 NU SH SX EX PF HT LC DL */ 0x00, 0x01, 0x02, 0x03, 0x00, 0x09, 0x00, 0x7F, @@ -277,7 +281,7 @@ unsigned char ebcasc[256] = char mvs_map_char (c) - char c; + int c; { #if defined(TARGET_EBCDIC) && !defined(HOST_EBCDIC) fprintf (stderr, "mvs_map_char: TE & !HE: c = %02x\n", c); @@ -389,7 +393,7 @@ i370_short_branch (insn) } void -i370_label_scan (void) +i370_label_scan () { rtx insn; label_node_t *lp; @@ -429,7 +433,6 @@ i370_label_scan (void) if (JUMP_INSN == code) { rtx label = JUMP_LABEL (insn); - int labelno; /* If there is no label for this jump, then this had better be a ADDR_VEC or an ADDR_DIFF_VEC @@ -442,7 +445,6 @@ i370_label_scan (void) { for (j=0; j < XVECLEN (body, 0); j++) { - int labelno; rtx lref = XVECEXP (body, 0, j); if (LABEL_REF != GET_CODE (lref)) abort (); label = XEXP (lref,0); @@ -476,7 +478,6 @@ i370_label_scan (void) debug_rtx (insn); for (j=0; j < XVECLEN (body, 0); j++) { - int labelno; } /* finished with the vector go do next insn */ continue; @@ -551,8 +552,8 @@ i370_label_scan (void) code, this shouldn't be a problem ... */ -int -check_label_emit (void) +void +check_label_emit () { if (mvs_need_base_reload) { @@ -699,7 +700,7 @@ mvs_get_label_page(int id) label element chain. */ void -mvs_free_label_list (void) +mvs_free_label_list () { if (label_anchor) @@ -806,7 +807,7 @@ mvs_check_page (file, code, lit) int mvs_function_check (name) - char *name; + const char *name; { int lower, middle, upper; int i; @@ -830,11 +831,11 @@ mvs_function_check (name) /* Add the alias to the current alias list. */ -int +void mvs_add_alias (realname, aliasname, emitted) - char *realname; - char *aliasname; - int emitted; + const char *realname; + const char *aliasname; + int emitted; { alias_node_t *ap; @@ -850,7 +851,7 @@ mvs_add_alias (realname, aliasname, emitted) int mvs_need_alias (realname) - char *realname; + const char *realname; { if (mvs_function_check (realname)) return 0; @@ -866,7 +867,7 @@ mvs_need_alias (realname) int mvs_get_alias (realname, aliasname) - char *realname; + const char *realname; char *aliasname; { #ifdef LONGEXTERNAL @@ -902,7 +903,7 @@ mvs_get_alias (realname, aliasname) int mvs_check_alias (realname, aliasname) - char *realname; + const char *realname; char *aliasname; { #ifdef LONGEXTERNAL @@ -942,18 +943,13 @@ mvs_check_alias (realname, aliasname) The result is 1 if the pragma was handled. */ int -handle_pragma (finput, node) - FILE *finput; - tree node; +handle_pragma (p_getc, p_ungetc, pname) + int (* p_getc) PARAMS ((void)); + void (* p_ungetc) PARAMS ((int)); + const char *pname; { int retval = 0; register int c; - register char *pname; - - if (TREE_CODE (node) != IDENTIFIER_NODE) - return 0; - - pname = IDENTIFIER_POINTER (node); if (strcmp (pname, "map") == 0) { @@ -962,20 +958,20 @@ handle_pragma (finput, node) char *s; do { - c = getc (finput); + c = p_getc (); } while (c == ' ' || c == '\t'); if (c == '(') { s = realname; do { - c = getc (finput); + c = p_getc (); } while (c == ' ' || c == '\t'); if (c == '\n') goto PRAGMA_WARNING; do { *s++ = c; - c = getc (finput); + c = p_getc (); } while (ISALNUM(c) || c == '_'); if (c == '\n') goto PRAGMA_WARNING; @@ -983,28 +979,28 @@ handle_pragma (finput, node) if (c == ' ' || c == '\t') do { - c = getc (finput); + c = p_getc (); } while (c == ' ' || c == '\t'); if (c == ',') { do { - c = getc (finput); + c = p_getc (); } while (c == ' ' || c == '\t'); if (c == '"') { s = aliasname; - c = getc(finput); + c = p_getc (); do { if (c == '\\') { int d = 0; do { - c = getc(finput); + c = p_getc (); if (c >= '0' && c <= '7') - d = (d << 3) | c - '0'; + d = (d << 3) | (c - '0'); } while (c >= '0' && c <= '7'); - ungetc (c, finput); + p_ungetc (c); c = d; if (d < 1 || d > 255) warning ("Escape value out of range"); @@ -1013,7 +1009,7 @@ handle_pragma (finput, node) #endif } *s++ = c; - c = getc (finput); + c = p_getc (); if (ISSPACE(c) || c == ')') goto PRAGMA_WARNING; } while (c != '"'); @@ -1024,7 +1020,7 @@ handle_pragma (finput, node) aliasname[MAX_MVS_LABEL_SIZE] = '\0'; } do { - c = getc (finput); + c = p_getc (); } while (c == ' ' || c == '\t'); if (c == ')') { @@ -1066,7 +1062,7 @@ handle_pragma (finput, node) int mvs_function_check (name) - char *name; + const char *name ATTRIBUTE_UNUSED; { return 0; } @@ -1165,6 +1161,7 @@ r_or_s_operand (op, mode) The unsigned_jump_follows_p() routine returns a 1 if the next jump is unsigned. INSN is the current instruction. */ +int unsigned_jump_follows_p (insn) register rtx insn; { @@ -1213,7 +1210,6 @@ i370_function_prolog (f, l) static int function_first = 0; static int function_year, function_month, function_day; static int function_hour, function_minute, function_second; - int i; #if defined(LE370) if (!function_first) { @@ -1260,7 +1256,7 @@ i370_function_prolog (f, l) fprintf (f, "FTIM%03d\tDS\t0F\n", function_label_index); fprintf (f, "\tDC\tCL4'%d',CL4'%02d%02d',CL6'%02d%02d00'\n", function_year, function_month, function_day, - function_hour, function_minute, function_second); + function_hour, function_minute); fprintf (f, "\tDC\tCL2'01',CL4'0100'\n"); fprintf (f, "FENT%03d\tDS\t0H\n", function_label_index); fprintf (f, "\tSTM\t14,12,12(13)\n"); @@ -1396,8 +1392,7 @@ i370_function_prolog (f, frame_size) { static int function_label_index = 1; static int function_first = 0; - int i; - int stackframe_size, soffset, aligned_size; + int stackframe_size, aligned_size; fprintf (f, "# Function prologue\n"); /* define the stack, put it into its own data segment diff --git a/gcc/config/i370/i370.h b/gcc/config/i370/i370.h index 4ecc07dd292..42b00d0afcb 100644 --- a/gcc/config/i370/i370.h +++ b/gcc/config/i370/i370.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. System/370 version. - Copyright (C) 1989, 93, 95, 96, 97, 1998, 1999 Free Software Foundation, Inc. + Copyright (C) 1989, 93, 95-99, 2000 Free Software Foundation, Inc. Contributed by Jan Stein (jan@cd.chalmers.se). Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com) Hacked for Linux-ELF/390 by Linas Vepstas (linas@linas.org) @@ -61,7 +61,7 @@ extern int mvs_function_name_length; #define TARGET_SWITCHES \ { { "char-instructions", 1, "Generate char instructions"}, \ { "no-char-instructions", -1, "Do not generate char instructions"}, \ - { "", TARGET_DEFAULT} } + { "", TARGET_DEFAULT, 0} } /* To use IBM supplied macro function prologue and epilogue, define the following to 1. Should only be needed if IBM changes the definition @@ -152,8 +152,8 @@ extern int mvs_function_name_length; text can be read. CH is the first character after the #pragma. The result of the expression is the terminating character found (newline or EOF). */ -#define HANDLE_PRAGMA(FILE, ungetc_unused, NODE) \ - handle_pragma ((FILE), (NODE)) +#define HANDLE_PRAGMA(GETC, UNGETC, NAME) \ + handle_pragma ((GETC), (UNGETC), (NAME)) #endif /* TARGET_HLASM */ /* Define maximum length of page minus page escape overhead. */ @@ -392,7 +392,7 @@ enum reg_class /* Define which registers fit in which classes. This is an initializer for a vector of HARD_REG_SET of length N_REG_CLASSES. */ -#define REG_CLASS_CONTENTS {0, 0x0fffe, 0x0ffff, 0xf0000, 0xfffff} +#define REG_CLASS_CONTENTS {{0}, {0x0fffe}, {0x0ffff}, {0xf0000}, {0xfffff}} /* The same information, inverted: Return the class number of the smallest class containing @@ -1016,6 +1016,8 @@ enum reg_class /* some shifts set the CC some don't. */ \ case ASHIFT: case ASHIFTRT: \ do {} while (0); \ + default: \ + break; \ } \ } \ } \ diff --git a/gcc/config/i370/i370.md b/gcc/config/i370/i370.md index 7fba8635789..20452ac12cc 100644 --- a/gcc/config/i370/i370.md +++ b/gcc/config/i370/i370.md @@ -1,5 +1,5 @@ ;;- Machine description for GNU compiler -- System/370 version. -;; Copyright (C) 1989, 93, 94, 95, 1997 Free Software Foundation, Inc. +;; Copyright (C) 1989, 93, 94, 95, 97-99, 2000 Free Software Foundation, Inc. ;; Contributed by Jan Stein (jan@cd.chalmers.se). ;; Modified for OS/390 LanguageEnvironment C by Dave Pitts (dpitts@cozx.com) ;; Lots of Bug Fixes & Enhancements by Linas Vepstas (linas@linas.org) @@ -1591,6 +1591,7 @@ check_label_emit (); if (REG_P (operands[0])) { if (REG_P (operands[1])) + { if (REGNO (operands[0]) != REGNO (operands[1])) { mvs_check_page (0, 10, 0); @@ -1598,6 +1599,7 @@ check_label_emit (); } else return \"\"; /* Should be empty. 16-bits regs are always 32-bits. */ + } if (operands[1] == const0_rtx) { CC_STATUS_INIT; @@ -1641,7 +1643,7 @@ check_label_emit (); mvs_check_page (0, 8, 0); return \"SLL %0,24\;SRA %0,24\"; } - if (s_operand (operands[1])) + if (s_operand (operands[1], GET_MODE (operands[1]))) { mvs_check_page (0, 8, 0); return \"ICM %0,8,%1\;SRA %0,24\"; @@ -1669,7 +1671,7 @@ check_label_emit (); mvs_check_page (0, 8, 0); return \"SLL %0,24\;SRA %0,24\"; } - if (s_operand (operands[1])) + if (s_operand (operands[1], GET_MODE (operands[1]))) { mvs_check_page (0, 8, 0); return \"ICM %0,8,%1\;SRA %0,24\"; @@ -2718,7 +2720,6 @@ check_label_emit (); { rtx dr = gen_reg_rtx (DImode); rtx dr_0 = gen_rtx_SUBREG (SImode, dr, 0); - rtx dr_1 = gen_rtx_SUBREG (SImode, dr, 1); emit_insn (gen_rtx_SET (VOIDmode, dr_0, operands[1])); -- 2.30.2