Commit 37ef1054 by Richard Kenner

(__negdi2, __lshrdi3, __ashldi3, __ashrdi3, __ffsdi2):

Use ANSI style definition with full prototype.
(__muldi3, __udiv_w_sdiv, __udivmoddi4, __divdi3, __moddi3) : Likewise.
(__udivmoddi4, __udivdi3, __cmpdi2, __ucmpdi2) : Likewise.
(__fixunstfdi, __fixtfdi, __fixunsxfdi, __fixxfdi) : Likewise.
(__fixunsdfdi, __fixdfdi, __floatdixf, __floatditf) : Likewise.
(__floatdidf, __floatdisf, __fixunsxfsi, __fixunsdfsi) : Likewise.
(__gcc_bcmp, __eprintf, gopen, gclose, __bb_init_file) : Likewise.
(__bb_init_trace_func, __clear_cache, mprotect) : Likewise.
(__enable_execute_stack, cacheflush, exit) : Likewise.
(find_exception_table, __find_first_exception_table_match) : Likewise.

From-SVN: r13658
parent 7598db11
/* More subroutines needed by GCC output code on some machines. */ /* More subroutines needed by GCC output code on some machines. */
/* Compile this one with gcc. */ /* Compile this one with gcc. */
/* Copyright (C) 1989, 92, 93, 94, 95, 1996 Free Software Foundation, Inc. /* Copyright (C) 1989, 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
This file is part of GNU CC. This file is part of GNU CC.
...@@ -138,8 +138,7 @@ extern DItype __fixunstfdi (TFtype a); ...@@ -138,8 +138,7 @@ extern DItype __fixunstfdi (TFtype a);
static inline static inline
#endif #endif
DItype DItype
__negdi2 (u) __negdi2 (DItype u)
DItype u;
{ {
DIunion w; DIunion w;
DIunion uu; DIunion uu;
...@@ -153,11 +152,11 @@ __negdi2 (u) ...@@ -153,11 +152,11 @@ __negdi2 (u)
} }
#endif #endif
/* Unless shift functions are defined whith full ANSI prototypes,
parameter b will be promoted to int if word_type is smaller than an int. */
#ifdef L_lshrdi3 #ifdef L_lshrdi3
DItype DItype
__lshrdi3 (u, b) __lshrdi3 (DItype u, word_type b)
DItype u;
word_type b;
{ {
DIunion w; DIunion w;
word_type bm; word_type bm;
...@@ -187,9 +186,7 @@ __lshrdi3 (u, b) ...@@ -187,9 +186,7 @@ __lshrdi3 (u, b)
#ifdef L_ashldi3 #ifdef L_ashldi3
DItype DItype
__ashldi3 (u, b) __ashldi3 (DItype u, word_type b)
DItype u;
word_type b;
{ {
DIunion w; DIunion w;
word_type bm; word_type bm;
...@@ -219,9 +216,7 @@ __ashldi3 (u, b) ...@@ -219,9 +216,7 @@ __ashldi3 (u, b)
#ifdef L_ashrdi3 #ifdef L_ashrdi3
DItype DItype
__ashrdi3 (u, b) __ashrdi3 (DItype u, word_type b)
DItype u;
word_type b;
{ {
DIunion w; DIunion w;
word_type bm; word_type bm;
...@@ -252,8 +247,7 @@ __ashrdi3 (u, b) ...@@ -252,8 +247,7 @@ __ashrdi3 (u, b)
#ifdef L_ffsdi2 #ifdef L_ffsdi2
DItype DItype
__ffsdi2 (u) __ffsdi2 (DItype u)
DItype u;
{ {
DIunion uu, w; DIunion uu, w;
uu.ll = u; uu.ll = u;
...@@ -273,8 +267,7 @@ __ffsdi2 (u) ...@@ -273,8 +267,7 @@ __ffsdi2 (u)
#ifdef L_muldi3 #ifdef L_muldi3
DItype DItype
__muldi3 (u, v) __muldi3 (DItype u, DItype v)
DItype u, v;
{ {
DIunion w; DIunion w;
DIunion uu, vv; DIunion uu, vv;
...@@ -293,8 +286,7 @@ __muldi3 (u, v) ...@@ -293,8 +286,7 @@ __muldi3 (u, v)
#ifdef L_udiv_w_sdiv #ifdef L_udiv_w_sdiv
#if defined (sdiv_qrnnd) #if defined (sdiv_qrnnd)
USItype USItype
__udiv_w_sdiv (rp, a1, a0, d) __udiv_w_sdiv (USItype *rp, USItype a1, USItype a0, USItype d)
USItype *rp, a1, a0, d;
{ {
USItype q, r; USItype q, r;
USItype c0, c1, b1; USItype c0, c1, b1;
...@@ -392,8 +384,7 @@ __udiv_w_sdiv (rp, a1, a0, d) ...@@ -392,8 +384,7 @@ __udiv_w_sdiv (rp, a1, a0, d)
#else #else
/* If sdiv_qrnnd doesn't exist, define dummy __udiv_w_sdiv. */ /* If sdiv_qrnnd doesn't exist, define dummy __udiv_w_sdiv. */
USItype USItype
__udiv_w_sdiv (rp, a1, a0, d) __udiv_w_sdiv (USItype *rp, USItype a1, USItype a0, USItype d)
USItype *rp, a1, a0, d;
{} {}
#endif #endif
#endif #endif
...@@ -421,9 +412,7 @@ static const UQItype __clz_tab[] = ...@@ -421,9 +412,7 @@ static const UQItype __clz_tab[] =
static inline static inline
#endif #endif
UDItype UDItype
__udivmoddi4 (n, d, rp) __udivmoddi4 (UDItype n, UDItype d, UDItype *rp)
UDItype n, d;
UDItype *rp;
{ {
DIunion ww; DIunion ww;
DIunion nn, dd; DIunion nn, dd;
...@@ -644,8 +633,7 @@ __udivmoddi4 (n, d, rp) ...@@ -644,8 +633,7 @@ __udivmoddi4 (n, d, rp)
UDItype __udivmoddi4 (); UDItype __udivmoddi4 ();
DItype DItype
__divdi3 (u, v) __divdi3 (DItype u, DItype v)
DItype u, v;
{ {
word_type c = 0; word_type c = 0;
DIunion uu, vv; DIunion uu, vv;
...@@ -672,8 +660,7 @@ __divdi3 (u, v) ...@@ -672,8 +660,7 @@ __divdi3 (u, v)
#ifdef L_moddi3 #ifdef L_moddi3
UDItype __udivmoddi4 (); UDItype __udivmoddi4 ();
DItype DItype
__moddi3 (u, v) __moddi3 (DItype u, DItype v)
DItype u, v;
{ {
word_type c = 0; word_type c = 0;
DIunion uu, vv; DIunion uu, vv;
...@@ -699,8 +686,7 @@ __moddi3 (u, v) ...@@ -699,8 +686,7 @@ __moddi3 (u, v)
#ifdef L_umoddi3 #ifdef L_umoddi3
UDItype __udivmoddi4 (); UDItype __udivmoddi4 ();
UDItype UDItype
__umoddi3 (u, v) __umoddi3 (UDItype u, UDItype v)
UDItype u, v;
{ {
UDItype w; UDItype w;
...@@ -713,8 +699,7 @@ __umoddi3 (u, v) ...@@ -713,8 +699,7 @@ __umoddi3 (u, v)
#ifdef L_udivdi3 #ifdef L_udivdi3
UDItype __udivmoddi4 (); UDItype __udivmoddi4 ();
UDItype UDItype
__udivdi3 (n, d) __udivdi3 (UDItype n, UDItype d)
UDItype n, d;
{ {
return __udivmoddi4 (n, d, (UDItype *) 0); return __udivmoddi4 (n, d, (UDItype *) 0);
} }
...@@ -722,8 +707,7 @@ __udivdi3 (n, d) ...@@ -722,8 +707,7 @@ __udivdi3 (n, d)
#ifdef L_cmpdi2 #ifdef L_cmpdi2
word_type word_type
__cmpdi2 (a, b) __cmpdi2 (DItype a, DItype b)
DItype a, b;
{ {
DIunion au, bu; DIunion au, bu;
...@@ -743,8 +727,7 @@ __cmpdi2 (a, b) ...@@ -743,8 +727,7 @@ __cmpdi2 (a, b)
#ifdef L_ucmpdi2 #ifdef L_ucmpdi2
word_type word_type
__ucmpdi2 (a, b) __ucmpdi2 (DItype a, DItype b)
DItype a, b;
{ {
DIunion au, bu; DIunion au, bu;
...@@ -767,8 +750,7 @@ __ucmpdi2 (a, b) ...@@ -767,8 +750,7 @@ __ucmpdi2 (a, b)
#define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE) #define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE)
DItype DItype
__fixunstfdi (a) __fixunstfdi (TFtype a)
TFtype a;
{ {
TFtype b; TFtype b;
UDItype v; UDItype v;
...@@ -797,8 +779,7 @@ __fixunstfdi (a) ...@@ -797,8 +779,7 @@ __fixunstfdi (a)
#if defined(L_fixtfdi) && (LONG_DOUBLE_TYPE_SIZE == 128) #if defined(L_fixtfdi) && (LONG_DOUBLE_TYPE_SIZE == 128)
DItype DItype
__fixtfdi (a) __fixtfdi (TFtype a)
TFtype a;
{ {
if (a < 0) if (a < 0)
return - __fixunstfdi (-a); return - __fixunstfdi (-a);
...@@ -811,8 +792,7 @@ __fixtfdi (a) ...@@ -811,8 +792,7 @@ __fixtfdi (a)
#define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE) #define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE)
DItype DItype
__fixunsxfdi (a) __fixunsxfdi (XFtype a)
XFtype a;
{ {
XFtype b; XFtype b;
UDItype v; UDItype v;
...@@ -841,8 +821,7 @@ __fixunsxfdi (a) ...@@ -841,8 +821,7 @@ __fixunsxfdi (a)
#if defined(L_fixxfdi) && (LONG_DOUBLE_TYPE_SIZE == 96) #if defined(L_fixxfdi) && (LONG_DOUBLE_TYPE_SIZE == 96)
DItype DItype
__fixxfdi (a) __fixxfdi (XFtype a)
XFtype a;
{ {
if (a < 0) if (a < 0)
return - __fixunsxfdi (-a); return - __fixunsxfdi (-a);
...@@ -855,8 +834,7 @@ __fixxfdi (a) ...@@ -855,8 +834,7 @@ __fixxfdi (a)
#define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE) #define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE)
DItype DItype
__fixunsdfdi (a) __fixunsdfdi (DFtype a)
DFtype a;
{ {
DFtype b; DFtype b;
UDItype v; UDItype v;
...@@ -885,8 +863,7 @@ __fixunsdfdi (a) ...@@ -885,8 +863,7 @@ __fixunsdfdi (a)
#ifdef L_fixdfdi #ifdef L_fixdfdi
DItype DItype
__fixdfdi (a) __fixdfdi (DFtype a)
DFtype a;
{ {
if (a < 0) if (a < 0)
return - __fixunsdfdi (-a); return - __fixunsdfdi (-a);
...@@ -946,8 +923,7 @@ __fixsfdi (SFtype a) ...@@ -946,8 +923,7 @@ __fixsfdi (SFtype a)
#define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE) #define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE)
XFtype XFtype
__floatdixf (u) __floatdixf (DItype u)
DItype u;
{ {
XFtype d; XFtype d;
SItype negate = 0; SItype negate = 0;
...@@ -970,8 +946,7 @@ __floatdixf (u) ...@@ -970,8 +946,7 @@ __floatdixf (u)
#define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE) #define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE)
TFtype TFtype
__floatditf (u) __floatditf (DItype u)
DItype u;
{ {
TFtype d; TFtype d;
SItype negate = 0; SItype negate = 0;
...@@ -994,8 +969,7 @@ __floatditf (u) ...@@ -994,8 +969,7 @@ __floatditf (u)
#define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE) #define HIGH_WORD_COEFF (((UDItype) 1) << WORD_SIZE)
DFtype DFtype
__floatdidf (u) __floatdidf (DItype u)
DItype u;
{ {
DFtype d; DFtype d;
SItype negate = 0; SItype negate = 0;
...@@ -1047,8 +1021,7 @@ __floatdidf (u) ...@@ -1047,8 +1021,7 @@ __floatdidf (u)
#endif #endif
SFtype SFtype
__floatdisf (u) __floatdisf (DItype u)
DItype u;
{ {
/* Do the calculation in DFmode /* Do the calculation in DFmode
so that we don't lose any of the precision of the high word so that we don't lose any of the precision of the high word
...@@ -1098,8 +1071,7 @@ __floatdisf (u) ...@@ -1098,8 +1071,7 @@ __floatdisf (u)
#include <limits.h> #include <limits.h>
USItype USItype
__fixunsxfsi (a) __fixunsxfsi (XFtype a)
XFtype a;
{ {
if (a >= - (DFtype) LONG_MIN) if (a >= - (DFtype) LONG_MIN)
return (SItype) (a + LONG_MIN) - LONG_MIN; return (SItype) (a + LONG_MIN) - LONG_MIN;
...@@ -1121,8 +1093,7 @@ __fixunsxfsi (a) ...@@ -1121,8 +1093,7 @@ __fixunsxfsi (a)
#include <limits.h> #include <limits.h>
USItype USItype
__fixunsdfsi (a) __fixunsdfsi (DFtype a)
DFtype a;
{ {
if (a >= - (DFtype) LONG_MIN) if (a >= - (DFtype) LONG_MIN)
return (SItype) (a + LONG_MIN) - LONG_MIN; return (SItype) (a + LONG_MIN) - LONG_MIN;
...@@ -1176,9 +1147,7 @@ __fixunssfsi (SFtype a) ...@@ -1176,9 +1147,7 @@ __fixunssfsi (SFtype a)
positive if S1 is greater, 0 if S1 and S2 are equal. */ positive if S1 is greater, 0 if S1 and S2 are equal. */
int int
__gcc_bcmp (s1, s2, size) __gcc_bcmp (unsigned char *s1, unsigned char *s2, size_t size)
unsigned char *s1, *s2;
size_t size;
{ {
while (size > 0) while (size > 0)
{ {
...@@ -1424,11 +1393,8 @@ __builtin_saveregs () ...@@ -1424,11 +1393,8 @@ __builtin_saveregs ()
#include <stdio.h> #include <stdio.h>
/* This is used by the `assert' macro. */ /* This is used by the `assert' macro. */
void void
__eprintf (string, expression, line, filename) __eprintf (const char *string, const char *expression,
const char *string; int line, const char *filename)
const char *expression;
int line;
const char *filename;
{ {
fprintf (stderr, string, expression, line, filename); fprintf (stderr, string, expression, line, filename);
fflush (stderr); fflush (stderr);
...@@ -1720,9 +1686,7 @@ bb_mode & 8 != 0 : Insert return instructions in basic block flow. ...@@ -1720,9 +1686,7 @@ bb_mode & 8 != 0 : Insert return instructions in basic block flow.
'.gz' from any first parameter to gopen. */ '.gz' from any first parameter to gopen. */
static FILE * static FILE *
gopen (fn, mode) gopen (char *fn, char *mode)
char *fn;
char *mode;
{ {
int use_gzip; int use_gzip;
char *p; char *p;
...@@ -1770,8 +1734,7 @@ gopen (fn, mode) ...@@ -1770,8 +1734,7 @@ gopen (fn, mode)
} }
static int static int
gclose (f) gclose (FILE *f)
FILE *f;
{ {
struct stat buf; struct stat buf;
...@@ -2228,8 +2191,7 @@ skip: ...@@ -2228,8 +2191,7 @@ skip:
/* Called upon entering the first function of a file. */ /* Called upon entering the first function of a file. */
static void static void
__bb_init_file (blocks) __bb_init_file (struct bb *blocks)
struct bb *blocks;
{ {
const struct bb_func *p; const struct bb_func *p;
...@@ -2290,9 +2252,7 @@ __bb_trace_ret () ...@@ -2290,9 +2252,7 @@ __bb_trace_ret ()
/* Called when entering a function. */ /* Called when entering a function. */
void void
__bb_init_trace_func (blocks, blockno) __bb_init_trace_func (struct bb *blocks, unsigned long blockno)
struct bb *blocks;
unsigned long blockno;
{ {
static int trace_init = 0; static int trace_init = 0;
...@@ -2529,8 +2489,7 @@ unsigned int __shtab[] = { ...@@ -2529,8 +2489,7 @@ unsigned int __shtab[] = {
#define INSN_CACHE_PLANE_SIZE (INSN_CACHE_SIZE / INSN_CACHE_DEPTH) #define INSN_CACHE_PLANE_SIZE (INSN_CACHE_SIZE / INSN_CACHE_DEPTH)
void void
__clear_cache (beg, end) __clear_cache (char *beg, char *end)
char *beg, *end;
{ {
#ifdef CLEAR_INSN_CACHE #ifdef CLEAR_INSN_CACHE
CLEAR_INSN_CACHE (beg, end); CLEAR_INSN_CACHE (beg, end);
...@@ -2653,9 +2612,7 @@ long getpagesize() ...@@ -2653,9 +2612,7 @@ long getpagesize()
#endif #endif
} }
int mprotect(addr, len, prot) int mprotect(char *addr, int len, int prot)
char *addr;
int len, prot;
{ {
int np, op; int np, op;
...@@ -2690,8 +2647,7 @@ TRANSFER_FROM_TRAMPOLINE ...@@ -2690,8 +2647,7 @@ TRANSFER_FROM_TRAMPOLINE
#endif #endif
void void
__enable_execute_stack (addr) __enable_execute_stack (char *addr)
char *addr;
{ {
kern_return_t r; kern_return_t r;
char *eaddr = addr + TRAMPOLINE_SIZE; char *eaddr = addr + TRAMPOLINE_SIZE;
...@@ -2815,10 +2771,7 @@ __enable_execute_stack () ...@@ -2815,10 +2771,7 @@ __enable_execute_stack ()
defined in config/mips/mips.h. */ defined in config/mips/mips.h. */
void void
cacheflush (beg,size,flag) cacheflush (char *beg, int size, int flag)
char *beg;
int size;
int flag;
{ {
if (syscall (SYS_sysnews, NEWS_CACHEFLUSH, beg, size, FLUSH_BCACHE)) if (syscall (SYS_sysnews, NEWS_CACHEFLUSH, beg, size, FLUSH_BCACHE))
{ {
...@@ -2988,8 +2941,7 @@ extern void _cleanup (); ...@@ -2988,8 +2941,7 @@ extern void _cleanup ();
extern void _exit () __attribute__ ((noreturn)); extern void _exit () __attribute__ ((noreturn));
void void
exit (status) exit (int status)
int status;
{ {
#if !defined (INIT_SECTION_ASM_OP) || !defined (OBJECT_FORMAT_ELF) #if !defined (INIT_SECTION_ASM_OP) || !defined (OBJECT_FORMAT_ELF)
#ifdef NEED_ATEXIT #ifdef NEED_ATEXIT
...@@ -3045,8 +2997,7 @@ struct exception_table_node { ...@@ -3045,8 +2997,7 @@ struct exception_table_node {
static struct exception_table_node *exception_table_list; static struct exception_table_node *exception_table_list;
static exception_table * static exception_table *
find_exception_table (pc) find_exception_table (void *pc)
void *pc;
{ {
register struct exception_table_node *table = exception_table_list; register struct exception_table_node *table = exception_table_list;
for ( ; table != 0; table = table->next) for ( ; table != 0; table = table->next)
...@@ -3082,8 +3033,7 @@ find_exception_table (pc) ...@@ -3082,8 +3033,7 @@ find_exception_table (pc)
an inner block. */ an inner block. */
void * void *
__find_first_exception_table_match (pc) __find_first_exception_table_match (void *pc)
void *pc;
{ {
exception_table *table = find_exception_table (pc); exception_table *table = find_exception_table (pc);
int pos = 0; int pos = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment