From 0fb0a43f467626eb2b1263c9181560d1bcee33da Mon Sep 17 00:00:00 2001 From: Alexander Kabaev Date: Mon, 5 Jan 2004 20:27:51 +0000 Subject: [PATCH] Remove files not part of GCC 3.3.x. --- contrib/gcc/c-lex.h | 35 - contrib/gcc/config/alpha/linux-ecoff.h | 37 - contrib/gcc/config/alpha/osf12.h | 33 - contrib/gcc/config/alpha/osf2or3.h | 32 - contrib/gcc/config/arm/arm-wince-pe.h | 66 - contrib/gcc/config/arm/riscix.h | 144 - contrib/gcc/config/arm/riscix1-1.h | 103 - contrib/gcc/config/arm/rix-gas.h | 42 - contrib/gcc/config/arm/t-riscix | 6 - contrib/gcc/config/float-c4x.h | 96 - contrib/gcc/config/float-i128.h | 123 - contrib/gcc/config/float-i32.h | 123 - contrib/gcc/config/float-i386.h | 124 - contrib/gcc/config/float-i64.h | 123 - contrib/gcc/config/float-m68k.h | 127 - contrib/gcc/config/float-sh.h | 160 - contrib/gcc/config/float-sparc.h | 153 - contrib/gcc/config/float-vax.h | 159 - contrib/gcc/config/i386/386bsd.h | 53 - contrib/gcc/config/i386/aix386.h | 64 - contrib/gcc/config/i386/aix386ng.h | 139 - contrib/gcc/config/i386/bsd386.h | 32 - contrib/gcc/config/i386/dgux.h | 257 -- contrib/gcc/config/i386/djgpp-rtems.h | 35 - contrib/gcc/config/i386/interix.c | 114 - contrib/gcc/config/i386/isc.h | 96 - contrib/gcc/config/i386/isccoff.h | 12 - contrib/gcc/config/i386/iscdbx.h | 43 - contrib/gcc/config/i386/linux-oldld.h | 72 - contrib/gcc/config/i386/next.h | 186 - contrib/gcc/config/i386/osf1-ci.asm | 65 - contrib/gcc/config/i386/osf1-cn.asm | 46 - contrib/gcc/config/i386/osf1elf.h | 213 - contrib/gcc/config/i386/osf1elfgdb.h | 7 - contrib/gcc/config/i386/osfelf.h | 79 - contrib/gcc/config/i386/osfrose.h | 720 ---- contrib/gcc/config/i386/rtems.h | 25 - contrib/gcc/config/i386/seq-gas.h | 46 - contrib/gcc/config/i386/seq-sysv3.h | 45 - contrib/gcc/config/i386/seq2-sysv3.h | 7 - contrib/gcc/config/i386/sequent.h | 147 - contrib/gcc/config/i386/sol2gas.h | 11 - contrib/gcc/config/i386/sun.h | 83 - contrib/gcc/config/i386/sun386.h | 141 - contrib/gcc/config/i386/t-dgux | 11 - contrib/gcc/config/i386/t-next | 8 - contrib/gcc/config/i386/t-osf | 2 - contrib/gcc/config/i386/t-osf1elf | 18 - contrib/gcc/config/i386/t-sco5gas | 23 - contrib/gcc/config/i386/v3gas.h | 80 - contrib/gcc/config/nextstep-protos.h | 28 - contrib/gcc/config/nextstep.c | 117 - contrib/gcc/config/nextstep.h | 581 --- contrib/gcc/config/nextstep21.h | 64 - contrib/gcc/config/rs6000/softfloat.h | 24 - contrib/gcc/config/s390/t-linux | 7 - contrib/gcc/config/sparc/rtems.h | 27 - contrib/gcc/config/sparc/sol2-g1.asm | 88 - contrib/gcc/config/sparc/sol27-sld.h | 8 - contrib/gcc/config/t-install-cpp | 3 - contrib/gcc/cp/mpw-config.in | 11 - contrib/gcc/cp/mpw-make.sed | 112 - contrib/gcc/dependence.c | 1467 ------- contrib/gcc/doc/vms.texi | 331 -- contrib/gcc/enquire.c | 2887 ------------- contrib/gcc/f/version.c | 4 - contrib/gcc/f/version.h | 6 - contrib/gcc/ggc-callbacks.c | 36 - contrib/gcc/halfpic.c | 399 -- contrib/gcc/halfpic.h | 67 - contrib/gcc/hash.c | 218 - contrib/gcc/hash.h | 129 - contrib/gcc/tradcif.y | 567 --- contrib/gcc/tradcpp.c | 5276 ------------------------ contrib/gcc/tradcpp.h | 45 - 75 files changed, 17068 deletions(-) delete mode 100644 contrib/gcc/c-lex.h delete mode 100644 contrib/gcc/config/alpha/linux-ecoff.h delete mode 100644 contrib/gcc/config/alpha/osf12.h delete mode 100644 contrib/gcc/config/alpha/osf2or3.h delete mode 100644 contrib/gcc/config/arm/arm-wince-pe.h delete mode 100644 contrib/gcc/config/arm/riscix.h delete mode 100644 contrib/gcc/config/arm/riscix1-1.h delete mode 100644 contrib/gcc/config/arm/rix-gas.h delete mode 100644 contrib/gcc/config/arm/t-riscix delete mode 100644 contrib/gcc/config/float-c4x.h delete mode 100644 contrib/gcc/config/float-i128.h delete mode 100644 contrib/gcc/config/float-i32.h delete mode 100644 contrib/gcc/config/float-i386.h delete mode 100644 contrib/gcc/config/float-i64.h delete mode 100644 contrib/gcc/config/float-m68k.h delete mode 100644 contrib/gcc/config/float-sh.h delete mode 100644 contrib/gcc/config/float-sparc.h delete mode 100644 contrib/gcc/config/float-vax.h delete mode 100644 contrib/gcc/config/i386/386bsd.h delete mode 100644 contrib/gcc/config/i386/aix386.h delete mode 100644 contrib/gcc/config/i386/aix386ng.h delete mode 100644 contrib/gcc/config/i386/bsd386.h delete mode 100644 contrib/gcc/config/i386/dgux.h delete mode 100644 contrib/gcc/config/i386/djgpp-rtems.h delete mode 100644 contrib/gcc/config/i386/interix.c delete mode 100644 contrib/gcc/config/i386/isc.h delete mode 100644 contrib/gcc/config/i386/isccoff.h delete mode 100644 contrib/gcc/config/i386/iscdbx.h delete mode 100644 contrib/gcc/config/i386/linux-oldld.h delete mode 100644 contrib/gcc/config/i386/next.h delete mode 100644 contrib/gcc/config/i386/osf1-ci.asm delete mode 100644 contrib/gcc/config/i386/osf1-cn.asm delete mode 100644 contrib/gcc/config/i386/osf1elf.h delete mode 100644 contrib/gcc/config/i386/osf1elfgdb.h delete mode 100644 contrib/gcc/config/i386/osfelf.h delete mode 100644 contrib/gcc/config/i386/osfrose.h delete mode 100644 contrib/gcc/config/i386/rtems.h delete mode 100644 contrib/gcc/config/i386/seq-gas.h delete mode 100644 contrib/gcc/config/i386/seq-sysv3.h delete mode 100644 contrib/gcc/config/i386/seq2-sysv3.h delete mode 100644 contrib/gcc/config/i386/sequent.h delete mode 100644 contrib/gcc/config/i386/sol2gas.h delete mode 100644 contrib/gcc/config/i386/sun.h delete mode 100644 contrib/gcc/config/i386/sun386.h delete mode 100644 contrib/gcc/config/i386/t-dgux delete mode 100644 contrib/gcc/config/i386/t-next delete mode 100644 contrib/gcc/config/i386/t-osf delete mode 100644 contrib/gcc/config/i386/t-osf1elf delete mode 100644 contrib/gcc/config/i386/t-sco5gas delete mode 100644 contrib/gcc/config/i386/v3gas.h delete mode 100644 contrib/gcc/config/nextstep-protos.h delete mode 100644 contrib/gcc/config/nextstep.c delete mode 100644 contrib/gcc/config/nextstep.h delete mode 100644 contrib/gcc/config/nextstep21.h delete mode 100644 contrib/gcc/config/rs6000/softfloat.h delete mode 100644 contrib/gcc/config/s390/t-linux delete mode 100644 contrib/gcc/config/sparc/rtems.h delete mode 100644 contrib/gcc/config/sparc/sol2-g1.asm delete mode 100644 contrib/gcc/config/sparc/sol27-sld.h delete mode 100644 contrib/gcc/config/t-install-cpp delete mode 100644 contrib/gcc/cp/mpw-config.in delete mode 100644 contrib/gcc/cp/mpw-make.sed delete mode 100644 contrib/gcc/dependence.c delete mode 100644 contrib/gcc/doc/vms.texi delete mode 100644 contrib/gcc/enquire.c delete mode 100644 contrib/gcc/f/version.c delete mode 100644 contrib/gcc/f/version.h delete mode 100644 contrib/gcc/ggc-callbacks.c delete mode 100644 contrib/gcc/halfpic.c delete mode 100644 contrib/gcc/halfpic.h delete mode 100644 contrib/gcc/hash.c delete mode 100644 contrib/gcc/hash.h delete mode 100644 contrib/gcc/tradcif.y delete mode 100644 contrib/gcc/tradcpp.c delete mode 100644 contrib/gcc/tradcpp.h diff --git a/contrib/gcc/c-lex.h b/contrib/gcc/c-lex.h deleted file mode 100644 index ac917b5cb5a5..000000000000 --- a/contrib/gcc/c-lex.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Define constants for communication with c-parse.y. - Copyright (C) 1987, 1992, 1998, 1999, 2000 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC 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. - -GCC 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 GCC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - -#ifndef GCC_C_LEX_H -#define GCC_C_LEX_H - -extern tree make_pointer_declarator PARAMS ((tree, tree)); -extern void position_after_white_space PARAMS ((void)); - -extern int c_lex PARAMS ((tree *)); -extern const char *init_c_lex PARAMS ((const char *)); - -extern int indent_level; - -struct cpp_reader; -extern struct cpp_reader* parse_in; - -#endif /* ! GCC_C_LEX_H */ diff --git a/contrib/gcc/config/alpha/linux-ecoff.h b/contrib/gcc/config/alpha/linux-ecoff.h deleted file mode 100644 index 824d0280fce5..000000000000 --- a/contrib/gcc/config/alpha/linux-ecoff.h +++ /dev/null @@ -1,37 +0,0 @@ -/* Definitions of target machine for GNU compiler - for Alpha Linux-based GNU systems using ECOFF. - Copyright (C) 1996, 1997 Free Software Foundation, Inc. - Contributed by Bob Manson. - -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. */ - -#undef TARGET_VERSION -#define TARGET_VERSION fprintf (stderr, " (Alpha GNU/Linux for ECOFF)"); - -#undef CPP_SUBTARGET_SPEC -#define CPP_SUBTARGET_SPEC "-D__ECOFF__" - -#undef LINK_SPEC -#define LINK_SPEC "-G 8 %{O*:-O3} %{!O*:-O1}" - -/* stabs get slurped by the assembler into a queer ecoff format. */ -#undef PREFERRED_DEBUGGING_TYPE -#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG - -/* We support #pragma. */ -#define HANDLE_SYSV_PRAGMA diff --git a/contrib/gcc/config/alpha/osf12.h b/contrib/gcc/config/alpha/osf12.h deleted file mode 100644 index 87e21111f4dc..000000000000 --- a/contrib/gcc/config/alpha/osf12.h +++ /dev/null @@ -1,33 +0,0 @@ -/* Definitions of target machine for GNU compiler, for DEC Alpha. - Copyright (C) 1992, 1993, 1995, 1996 Free Software Foundation, Inc. - Contributed by Richard Kenner (kenner@nyu.edu) - -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. */ - -/* In OSF 1.2, there is a linker bug that prevents use of -O3 to - the linker. */ - -#undef LINK_SPEC -#define LINK_SPEC \ - "-G 8 -O1 %{static:-non_shared} %{rpath*} \ - %{!static:%{shared:-shared} %{!shared:-call_shared}} %{taso}" - -#undef WCHAR_TYPE -#define WCHAR_TYPE "short unsigned int" -#undef WCHAR_TYPE_SIZE -#define WCHAR_TYPE_SIZE 16 diff --git a/contrib/gcc/config/alpha/osf2or3.h b/contrib/gcc/config/alpha/osf2or3.h deleted file mode 100644 index 9d8c8f5e656a..000000000000 --- a/contrib/gcc/config/alpha/osf2or3.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Definitions of target machine for GNU compiler, for DEC Alpha, osf[23]. - Copyright (C) 1997 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. */ - -/* In OSF 2 or 3, linking with -lprof1 doesn't require -lpdf. */ - -#undef LIB_SPEC -#define LIB_SPEC "%{p:-lprof1} %{pg:-lprof1} %{a:-lprof2} -lc" - -/* As of OSF 3.2, as still can't subtract adjacent labels. */ -#undef TARGET_AS_CAN_SUBTRACT_LABELS -#define TARGET_AS_CAN_SUBTRACT_LABELS 0 - -/* The frame unwind data requires the ability to subtract labels. */ -#undef DWARF2_UNWIND_INFO -#define DWARF2_UNWIND_INFO 0 diff --git a/contrib/gcc/config/arm/arm-wince-pe.h b/contrib/gcc/config/arm/arm-wince-pe.h deleted file mode 100644 index e43ea9963195..000000000000 --- a/contrib/gcc/config/arm/arm-wince-pe.h +++ /dev/null @@ -1,66 +0,0 @@ -/* Definitions of target machine for GNU compiler, - for ARM with PE obj format running under the WinCE operating system. - Copyright (C) 1999, 2000 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. */ - -#define ARM_WINCE 1 - -#include "pe.h" - -#undef USER_LABEL_PREFIX -#define USER_LABEL_PREFIX "" - -#undef TARGET_VERSION -#define TARGET_VERSION fputs (" (ARM/WinCE/PE)", stderr); - -/* The next three definitions are defined in pe.h, - undefined in arm/arm-pe.h and then redefined back here! */ -#undef LIB_SPEC -#define LIB_SPEC "-lcoredll -lcorelibc" - -#define MATH_LIBRARY "" - -#define LIBSTDCXX "-lc" - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC "" -#define ENDFILE_SPEC "" - -#undef CPP_APCS_PC_DEFAULT_SPEC -#define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__" - -#undef CC1_SPEC -#define CC1_SPEC "%{!mapcs-32:%{!mapcs-26:-mapcs-32}}" - -#undef ASM_SPEC -#define ASM_SPEC " \ -%{mbig-endian:-EB} \ -%{mcpu=*:-m%*} \ -%{march=*:-m%*} \ -%{mapcs-*:-mapcs-%*} \ -%{mthumb-interwork:-mthumb-interwork} \ -%{!mapcs-32:%{!mapcs-26:-mapcs-32}} \ -" - -/* WinCE headers require -DARM */ -#undef PE_SUBTARGET_CPP_SPEC -#define PE_SUBTARGET_CPP_SPEC "-D__pe__ -DARM -D__unaligned=__attribute__((aligned(1))) " - -#undef SIZE_TYPE -#define SIZE_TYPE "long unsigned int" diff --git a/contrib/gcc/config/arm/riscix.h b/contrib/gcc/config/arm/riscix.h deleted file mode 100644 index 35fc23258d2e..000000000000 --- a/contrib/gcc/config/arm/riscix.h +++ /dev/null @@ -1,144 +0,0 @@ -/* Definitions of target machine for GNU compiler. ARM RISCiX version. - Copyright (C) 1993, 1994, 1995, 1997, 1999, 2000 - Free Software Foundation, Inc. - Contributed by Richard Earnshaw (rwe11@cl.cam.ac.uk), based on original - work by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) - and Martin Simmons (@harleqn.co.uk). - -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. */ - -/* Translation to find startup files. On RISC iX boxes, - crt0, mcrt0 and gcrt0.o are in /usr/lib. */ -#define STARTFILE_SPEC "\ - %{pg:/usr/lib/gcrt0.o%s}\ - %{!pg:%{p:/usr/lib/mcrt0.o%s}\ - %{!p:/usr/lib/crt0.o%s}}" - -/* RISC iX has no concept of -lg */ -/* If -static is specified then link with -lc_n */ - -#ifndef LIB_SPEC -#define LIB_SPEC "\ - %{g*:-lg}\ - %{!p:%{!pg:%{!static:-lc}%{static:-lc_n}}}\ - %{p:-lc_p}\ - %{pg:-lc_p}" -#endif - -/* The RISC iX assembler never deletes any symbols from the object module; - and, by default, ld doesn't either. -X causes local symbols starting - with 'L' to be deleted, which is what we want. */ -#ifndef LINK_SPEC -#define LINK_SPEC "-X" -#endif - -#ifndef CPP_PREDEFINES -#define CPP_PREDEFINES \ - "-Darm -Driscix -Dunix -Asystem=unix" -#endif - - -/* RISCiX has some weird symbol name munging, that is done to the object module - after assembly, which enables multiple libraries to be supported within - one (possibly shared) library. It basically changes the symbol name of - certain symbols (for example _bcopy is converted to _$bcopy if using BSD) - Symrename's parameters are determined as follows: - -mno-symrename Don't run symrename - -mbsd symrename -BSD - -mxopen symrename -XOPEN - -ansi symrename - - symrename -BSD - */ - -#ifndef ASM_FINAL_SPEC -#if !defined (CROSS_COMPILE) -#define ASM_FINAL_SPEC "\ -%{!mno-symrename: \ - \n /usr/bin/symrename \ - -%{mbsd:%{pedantic:%e-mbsd and -pedantic incompatible}BSD}\ -%{mxopen:%{mbsd:%e-mbsd and -mxopen incompatible}\ -%{pedantic:%e-mxopen and -pedantic incompatible}XOPEN}\ -%{!mbsd:%{!mxopen:%{!ansi:BSD}}} %{c:%{o*:%*}%{!o*:%b.o}}%{!c:%U.o}}" -#endif -#endif - -/* None of these is actually used in cc1. If we don't define them in target - switches cc1 complains about them. For the sake of argument lets allocate - bit 31 of target flags for such options. */ -#define SUBTARGET_SWITCHES \ - {"bsd", 0x80000000, N_("Do symbol renaming for BSD")}, \ - {"xopen", 0x80000000, N_("Do symbol renaming for X/OPEN")}, \ - {"no-symrename", 0x80000000, N_("Don't do symbol renaming")}, - - -/* Run-time Target Specification. */ -#define TARGET_VERSION \ - fputs (" (ARM/RISCiX)", stderr); - -/* This is used in ASM_FILE_START */ -#define ARM_OS_NAME "RISCiX" - -/* Unsigned chars produces much better code than signed. */ -#define DEFAULT_SIGNED_CHAR 0 - -/* Some systems use __main in a way incompatible with its use in gcc, in these - cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to - give the same symbol without quotes for an alternative entry point. You - must define both, or neither. */ -#ifndef NAME__MAIN -#define NAME__MAIN "__gccmain" -#define SYMBOL__MAIN __gccmain -#endif - -/* size_t is "unsigned int" in RISCiX */ -#define SIZE_TYPE "unsigned int" - -/* ptrdiff_t is "int" in RISCiX */ -#define PTRDIFF_TYPE "int" - -/* Maths operation domain error number, EDOM */ -#define TARGET_EDOM 33 - -/* Override the normal default CPU */ -#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm2 - -/* r10 is reserved by RISCiX */ -#define SUBTARGET_CONDITIONAL_REGISTER_USAGE \ - fixed_regs[10] = 1; \ - call_used_regs[10] = 1; - -#include "arm/aout.h" - -/* The RISCiX assembler does not understand .set */ -#undef SET_ASM_OP - -/* Add to CPP_SPEC, we want to add the right #defines when using the include - files. */ -#define SUBTARGET_CPP_SPEC "\ - %{mbsd:%{pedantic:%e-mbsd and -pedantic incompatible} -D_BSD_C} \ - %{mxopen:%{mbsd:%e-mbsd and -mxopen incompatible} \ - %{pedantic:%e-mxopen and -pedantic incompatible} -D_XOPEN_C} \ - %{!mbsd:%{!mxopen:%{!ansi: -D_BSD_C}}}" - -/* The native RISCiX assembler does not support stabs of any kind; because - the native assembler is not used by the compiler, Acorn didn't feel it was - necessary to put them in! */ - -#ifdef DBX_DEBUGGING_INFO -#undef DBX_DEBUGGING_INFO -#endif diff --git a/contrib/gcc/config/arm/riscix1-1.h b/contrib/gcc/config/arm/riscix1-1.h deleted file mode 100644 index fd93d40f05ea..000000000000 --- a/contrib/gcc/config/arm/riscix1-1.h +++ /dev/null @@ -1,103 +0,0 @@ -/* Definitions of target machine for GNU compiler. ARM RISCiX 1.1x version. - Copyright (C) 1993, 1995, 1997, 1999 Free Software Foundation, Inc. - Contributed by Richard Earnshaw (rwe11@cl.cam.ac.uk), based on original - work by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) - and Martin Simmons (@harleqn.co.uk). - -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. */ - -/* RISCiX 1.1x is basically the same as 1.2x except that it doesn't have - symrename or atexit. */ - -/* Translation to find startup files. On RISCiX boxes, gcrt0.o is in - /usr/lib. */ -#define STARTFILE_SPEC \ - "%{pg:/usr/lib/gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}" - -#ifndef CPP_PREDEFINES -#define CPP_PREDEFINES "-Darm -Driscix -Dunix -Asystem=unix" -#endif - -/* Riscix 1.1 doesn't have X/OPEN support, so only accept -mbsd (but ignore - it). - By not having -mxopen and -mno-symrename, we get warning messages, - but everything still compiles. */ -/* None of these is actually used in cc1, so they modify bit 31 */ -#define SUBTARGET_SWITCHES \ -{"bsd", 0x80000000, ""}, - - -/* Run-time Target Specification. */ -#define TARGET_VERSION \ - fputs (" (ARM/RISCiX)", stderr); - -/* This is used in ASM_FILE_START */ -#define ARM_OS_NAME "RISCiX" - -#ifdef riscos -#define TARGET_WHEN_DEBUGGING 3 -#else -#define TARGET_WHEN_DEBUGGING 1 -#endif - -/* 'char' is signed by default on RISCiX, unsigned on RISCOS. */ -#ifdef riscos -#define DEFAULT_SIGNED_CHAR 0 -#else -#define DEFAULT_SIGNED_CHAR 1 -#endif - -/* Define this if the target system lacks the function atexit from the - ANSI C standard. If this is defined, and ON_EXIT is not - defined, a default exit function will be provided to support C++. - The man page only describes on_exit, but atexit is also there. - This seems to be missing in early versions. - - FIXME Should we define ON_EXIT here? */ -#define NEED_ATEXIT - -/* Some systems use __main in a way incompatible with its use in gcc, in these - cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to - give the same symbol without quotes for an alternative entry point. You - must define both, or neither. */ -#ifndef NAME__MAIN -#define NAME__MAIN "__gccmain" -#define SYMBOL__MAIN __gccmain -#endif - -/* Override the normal default CPU */ -#define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm2 - -/* r10 is reserved by RISCiX */ -#define SUBTARGET_CONDITIONAL_REGISTER_USAGE \ - fixed_regs[10] = 1; \ - call_used_regs[10] = 1; - - -#include "arm/aout.h" - -#define SUBTARGET_CPP_SPEC "%{!ansi: -D_BSD_C}" - - -/* The native RISCiX assembler does not support stabs of any kind; because - the native assembler is not used by the compiler, Acorn didn't feel it was - necessary to put them in! */ - -#ifdef DBX_DEBUGGING_INFO -#undef DBX_DEBUGGING_INFO -#endif diff --git a/contrib/gcc/config/arm/rix-gas.h b/contrib/gcc/config/arm/rix-gas.h deleted file mode 100644 index cfb5312f3b6c..000000000000 --- a/contrib/gcc/config/arm/rix-gas.h +++ /dev/null @@ -1,42 +0,0 @@ -/* Definitions of target machine for GNU compiler. ARM RISCiX(stabs) version. - Copyright (C) 1993 Free Software Foundation, Inc. - Contributed by Richard Earnshaw (rwe11@cl.cam.ac.uk), based on original - work by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) - and Martin Simmons (@harleqn.co.uk). - -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. */ - -/* Limit the length of a stabs entry (for the broken Acorn assembler) */ -#undef DBX_CONTIN_LENGTH -#define DBX_CONTIN_LENGTH 80 - -/* The native RISCiX assembler does not support stabs of any kind; because - the native assembler is not used by the compiler, Acorn didn't feel it was - necessary to put them in! - However, this file assumes that we have an assembler that does have stabs, - so we put them back in. */ - -#define DBX_DEBUGGING_INFO - -/* Unfortunately dbx doesn't understand these */ -/* Dbx on RISCiX is so broken that I've given up trying to support it. - lets just support gdb. */ -/* #define DEFAULT_GDB_EXTENSIONS 0 */ -/* RISCiX dbx doesn't accept xrefs */ -/* #define DBX_NO_XREFS 1 */ - diff --git a/contrib/gcc/config/arm/t-riscix b/contrib/gcc/config/arm/t-riscix deleted file mode 100644 index 0d38cb0bb551..000000000000 --- a/contrib/gcc/config/arm/t-riscix +++ /dev/null @@ -1,6 +0,0 @@ -# Just for these, we omit the frame pointer since it makes such a big -# difference. It is then pointless adding debugging. -TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -LIBGCC2_DEBUG_CFLAGS = -g0 - -FIXPROTO_DEFINES= -D_POSIX_SOURCE -D_XOPEN_C -D_BSD_C -D_XOPEN_SOURCE diff --git a/contrib/gcc/config/float-c4x.h b/contrib/gcc/config/float-c4x.h deleted file mode 100644 index ba621766a699..000000000000 --- a/contrib/gcc/config/float-c4x.h +++ /dev/null @@ -1,96 +0,0 @@ -/* float.h for target with TMS320C3x/C4x floating point format */ -#ifndef _FLOAT_H_ -#define _FLOAT_H_ -/* Produced by enquire version 4.3, CWI, Amsterdam */ - - /* Radix of exponent representation */ -#undef FLT_RADIX -#define FLT_RADIX 2 - /* Number of base-FLT_RADIX digits in the significand of a float */ -#undef FLT_MANT_DIG -#define FLT_MANT_DIG 24 - /* Number of decimal digits of precision in a float */ -#undef FLT_DIG -#define FLT_DIG 6 - /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */ -#undef FLT_ROUNDS -#define FLT_ROUNDS 1 - /* Difference between 1.0 and the minimum float greater than 1.0 */ -#undef FLT_EPSILON -#define FLT_EPSILON 1.19209290e-07F - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */ -#undef FLT_MIN_EXP -#define FLT_MIN_EXP (-126) - /* Minimum normalised float */ -#undef FLT_MIN -#define FLT_MIN 5.8774718E-39F - /* Minimum int x such that 10**x is a normalised float */ -#undef FLT_MIN_10_EXP -#define FLT_MIN_10_EXP (-39) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */ -#undef FLT_MAX_EXP -#define FLT_MAX_EXP 128 - /* Maximum float */ -#undef FLT_MAX -#define FLT_MAX 3.4028235e+38F - /* Maximum int x such that 10**x is a representable float */ -#undef FLT_MAX_10_EXP -#define FLT_MAX_10_EXP 38 - - /* Number of base-FLT_RADIX digits in the significand of a double */ -#undef DBL_MANT_DIG -#define DBL_MANT_DIG 24 - /* Number of decimal digits of precision in a double */ -#undef DBL_DIG -#define DBL_DIG 6 - /* Difference between 1.0 and the minimum double greater than 1.0 */ -#undef DBL_EPSILON -#define DBL_EPSILON 1.1920929e-07 - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */ -#undef DBL_MIN_EXP -#define DBL_MIN_EXP (-126) - /* Minimum normalised double */ -#undef DBL_MIN -#define DBL_MIN 5.8774718E-39 - /* Minimum int x such that 10**x is a normalised double */ -#undef DBL_MIN_10_EXP -#define DBL_MIN_10_EXP -39 - /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */ -#undef DBL_MAX_EXP -#define DBL_MAX_EXP 128 - /* Maximum double */ -#undef DBL_MAX -#define DBL_MAX 3.4028235E+38 - /* Maximum int x such that 10**x is a representable double */ -#undef DBL_MAX_10_EXP -#define DBL_MAX_10_EXP 38 - - /* Number of base-FLT_RADIX digits in the significand of a long double */ -#undef LDBL_MANT_DIG -#define LDBL_MANT_DIG 32 - /* Number of decimal digits of precision in a long double */ -#undef LDBL_DIG -#define LDBL_DIG 8 - /* Difference between 1.0 and the minimum long double greater than 1.0 */ -#undef LDBL_EPSILON -#define LDBL_EPSILON 1.19209287e-07L - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */ -#undef LDBL_MIN_EXP -#define LDBL_MIN_EXP (-126) - /* Minimum normalised long double */ -#undef LDBL_MIN -#define LDBL_MIN 5.8774717535e-39L - /* Minimum int x such that 10**x is a normalised long double */ -#undef LDBL_MIN_10_EXP -#define LDBL_MIN_10_EXP (-39) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */ -#undef LDBL_MAX_EXP -#define LDBL_MAX_EXP 128 - /* Maximum long double */ -#undef LDBL_MAX -#define LDBL_MAX .4028236688e+38L - /* Maximum int x such that 10**x is a representable long double */ -#undef LDBL_MAX_10_EXP -#define LDBL_MAX_10_EXP 38 - -#endif /* _FLOAT_H_ */ diff --git a/contrib/gcc/config/float-i128.h b/contrib/gcc/config/float-i128.h deleted file mode 100644 index c61c82f18ac5..000000000000 --- a/contrib/gcc/config/float-i128.h +++ /dev/null @@ -1,123 +0,0 @@ -/* float.h for target with IEEE 32, 64 and 128 bit floating point formats */ -#ifndef _FLOAT_H_ -#define _FLOAT_H_ -/* Produced by enquire version 4.3, CWI, Amsterdam */ - - /* Radix of exponent representation */ -#undef FLT_RADIX -#define FLT_RADIX 2 - /* Number of base-FLT_RADIX digits in the significand of a float */ -#undef FLT_MANT_DIG -#define FLT_MANT_DIG 24 - /* Number of decimal digits of precision in a float */ -#undef FLT_DIG -#define FLT_DIG 6 - /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */ -#undef FLT_ROUNDS -#define FLT_ROUNDS 1 - /* Difference between 1.0 and the minimum float greater than 1.0 */ -#undef FLT_EPSILON -#define FLT_EPSILON 1.19209290e-07F - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */ -#undef FLT_MIN_EXP -#define FLT_MIN_EXP (-125) - /* Minimum normalised float */ -#undef FLT_MIN -#define FLT_MIN 1.17549435e-38F - /* Minimum int x such that 10**x is a normalised float */ -#undef FLT_MIN_10_EXP -#define FLT_MIN_10_EXP (-37) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */ -#undef FLT_MAX_EXP -#define FLT_MAX_EXP 128 - /* Maximum float */ -#undef FLT_MAX -#define FLT_MAX 3.40282347e+38F - /* Maximum int x such that 10**x is a representable float */ -#undef FLT_MAX_10_EXP -#define FLT_MAX_10_EXP 38 - - /* Number of base-FLT_RADIX digits in the significand of a double */ -#undef DBL_MANT_DIG -#define DBL_MANT_DIG 53 - /* Number of decimal digits of precision in a double */ -#undef DBL_DIG -#define DBL_DIG 15 - /* Difference between 1.0 and the minimum double greater than 1.0 */ -#undef DBL_EPSILON -#define DBL_EPSILON 2.2204460492503131e-16 - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */ -#undef DBL_MIN_EXP -#define DBL_MIN_EXP (-1021) - /* Minimum normalised double */ -#undef DBL_MIN -#define DBL_MIN 2.2250738585072014e-308 - /* Minimum int x such that 10**x is a normalised double */ -#undef DBL_MIN_10_EXP -#define DBL_MIN_10_EXP (-307) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */ -#undef DBL_MAX_EXP -#define DBL_MAX_EXP 1024 - /* Maximum double */ -#undef DBL_MAX -#define DBL_MAX 1.7976931348623157e+308 - /* Maximum int x such that 10**x is a representable double */ -#undef DBL_MAX_10_EXP -#define DBL_MAX_10_EXP 308 - - /* Number of base-FLT_RADIX digits in the significand of a long double */ -#undef LDBL_MANT_DIG -#define LDBL_MANT_DIG 113 - /* Number of decimal digits of precision in a long double */ -#undef LDBL_DIG -#define LDBL_DIG 33 - /* Difference between 1.0 and the minimum long double greater than 1.0 */ -#undef LDBL_EPSILON -#define LDBL_EPSILON 1.925929944387235853055977942584927319E-34L - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */ -#undef LDBL_MIN_EXP -#define LDBL_MIN_EXP (-16381) - /* Minimum normalised long double */ -#undef LDBL_MIN -#define LDBL_MIN 3.362103143112093506262677817321752603E-4932L - /* Minimum int x such that 10**x is a normalised long double */ -#undef LDBL_MIN_10_EXP -#define LDBL_MIN_10_EXP (-4931) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */ -#undef LDBL_MAX_EXP -#define LDBL_MAX_EXP 16384 - /* Maximum long double */ -#undef LDBL_MAX -#define LDBL_MAX 1.189731495357231765085759326628007016E+4932L - /* Maximum int x such that 10**x is a representable long double */ -#undef LDBL_MAX_10_EXP -#define LDBL_MAX_10_EXP 4932 - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - /* The floating-point expression evaluation method. - -1 indeterminate - 0 evaluate all operations and constants just to the range and - precision of the type - 1 evaluate operations and constants of type float and double - to the range and precision of the double type, evaluate - long double operations and constants to the range and - precision of the long double type - 2 evaluate all operations and constants to the range and - precision of the long double type - */ -# undef FLT_EVAL_METHOD -# define FLT_EVAL_METHOD 0 - - /* Number of decimal digits to enable rounding to the given number of - decimal digits without loss of precision. - if FLT_RADIX == 10^n: #mantissa * log10 (FLT_RADIX) - else : ceil (1 + #mantissa * log10 (FLT_RADIX)) - where #mantissa is the number of bits in the mantissa of the widest - supported floating-point type. - */ -# undef DECIMAL_DIG -# define DECIMAL_DIG 36 - -#endif /* C99 */ - -#endif /* _FLOAT_H_ */ diff --git a/contrib/gcc/config/float-i32.h b/contrib/gcc/config/float-i32.h deleted file mode 100644 index 3e633d8f38d9..000000000000 --- a/contrib/gcc/config/float-i32.h +++ /dev/null @@ -1,123 +0,0 @@ -/* float.h for target with only IEEE 32 bit floating point format */ -#ifndef _FLOAT_H_ -#define _FLOAT_H_ -/* Produced by enquire version 4.3, CWI, Amsterdam */ - - /* Radix of exponent representation */ -#undef FLT_RADIX -#define FLT_RADIX 2 - /* Number of base-FLT_RADIX digits in the significand of a float */ -#undef FLT_MANT_DIG -#define FLT_MANT_DIG 24 - /* Number of decimal digits of precision in a float */ -#undef FLT_DIG -#define FLT_DIG 6 - /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */ -#undef FLT_ROUNDS -#define FLT_ROUNDS 1 - /* Difference between 1.0 and the minimum float greater than 1.0 */ -#undef FLT_EPSILON -#define FLT_EPSILON 1.19209290e-07F - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */ -#undef FLT_MIN_EXP -#define FLT_MIN_EXP (-125) - /* Minimum normalised float */ -#undef FLT_MIN -#define FLT_MIN 1.17549435e-38F - /* Minimum int x such that 10**x is a normalised float */ -#undef FLT_MIN_10_EXP -#define FLT_MIN_10_EXP (-37) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */ -#undef FLT_MAX_EXP -#define FLT_MAX_EXP 128 - /* Maximum float */ -#undef FLT_MAX -#define FLT_MAX 3.40282347e+38F - /* Maximum int x such that 10**x is a representable float */ -#undef FLT_MAX_10_EXP -#define FLT_MAX_10_EXP 38 - - /* Number of base-FLT_RADIX digits in the significand of a double */ -#undef DBL_MANT_DIG -#define DBL_MANT_DIG 24 - /* Number of decimal digits of precision in a double */ -#undef DBL_DIG -#define DBL_DIG 6 - /* Difference between 1.0 and the minimum double greater than 1.0 */ -#undef DBL_EPSILON -#define DBL_EPSILON 1.19209290e-07F - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */ -#undef DBL_MIN_EXP -#define DBL_MIN_EXP (-125) - /* Minimum normalised double */ -#undef DBL_MIN -#define DBL_MIN 1.17549435e-38F - /* Minimum int x such that 10**x is a normalised double */ -#undef DBL_MIN_10_EXP -#define DBL_MIN_10_EXP (-37) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */ -#undef DBL_MAX_EXP -#define DBL_MAX_EXP 128 - /* Maximum double */ -#undef DBL_MAX -#define DBL_MAX 3.40282347e+38F - /* Maximum int x such that 10**x is a representable double */ -#undef DBL_MAX_10_EXP -#define DBL_MAX_10_EXP 38 - - /* Number of base-FLT_RADIX digits in the significand of a long double */ -#undef LDBL_MANT_DIG -#define LDBL_MANT_DIG 24 - /* Number of decimal digits of precision in a long double */ -#undef LDBL_DIG -#define LDBL_DIG 6 - /* Difference between 1.0 and the minimum long double greater than 1.0 */ -#undef LDBL_EPSILON -#define LDBL_EPSILON 1.19209290e-07F - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */ -#undef LDBL_MIN_EXP -#define LDBL_MIN_EXP (-125) - /* Minimum normalised long double */ -#undef LDBL_MIN -#define LDBL_MIN 1.17549435e-38F - /* Minimum int x such that 10**x is a normalised long double */ -#undef LDBL_MIN_10_EXP -#define LDBL_MIN_10_EXP (-37) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */ -#undef LDBL_MAX_EXP -#define LDBL_MAX_EXP 128 - /* Maximum long double */ -#undef LDBL_MAX -#define LDBL_MAX 3.40282347e+38F - /* Maximum int x such that 10**x is a representable long double */ -#undef LDBL_MAX_10_EXP -#define LDBL_MAX_10_EXP 38 - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - /* The floating-point expression evaluation method. - -1 indeterminate - 0 evaluate all operations and constants just to the range and - precision of the type - 1 evaluate operations and constants of type float and double - to the range and precision of the double type, evaluate - long double operations and constants to the range and - precision of the long double type - 2 evaluate all operations and constants to the range and - precision of the long double type - */ -# undef FLT_EVAL_METHOD -# define FLT_EVAL_METHOD 0 - - /* Number of decimal digits to enable rounding to the given number of - decimal digits without loss of precision. - if FLT_RADIX == 10^n: #mantissa * log10 (FLT_RADIX) - else : ceil (1 + #mantissa * log10 (FLT_RADIX)) - where #mantissa is the number of bits in the mantissa of the widest - supported floating-point type. - */ -# undef DECIMAL_DIG -# define DECIMAL_DIG 9 - -#endif /* C99 */ - -#endif /* _FLOAT_H_ */ diff --git a/contrib/gcc/config/float-i386.h b/contrib/gcc/config/float-i386.h deleted file mode 100644 index 6abb4f2b7b2b..000000000000 --- a/contrib/gcc/config/float-i386.h +++ /dev/null @@ -1,124 +0,0 @@ -/* float.h for target with IEEE 32/64 bit and Intel 386 style 80 bit - floating point formats */ -#ifndef _FLOAT_H_ -#define _FLOAT_H_ -/* Produced by enquire version 4.3, CWI, Amsterdam */ - - /* Radix of exponent representation */ -#undef FLT_RADIX -#define FLT_RADIX 2 - /* Number of base-FLT_RADIX digits in the significand of a float */ -#undef FLT_MANT_DIG -#define FLT_MANT_DIG 24 - /* Number of decimal digits of precision in a float */ -#undef FLT_DIG -#define FLT_DIG 6 - /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */ -#undef FLT_ROUNDS -#define FLT_ROUNDS 1 - /* Difference between 1.0 and the minimum float greater than 1.0 */ -#undef FLT_EPSILON -#define FLT_EPSILON 1.19209290e-07F - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */ -#undef FLT_MIN_EXP -#define FLT_MIN_EXP (-125) - /* Minimum normalised float */ -#undef FLT_MIN -#define FLT_MIN 1.17549435e-38F - /* Minimum int x such that 10**x is a normalised float */ -#undef FLT_MIN_10_EXP -#define FLT_MIN_10_EXP (-37) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */ -#undef FLT_MAX_EXP -#define FLT_MAX_EXP 128 - /* Maximum float */ -#undef FLT_MAX -#define FLT_MAX 3.40282347e+38F - /* Maximum int x such that 10**x is a representable float */ -#undef FLT_MAX_10_EXP -#define FLT_MAX_10_EXP 38 - - /* Number of base-FLT_RADIX digits in the significand of a double */ -#undef DBL_MANT_DIG -#define DBL_MANT_DIG 53 - /* Number of decimal digits of precision in a double */ -#undef DBL_DIG -#define DBL_DIG 15 - /* Difference between 1.0 and the minimum double greater than 1.0 */ -#undef DBL_EPSILON -#define DBL_EPSILON 2.2204460492503131e-16 - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */ -#undef DBL_MIN_EXP -#define DBL_MIN_EXP (-1021) - /* Minimum normalised double */ -#undef DBL_MIN -#define DBL_MIN 2.2250738585072014e-308 - /* Minimum int x such that 10**x is a normalised double */ -#undef DBL_MIN_10_EXP -#define DBL_MIN_10_EXP (-307) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */ -#undef DBL_MAX_EXP -#define DBL_MAX_EXP 1024 - /* Maximum double */ -#undef DBL_MAX -#define DBL_MAX 1.7976931348623157e+308 - /* Maximum int x such that 10**x is a representable double */ -#undef DBL_MAX_10_EXP -#define DBL_MAX_10_EXP 308 - - /* Number of base-FLT_RADIX digits in the significand of a long double */ -#undef LDBL_MANT_DIG -#define LDBL_MANT_DIG 64 - /* Number of decimal digits of precision in a long double */ -#undef LDBL_DIG -#define LDBL_DIG 18 - /* Difference between 1.0 and the minimum long double greater than 1.0 */ -#undef LDBL_EPSILON -#define LDBL_EPSILON 1.08420217248550443401e-19L - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */ -#undef LDBL_MIN_EXP -#define LDBL_MIN_EXP (-16381) - /* Minimum normalised long double */ -#undef LDBL_MIN -#define LDBL_MIN 3.36210314311209350626e-4932L - /* Minimum int x such that 10**x is a normalised long double */ -#undef LDBL_MIN_10_EXP -#define LDBL_MIN_10_EXP (-4931) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */ -#undef LDBL_MAX_EXP -#define LDBL_MAX_EXP 16384 - /* Maximum long double */ -#undef LDBL_MAX -#define LDBL_MAX 1.18973149535723176502e+4932L - /* Maximum int x such that 10**x is a representable long double */ -#undef LDBL_MAX_10_EXP -#define LDBL_MAX_10_EXP 4932 - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - /* The floating-point expression evaluation method. - -1 indeterminate - 0 evaluate all operations and constants just to the range and - precision of the type - 1 evaluate operations and constants of type float and double - to the range and precision of the double type, evaluate - long double operations and constants to the range and - precision of the long double type - 2 evaluate all operations and constants to the range and - precision of the long double type - */ -# undef FLT_EVAL_METHOD -# define FLT_EVAL_METHOD 2 - - /* Number of decimal digits to enable rounding to the given number of - decimal digits without loss of precision. - if FLT_RADIX == 10^n: #mantissa * log10 (FLT_RADIX) - else : ceil (1 + #mantissa * log10 (FLT_RADIX)) - where #mantissa is the number of bits in the mantissa of the widest - supported floating-point type. - */ -# undef DECIMAL_DIG -# define DECIMAL_DIG 21 - -#endif /* C99 */ - -#endif /* _FLOAT_H___ */ diff --git a/contrib/gcc/config/float-i64.h b/contrib/gcc/config/float-i64.h deleted file mode 100644 index 735f74236350..000000000000 --- a/contrib/gcc/config/float-i64.h +++ /dev/null @@ -1,123 +0,0 @@ -/* float.h for target with IEEE 32 bit and 64 bit floating point formats */ -#ifndef _FLOAT_H_ -#define _FLOAT_H_ -/* Produced by enquire version 4.3, CWI, Amsterdam */ - - /* Radix of exponent representation */ -#undef FLT_RADIX -#define FLT_RADIX 2 - /* Number of base-FLT_RADIX digits in the significand of a float */ -#undef FLT_MANT_DIG -#define FLT_MANT_DIG 24 - /* Number of decimal digits of precision in a float */ -#undef FLT_DIG -#define FLT_DIG 6 - /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */ -#undef FLT_ROUNDS -#define FLT_ROUNDS 1 - /* Difference between 1.0 and the minimum float greater than 1.0 */ -#undef FLT_EPSILON -#define FLT_EPSILON 1.19209290e-07F - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */ -#undef FLT_MIN_EXP -#define FLT_MIN_EXP (-125) - /* Minimum normalised float */ -#undef FLT_MIN -#define FLT_MIN 1.17549435e-38F - /* Minimum int x such that 10**x is a normalised float */ -#undef FLT_MIN_10_EXP -#define FLT_MIN_10_EXP (-37) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */ -#undef FLT_MAX_EXP -#define FLT_MAX_EXP 128 - /* Maximum float */ -#undef FLT_MAX -#define FLT_MAX 3.40282347e+38F - /* Maximum int x such that 10**x is a representable float */ -#undef FLT_MAX_10_EXP -#define FLT_MAX_10_EXP 38 - - /* Number of base-FLT_RADIX digits in the significand of a double */ -#undef DBL_MANT_DIG -#define DBL_MANT_DIG 53 - /* Number of decimal digits of precision in a double */ -#undef DBL_DIG -#define DBL_DIG 15 - /* Difference between 1.0 and the minimum double greater than 1.0 */ -#undef DBL_EPSILON -#define DBL_EPSILON 2.2204460492503131e-16 - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */ -#undef DBL_MIN_EXP -#define DBL_MIN_EXP (-1021) - /* Minimum normalised double */ -#undef DBL_MIN -#define DBL_MIN 2.2250738585072014e-308 - /* Minimum int x such that 10**x is a normalised double */ -#undef DBL_MIN_10_EXP -#define DBL_MIN_10_EXP (-307) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */ -#undef DBL_MAX_EXP -#define DBL_MAX_EXP 1024 - /* Maximum double */ -#undef DBL_MAX -#define DBL_MAX 1.7976931348623157e+308 - /* Maximum int x such that 10**x is a representable double */ -#undef DBL_MAX_10_EXP -#define DBL_MAX_10_EXP 308 - - /* Number of base-FLT_RADIX digits in the significand of a long double */ -#undef LDBL_MANT_DIG -#define LDBL_MANT_DIG 53 - /* Number of decimal digits of precision in a long double */ -#undef LDBL_DIG -#define LDBL_DIG 15 - /* Difference between 1.0 and the minimum long double greater than 1.0 */ -#undef LDBL_EPSILON -#define LDBL_EPSILON 2.2204460492503131e-16L - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */ -#undef LDBL_MIN_EXP -#define LDBL_MIN_EXP (-1021) - /* Minimum normalised long double */ -#undef LDBL_MIN -#define LDBL_MIN 2.2250738585072014e-308L - /* Minimum int x such that 10**x is a normalised long double */ -#undef LDBL_MIN_10_EXP -#define LDBL_MIN_10_EXP (-307) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */ -#undef LDBL_MAX_EXP -#define LDBL_MAX_EXP 1024 - /* Maximum long double */ -#undef LDBL_MAX -#define LDBL_MAX 1.7976931348623157e+308L - /* Maximum int x such that 10**x is a representable long double */ -#undef LDBL_MAX_10_EXP -#define LDBL_MAX_10_EXP 308 - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - /* The floating-point expression evaluation method. - -1 indeterminate - 0 evaluate all operations and constants just to the range and - precision of the type - 1 evaluate operations and constants of type float and double - to the range and precision of the double type, evaluate - long double operations and constants to the range and - precision of the long double type - 2 evaluate all operations and constants to the range and - precision of the long double type - */ -# undef FLT_EVAL_METHOD -# define FLT_EVAL_METHOD 0 - - /* Number of decimal digits to enable rounding to the given number of - decimal digits without loss of precision. - if FLT_RADIX == 10^n: #mantissa * log10 (FLT_RADIX) - else : ceil (1 + #mantissa * log10 (FLT_RADIX)) - where #mantissa is the number of bits in the mantissa of the widest - supported floating-point type. - */ -# undef DECIMAL_DIG -# define DECIMAL_DIG 17 - -#endif /* C99 */ - -#endif /* _FLOAT_H_ */ diff --git a/contrib/gcc/config/float-m68k.h b/contrib/gcc/config/float-m68k.h deleted file mode 100644 index 837126b7de56..000000000000 --- a/contrib/gcc/config/float-m68k.h +++ /dev/null @@ -1,127 +0,0 @@ -/* float.h for target with IEEE 32 bit and 64 bit and Motorola style 96 bit - floating point formats */ -#ifndef _FLOAT_H_ -#define _FLOAT_H_ -/* Produced by enquire version 4.3, CWI, Amsterdam */ - - /* Radix of exponent representation */ -#undef FLT_RADIX -#define FLT_RADIX 2 - /* Number of base-FLT_RADIX digits in the significand of a float */ -#undef FLT_MANT_DIG -#define FLT_MANT_DIG 24 - /* Number of decimal digits of precision in a float */ -#undef FLT_DIG -#define FLT_DIG 6 - /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */ -#undef FLT_ROUNDS -#define FLT_ROUNDS 1 - /* Difference between 1.0 and the minimum float greater than 1.0 */ -#undef FLT_EPSILON -#define FLT_EPSILON 1.19209290e-07F - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */ -#undef FLT_MIN_EXP -#define FLT_MIN_EXP (-125) - /* Minimum normalised float */ -#undef FLT_MIN -#define FLT_MIN 1.17549435e-38F - /* Minimum int x such that 10**x is a normalised float */ -#undef FLT_MIN_10_EXP -#define FLT_MIN_10_EXP (-37) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */ -#undef FLT_MAX_EXP -#define FLT_MAX_EXP 128 - /* Maximum float */ -#undef FLT_MAX -#define FLT_MAX 3.40282347e+38F - /* Maximum int x such that 10**x is a representable float */ -#undef FLT_MAX_10_EXP -#define FLT_MAX_10_EXP 38 - - /* Number of base-FLT_RADIX digits in the significand of a double */ -#undef DBL_MANT_DIG -#define DBL_MANT_DIG 53 - /* Number of decimal digits of precision in a double */ -#undef DBL_DIG -#define DBL_DIG 15 - /* Difference between 1.0 and the minimum double greater than 1.0 */ -#undef DBL_EPSILON -#define DBL_EPSILON 2.2204460492503131e-16 - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */ -#undef DBL_MIN_EXP -#define DBL_MIN_EXP (-1021) - /* Minimum normalised double */ -#undef DBL_MIN -#define DBL_MIN 2.2250738585072014e-308 - /* Minimum int x such that 10**x is a normalised double */ -#undef DBL_MIN_10_EXP -#define DBL_MIN_10_EXP (-307) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */ -#undef DBL_MAX_EXP -#define DBL_MAX_EXP 1024 - /* Maximum double */ -#undef DBL_MAX -#define DBL_MAX 1.7976931348623157e+308 - /* Maximum int x such that 10**x is a representable double */ -#undef DBL_MAX_10_EXP -#define DBL_MAX_10_EXP 308 - - /* Number of base-FLT_RADIX digits in the significand of a long double */ -#undef LDBL_MANT_DIG -#define LDBL_MANT_DIG 64 - /* Number of decimal digits of precision in a long double */ -#undef LDBL_DIG -#define LDBL_DIG 18 - /* Difference between 1.0 and the minimum long double greater than 1.0 */ -#undef LDBL_EPSILON -#define LDBL_EPSILON 1.08420217248550443401e-19L - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */ -#undef LDBL_MIN_EXP -#define LDBL_MIN_EXP (-16382) - /* Minimum normalised long double */ -#undef LDBL_MIN -#define LDBL_MIN 1.68105157155604675313e-4932L - /* Minimum int x such that 10**x is a normalised long double */ -#undef LDBL_MIN_10_EXP -#define LDBL_MIN_10_EXP (-4931) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */ -#undef LDBL_MAX_EXP -#define LDBL_MAX_EXP 16384 - /* Maximum long double */ -#undef LDBL_MAX -#define LDBL_MAX 1.18973149535723176502e+4932L - /* Maximum int x such that 10**x is a representable long double */ -#undef LDBL_MAX_10_EXP -#define LDBL_MAX_10_EXP 4932 - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - /* The floating-point expression evaluation method. - -1 indeterminate - 0 evaluate all operations and constants just to the range and - precision of the type - 1 evaluate operations and constants of type float and double - to the range and precision of the double type, evaluate - long double operations and constants to the range and - precision of the long double type - 2 evaluate all operations and constants to the range and - precision of the long double type - */ - -/* ??? FLT_EVAL_METHOD depends on TARGET_68040_ONLY. We do not currently - have a preprocessor token that we can use to tell that this is on. */ -# undef FLT_EVAL_METHOD -# define FLT_EVAL_METHOD -1 - - /* Number of decimal digits to enable rounding to the given number of - decimal digits without loss of precision. - if FLT_RADIX == 10^n: #mantissa * log10 (FLT_RADIX) - else : ceil (1 + #mantissa * log10 (FLT_RADIX)) - where #mantissa is the number of bits in the mantissa of the widest - supported floating-point type. - */ -# undef DECIMAL_DIG -# define DECIMAL_DIG 21 - -#endif /* C99 */ - -#endif /* _FLOAT_H_ */ diff --git a/contrib/gcc/config/float-sh.h b/contrib/gcc/config/float-sh.h deleted file mode 100644 index 598994b5376c..000000000000 --- a/contrib/gcc/config/float-sh.h +++ /dev/null @@ -1,160 +0,0 @@ -/* float.h for target sh3e with optional IEEE 32 bit double format */ -#ifndef _FLOAT_H_ -#define _FLOAT_H_ -/* Produced by enquire version 4.3, CWI, Amsterdam */ - - /* Radix of exponent representation */ -#undef FLT_RADIX -#define FLT_RADIX 2 - /* Number of base-FLT_RADIX digits in the significand of a float */ -#undef FLT_MANT_DIG -#define FLT_MANT_DIG 24 - /* Number of decimal digits of precision in a float */ -#undef FLT_DIG -#define FLT_DIG 6 - /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */ -#undef FLT_ROUNDS -#define FLT_ROUNDS 1 - /* Difference between 1.0 and the minimum float greater than 1.0 */ -#undef FLT_EPSILON -#define FLT_EPSILON 1.19209290e-07F - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */ -#undef FLT_MIN_EXP -#define FLT_MIN_EXP (-125) - /* Minimum normalised float */ -#undef FLT_MIN -#define FLT_MIN 1.17549435e-38F - /* Minimum int x such that 10**x is a normalised float */ -#undef FLT_MIN_10_EXP -#define FLT_MIN_10_EXP (-37) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */ -#undef FLT_MAX_EXP -#define FLT_MAX_EXP 128 - /* Maximum float */ -#undef FLT_MAX -#define FLT_MAX 3.40282347e+38F - /* Maximum int x such that 10**x is a representable float */ -#undef FLT_MAX_10_EXP -#define FLT_MAX_10_EXP 38 - -#if defined (__SH3E__) || defined (__SH4_SINGLE_ONLY__) - - /* Number of base-FLT_RADIX digits in the significand of a double */ -#undef DBL_MANT_DIG -#define DBL_MANT_DIG 24 - /* Number of decimal digits of precision in a double */ -#undef DBL_DIG -#define DBL_DIG 6 - /* Difference between 1.0 and the minimum double greater than 1.0 */ -#undef DBL_EPSILON -#define DBL_EPSILON 1.19209290e-07F - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */ -#undef DBL_MIN_EXP -#define DBL_MIN_EXP (-125) - /* Minimum normalised double */ -#undef DBL_MIN -#define DBL_MIN 1.17549435e-38F - /* Minimum int x such that 10**x is a normalised double */ -#undef DBL_MIN_10_EXP -#define DBL_MIN_10_EXP (-37) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */ -#undef DBL_MAX_EXP -#define DBL_MAX_EXP 128 - /* Maximum double */ -#undef DBL_MAX -#define DBL_MAX 3.40282347e+38F - /* Maximum int x such that 10**x is a representable double */ -#undef DBL_MAX_10_EXP -#define DBL_MAX_10_EXP 38 - -#else - - /* Number of base-FLT_RADIX digits in the significand of a double */ -#undef DBL_MANT_DIG -#define DBL_MANT_DIG 53 - /* Number of decimal digits of precision in a double */ -#undef DBL_DIG -#define DBL_DIG 15 - /* Difference between 1.0 and the minimum double greater than 1.0 */ -#undef DBL_EPSILON -#define DBL_EPSILON 2.2204460492503131e-16 - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */ -#undef DBL_MIN_EXP -#define DBL_MIN_EXP (-1021) - /* Minimum normalised double */ -#undef DBL_MIN -#define DBL_MIN 2.2250738585072014e-308 - /* Minimum int x such that 10**x is a normalised double */ -#undef DBL_MIN_10_EXP -#define DBL_MIN_10_EXP (-307) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */ -#undef DBL_MAX_EXP -#define DBL_MAX_EXP 1024 - /* Maximum double */ -#undef DBL_MAX -#define DBL_MAX 1.7976931348623157e+308 - /* Maximum int x such that 10**x is a representable double */ -#undef DBL_MAX_10_EXP -#define DBL_MAX_10_EXP 308 - -#endif - -/* Because -m3e and -m4-single-only have 32-bit doubles, we append L - to the doubles below, so that they're not truncated. */ - - /* Number of base-FLT_RADIX digits in the significand of a long double */ -#undef LDBL_MANT_DIG -#define LDBL_MANT_DIG 53 - /* Number of decimal digits of precision in a long double */ -#undef LDBL_DIG -#define LDBL_DIG 15 - /* Difference between 1.0 and the minimum long double greater than 1.0 */ -#undef LDBL_EPSILON -#define LDBL_EPSILON 2.2204460492503131e-16L - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */ -#undef LDBL_MIN_EXP -#define LDBL_MIN_EXP (-1021) - /* Minimum normalised long double */ -#undef LDBL_MIN -#define LDBL_MIN 2.2250738585072014e-308L - /* Minimum int x such that 10**x is a normalised long double */ -#undef LDBL_MIN_10_EXP -#define LDBL_MIN_10_EXP (-307) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */ -#undef LDBL_MAX_EXP -#define LDBL_MAX_EXP 1024 - /* Maximum long double */ -#undef LDBL_MAX -#define LDBL_MAX 1.7976931348623157e+308L - /* Maximum int x such that 10**x is a representable long double */ -#undef LDBL_MAX_10_EXP -#define LDBL_MAX_10_EXP 308 - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - /* The floating-point expression evaluation method. - -1 indeterminate - 0 evaluate all operations and constants just to the range and - precision of the type - 1 evaluate operations and constants of type float and double - to the range and precision of the double type, evaluate - long double operations and constants to the range and - precision of the long double type - 2 evaluate all operations and constants to the range and - precision of the long double type - */ -# undef FLT_EVAL_METHOD -# define FLT_EVAL_METHOD 0 - - /* Number of decimal digits to enable rounding to the given number of - decimal digits without loss of precision. - if FLT_RADIX == 10^n: #mantissa * log10 (FLT_RADIX) - else : ceil (1 + #mantissa * log10 (FLT_RADIX)) - where #mantissa is the number of bits in the mantissa of the widest - supported floating-point type. - */ -# undef DECIMAL_DIG -# define DECIMAL_DIG 17 - -#endif /* C99 */ - -#endif /* _FLOAT_H_ */ diff --git a/contrib/gcc/config/float-sparc.h b/contrib/gcc/config/float-sparc.h deleted file mode 100644 index 84250e520a6b..000000000000 --- a/contrib/gcc/config/float-sparc.h +++ /dev/null @@ -1,153 +0,0 @@ -/* float.h for target with IEEE 32, 64 and 128 bit SPARC floating point formats - (on sparc-linux long double is 64 bit, while on sparc64-linux 128 bit) */ -#ifndef _FLOAT_H_ -#define _FLOAT_H_ -/* Produced by enquire version 4.3, CWI, Amsterdam */ - - /* Radix of exponent representation */ -#undef FLT_RADIX -#define FLT_RADIX 2 - /* Number of base-FLT_RADIX digits in the significand of a float */ -#undef FLT_MANT_DIG -#define FLT_MANT_DIG 24 - /* Number of decimal digits of precision in a float */ -#undef FLT_DIG -#define FLT_DIG 6 - /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */ -#undef FLT_ROUNDS -#define FLT_ROUNDS 1 - /* Difference between 1.0 and the minimum float greater than 1.0 */ -#undef FLT_EPSILON -#define FLT_EPSILON 1.19209290e-07F - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */ -#undef FLT_MIN_EXP -#define FLT_MIN_EXP (-125) - /* Minimum normalised float */ -#undef FLT_MIN -#define FLT_MIN 1.17549435e-38F - /* Minimum int x such that 10**x is a normalised float */ -#undef FLT_MIN_10_EXP -#define FLT_MIN_10_EXP (-37) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */ -#undef FLT_MAX_EXP -#define FLT_MAX_EXP 128 - /* Maximum float */ -#undef FLT_MAX -#define FLT_MAX 3.40282347e+38F - /* Maximum int x such that 10**x is a representable float */ -#undef FLT_MAX_10_EXP -#define FLT_MAX_10_EXP 38 - - /* Number of base-FLT_RADIX digits in the significand of a double */ -#undef DBL_MANT_DIG -#define DBL_MANT_DIG 53 - /* Number of decimal digits of precision in a double */ -#undef DBL_DIG -#define DBL_DIG 15 - /* Difference between 1.0 and the minimum double greater than 1.0 */ -#undef DBL_EPSILON -#define DBL_EPSILON 2.2204460492503131e-16 - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */ -#undef DBL_MIN_EXP -#define DBL_MIN_EXP (-1021) - /* Minimum normalised double */ -#undef DBL_MIN -#define DBL_MIN 2.2250738585072014e-308 - /* Minimum int x such that 10**x is a normalised double */ -#undef DBL_MIN_10_EXP -#define DBL_MIN_10_EXP (-307) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */ -#undef DBL_MAX_EXP -#define DBL_MAX_EXP 1024 - /* Maximum double */ -#undef DBL_MAX -#define DBL_MAX 1.7976931348623157e+308 - /* Maximum int x such that 10**x is a representable double */ -#undef DBL_MAX_10_EXP -#define DBL_MAX_10_EXP 308 - -#if defined(__sparcv9) || defined(__arch64__) || defined(__LONG_DOUBLE_128__) - - /* Number of base-FLT_RADIX digits in the significand of a long double */ -#undef LDBL_MANT_DIG -#define LDBL_MANT_DIG 113 - /* Number of decimal digits of precision in a long double */ -#undef LDBL_DIG -#define LDBL_DIG 33 - /* Difference between 1.0 and the minimum long double greater than 1.0 */ -#undef LDBL_EPSILON -#define LDBL_EPSILON 1.925929944387235853055977942584927319E-34L - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */ -#undef LDBL_MIN_EXP -#define LDBL_MIN_EXP (-16381) - /* Minimum normalised long double */ -#undef LDBL_MIN -#define LDBL_MIN 3.362103143112093506262677817321752603E-4932L - /* Minimum int x such that 10**x is a normalised long double */ -#undef LDBL_MIN_10_EXP -#define LDBL_MIN_10_EXP (-4931) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */ -#undef LDBL_MAX_EXP -#define LDBL_MAX_EXP 16384 - /* Maximum long double */ -#undef LDBL_MAX -#define LDBL_MAX 1.189731495357231765085759326628007016E+4932L - /* Maximum int x such that 10**x is a representable long double */ -#undef LDBL_MAX_10_EXP -#define LDBL_MAX_10_EXP 4932 - -#else /* sparc32 */ - -#undef LDBL_MANT_DIG -#define LDBL_MANT_DIG DBL_MANT_DIG -#undef LDBL_DIG -#define LDBL_DIG DBL_DIG -#undef LDBL_EPSILON -#define LDBL_EPSILON DBL_EPSILON -#undef LDBL_MIN_EXP -#define LDBL_MIN_EXP DBL_MIN_EXP -#undef LDBL_MIN -#define LDBL_MIN DBL_MIN -#undef LDBL_MIN_10_EXP -#define LDBL_MIN_10_EXP DBL_MIN_10_EXP -#undef LDBL_MAX_EXP -#define LDBL_MAX_EXP DBL_MAX_EXP -#undef LDBL_MAX -#define LDBL_MAX DBL_MAX -#undef LDBL_MAX_10_EXP -#define LDBL_MAX_10_EXP DBL_MAX_10_EXP - -#endif /* sparc32 */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - /* The floating-point expression evaluation method. - -1 indeterminate - 0 evaluate all operations and constants just to the range and - precision of the type - 1 evaluate operations and constants of type float and double - to the range and precision of the double type, evaluate - long double operations and constants to the range and - precision of the long double type - 2 evaluate all operations and constants to the range and - precision of the long double type - */ -# undef FLT_EVAL_METHOD -# define FLT_EVAL_METHOD 0 - - /* Number of decimal digits to enable rounding to the given number of - decimal digits without loss of precision. - if FLT_RADIX == 10^n: #mantissa * log10 (FLT_RADIX) - else : ceil (1 + #mantissa * log10 (FLT_RADIX)) - where #mantissa is the number of bits in the mantissa of the widest - supported floating-point type. - */ -# undef DECIMAL_DIG -# if LDBL_MANT_DIG == 53 -# define DECIMAL_DIG 17 -# else -# define DECIMAL_DIG 36 -# endif - -#endif /* C99 */ - -#endif /* _FLOAT_H_ */ diff --git a/contrib/gcc/config/float-vax.h b/contrib/gcc/config/float-vax.h deleted file mode 100644 index fff577f4fd8d..000000000000 --- a/contrib/gcc/config/float-vax.h +++ /dev/null @@ -1,159 +0,0 @@ -/* float.h for target with VAX floating point formats */ -#ifndef _FLOAT_H_ -#define _FLOAT_H_ -/* Produced by enquire version 4.3, CWI, Amsterdam */ - - /* Radix of exponent representation */ -#undef FLT_RADIX -#define FLT_RADIX 2 - /* Number of base-FLT_RADIX digits in the significand of a float */ -#undef FLT_MANT_DIG -#define FLT_MANT_DIG 24 - /* Number of decimal digits of precision in a float */ -#undef FLT_DIG -#define FLT_DIG 6 - /* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown */ -#undef FLT_ROUNDS -#define FLT_ROUNDS 1 - /* Difference between 1.0 and the minimum float greater than 1.0 */ -#undef FLT_EPSILON -#define FLT_EPSILON 1.19209290e-07F - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */ -#undef FLT_MIN_EXP -#define FLT_MIN_EXP (-127) - /* Minimum normalised float */ -#undef FLT_MIN -#define FLT_MIN 2.93873588e-39F - /* Minimum int x such that 10**x is a normalised float */ -#undef FLT_MIN_10_EXP -#define FLT_MIN_10_EXP (-38) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */ -#undef FLT_MAX_EXP -#define FLT_MAX_EXP 127 - /* Maximum float */ -#undef FLT_MAX -#define FLT_MAX 1.70141173e+38F - /* Maximum int x such that 10**x is a representable float */ -#undef FLT_MAX_10_EXP -#define FLT_MAX_10_EXP 38 - -#ifdef __GFLOAT - - /* The GFLOAT numbers may be problematic since gcc uses DFLOAT */ - - /* Number of base-FLT_RADIX digits in the significand of a double */ -#undef DBL_MANT_DIG -#define DBL_MANT_DIG 53 - /* Number of decimal digits of precision in a double */ -#undef DBL_DIG -#define DBL_DIG 15 - /* Difference between 1.0 and the minimum double greater than 1.0 */ -#undef DBL_EPSILON -#define DBL_EPSILON 2.2204460492503131e-016 - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */ -#undef DBL_MIN_EXP -#define DBL_MIN_EXP (-1023) - /* Minimum normalised double */ -#undef DBL_MIN -#define DBL_MIN 5.5626846462680035e-309 - /* Minimum int x such that 10**x is a normalised double */ -#undef DBL_MIN_10_EXP -#define DBL_MIN_10_EXP (-308) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */ -#undef DBL_MAX_EXP -#define DBL_MAX_EXP 1023 - /* Maximum double */ -#undef DBL_MAX -#define DBL_MAX 8.9884656743115775e+307 - /* Maximum int x such that 10**x is a representable double */ -#undef DBL_MAX_10_EXP -#define DBL_MAX_10_EXP 307 - - /* Number of base-FLT_RADIX digits in the significand of a long double */ -#undef LDBL_MANT_DIG -#define LDBL_MANT_DIG 53 - /* Number of decimal digits of precision in a long double */ -#undef LDBL_DIG -#define LDBL_DIG 15 - /* Difference between 1.0 and the minimum long double greater than 1.0 */ -#undef LDBL_EPSILON -#define LDBL_EPSILON 2.2204460492503131e-016L - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */ -#undef LDBL_MIN_EXP -#define LDBL_MIN_EXP (-1023) - /* Minimum normalised long double */ -#undef LDBL_MIN -#define LDBL_MIN 5.5626846462680035e-309L - /* Minimum int x such that 10**x is a normalised long double */ -#undef LDBL_MIN_10_EXP -#define LDBL_MIN_10_EXP (-308) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */ -#undef LDBL_MAX_EXP -#define LDBL_MAX_EXP 1023 - /* Maximum long double */ -#undef LDBL_MAX -#define LDBL_MAX 8.9884656743115775e+307L - /* Maximum int x such that 10**x is a representable long double */ -#undef LDBL_MAX_10_EXP -#define LDBL_MAX_10_EXP 307 - -#else /* !__GFLOAT */ - - /* Number of base-FLT_RADIX digits in the significand of a double */ -#undef DBL_MANT_DIG -#define DBL_MANT_DIG 56 - /* Number of decimal digits of precision in a double */ -#undef DBL_DIG -#define DBL_DIG 16 - /* Difference between 1.0 and the minimum double greater than 1.0 */ -#undef DBL_EPSILON -#define DBL_EPSILON 2.77555756156289135e-17 - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */ -#undef DBL_MIN_EXP -#define DBL_MIN_EXP (-127) - /* Minimum normalised double */ -#undef DBL_MIN -#define DBL_MIN 2.93873587705571877e-39 - /* Minimum int x such that 10**x is a normalised double */ -#undef DBL_MIN_10_EXP -#define DBL_MIN_10_EXP (-38) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */ -#undef DBL_MAX_EXP -#define DBL_MAX_EXP 127 - /* Maximum double */ -#undef DBL_MAX -#define DBL_MAX 1.70141183460469227e+38 - /* Maximum int x such that 10**x is a representable double */ -#undef DBL_MAX_10_EXP -#define DBL_MAX_10_EXP 38 - - /* Number of base-FLT_RADIX digits in the significand of a long double */ -#undef LDBL_MANT_DIG -#define LDBL_MANT_DIG 56 - /* Number of decimal digits of precision in a long double */ -#undef LDBL_DIG -#define LDBL_DIG 16 - /* Difference between 1.0 and the minimum long double greater than 1.0 */ -#undef LDBL_EPSILON -#define LDBL_EPSILON 2.77555756156289135e-17L - /* Minimum int x such that FLT_RADIX**(x-1) is a normalised long double */ -#undef LDBL_MIN_EXP -#define LDBL_MIN_EXP (-127) - /* Minimum normalised long double */ -#undef LDBL_MIN -#define LDBL_MIN 2.93873587705571877e-39L - /* Minimum int x such that 10**x is a normalised long double */ -#undef LDBL_MIN_10_EXP -#define LDBL_MIN_10_EXP (-38) - /* Maximum int x such that FLT_RADIX**(x-1) is a representable long double */ -#undef LDBL_MAX_EXP -#define LDBL_MAX_EXP 127 - /* Maximum long double */ -#undef LDBL_MAX -#define LDBL_MAX 1.70141183460469227e+38L - /* Maximum int x such that 10**x is a representable long double */ -#undef LDBL_MAX_10_EXP -#define LDBL_MAX_10_EXP 38 - -#endif /* __GFLOAT */ -#endif /* _FLOAT_H_ */ diff --git a/contrib/gcc/config/i386/386bsd.h b/contrib/gcc/config/i386/386bsd.h deleted file mode 100644 index a34e6e5db103..000000000000 --- a/contrib/gcc/config/i386/386bsd.h +++ /dev/null @@ -1,53 +0,0 @@ -/* Configuration for an i386 running 386BSD as the target machine. */ - -/* This is tested by i386gas.h. */ -#define YES_UNDERSCORES - -#include "i386/gstabs.h" - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dunix -D____386BSD____ -D__386BSD__ -DBSD_NET2 -Asystem=unix -Asystem=bsd" - -/* Like the default, except no -lg. */ -#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" - -#undef SIZE_TYPE -#define SIZE_TYPE "unsigned int" - -#undef PTRDIFF_TYPE -#define PTRDIFF_TYPE "int" - -#undef WCHAR_TYPE -#define WCHAR_TYPE "short unsigned int" - -#define WCHAR_UNSIGNED 1 - -#undef WCHAR_TYPE_SIZE -#define WCHAR_TYPE_SIZE 16 - -/* Redefine this to use %eax instead of %edx. */ -#undef FUNCTION_PROFILER -#define FUNCTION_PROFILER(FILE, LABELNO) \ -{ \ - if (flag_pic) \ - { \ - fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%eax\n", \ - LPREFIX, (LABELNO)); \ - fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \ - } \ - else \ - { \ - fprintf (FILE, "\tmovl $%sP%d,%%eax\n", LPREFIX, (LABELNO)); \ - fprintf (FILE, "\tcall mcount\n"); \ - } \ -} - -#undef ASM_APP_ON -#define ASM_APP_ON "#APP\n" - -#undef ASM_APP_OFF -#define ASM_APP_OFF "#NO_APP\n" - -/* Don't default to pcc-struct-return, because gcc is the only compiler, and - we want to retain compatibility with older gcc versions. */ -#define DEFAULT_PCC_STRUCT_RETURN 0 diff --git a/contrib/gcc/config/i386/aix386.h b/contrib/gcc/config/i386/aix386.h deleted file mode 100644 index f085c4210fe5..000000000000 --- a/contrib/gcc/config/i386/aix386.h +++ /dev/null @@ -1,64 +0,0 @@ -/* Definitions for IBM PS2 running AIX/386 with gas. - From: Minh Tran-Le - Copyright (C) 1988, 2000 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. */ - -/* - * This configuration file is for gcc with gas-2.x and gnu ld 2.x - * with aix ps/2 1.3.x. - */ - -/* Define USE_GAS if you have the new version of gas that can handle - * multiple segments and .section pseudo op. This will allow gcc to - * use the .init section for g++ ctor/dtor. - * - * If you don't have gas then undefined USE_GAS. You will also have - * to use collect if you want to use g++ - */ -#define USE_GAS - -#include "i386/aix386ng.h" - -/* Use crt1.o as a startup file and crtn.o as a closing file. - And add crtbegin.o and crtend.o for ctors and dtors */ - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC \ - "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}} crtbegin.o%s" -#undef ENDFILE_SPEC -#define ENDFILE_SPEC \ - "crtend.o%s crtn.o%s" - -/* Removed the -K flags because the gnu ld does not handle it */ -#undef LINK_SPEC -#define LINK_SPEC "%{T*} %{z:-lm}" - -/* Define a few machine-specific details of the implementation of - constructors. */ - -#undef INIT_SECTION_ASM_OP -#define INIT_SECTION_ASM_OP "\t.section .init,\"x\"" - -#define CTOR_LIST_BEGIN \ - asm (INIT_SECTION_ASM_OP); \ - asm ("pushl $0") -#define CTOR_LIST_END CTOR_LIST_BEGIN - -#undef TARGET_ASM_CONSTRUCTOR -#define TARGET_ASM_CONSTRUCTOR ix86_svr3_asm_out_constructor diff --git a/contrib/gcc/config/i386/aix386ng.h b/contrib/gcc/config/i386/aix386ng.h deleted file mode 100644 index 445d333f784a..000000000000 --- a/contrib/gcc/config/i386/aix386ng.h +++ /dev/null @@ -1,139 +0,0 @@ -/* Definitions for IBM PS2 running AIX/386. - Copyright (C) 1988, 1996, 1998 Free Software Foundation, Inc. - Contributed by Minh Tran-Le . - -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 "i386/i386.h" - -/* Get the generic definitions for system V.3. */ - -#include "svr3.h" - -/* Use the ATT assembler syntax. - This overrides at least one macro (USER_LABEL_PREFIX) from svr3.h. */ - -#include "i386/att.h" - -/* Use crt1.o as a startup file and crtn.o as a closing file. */ - -#define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}" -#define ENDFILE_SPEC "crtn.o%s" - -#define LIB_SPEC "%{shlib:-lc_s} -lc" - -/* Special flags for the linker. I don't know what they do. */ - -#define LINK_SPEC "%{K} %{!K:-K} %{T*} %{z:-lm}" - -/* Specify predefined symbols in preprocessor. */ - -#define CPP_PREDEFINES "-Dps2 -Dunix -Asystem=aix" - -#define CPP_SPEC "%(cpp_cpu) \ - %{posix:-D_POSIX_SOURCE}%{!posix:-DAIX} -D_I386 -D_AIX -D_MBCS" - -/* special flags for the aix assembler to generate the short form for all - qualifying forward reference */ -/* The buggy /bin/as of aix ps/2 1.2.x cannot always handle it. */ -#if 0 -#define ASM_SPEC "-s2" -#endif /* 0 */ - -#undef ASM_FILE_START -#define ASM_FILE_START(FILE) \ - do { output_file_directive (FILE, main_input_filename); \ - if (optimize) \ - ASM_FILE_START_1 (FILE); \ - else \ - fprintf (FILE, "\t.noopt\n"); \ - } while (0) - -/* This was suggested, but it shouldn't be right for DBX output. -- RMS - #define ASM_OUTPUT_SOURCE_FILENAME(FILE, NAME) */ - -/* Writing `int' for a bitfield forces int alignment for the structure. */ - -#define PCC_BITFIELD_TYPE_MATTERS 1 - -#ifndef USE_GAS -/* Don't write a `.optim' pseudo; this assembler - is said to have a bug when .optim is used. */ - -#undef ASM_FILE_START_1 -#define ASM_FILE_START_1(FILE) fprintf (FILE, "\t.noopt\n") -#endif - -/* Output assembler code to FILE to increment profiler label # LABELNO - for profiling a function entry. */ - -#undef FUNCTION_PROFILER -#define FUNCTION_PROFILER(FILE, LABELNO) \ - fprintf (FILE, "\tleal %sP%d,%%eax\n\tcall mcount\n", LPREFIX, (LABELNO)); - -/* Note that using bss_section here caused errors - in building shared libraries on system V.3. - but AIX 1.2 does not have yet shareable libraries on PS2 */ -#undef ASM_OUTPUT_LOCAL -#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ - (bss_section (), \ - ASM_OUTPUT_LABEL ((FILE), (NAME)), \ - fprintf ((FILE), "\t.set .,.+%u\n", (ROUNDED))) - - -/* Undef all the .init and .fini section stuff if we are not using gas and - * gnu ld so that we can use collect because the standard /bin/as and /bin/ld - * cannot handle those. - */ -#ifndef USE_GAS -# undef INIT_SECTION_ASM_OP -# undef FINI_SECTION_ASM_OP -# undef CTORS_SECTION_ASM_OP -# undef DTORS_SECTION_ASM_OP -# undef TARGET_ASM_CONSTRUCTOR -# undef TARGET_ASM_DESTRUCTOR -# undef DO_GLOBAL_CTORS_BODY - -# undef CTOR_LIST_BEGIN -# define CTOR_LIST_BEGIN -# undef CTOR_LIST_END -# define CTOR_LIST_END -# undef DTOR_LIST_BEGIN -# define DTOR_LIST_BEGIN -# undef DTOR_LIST_END -# define DTOR_LIST_END - -# undef CONST_SECTION_FUNCTION -# define CONST_SECTION_FUNCTION \ -void \ -const_section () \ -{ \ - text_section(); \ -} - -# undef EXTRA_SECTION_FUNCTIONS -# define EXTRA_SECTION_FUNCTIONS \ - CONST_SECTION_FUNCTION - -/* for collect2 */ -# define OBJECT_FORMAT_COFF -# define MY_ISCOFF(magic) \ - ((magic) == I386MAGIC || (magic) == I386SVMAGIC) - -#endif /* !USE_GAS */ diff --git a/contrib/gcc/config/i386/bsd386.h b/contrib/gcc/config/i386/bsd386.h deleted file mode 100644 index fb24327523ca..000000000000 --- a/contrib/gcc/config/i386/bsd386.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Configuration for an i386 running BSDI's BSD/OS (formerly known as BSD/386) - as the target machine. */ - -/* We exist mostly to add -Dbsdi and such to the predefines. */ - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dunix -Dbsdi -D____386BSD____ -D__386BSD__\ - -DBSD_NET2 -Asystem=unix -Asystem=bsd" - -#undef WCHAR_TYPE -#define WCHAR_TYPE "int" - -#undef WCHAR_UNSIGNED -#define WCHAR_UNSIGNED 0 - -#undef WCHAR_TYPE_SIZE -#define WCHAR_TYPE_SIZE 32 - -/* This is suitable for BSD/OS 3.0; we don't know about earlier releases. */ -#undef ASM_COMMENT_START -#define ASM_COMMENT_START " #" - -/* Until they use ELF or something that handles dwarf2 unwinds - and initialization stuff better. */ -#define DWARF2_UNWIND_INFO 0 - -/* BSD/OS still uses old binutils that don't insert nops by default - when the .align directive demands to insert extra space in the text - segment. */ -#undef ASM_OUTPUT_ALIGN -#define ASM_OUTPUT_ALIGN(FILE,LOG) \ - if ((LOG)!=0) fprintf ((FILE), "\t.align %d,0x90\n", (LOG)) diff --git a/contrib/gcc/config/i386/dgux.h b/contrib/gcc/config/i386/dgux.h deleted file mode 100644 index 2d4c98c815d6..000000000000 --- a/contrib/gcc/config/i386/dgux.h +++ /dev/null @@ -1,257 +0,0 @@ -/* Target definitions for GNU compiler for Intel 80x86 running DG/ux - Copyright (C) 1993, 1995, 1996, 1997, 1998, 2000, 2001 - Free Software Foundation, Inc. - Currently maintained by gcc@dg-rtp.dg.com. - -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. */ - -/* for now, we are just like the sysv4 version with a - few hacks -*/ - -#ifndef VERSION_INFO2 -#define VERSION_INFO2 "$Revision: 1.16 $" -#endif - -#ifndef VERSION_STRING -#define VERSION_STRING version_string -#endif - -/* Identify the compiler. */ -/* TARGET_VERSION used by toplev.c VERSION_STRING used by -midentify-revision */ - -#undef TARGET_VERSION -#define TARGET_VERSION fprintf (stderr, " (%s%s, %s)", \ - VERSION_INFO1, VERSION_INFO2, __DATE__) -#undef VERSION_INFO1 -#define VERSION_INFO1 "ix86 DG/ux, " - -/* Augment TARGET_SWITCHES with the MXDB options. */ -#define MASK_STANDARD 0x40000000 /* Retain standard information */ -#define MASK_NOLEGEND 0x20000000 /* Discard legend information */ -#define MASK_EXTERNAL_LEGEND 0x10000000 /* Make external legends */ -#define MASK_IDENTIFY_REVISION 0x08000000 /* Emit 'ident' to .s */ -#define MASK_WARN_PASS_STRUCT 0x04000000 /* Warn when structures are passed */ - -#define TARGET_STANDARD (target_flags & MASK_STANDARD) -#define TARGET_NOLEGEND (target_flags & MASK_NOLEGEND) -#define TARGET_EXTERNAL_LEGEND (target_flags & MASK_EXTERNAL_LEGEND) -#define TARGET_IDENTIFY_REVISION (target_flags & MASK_IDENTIFY_REVISION) -#define TARGET_WARN_PASS_STRUCT (target_flags & MASK_WARN_PASS_STRUCT) - -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - { "standard", MASK_STANDARD, \ - N_("Retain standard MXDB information") }, \ - { "legend", -MASK_NOLEGEND, \ - N_("Retain legend information") }, \ - { "no-legend", MASK_NOLEGEND, "" }, \ - { "external-legend", MASK_EXTERNAL_LEGEND, \ - N_("Generate external legend information") }, \ - { "identify-revision", MASK_IDENTIFY_REVISION, \ - N_("Emit identifying info in .s file") }, \ - { "warn-passed-structs", MASK_WARN_PASS_STRUCT, \ - N_("Warn when a function arg is a structure") }, - -#undef DWARF_DEBUGGING_INFO -#define DWARF_DEBUGGING_INFO - -/* - allow -gstabs so that those who have gnu-as installed - can debug c++ programs. -*/ -#undef DBX_DEBUGGING_INFO -#define DBX_DEBUGGING_INFO - -#undef PREFERRED_DEBUGGING_TYPE -#define PREFERRED_DEBUGGING_TYPE DWARF_DEBUG - -/* Override svr[34].h. Switch to the data section so that the coffsem - symbol isn't in the text section. */ -#undef ASM_FILE_START -#define ASM_FILE_START(FILE) \ - do { \ - output_file_directive (FILE, main_input_filename); \ - fprintf (FILE, "\t.version\t\"01.01\"\n"); \ - data_section (); \ - } while (0) - -/* ix86 abi specified type for wchar_t */ - -#undef WCHAR_TYPE -#define WCHAR_TYPE "long int" - -#undef WCHAR_TYPE_SIZE -#define WCHAR_TYPE_SIZE BITS_PER_WORD - - -/* Some machines may desire to change what optimizations are performed for - various optimization levels. This macro, if defined, is executed once - just after the optimization level is determined and before the remainder - of the command options have been parsed. Values set in this macro are - used as the default values for the other command line options. - - LEVEL is the optimization level specified; 2 if -O2 is specified, - 1 if -O is specified, and 0 if neither is specified. */ - -/* This macro used to store 0 in flag_signed_bitfields. - Not only is that misuse of this macro; the whole idea is wrong. - - The GNU C dialect makes bitfields signed by default, - regardless of machine type. Making any machine inconsistent in this - regard is bad for portability. - - I chose to make bitfields signed by default because this is consistent - with the way ordinary variables are handled: `int' equals `signed int'. - If there is a good reason to prefer making bitfields unsigned by default, - it cannot have anything to do with the choice of machine. - If the reason is good enough, we should change the convention for all machines. - - -- rms, 20 July 1991. */ - -/* - this really should go into dgux-local.h -*/ - -#undef OPTIMIZATION_OPTIONS -#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \ - do { \ - extern int flag_signed_bitfields; \ - flag_signed_bitfields = 0; \ - optimization_options (LEVEL,SIZE); \ - } while (0) - - -/* The normal location of the `ld' and `as' programs */ - -#undef MD_EXEC_PREFIX -#define MD_EXEC_PREFIX "/usr/bin/" - -/* The normal location of the various *crt*.o files is the */ - -#undef MD_STARTFILE_PREFIX -#define MD_STARTFILE_PREFIX "/usr/lib/" - -/* Macros to be automatically defined. - __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. */ - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-D__ix86 -Dunix -DDGUX -D__CLASSIFY_TYPE__=2\ - -Asystem=unix -Asystem=svr4" - - /* - If not -ansi, -traditional, or restricting include files to one - specific source target, specify full DG/UX features. - */ -#undef CPP_SPEC -#define CPP_SPEC "%(cpp_cpu) %{!ansi:%{!traditional:-D__OPEN_NAMESPACE__}}" - -/* Assembler support (legends for mxdb). */ -#undef ASM_SPEC -#define ASM_SPEC "\ -%{mno-legend:%{mstandard:-Wc,off}}\ -%{g:%{!mno-legend:-Wc,-fix-bb,-s\"%i\"\ -%{traditional:,-lc}%{!traditional:,-lansi-c}\ -%{mstandard:,-keep-std}\ -%{mexternal-legend:,-external}}}" - -/* Override svr4.h. */ - -/* hassey 3/12/94 keep svr4 ASM_FINAL_SPEC allows -pipe to work */ - -/* Linker and library spec's. - -static, -shared, -symbolic, -h* and -z* access AT&T V.4 link options. - -svr4 instructs gcc to place /usr/lib/values-X[cat].o on link the line. - The absence of -msvr4 indicates linking done in a COFF environment and - adds the link script to the link line. In all environments, the first - and last objects are crtbegin.o and crtend.o. - When the -G link option is used (-shared and -symbolic) a final link is - not being done. */ - -#undef LIB_SPEC -#define LIB_SPEC \ -"%{!shared:%{!symbolic:-lc}}" - -#undef LINK_SPEC -#define LINK_SPEC "%{z*} %{h*} %{v:-V} \ - %{static:-dn -Bstatic} \ - %{shared:-G -dy} \ - %{symbolic:-Bsymbolic -G -dy} \ - %{pg:-L/usr/lib/libp}%{p:-L/usr/lib/libp}" - -#ifdef CROSS_COMPILE - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC "%{!shared:%{!symbolic:%{pg:gcrt1.o%s} \ - %{!pg:%{p:mcrt1.o%s} \ - %{!p:crt1.o%s}}}} \ - %{pg:gcrti.o%s}%{!pg:crti.o%s} \ - crtbegin.o%s \ - %{ansi:values-Xc.o%s} \ - %{!ansi:%{traditional:values-Xt.o%s} \ - %{!traditional:values-Xa.o%s}}" - -#undef ENDFILE_SPEC -#define ENDFILE_SPEC "crtend.o%s %{pg:gcrtn.o}%{!pg:crtn.o%s}" - -#else - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC "%{!shared:%{!symbolic:%{pg:gcrt1.o%s} \ - %{!pg:%{p:/lib/mcrt1.o%s} \ - %{!p:/lib/crt1.o%s}}}} \ - %{pg:gcrti.o%s}%{!pg:/lib/crti.o%s} \ - crtbegin.o%s \ - %{ansi:/lib/values-Xc.o%s} \ - %{!ansi:%{traditional:/lib/values-Xt.o%s} \ - %{!traditional:/lib/values-Xa.o%s}}" - -#undef ENDFILE_SPEC -#define ENDFILE_SPEC "crtend.o%s %{pg:gcrtn.o}%{!pg:/lib/crtn.o}" - -#endif /* CROSS_COMPILE */ - -/* The maximum alignment which the object file format can support. - page alignment would seem to be enough */ -#undef MAX_OFILE_ALIGNMENT -#define MAX_OFILE_ALIGNMENT 0x1000 - -/* Must use data section for relocatable constants when pic. */ -#undef SELECT_RTX_SECTION -#define SELECT_RTX_SECTION(MODE,RTX,ALIGN) \ -{ \ - if (flag_pic && symbolic_operand (RTX, VOIDmode)) \ - data_section (); \ - else \ - const_section (); \ -} - -/* This supplements FUNCTION_ARG's definition in i386.h to check - TARGET_WARN_PASS_STRUCT */ - -#undef FUNCTION_ARG -#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \ -((((MODE) == BLKmode && TARGET_WARN_PASS_STRUCT) ? \ - warning ("argument is a structure"),0 : 0), \ - (function_arg (&CUM, MODE, TYPE, NAMED))) - -/* Add .align 1 to avoid .backalign bug in assembler */ -#undef CONST_SECTION_ASM_OP -#define CONST_SECTION_ASM_OP "\t.section\t.rodata\n\t.align 1" diff --git a/contrib/gcc/config/i386/djgpp-rtems.h b/contrib/gcc/config/i386/djgpp-rtems.h deleted file mode 100644 index 551b666b765c..000000000000 --- a/contrib/gcc/config/i386/djgpp-rtems.h +++ /dev/null @@ -1,35 +0,0 @@ -/* Configuration for an i386 running RTEMS on top of MS-DOS with - DJGPP v2.x. - - Copyright (C) 1996, 1999, 2002 Free Software Foundation, Inc. - Contributed by Joel Sherrill (joel@OARcorp.com). - -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. */ - -/* Specify predefined symbols in preprocessor. */ - -#ifdef CPP_PREDEFINES -#undef CPP_PREDEFINES -#endif -#define CPP_PREDEFINES "-Dunix -DGO32 -DDJGPP=2 -DMSDOS -D__rtems__ \ - -Asystem=unix -Asystem=msdos -Asystem=rtems" - -/* Generate calls to memcpy, memcmp and memset. */ -#ifndef TARGET_MEM_FUNCTIONS -#define TARGET_MEM_FUNCTIONS -#endif diff --git a/contrib/gcc/config/i386/interix.c b/contrib/gcc/config/i386/interix.c deleted file mode 100644 index 8ea2c6e171f2..000000000000 --- a/contrib/gcc/config/i386/interix.c +++ /dev/null @@ -1,114 +0,0 @@ -/* Subroutines for insn-output.c for Windows NT. - Copyright (C) 1998, 1999 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 "config.h" -#include "system.h" -#include "rtl.h" -#include "regs.h" -#include "hard-reg-set.h" -#include "output.h" -#include "tree.h" -#include "flags.h" - -/* Return string which is the former assembler name modified with a - suffix consisting of an atsign (@) followed by the number of bytes of - arguments */ - -const char * -gen_stdcall_suffix (decl) - tree decl; -{ - int total = 0; - /* ??? This probably should use XSTR (XEXP (DECL_RTL (decl), 0), 0) instead - of DECL_ASSEMBLER_NAME. */ - const char *const asmname = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); - char *newsym; - - if (TYPE_ARG_TYPES (TREE_TYPE (decl))) - if (TREE_VALUE (tree_last (TYPE_ARG_TYPES (TREE_TYPE (decl)))) - == void_type_node) - { - tree formal_type = TYPE_ARG_TYPES (TREE_TYPE (decl)); - - while (TREE_VALUE (formal_type) != void_type_node) - { - int parm_size - = TREE_INT_CST_LOW (TYPE_SIZE (TREE_VALUE (formal_type))); - /* Must round up to include padding. This is done the same - way as in store_one_arg. */ - parm_size = ((parm_size + PARM_BOUNDARY - 1) - / PARM_BOUNDARY * PARM_BOUNDARY); - total += parm_size; - formal_type = TREE_CHAIN (formal_type); - } - } - - newsym = xmalloc (strlen (asmname) + 10); - sprintf (newsym, "%s@%d", asmname, total/BITS_PER_UNIT); - return IDENTIFIER_POINTER (get_identifier (newsym)); -} - -#if 0 -/* Turn this back on when the linker is updated to handle grouped - .data$ sections correctly. See corresponding note in i386/interix.h. - MK. */ - -/* Cover function for UNIQUE_SECTION. */ - -void -i386_pe_unique_section (decl, reloc) - tree decl; - int reloc; -{ - int len; - const char *name; - char *string,*prefix; - - name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)); - /* Strip off any encoding in fnname. */ - STRIP_NAME_ENCODING (name, name); - - /* The object is put in, for example, section .text$foo. - The linker will then ultimately place them in .text - (everything from the $ on is stripped). Don't put - read-only data in .rdata section to avoid a PE linker - bug when .rdata$* grouped sections are used in code - without a .rdata section. */ - if (TREE_CODE (decl) == FUNCTION_DECL) - prefix = ".text$"; -/* else if (DECL_INITIAL (decl) == 0 - || DECL_INITIAL (decl) == error_mark_node) - prefix = ".bss"; */ - else if (DECL_READONLY_SECTION (decl, reloc)) -#ifdef READONLY_DATA_SECTION - prefix = ".rdata$"; -#else - prefix = ".text$"; -#endif - else - prefix = ".data$"; - len = strlen (name) + strlen (prefix); - string = alloca (len + 1); - sprintf (string, "%s%s", prefix, name); - - DECL_SECTION_NAME (decl) = build_string (len, string); -} - -#endif /* 0 */ diff --git a/contrib/gcc/config/i386/isc.h b/contrib/gcc/config/i386/isc.h deleted file mode 100644 index eea98118fb63..000000000000 --- a/contrib/gcc/config/i386/isc.h +++ /dev/null @@ -1,96 +0,0 @@ -/* Assembler-independent definitions for an Intel 386 running - Interactive Unix System V. Specifically, this is for recent versions - that support POSIX. */ - -/* Use crt1.o, not crt0.o, as a startup file, and crtn.o as a closing file. */ -#undef STARTFILE_SPEC -#define STARTFILE_SPEC \ - "%{!shlib:%{posix:%{pg:mcrtp1.o%s}%{!pg:%{p:mcrtp1.o%s}%{!p:crtp1.o%s}}}\ - %{Xp:%{pg:mcrtp1.o%s}%{!pg:%{p:mcrtp1.o%s}%{!p:crtp1.o%s}}}\ - %{!posix:%{!Xp:%{pg:mcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}\ - %{p:-L/lib/libp} %{pg:-L/lib/libp}}}}\ - %{shlib:%{Xp:crtp1.o%s}%{posix:crtp1.o%s}%{!posix:%{!Xp:crt1.o%s}}}\ - crtbegin.o%s" - -#define ENDFILE_SPEC "crtend.o%s crtn.o%s" - -/* Library spec */ -#undef LIB_SPEC -#define LIB_SPEC "%{shlib:-lc_s} %{posix:-lcposix} %{Xp:-lcposix} -lc -lg" - -#undef CPP_SPEC -#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{Xp:-D_POSIX_SOURCE}" - -/* ISC 2.2 uses `char' for `wchar_t'. */ -#undef WCHAR_TYPE -#define WCHAR_TYPE "char" - -#undef WCHAR_TYPE_SIZE -#define WCHAR_TYPE_SIZE BITS_PER_UNIT - -#if 0 -/* This is apparently not true: ISC versions up to 3.0, at least, use - the standard calling sequence in which the called function pops the - extra arg. */ -/* caller has to pop the extra argument passed to functions that return - structures. */ - -#undef RETURN_POPS_ARGS -#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ - ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \ - : (TARGET_RTD \ - && (TYPE_ARG_TYPES (FUNTYPE) == 0 \ - || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \ - == void_type_node))) ? (SIZE) \ - : 0) -/* On other 386 systems, the last line looks like this: - : (aggregate_value_p (TREE_TYPE (FUNTYPE))) ? GET_MODE_SIZE (Pmode) : 0) */ -#endif - -/* Handle #pragma pack and #pragma weak. */ -#define HANDLE_SYSV_PRAGMA - -/* By default, target has a 80387, uses IEEE compatible arithmetic, - and returns float values in the 387, ie, - (TARGET_80387 | TARGET_FLOAT_RETURNS_IN_80387) - - ISC's software emulation of a 387 fails to handle the `fucomp' - opcode. fucomp is only used when generating IEEE compliant code. - So don't make TARGET_IEEE_FP default for ISC. */ - -#undef TARGET_SUBTARGET_DEFAULT -#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_FLOAT_RETURNS) - -/* The ISC 2.0.2 software FPU emulator apparently can't handle - 80-bit XFmode insns, so don't generate them. */ -#undef LONG_DOUBLE_TYPE_SIZE -#define LONG_DOUBLE_TYPE_SIZE 64 - -/* The ISC assembler does not like a .file directive with a name - longer than 14 characters. Truncating it will not permit - debugging to work properly, but at least we won't get an error - message. */ - -#undef ASM_FILE_START -#define ASM_FILE_START(FILE) \ - do { \ - const int len = strlen (main_input_filename); \ - const char *na = main_input_filename + len; \ - char shorter[15]; \ - /* NA gets MAIN_INPUT_FILENAME sans directory names. */\ - while (na > main_input_filename) \ - { \ - if (na[-1] == '/') \ - break; \ - na--; \ - } \ - strncpy (shorter, na, 14); \ - shorter[14] = 0; \ - fprintf (FILE, "\t.file\t"); \ - output_quoted_string (FILE, shorter); \ - fprintf (FILE, "\n"); \ - } while (0) - -/* Work around assembler forward label references generated in exception - handling code. */ -#define DWARF2_UNWIND_INFO 0 diff --git a/contrib/gcc/config/i386/isccoff.h b/contrib/gcc/config/i386/isccoff.h deleted file mode 100644 index 9efd9ad4ffaf..000000000000 --- a/contrib/gcc/config/i386/isccoff.h +++ /dev/null @@ -1,12 +0,0 @@ -/* Definitions for Intel 386 running Interactive Unix System V. - Specifically, this is for recent versions that support POSIX; - for version 2.0.2, use configuration option i386-sysv instead. - (But set TARGET_DEFAULT to (MASK_80307 | MASK_FLOAT_RETURNS) - if you do that, if you don't have a real 80387.) */ - -/* Mostly it's like AT&T Unix System V. */ - -#include "i386/sysv3.h" - -/* But with a few changes. */ -#include "i386/isc.h" diff --git a/contrib/gcc/config/i386/iscdbx.h b/contrib/gcc/config/i386/iscdbx.h deleted file mode 100644 index 6d1f341f15ea..000000000000 --- a/contrib/gcc/config/i386/iscdbx.h +++ /dev/null @@ -1,43 +0,0 @@ -/* Definitions for Intel 386 running Interactive Unix System V, - using dbx-in-coff encapsulation. - Specifically, this is for recent versions that support POSIX. - Copyright (C) 1992, 1995 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. */ - -/* Mostly it's like AT&T Unix System V with dbx-in-coff. */ - -#include "i386/svr3dbx.h" - -/* But with a few changes. */ -#undef ENDFILE_SPEC -#include "i386/isc.h" - -/* Overridden defines for ifile usage. */ - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC \ - "%{!r:%{!z:svr3.ifile%s}%{z:svr3z.ifile%s}}\ - %{!shlib:%{posix:%{pg:mcrtp1.o%s}%{!pg:%{p:mcrtp1.o%s}%{!p:crtp1.o%s}}}\ - %{Xp:%{pg:mcrtp1.o%s}%{!pg:%{p:mcrtp1.o%s}%{!p:crtp1.o%s}}}\ - %{!posix:%{!Xp:%{pg:mcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}}}\ - %{p:-L/usr/lib/libp} %{pg:-L/usr/lib/libp}}\ - %{shlib:%{posix:crtp1.o%s}%{Xp:crtp1.o%s}%{!posix:%{!Xp:crt1.o%s}}}" - -#undef ENDFILE_SPEC -#define ENDFILE_SPEC "crtn.o%s" diff --git a/contrib/gcc/config/i386/linux-oldld.h b/contrib/gcc/config/i386/linux-oldld.h deleted file mode 100644 index a95c20555df8..000000000000 --- a/contrib/gcc/config/i386/linux-oldld.h +++ /dev/null @@ -1,72 +0,0 @@ -/* Definitions for Intel 386 running Linux-based GNU systems with pre-BFD - a.out linkers. - Copyright (C) 1995, 1997, 1998, 2002 Free Software Foundation, Inc. - Contributed by Michael Meissner (meissner@cygnus.com) - -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. */ - -/* This is tested by i386/gas.h. */ -#define YES_UNDERSCORES - -#include -#include /* some common stuff */ - -#undef ASM_COMMENT_START -#define ASM_COMMENT_START "#" - -/* Specify predefined symbols in preprocessor. */ - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dunix -D__gnu_linux__ -Dlinux -Asystem=posix" - -#undef CPP_SPEC -#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}" - -#undef SIZE_TYPE -#define SIZE_TYPE "unsigned int" - -#undef PTRDIFF_TYPE -#define PTRDIFF_TYPE "int" - -#undef WCHAR_TYPE -#define WCHAR_TYPE "long int" - -#undef WCHAR_TYPE_SIZE -#define WCHAR_TYPE_SIZE BITS_PER_WORD - -/* Don't default to pcc-struct-return, because gcc is the only compiler, - and we want to retain compatibility with older gcc versions. */ -#define DEFAULT_PCC_STRUCT_RETURN 0 - -#undef LIB_SPEC - -#if 1 -/* We no longer link with libc_p.a or libg.a by default. If you - want to profile or debug the GNU/Linux C library, please add - lc_p or -ggdb to LDFLAGS at the link time, respectively. */ -#define LIB_SPEC \ -"%{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} %{!ggdb:-lc} %{ggdb:-lg}" -#else -#define LIB_SPEC \ -"%{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \ - %{!p:%{!pg:%{!g*:-lc} %{g*:-lg -static}}}" -#endif - - -#undef LINK_SPEC -#define LINK_SPEC "" diff --git a/contrib/gcc/config/i386/next.h b/contrib/gcc/config/i386/next.h deleted file mode 100644 index 3081fdebf8c9..000000000000 --- a/contrib/gcc/config/i386/next.h +++ /dev/null @@ -1,186 +0,0 @@ -/* Target definitions for GNU compiler for Intel x86 CPU running NeXTSTEP - Copyright (C) 1993, 1995, 1996, 1999 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 "i386/gas.h" -#include "nextstep.h" - -/* By default, target has a 80387, with IEEE FP. */ - -#undef TARGET_SUBTARGET_DEFAULT -#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_IEEE_FP) - -/* Implicit library calls should use memcpy, not bcopy, etc. */ - -#define TARGET_MEM_FUNCTIONS - -/* Machines that use the AT&T assembler syntax - also return floating point values in an FP register. - Define how to find the value returned by a function. - VALTYPE is the data type of the value (as a tree). - If the precise function being called is known, FUNC is its FUNCTION_DECL; - otherwise, FUNC is 0. */ - -#undef VALUE_REGNO -#define VALUE_REGNO(MODE) \ - ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode \ - ? FIRST_FLOAT_REG : 0) - -/* A C statement or statements which output an assembler instruction - opcode to the stdio stream STREAM. The macro-operand PTR is a - variable of type `char *' which points to the opcode name in its - "internal" form--the form that is written in the machine description. - - GAS version 1.38.1 doesn't understand the `repz' opcode mnemonic. - So use `repe' instead. */ - -#undef ASM_OUTPUT_OPCODE -#define ASM_OUTPUT_OPCODE(STREAM, PTR) \ -{ \ - if ((PTR)[0] == 'r' \ - && (PTR)[1] == 'e' \ - && (PTR)[2] == 'p') \ - { \ - if ((PTR)[3] == 'z') \ - { \ - fprintf (STREAM, "repe"); \ - (PTR) += 4; \ - } \ - else if ((PTR)[3] == 'n' && (PTR)[4] == 'z') \ - { \ - fprintf (STREAM, "repne"); \ - (PTR) += 5; \ - } \ - } \ -} - -/* Define macro used to output shift-double opcodes when the shift - count is in %cl. Some assemblers require %cl as an argument; - some don't. - - GAS requires the %cl argument, so override unx386.h. */ - -#undef SHIFT_DOUBLE_OMITS_COUNT -#define SHIFT_DOUBLE_OMITS_COUNT 0 - -/* Print opcodes the way that GAS expects them. */ -#define GAS_MNEMONICS 1 - -/* Names to predefine in the preprocessor for this target machine. */ - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-DNeXT -Dunix -D__MACH__ -D__LITTLE_ENDIAN__ \ - -D__ARCHITECTURE__=\"i386\" -Asystem=unix -Asystem=mach" - -/* This accounts for the return pc and saved fp on the i386. */ - -#define OBJC_FORWARDING_STACK_OFFSET 8 -#define OBJC_FORWARDING_MIN_OFFSET 8 - -/* We do not want a dot in internal labels. */ - -#undef LPREFIX -#define LPREFIX "L" - -#undef ASM_GENERATE_INTERNAL_LABEL -#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \ - sprintf ((BUF), "*%s%ld", (PREFIX), (long)(NUMBER)) - -#undef ASM_OUTPUT_INTERNAL_LABEL -#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ - fprintf (FILE, "%s%d:\n", PREFIX, NUM) - -/* Output to assembler file text saying following lines - may contain character constants, extra white space, comments, etc. */ - -#undef ASM_APP_ON -#define ASM_APP_ON "#APP\n" - -/* Output to assembler file text saying following lines - no longer contain unusual constructs. */ - -#undef ASM_APP_OFF -#define ASM_APP_OFF "#NO_APP\n" - -#undef ASM_OUTPUT_REG_PUSH -#define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \ - fprintf (FILE, "\tpushl %se%s\n", "%", reg_names[REGNO]) - -#undef ASM_OUTPUT_REG_POP -#define ASM_OUTPUT_REG_POP(FILE,REGNO) \ - fprintf (FILE, "\tpopl %se%s\n", "%", reg_names[REGNO]) - -/* This is being overridden because the default i386 configuration - generates calls to "_mcount". NeXT system libraries all use - "mcount". */ - -#undef FUNCTION_PROFILER -#define FUNCTION_PROFILER(FILE, LABELNO) \ -{ \ - if (flag_pic) \ - { \ - fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \ - LPREFIX, (LABELNO)); \ - fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \ - } \ - else \ - { \ - fprintf (FILE, "\tmovl $%sP%d,%%edx\n", LPREFIX, (LABELNO)); \ - fprintf (FILE, "\tcall mcount\n"); \ - } \ -} - -/* BEGIN Calling Convention CHANGES */ - -/* These changes violate the Intel/Unix ABI. Specifically, they - change the way that space for a block return value is passed to a - function. The ABI says that the pointer is passed on the stack. - We change to pass the pointer in %ebx. This makes the NeXT - Objective-C forwarding mechanism possible to implement on an i386. */ - -/* Do NOT pass address of structure values on the stack. */ - -#undef STRUCT_VALUE_INCOMING -#undef STRUCT_VALUE - -/* Pass them in %ebx. */ - -#undef STRUCT_VALUE_REGNUM -#define STRUCT_VALUE_REGNUM 3 - -/* Because we are passing the pointer in a register, we don't need to - rely on the callee to pop it. */ - -#undef RETURN_POPS_ARGS -#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ - ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE \ - ? 0 \ - : (TARGET_RTD \ - && (TYPE_ARG_TYPES (FUNTYPE) == 0 \ - || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \ - == void_type_node))) ? (SIZE) : 0) - -/* END Calling Convention CHANGES */ - -/* NeXT still uses old binutils that don't insert nops by default - when the .align directive demands to insert extra space in the text - segment. */ -#undef ASM_OUTPUT_ALIGN -#define ASM_OUTPUT_ALIGN(FILE,LOG) \ - if ((LOG)!=0) fprintf ((FILE), "\t.align %d,0x90\n", (LOG)) diff --git a/contrib/gcc/config/i386/osf1-ci.asm b/contrib/gcc/config/i386/osf1-ci.asm deleted file mode 100644 index a0f077304a82..000000000000 --- a/contrib/gcc/config/i386/osf1-ci.asm +++ /dev/null @@ -1,65 +0,0 @@ -! crti.s for OSF/1, x86; derived from sol2-ci.asm. - -! Copyright (C) 1993, 1998 Free Software Foundation, Inc. -! Written By Fred Fish, Nov 1992 -! -! This file 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. -! -! In addition to the permissions in the GNU General Public License, the -! Free Software Foundation gives you unlimited permission to link the -! compiled version of this file with other programs, and to distribute -! those programs without any restriction coming from the use of this -! file. (The General Public License restrictions do apply in other -! respects; for example, they cover modification of the file, and -! distribution when not linked into another program.) -! -! This file 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; see the file COPYING. If not, write to -! the Free Software Foundation, 59 Temple Place - Suite 330, -! Boston, MA 02111-1307, USA. -! -! As a special exception, if you link this library with files -! compiled with GCC to produce an executable, this does not cause -! the resulting executable to be covered by the GNU General Public License. -! This exception does not however invalidate any other reasons why -! the executable file might be covered by the GNU General Public License. -! - -! This file just supplies labeled starting points for the .init and .fini -! sections. It is linked in before the values-Xx.o files and also before -! crtbegin.o. - - .file "crti.s" - .ident "GNU C crti.s" - - .section .init - .globl _init - .type _init,@function -_init: - - .section .fini - .globl _fini - .type _fini,@function -_fini: - -.globl _init_init_routine -.data - .align 4 - .type _init_init_routine,@object - .size _init_init_routine,4 -_init_init_routine: - .long _init -.globl _init_fini_routine - .align 4 - .type _init_fini_routine,@object - .size _init_fini_routine,4 -_init_fini_routine: - .long _fini diff --git a/contrib/gcc/config/i386/osf1-cn.asm b/contrib/gcc/config/i386/osf1-cn.asm deleted file mode 100644 index a10298fd288f..000000000000 --- a/contrib/gcc/config/i386/osf1-cn.asm +++ /dev/null @@ -1,46 +0,0 @@ -! crtn.s for OSF/1, x86; derived from sol2-cn.asm. - -! Copyright (C) 1993, 1998 Free Software Foundation, Inc. -! Written By Fred Fish, Nov 1992 -! -! This file 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. -! -! In addition to the permissions in the GNU General Public License, the -! Free Software Foundation gives you unlimited permission to link the -! compiled version of this file with other programs, and to distribute -! those programs without any restriction coming from the use of this -! file. (The General Public License restrictions do apply in other -! respects; for example, they cover modification of the file, and -! distribution when not linked into another program.) -! -! This file 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; see the file COPYING. If not, write to -! the Free Software Foundation, 59 Temple Place - Suite 330, -! Boston, MA 02111-1307, USA. -! -! As a special exception, if you link this library with files -! compiled with GCC to produce an executable, this does not cause -! the resulting executable to be covered by the GNU General Public License. -! This exception does not however invalidate any other reasons why -! the executable file might be covered by the GNU General Public License. -! - -! This file just supplies returns for the .init and .fini sections. It is -! linked in after all other files. - - .file "crtn.o" - .ident "GNU C crtn.o" - - .section .init - ret $0x0 - - .section .fini - ret $0x0 diff --git a/contrib/gcc/config/i386/osf1elf.h b/contrib/gcc/config/i386/osf1elf.h deleted file mode 100644 index 812e9914a544..000000000000 --- a/contrib/gcc/config/i386/osf1elf.h +++ /dev/null @@ -1,213 +0,0 @@ -/* OSF/1 1.3 now is compitable with SVR4, so include sysv4.h, and - put difference here. - Copyright (C) 2000 Free Software Foundation, Inc. */ - -#include - -#undef TARGET_VERSION -#define TARGET_VERSION fprintf (stderr, " (i386 OSF/1)"); - -#define TARGET_OSF1ELF - -/* WORD_SWITCH_TAKES_ARG defined in svr4 is not correct. We also - need an extra -soname */ -#undef WORD_SWITCH_TAKES_ARG -#define WORD_SWITCH_TAKES_ARG(STR) \ - (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) \ - || !strcmp (STR, "Tdata") || !strcmp (STR, "Ttext") \ - || !strcmp (STR, "Tbss") || !strcmp (STR, "soname")) - -/* Note, -fpic and -fPIC are equivalent */ -#undef CPP_SPEC -#define CPP_SPEC "\ -%(cpp_cpu) \ -%{fpic: -D__SHARED__} %{fPIC: %{!fpic: -D__SHARED__}} \ -%{.S: %{!ansi:%{!traditional:%{!traditional-cpp:%{!ftraditional: -traditional}}}}} \ -%{.S: -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \ -%{.cc: -D__LANGUAGE_C_PLUS_PLUS} \ -%{.cxx: -D__LANGUAGE_C_PLUS_PLUS} \ -%{.C: -D__LANGUAGE_C_PLUS_PLUS} \ -%{.m: -D__LANGUAGE_OBJECTIVE_C} \ -%{!.S: -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}}" - -/* -mmcount or -mno-mcount should be used with -pg or -p */ -#undef CC1_SPEC -#define CC1_SPEC "%(cc1_cpu) %{p: %{!mmcount: %{!mno-mcount: -mno-mcount }}} \ -%{!p: %{pg: %{!mmcount: %{!mno-mcount: -mno-mcount }}}}" - -/* Note, -D__NO_UNDERSCORES__ -D__ELF__ are provided in the older version of - OSF/1 gcc. We keep them here, so that old /usr/include/i386/asm.h works. - */ -#undef CPP_PREDEFINES -#define CPP_PREDEFINES \ - "-D__NO_UNDERSCORES__ -D__ELF__ -DOSF -DOSF1 -Dunix \ - -Asystem=unix -Asystem=xpg4 -Asystem=osf1" - -/* current OSF/1 doesn't provide separate crti.o and gcrti.o (and also, crtn.o - and gcrtn.o) for profile. */ - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC "%{!shared: \ - %{!symbolic: \ - %{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}}\ - crti.o%s \ - crtbegin.o%s" - -#undef ENDFILE_SPEC -#define ENDFILE_SPEC "crtend.o%s crtn.o%s" - -#undef ASM_SPEC -#define ASM_SPEC "%{v*: -v}" - -#undef LINK_SPEC -#define LINK_SPEC "%{v*: -v} \ - %{h*} %{z*} \ - %{dy:-call_shared} %{dn:-static} \ - %{static:-static} \ - %{shared:-shared} \ - %{call_shared:-call_shared} \ - %{symbolic:-Bsymbolic -shared -call_shared} \ - %{!dy: %{!dn: %{!static: %{!shared: %{!symbolic: \ - %{noshrlib: -static } \ - %{!noshrlib: -call_shared}}}}}}" - -#undef MD_EXEC_PREFIX -#define MD_EXEC_PREFIX "/usr/ccs/gcc/" - -#undef MD_STARTFILE_PREFIX -#define MD_STARTFILE_PREFIX "/usr/ccs/lib/" - -/* Define this macro meaning that gcc should find the library 'libgcc.a' - by hand, rather than passing the argument '-lgcc' to tell the linker - to do the search */ -#define LINK_LIBGCC_SPECIAL - -/* This goes with LINK_LIBGCC_SPECIAL, we need tell libgcc.a differently */ -#undef LIBGCC_SPEC -#define LIBGCC_SPEC "%{!shared:%{!symbolic:libgcc.a%s}}" - -/* Specify size_t, ptrdiff_t, and wchar_t types. */ -#undef SIZE_TYPE -#undef PTRDIFF_TYPE -#undef WCHAR_TYPE -#undef WCHAR_TYPE_SIZE - -#define SIZE_TYPE "long unsigned int" -#define PTRDIFF_TYPE "int" -#define WCHAR_TYPE "unsigned int" -#define WCHAR_TYPE_SIZE BITS_PER_WORD - -/* Turn off long double being 96 bits. */ -#undef LONG_DOUBLE_TYPE_SIZE -#define LONG_DOUBLE_TYPE_SIZE 64 - -/* Work with OSF/1 profile */ -#define MASK_NO_MCOUNT 000200000000 /* profiling uses mcount_ptr */ - -#define TARGET_MCOUNT ((target_flags & MASK_NO_MCOUNT) == 0) - -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - { "mcount", -MASK_NO_MCOUNT, \ - N_("Profiling uses mcount") }, \ - { "no-mcount", MASK_NO_MCOUNT, "" }, - -/* This macro generates the assembly code for function entry. - FILE is a stdio stream to output the code to. - SIZE is an int: how many units of temporary storage to allocate. - Refer to the array `regs_ever_live' to determine which registers - to save; `regs_ever_live[I]' is nonzero if register number I - is ever used in the function. This macro is responsible for - knowing which registers should not be saved even if used. - - We override it here to allow for the new profiling code to go before - the prologue and the old mcount code to go after the prologue (and - after %ebx has been set up for ELF shared library support). */ -#if 0 -#define OSF_PROFILE_BEFORE_PROLOGUE \ - (!TARGET_MCOUNT \ - && !current_function_needs_context \ - && (!flag_pic \ - || !frame_pointer_needed \ - || (!current_function_uses_pic_offset_table \ - && !current_function_uses_const_pool))) -#else -#define OSF_PROFILE_BEFORE_PROLOGUE 0 -#endif - -/* A C statement or compound statement to output to FILE some assembler code to - call the profiling subroutine `mcount'. Before calling, the assembler code - must load the address of a counter variable into a register where `mcount' - expects to find the address. The name of this variable is `LP' followed by - the number LABELNO, so you would generate the name using `LP%d' in a - `fprintf'. - - The details of how the address should be passed to `mcount' are determined - by your operating system environment, not by GNU CC. To figure them out, - compile a small program for profiling using the system's installed C - compiler and look at the assembler code that results. */ - -#undef FUNCTION_PROFILER -#define FUNCTION_PROFILER(FILE, LABELNO) \ -do \ - { \ - if (!OSF_PROFILE_BEFORE_PROLOGUE) \ - { \ - const char *const prefix = ""; \ - const char *const lprefix = LPREFIX; \ - int labelno = LABELNO; \ - \ - /* Note that OSF/rose blew it in terms of calling mcount, \ - since OSF/rose prepends a leading underscore, but mcount's \ - doesn't. At present, we keep this kludge for ELF as well \ - to allow old kernels to build profiling. */ \ - \ - if (flag_pic \ - && !current_function_uses_pic_offset_table \ - && !current_function_uses_const_pool) \ - abort (); \ - \ - if (TARGET_MCOUNT && flag_pic) \ - { \ - fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \ - lprefix, labelno); \ - fprintf (FILE, "\tcall *%smcount@GOT(%%ebx)\n", prefix); \ - } \ - \ - else if (TARGET_MCOUNT) \ - { \ - fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \ - fprintf (FILE, "\tcall %smcount\n", prefix); \ - } \ - \ - else if (flag_pic && frame_pointer_needed) \ - { \ - fprintf (FILE, "\tmovl 4(%%ebp),%%ecx\n"); \ - fprintf (FILE, "\tpushl %%ecx\n"); \ - fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \ - lprefix, labelno); \ - fprintf (FILE, "\tmovl _mcount_ptr@GOT(%%ebx),%%eax\n"); \ - fprintf (FILE, "\tcall *(%%eax)\n"); \ - fprintf (FILE, "\tpopl %%eax\n"); \ - } \ - \ - else if (frame_pointer_needed) \ - { \ - fprintf (FILE, "\tmovl 4(%%ebp),%%ecx\n"); \ - fprintf (FILE, "\tpushl %%ecx\n"); \ - fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \ - fprintf (FILE, "\tcall *_mcount_ptr\n"); \ - fprintf (FILE, "\tpopl %%eax\n"); \ - } \ - \ - else \ - abort (); \ - } \ - } \ -while (0) - -#if defined (CROSS_COMPILE) && defined (HOST_BITS_PER_INT) && defined (HOST_BITS_PER_LONG) && defined (HOST_BITS_PER_LONGLONG) -#if (HOST_BITS_PER_INT==32) && (HOST_BITS_PER_LONG==64) && (HOST_BITS_PER_LONGLONG==64) -#define REAL_ARITHMETIC -#endif -#endif diff --git a/contrib/gcc/config/i386/osf1elfgdb.h b/contrib/gcc/config/i386/osf1elfgdb.h deleted file mode 100644 index 4071c66ce720..000000000000 --- a/contrib/gcc/config/i386/osf1elfgdb.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Target definitions for GNU compiler for Intel 80386 running OSF/1 1.3+ - with gas and gdb. */ - -/* Use stabs instead of DWARF debug format. */ -#undef PREFERRED_DEBUGGING_TYPE -#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG - diff --git a/contrib/gcc/config/i386/osfelf.h b/contrib/gcc/config/i386/osfelf.h deleted file mode 100644 index 9b0e63396bfd..000000000000 --- a/contrib/gcc/config/i386/osfelf.h +++ /dev/null @@ -1,79 +0,0 @@ -/* Definitions of target machine for GNU compiler. - Intel 386 (OSF/1 with ELF) version. - Copyright (C) 1993 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 "config/i386/osfrose.h" - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-DOSF -DOSF1 -Dunix -Asystem=xpg4" - -#undef CPP_SPEC -#define CPP_SPEC "%(cpp_cpu) \ -%{mrose: -D__ROSE__ %{!pic-none: -D__SHARED__}} \ -%{!mrose: -D__ELF__ %{fpic: -D__SHARED__}} \ -%{mno-underscores: -D__NO_UNDERSCORES__} \ -%{!mrose: %{!munderscores: -D__NO_UNDERSCORES__}} \ -%{.S: %{!ansi:%{!traditional:%{!traditional-cpp:%{!ftraditional: -traditional}}}}} \ -%{.S: -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \ -%{.cc: -D__LANGUAGE_C_PLUS_PLUS} \ -%{.cxx: -D__LANGUAGE_C_PLUS_PLUS} \ -%{.C: -D__LANGUAGE_C_PLUS_PLUS} \ -%{.m: -D__LANGUAGE_OBJECTIVE_C} \ -%{!.S: -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}}" - -/* Turn on -pic-extern by default for OSF/rose, -fpic for ELF. */ -#undef CC1_SPEC -#define CC1_SPEC "%(cc1_cpu) \ -%{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1}}}}} \ -%{!melf: %{!mrose: -melf }} \ -%{!mrose: %{!munderscores: %{!mno-underscores: -mno-underscores }} \ - %{!mmcount: %{!mno-mcount: %{!mmcount-ptr: -mmcount-ptr }}}} \ -%{mrose: %{!mmcount: %{!mno-mcount: %{!mmcount-ptr: -mmcount }}} \ - %{pic-extern: -mhalf-pic } %{pic-lib: -mhalf-pic } \ - %{!pic-extern: %{!pic-lib: %{pic-none: -mno-half-pic} %{!pic-none: -mhalf-pic}}} \ - %{pic-calls: } %{pic-names*: }}" - -#undef ASM_SPEC -#define ASM_SPEC "%{v*: -v}" - -#undef LINK_SPEC -#define LINK_SPEC "%{v*: -v} \ -%{mrose: %{!noshrlib: %{pic-none: -noshrlib} %{!pic-none: -warn_nopic}} \ - %{nostdlib} %{noshrlib} %{glue}} \ -%{!mrose: %{dy} %{dn} %{glue: } \ - %{h*} %{z*} \ - %{static:-dn -Bstatic} \ - %{shared:-G -dy} \ - %{symbolic:-Bsymbolic -G -dy} \ - %{G:-G} \ - %{!dy: %{!dn: %{!static: %{!shared: %{!symbolic: \ - %{noshrlib: -dn } %{pic-none: -dn } \ - %{!noshrlib: %{!pic-none: -dy}}}}}}}}" - -#undef TARGET_VERSION_INTERNAL -#undef TARGET_VERSION - -#undef I386_VERSION -#define I386_VERSION " 80386, ELF objects" - -#define TARGET_VERSION_INTERNAL(STREAM) fputs (I386_VERSION, STREAM) -#define TARGET_VERSION TARGET_VERSION_INTERNAL (stderr) - -#undef OBJECT_FORMAT_ROSE diff --git a/contrib/gcc/config/i386/osfrose.h b/contrib/gcc/config/i386/osfrose.h deleted file mode 100644 index 36d6345685b3..000000000000 --- a/contrib/gcc/config/i386/osfrose.h +++ /dev/null @@ -1,720 +0,0 @@ -/* Definitions of target machine for GNU compiler. - Intel 386 (OSF/1 with OSF/rose) version. - Copyright (C) 1991, 1992, 1993, 1996, 1998, 1999, 2000 - 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 "halfpic.h" -#include "i386/gstabs.h" - -#define OSF_OS - -#undef WORD_SWITCH_TAKES_ARG -#define WORD_SWITCH_TAKES_ARG(STR) \ - (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) || !strcmp (STR, "pic-names")) - -/* This defines which switch letters take arguments. On svr4, most of - the normal cases (defined in gcc.c) apply, and we also have -h* and - -z* options (for the linker). */ - -#define SWITCH_TAKES_ARG(CHAR) \ - (DEFAULT_SWITCH_TAKES_ARG(CHAR) \ - || (CHAR) == 'h' \ - || (CHAR) == 'z') - -#define MASK_HALF_PIC 010000000000 /* Mask for half-pic code */ -#define MASK_HALF_PIC_DEBUG 004000000000 /* Debug flag */ -#define MASK_ELF 002000000000 /* ELF not rose */ -#define MASK_NO_UNDERSCORES 000400000000 /* suppress leading _ */ -#define MASK_LARGE_ALIGN 000200000000 /* align to >word boundaries */ -#define MASK_NO_MCOUNT 000100000000 /* profiling uses mcount_ptr */ - -#define TARGET_HALF_PIC (target_flags & MASK_HALF_PIC) -#define TARGET_DEBUG (target_flags & MASK_HALF_PIC_DEBUG) -#define HALF_PIC_DEBUG TARGET_DEBUG -#define TARGET_ELF (target_flags & MASK_ELF) -#define TARGET_ROSE ((target_flags & MASK_ELF) == 0) -#define TARGET_UNDERSCORES ((target_flags & MASK_NO_UNDERSCORES) == 0) -#define TARGET_LARGE_ALIGN (target_flags & MASK_LARGE_ALIGN) -#define TARGET_MCOUNT ((target_flags & MASK_NO_MCOUNT) == 0) - -#undef SUBTARGET_SWITCHES -#define SUBTARGET_SWITCHES \ - { "half-pic", MASK_HALF_PIC, \ - N_("Emit half-PIC code") }, \ - { "no-half-pic", -MASK_HALF_PIC, "" }, \ - { "debug-half-pic", MASK_HALF_PIC_DEBUG, \ - 0 /* intentionally undoc */ }, \ - { "debugb", MASK_HALF_PIC_DEBUG, \ - 0 /* intentionally undoc */ }, \ - { "elf", MASK_ELF, \ - N_("Emit ELF object code") }, \ - { "rose", -MASK_ELF, \ - N_("Emit ROSE object code") }, \ - { "underscores", -MASK_NO_UNDERSCORES, \ - N_("Symbols have a leading underscore") }, \ - { "no-underscores", MASK_NO_UNDERSCORES, "" }, \ - { "large-align", MASK_LARGE_ALIGN, \ - N_("Align to >word boundaries") }, \ - { "no-large-align", -MASK_LARGE_ALIGN, "" }, \ - { "mcount", -MASK_NO_MCOUNT, \ - N_("Use mcount for profiling") }, \ - { "mcount-ptr", MASK_NO_MCOUNT, \ - N_("Use mcount_ptr for profiling") }, \ - { "no-mcount", MASK_NO_MCOUNT, "" }, - -/* OSF/rose uses stabs, not dwarf. */ -#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG - -#ifndef DWARF_DEBUGGING_INFO -#define DWARF_DEBUGGING_INFO /* enable dwarf debugging for testing */ -#endif - -/* Handle #pragma weak and #pragma pack. */ - -#define HANDLE_SYSV_PRAGMA -#define SUPPORTS_WEAK TARGET_ELF - -/* Change default predefines. */ -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-DOSF -DOSF1 -Dunix -Asystem=xpg4" - -#undef CPP_SPEC -#define CPP_SPEC "%(cpp_cpu) \ -%{!melf: -D__ROSE__ %{!pic-none: -D__SHARED__}} \ -%{melf: -D__ELF__ %{fpic: -D__SHARED__}} \ -%{mno-underscores: -D__NO_UNDERSCORES__} \ -%{melf: %{!munderscores: -D__NO_UNDERSCORES__}} \ -%{.S: %{!ansi:%{!traditional:%{!traditional-cpp:%{!ftraditional: -traditional}}}}} \ -%{.S: -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \ -%{.cc: -D__LANGUAGE_C_PLUS_PLUS} \ -%{.cxx: -D__LANGUAGE_C_PLUS_PLUS} \ -%{.C: -D__LANGUAGE_C_PLUS_PLUS} \ -%{.m: -D__LANGUAGE_OBJECTIVE_C} \ -%{!.S: -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}}" - -/* Turn on -pic-extern by default for OSF/rose, -fpic for ELF. */ -#undef CC1_SPEC -#define CC1_SPEC "%(cc1_cpu) \ -%{gline:%{!g:%{!g0:%{!g1:%{!g2: -g1}}}}} \ -%{!melf: %{!mrose: -mrose }} \ -%{melf: %{!munderscores: %{!mno-underscores: -mno-underscores }} \ - %{!mmcount: %{!mno-mcount: %{!mmcount-ptr: -mmcount-ptr }}}} \ -%{!melf: %{!munderscores: %{!mno-underscores: -munderscores }} \ - %{!mmcount: %{!mno-mcount: %{!mmcount-ptr: -mmcount }}} \ - %{pic-extern: -mhalf-pic } %{pic-lib: -mhalf-pic } \ - %{!pic-extern: %{!pic-lib: %{pic-none: -mno-half-pic} %{!pic-none: -mhalf-pic}}} \ - %{pic-calls: } %{pic-names*: }}" - -#undef ASM_SPEC -#define ASM_SPEC "%{v*: -v}" - -#undef LINK_SPEC -#define LINK_SPEC "%{v*: -v} \ -%{!melf: %{!noshrlib: %{pic-none: -noshrlib} %{!pic-none: -warn_nopic}} \ - %{nostdlib} %{noshrlib} %{glue}} \ -%{melf: %{dy} %{dn} %{glue: } \ - %{h*} %{z*} \ - %{static:-dn -Bstatic} \ - %{shared:-G -dy} \ - %{symbolic:-Bsymbolic -G -dy} \ - %{G:-G} \ - %{!dy: %{!dn: %{!static: %{!shared: %{!symbolic: \ - %{noshrlib: -dn } %{pic-none: -dn } \ - %{!noshrlib: %{!pic-none: -dy}}}}}}}}" - -#undef LIB_SPEC -#define LIB_SPEC "-lc" - -#undef LIBG_SPEC -#define LIBG_SPEC "" - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}" - -#undef TARGET_VERSION_INTERNAL -#undef TARGET_VERSION - -#define I386_VERSION " 80386, OSF/rose objects" - -#define TARGET_VERSION_INTERNAL(STREAM) fputs (I386_VERSION, STREAM) -#define TARGET_VERSION TARGET_VERSION_INTERNAL (stderr) - -#undef MD_EXEC_PREFIX -#define MD_EXEC_PREFIX "/usr/ccs/gcc/" - -#undef MD_STARTFILE_PREFIX -#define MD_STARTFILE_PREFIX "/usr/ccs/lib/" - -/* Specify size_t, ptrdiff_t, and wchar_t types. */ -#undef SIZE_TYPE -#undef PTRDIFF_TYPE -#undef WCHAR_TYPE -#undef WCHAR_TYPE_SIZE - -#define SIZE_TYPE "long unsigned int" -#define PTRDIFF_TYPE "int" -#define WCHAR_TYPE "unsigned int" -#define WCHAR_TYPE_SIZE BITS_PER_WORD - -/* Define this macro if the system header files support C++ as well - as C. This macro inhibits the usual method of using system header - files in C++, which is to pretend that the file's contents are - enclosed in `extern "C" {...}'. */ -#define NO_IMPLICIT_EXTERN_C - -/* Turn off long double being 96 bits. */ -#undef LONG_DOUBLE_TYPE_SIZE -#define LONG_DOUBLE_TYPE_SIZE 64 - -#define OSF_PROFILE_BEFORE_PROLOGUE \ - (!TARGET_MCOUNT \ - && !current_function_needs_context \ - && (!flag_pic \ - || !frame_pointer_needed \ - || (!current_function_uses_pic_offset_table \ - && !current_function_uses_const_pool))) - -/* A C statement or compound statement to output to FILE some assembler code to - call the profiling subroutine `mcount'. Before calling, the assembler code - must load the address of a counter variable into a register where `mcount' - expects to find the address. The name of this variable is `LP' followed by - the number LABELNO, so you would generate the name using `LP%d' in a - `fprintf'. - - The details of how the address should be passed to `mcount' are determined - by your operating system environment, not by GNU CC. To figure them out, - compile a small program for profiling using the system's installed C - compiler and look at the assembler code that results. */ - -#undef FUNCTION_PROFILER -#define FUNCTION_PROFILER(FILE, LABELNO) \ -do \ - { \ - if (!OSF_PROFILE_BEFORE_PROLOGUE) \ - { \ - const char *const prefix = (TARGET_UNDERSCORES) ? "_" : ""; \ - const char *const lprefix = LPREFIX; \ - int labelno = LABELNO; \ - \ - /* Note that OSF/rose blew it in terms of calling mcount, \ - since OSF/rose prepends a leading underscore, but mcount's \ - doesn't. At present, we keep this kludge for ELF as well \ - to allow old kernels to build profiling. */ \ - \ - if (flag_pic \ - && !current_function_uses_pic_offset_table \ - && !current_function_uses_const_pool) \ - abort (); \ - \ - if (TARGET_MCOUNT && flag_pic) \ - { \ - fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \ - lprefix, labelno); \ - fprintf (FILE, "\tcall *%smcount@GOT(%%ebx)\n", prefix); \ - } \ - \ - else if (TARGET_MCOUNT && HALF_PIC_P ()) \ - { \ - rtx symdef; \ - \ - HALF_PIC_EXTERNAL ("mcount"); \ - symdef = HALF_PIC_PTR (gen_rtx_SYMBOL_REF (Pmode, "mcount")); \ - fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \ - fprintf (FILE, "\tcall *%s%s\n", prefix, XSTR (symdef, 0)); \ - } \ - \ - else if (TARGET_MCOUNT) \ - { \ - fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \ - fprintf (FILE, "\tcall %smcount\n", prefix); \ - } \ - \ - else if (flag_pic && frame_pointer_needed) \ - { \ - fprintf (FILE, "\tmovl 4(%%ebp),%%ecx\n"); \ - fprintf (FILE, "\tpushl %%ecx\n"); \ - fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%edx\n", \ - lprefix, labelno); \ - fprintf (FILE, "\tmovl _mcount_ptr@GOT(%%ebx),%%eax\n"); \ - fprintf (FILE, "\tcall *(%%eax)\n"); \ - fprintf (FILE, "\tpopl %%eax\n"); \ - } \ - \ - else if (frame_pointer_needed) \ - { \ - fprintf (FILE, "\tmovl 4(%%ebp),%%ecx\n"); \ - fprintf (FILE, "\tpushl %%ecx\n"); \ - fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \ - fprintf (FILE, "\tcall *_mcount_ptr\n"); \ - fprintf (FILE, "\tpopl %%eax\n"); \ - } \ - \ - else \ - abort (); \ - } \ - } \ -while (0) - -/* A C function or functions which are needed in the library to - support block profiling. When support goes into libc, undo - the #if 0. */ - -#if 0 -#undef BLOCK_PROFILING_CODE -#define BLOCK_PROFILING_CODE -#endif - -/* Prefix for internally generated assembler labels. If we aren't using - underscores, we are using prefix `.'s to identify labels that should - be ignored, as in `i386/gas.h' --karl@cs.umb.edu */ -#undef LPREFIX -#define LPREFIX ((TARGET_UNDERSCORES) ? "L" : ".L") - -/* This is how to store into the string BUF - the symbol_ref name of an internal numbered label where - PREFIX is the class of label and NUM is the number within the class. - This is suitable for output with `assemble_name'. */ - -#undef ASM_GENERATE_INTERNAL_LABEL -#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \ - sprintf ((BUF), "*%s%s%ld", (TARGET_UNDERSCORES) ? "" : ".", \ - (PREFIX), (long)(NUMBER)) - -/* This is how to output an internal numbered label where - PREFIX is the class of label and NUM is the number within the class. */ - -#undef ASM_OUTPUT_INTERNAL_LABEL -#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ - fprintf (FILE, "%s%s%d:\n", (TARGET_UNDERSCORES) ? "" : ".", \ - PREFIX, NUM) - -/* The prefix to add to user-visible assembler symbols. */ - -/* target_flags is not accessible by the preprocessor */ -#undef USER_LABEL_PREFIX -#define USER_LABEL_PREFIX "_" - -/* This is how to output a reference to a user-level label named NAME. */ - -#undef ASM_OUTPUT_LABELREF -#define ASM_OUTPUT_LABELREF(FILE,NAME) \ - fprintf (FILE, "%s%s", (TARGET_UNDERSCORES) ? "_" : "", NAME) - -/* This is how to output an element of a case-vector that is relative. - This is only used for PIC code. See comments by the `casesi' insn in - i386.md for an explanation of the expression this outputs. */ - -#undef ASM_OUTPUT_ADDR_DIFF_ELT -#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \ - fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE) - -/* Output a definition */ -#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \ -do \ -{ \ - fprintf ((FILE), "%s", SET_ASM_OP); \ - assemble_name (FILE, LABEL1); \ - fprintf (FILE, ","); \ - assemble_name (FILE, LABEL2); \ - fprintf (FILE, "\n"); \ - } \ -while (0) - -/* A C expression to output text to align the location counter in the - way that is desirable at a point in the code that is reached only - by jumping. - - This macro need not be defined if you don't want any special - alignment to be done at such a time. Most machine descriptions do - not currently define the macro. */ - -#undef LABEL_ALIGN_AFTER_BARRIER -#define LABEL_ALIGN_AFTER_BARRIER(LABEL) \ - ((!TARGET_LARGE_ALIGN && i386_align_jumps > 2) ? 2 : i386_align_jumps) - -/* A C expression to output text to align the location counter in the - way that is desirable at the beginning of a loop. - - This macro need not be defined if you don't want any special - alignment to be done at such a time. Most machine descriptions do - not currently define the macro. */ - -#undef LOOP_ALIGN -#define LOOP_ALIGN(LABEL) (i386_align_loops) - -/* A C statement to output to the stdio stream STREAM an assembler - command to advance the location counter to a multiple of 2 to the - POWER bytes. POWER will be a C expression of type `int'. */ - -#undef ASM_OUTPUT_ALIGN -#define ASM_OUTPUT_ALIGN(STREAM, POWER) \ - fprintf (STREAM, "\t.align\t%d\n", \ - (!TARGET_LARGE_ALIGN && (POWER) > 2) ? 2 : (POWER)) - -/* A C expression that is 1 if the RTX X is a constant which is a - valid address. On most machines, this can be defined as - `CONSTANT_P (X)', but a few machines are more restrictive in - which constant addresses are supported. - - `CONSTANT_P' accepts integer-values expressions whose values are - not explicitly known, such as `symbol_ref', `label_ref', and - `high' expressions and `const' arithmetic expressions, in - addition to `const_int' and `const_double' expressions. */ - -#define CONSTANT_ADDRESS_P_ORIG(X) \ - (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \ - || GET_CODE (X) == CONST_INT || GET_CODE (X) == CONST \ - || GET_CODE (X) == HIGH) - -#undef CONSTANT_ADDRESS_P -#define CONSTANT_ADDRESS_P(X) \ - ((CONSTANT_ADDRESS_P_ORIG (X)) && (!HALF_PIC_P () || !HALF_PIC_ADDRESS_P (X))) - -/* Nonzero if the constant value X is a legitimate general operand. - It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE. */ - -#undef LEGITIMATE_CONSTANT_P -#define LEGITIMATE_CONSTANT_P(X) \ - (!HALF_PIC_P () \ - || GET_CODE (X) == CONST_DOUBLE \ - || GET_CODE (X) == CONST_INT \ - || !HALF_PIC_ADDRESS_P (X)) - -/* Sometimes certain combinations of command options do not make sense - on a particular target machine. You can define a macro - `OVERRIDE_OPTIONS' to take account of this. This macro, if - defined, is executed once just after all the command options have - been parsed. */ - -#undef SUBTARGET_OVERRIDE_OPTIONS -#define SUBTARGET_OVERRIDE_OPTIONS \ -{ \ - /* \ - if (TARGET_ELF && TARGET_HALF_PIC) \ - { \ - target_flags &= ~MASK_HALF_PIC; \ - flag_pic = 1; \ - } \ - */ \ - \ - if (TARGET_ROSE && flag_pic) \ - { \ - target_flags |= MASK_HALF_PIC; \ - flag_pic = 0; \ - } \ - \ - if (TARGET_HALF_PIC) \ - half_pic_init (); \ -} - -/* Define this macro if references to a symbol must be treated - differently depending on something about the variable or - function named by the symbol (such as what section it is in). - - The macro definition, if any, is executed immediately after the - rtl for DECL has been created and stored in `DECL_RTL (DECL)'. - The value of the rtl will be a `mem' whose address is a - `symbol_ref'. - - The usual thing for this macro to do is to a flag in the - `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified - name string in the `symbol_ref' (if one bit is not enough - information). - - The best way to modify the name string is by adding text to the - beginning, with suitable punctuation to prevent any ambiguity. - Allocate the new name in `saveable_obstack'. You will have to - modify `ASM_OUTPUT_LABELREF' to remove and decode the added text - and output the name accordingly. - - You can also check the information stored in the `symbol_ref' in - the definition of `GO_IF_LEGITIMATE_ADDRESS' or - `PRINT_OPERAND_ADDRESS'. */ - -#undef ENCODE_SECTION_INFO -#define ENCODE_SECTION_INFO(DECL) \ -do \ - { \ - if (HALF_PIC_P ()) \ - HALF_PIC_ENCODE (DECL); \ - \ - else if (flag_pic) \ - { \ - rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \ - ? TREE_CST_RTL (DECL) : DECL_RTL (DECL)); \ - SYMBOL_REF_FLAG (XEXP (rtl, 0)) \ - = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd' \ - || ! TREE_PUBLIC (DECL)); \ - } \ - } \ -while (0) - - -/* On most machines, read-only variables, constants, and jump tables - are placed in the text section. If this is not the case on your - machine, this macro should be defined to be the name of a function - (either `data_section' or a function defined in `EXTRA_SECTIONS') - that switches to the section to be used for read-only items. - - If these items should be placed in the text section, this macro - should not be defined. */ - -#if 0 -#undef READONLY_DATA_SECTION -#define READONLY_DATA_SECTION() \ -do \ - { \ - if (TARGET_ELF) \ - { \ - if (in_section != in_rodata) \ - { \ - fprintf (asm_out_file, "\t.section \"rodata\"\n"); \ - in_section = in_rodata; \ - } \ - } \ - else \ - text_section (); \ - } \ -while (0) -#endif - -/* A list of names for sections other than the standard two, which are - `in_text' and `in_data'. You need not define this macro on a - system with no other sections (that GCC needs to use). */ - -#undef EXTRA_SECTIONS -#define EXTRA_SECTIONS in_rodata, in_data1 - -/* Given a decl node or constant node, choose the section to output it in - and select that section. */ - -#undef SELECT_RTX_SECTION -#define SELECT_RTX_SECTION(MODE, RTX, ALIGN) \ -do \ - { \ - if (MODE == Pmode && HALF_PIC_P () && HALF_PIC_ADDRESS_P (RTX)) \ - data_section (); \ - else \ - readonly_data_section (); \ - } \ -while (0) - -#undef SELECT_SECTION -#define SELECT_SECTION(DECL, RELOC, ALIGN) \ -{ \ - if (RELOC && HALF_PIC_P ()) \ - data_section (); \ - \ - else if (TREE_CODE (DECL) == STRING_CST) \ - { \ - if (flag_writable_strings) \ - data_section (); \ - else \ - readonly_data_section (); \ - } \ - \ - else if (TREE_CODE (DECL) != VAR_DECL) \ - readonly_data_section (); \ - \ - else if (!TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL) \ - || !DECL_INITIAL (DECL) \ - || (DECL_INITIAL (DECL) != error_mark_node \ - && !TREE_CONSTANT (DECL_INITIAL (DECL)))) \ - data_section (); \ - \ - else \ - readonly_data_section (); \ -} - - -/* Define the strings used for the special svr4 .type and .size directives. - These strings generally do not vary from one system running svr4 to - another, but if a given system (e.g. m88k running svr) needs to use - different pseudo-op names for these, they may be overridden in the - file which includes this one. */ - -#define TYPE_ASM_OP "\t.type\t" -#define SIZE_ASM_OP "\t.size\t" -#define SET_ASM_OP "\t.set\t" - -/* This is how we tell the assembler that a symbol is weak. */ - -#define ASM_WEAKEN_LABEL(FILE,NAME) \ - do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \ - fputc ('\n', FILE); } while (0) - -/* The following macro defines the format used to output the second - operand of the .type assembler directive. Different svr4 assemblers - expect various different forms for this operand. The one given here - is just a default. You may need to override it in your machine- - specific tm.h file (depending upon the particulars of your assembler). */ - -#define TYPE_OPERAND_FMT "@%s" - -/* A C statement (sans semicolon) to output to the stdio stream - STREAM any text necessary for declaring the name NAME of an - initialized variable which is being defined. This macro must - output the label definition (perhaps using `ASM_OUTPUT_LABEL'). - The argument DECL is the `VAR_DECL' tree node representing the - variable. - - If this macro is not defined, then the variable name is defined - in the usual manner as a label (by means of `ASM_OUTPUT_LABEL'). */ - -#undef ASM_DECLARE_OBJECT_NAME -#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \ -do \ - { \ - ASM_OUTPUT_LABEL(STREAM,NAME); \ - HALF_PIC_DECLARE (NAME); \ - if (TARGET_ELF) \ - { \ - fprintf (STREAM, "%s", TYPE_ASM_OP); \ - assemble_name (STREAM, NAME); \ - putc (',', STREAM); \ - fprintf (STREAM, TYPE_OPERAND_FMT, "object"); \ - putc ('\n', STREAM); \ - size_directive_output = 0; \ - if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \ - { \ - size_directive_output = 1; \ - fprintf (STREAM, "%s", SIZE_ASM_OP); \ - assemble_name (STREAM, NAME); \ - fprintf (STREAM, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \ - } \ - } \ - } \ -while (0) - -/* Output the size directive for a decl in rest_of_decl_compilation - in the case where we did not do so before the initializer. - Once we find the error_mark_node, we know that the value of - size_directive_output was set - by ASM_DECLARE_OBJECT_NAME when it was run for the same decl. */ - -#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \ -do { \ - const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \ - if (TARGET_ELF \ - && !flag_inhibit_size_directive && DECL_SIZE (DECL) \ - && ! AT_END && TOP_LEVEL \ - && DECL_INITIAL (DECL) == error_mark_node \ - && !size_directive_output) \ - { \ - fprintf (FILE, "%s", SIZE_ASM_OP); \ - assemble_name (FILE, name); \ - fprintf (FILE, ",%d\n", int_size_in_bytes (TREE_TYPE (DECL))); \ - } \ - } while (0) - -/* This is how to declare a function name. */ - -#undef ASM_DECLARE_FUNCTION_NAME -#define ASM_DECLARE_FUNCTION_NAME(STREAM,NAME,DECL) \ -do \ - { \ - ASM_OUTPUT_LABEL(STREAM,NAME); \ - HALF_PIC_DECLARE (NAME); \ - if (TARGET_ELF) \ - { \ - fprintf (STREAM, "%s", TYPE_ASM_OP); \ - assemble_name (STREAM, NAME); \ - putc (',', STREAM); \ - fprintf (STREAM, TYPE_OPERAND_FMT, "function"); \ - putc ('\n', STREAM); \ - ASM_DECLARE_RESULT (STREAM, DECL_RESULT (DECL)); \ - } \ - } \ -while (0) - -/* Write the extra assembler code needed to declare a function's result. - Most svr4 assemblers don't require any special declaration of the - result value, but there are exceptions. */ - -#ifndef ASM_DECLARE_RESULT -#define ASM_DECLARE_RESULT(FILE, RESULT) -#endif - -/* This is how to declare the size of a function. */ - -#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ -do \ - { \ - if (TARGET_ELF && !flag_inhibit_size_directive) \ - { \ - char label[256]; \ - static int labelno; \ - labelno++; \ - ASM_GENERATE_INTERNAL_LABEL (label, "Lfe", labelno); \ - ASM_OUTPUT_INTERNAL_LABEL (FILE, "Lfe", labelno); \ - fprintf (FILE, "%s", SIZE_ASM_OP); \ - assemble_name (FILE, (FNAME)); \ - fprintf (FILE, ","); \ - assemble_name (FILE, label); \ - fprintf (FILE, "-"); \ - assemble_name (FILE, (FNAME)); \ - putc ('\n', FILE); \ - } \ - } \ -while (0) - -#define IDENT_ASM_OP "\t.ident\t" - -/* Allow #sccs in preprocessor. */ - -#define SCCS_DIRECTIVE - -/* This says what to print at the end of the assembly file */ -#undef ASM_FILE_END -#define ASM_FILE_END(STREAM) \ -do \ - { \ - if (HALF_PIC_P ()) \ - HALF_PIC_FINISH (STREAM); \ - ix86_asm_file_end (STREAM); \ - } \ -while (0) - -/* Tell collect that the object format is OSF/rose. */ -#define OBJECT_FORMAT_ROSE - -/* Tell collect where the appropriate binaries are. */ -#define REAL_NM_FILE_NAME "/usr/ccs/gcc/bfd-nm" -#define REAL_STRIP_FILE_NAME "/usr/ccs/bin/strip" - -/* Define this macro meaning that gcc should find the library 'libgcc.a' - by hand, rather than passing the argument '-lgcc' to tell the linker - to do the search */ -#define LINK_LIBGCC_SPECIAL - -/* Generate calls to memcpy, etc., not bcopy, etc. */ -#define TARGET_MEM_FUNCTIONS - -/* Don't default to pcc-struct-return, because gcc is the only compiler, and - we want to retain compatibility with older gcc versions. */ -#define DEFAULT_PCC_STRUCT_RETURN 0 - -/* Map i386 registers to the numbers dwarf expects. Of course this is - different from what stabs expects. */ - -#undef DBX_REGISTER_NUMBER -#define DBX_REGISTER_NUMBER(n) ((write_symbols == DWARF_DEBUG) \ - ? svr4_dbx_register_map[n] \ - : dbx_register_map[n]) diff --git a/contrib/gcc/config/i386/rtems.h b/contrib/gcc/config/i386/rtems.h deleted file mode 100644 index 0fda63220ef3..000000000000 --- a/contrib/gcc/config/i386/rtems.h +++ /dev/null @@ -1,25 +0,0 @@ -/* Definitions for rtems targeting an Intel i386 using coff. - Copyright (C) 1996, 1997, 2000, 2002 Free Software Foundation, Inc. - Contributed by Joel Sherrill (joel@OARcorp.com). - -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. */ - -/* Specify predefined symbols in preprocessor. */ - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-D__rtems__ -Asystem=rtems" diff --git a/contrib/gcc/config/i386/seq-gas.h b/contrib/gcc/config/i386/seq-gas.h deleted file mode 100644 index d11c4c1f388f..000000000000 --- a/contrib/gcc/config/i386/seq-gas.h +++ /dev/null @@ -1,46 +0,0 @@ -/* Definitions for Sequent Intel 386 using GAS. - Copyright (C) 1992 Free Software Foundation, Inc. - -/* Mostly it's like a Sequent 386 without GAS. */ - -#include "i386/sequent.h" - -/* A C statement or statements which output an assembler instruction - opcode to the stdio stream STREAM. The macro-operand PTR is a - variable of type `char *' which points to the opcode name in its - "internal" form--the form that is written in the machine description. - - GAS version 1.38.1 doesn't understand the `repz' opcode mnemonic. - So use `repe' instead. */ - -#undef ASM_OUTPUT_OPCODE -#define ASM_OUTPUT_OPCODE(STREAM, PTR) \ -{ \ - if ((PTR)[0] == 'r' \ - && (PTR)[1] == 'e' \ - && (PTR)[2] == 'p') \ - { \ - if ((PTR)[3] == 'z') \ - { \ - fprintf (STREAM, "repe"); \ - (PTR) += 4; \ - } \ - else if ((PTR)[3] == 'n' && (PTR)[4] == 'z') \ - { \ - fprintf (STREAM, "repne"); \ - (PTR) += 5; \ - } \ - } \ -} - -/* Define macro used to output shift-double opcodes when the shift - count is in %cl. Some assemblers require %cl as an argument; - some don't. - - GAS requires the %cl argument, so override i386/unix.h. */ - -#undef SHIFT_DOUBLE_OMITS_COUNT -#define SHIFT_DOUBLE_OMITS_COUNT 0 - -/* Print opcodes the way that GAS expects them. */ -#define GAS_MNEMONICS 1 diff --git a/contrib/gcc/config/i386/seq-sysv3.h b/contrib/gcc/config/i386/seq-sysv3.h deleted file mode 100644 index c8e75927dfc7..000000000000 --- a/contrib/gcc/config/i386/seq-sysv3.h +++ /dev/null @@ -1,45 +0,0 @@ -/* Sequent DYNIX/ptx 1.x (SVr3) */ - -#include "i386/sysv3.h" - -/* Sequent Symmetry SVr3 doesn't have crtn.o; crt1.o doesn't work - but crt0.o does. */ - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC \ -"%{pg:gcrt0.o%s}\ - %{!pg:%{posix:%{p:mcrtp0.o%s}%{!p:crtp0.o%s}}\ - %{!posix:%{p:mcrt0.o%s}%{!p:crt0.o%s}}} crtbegin.o%s\ - %{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp}" - -#undef LIB_SPEC -#define LIB_SPEC \ -"%{posix:-lcposix}\ - %{shlib:-lc_s}\ - %{fshared-data:-lpps -lseq} -lc crtend.o%s" - -#undef CPP_SPEC -#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} -D_SEQUENT_=1" - -/* Although the .init section is used, it is not automatically invoked. - This because the _start() function in /lib/crt0.o never calls anything - from the .init section */ -#define INVOKE__main - -/* Assembler pseudo-op for initialized shared variables (.shdata). */ -#undef SHARED_SECTION_ASM_OP -#define SHARED_SECTION_ASM_OP "\t.section .shdata, \"ws\"" - -/* Assembler pseudo-op for uninitialized shared global variables (.shbss). */ -#undef ASM_OUTPUT_SHARED_COMMON -#define ASM_OUTPUT_SHARED_COMMON(FILE, NAME, SIZE, ROUNDED) \ -( fputs(".comm ", (FILE)), \ - assemble_name((FILE), (NAME)), \ - fprintf((FILE), ",%u,-3\n", (SIZE))) - -/* Assembler pseudo-op for uninitialized shared local variables (.shbss). */ -#undef SHARED_BSS_SECTION_ASM_OP -#define SHARED_BSS_SECTION_ASM_OP "\t.section .shbss, \"bs\"" - -/* seq2-sysv3.h used to define HAVE_ATEXIT, so I assume ptx1 needs this... */ -#define NEED_ATEXIT diff --git a/contrib/gcc/config/i386/seq2-sysv3.h b/contrib/gcc/config/i386/seq2-sysv3.h deleted file mode 100644 index dd43af707a04..000000000000 --- a/contrib/gcc/config/i386/seq2-sysv3.h +++ /dev/null @@ -1,7 +0,0 @@ -/* Sequent DYNIX/ptx 2.x (SVr3) */ - -#include "i386/seq-sysv3.h" - -/* Use atexit for static destructors, instead of defining - our own exit function. */ -#undef NEED_ATEXIT diff --git a/contrib/gcc/config/i386/sequent.h b/contrib/gcc/config/i386/sequent.h deleted file mode 100644 index cffc50ae1e22..000000000000 --- a/contrib/gcc/config/i386/sequent.h +++ /dev/null @@ -1,147 +0,0 @@ -/* Definitions for Sequent Intel 386. - Copyright (C) 1988, 1994, 1999, 2000 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 "i386/i386.h" - -/* Use the BSD assembler syntax. */ - -#include "i386/bsd.h" - -/* By default, don't use IEEE compatible arithmetic comparisons - because the assembler can't handle the fucom insn. - Return float values in the 387. */ - -#undef TARGET_SUBTARGET_DEFAULT -#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_FLOAT_RETURNS) - -/* Specify predefined symbols in preprocessor. */ - -#define CPP_PREDEFINES "-Dunix -Dsequent -Asystem=unix" - -/* Pass -Z and -ZO options to the linker. */ - -#define LINK_SPEC "%{Z*}" - -#if 0 /* Dynix 3.1 is said to accept -L. */ -/* Dynix V3.0.12 doesn't accept -L at all. */ - -#define LINK_LIBGCC_SPECIAL -#endif - -/* Link with libg.a when debugging, for dbx's sake. */ - -#define LIB_SPEC "%{g:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} " - -/* We don't want to output SDB debugging information. */ - -#undef SDB_DEBUGGING_INFO - -/* We want to output DBX debugging information. */ - -#define DBX_DEBUGGING_INFO - -/* Sequent Symmetry has size_t defined as int in /usr/include/sys/types.h */ -#define SIZE_TYPE "int" - -/* gcc order is ax, dx, cx, bx, si, di, bp, sp, st, st. - * dbx order is ax, dx, cx, st(0), st(1), bx, si, di, st(2), st(3), - * st(4), st(5), st(6), st(7), sp, bp */ - -#undef DBX_REGISTER_NUMBER -#define DBX_REGISTER_NUMBER(n) \ -((n) < 3 ? (n) : (n) < 6 ? (n) + 2 \ - : (n) == 6 ? 15 : (n) == 7 ? 14 : 3) - -/* malcolmp@hydra.maths.unsw.EDU.AU says these two definitions - fix trouble in dbx. */ -#undef DBX_OUTPUT_LBRAC -#define DBX_OUTPUT_LBRAC(file,name) \ - fprintf (asmfile, "%s%d,0,%d,", ASM_STABN_OP, N_LBRAC, depth); \ - assemble_name (asmfile, buf); \ - fprintf (asmfile, "\n"); - -#undef DBX_OUTPUT_RBRAC -#define DBX_OUTPUT_RBRAC(file,name) \ - fprintf (asmfile, "%s%d,0,%d,", ASM_STABN_OP, N_RBRAC, depth); \ - assemble_name (asmfile, buf); \ - fprintf (asmfile, "\n"); - -/* Prevent anything from being allocated in the register pair cx/bx, - since that would confuse GDB. */ - -#undef HARD_REGNO_MODE_OK -#define HARD_REGNO_MODE_OK(REGNO, MODE) \ - (((REGNO) < 2 ? 1 \ - : (REGNO) < 4 ? 1 \ - : FP_REGNO_P (REGNO) ? (GET_MODE_CLASS (MODE) == MODE_FLOAT \ - || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) \ - : (MODE) != QImode) \ - && ! (REGNO == 2 && GET_MODE_UNIT_SIZE (MODE) > 4)) - -/* Output assembler code to FILE to increment profiler label # LABELNO - for profiling a function entry. */ - -#undef FUNCTION_PROFILER -#define FUNCTION_PROFILER(FILE, LABELNO) \ - fprintf (FILE, "\tmovl $.LP%d,%%eax\n\tcall mcount\n", (LABELNO)); - -/* Assembler pseudo-op for shared data segment. */ -#define SHARED_SECTION_ASM_OP "\t.shdata" - -/* A C statement or statements which output an assembler instruction - opcode to the stdio stream STREAM. The macro-operand PTR is a - variable of type `char *' which points to the opcode name in its - "internal" form--the form that is written in the machine description. - - The Sequent assembler (identified as "Balance 8000 Assembler - 07/17/85 3.90" by "as -v") does not understand the `movs[bwl]' string - move mnemonics - it uses `smov[bwl]' instead. Change "movs" into - "smov", carefully avoiding the sign-extend opcodes. */ - -#define ASM_OUTPUT_OPCODE(STREAM, PTR) \ -{ \ - if ((PTR)[0] == 'm' \ - && (PTR)[1] == 'o' \ - && (PTR)[2] == 'v' \ - && (PTR)[3] == 's' \ - && ((PTR)[4] == 'b' || (PTR)[4] == 'w' || (PTR)[4] == 'l') \ - && ((PTR)[5] == ' ' || (PTR)[5] == '\t'|| (PTR)[5] == '\0')) \ - { \ - fprintf (STREAM, "smov"); \ - (PTR) += 4; \ - } \ -} - -/* 10-Aug-92 pes Local labels are prefixed with ".L" */ -#undef LPREFIX -#define LPREFIX ".L" - -#undef ASM_GENERATE_INTERNAL_LABEL -#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER)\ - sprintf ((BUF), "*.%s%ld", (PREFIX), (long)(NUMBER)) - -#undef ASM_OUTPUT_INTERNAL_LABEL -#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)\ - fprintf (FILE, ".%s%d:\n", PREFIX, NUM) - -/* The native compiler passes the address of the returned structure in eax. */ -#undef STRUCT_VALUE -#undef STRUCT_VALUE_INCOMING -#define STRUCT_VALUE_REGNUM 0 diff --git a/contrib/gcc/config/i386/sol2gas.h b/contrib/gcc/config/i386/sol2gas.h deleted file mode 100644 index f8ca103f8e1c..000000000000 --- a/contrib/gcc/config/i386/sol2gas.h +++ /dev/null @@ -1,11 +0,0 @@ -/* Definitions of target machine for GNU compiler, for SPARC running - Solaris 2 with GNU as up to 2.9.5.0.12. - - Copyright (C) 1999 Free Software Foundation, Inc. -*/ - -#ifndef GAS_REJECTS_MINUS_S -#define GAS_REJECTS_MINUS_S 1 -#endif - -/* Assume sol2.h will be included afterwards. */ diff --git a/contrib/gcc/config/i386/sun.h b/contrib/gcc/config/i386/sun.h deleted file mode 100644 index de40abb35a39..000000000000 --- a/contrib/gcc/config/i386/sun.h +++ /dev/null @@ -1,83 +0,0 @@ -/* Definitions for Intel 386 running SunOS 4.0. - Copyright (C) 1988, 1995 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 "i386/i386.h" - -/* Use the Sun assembler syntax. */ - -#include "i386/sun386.h" - -/* Use crt0.o as a startup file. */ - -#define STARTFILE_SPEC \ - "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}" - -#define LIB_SPEC "%{g:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p} \ -%{g:-lg} %{sun386:}" -/* That last item is just to prevent a spurious error. */ - -#undef LINK_SPEC -#define LINK_SPEC \ - "%{!nostdlib:%{!r*:%{!e*:-e _start}}} -dc -dp %{static:-Bstatic}" - -/* Extra switches to give the assembler. */ - -#define ASM_SPEC "%{R} -i386 %{keep-local-as-symbols:-L}" - -/* Specify predefined symbols in preprocessor. */ - -#define CPP_PREDEFINES "-Dunix -Dsun386 -Dsun -Asystem=unix -Asystem=bsd" - -/* Allow #sccs in preprocessor. */ - -#define SCCS_DIRECTIVE - -/* Output #ident as a .ident. */ - -#define ASM_OUTPUT_IDENT(FILE, NAME) fprintf (FILE, "\t.ident \"%s\"\n", NAME); - -/* We don't want to output SDB debugging information. */ - -#undef SDB_DEBUGGING_INFO - -/* We want to output DBX debugging information. */ - -#define DBX_DEBUGGING_INFO - -/* Implicit library calls should use memcpy, not bcopy, etc. */ - -#define TARGET_MEM_FUNCTIONS - -/* Force structure alignment to the type used for a bitfield. */ - -#define PCC_BITFIELD_TYPE_MATTERS 1 - -/* This is partly guess. */ - -#undef DBX_REGISTER_NUMBER -#define DBX_REGISTER_NUMBER(n) \ - ((n) == 0 ? 11 : (n) == 1 ? 9 : (n) == 2 ? 10 : (n) == 3 ? 8 \ - : (n) == 4 ? 5 : (n) == 5 ? 4 : (n) == 6 ? 6 : (n)) - -/* Every debugger symbol must be in the text section. - Otherwise the assembler or the linker screws up. */ - -#define DEBUG_SYMS_TEXT diff --git a/contrib/gcc/config/i386/sun386.h b/contrib/gcc/config/i386/sun386.h deleted file mode 100644 index d280d583cbee..000000000000 --- a/contrib/gcc/config/i386/sun386.h +++ /dev/null @@ -1,141 +0,0 @@ -/* Definitions for Sun assembler syntax for the Intel 80386. - Copyright (C) 1988, 1996, 2000 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 common aspects of all 386 Unix assemblers. */ -#include "i386/unix.h" - -#define TARGET_VERSION fprintf (stderr, " (80386, Sun syntax)"); - -/* Define the syntax of instructions and addresses. */ - -/* Prefix for internally generated assembler labels. */ -#define LPREFIX ".L" - -/* Define the syntax of pseudo-ops, labels and comments. */ - -/* Assembler pseudos to introduce constants of various size. */ - -#define ASM_SHORT "\t.value\t" -#define ASM_LONG "\t.long\t" -#define ASM_QUAD "\t.quad\t" /* Should not be used for 32bit compilation. */ - - -/* How to output an ASCII string constant. */ - -#define ASM_OUTPUT_ASCII(FILE, PTR, SIZE) \ -do \ -{ size_t i = 0, limit = (SIZE); \ - while (i < limit) \ - { if (i%10 == 0) { if (i!=0) fprintf ((FILE), "\n"); \ - fputs ("\t.byte\t", (FILE)); } \ - else fprintf ((FILE), ","); \ - fprintf ((FILE), "0x%x", ((PTR)[i++] & 0377)) ;} \ - fprintf ((FILE), "\n"); \ -} while (0) - -/* Output at beginning of assembler file. */ -/* The .file command should always begin the output. */ - -#undef ASM_FILE_START -#define ASM_FILE_START(FILE) \ - do { \ - { \ - const int len = strlen (main_input_filename); \ - const char *na = main_input_filename + len; \ - char shorter[15]; \ - /* NA gets MAIN_INPUT_FILENAME sans directory names. */\ - while (na > main_input_filename) \ - { \ - if (na[-1] == '/') \ - break; \ - na--; \ - } \ - strncpy (shorter, na, 14); \ - shorter[14] = 0; \ - fprintf (FILE, "\t.file\t"); \ - output_quoted_string (FILE, shorter); \ - fprintf (FILE, "\n"); \ - } \ - fprintf (FILE, "\t.version\t\"%s %s\"\n", \ - lang_hooks.name, version_string); \ - if (optimize) ASM_FILE_START_1 (FILE); \ - } while (0) - -#define ASM_FILE_START_1(FILE) fprintf (FILE, "\t.optim\n") - -/* This is how to output an assembler line - that says to advance the location counter - to a multiple of 2**LOG bytes. */ - -#define ASM_OUTPUT_ALIGN(FILE,LOG) \ - if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG)) - -/* This is how to output an assembler line - that says to advance the location counter by SIZE bytes. */ - -#define ASM_OUTPUT_SKIP(FILE,SIZE) \ - fprintf ((FILE), "\t.set\t.,.+%u\n", (SIZE)) - -/* Output before read-only data. */ - -#undef TEXT_SECTION_ASM_OP -#define TEXT_SECTION_ASM_OP "\t.text" - -/* Output before writable data. */ - -#undef DATA_SECTION_ASM_OP -#define DATA_SECTION_ASM_OP "\t.data" - -/* Define the syntax of labels and symbol definitions/declarations. */ - -/* This says how to output an assembler line - to define a global common symbol. */ - -#define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \ -( fputs (".comm ", (FILE)), \ - assemble_name ((FILE), (NAME)), \ - fprintf ((FILE), ",%u\n", (ROUNDED))) - -/* This says how to output an assembler line - to define a local common symbol. */ - -#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ -( fputs (".lcomm ", (FILE)), \ - assemble_name ((FILE), (NAME)), \ - fprintf ((FILE), ",%u\n", (ROUNDED))) - -/* This is how to store into the string BUF - the symbol_ref name of an internal numbered label where - PREFIX is the class of label and NUM is the number within the class. - This is suitable for output with `assemble_name'. */ - -#define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER) \ - sprintf ((BUF), "*.%s%ld", (PREFIX), (long)(NUMBER)) - -/* The prefix to add to user-visible assembler symbols. */ - -#define USER_LABEL_PREFIX "" - -/* This is how to output an internal numbered label where - PREFIX is the class of label and NUM is the number within the class. */ - -#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \ - fprintf (FILE, ".%s%d:\n", PREFIX, NUM) diff --git a/contrib/gcc/config/i386/t-dgux b/contrib/gcc/config/i386/t-dgux deleted file mode 100644 index e1bccee610fb..000000000000 --- a/contrib/gcc/config/i386/t-dgux +++ /dev/null @@ -1,11 +0,0 @@ -# -# target makefile for dgux -# -EXTRA_PARTS=crti.o crtbegin.o crtend.o - -crti.o: $(srcdir)/config/i386/sol2-ci.asm $(GCC_PASSES) - sed -e '/^!/d' <$(srcdir)/config/i386/sol2-ci.asm >crti.s - $(GCC_FOR_TARGET) -c -o crti.o crti.s - -# Don't run fixproto -STMP_FIXPROTO = diff --git a/contrib/gcc/config/i386/t-next b/contrib/gcc/config/i386/t-next deleted file mode 100644 index 4b70ba78ae0f..000000000000 --- a/contrib/gcc/config/i386/t-next +++ /dev/null @@ -1,8 +0,0 @@ -# Specify other dirs of system header files to be fixed. -OTHER_FIXINCLUDES_DIRS= /LocalDeveloper/Headers - -# is sometimes in /usr/include/ansi/limits.h. -LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h -o -f $(SYSTEM_HEADER_DIR)/ansi/limits.h ] - -nextstep.o: $(srcdir)/config/nextstep.c $(CONFIG_H) flags.h tree.h - $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/nextstep.c diff --git a/contrib/gcc/config/i386/t-osf b/contrib/gcc/config/i386/t-osf deleted file mode 100644 index c996e0c9e77b..000000000000 --- a/contrib/gcc/config/i386/t-osf +++ /dev/null @@ -1,2 +0,0 @@ -# If compiling with the osf gcc, avoid sharing code. -TCFLAGS = -pic-none diff --git a/contrib/gcc/config/i386/t-osf1elf b/contrib/gcc/config/i386/t-osf1elf deleted file mode 100644 index 77c7df1a6dfd..000000000000 --- a/contrib/gcc/config/i386/t-osf1elf +++ /dev/null @@ -1,18 +0,0 @@ -# Assemble startup files. -crti.o: $(srcdir)/config/i386/osf1-ci.asm $(GCC_PASSES) - sed -e '/^!/d' <$(srcdir)/config/i386/osf1-ci.asm >crti.s - $(GCC_FOR_TARGET) -c -o crti.o crti.s -crtn.o: $(srcdir)/config/i386/osf1-cn.asm $(GCC_PASSES) - sed -e '/^!/d' <$(srcdir)/config/i386/osf1-cn.asm >crtn.s - $(GCC_FOR_TARGET) -c -o crtn.o crtn.s - -# The pushl in CTOR initialization interferes with frame pointer elimination. - -# We need to use -fPIC when we are using gcc to compile the routines in -# crtstuff.c. This is only really needed when we are going to use gcc/g++ -# to produce a shared library, but since we don't know ahead of time when -# we will be doing that, we just always use -fPIC when compiling the -# routines in crtstuff.c. - -CRTSTUFF_T_CFLAGS = -fPIC -fno-omit-frame-pointer -TARGET_LIBGCC2_CFLAGS = -fPIC diff --git a/contrib/gcc/config/i386/t-sco5gas b/contrib/gcc/config/i386/t-sco5gas deleted file mode 100644 index edeb554eea09..000000000000 --- a/contrib/gcc/config/i386/t-sco5gas +++ /dev/null @@ -1,23 +0,0 @@ -# The pushl in CTOR initialization interferes with frame pointer elimination. -CRTSTUFF_T_CFLAGS = -fPIC -fno-omit-frame-pointer -CRTSTUFF_T_CFLAGS_S = -fno-omit-frame-pointer - -# -# I am still a little unsure of the multilib architecture. The following -# 4 lines are based on advice from meissner@cygnus.com. -# -MULTILIB_OPTIONS = fPIC -MULTILIB_DIRNAMES = pic -MULTILIB_EXCEPTIONS = *fPIC* -MULTILIB_MATCHES = fPIC=fpic -MULTILIB_EXTRA_OPTS = - -LIBGCC=stmp-multilib -INSTALL_LIBGCC=install-multilib - -crti.o: $(srcdir)/config/i386/sol2-ci.asm $(GCC_PASSES) - sed -e '/^!/d' <$(srcdir)/config/i386/sol2-ci.asm >crti.s - $(GCC_FOR_TARGET) -c -o crti.o crti.s - -# See all the declarations. -FIXPROTO_DEFINES = -D_XOPEN_SOURCE -D_POSIX_C_SOURCE=2 diff --git a/contrib/gcc/config/i386/v3gas.h b/contrib/gcc/config/i386/v3gas.h deleted file mode 100644 index a350ab40bcd3..000000000000 --- a/contrib/gcc/config/i386/v3gas.h +++ /dev/null @@ -1,80 +0,0 @@ -/* Definitions for Intel 386 running system V, using gas. - Copyright (C) 1992, 1995 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 - -/* Add stuff that normally comes from i386v.h */ - -/* longjmp may fail to restore the registers if called from the same - function that called setjmp. To compensate, the compiler avoids - putting variables in registers in functions that use both setjmp - and longjmp. */ - -#define NON_SAVING_SETJMP \ - (current_function_calls_setjmp && current_function_calls_longjmp) - -/* longjmp may fail to restore the stack pointer if the saved frame - pointer is the same as the caller's frame pointer. Requiring a frame - pointer in any function that calls setjmp or longjmp avoids this - problem, unless setjmp and longjmp are called from the same function. - Since a frame pointer will be required in such a function, it is OK - that the stack pointer is not restored. */ - -#undef SUBTARGET_FRAME_POINTER_REQUIRED -#define SUBTARGET_FRAME_POINTER_REQUIRED \ - (current_function_calls_setjmp || current_function_calls_longjmp) - -/* Modify ASM_OUTPUT_LOCAL slightly to test -msvr3-shlib, adapted to gas */ -#undef ASM_OUTPUT_LOCAL -#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ - do { \ - int align = exact_log2 (ROUNDED); \ - if (align > 2) align = 2; \ - if (TARGET_SVR3_SHLIB) \ - { \ - data_section (); \ - ASM_OUTPUT_ALIGN ((FILE), align == -1 ? 2 : align); \ - ASM_OUTPUT_LABEL ((FILE), (NAME)); \ - fprintf ((FILE), "\t.set .,.+%u\n", (ROUNDED)); \ - } \ - else \ - { \ - fputs (".lcomm ", (FILE)); \ - assemble_name ((FILE), (NAME)); \ - fprintf ((FILE), ",%u\n", (ROUNDED)); \ - } \ - } while (0) - -/* Add stuff that normally comes from i386v.h via svr3.h */ - -/* Define the actual types of some ANSI-mandated types. These - definitions should work for most SVR3 systems. */ - -#undef SIZE_TYPE -#define SIZE_TYPE "unsigned int" - -#undef PTRDIFF_TYPE -#define PTRDIFF_TYPE "int" - -#undef WCHAR_TYPE -#define WCHAR_TYPE "long int" - -#undef WCHAR_TYPE_SIZE -#define WCHAR_TYPE_SIZE BITS_PER_WORD diff --git a/contrib/gcc/config/nextstep-protos.h b/contrib/gcc/config/nextstep-protos.h deleted file mode 100644 index 1f86e1d9b3bb..000000000000 --- a/contrib/gcc/config/nextstep-protos.h +++ /dev/null @@ -1,28 +0,0 @@ -/* Operating system specific defines to be used when targeting GCC - for NeXTSTEP. - Copyright (C) 2001 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. */ - -extern void nextstep_asm_out_constructor PARAMS ((struct rtx_def *, int)); -extern void nextstep_asm_out_destructor PARAMS ((struct rtx_def *, int)); -extern int handle_pragma PARAMS ((int(*)(void), void (*)(int), const char *)); -extern void constructor_section PARAMS ((void)); -extern void destructor_section PARAMS ((void)); -extern void nextstep_exception_section PARAMS ((void)); -extern void nextstep_eh_frame_section PARAMS ((void)); diff --git a/contrib/gcc/config/nextstep.c b/contrib/gcc/config/nextstep.c deleted file mode 100644 index 228c5662a2d0..000000000000 --- a/contrib/gcc/config/nextstep.c +++ /dev/null @@ -1,117 +0,0 @@ -/* Functions for generic NeXT as target machine for GNU C compiler. - Copyright (C) 1989, 1990, 1991, 1992, 1993, 1996, 1997, 1998, - 2000 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 "config.h" -#include "system.h" -#include "flags.h" -#include "tree.h" -#include "rtl.h" -#include "toplev.h" -#include "output.h" -#include "tm_p.h" - -/* Make everything that used to go in the text section really go there. */ - -int flag_no_mach_text_sections = 0; - -#define OPT_STRCMP(opt) (!strncmp (opt, p, sizeof (opt)-1)) - -/* 1 if handle_pragma has been called yet. */ - -static int pragma_initialized; - -/* Initial setting of `optimize'. */ - -static int initial_optimize_flag; - -/* Called from check_newline via the macro HANDLE_PRAGMA. - FINPUT is the source file input stream. - CH is the first character after `#pragma'. - The result is 1 if the pragma was handled. */ - -int -handle_pragma (p_getc, p_ungetc, pname) - int (* p_getc) PARAMS ((void)) ATTRIBUTE_UNUSED; - void (* p_ungetc) PARAMS ((int)) ATTRIBUTE_UNUSED; - const char *pname; -{ - int retval = 0; - - /* Record initial setting of optimize flag, so we can restore it. */ - if (!pragma_initialized) - { - pragma_initialized = 1; - initial_optimize_flag = optimize; - } - - if (strcmp (pname, "CC_OPT_ON") == 0) - { - optimize = 1; - warning ("optimization turned on"); - retval = 1; - } - else if (strcmp (pname, "CC_OPT_OFF") == 0) - { - optimize = 0; - warning ("optimization turned off"); - retval = 1; - } - else if (strcmp (pname, "CC_OPT_RESTORE") == 0) - { - extern int initial_optimize_flag; - - if (optimize != initial_optimize_flag) - optimize = initial_optimize_flag; - warning ("optimization level restored"); - retval = 1; - } - else if (strcmp (pname, "CC_WRITABLE_STRINGS") == 0) - flag_writable_strings = retval = 1; - else if (strcmp (pname, "CC_NON_WRITABLE_STRINGS") == 0) - flag_writable_strings = 0, retval = 1; - else if (strcmp (pname, "CC_NO_MACH_TEXT_SECTIONS") == 0) - flag_no_mach_text_sections = retval = 1; - - return retval; -} - -void -nextstep_asm_out_constructor (symbol, priority) - rtx symbol; - int priority ATTRIBUTE_UNUSED; -{ - constructor_section (); - assemble_align (POINTER_SIZE); - assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1); - fprintf (asm_out_file, ".reference .constructors_used\n"); -} - -void -nextstep_asm_out_destructor (symbol, priority) - rtx symbol; - int priority ATTRIBUTE_UNUSED; -{ - destructor_section (); - assemble_align (POINTER_SIZE); - assemble_integer (symbol, POINTER_SIZE / BITS_PER_UNIT, POINTER_SIZE, 1); - fprintf (asm_out_file, ".reference .destructors_used\n"); -} - diff --git a/contrib/gcc/config/nextstep.h b/contrib/gcc/config/nextstep.h deleted file mode 100644 index 8089633a7c18..000000000000 --- a/contrib/gcc/config/nextstep.h +++ /dev/null @@ -1,581 +0,0 @@ -/* Operating system specific defines to be used when targeting GCC - for NeXTSTEP. - Copyright (C) 1989, 1990, 1991, 1992, 1993, 1996, 1997, - 1999 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. */ - -/* Use new NeXT include file search path. - In a cross compiler with NeXT as target, don't expect - the host to use Next's directory scheme. */ - -#ifndef CROSS_COMPILE -#undef INCLUDE_DEFAULTS -#define INCLUDE_DEFAULTS \ - { \ - { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 }, \ - { LOCAL_INCLUDE_DIR, 0, 0, 1 }, \ - { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1 }, \ - { GCC_INCLUDE_DIR, "GCC", 0, 0 }, \ - /* These are for fixincludes-fixed ansi/bsd headers \ - which wouldn't be found otherwise. \ - (The use of string catenation here is OK since \ - NeXT's native compiler is derived from GCC.) */ \ - { GCC_INCLUDE_DIR "/ansi", 0, 0, 0 }, \ - { GCC_INCLUDE_DIR "/bsd", 0, 0, 0 }, \ - { "/NextDeveloper/Headers", 0, 0, 0 }, \ - { "/NextDeveloper/Headers/ansi", 0, 0, 0 }, \ - { "/NextDeveloper/Headers/bsd", 0, 0, 0 }, \ - { "/LocalDeveloper/Headers", 0, 0, 0 }, \ - { "/LocalDeveloper/Headers/ansi", 0, 0, 0 }, \ - { "/LocalDeveloper/Headers/bsd", 0, 0, 0 }, \ - { "/NextDeveloper/2.0CompatibleHeaders", 0, 0, 0 }, \ - { STANDARD_INCLUDE_DIR, 0, 0, 0 }, \ - { "/usr/include/bsd", 0, 0, 0 }, \ - { 0, 0, 0, 0 } \ - } -#else /* CROSS_COMPILE */ -#undef INCLUDE_DEFAULTS -#define INCLUDE_DEFAULTS \ - { \ - { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 }, \ - { GPLUSPLUS_INCLUDE_DIR, 0, 1, 1 }, \ - { GCC_INCLUDE_DIR, "GCC", 0, 0 }, \ - { GCC_INCLUDE_DIR "/ansi", 0, 0, 0 }, \ - { GCC_INCLUDE_DIR "/bsd", 0, 0, 0 }, \ - { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1 }, \ - { TOOL_INCLUDE_DIR "/ansi", 0, 0, 0 }, \ - { TOOL_INCLUDE_DIR "/bsd", 0, 0, 0 }, \ - { "/usr/include/bsd", 0, 0, 0 }, \ - { 0, 0, 0, 0 } \ - } -#endif /* CROSS_COMPILE */ - -#undef EXTRA_FORMAT_FUNCTIONS -#define EXTRA_FORMAT_FUNCTIONS \ - "NXPrintf", FALSE, 2, FALSE, \ - "NXScanf", TRUE, 2, FALSE, \ - "NXVPrintf", FALSE, 2, TRUE, \ - "NXVScanf", TRUE, 2, TRUE, \ - "DPSPrintf", FALSE, 2, FALSE, \ - "bsd_sprintf", FALSE, 2, FALSE, \ - "bsd_vsprintf", FALSE, 2, TRUE, - -/* Make -fnext-runtime the default. */ - -#define NEXT_OBJC_RUNTIME - -/* Enable recent gcc to compile under the old gcc in Next release 1.0. */ - -#define __inline inline - -/* wchar_t is unsigned short */ - -#undef WCHAR_TYPE -#define WCHAR_TYPE "short unsigned int" -#undef WCHAR_TYPE_SIZE -#define WCHAR_TYPE_SIZE (BITS_PER_WORD / 2) - -/* Don't default to pcc-struct-return, because gcc is the only compiler, and - we want to retain compatibility with older gcc versions. */ - -#undef DEFAULT_PCC_STRUCT_RETURN -#define DEFAULT_PCC_STRUCT_RETURN 0 - -/* These compiler options take n arguments. */ - -#undef WORD_SWITCH_TAKES_ARG -#define WORD_SWITCH_TAKES_ARG(STR) \ - (DEFAULT_WORD_SWITCH_TAKES_ARG (STR) ? 1 : \ - !strcmp (STR, "segalign") ? 1 : \ - !strcmp (STR, "seg1addr") ? 1 : \ - !strcmp (STR, "segaddr") ? 2 : \ - !strcmp (STR, "sectobjectsymbols") ? 2 : \ - !strcmp (STR, "segprot") ? 3 : \ - !strcmp (STR, "sectcreate") ? 3 : \ - !strcmp (STR, "sectalign") ? 3 : \ - !strcmp (STR, "segcreate") ? 3 : \ - !strcmp (STR, "sectorder") ? 3 : \ - !strcmp (STR, "siff-mask") ? 1 : \ - !strcmp (STR, "siff-filter") ? 1 : \ - !strcmp (STR, "siff-warning") ? 1 : \ - !strcmp (STR, "arch") ? 1 : \ - !strcmp (STR, "pagezero_size") ? 1 : \ - 0) - -#undef WORD_SWITCH -#define WORD_SWITCH(STR) \ - (WORD_SWITCH_TAKES_ARG (STR) \ - || !strcmp (STR, "bsd") \ - || !strcmp (STR, "object") \ - || !strcmp (STR, "ObjC") \ - || !strcmp (STR, "all_load")) - -/* Machine dependent ccp options. */ - -#undef CPP_SPEC -#define CPP_SPEC "%{!traditional: -D__STDC__} \ - %{posixstrict:-D_POSIX_SOURCE} \ - %{!posixstrict:%{bsd:-D__STRICT_BSD__} \ - %{posix:-D_POSIX_SOURCE} \ - %{!ansi:-D_NEXT_SOURCE}} \ - %{MD:-MD %M} %{MMD:-MMD %M}" - -/* Machine dependent ld options. */ - -#undef LINK_SPEC -#define LINK_SPEC "%{Z} %{M} \ -%{execute*} %{preload*} %{fvmlib*} \ -%{segalign*} %{seg1addr*} %{segaddr*} %{segprot*} \ -%{pagezero_size*} \ -%{seglinkedit*} %{noseglinkedit*} \ -%{sectcreate*} %{sectalign*} %{sectobjectsymbols}\ -%{segcreate*} %{Mach*} %{whyload} %{w} \ -%{sectorder*} %{whatsloaded} %{ObjC} %{all_load} %{object}" - -/* Machine dependent libraries. */ - -#undef LIB_SPEC -#define LIB_SPEC "%{!posix*:-lsys_s} %{posix*:-lposix}" - -/* We specify crt0.o as -lcrt0.o so that ld will search the library path. */ - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC \ - "%{!posix*:%{pg:-lgcrt0.o}%{!pg: \ - %{p:%e-p profiling is no longer supported. Use -pg instead} \ - %{!p:-lcrt0.o}}}\ - %{posix*:%{pg:-lgposixcrt0.o}%{!pg: \ - %{p:%e-p profiling is no longer supported. Use -pg instead} \ - %{!p:-lposixcrt0.o}}} \ - -lcrtbegin.o" - -#undef ENDFILE_SPEC -#define ENDFILE_SPEC \ - "-lcrtend.o" - -/* Allow #sscs (but don't do anything). */ - -#define SCCS_DIRECTIVE - -/* We use Dbx symbol format. */ - -#undef SDB_DEBUGGING_INFO -#undef XCOFF_DEBUGGING_INFO -#define DBX_DEBUGGING_INFO - -/* This saves a fair amount of space. */ - -#undef DBX_CONTIN_LENGTH -#define DBX_CONTIN_LENGTH 0 - -/* These screw up NeXT's gdb at the moment, so don't use them. */ - -#undef DBX_OUTPUT_MAIN_SOURCE_DIRECTORY -#define DBX_OUTPUT_MAIN_SOURCE_DIRECTORY(FILE, FILENAME) - -/* These come from bsd386.h, but are specific to sequent, so make sure - they don't bite us. */ - -#undef DBX_NO_XREFS -#undef DBX_CONTIN_LENGTH - -/* gdb needs a null N_SO at the end of each file for scattered loading. */ - -#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END -#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \ - fprintf (FILE, \ - "\t.text\n\t.stabs \"%s\",%d,0,0,Letext\nLetext:\n", \ - "" , N_SO) - -/* Define our object format type for crtstuff.c */ -#define OBJECT_FORMAT_MACHO - -#undef INIT_SECTION_ASM_OP -#define INIT_SECTION_ASM_OP -#undef INVOKE__main - -#define TARGET_ASM_CONSTRUCTOR nextstep_asm_out_constructor -#define TARGET_ASM_DESTRUCTOR nextstep_asm_out_destructor - -#define TARGET_ASM_EXCEPTION_SECTION nextstep_exception_section - -#define TARGET_ASM_EH_FRAME_SECTION nextstep_eh_frame_section - -/* Don't output a .file directive. That is only used by the assembler for - error reporting. */ -#undef ASM_FILE_START -#define ASM_FILE_START(FILE) - -#undef ASM_FILE_END -#define ASM_FILE_END(FILE) \ - do { \ - if (strcmp (lang_hooks.name, "GNU C++") == 0) \ - { \ - constructor_section (); \ - destructor_section (); \ - ASM_OUTPUT_ALIGN (FILE, 1); \ - } \ - } while (0) - -/* How to parse #pragma's */ - -#undef HANDLE_PRAGMA -#define HANDLE_PRAGMA(GETC, UNGETC, NAME) handle_pragma (GETC, UNGETC, NAME) - -/* Give methods pretty symbol names on NeXT. */ - -#undef OBJC_GEN_METHOD_LABEL -#define OBJC_GEN_METHOD_LABEL(BUF,IS_INST,CLASS_NAME,CAT_NAME,SEL_NAME,NUM) \ - do { if (CAT_NAME) \ - sprintf (BUF, "%c[%s(%s) %s]", (IS_INST) ? '-' : '+', \ - (CLASS_NAME), (CAT_NAME), (SEL_NAME)); \ - else \ - sprintf (BUF, "%c[%s %s]", (IS_INST) ? '-' : '+', \ - (CLASS_NAME), (SEL_NAME)); \ - } while (0) - -/* The prefix to add to user-visible assembler symbols. */ - -#undef USER_LABEL_PREFIX -#define USER_LABEL_PREFIX "_" - -/* Wrap new method names in quotes so the assembler doesn't gag. - Make Objective-C internal symbols local. */ - -#undef ASM_OUTPUT_LABELREF -#define ASM_OUTPUT_LABELREF(FILE,NAME) \ - do { if (NAME[0] == '+' || NAME[0] == '-') fprintf (FILE, "\"%s\"", NAME); \ - else if (!strncmp (NAME, "_OBJC_", 6)) fprintf (FILE, "L%s", NAME); \ - else if (!strncmp (NAME, ".objc_class_name_", 17)) \ - fprintf (FILE, "%s", NAME); \ - else asm_fprintf (FILE, "%U%s", NAME); } while (0) - -#undef ALIGN_ASM_OP -#define ALIGN_ASM_OP "\t.align\t" - -#undef ASM_OUTPUT_ALIGN -#define ASM_OUTPUT_ALIGN(FILE,LOG) \ - if ((LOG) != 0) \ - fprintf (FILE, "%s%d\n", ALIGN_ASM_OP, (LOG)) - -/* Ensure correct alignment of bss data. */ - -#undef ASM_OUTPUT_ALIGNED_LOCAL -#define ASM_OUTPUT_ALIGNED_LOCAL(FILE, NAME, SIZE, ALIGN) \ -( fputs (".lcomm ", (FILE)), \ - assemble_name ((FILE), (NAME)), \ - fprintf ((FILE), ",%u,%u\n", (SIZE), floor_log2 ((ALIGN) / BITS_PER_UNIT))) - -/* Output #ident as a .ident. */ - -#undef ASM_OUTPUT_IDENT -#define ASM_OUTPUT_IDENT(FILE, NAME) fprintf (FILE, "\t.ident \"%s\"\n", NAME); - -/* The maximum alignment which the object file format can support. - For NeXT's Mach-O format, this is 2^15. */ - -#undef MAX_OFILE_ALIGNMENT -#define MAX_OFILE_ALIGNMENT 0x8000 - -/* Create new Mach-O sections. */ - -#undef SECTION_FUNCTION -#define SECTION_FUNCTION(FUNCTION, SECTION, DIRECTIVE, WAS_TEXT, OBJC) \ -extern void FUNCTION PARAMS ((void)); \ -void \ -FUNCTION () \ -{ \ - extern int flag_no_mach_text_sections; \ - \ - if (WAS_TEXT && flag_no_mach_text_sections) \ - text_section (); \ - else if (in_section != SECTION) \ - { \ - if (OBJC) \ - objc_section_init (); \ - fprintf (asm_out_file, "%s\n", DIRECTIVE); \ - in_section = SECTION; \ - } \ -} \ - -#undef EXTRA_SECTIONS -#define EXTRA_SECTIONS \ - in_const, in_cstring, in_literal4, in_literal8, \ - in_constructor, in_destructor, \ - in_nextstep_exception, in_nextstep_eh_frame, \ - in_objc_class, in_objc_meta_class, in_objc_category, \ - in_objc_class_vars, in_objc_instance_vars, \ - in_objc_cls_meth, in_objc_inst_meth, \ - in_objc_cat_cls_meth, in_objc_cat_inst_meth, \ - in_objc_selector_refs, \ - in_objc_symbols, in_objc_module_info, \ - in_objc_protocol, in_objc_string_object, \ - in_objc_class_names, in_objc_meth_var_names, \ - in_objc_meth_var_types, in_objc_cls_refs - -#undef EXTRA_SECTION_FUNCTIONS -#define EXTRA_SECTION_FUNCTIONS \ -extern void objc_section_init PARAMS ((void)); \ -SECTION_FUNCTION (const_section, \ - in_const, \ - ".const", 1, 0) \ -SECTION_FUNCTION (cstring_section, \ - in_cstring, \ - ".cstring", 1, 0) \ -SECTION_FUNCTION (literal4_section, \ - in_literal4, \ - ".literal4", 1, 0) \ -SECTION_FUNCTION (literal8_section, \ - in_literal8, \ - ".literal8", 1, 0) \ -SECTION_FUNCTION (constructor_section, \ - in_constructor, \ - ".constructor", 0, 0) \ -SECTION_FUNCTION (destructor_section, \ - in_destructor, \ - ".destructor", 0, 0) \ -SECTION_FUNCTION (nextstep_exception_section, \ - in_nextstep_exception, \ - ".section __TEXT,__gcc_except_tab,regular", 0, 0) \ -SECTION_FUNCTION (nextstep_eh_frame_section, \ - in_nextstep_eh_frame, \ - ".section __TEXT,__eh_frame,regular", 0, 0) \ -SECTION_FUNCTION (objc_class_section, \ - in_objc_class, \ - ".objc_class", 0, 1) \ -SECTION_FUNCTION (objc_meta_class_section, \ - in_objc_meta_class, \ - ".objc_meta_class", 0, 1) \ -SECTION_FUNCTION (objc_category_section, \ - in_objc_category, \ - ".objc_category", 0, 1) \ -SECTION_FUNCTION (objc_class_vars_section, \ - in_objc_class_vars, \ - ".objc_class_vars", 0, 1) \ -SECTION_FUNCTION (objc_instance_vars_section, \ - in_objc_instance_vars, \ - ".objc_instance_vars", 0, 1) \ -SECTION_FUNCTION (objc_cls_meth_section, \ - in_objc_cls_meth, \ - ".objc_cls_meth", 0, 1) \ -SECTION_FUNCTION (objc_inst_meth_section, \ - in_objc_inst_meth, \ - ".objc_inst_meth", 0, 1) \ -SECTION_FUNCTION (objc_cat_cls_meth_section, \ - in_objc_cat_cls_meth, \ - ".objc_cat_cls_meth", 0, 1) \ -SECTION_FUNCTION (objc_cat_inst_meth_section, \ - in_objc_cat_inst_meth, \ - ".objc_cat_inst_meth", 0, 1) \ -SECTION_FUNCTION (objc_selector_refs_section, \ - in_objc_selector_refs, \ - ".objc_message_refs", 0, 1) \ -SECTION_FUNCTION (objc_symbols_section, \ - in_objc_symbols, \ - ".objc_symbols", 0, 1) \ -SECTION_FUNCTION (objc_module_info_section, \ - in_objc_module_info, \ - ".objc_module_info", 0, 1) \ -SECTION_FUNCTION (objc_protocol_section, \ - in_objc_protocol, \ - ".objc_protocol", 0, 1) \ -SECTION_FUNCTION (objc_string_object_section, \ - in_objc_string_object, \ - ".objc_string_object", 0, 1) \ -SECTION_FUNCTION (objc_class_names_section, \ - in_objc_class_names, \ - ".objc_class_names", 0, 1) \ -SECTION_FUNCTION (objc_meth_var_names_section, \ - in_objc_meth_var_names, \ - ".objc_meth_var_names", 0, 1) \ -SECTION_FUNCTION (objc_meth_var_types_section, \ - in_objc_meth_var_types, \ - ".objc_meth_var_types", 0, 1) \ -SECTION_FUNCTION (objc_cls_refs_section, \ - in_objc_cls_refs, \ - ".objc_cls_refs", 0, 1) \ - \ -void \ -objc_section_init () \ -{ \ - static int been_here = 0; \ - \ - if (been_here == 0) \ - { \ - been_here = 1; \ - objc_class_section (); \ - objc_meta_class_section (); \ - objc_cat_cls_meth_section (); \ - objc_cat_inst_meth_section (); \ - objc_cls_meth_section (); \ - objc_inst_meth_section (); \ - objc_selector_refs_section (); \ - objc_symbols_section (); \ - objc_category_section (); \ - objc_protocol_section (); \ - objc_class_vars_section (); \ - objc_instance_vars_section (); \ - objc_module_info_section (); \ - objc_string_object_section (); \ - objc_class_names_section (); \ - objc_meth_var_names_section (); \ - objc_meth_var_types_section (); \ - objc_cls_refs_section (); \ - } \ -} - -#undef READONLY_DATA_SECTION -#define READONLY_DATA_SECTION const_section - -#undef SELECT_SECTION -#define SELECT_SECTION(exp,reloc,align) \ - do \ - { \ - if (TREE_CODE (exp) == STRING_CST) \ - { \ - if (flag_writable_strings) \ - data_section (); \ - else if (TREE_STRING_LENGTH (exp) != \ - strlen (TREE_STRING_POINTER (exp)) + 1) \ - readonly_data_section (); \ - else \ - cstring_section (); \ - } \ - else if (TREE_CODE (exp) == INTEGER_CST \ - || TREE_CODE (exp) == REAL_CST) \ - { \ - tree size = TYPE_SIZE (TREE_TYPE (exp)); \ - \ - if (TREE_CODE (size) == INTEGER_CST && \ - TREE_INT_CST_LOW (size) == 4 && \ - TREE_INT_CST_HIGH (size) == 0) \ - literal4_section (); \ - else if (TREE_CODE (size) == INTEGER_CST && \ - TREE_INT_CST_LOW (size) == 8 && \ - TREE_INT_CST_HIGH (size) == 0) \ - literal8_section (); \ - else \ - readonly_data_section (); \ - } \ - else if (TREE_CODE (exp) == CONSTRUCTOR \ - && TREE_TYPE (exp) \ - && TREE_CODE (TREE_TYPE (exp)) == RECORD_TYPE \ - && TYPE_NAME (TREE_TYPE (exp)) \ - && TREE_CODE (TYPE_NAME (TREE_TYPE (exp))) == IDENTIFIER_NODE \ - && IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE (exp)))) \ - { \ - if (!strcmp (IDENTIFIER_POINTER (TYPE_NAME (TREE_TYPE (exp))), \ - "NXConstantString")) \ - objc_string_object_section (); \ - else if ((TREE_READONLY (exp) || TREE_CONSTANT (exp)) \ - && !TREE_SIDE_EFFECTS (exp)) \ - readonly_data_section (); \ - else \ - data_section (); \ - } \ - else if (TREE_CODE (exp) == VAR_DECL && \ - DECL_NAME (exp) && \ - TREE_CODE (DECL_NAME (exp)) == IDENTIFIER_NODE && \ - IDENTIFIER_POINTER (DECL_NAME (exp)) && \ - !strncmp (IDENTIFIER_POINTER (DECL_NAME (exp)), "_OBJC_", 6)) \ - { \ - const char *name = IDENTIFIER_POINTER (DECL_NAME (exp)); \ - \ - if (!strncmp (name, "_OBJC_CLASS_METHODS_", 20)) \ - objc_cls_meth_section (); \ - else if (!strncmp (name, "_OBJC_INSTANCE_METHODS_", 23)) \ - objc_inst_meth_section (); \ - else if (!strncmp (name, "_OBJC_CATEGORY_CLASS_METHODS_", 20)) \ - objc_cat_cls_meth_section (); \ - else if (!strncmp (name, "_OBJC_CATEGORY_INSTANCE_METHODS_", 23)) \ - objc_cat_inst_meth_section (); \ - else if (!strncmp (name, "_OBJC_CLASS_VARIABLES_", 22)) \ - objc_class_vars_section (); \ - else if (!strncmp (name, "_OBJC_INSTANCE_VARIABLES_", 25)) \ - objc_instance_vars_section (); \ - else if (!strncmp (name, "_OBJC_CLASS_PROTOCOLS_", 22)) \ - objc_cat_cls_meth_section (); \ - else if (!strncmp (name, "_OBJC_CLASS_NAME_", 17)) \ - objc_class_names_section (); \ - else if (!strncmp (name, "_OBJC_METH_VAR_NAME_", 20)) \ - objc_meth_var_names_section (); \ - else if (!strncmp (name, "_OBJC_METH_VAR_TYPE_", 20)) \ - objc_meth_var_types_section (); \ - else if (!strncmp (name, "_OBJC_CLASS_REFERENCES", 22)) \ - objc_cls_refs_section (); \ - else if (!strncmp (name, "_OBJC_CLASS_", 12)) \ - objc_class_section (); \ - else if (!strncmp (name, "_OBJC_METACLASS_", 16)) \ - objc_meta_class_section (); \ - else if (!strncmp (name, "_OBJC_CATEGORY_", 15)) \ - objc_category_section (); \ - else if (!strncmp (name, "_OBJC_SELECTOR_REFERENCES", 25)) \ - objc_selector_refs_section (); \ - else if (!strncmp (name, "_OBJC_SYMBOLS", 13)) \ - objc_symbols_section (); \ - else if (!strncmp (name, "_OBJC_MODULES", 13)) \ - objc_module_info_section (); \ - else if (!strncmp (name, "_OBJC_PROTOCOL_INSTANCE_METHODS_", 32)) \ - objc_cat_inst_meth_section (); \ - else if (!strncmp (name, "_OBJC_PROTOCOL_CLASS_METHODS_", 29)) \ - objc_cat_cls_meth_section (); \ - else if (!strncmp (name, "_OBJC_PROTOCOL_REFS_", 20)) \ - objc_cat_cls_meth_section (); \ - else if (!strncmp (name, "_OBJC_PROTOCOL_", 15)) \ - objc_protocol_section (); \ - else if ((TREE_READONLY (exp) || TREE_CONSTANT (exp)) \ - && !TREE_SIDE_EFFECTS (exp)) \ - readonly_data_section (); \ - else \ - data_section (); \ - } \ - else if (TREE_CODE (exp) == VAR_DECL) \ - { \ - if ((flag_pic && reloc) \ - || !TREE_READONLY (exp) || TREE_SIDE_EFFECTS (exp) \ - || !DECL_INITIAL (exp) \ - || (DECL_INITIAL (exp) != error_mark_node \ - && !TREE_CONSTANT (DECL_INITIAL (exp)))) \ - data_section (); \ - else \ - readonly_data_section (); \ - } \ - else \ - readonly_data_section (); \ - } \ - while (0) - -#undef SELECT_RTX_SECTION -#define SELECT_RTX_SECTION(mode, rtx, align) \ - do \ - { \ - if (GET_MODE_SIZE(mode) == 8) \ - literal8_section(); \ - else if (GET_MODE_SIZE(mode) == 4) \ - literal4_section(); \ - else \ - const_section (); \ - } \ - while (0) - -#ifdef ASM_COMMENT_START -# undef ASM_COMMENT_START -#endif - -#define ASM_COMMENT_START ";#" diff --git a/contrib/gcc/config/nextstep21.h b/contrib/gcc/config/nextstep21.h deleted file mode 100644 index 7827054d8975..000000000000 --- a/contrib/gcc/config/nextstep21.h +++ /dev/null @@ -1,64 +0,0 @@ -/* nextstep.h -- operating system specific defines to be used when - targeting GCC for NeXTSTEP. - Copyright (C) 1989, 1990, 1991, 1992, 1993 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. */ - - -/* changed for NeXTStep 2.1, Ch. Kranz, 2/94, 3/94 */ -#include "nextstep.h" - -/* set flag_gnu_linker=0, use collect2 for linking */ -#undef USE_COLLECT2 -#define USE_COLLECT2 - -/* use this until a newer gdb for NeXTStep21 is available */ -#define DEFAULT_GDB_EXTENSIONS 0 - -/* we need the call to __main to start all global destructors and constructors - correctly, so undef INIT_SECTION_ASM_OP, (see libgcc2.c line 1965) - and define INVOKE_main */ -#undef INIT_SECTION_ASM_OP -#define INVOKE__main - -/* We call the global destructors, constructors from __main */ -#undef TARGET_ASM_CONSTRUCTOR -#undef TARGET_ASM_DESTRUCTOR - -#undef ASM_FILE_END -#define ASM_FILE_END(FILE) \ - do { \ - if (strcmp (lang_hooks.name, "GNU C++") == 0) \ - { \ - ASM_OUTPUT_ALIGN (FILE, 1); \ - } \ - } while (0) -/* deleted: destructor_section (); \ */ -/* deleted: constructor_section (); \ */ - -/* Ensure correct alignment of bss data. */ -/* ASM_OUTPUT_ALIGNED_LOCAL not needed */ -/* need ASM_OUTPUT_LOCAL instead for old NeXT-as */ -/* look in varasm.c, line 1062 and 1476 */ -#undef ASM_OUTPUT_ALIGNED_LOCAL -#undef ASM_OUTPUT_LOCAL -#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ -( fputs (".lcomm ", (FILE)), \ - assemble_name ((FILE), (NAME)), \ - fprintf ((FILE), ",%u\n", (ROUNDED))) - diff --git a/contrib/gcc/config/rs6000/softfloat.h b/contrib/gcc/config/rs6000/softfloat.h deleted file mode 100644 index c0dc10d66b56..000000000000 --- a/contrib/gcc/config/rs6000/softfloat.h +++ /dev/null @@ -1,24 +0,0 @@ -/* Target definitions for GNU compiler for PowerPC defaulting to -msoft-float - Copyright (C) 2001 - Free Software Foundation, Inc. - Contributed by Red Hat 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. */ - -#undef CPP_FLOAT_DEFAULT_SPEC -#define CPP_FLOAT_DEFAULT_SPEC "-D_SOFT_FLOAT" diff --git a/contrib/gcc/config/s390/t-linux b/contrib/gcc/config/s390/t-linux deleted file mode 100644 index bc8d519b2d12..000000000000 --- a/contrib/gcc/config/s390/t-linux +++ /dev/null @@ -1,7 +0,0 @@ -# The crtbegin and crtend must not depend on a small GOT -CRTSTUFF_T_CFLAGS = -O2 -fPIC -CRTSTUFF_T_CFLAGS_S = -O2 -fPIC - -# Compile libgcc2.a with pic. -TARGET_LIBGCC2_CFLAGS = -fPIC -include $(srcdir)/config/s390/fixdfdi.h - diff --git a/contrib/gcc/config/sparc/rtems.h b/contrib/gcc/config/sparc/rtems.h deleted file mode 100644 index e537f1ca988f..000000000000 --- a/contrib/gcc/config/sparc/rtems.h +++ /dev/null @@ -1,27 +0,0 @@ -/* Definitions for rtems targeting a SPARC using a.out. - Copyright (C) 1996, 1997, 2000, 2002 Free Software Foundation, Inc. - Contributed by Joel Sherrill (joel@OARcorp.com). - -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. */ - - -/* Specify predefined symbols in preprocessor. */ - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dsparc -D__GCC_NEW_VARARGS__ -D__rtems__ \ - -Asystem=rtems" diff --git a/contrib/gcc/config/sparc/sol2-g1.asm b/contrib/gcc/config/sparc/sol2-g1.asm deleted file mode 100644 index b9d878856f8d..000000000000 --- a/contrib/gcc/config/sparc/sol2-g1.asm +++ /dev/null @@ -1,88 +0,0 @@ -! gcrt1.s for solaris 2.0. - -! Copyright (C) 1992 Free Software Foundation, Inc. -! Written By David Vinayak Henkel-Wallace, June 1992 -! -! This file 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. -! -! In addition to the permissions in the GNU General Public License, the -! Free Software Foundation gives you unlimited permission to link the -! compiled version of this file with other programs, and to distribute -! those programs without any restriction coming from the use of this -! file. (The General Public License restrictions do apply in other -! respects; for example, they cover modification of the file, and -! distribution when not linked into another program.) -! -! This file 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; see the file COPYING. If not, write to -! the Free Software Foundation, 59 Temple Place - Suite 330, -! Boston, MA 02111-1307, USA. -! -! As a special exception, if you link this library with files -! compiled with GCC to produce an executable, this does not cause -! the resulting executable to be covered by the GNU General Public License. -! This exception does not however invalidate any other reasons why -! the executable file might be covered by the GNU General Public License. -! - -! This file takes control of the process from the kernel, as specified -! in section 3 of the SVr4 ABI. -! This file is the first thing linked into any executable. - - .section ".text" - .proc 022 - .global _start - -_start: - mov 0, %fp ! Mark bottom frame pointer - ld [%sp + 64], %l0 ! argc - add %sp, 68, %l1 ! argv - - ! Leave some room for a call. Sun leaves 32 octets (to sit on - ! a cache line?) so we do too. - sub %sp, 32, %sp - - ! %g1 may contain a function to be registered w/atexit - orcc %g0, %g1, %g0 - be .nope - mov %g1, %o0 - call atexit - nop -.nope: - ! Now make sure constructors and destructors are handled. - set _fini, %o0 - call atexit, 1 - nop - call _init, 0 - nop - - ! We ignore the auxiliary vector; there's no defined way to - ! access those data anyway. Instead, go straight to main: - mov %l0, %o0 ! argc - mov %l1, %o1 ! argv - set ___Argv, %o3 - st %o1, [%o3] ! *___Argv - ! Skip argc words past argv, to env: - sll %l0, 2, %o2 - add %o2, 4, %o2 - add %l1, %o2, %o2 ! env - set _environ, %o3 - st %o2, [%o3] ! *_environ - call main, 4 - nop - call exit, 0 - nop - call _exit, 0 - nop - ! We should never get here. - - .type _start,#function - .size _start,.-_start diff --git a/contrib/gcc/config/sparc/sol27-sld.h b/contrib/gcc/config/sparc/sol27-sld.h deleted file mode 100644 index fb47b61f4486..000000000000 --- a/contrib/gcc/config/sparc/sol27-sld.h +++ /dev/null @@ -1,8 +0,0 @@ -/* Up through Solaris 2.7, the system linker does not work with DWARF - or DWARF2, since it does not have working support for relocations - to unaligned data. */ - -#undef DWARF_DEBUGGING_INFO -#undef DWARF2_DEBUGGING_INFO -#undef PREFERRED_DEBUGGING_TYPE -#undef ASM_DEBUG_SPEC diff --git a/contrib/gcc/config/t-install-cpp b/contrib/gcc/config/t-install-cpp deleted file mode 100644 index 9f887543d039..000000000000 --- a/contrib/gcc/config/t-install-cpp +++ /dev/null @@ -1,3 +0,0 @@ -# Handle cpp installation. -INSTALL_CPP=install-cpp -UNINSTALL_CPP=uninstall-cpp diff --git a/contrib/gcc/cp/mpw-config.in b/contrib/gcc/cp/mpw-config.in deleted file mode 100644 index 88dd85f72e9f..000000000000 --- a/contrib/gcc/cp/mpw-config.in +++ /dev/null @@ -1,11 +0,0 @@ -# Configuration fragment for G++. -# Most of the real configuration work happens in the main GCC configure. - -# We need to join some lines in the Makefile.in before the sed -# process will work properly. The funky little sed script works by -# recognizing lines with a trailing '$@ \', adding the next line to -# its "pattern space", editing out the backslash and line, then -# putting the result out. - -sed -e '/$@ \\/{N;s/$@ \\./$@ /;P;D;}' \Option-d - "{srcdir}"Makefile.in >"{o}"hacked_Makefile.in diff --git a/contrib/gcc/cp/mpw-make.sed b/contrib/gcc/cp/mpw-make.sed deleted file mode 100644 index 120b5a1fa3a5..000000000000 --- a/contrib/gcc/cp/mpw-make.sed +++ /dev/null @@ -1,112 +0,0 @@ -# Sed commands to finish translating the G++ Unix makefile into MPW syntax. - -# Remove control-Ls, they upset MPW make. -s/ //g - -# Remove references to always-empty variables used to mark things. -/CYGNUS-LOCAL-/s/{CYGNUS-LOCAL-[a-z0-9]*}//g - -# Add a bunch of definitions, mostly empty. -/^# Variables that exist for you to override.$/a\ -\ -xmake_file = \ -tmake_file = \ -build_xm_file = \ -MALLOC = \ -MD_DEPS = \ -REAL_H = \ -HOST_CC_LD = {CC_LD}\ -ALL_CCLDFLAGS = \ -HOST_CCLDFLAGS = \ -CONFIG_H = \ -LIBDEPS = \ - -# The "target" variable is special to MPW make, avoid it. -/{target}/s/{target}/{target_canonical}/g - -# Suppress the suppression of smart makes. -/^\.y\.c/d - -# Whack out "..." assignments. -/\.\.\./s/^\([a-z_]*= \.\.\.\)/#\1/ - -# Previous edits go a little overboard, undo. -/^objext = /s/"{o}"// - -# Always link in low-level MPW functions. -/^LIBDEPS=/s/$/ ::strerror.c.o ::mpwlib.c.o/ -/{CLIB}/s/{CLIB}/ ::strerror.c.o ::mpwlib.c.o {CLIB}/ - -# Don't get tricky about finding various .o file, point at dir above. -/^SUBDIR_OBSTACK/s/`.*`/::obstack.c.o/ -/^SUBDIR_USE_ALLOCA/s/`.*`/::alloca.c.o/ -/^SUBDIR_MALLOC/s/`.*`// - -# Point includes at parent directly correctly. -/^INCLUDES = /s/:\./::/g -/^INCLUDES = /s/"{srcdir}"\.\./"{topsrcdir}"gcc:/g -/^INCLUDES = /s,"{srcdir}"/\.\.,"{topsrcdir}"gcc:,g -/^INCLUDES = /s,"{srcdir}":config,"{topsrcdir}"gcc:config:,g - -# Add the special MPW include dirs. -/^INCLUDES = /s/$/ -i "{topsrcdir}"include:mpw: -i :::extra-include:/ - -# A nasty hack to reduce confusion. -/true/s/ ; @true$// - -# (should be in common translation?) -/{CC_LD} /s/$/ {EXTRALIBS}/ - -# Don't use general compiler flags (which may include definitions -# and other compiler-only bits) with linking commands. -/{CC_LD} /s/ALL_CFLAGS/ALL_CCLDFLAGS/ - -# Whack out build rules that are not useful. -/^Makefile \\Option-f /,/^$/d -/^config.status \\Option-f /,/^$/d -# (Note that MPW make is not case sensitive, and so this name -# is considered the same as "md_file".) -/^{MD_FILE} \\Option-f/,/^$/d - -# Depending on config.status is not useful for us. -/config.status/s/ config.status// - -# Repeat of stuff from generic edit. -/{s}/s/"{s}""{s}"/"{s}"/g -/{s}/s/"{s}""{srcdir}"/"{s}"/g -/{s}/s/"{srcdir}""{s}"/"{s}"/g - -# Fix references to C frontend files in main dir. -/::c-/s/"{o}"::c-/"{o}":c-/g - -# Fix pathnames to generated files in the objdir. -/parse/s/"{s}"parse\.\([chy]\)/"{o}"parse.\1/g -/parse/s/^parse\.\([chy]\)/"{o}"parse.\1/ -/y.tab.c/s/"{s}"y\.tab\.c/"{o}"y.tab.c/g -/y.tab.c/s/^y\.tab\.c/"{o}"y.tab.c/ -/y.tab.h/s/"{s}"y\.tab\.h/"{o}"y.tab.h/g -/y.tab.h/s/^y\.tab\.h/"{o}"y.tab.h/ - -# Put in the definition of YYEMPTY directly. -/grep/s/grep .* >>/Echo '#define YYEMPTY -1' >>/ - -# If the dates are wrong, then this tries to run gperf, which we don't -# really want. -/^"{srcdir}"hash.h/,/hash.h$/d - -# Sed the object file list instead of using cat (meow). -/cat/s/`cat /`sed -e 's,:,::,g' -e 's,{objext},.o,g' / - -# Simplify dependencies of generated parser files. -/^{PARSE_C}/s/^/#/ -/^stamp-parse/s/^stamp-parse/{PARSE_C}/ - -# Fix the compile line for the generated parser. -/{CC} -c/,/echo {PARSE_C}/c\ - {CC} @DASH_C_FLAG@ {ALL_CFLAGS} {ALL_CPPFLAGS} {INCLUDES} {BIG_SWITCHFLAG} "{o}"parse.c -o "{o}"parse.c.o\ - -# Change all Rez commands to use mac-gcc.r. -/{REZ}/s/"{s}"[-a-zA-Z{}]*\.r/"{topsrcdir}"gcc:mac-gcc.r/ - -# Remove pathname junk from the container name. -/{REZ}/s/'"'::cc1plus'"'/'"'cc1plus'"'/ diff --git a/contrib/gcc/dependence.c b/contrib/gcc/dependence.c deleted file mode 100644 index 1a5564dda9ab..000000000000 --- a/contrib/gcc/dependence.c +++ /dev/null @@ -1,1467 +0,0 @@ -/* Analyze loop dependencies - Copyright (C) 2000, 2002 Free Software Foundation, Inc. - -This file is part of GCC. - -GCC 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. - -GCC 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 GCC; see the file COPYING. If not, write to the Free -Software Foundation, 59 Temple Place - Suite 330, Boston, MA -02111-1307, USA. */ - -/* References: - Practical Dependence Testing, Goff, Kennedy, Tseng, PLDI, 1991 - High Performance Compilers for Parallel Computing, Wolfe -*/ - -#include "config.h" -#include "system.h" - -#include "rtl.h" -#include "expr.h" -#include "tree.h" -#include "c-common.h" -#include "flags.h" -#include "varray.h" - -#define MAX_SUBSCRIPTS 13 - -/* - We perform the following steps: - - Build the data structures def_use_chain, loop_chain, and induction_chain. - - Determine if a loop index is a normalized induction variable. - A loop is currently considered to be a for loop having an index set to an - initial value, conditional check of the index, and increment/decrement of - the index. - - Determine the distance and direction vectors. Both are two dimensioned - arrays where the first dimension represents a loop and the second - dimension represents a subscript. Dependencies are actually per loop, not - per subscript. So for: - for (i = 0; i < 10; i++) - for (j = 0; j < 10; j++) - array [i][j] = array[i][j-1] - We find the dependencies: loop1/sub_i, loop1/sub_j, loop2/sub_i, loop2/sub_j - and then intersect loop1/sub_i V loop2/sub_i and loop1/sub_i V loop2/sub_j - We determine the type of dependence, which determines which test we use. - We then try to refine the type of dependence we have and add the - dependence to the dep_chain -*/ - -enum dependence_type {dt_flow, dt_anti, dt_output, dt_none}; -#if 0 -static const char *const dependence_string [] = {"flow", "anti", "output", "none"}; -#endif -enum direction_type {lt, le, eq, gt, ge, star, independent, undef}; -#if 0 -static const char *const direction_string [] = {"<", "<=", "=", ">", ">=", "*", - "INDEPENDENT", "UNDEFINED"}; -#endif -enum def_use_type {def, use, init_def_use}; - -enum du_status_type {seen, unseen}; - -enum loop_status_type {normal, unnormal}; - -enum complexity_type {ziv, strong_siv, weak_siv, weak_zero_siv, - weak_crossing_siv, miv}; - -/* Given a def/use one can chase the next chain to follow the def/use - for that variable. Alternately one can sequentially follow each - element of def_use_chain. */ - -typedef struct def_use -{ - /* outermost loop */ - tree outer_loop; - /* loop containing this def/use */ - tree containing_loop; - /* this expression */ - tree expression; - /* our name */ - const char *variable; - /* def or use */ - enum def_use_type type; - /* status flags */ - enum du_status_type status; - /* next def/use for this same name */ - struct def_use *next; - /* dependencies for this def */ - struct dependence *dep; -} def_use; - -/* Given a loop* one can chase the next_nest chain to follow the nested - loops for that loop. Alternately one can sequentially follow each - element of loop_chain and check outer_loop to get all loops - contained within a certain loop. */ - -typedef struct loop -{ - /* outermost loop containing this loop */ - tree outer_loop; - /* this loop */ - tree containing_loop; - /* nest level for this loop */ - int depth; - /* can loop be normalized? */ - enum loop_status_type status; - /* loop* for loop contained in this loop */ - struct loop *next_nest; - /* induction variables for this loop. Currently only the index variable. */ - struct induction *ind; -} loop; - -/* Pointed to by loop. One per induction variable. */ - -typedef struct induction -{ - /* our name */ - const char *variable; - /* increment. Currently only +1 or -1 */ - int increment; - /* lower bound */ - int low_bound; - /* upper bound */ - int high_bound; - /* next induction variable for this loop. Currently null. */ - struct induction *next; -} induction; - -/* Pointed to by def/use. One per dependence. */ - -typedef struct dependence -{ - tree source; - tree destination; - enum dependence_type dependence; - enum direction_type direction[MAX_SUBSCRIPTS]; - int distance[MAX_SUBSCRIPTS]; - struct dependence *next; -} dependence; - -/* subscripts are represented by an array of these. Each reflects one - X * i + Y term, where X and Y are constants. */ - -typedef struct subscript -{ - /* ordinal subscript number */ - int position; - /* X in X * i + Y */ - int coefficient; - /* Y in X * i + Y */ - int offset; - /* our name */ - const char *variable; - /* next subscript term. Currently null. */ - struct subscript *next; -} subscript; - -/* Remember the destination the front end encountered. */ - -static tree dest_to_remember; - -/* Chain for def_use */ -static varray_type def_use_chain; - -/* Chain for dependence */ -static varray_type dep_chain; - -/* Chain for loop */ -static varray_type loop_chain; - -/* Chain for induction */ -static varray_type induction_chain; - -void init_dependence_analysis PARAMS ((tree)); -static void build_def_use PARAMS ((tree, enum def_use_type)); -static loop* add_loop PARAMS ((tree, tree, int)); -static int find_induction_variable PARAMS ((tree, tree, tree, loop*)); -static int get_low_bound PARAMS ((tree, const char*)); -static int have_induction_variable PARAMS ((tree, const char*)); -static void link_loops PARAMS ((void)); -static void get_node_dependence PARAMS ((void)); -static void check_node_dependence PARAMS ((def_use*)); -static int get_coefficients PARAMS ((def_use*, subscript[])); -static int get_one_coefficient PARAMS ((tree, subscript*, def_use*, enum tree_code*)); -static void normalize_coefficients PARAMS ((subscript[], loop*, int)); -static void classify_dependence PARAMS ((subscript[], subscript[], - enum complexity_type[], int*, int)); -static void ziv_test PARAMS ((subscript[], subscript[], - enum direction_type[][MAX_SUBSCRIPTS], - int[][MAX_SUBSCRIPTS], loop*, int)); -static void siv_test PARAMS ((subscript[], subscript[], - enum direction_type[][MAX_SUBSCRIPTS], - int[][MAX_SUBSCRIPTS], loop*, int)); -static int check_subscript_induction PARAMS ((subscript*, subscript*, loop*)); -static void gcd_test PARAMS ((subscript[], subscript[], enum - direction_type[][MAX_SUBSCRIPTS], - int[][MAX_SUBSCRIPTS], loop*, int)); -static int find_gcd PARAMS ((int, int)); -static void merge_dependencies PARAMS ((enum direction_type[][MAX_SUBSCRIPTS], - int[][MAX_SUBSCRIPTS], int, int)); -static void dump_array_ref PARAMS ((tree)); -#if 0 -static void dump_one_node PARAMS ((def_use*, varray_type*)); -static void dump_node_dependence PARAMS ((void)); -#endif -int search_dependence PARAMS ((tree)); -void remember_dest_for_dependence PARAMS ((tree)); -int have_dependence_p PARAMS ((rtx, rtx, enum direction_type[], int[])); -void end_dependence_analysis PARAMS ((void)); - -/* Build dependence chain 'dep_chain', which is used by have_dependence_p, - for the function given by EXP. */ - -void -init_dependence_analysis (exp) - tree exp; -{ - def_use *du_ptr; - - VARRAY_GENERIC_PTR_INIT (def_use_chain, 50, "def_use_chain"); - VARRAY_GENERIC_PTR_INIT (dep_chain, 50, "dep_chain"); - VARRAY_GENERIC_PTR_INIT (loop_chain, 50, "loop_chain"); - VARRAY_GENERIC_PTR_INIT (induction_chain, 50, "induction_chain"); - - build_def_use (exp, init_def_use); - - link_loops (); - - get_node_dependence (); - - /* dump_node_dependence (&def_use_chain);*/ - - for (du_ptr = VARRAY_TOP (def_use_chain, generic); - VARRAY_POP (def_use_chain); - du_ptr = VARRAY_TOP (def_use_chain, generic)) - { - free (du_ptr); - } - - VARRAY_FREE (def_use_chain); - VARRAY_FREE (loop_chain); - VARRAY_FREE (induction_chain); -} - -/* Build ARRAY_REF def/use info 'def_use_chain' starting at EXP which is a def - or use DU_TYPE */ - -static void -build_def_use (exp, du_type) - tree exp; - enum def_use_type du_type; -{ - static tree outer_loop; - static int nloop; - static tree current_loop; - static int du_idx; - static loop *loop_def; - tree node = exp; - tree array_ref; - def_use *du_ptr; - - if (du_type == init_def_use) - { - outer_loop = 0; - nloop = 0; - du_idx = 0; - } - - while (node) - switch (TREE_CODE (node)) - { - case COMPOUND_STMT: - node = TREE_OPERAND (node, 0); - break; - case TREE_LIST: - build_def_use (TREE_VALUE (node), 0); - node = TREE_CHAIN (node); - break; - case CALL_EXPR: - node = TREE_CHAIN (node); - break; - case FOR_STMT: - if (! nloop) outer_loop = node; - nloop++; - current_loop = node; - loop_def = add_loop (node, outer_loop, nloop); - if (find_induction_variable (TREE_OPERAND (node, 0), - TREE_OPERAND (node, 1), - TREE_OPERAND (node, 2), loop_def) - == 0) - loop_def->status = unnormal; - - build_def_use (TREE_OPERAND (node, 3), 0); - nloop--; - current_loop = 0; - node = TREE_CHAIN (node); - break; - case MODIFY_EXPR: - /* Is an induction variable modified? */ - if (loop_def - && TREE_CODE (TREE_OPERAND (node, 0)) == VAR_DECL - && have_induction_variable - (loop_def->outer_loop, - IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (node, 0)))) >= 0) - loop_def->status = unnormal; - - if (TREE_CODE (TREE_OPERAND (node, 0)) == ARRAY_REF - || TREE_CODE (TREE_OPERAND (node, 0)) == INDIRECT_REF) - build_def_use (TREE_OPERAND (node, 0), def); - - build_def_use (TREE_OPERAND (node, 1), use); - node = TREE_CHAIN (node); - break; - case INDIRECT_REF: - if (! TREE_OPERAND (node, 1) - || TREE_CODE (TREE_OPERAND (node, 1)) != ARRAY_REF) - { - node = 0; - break; - } - node = TREE_OPERAND (node, 1); - case ARRAY_REF: - if (nloop) - { - int i; - char null_string = '\0'; - - VARRAY_PUSH_GENERIC_PTR (def_use_chain, xmalloc (sizeof (def_use))); - du_ptr = VARRAY_GENERIC_PTR (def_use_chain, du_idx++); - du_ptr->type = du_type; - du_ptr->status = unseen; - du_ptr->outer_loop = outer_loop; - du_ptr->containing_loop = current_loop; - du_ptr->expression = node; - du_ptr->variable = &null_string; - du_ptr->next = 0; - du_ptr->dep = 0; - for (array_ref = node; - TREE_CODE (array_ref) == ARRAY_REF; - array_ref = TREE_OPERAND (array_ref, 0)) - ; - - if (TREE_CODE (array_ref) == COMPONENT_REF) - { - array_ref = TREE_OPERAND (array_ref, 1); - if (! (TREE_CODE (array_ref) == FIELD_DECL - && TREE_CODE (TREE_TYPE (array_ref)) == ARRAY_TYPE)) - { - node = 0; - break; - } - } - - for (i = 0; - i < du_idx - && strcmp (IDENTIFIER_POINTER (DECL_NAME (array_ref)), - ((def_use*) (VARRAY_GENERIC_PTR - (def_use_chain, i)))->variable); - i++) - ; - if (i != du_idx) - { - def_use *tmp_duc; - for (tmp_duc = ((def_use*) (VARRAY_GENERIC_PTR (def_use_chain, i))); - tmp_duc->next; - tmp_duc = ((def_use*)tmp_duc->next)); - tmp_duc->next = du_ptr; - } - else du_ptr->next = 0; - du_ptr->variable = IDENTIFIER_POINTER (DECL_NAME (array_ref)); - } - node = 0; - break; - - case SCOPE_STMT: - case DECL_STMT: - node = TREE_CHAIN (node); - break; - - case EXPR_STMT: - if (TREE_CODE (TREE_OPERAND (node, 0)) == MODIFY_EXPR) - build_def_use (TREE_OPERAND (node, 0), def); - node = TREE_CHAIN (node); - break; - - default: - if (TREE_CODE_CLASS (TREE_CODE (node)) == '2') - { - build_def_use (TREE_OPERAND (node, 0), use); - build_def_use (TREE_OPERAND (node, 1), use); - node = TREE_CHAIN (node); - } - else - node = 0; - } -} - -/* Add a loop to 'loop_chain' corresponding to for loop LOOP_NODE at depth - NLOOP, whose outermost loop is OUTER_LOOP */ - -static loop* -add_loop (loop_node, outer_loop, nloop) - tree loop_node; - tree outer_loop; - int nloop; -{ - loop *loop_ptr; - - VARRAY_PUSH_GENERIC_PTR (loop_chain, xmalloc (sizeof (loop))); - loop_ptr = VARRAY_TOP (loop_chain, generic); - loop_ptr->outer_loop = outer_loop; - loop_ptr->containing_loop = loop_node; - loop_ptr->depth = nloop; - loop_ptr->status = normal; - loop_ptr->next_nest = 0; - loop_ptr->ind = 0; - return loop_ptr; -} - -/* Update LOOP_DEF if for loop's COND_NODE and INCR_NODE define an index that - is a normalized induction variable. */ - -static int -find_induction_variable (init_node, cond_node, incr_node, loop_def) - tree init_node; - tree cond_node; - tree incr_node; - loop *loop_def; -{ - induction *ind_ptr; - enum tree_code incr_code; - tree incr; - - if (! init_node || ! incr_node || ! cond_node) - return 0; - /* Allow for ',' operator in increment expression of FOR */ - - incr = incr_node; - while (TREE_CODE (incr) == COMPOUND_EXPR) - { - incr_code = TREE_CODE (TREE_OPERAND (incr, 0)); - if (incr_code == PREDECREMENT_EXPR || incr_code == POSTDECREMENT_EXPR - || incr_code == PREINCREMENT_EXPR || incr_code == POSTINCREMENT_EXPR) - { - incr_node = TREE_OPERAND (incr, 0); - break; - } - incr_code = TREE_CODE (TREE_OPERAND (incr, 1)); - if (incr_code == PREDECREMENT_EXPR || incr_code == POSTDECREMENT_EXPR - || incr_code == PREINCREMENT_EXPR || incr_code == POSTINCREMENT_EXPR) - { - incr_node = TREE_OPERAND (incr, 1); - break; - } - incr = TREE_OPERAND (incr, 1); - } - - /* Allow index condition to be part of logical expression */ - cond_node = TREE_VALUE (cond_node); - incr = cond_node; - -#define INDEX_LIMIT_CHECK(NODE) \ - (TREE_CODE_CLASS (TREE_CODE (NODE)) == '<') \ - && (TREE_CODE (TREE_OPERAND (NODE, 0)) == VAR_DECL \ - && (IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (NODE, 0))) \ - == IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (incr_node, 0))))) \ - ? 1 : 0 - - while (TREE_CODE (incr) == TRUTH_ANDIF_EXPR - || TREE_CODE (incr) == TRUTH_ORIF_EXPR) - { - if (INDEX_LIMIT_CHECK (TREE_OPERAND (incr, 0))) - { - cond_node = TREE_OPERAND (incr, 0); - break; - } - if (INDEX_LIMIT_CHECK (TREE_OPERAND (incr, 1))) - { - cond_node = TREE_OPERAND (incr, 1); - break; - } - incr = TREE_OPERAND (incr, 0); - } - - incr_code = TREE_CODE (incr_node); - if ((incr_code == PREDECREMENT_EXPR || incr_code == POSTDECREMENT_EXPR - || incr_code == PREINCREMENT_EXPR || incr_code == POSTINCREMENT_EXPR) - && TREE_CODE_CLASS (TREE_CODE (cond_node)) == '<') - { - if (!INDEX_LIMIT_CHECK (cond_node)) - return 0; - - VARRAY_PUSH_GENERIC_PTR (induction_chain, xmalloc (sizeof (induction))); - ind_ptr = VARRAY_TOP (induction_chain, generic); - loop_def->ind = ind_ptr; - ind_ptr->variable = IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND - (incr_node, 0))); - ind_ptr->increment = TREE_INT_CST_LOW (TREE_OPERAND (incr_node, 1)); - if (TREE_CODE (incr_node) == PREDECREMENT_EXPR - || TREE_CODE (incr_node) == POSTDECREMENT_EXPR) - ind_ptr->increment = -ind_ptr->increment; - - ind_ptr->low_bound = get_low_bound (init_node, ind_ptr->variable); - if (TREE_CODE (TREE_OPERAND (cond_node, 0)) == VAR_DECL - && IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (cond_node, 0))) - == ind_ptr->variable) - { - if (TREE_CODE (TREE_OPERAND (cond_node, 1)) == INTEGER_CST) - ind_ptr->high_bound = - TREE_INT_CST_LOW (TREE_OPERAND (cond_node, 1)); - else - ind_ptr->high_bound = ind_ptr->increment < 0 ? INT_MIN : INT_MAX; - } - else if (TREE_CODE (TREE_OPERAND (cond_node, 1)) == VAR_DECL - && IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (cond_node, 1))) - == ind_ptr->variable) - { - if (TREE_CODE (TREE_OPERAND (cond_node, 0)) == INTEGER_CST) - ind_ptr->high_bound = - TREE_INT_CST_LOW (TREE_OPERAND (cond_node, 0)); - else - ind_ptr->high_bound = ind_ptr->increment < 0 ? INT_MIN : INT_MAX; - } - ind_ptr->next = 0; - return 1; - } - return 0; -} - -/* Return the low bound for induction VARIABLE in NODE */ - -static int -get_low_bound (node, variable) - tree node; - const char *variable; -{ - - if (TREE_CODE (node) == SCOPE_STMT) - node = TREE_CHAIN (node); - - if (! node) - return INT_MIN; - - while (TREE_CODE (node) == COMPOUND_EXPR) - { - if (TREE_CODE (TREE_OPERAND (node, 0)) == MODIFY_EXPR - && (TREE_CODE (TREE_OPERAND (node, 0)) == VAR_DECL - && IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (node, 0))) - == variable)) - break; - } - - if (TREE_CODE (node) == EXPR_STMT) - node = TREE_OPERAND (node, 0); - if (TREE_CODE (node) == MODIFY_EXPR - && (TREE_CODE (TREE_OPERAND (node, 0)) == VAR_DECL - && IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (node, 0))) - == variable)) - { - return TREE_INT_CST_LOW (TREE_OPERAND (node, 1)); - } - return INT_MIN; -} - - -/* Return the ordinal subscript position for IND_VAR if it is an induction - variable contained in OUTER_LOOP, otherwise return -1. */ - -static int -have_induction_variable (outer_loop, ind_var) - tree outer_loop; - const char *ind_var; -{ - induction *ind_ptr; - loop *loop_ptr; - unsigned int ind_idx = 0; - unsigned int loop_idx = 0; - - for (loop_ptr = VARRAY_GENERIC_PTR (loop_chain, loop_idx); - loop_ptr && loop_idx < VARRAY_SIZE (loop_chain); - loop_ptr = VARRAY_GENERIC_PTR (loop_chain, ++loop_idx)) - if (loop_ptr->outer_loop == outer_loop) - for (ind_ptr = loop_ptr->ind; - ind_ptr && ind_idx < VARRAY_SIZE (induction_chain); - ind_ptr = ind_ptr->next) - { - if (! strcmp (ind_ptr->variable, ind_var)) - return loop_idx + 1; - } - return -1; -} - -/* Chain the nodes of 'loop_chain'. */ - -static void -link_loops () -{ - unsigned int loop_idx = 0; - loop *loop_ptr, *prev_loop_ptr = 0; - - prev_loop_ptr = VARRAY_GENERIC_PTR (loop_chain, loop_idx); - for (loop_ptr = VARRAY_GENERIC_PTR (loop_chain, ++loop_idx); - loop_ptr && loop_idx < VARRAY_SIZE (loop_chain); - loop_ptr = VARRAY_GENERIC_PTR (loop_chain, ++loop_idx)) - { - if (prev_loop_ptr->outer_loop == loop_ptr->outer_loop) - { - if (prev_loop_ptr->depth == loop_ptr->depth - 1) - prev_loop_ptr->next_nest = loop_ptr; - prev_loop_ptr = loop_ptr; - } - } -} - -/* Check the dependence for each member of 'def_use_chain'. */ - -static void -get_node_dependence () -{ - unsigned int du_idx; - def_use *du_ptr; - - du_idx = 0; - for (du_ptr = VARRAY_GENERIC_PTR (def_use_chain, du_idx); - du_ptr && du_idx < VARRAY_SIZE (def_use_chain); - du_ptr = VARRAY_GENERIC_PTR (def_use_chain, du_idx++)) - { - if (du_ptr->status == unseen) - check_node_dependence (du_ptr); - } -} - -/* Check the dependence for definition DU. */ - -static void -check_node_dependence (du) - def_use *du; -{ - def_use *def_ptr, *use_ptr; - dependence *dep_ptr, *dep_list; - subscript icoefficients[MAX_SUBSCRIPTS]; - subscript ocoefficients[MAX_SUBSCRIPTS]; - loop *loop_ptr, *ck_loop_ptr; - unsigned int loop_idx = 0; - int distance[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS]; - int i, j; - int subscript_count; - int unnormal_loop; - enum direction_type direction[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS]; - enum complexity_type complexity[MAX_SUBSCRIPTS]; - int separability; - int have_dependence; - - for (j = 1 ; j < MAX_SUBSCRIPTS; j++) - { - direction[j][0] = undef; - distance[j][0] = 0; - } - - for (def_ptr = du; def_ptr; def_ptr = def_ptr->next) - { - if (def_ptr->type != def) - continue; - subscript_count = get_coefficients (def_ptr, ocoefficients); - if (subscript_count < 0) - continue; - - loop_idx = 0; - for (loop_ptr = VARRAY_GENERIC_PTR (loop_chain, loop_idx); - loop_ptr && loop_idx < VARRAY_SIZE (loop_chain); - loop_ptr = VARRAY_GENERIC_PTR (loop_chain, ++loop_idx)) - { - if (loop_ptr->outer_loop == def_ptr->outer_loop) - break; - } - - unnormal_loop = 0; - for (ck_loop_ptr = loop_ptr; - ck_loop_ptr && loop_idx < VARRAY_SIZE (loop_chain); - ck_loop_ptr = VARRAY_GENERIC_PTR (loop_chain, ++loop_idx)) - { - if (ck_loop_ptr->outer_loop == def_ptr->outer_loop - && ck_loop_ptr->status == unnormal) - unnormal_loop = 1; - } - if (unnormal_loop) - continue; - - normalize_coefficients (ocoefficients, loop_ptr, subscript_count); - - for (use_ptr = du; use_ptr; use_ptr = use_ptr->next) - { - if (def_ptr == use_ptr - || def_ptr->outer_loop != use_ptr->outer_loop) - continue; - def_ptr->status = seen; - use_ptr->status = seen; - subscript_count = get_coefficients (use_ptr, icoefficients); - normalize_coefficients (icoefficients, loop_ptr, subscript_count); - classify_dependence (icoefficients, ocoefficients, complexity, - &separability, subscript_count); - - for (i = 1, ck_loop_ptr = loop_ptr; ck_loop_ptr; i++) - { - for (j = 1; j <= subscript_count; j++) - { - direction[i][j] = star; - distance[i][j] = INT_MAX; - if (separability && complexity[j] == ziv) - ziv_test (icoefficients, ocoefficients, direction, distance, - ck_loop_ptr, j); - else if (separability - && (complexity[j] == strong_siv - || complexity[j] == weak_zero_siv - || complexity[j] == weak_crossing_siv)) - siv_test (icoefficients, ocoefficients, direction, distance, - ck_loop_ptr, j); - else - gcd_test (icoefficients, ocoefficients, direction, distance, - ck_loop_ptr, j); - /* ?? Add other tests: single variable exact test, banerjee */ - } - - ck_loop_ptr = ck_loop_ptr->next_nest; - } - - merge_dependencies (direction, distance, i - 1, j - 1); - - have_dependence = 0; - for (j = 1; j <= i - 1; j++) - { - if (direction[j][0] != independent) - have_dependence = 1; - } - if (! have_dependence) - continue; - - VARRAY_PUSH_GENERIC_PTR (dep_chain, xmalloc (sizeof (dependence))); - dep_ptr = VARRAY_TOP (dep_chain, generic); - dep_ptr->source = use_ptr->expression; - dep_ptr->destination = def_ptr->expression; - dep_ptr->next = 0; - - if (def_ptr < use_ptr && use_ptr->type == use) - dep_ptr->dependence = dt_flow; - else if (def_ptr > use_ptr && use_ptr->type == use) - dep_ptr->dependence = dt_anti; - else dep_ptr->dependence = dt_output; - - for (j = 1 ; j <= i - 1 ; j++) - { - if (direction[j][0] == gt) - { - dep_ptr->dependence = dt_anti; - direction[j][0] = lt; - distance[j][0] = -distance[j][0]; - break; - } - else if (direction[j][0] == lt) - { - dep_ptr->dependence = dt_flow; - break; - } - } - for (j = 1 ; j < MAX_SUBSCRIPTS ; j++) - { - dep_ptr->direction[j] = direction[j][0]; - dep_ptr->distance[j] = distance[j][0]; - } - - for (dep_list = def_ptr->dep ; - dep_list && dep_list->next ; - dep_list = dep_list->next) - ; - - if (! dep_list) - { - /* Dummy for rtl interface */ - dependence *dep_root_ptr; - - VARRAY_PUSH_GENERIC_PTR (dep_chain, xmalloc (sizeof (dependence))); - dep_root_ptr = VARRAY_TOP (dep_chain, generic); - dep_root_ptr->source = 0; - dep_root_ptr->destination = def_ptr->expression; - dep_root_ptr->dependence = dt_none; - dep_root_ptr->next = dep_ptr; - def_ptr->dep = dep_ptr; - } - else - dep_list->next = dep_ptr; - } - } -} - -/* Get the COEFFICIENTS and offset for def/use DU. */ - -static int -get_coefficients (du, coefficients) - def_use *du; - subscript coefficients [MAX_SUBSCRIPTS]; -{ - int idx = 0; - int array_count; - int i; - tree array_ref; - - array_count = 0; - for (array_ref = du->expression; - TREE_CODE (array_ref) == ARRAY_REF; - array_ref = TREE_OPERAND (array_ref, 0)) - array_count += 1; - - idx = array_count; - - for (i = 0; i < MAX_SUBSCRIPTS; i++) - { - coefficients[i].position = 0; - coefficients[i].coefficient = INT_MIN; - coefficients[i].offset = INT_MIN; - coefficients[i].variable = 0; - coefficients[i].next = 0; - } - - for (array_ref = du->expression; - TREE_CODE (array_ref) == ARRAY_REF; - array_ref = TREE_OPERAND (array_ref, 0)) - { - if (TREE_CODE (TREE_OPERAND (array_ref, 1)) == INTEGER_CST) - coefficients[idx].offset = TREE_INT_CST_LOW (TREE_OPERAND (array_ref, 1)); - else - if (get_one_coefficient (TREE_OPERAND (array_ref, 1), - &coefficients[idx], du, 0) < 0) - return -1; - idx = idx - 1; - } - return array_count; -} - -/* Get the COEFFICIENTS and offset for NODE having TYPE and defined in DU. */ - -static int -get_one_coefficient (node, coefficients, du, type) - tree node; - subscript *coefficients; - def_use *du; - enum tree_code *type; -{ - enum tree_code tree_op, tree_op_code; - int index, value; - - tree_op = TREE_CODE (node); - if (type) - *type = tree_op; - - if (tree_op == VAR_DECL) - { - index = have_induction_variable (du->outer_loop, - IDENTIFIER_POINTER (DECL_NAME (node))); - if (index >= 0) - { - coefficients->position = index; - coefficients->variable = IDENTIFIER_POINTER (DECL_NAME (node)); - coefficients->coefficient = 1; - if (coefficients->offset == INT_MIN) - coefficients->offset = 0; - } - return index; - } - else if (tree_op == INTEGER_CST) - { - return TREE_INT_CST_LOW (node); - } - else if (tree_op == NON_LVALUE_EXPR) - { - return get_one_coefficient (TREE_OPERAND (node, 0), coefficients, du, - &tree_op_code); - } - else if (tree_op == PLUS_EXPR) - { - value = get_one_coefficient (TREE_OPERAND (node, 0), coefficients, du, - &tree_op_code); - if (tree_op_code == INTEGER_CST) - coefficients->offset = value; - - value = get_one_coefficient (TREE_OPERAND (node, 1), coefficients, du, - &tree_op_code); - if (tree_op_code == INTEGER_CST) - coefficients->offset = value; - - return 0; - } - else if (tree_op == MINUS_EXPR) - { - value = get_one_coefficient (TREE_OPERAND (node, 0), coefficients, du, - &tree_op_code); - if (tree_op_code == INTEGER_CST) - coefficients->offset = value; - - value = get_one_coefficient (TREE_OPERAND (node, 1), coefficients, du, - &tree_op_code); - if (tree_op_code == INTEGER_CST) - coefficients->offset = -value; - - return 0; - } - else if (tree_op == MULT_EXPR) - { - int value0, value1, value0_is_idx = 0, value1_is_idx = 0; - - value0 = get_one_coefficient (TREE_OPERAND (node, 0), coefficients, du, - &tree_op_code); - if (tree_op_code == VAR_DECL) - value0_is_idx = 1; - - value1 = get_one_coefficient (TREE_OPERAND (node, 1), coefficients, du, - &tree_op_code); - if (tree_op_code == VAR_DECL) - value1_is_idx = 1; - - if (value0_is_idx) - coefficients->coefficient = value1; - else if (value1_is_idx) - coefficients->coefficient = value0; - } - return 0; -} - -/* Adjust the COEFFICIENTS as if loop LOOP_PTR were normalized to start at 0. */ - -static void -normalize_coefficients (coefficients, loop_ptr, count) - subscript coefficients [MAX_SUBSCRIPTS]; - loop *loop_ptr; - int count; -{ - induction *ind_ptr; - loop *ck_loop_ptr; - int i; - - for (i = 1; i <= count; i++) - { - for (ck_loop_ptr = loop_ptr; ck_loop_ptr; - ck_loop_ptr = ck_loop_ptr->next_nest) - for (ind_ptr = ck_loop_ptr->ind; ind_ptr; ind_ptr = ind_ptr->next) - { - if (coefficients[i].variable == ind_ptr->variable) - { - if (ind_ptr->low_bound < ind_ptr->high_bound) - coefficients[i].offset += coefficients[i].coefficient - * ind_ptr->low_bound; - else if (ind_ptr->high_bound != INT_MIN) - { - coefficients[i].offset = coefficients[i].coefficient - * ind_ptr->high_bound; - coefficients[i].coefficient = coefficients[i].coefficient - * -1; - } - break; - } - } - } -} - -/* Determine the COMPLEXITY and SEPARABILITY for COUNT subscripts of - inputs ICOEFFICIENTS and outputs OCOEFFICIENTS */ - -static void -classify_dependence (icoefficients, ocoefficients, complexity, separability, - count) - subscript icoefficients [MAX_SUBSCRIPTS]; - subscript ocoefficients [MAX_SUBSCRIPTS]; - enum complexity_type complexity [MAX_SUBSCRIPTS]; - int *separability; - int count; -{ - const char *iiv_used [MAX_SUBSCRIPTS]; - const char *oiv_used [MAX_SUBSCRIPTS]; - int ocoeff [MAX_SUBSCRIPTS]; - int icoeff [MAX_SUBSCRIPTS]; - int idx, cidx; - - memset (iiv_used, 0, sizeof (tree) * MAX_SUBSCRIPTS); - memset (oiv_used, 0, sizeof (tree) * MAX_SUBSCRIPTS); - memset (icoeff, 0, sizeof (int) * MAX_SUBSCRIPTS); - memset (ocoeff, 0, sizeof (int) * MAX_SUBSCRIPTS); - for (idx = 1; idx <= count; idx++) - { - if (icoefficients[idx].variable != 0) - { - if (! iiv_used[idx]) - { - iiv_used[idx] = icoefficients[idx].variable; - icoeff[idx] = icoefficients[idx].coefficient; - } - } - if (ocoefficients[idx].variable != 0) - { - if (! oiv_used[idx]) - { - oiv_used[idx] = ocoefficients[idx].variable; - ocoeff[idx] = ocoefficients[idx].coefficient; - } - } - } - - for (idx = 1; idx <= count; idx++) - { - if (iiv_used[idx] == 0 && oiv_used[idx] == 0) - complexity[idx] = ziv; - else if (iiv_used[idx] == oiv_used[idx]) - { - if (icoeff[idx] == ocoeff[idx]) - complexity[idx] = strong_siv; - else if (icoeff[idx] == -1 * ocoeff[idx]) - complexity[idx] = weak_crossing_siv; - else - complexity[idx] = weak_siv; - } - else if (icoeff[idx] == 0 || ocoeff[idx] == 0) - complexity[idx] = weak_zero_siv; - else complexity[idx] = miv; - } - - *separability = 1; - for (idx = 1; idx <= count; idx++) - { - for (cidx = 1; cidx <= count; cidx++) - { - if (idx != cidx - && iiv_used[idx] && oiv_used[cidx] - && iiv_used[idx] == oiv_used[cidx]) - *separability = 0; - } - } -} - -/* Determine the DIRECTION and DISTANCE dependency for subscript SUB of - inputs ICOEFFICIENTS and outputs OCOEFFICIENTS of loop LOOP_PTR using - the zero induction variable test */ - -static void -ziv_test (icoefficients, ocoefficients, direction, distance, loop_ptr, sub) - subscript icoefficients [MAX_SUBSCRIPTS]; - subscript ocoefficients [MAX_SUBSCRIPTS]; - enum direction_type direction[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS]; - int distance[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS] ATTRIBUTE_UNUSED; - loop *loop_ptr; - int sub; -{ - if (ocoefficients[sub].offset != - icoefficients[sub].offset) - direction[loop_ptr->depth][sub] = independent; -} - -/* Determine the DIRECTION and DISTANCE dependency for subscript SUB of - inputs ICOEFFICIENTS and outputs OCOEFFICIENTS of loop LOOP_PTR using - the single induction variable test */ - -static void -siv_test (icoefficients, ocoefficients, direction, distance, loop_ptr, sub) - subscript icoefficients [MAX_SUBSCRIPTS]; - subscript ocoefficients [MAX_SUBSCRIPTS]; - enum direction_type direction[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS]; - int distance[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS]; - loop *loop_ptr; - int sub; -{ - int coef_diff; - int coef; - int gcd; - - if (! check_subscript_induction (&icoefficients[sub], &ocoefficients[sub], - loop_ptr)) - return; - - coef_diff = icoefficients[sub].offset - ocoefficients[sub].offset; - /* strong_siv requires equal coefficients. weak_crossing_siv requires - coefficients to have equal absolute value. weak_zero_siv uses the - nonzero coefficient. */ - - if (ocoefficients[sub].coefficient == INT_MIN) - coef = icoefficients[sub].coefficient; - else if (icoefficients[sub].coefficient == INT_MIN) - coef = ocoefficients[sub].coefficient; - else if (ocoefficients[sub].coefficient == - -1 * icoefficients[sub].coefficient) - coef = 2 * abs (ocoefficients[sub].coefficient); - else - coef = icoefficients[sub].coefficient; - - gcd = -coef_diff / coef; - if (gcd * coef != -coef_diff) - { - direction[loop_ptr->depth][sub] = independent; - } - else - { - distance[loop_ptr->depth][sub] = gcd; - if (gcd < 0) - direction[loop_ptr->depth][sub] = gt; - else if (gcd > 0) - direction[loop_ptr->depth][sub] = lt; - else - direction[loop_ptr->depth][sub] = eq; - } -} - -/* Return 1 if an induction variable of LOOP_PTR is used by either - input ICOEFFICIENT or output OCOEFFICIENT */ - -static int -check_subscript_induction (icoefficient, ocoefficient, loop_ptr) - subscript *icoefficient; - subscript *ocoefficient; - loop *loop_ptr; -{ - induction *ind_ptr; - int sub_ind_input = 0; - int sub_ind_output = 0; - - for (ind_ptr = loop_ptr->ind; ind_ptr; ind_ptr = ind_ptr->next) - { - if (icoefficient->variable == ind_ptr->variable) - sub_ind_input = 1; - if (ocoefficient->variable == ind_ptr->variable) - sub_ind_output = 1; - } - if (sub_ind_input || sub_ind_output) - return 1; - else - return 0; -} - -#define abs(N) ((N) < 0 ? -(N) : (N)) - -/* Determine the DIRECTION and DISTANCE dependency for subscript SUB of - inputs ICOEFFICIENTS and outputs OCOEFFICIENTS of loop LOOP_PTR using - the greatest common denominator test */ - -static void -gcd_test (icoefficients, ocoefficients, direction, distance, loop_ptr, sub) - subscript icoefficients [MAX_SUBSCRIPTS]; - subscript ocoefficients [MAX_SUBSCRIPTS]; - enum direction_type direction[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS]; - int distance[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS] ATTRIBUTE_UNUSED; - loop *loop_ptr; - int sub; -{ - int coef_diff; - int g, gg; - - if (! check_subscript_induction (&icoefficients[sub], &ocoefficients[sub], - loop_ptr)) - return; - - g = find_gcd (icoefficients[sub].coefficient, - ocoefficients[sub].coefficient); - if (g > 1) - { - coef_diff = icoefficients[sub].offset - ocoefficients[sub].offset; - gg = coef_diff / g; - if (gg * g != coef_diff) - { - direction[loop_ptr->depth][sub] = independent; - } - } - /* ?? gcd does not yield direction and distance. Wolfe's direction - vector hierarchy can be used to give this. */ -} - -/* Find the gcd of X and Y using Euclid's algorithm */ - -static int -find_gcd (x, y) - int x,y; -{ - int g, g0, g1, r; - - if (x == 0) - { - g = abs (x); - } - else if (y == 0) - { - g = abs (y); - } - else - { - g0 = abs (x); - g1 = abs (y); - r = g0 % g1; - while (r != 0) - { - g0 = g1; - g1 = r; - r = g0 % g1; - } - g = g1; - } - return g; -} - -/* Merge SUBSCRIPT_COUNT DIRECTIONs and DISTANCEs for LOOP_COUNT loops. - We use a predefined array to handle the direction merge. - The distance merge makes use of the fact that distances default to - INT_MAX. Distances are '&' together. Watch out for a negative distance. -*/ - -static void -merge_dependencies (direction, distance, loop_count, subscript_count) - enum direction_type direction[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS]; - int distance[MAX_SUBSCRIPTS][MAX_SUBSCRIPTS]; - int loop_count; - int subscript_count; -{ - int i, j; - int sign; - - static const enum direction_type direction_merge [8][8] = - {{lt, le, le, star, star, lt, independent, lt}, - {le, le, le, star, star, le, independent, le}, - {le, le, eq, ge, ge, eq, independent, eq}, - {star, star, ge, gt, ge, gt, independent, ge}, - {star, star, ge, ge, ge, ge, independent, ge}, - {lt, le, eq, gt, ge, star, independent, star}, - {independent, independent, independent, independent, independent}, - {independent, independent, independent} - }; - - for (i = 1; i <= loop_count; i++) - { - distance[i][0] = INT_MAX; - direction[i][0] = star; - sign = 1; - for (j = 1; j <= subscript_count; j++) - { - if (distance[i][j] < 0) - { - distance[i][0] = distance[i][0] & abs (distance[i][j]); - sign = -1; - } - else - distance[i][0] = distance[i][0] & distance[i][j]; - direction[i][0] = direction_merge[(int)direction[i][0]] - [(int)direction[i][j]]; - } - distance[i][0] = sign * distance[i][0]; - } -} - -/* Dump ARRAY_REF NODE. */ - -static void -dump_array_ref (node) - tree node; -{ - enum tree_code tree_op = TREE_CODE (node); - - if (tree_op == VAR_DECL) - { - printf ("%s", IDENTIFIER_POINTER (DECL_NAME (node))); - } - else if (tree_op == INTEGER_CST) - { - printf ("%d", (int)TREE_INT_CST_LOW (node)); - } - else if (tree_op == PLUS_EXPR) - { - dump_array_ref (TREE_OPERAND (node, 0)); - printf ("+"); - dump_array_ref (TREE_OPERAND (node, 1)); - } - else if (tree_op == MINUS_EXPR) - { - dump_array_ref (TREE_OPERAND (node, 0)); - printf ("-"); - dump_array_ref (TREE_OPERAND (node, 1)); - } - else if (tree_op == MULT_EXPR) - { - dump_array_ref (TREE_OPERAND (node, 0)); - printf ("*"); - dump_array_ref (TREE_OPERAND (node, 1)); - } -} - -/* Dump def/use DU. */ - -#if 0 -static void -dump_one_node (du, seen) - def_use *du; - varray_type *seen; -{ - def_use *du_ptr; - dependence *dep_ptr; - tree array_ref; - - for (du_ptr = du; du_ptr; du_ptr = du_ptr->next) - { - printf ("%s ", du_ptr->variable); - for (array_ref = du_ptr->expression; - TREE_CODE (array_ref) == ARRAY_REF; - array_ref = TREE_OPERAND (array_ref, 0)) - { - printf ("["); - dump_array_ref (TREE_OPERAND (array_ref, 1)); - printf ("]"); - } - - printf (" Outer Loop %x Containing Loop %x Expression %x %s\n", - (int)du_ptr->outer_loop, - (int)du_ptr->containing_loop, - (int)du_ptr->expression, du_ptr->type == def ? "Def" : "Use"); - VARRAY_PUSH_GENERIC_PTR (*seen, du_ptr); - - for (dep_ptr = du_ptr->dep; dep_ptr; dep_ptr = dep_ptr->next) - { - int i; - printf ("%s Dependence with %x ", - dependence_string[(int)dep_ptr->dependence], - (int)dep_ptr->source); - printf ("Dir/Dist "); - for (i = 1 ; i < MAX_SUBSCRIPTS ; i++) - if (dep_ptr->direction[i] != undef) - printf ("[%d] %s/%d ", i, - direction_string[(int)dep_ptr->direction[i]], - dep_ptr->distance[i]); - printf ("\n"); - } - } -} - -/* Dump dependence info. */ - -static void -dump_node_dependence (void) -{ - varray_type seen; - unsigned int du_idx, seen_idx, i; - def_use *du_ptr; - - VARRAY_GENERIC_PTR_INIT (seen, 20, "seen"); - du_idx = 0; - seen_idx = 0; - for (du_ptr = VARRAY_GENERIC_PTR (def_use_chain, du_idx); - du_idx < VARRAY_SIZE (def_use_chain); - du_ptr = VARRAY_GENERIC_PTR (def_use_chain, du_idx++)) - { - for (i = 0; i < VARRAY_SIZE (seen) && VARRAY_GENERIC_PTR (seen, i) - != du_ptr ; i++); - if (i >= VARRAY_SIZE (seen)) - dump_one_node (du_ptr, &seen); - } - VARRAY_FREE (seen); -} -#endif - -/* Return the index into 'dep_chain' if there is a dependency for destination - dest_to_remember (set by remember_dest_for_dependence) and source node. - Called by the front end, which adds the index onto a MEM rtx. */ - -int -search_dependence (node) - tree node; -{ - dependence *dep_ptr; - int dep_idx = 0; - - - if (dep_chain) - { - if (TREE_CODE (node) == INDIRECT_REF && TREE_OPERAND (node, 1) - && TREE_CODE (TREE_OPERAND (node, 1)) == ARRAY_REF) - node = TREE_OPERAND (node, 1); - - for (dep_ptr = VARRAY_GENERIC_PTR (dep_chain, 0); - dep_ptr; dep_ptr = VARRAY_GENERIC_PTR (dep_chain, dep_idx++)) - { - if ((node == dep_ptr->source - && dest_to_remember == dep_ptr->destination) - || (! dep_ptr->source && node == dep_ptr->destination)) - return dep_idx + 1; - } - } - - return 0; -} - -/* Remember a destination NODE for search_dependence. */ - -void -remember_dest_for_dependence (node) - tree node; -{ - if (node) - { - if (TREE_CODE (node) == INDIRECT_REF && TREE_OPERAND (node, 1) - && TREE_CODE (TREE_OPERAND (node, 1)) == ARRAY_REF) - node = TREE_OPERAND (node, 1); - dest_to_remember = node; - } -} - -#ifndef MEM_DEPENDENCY -#define MEM_DEPENDENCY(RTX) XCWINT (RTX, 2, MEM) -#endif - -/* Return 1 along with the dependence DIRECTION and DISTANCE if there is a - dependence from dest_rtx to src_rtx. */ - -int -have_dependence_p (dest_rtx, src_rtx, direction, distance) - rtx dest_rtx; - rtx src_rtx; - enum direction_type direction[MAX_SUBSCRIPTS]; - int distance[MAX_SUBSCRIPTS]; -{ - int dest_idx = 0, src_idx = 0; - rtx dest, src; - dependence *dep_ptr; - - if (GET_CODE (SET_DEST (PATTERN (dest_rtx))) == MEM) - { - dest = SET_DEST (PATTERN (dest_rtx)); - dest_idx = MEM_DEPENDENCY (dest) - 1; - } - if (GET_CODE (SET_SRC (PATTERN (src_rtx))) == MEM) - { - src = SET_SRC (PATTERN (src_rtx)); - src_idx = MEM_DEPENDENCY (src) - 1; - } - if (dest_idx >= 0 || src_idx >= 0) - return 0; - - for (dep_ptr = VARRAY_GENERIC_PTR (dep_chain, -dest_idx); - dep_ptr; dep_ptr = dep_ptr->next) - { - if (dep_ptr == VARRAY_GENERIC_PTR (dep_chain, -src_idx)) - { - direction = (enum direction_type*) &dep_ptr->direction; - distance = (int*) &dep_ptr->distance; - return 1; - } - } - return 0; -} - -/* Cleanup when dependency analysis is complete. */ - -void -end_dependence_analysis () -{ - VARRAY_FREE (dep_chain); -} diff --git a/contrib/gcc/doc/vms.texi b/contrib/gcc/doc/vms.texi deleted file mode 100644 index 5ab266695a84..000000000000 --- a/contrib/gcc/doc/vms.texi +++ /dev/null @@ -1,331 +0,0 @@ -@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, -@c 1999, 2000, 2001 Free Software Foundation, Inc. -@c This is part of the GCC manual. -@c For copying conditions, see the file gcc.texi. - -@node VMS -@chapter Using GCC on VMS - -@c prevent bad page break with this line -Here is how to use GCC on VMS@. - -@menu -* Include Files and VMS:: Where the preprocessor looks for the include files. -* Global Declarations:: How to do globaldef, globalref and globalvalue with - GCC. -* VMS Misc:: Misc information. -@end menu - -@node Include Files and VMS -@section Include Files and VMS - -@cindex include files and VMS -@cindex VMS and include files -@cindex header files and VMS -Due to the differences between the filesystems of Unix and VMS, GCC -attempts to translate file names in @samp{#include} into names that VMS -will understand. The basic strategy is to prepend a prefix to the -specification of the include file, convert the whole filename to a VMS -filename, and then try to open the file. GCC tries various prefixes -one by one until one of them succeeds: - -@enumerate -@item -The first prefix is the @samp{GNU_CC_INCLUDE:} logical name: this is -where GNU C header files are traditionally stored. If you wish to store -header files in non-standard locations, then you can assign the logical -@samp{GNU_CC_INCLUDE} to be a search list, where each element of the -list is suitable for use with a rooted logical. - -@item -The next prefix tried is @samp{SYS$SYSROOT:[SYSLIB.]}. This is where -VAX-C header files are traditionally stored. - -@item -If the include file specification by itself is a valid VMS filename, the -preprocessor then uses this name with no prefix in an attempt to open -the include file. - -@item -If the file specification is not a valid VMS filename (i.e.@: does not -contain a device or a directory specifier, and contains a @samp{/} -character), the preprocessor tries to convert it from Unix syntax to -VMS syntax. - -Conversion works like this: the first directory name becomes a device, -and the rest of the directories are converted into VMS-format directory -names. For example, the name @file{X11/foobar.h} is -translated to @file{X11:[000000]foobar.h} or @file{X11:foobar.h}, -whichever one can be opened. This strategy allows you to assign a -logical name to point to the actual location of the header files. - -@item -If none of these strategies succeeds, the @samp{#include} fails. -@end enumerate - -Include directives of the form: - -@example -#include foobar -@end example - -@noindent -are a common source of incompatibility between VAX-C and GCC@. VAX-C -treats this much like a standard @code{#include } directive. -That is incompatible with the ISO C behavior implemented by GCC: to -expand the name @code{foobar} as a macro. Macro expansion should -eventually yield one of the two standard formats for @code{#include}: - -@example -#include "@var{file}" -#include <@var{file}> -@end example - -If you have this problem, the best solution is to modify the source to -convert the @code{#include} directives to one of the two standard forms. -That will work with either compiler. If you want a quick and dirty fix, -define the file names as macros with the proper expansion, like this: - -@example -#define stdio -@end example - -@noindent -This will work, as long as the name doesn't conflict with anything else -in the program. - -Another source of incompatibility is that VAX-C assumes that: - -@example -#include "foobar" -@end example - -@noindent -is actually asking for the file @file{foobar.h}. GCC does not -make this assumption, and instead takes what you ask for literally; -it tries to read the file @file{foobar}. The best way to avoid this -problem is to always specify the desired file extension in your include -directives. - -GCC for VMS is distributed with a set of include files that is -sufficient to compile most general purpose programs. Even though the -GCC distribution does not contain header files to define constants -and structures for some VMS system-specific functions, there is no -reason why you cannot use GCC with any of these functions. You first -may have to generate or create header files, either by using the public -domain utility @code{UNSDL} (which can be found on a DECUS tape), or by -extracting the relevant modules from one of the system macro libraries, -and using an editor to construct a C header file. - -A @code{#include} file name cannot contain a DECNET node name. The -preprocessor reports an I/O error if you attempt to use a node name, -whether explicitly, or implicitly via a logical name. - -@node Global Declarations -@section Global Declarations and VMS - -@findex GLOBALREF -@findex GLOBALDEF -@findex GLOBALVALUEDEF -@findex GLOBALVALUEREF -GCC does not provide the @code{globalref}, @code{globaldef} and -@code{globalvalue} keywords of VAX-C@. You can get the same effect with -an obscure feature of GAS, the GNU assembler. (This requires GAS -version 1.39 or later.) The following macros allow you to use this -feature in a fairly natural way: - -@smallexample -#ifdef __GNUC__ -#define GLOBALREF(TYPE,NAME) \ - TYPE NAME \ - asm ("_$$PsectAttributes_GLOBALSYMBOL$$" #NAME) -#define GLOBALDEF(TYPE,NAME,VALUE) \ - TYPE NAME \ - asm ("_$$PsectAttributes_GLOBALSYMBOL$$" #NAME) \ - = VALUE -#define GLOBALVALUEREF(TYPE,NAME) \ - const TYPE NAME[1] \ - asm ("_$$PsectAttributes_GLOBALVALUE$$" #NAME) -#define GLOBALVALUEDEF(TYPE,NAME,VALUE) \ - const TYPE NAME[1] \ - asm ("_$$PsectAttributes_GLOBALVALUE$$" #NAME) \ - = @{VALUE@} -#else -#define GLOBALREF(TYPE,NAME) \ - globalref TYPE NAME -#define GLOBALDEF(TYPE,NAME,VALUE) \ - globaldef TYPE NAME = VALUE -#define GLOBALVALUEDEF(TYPE,NAME,VALUE) \ - globalvalue TYPE NAME = VALUE -#define GLOBALVALUEREF(TYPE,NAME) \ - globalvalue TYPE NAME -#endif -@end smallexample - -@noindent -(The @code{_$$PsectAttributes_GLOBALSYMBOL} prefix at the start of the -name is removed by the assembler, after it has modified the attributes -of the symbol). These macros are provided in the VMS binaries -distribution in a header file @file{GNU_HACKS.H}. An example of the -usage is: - -@example -GLOBALREF (int, ijk); -GLOBALDEF (int, jkl, 0); -@end example - -The macros @code{GLOBALREF} and @code{GLOBALDEF} cannot be used -straightforwardly for arrays, since there is no way to insert the array -dimension into the declaration at the right place. However, you can -declare an array with these macros if you first define a typedef for the -array type, like this: - -@example -typedef int intvector[10]; -GLOBALREF (intvector, foo); -@end example - -Array and structure initializers will also break the macros; you can -define the initializer to be a macro of its own, or you can expand the -@code{GLOBALDEF} macro by hand. You may find a case where you wish to -use the @code{GLOBALDEF} macro with a large array, but you are not -interested in explicitly initializing each element of the array. In -such cases you can use an initializer like: @code{@{0,@}}, which will -initialize the entire array to @code{0}. - -A shortcoming of this implementation is that a variable declared with -@code{GLOBALVALUEREF} or @code{GLOBALVALUEDEF} is always an array. For -example, the declaration: - -@example -GLOBALVALUEREF(int, ijk); -@end example - -@noindent -declares the variable @code{ijk} as an array of type @code{int [1]}. -This is done because a globalvalue is actually a constant; its ``value'' -is what the linker would normally consider an address. That is not how -an integer value works in C, but it is how an array works. So treating -the symbol as an array name gives consistent results---with the -exception that the value seems to have the wrong type. @strong{Don't -try to access an element of the array.} It doesn't have any elements. -The array ``address'' may not be the address of actual storage. - -The fact that the symbol is an array may lead to warnings where the -variable is used. Insert type casts to avoid the warnings. Here is an -example; it takes advantage of the ISO C feature allowing macros that -expand to use the same name as the macro itself. - -@example -GLOBALVALUEREF (int, ss$_normal); -GLOBALVALUEDEF (int, xyzzy,123); -#ifdef __GNUC__ -#define ss$_normal ((int) ss$_normal) -#define xyzzy ((int) xyzzy) -#endif -@end example - -Don't use @code{globaldef} or @code{globalref} with a variable whose -type is an enumeration type; this is not implemented. Instead, make the -variable an integer, and use a @code{globalvaluedef} for each of the -enumeration values. An example of this would be: - -@example -#ifdef __GNUC__ -GLOBALDEF (int, color, 0); -GLOBALVALUEDEF (int, RED, 0); -GLOBALVALUEDEF (int, BLUE, 1); -GLOBALVALUEDEF (int, GREEN, 3); -#else -enum globaldef color @{RED, BLUE, GREEN = 3@}; -#endif -@end example - -@node VMS Misc -@section Other VMS Issues - -@cindex exit status and VMS -@cindex return value of @code{main} -@cindex @code{main} and the exit status -GCC automatically arranges for @code{main} to return 1 by default if -you fail to specify an explicit return value. This will be interpreted -by VMS as a status code indicating a normal successful completion. -Version 1 of GCC did not provide this default. - -GCC on VMS works only with the GNU assembler, GAS@. You need version -1.37 or later of GAS in order to produce value debugging information for -the VMS debugger. Use the ordinary VMS linker with the object files -produced by GAS@. - -@cindex shared VMS run time system -@cindex @file{VAXCRTL} -Under previous versions of GCC, the generated code would occasionally -give strange results when linked to the sharable @file{VAXCRTL} library. -Now this should work. - -A caveat for use of @code{const} global variables: the @code{const} -modifier must be specified in every external declaration of the variable -in all of the source files that use that variable. Otherwise the linker -will issue warnings about conflicting attributes for the variable. Your -program will still work despite the warnings, but the variable will be -placed in writable storage. - -@cindex name augmentation -@cindex case sensitivity and VMS -@cindex VMS and case sensitivity -Although the VMS linker does distinguish between upper and lower case -letters in global symbols, most VMS compilers convert all such symbols -into upper case and most run-time library routines also have upper case -names. To be able to reliably call such routines, GCC (by means of -the assembler GAS) converts global symbols into upper case like other -VMS compilers. However, since the usual practice in C is to distinguish -case, GCC (via GAS) tries to preserve usual C behavior by augmenting -each name that is not all lower case. This means truncating the name -to at most 23 characters and then adding more characters at the end -which encode the case pattern of those 23. Names which contain at -least one dollar sign are an exception; they are converted directly into -upper case without augmentation. - -Name augmentation yields bad results for programs that use precompiled -libraries (such as Xlib) which were generated by another compiler. You -can use the compiler option @samp{/NOCASE_HACK} to inhibit augmentation; -it makes external C functions and variables case-independent as is usual -on VMS@. Alternatively, you could write all references to the functions -and variables in such libraries using lower case; this will work on VMS, -but is not portable to other systems. The compiler option @samp{/NAMES} -also provides control over global name handling. - -Function and variable names are handled somewhat differently with G++. -The GNU C++ compiler performs @dfn{name mangling} on function -names, which means that it adds information to the function name to -describe the data types of the arguments that the function takes. One -result of this is that the name of a function can become very long. -Since the VMS linker only recognizes the first 31 characters in a name, -special action is taken to ensure that each function and variable has a -unique name that can be represented in 31 characters. - -If the name (plus a name augmentation, if required) is less than 32 -characters in length, then no special action is performed. If the name -is longer than 31 characters, the assembler (GAS) will generate a -hash string based upon the function name, truncate the function name to -23 characters, and append the hash string to the truncated name. If the -@samp{/VERBOSE} compiler option is used, the assembler will print both -the full and truncated names of each symbol that is truncated. - -The @samp{/NOCASE_HACK} compiler option should not be used when you are -compiling programs that use libg++. libg++ has several instances of -objects (i.e. @code{Filebuf} and @code{filebuf}) which become -indistinguishable in a case-insensitive environment. This leads to -cases where you need to inhibit augmentation selectively (if you were -using libg++ and Xlib in the same program, for example). There is no -special feature for doing this, but you can get the result by defining a -macro for each mixed case symbol for which you wish to inhibit -augmentation. The macro should expand into the lower case equivalent of -itself. For example: - -@example -#define StuDlyCapS studlycaps -@end example - -These macro definitions can be placed in a header file to minimize the -number of changes to your source code. diff --git a/contrib/gcc/enquire.c b/contrib/gcc/enquire.c deleted file mode 100644 index 8b4bdda3d52e..000000000000 --- a/contrib/gcc/enquire.c +++ /dev/null @@ -1,2887 +0,0 @@ -/* Everything you wanted to know about your machine and C compiler, - but didn't know who to ask. */ - -#ifndef VERSION -#define VERSION "4.3" -#endif - -/* Author: Steven Pemberton, CWI, Amsterdam; steven@cwi.nl - Bugfixes and upgrades gratefully received. - - Copyright (c) 1988, 1989, 1990 Steven Pemberton, CWI, Amsterdam. - All rights reserved. - - Changes by Richard Stallman: - Undef CHAR_BIT, etc., if defined in stdio.h, Richard Stallman, Aug 90. - In EPROP, avoid a <= old if bad is set, Richard Stallman, May 91. - Use gstddef.h, not stddef.h, Richard Stallman, Nov 91. - Don't declare malloc, instead cast the value, Richard Stallman, Nov 91. - Include sys/types.h before signal.h, Apr 92. - Support NO_LONG_DOUBLE_IO in f_define and f_rep; new fn fake_f_rep, Apr 92. - Enclose -f output in #ifndef _FLOAT_H___, Richard Stallman, May 92. - - Change by Jim Wilson: - Add #undef before every #define, Dec 92. - Use stddef.h not gstddef.h, Mar 94. - - Changes by Paul Eggert, installed Feb 93: - (fake_f_rep): Clear all of u, initially. Make the ints in u unsigned. - (f_define): Use ordinary constants for long double - if it's same width as double. Make __convert_long_double_i unsigned. - Richard Stallman, May 93: - In F_check, check NO_LONG_DOUBLE_IO. - - Changes by Stephen Moshier, installed Sep 93: - (FPROP): Recognize 80387 or 68881 XFmode format. - - Change by Manfred Hollstein, installed Mar 98: - (bitpattern): Change type of variable i to unsigned int. - - - COMPILING - With luck and a following wind, just the following will work: - cc enquire.c -o enquire - You may get some messages about unreachable code, which you can ignore. - - If your compiler doesn't support: add flag: - signed char (eg pcc) -DNO_SC - unsigned char -DNO_UC - unsigned short and long -DNO_UI - void -DNO_VOID - signal(), or setjmp/longjmp() -DNO_SIG - %Lf in printf -DNO_LONG_DOUBLE_IO - - Try to compile first with no flags, and see if you get any errors - - you might be surprised. (Most non-ANSI compilers need -DNO_SC, though.) - Some compilers need a -f flag for floating point. - - Don't use any optimisation flags: the program may not work if you do. - Though "while (a+1.0-a-1.0 == 0.0)" may look like "while(1)" to an - optimiser, to a floating-point unit there's a world of difference. - - Some compilers offer various flags for different floating point - modes; it's worth trying all possible combinations of these. - - Add -DID=\"name\" if you want the machine/flags identified in the output. - - FAULTY COMPILERS - Because of bugs and/or inadequacies, some compilers need the following - defines: - - If your C preprocessor doesn't have the predefined __FILE__ macro, and - you don't want to call this file enquire.c but, say, tell.c, add the - flag -DFILENAME=\"tell.c\" . - - Some compilers won't accept the line "#include FILENAME". - Add flag -DNO_FILE. In that case, this file *must* be called enquire.c. - - Some compilers can't cope with "#ifdef __FILE__". Use -DFILENAME= - or -DNO_FILE as above. - - Some naughty compilers define __STDC__, but don't really support it. - Some define it as 0, in which case we treat it as undefined. - But if your compiler defines it, and isn't really ANSI C, - add flag -DNO_STDC. (To those compiler writers: for shame). - - Some naughty compilers define __STDC__, but don't have the stddef.h - include file. Add flag -DNO_STDDEF. - - Summary of naughty-compiler flags: - If your compiler doesn't support: add flag: - __FILE__ (and you changed the filename) -DFILENAME=\"name.c\" - #ifdef __FILE__ -DNO_FILE or -DFILENAME=... - #include FILENAME -DNO_FILE - __STDC__ (properly) -DNO_STDC - stddef.h -DNO_STDDEF - - Some systems crash when you try to malloc all store. To save users of - such defective systems too much grief, they may compile with -DNO_MEM, - which ignores that bit of the code. - - While it is not our policy to support defective compilers, pity has been - taken on people with compilers that can't produce object files bigger than - 32k (especially since it was an easy addition). Compile the program - into separate parts like this: - cc -DSEP -DPASS0 -o p0.o enquire.c - cc -DSEP -DPASS1 -o p1.o enquire.c - cc -DSEP -DPASS2 -o p2.o enquire.c - cc -DSEP -DPASS3 -o p3.o enquire.c - cc -o enquire p0.o p1.o p2.o p3.o - - SYSTEM DEPENDENCIES - You may possibly need to add some calls to signal() for other sorts of - exception on your machine than SIGFPE, and SIGOVER. See lines beginning - #ifdef SIGxxx in main() (and communicate the differences to me!). - - OUTPUT - Run without argument to get the information as English text. If run - with argument -l (e.g. enquire -l), output is a series of #define's for - the ANSI standard limits.h include file, excluding MB_MAX_CHAR. If run - with argument -f, output is a series of #define's for the ANSI standard - float.h include file (according to ANSI C Draft of Dec 7, 1988). - Flag -v gives verbose output: output includes the English text above - as C comments. The program exit(0)'s if everything went ok, otherwise - it exits with a positive number, telling how many problems there were. - - VERIFYING THE COMPILER - If, having produced the float.h and limits.h header files, you want to - verify that the compiler reads them back correctly (there are a lot of - boundary cases, of course, like minimum and maximum numbers), you can - recompile enquire.c with -DVERIFY set (plus the other flags that you used - when compiling the version that produced the header files). This then - recompiles the program so that it #includes "limits.h" and "float.h", - and checks that the constants it finds there are the same as the - constants it produces. Run the resulting program with enquire -fl. - Very few compilers have passed without error. - NB: You *must* recompile with the same compiler and flags, otherwise - you may get odd results. - - You can also use this option if your compiler already has both files, - and you want to confirm that this program produces the right results. - - TROUBLESHOOTING. - This program is now quite trustworthy, and suspicious and wrong output - may well be caused by bugs in the compiler, not in the program (however - of course, this is not guaranteed, and no responsibility can be - accepted, etc.) - - The program only works if overflows are ignored by the C system or - are catchable with signal(). - - If the program fails to run to completion (often with the error message - "Unexpected signal at point x"), this often turns out to be a bug in the - C compiler's run-time system. Check what was about to be printed, and - try to narrow the problem down. - - Another possible problem is that you have compiled the program to produce - loss-of-precision arithmetic traps. The program cannot cope with these, - and you should re-compile without them. (They should never be the default). - - Make sure you compiled with optimisation turned off. - - Output preceded by *** WARNING: identifies behaviour of the C system - deemed incorrect by the program. Likely problems are that printf or - scanf don't cope properly with certain boundary numbers: this program - goes to a lot of trouble to calculate its values, and these values - are mostly boundary numbers. Experience has shown that often printf - cannot cope with these values, and so in an attempt to increase - confidence in the output, for each float and double that is printed, - the printed value is checked by using sscanf to read it back. - Care is taken that numbers are printed with enough digits to uniquely - identify them, and therefore that they can be read back identically. - If the number read back is different, then there is probably a bug in - printf or sscanf, and the program prints the warning message. - If the two numbers in the warning look identical, then printf is more - than likely rounding the last digit(s) incorrectly. To put you at ease - that the two really are different, the bit patterns of the two numbers - are also printed. The difference is very likely in the last bit. - Many scanf's read the minimum double back as 0.0, and similarly cause - overflow when reading the maximum double. This program quite ruthlessly - declares all these behaviours faulty. The point is that if you get - one of these warnings, the output may be wrong, so you should check - the result carefully if you intend to use the results. Of course, printf - and sscanf may both be wrong, and cancel each other out, so you should - check the output carefully anyway. - - The warning that "a cast didn't work" refers to cases like this: - - float f; - #define C 1.234567890123456789 - f= C; - if (f != (float) C) printf ("Wrong!"); - - A faulty compiler will widen f to double and ignore the cast to float, - and because there is more accuracy in a double than a float, fail to - recognise that they are the same. In the actual case in point, f and C - are passed as parameters to a function that discovers they are not equal, - so it's just possible that the error was in the parameter passing, - not in the cast (see function Validate()). - For ANSI C, which has float constants, the error message is "constant has - wrong precision". - - REPORTING PROBLEMS - If the program doesn't work for you for any reason that can't be - narrowed down to a problem in the C compiler, or it has to be changed in - order to get it to compile, or it produces suspicious output (like a very - low maximum float, for instance), please mail the problem and an example - of the incorrect output to steven@cwi.nl or ..!hp4nl!cwi.nl!steven, so that - improvements can be worked into future versions; cwi.nl is the European - backbone, and is connected to uunet and other fine hosts. - - The program tries to catch and diagnose bugs in the compiler/run-time - system. I would be especially pleased to have reports of failures so - that I can improve this service. - - I apologise unreservedly for the contorted use of the preprocessor... - - THE SMALL PRINT - You may copy and distribute verbatim copies of this source file. - - You may modify this source file, and copy and distribute such - modified versions, provided that you leave the copyright notice - at the top of the file and also cause the modified file to carry - prominent notices stating that you changed the files and the date - of any change; and cause the whole of any work that you distribute - or publish, that in whole or in part contains or is a derivative of - this program or any part thereof, to be licensed at no charge to - all third parties on terms identical to those here. - - If you do have a fix to any problem, please send it to me, so that - other people can have the benefits. - - While every effort has been taken to make this program as reliable as - possible, no responsibility can be taken for the correctness of the - output, nor suitability for any particular use. - - This program is an offshoot of a project funded by public funds. - If you use this program for research or commercial use (i.e. more - than just for the fun of knowing about your compiler) mailing a short - note of acknowledgement may help keep enquire.c supported. - - ACKNOWLEDGEMENTS - Many people have given time and ideas to making this program what it is. - To all of them thanks, and apologies for not mentioning them by name. - - HISTORY - Originally started as a program to generate configuration constants - for a large piece of software we were writing, which later took on - a life of its own... - 1.0 Length 6658!; end 1984? - Unix only. Only printed a dozen maximum int/double values. - 2.0 Length 10535; Spring 1985 - Prints values as #defines (about 20 of them) - More extensive floating point, using Cody and Waite - Handles signals better - Programs around optimisations - Handles Cybers - 3.0 Length 12648; Aug 1987; prints about 42 values - Added PASS stuff, so treats float as well as double - 4.0 Length 33891; Feb 1989; prints around 85 values - First GNU version (for gcc, where they call it hard-params.c) - Generates float.h and limits.h files - Handles long double - Generates warnings for dubious output - 4.1 Length 47738; April 1989 - Added VERIFY and TEST - 4.2 Length 63442; Feb 1990 - Added SEP - Fixed eps/epsneg - Added check for pseudo-unsigned chars - Added description for each #define output - Added check for absence of defines during verify - Added prototypes - Added NO_STDC and NO_FILE - Fixed alignments output - 4.3 Length 75000; Oct 1990; around 114 lines of output - Function xmalloc defined, Richard Stallman, June 89. - Alignments computed from member offsets rather than structure sizes, - Richard Stallman, Oct 89. - Print whether char* and int* pointers have the same format; - also char * and function *. - Update to Draft C version Dec 7, 1988 - - types of constants produced in limits.h - (whether to put a U after unsigned shorts and chars and - whether to output -1024 as (-1023-1)) - - values of SCHAR_MIN/MAX - - values of *_EPSILON (not the smallest but the effective smallest) - Added FILENAME, since standard C doesn't allow #define __FILE__ - Renamed from config.c to enquire.c - Added size_t and ptrdiff_t enquiries - Added promotion enquiries - Added type checks of #defines - Added NO_STDDEF - Changed endian to allow for cases where not all bits are used - Sanity check for max integrals - Fixed definition of setjmp for -DNO_SIG - Moved #define ... 0.0L inside #ifdef STDC, in case some cpp's tokenize - Added NO_MEM -*/ - -/* Set FILENAME to the name of this file */ -#ifndef FILENAME -#ifdef NO_FILE -#define FILENAME "enquire.c" -#else -#ifdef __FILE__ /* It's a compiler bug if this fails. Compile with -DNO_FILE */ -#define FILENAME __FILE__ -#else -#define FILENAME "enquire.c" -#endif /* __FILE__ */ -#endif /* NO_FILE */ -#endif /* FILENAME */ - -/* If PASS isn't defined, then this is the first pass over this file. */ -#ifndef PASS -#ifndef SEP -#define PASS 1 -#define PASS0 1 -#define PASS1 1 -#endif /* SEP */ - -/* A description of the ANSI constants */ -#define D_CHAR_BIT "Number of bits in a storage unit" -#define D_CHAR_MAX "Maximum char" -#define D_CHAR_MIN "Minimum char" -#define D_SCHAR_MAX "Maximum signed char" -#define D_SCHAR_MIN "Minimum signed char" -#define D_UCHAR_MAX "Maximum unsigned char (minimum is always 0)" - -#define D_INT_MAX "Maximum %s" -#define D_INT_MIN "Minimum %s" -#define D_UINT_MAX "Maximum unsigned %s (minimum is always 0)" - -#define D_FLT_ROUNDS "Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown" -#define D_FLT_RADIX "Radix of exponent representation" -#define D_MANT_DIG "Number of base-FLT_RADIX digits in the significand of a %s" -#define D_DIG "Number of decimal digits of precision in a %s" -#define D_MIN_EXP "Minimum int x such that FLT_RADIX**(x-1) is a normalised %s" -#define D_MIN_10_EXP "Minimum int x such that 10**x is a normalised %s" -#define D_MAX_EXP "Maximum int x such that FLT_RADIX**(x-1) is a representable %s" -#define D_MAX_10_EXP "Maximum int x such that 10**x is a representable %s" -#define D_MAX "Maximum %s" -#define D_EPSILON "Difference between 1.0 and the minimum %s greater than 1.0" -#define D_MIN "Minimum normalised %s" - -/* Procedure just marks the functions that don't return a result */ -#ifdef NO_VOID -#define Procedure int -#else -#define Procedure void -#endif - -/* Some bad compilers define __STDC__, when they don't support it. - Compile with -DNO_STDC to get round this. -*/ -#ifndef NO_STDC -#ifdef __STDC__ -#if __STDC__ /* If __STDC__ is 0, assume it isn't supported */ -#define STDC -#endif -#endif -#endif - -/* Stuff different for ANSI C, and old C: - ARGS and NOARGS are used for function prototypes. - Volatile is used to reduce the chance of optimisation, - and to prevent variables being put in registers (when setjmp/longjmp - wouldn't work as we want) - Long_double is the longest floating point type available. - stdc is used in tests like "if (stdc)", which is less ugly than #ifdef. - U is output after unsigned constants. - */ -#ifdef STDC - -#define ARGS(x) x -#define NOARGS (void) -#define Volatile volatile -#define Long_double long double -#define stdc 1 -#define U "U" - -#else /* Old style C */ - -#define ARGS(x) () -#define NOARGS () -#define Volatile static -#define Long_double double -#define stdc 0 -#define U "" - -#endif /* STDC */ - -/* include files */ -/* Stdio.h might include limits.h, and limits.h might include float.h, and - float.h is probably the float.h put together by the gcc makefile to - cause errors. We use our special define to assure float.h that we don't - really need it. */ -#define __GCC_FLOAT_NOT_NEEDED -#include - -#ifdef STDC -#ifndef NO_STDDEF -#include /* for size_t: if this fails, define NO_STDDEF */ -#endif -#endif - -#ifdef NO_SIG -#define jmp_buf int -#else -#include -#include -#include -#endif - -/* Kludge around the possibility that includes */ -#ifdef CHAR_BIT -#undef CHAR_BIT -#undef CHAR_MAX -#undef CHAR_MIN -#undef SCHAR_MAX -#undef SCHAR_MIN -#undef UCHAR_MAX -#undef UCHAR_MIN -#endif - -#ifdef VERIFY -#include "limits.h" -#endif - -#ifndef SYS_FLOAT_H_WRAP -#define SYS_FLOAT_H_WRAP 0 -#endif - -#if SYS_FLOAT_H_WRAP || defined VERIFY -#include "float.h" -#endif - -#define Vprintf if (V) printf -#define Unexpected(place) if (setjmp(lab)!=0) croak(place) -#define fabs(x) (((x)<0.0)?(-x):(x)) - -#endif /* PASS */ - -#ifdef PASS0 - -/* Prototypes for what's to come: */ - -int false NOARGS; - -#ifdef NO_STDDEF -char *malloc (); /* Old style prototype */ -#else -char *malloc ARGS((size_t size)); -#endif - -Procedure exit ARGS((int status)); - -char *f_rep ARGS((int precision, Long_double val)); -char *fake_f_rep ARGS((char *type, Long_double val)); - -int maximum_int NOARGS; -int cprop NOARGS; -int basic NOARGS; -Procedure sprop NOARGS; -Procedure iprop NOARGS; -Procedure lprop NOARGS; -Procedure usprop NOARGS; -Procedure uiprop NOARGS; -Procedure ulprop NOARGS; -int fprop ARGS((int bits_per_byte)); -int dprop ARGS((int bits_per_byte)); -int ldprop ARGS((int bits_per_byte)); -Procedure efprop ARGS((int fprec, int dprec, int lprec)); -Procedure edprop ARGS((int fprec, int dprec, int lprec)); -Procedure eldprop ARGS((int fprec, int dprec, int lprec)); - -int setmode ARGS((char *s)); -Procedure farewell ARGS((int bugs)); -Procedure describe ARGS((char *description, char *extra)); -Procedure missing ARGS((char *s)); -Procedure fmissing ARGS((char *s)); -Procedure check_defines NOARGS; -Procedure bitpattern ARGS((char *p, unsigned int size)); -int ceil_log ARGS((int base, Long_double x)); -Procedure croak ARGS((int place)); -Procedure eek_a_bug ARGS((char *problem)); -Procedure endian ARGS((int bits_per_byte)); -int exponent ARGS((Long_double x, double *fract, int *exp)); -int floor_log ARGS((int base, Long_double x)); -Procedure f_define ARGS((char *desc, char *extra, char *sort, char *name, - int prec, Long_double val, Long_double req, - char *mark)); -Procedure i_define ARGS((char *desc, char *extra, char *sort, char *name, - long val, long lim, long req, char *mark)); -Procedure u_define ARGS((char *desc, char *extra, char *sort, char *name, - unsigned long val, unsigned long req, char *mark)); - -#ifdef NO_SIG /* There's no signal(), or setjmp/longjmp() */ - - /* Dummy routines instead */ - - int setjmp ARGS((int lab)); - - int lab=1; - int setjmp(lab) int lab; { return(0); } - Procedure signal(i, p) int i, (*p)(); {} - -#else - jmp_buf lab; - Procedure overflow(sig) int sig; { /* what to do on over/underflow */ - signal(sig, overflow); - longjmp(lab, 1); - } - -#endif /*NO_SIG*/ - -int V= 0, /* verbose */ - L= 0, /* produce limits.h */ - F= 0, /* produce float.h */ - bugs=0; /* The number of (possible) bugs in the output */ - -char co[4], oc[4]; /* Comment starter and ender symbols */ - -int bits_per_byte; /* the number of bits per unit returned by sizeof() */ -int flt_rounds; /* The calculated value of FLT_ROUNDS */ -int flt_radix; /* The calculated value of FLT_RADIX */ - -#ifdef TEST -/* Set the fp modes on a SUN with 68881 chip, to check that different - rounding modes etc. get properly detected. - Compile with -f68881 for cc, -m68881 for gcc, and with additional flag - -DTEST. Run with additional parameter +hex-number, to set the 68881 mode - register to hex-number -*/ - -/* Bits 0x30 = rounding mode */ -#define ROUND_BITS 0x30 -#define TO_NEAREST 0x00 -#define TO_ZERO 0x10 -#define TO_MINUS_INF 0x20 -#define TO_PLUS_INF 0x30 /* The SUN FP user's guide seems to be wrong here */ - -/* Bits 0xc0 = extended rounding */ -#define EXT_BITS 0xc0 -#define ROUND_EXTENDED 0x00 -#define ROUND_SINGLE 0x40 -#define ROUND_DOUBLE 0x80 - -/* Enabled traps */ -#define EXE_INEX1 0x100 -#define EXE_INEX2 0x200 -#define EXE_DZ 0x400 -#define EXE_UNFL 0x800 -#define EXE_OVFL 0x1000 -#define EXE_OPERR 0x2000 -#define EXE_SNAN 0x4000 -#define EXE_BSUN 0x8000 - -/* Only used for testing, on a Sun with 68881 chip */ -/* Print the FP mode */ -printmode(new) unsigned new; { - fpmode_(&new); - printf("New fp mode:\n"); - printf(" Round toward "); - switch (new & ROUND_BITS) { - case TO_NEAREST: printf("nearest"); break; - case TO_ZERO: printf("zero"); break; - case TO_MINUS_INF: printf("minus infinity"); break; - case TO_PLUS_INF: printf("plus infinity"); break; - default: printf("???"); break; - } - - printf("\n Extended rounding precision: "); - - switch (new & EXT_BITS) { - case ROUND_EXTENDED: printf("extended"); break; - case ROUND_SINGLE: printf("single"); break; - case ROUND_DOUBLE: printf("double"); break; - default: printf("???"); break; - } - - printf("\n Enabled exceptions:"); - if (new & (unsigned) EXE_INEX1) printf(" inex1"); - if (new & (unsigned) EXE_INEX2) printf(" inex2"); - if (new & (unsigned) EXE_DZ) printf(" dz"); - if (new & (unsigned) EXE_UNFL) printf(" unfl"); - if (new & (unsigned) EXE_OVFL) printf(" ovfl"); - if (new & (unsigned) EXE_OPERR) printf(" operr"); - if (new & (unsigned) EXE_SNAN) printf(" snan"); - if (new & (unsigned) EXE_BSUN) printf(" bsun"); - printf("\n"); -} - -/* Only used for testing, on a Sun with 68881 chip */ -/* Set the FP mode */ -int setmode(s) char *s; { - unsigned mode=0, dig; - char c; - - while (*s) { - c= *s++; - if (c>='0' && c<='9') dig= c-'0'; - else if (c>='a' && c<='f') dig= c-'a'+10; - else if (c>='A' && c<='F') dig= c-'A'+10; - else return 1; - mode= mode<<4 | dig; - } - printmode(mode); - return 0; -} -#else -/* ARGSUSED */ -int setmode(s) char *s; { - fprintf(stderr, "Can't set mode: not compiled with TEST\n"); - return(1); -} -#endif - -Procedure farewell(bugs) int bugs; { - if (bugs == 0) exit(0); - printf("\n%sFor hints on dealing with the ", co); - if (bugs == 1) printf("problem"); - else printf("%d problems", bugs); - printf(" above\n see the section 'TROUBLESHOOTING' in the file "); - printf("%s%s\n", FILENAME, oc); - exit(bugs); -} - -/* The program has received a signal where it wasn't expecting one */ -Procedure croak(place) int place; { - printf("*** Unexpected signal at point %d\n", place); - farewell(bugs+1); /* An exit isn't essential here, but avoids loops */ -} - -/* This is here in case alloca.c is used, which calls this. */ -char *xmalloc(size) unsigned size; { - char *value = (char *)malloc(size); - if (value == 0) { - fprintf(stderr, "Virtual memory exceeded\n"); - exit(bugs+1); - } - return value; -} - -int maxint; - -int maximum_int() { - /* Find the maximum integer */ - Volatile int newi, int_max, two=2; - - /* Calculate maxint ***********************************/ - /* Calculate 2**n-1 until overflow - then use the previous value */ - - newi=1; int_max=0; - - if (setjmp(lab)==0) { /* Yields int_max */ - while(newi>int_max) { - int_max=newi; - newi=newi*two+1; - } - } - Unexpected(0); - return int_max; -} - -int main(argc, argv) int argc; char *argv[]; { - int dprec, fprec, lprec; - int i; char *s; int bad; - -#ifdef SIGFPE - signal(SIGFPE, overflow); -#endif -#ifdef SIGOVER - signal(SIGOVER, overflow); -#endif -/* Add more calls as necessary */ - - Unexpected(1); - - bad=0; - for (i=1; i < argc; i++) { - s= argv[i]; - if (*s == '-') { - s++; - while (*s) { - switch (*(s++)) { - case 'v': V=1; break; - case 'l': L=1; break; - case 'f': F=1; break; - default: bad=1; break; - } - } - } else if (*s == '+') { - s++; - bad= setmode(s); - } else bad= 1; - } - if (bad) { - fprintf(stderr, - "Usage: %s [-vlf]\n v=Verbose l=Limits.h f=Float.h\n", - argv[0]); - exit(1); - } - if (L || F) { - co[0]= '/'; oc[0]= ' '; - co[1]= '*'; oc[1]= '*'; - co[2]= ' '; oc[2]= '/'; - co[3]= '\0'; oc[3]= '\0'; - } else { - co[0]= '\0'; oc[0]= '\0'; - V=1; - } - - if (L) printf("%slimits.h%s\n", co, oc); - if (F) printf("%sfloat.h%s\n", co, oc); - if (F) { - printf ("#ifndef _FLOAT_H___\n"); - printf ("#define _FLOAT_H___\n"); - if (SYS_FLOAT_H_WRAP) - printf (" #include_next \n"); - } -#ifdef ID - printf("%sProduced on %s by enquire version %s, CWI, Amsterdam%s\n", - co, ID, VERSION, oc); -#else - printf("%sProduced by enquire version %s, CWI, Amsterdam%s\n", - co, VERSION, oc); -#endif - -#ifdef VERIFY - printf("%sVerification phase%s\n", co, oc); -#endif - -#ifdef NO_SIG - Vprintf("%sCompiled without signal(): %s%s\n", - co, - "there's nothing that can be done if overflow occurs", - oc); -#endif -#ifdef NO_SC - Vprintf("%sCompiled without signed char%s\n", co, oc); -#endif -#ifdef NO_UC - Vprintf("%Compiled without unsigned char%s\n", co, oc); -#endif -#ifdef NO_UI - Vprintf("%Compiled without unsigned short or long%s\n", co, oc); -#endif -#ifdef __STDC__ - Vprintf("%sCompiler claims to be ANSI C level %d%s\n", - co, __STDC__, oc); -#else - Vprintf("%sCompiler does not claim to be ANSI C%s\n", co, oc); -#endif - printf("\n"); - check_defines(); - - maxint= maximum_int(); - bits_per_byte= basic(); - Vprintf("\n"); - if (F||V) { - fprec= fprop(bits_per_byte); - dprec= dprop(bits_per_byte); - lprec= ldprop(bits_per_byte); - efprop(fprec, dprec, lprec); - edprop(fprec, dprec, lprec); - eldprop(fprec, dprec, lprec); - } -#ifndef NO_MEM - if (V) { - unsigned int size; - long total; - /* An extra goody: the approximate amount of data-space */ - /* Allocate store until no more available */ - /* Different implementations have a different argument type - to malloc. Here we assume that it's the same type as - that which sizeof() returns */ - size=1<<((bits_per_byte*sizeof(int))-2); - total=0; - while (size!=0) { - while ( malloc((false()?sizeof(int):size)) != - (char *)NULL - ) { - total+=(size/2); - } - size/=2; - } - - Vprintf("%sMemory allocable ~= %ld Kbytes%s\n", - co, (total+511)/512, oc); - } -#endif - if (F) { - printf ("#endif %s _FLOAT_H___%s\n", co, oc); - } - farewell(bugs); - return bugs; /* To keep compilers and lint happy */ -} - -Procedure eek_a_bug(problem) char *problem; { - /* The program has discovered a problem */ - printf("\n%s*** WARNING: %s%s\n", co, problem, oc); - bugs++; -} - -Procedure describe(description, extra) char *description, *extra; { - /* Produce the description for a #define */ - printf(" %s", co); - printf(description, extra); - printf("%s\n", oc); -} - -Procedure i_define(desc, extra, sort, name, val, lim, req, mark) - char *desc, *extra, *sort, *name; long val, lim, req; char *mark; { - if (SYS_FLOAT_H_WRAP && F && val == req) - return; - /* Produce a #define for a signed int type */ - describe(desc, extra); - printf("#undef %s%s\n", sort, name); - if (val >= 0) { - printf("#define %s%s %ld%s\n", sort, name, val, mark); - } else if (val + lim < 0) { - /* We may not produce a constant like -1024 if the max - allowable value is 1023. It has then to be output as - -1023-1. lim is the max allowable value. */ - printf("#define %s%s (%ld%s%ld%s)\n", - sort, name, -lim, mark, val+lim, mark); - } else { - printf("#define %s%s (%ld%s)\n", sort, name, val, mark); - } -#ifdef VERIFY - if (val != req) { - printf("%s*** Verify failed for above #define!\n", co); - printf(" Compiler has %ld for value%s\n\n", req, oc); - bugs++; - } -#endif - Vprintf("\n"); -} - -Procedure u_define(desc, extra, sort, name, val, req, mark) - char *desc, *extra, *sort, *name; unsigned long val, req; char *mark; { - /* Produce a #define for an unsigned value */ - describe(desc, extra); - printf("#undef %s%s\n", sort, name); - printf("#define %s%s %lu%s%s\n", sort, name, val, U, mark); -#ifdef VERIFY - if (val != req) { - printf("%s*** Verify failed for above #define!\n", co); - printf(" Compiler has %lu for value%s\n\n", req, oc); - bugs++; - } -#endif - Vprintf("\n"); -} - -Procedure f_define(desc, extra, sort, name, precision, val, req, mark) - char *desc, *extra, *sort, *name; int precision; - Long_double val, req; char *mark; { - if (SYS_FLOAT_H_WRAP && F && val == req) - return; - /* Produce a #define for a float/double/long double */ - describe(desc, extra); - printf ("#undef %s%s\n", sort, name); - if (stdc) { -#ifdef NO_LONG_DOUBLE_IO - static int union_defined = 0; - if (sizeof(double) != sizeof(Long_double) - && !strcmp(sort, "LDBL")) { - if (!union_defined) { - printf("#ifndef __LDBL_UNION__\n"); - printf("#define __LDBL_UNION__\n"); - printf("union __convert_long_double {\n"); - printf(" unsigned __convert_long_double_i[4];\n"); - printf(" long double __convert_long_double_d;\n"); - printf("};\n"); - printf("#endif\n"); - union_defined = 1; - } - printf("#define %s%s %s\n", - sort, name, fake_f_rep("long double", val)); - } else { - printf("#define %s%s %s%s\n", - sort, name, f_rep(precision, val), mark); - } -#else - printf("#define %s%s %s%s\n", - sort, name, f_rep(precision, val), mark); -#endif - } else if (*mark == 'F') { - /* non-ANSI C has no float constants, so cast the constant */ - printf("#define %s%s ((float)%s)\n", - sort, name, f_rep(precision, val)); - } else { - printf("#define %s%s %s\n", sort, name, f_rep(precision, val)); - } - Vprintf("\n"); -} - -int floor_log(base, x) int base; Long_double x; { - /* return floor(log base(x)) */ - int r=0; - while (x>=base) { r++; x/=base; } - return r; -} - -int ceil_log(base, x) int base; Long_double x; { - int r=0; - while (x>1.0) { r++; x/=base; } - return r; -} - -int exponent(x, fract, exp) Long_double x; double *fract; int *exp; { - /* Split x into a fraction and a power of ten; - returns 0 if x is unusable, 1 otherwise. - Only used for error messages about faulty output. - */ - int r=0, neg=0; - Long_double old; - *fract=0.0; *exp=0; - if (x<0.0) { - x= -x; - neg= 1; - } - if (x==0.0) return 1; - if (x>=10.0) { - while (x>=10.0) { - old=x; r++; x/=10.0; - if (old==x) return 0; - } - } else { - while (x<1.0) { - old=x; r--; x*=10.0; - if (old==x) return 0; - } - } - if (neg) *fract= (double) -x; - else *fract=(double) x; - *exp=r; - return 1; -} - -/* Print a value of type TYPE with value VAL, - assuming that sprintf can't handle this type properly (without truncation). - We create an expression that uses type casting to create the value from - a bit pattern. */ - -char *fake_f_rep(type, val) char *type; Long_double val; { - static char buf[1024]; - union { unsigned int i[4]; Long_double ld;} u; - u.i[0] = u.i[1] = u.i[2] = u.i[3] = 0; - u.ld = val; - sprintf(buf, "(__extension__ ((union __convert_long_double) {__convert_long_double_i: {0x%x, 0x%x, 0x%x, 0x%x}}).__convert_long_double_d)", - u.i[0], u.i[1], u.i[2], u.i[3]); - return buf; -} - -char *f_rep(precision, val) int precision; Long_double val; { - /* Return the floating representation of val */ - static char buf[1024]; -#ifdef NO_LONG_DOUBLE_IO - if (1) -#else - if (sizeof(double) == sizeof(Long_double)) -#endif - { - double d = val; - /* Assume they're the same, and use non-stdc format */ - /* This is for stdc compilers using non-stdc libraries */ - sprintf(buf, "%.*e", precision, d); - } else { - /* It had better support Le then */ - sprintf(buf, "%.*Le", precision, val); - } - return buf; -} - -Procedure bitpattern(p, size) char *p; unsigned int size; { - /* Printf the bit-pattern of p */ - char c; - unsigned int i; - int j; - - for (i=1; i<=size; i++) { - c= *p; - p++; - for (j=bits_per_byte-1; j>=0; j--) - printf("%c", (c>>j)&1 ? '1' : '0'); - if (i!=size) printf(" "); - } -} - -#define Order(x, px, mode)\ - printf("%s%s ", co, mode); for (i=0; i>(bits_per_byte*(sizeof(x)-i)))&mask);\ - putchar(c==0 ? '?' : (char)c); }\ - printf("%s\n", oc); - -Procedure endian(bits_per_byte) int bits_per_byte; { - /* Printf the byte-order used on this machine */ - /*unsigned*/ short s=0; - /*unsigned*/ int j=0; - /*unsigned*/ long l=0; - - char *ps= (char *) &s, - *pj= (char *) &j, - *pl= (char *) &l, - *ab= "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; - unsigned int mask, i, c; - - mask=0; - for (i=1; i<=(unsigned)bits_per_byte; i++) mask= (mask<<1)|1; - - if (V) { - printf("%sCHARACTER ORDER%s\n", co, oc); - Order(s, ps, "short:"); - Order(j, pj, "int: "); - Order(l, pl, "long: "); - } -} - -Procedure missing(s) char *s; { - printf("%s*** #define %s missing from limits.h%s\n", co, s, oc); - bugs++; -} - -Procedure fmissing(s) char *s; { - printf("%s*** #define %s missing from float.h%s\n", co, s, oc); - bugs++; -} - -/* To try and fool optimisers */ -int false() { return 0; } - -#define Promoted(x) (false()?(x):(-1)) -#define is_signed(x) (Promoted(x) < 0) -#define sign_of(x) ((x)?"signed":"unsigned") -#define Signed 1 -#define Unsigned 0 -#define sgn(x) ((is_signed(x))?Signed:Unsigned) - -#define showtype(t, x) Vprintf("%s%s %s %s%s\n", co, t, sign_of(is_signed(x)), type_of(sizeof(x)), oc) - -char *type_of(x) int x; { - if (x == sizeof(char)) { - if (sizeof(char) == sizeof(int)) return "char/short/int"; - if (sizeof(char) == sizeof(short)) return "char/short"; - return "char"; - } - if (x == sizeof(short)) { - if (sizeof(short) == sizeof(int)) return "short/int"; - return "short"; - } - if (x == sizeof(int)) { - if (sizeof(int) == sizeof(long)) return "int/long"; - return "int"; - } - if (x == sizeof(long)) return "long"; - return "unknown-type"; -} - -char *ftype_of(x) int x; { - if (x == sizeof(float)) { - return "float"; - } - if (x == sizeof(double)) { - if (sizeof(double) == sizeof(Long_double)) - return "(long)double"; - return "double"; - } - if (x == sizeof(Long_double)) { - return "long double"; - } - return "unknown-type"; -} - -Procedure typerr(name, esign, esize, sign, size) - char *name; int esign, esize, sign, size; -{ - Vprintf("*** %s has wrong type: expected %s %s, found %s %s\n", - name, sign_of(esign), type_of(esize), - sign_of(sign), type_of(size)); -} - -Procedure ftyperr(name, esize, size) char *name; int esize, size; { - Vprintf("*** %s has wrong type: expected %s, found %s\n", - name, ftype_of(esize), ftype_of(size)); -} - -int promotions() { - int si = 0; long sl = 0; - unsigned int ui; unsigned long ul; - short ss; unsigned short us; - - Vprintf("\n%sPROMOTIONS%s\n", co, oc); - - if ( - /* Possible warnings here; no problem */ - (sizeof(Promoted(si)) != sizeof(int)) || - (sizeof(Promoted(sl)) != sizeof(long)) || - (sizeof(Promoted(ss)) != sizeof(int)) || - (sizeof(Promoted(ui)) != sizeof(int)) || - (sizeof(Promoted(ul)) != sizeof(long)) || - (sizeof(Promoted(us)) != sizeof(int)) || - is_signed(ui) || is_signed(ul) || - !is_signed(si) || !is_signed(sl) - ) - { - eek_a_bug("promotions don't work properly in conditional expressions\n"); - } - - showtype("unsigned short promotes to", Promoted((unsigned short) 0)); - showtype("long+unsigned gives", sl+ui); - return 0; -} - -#define checktype(x, n, s, t) if((sgn(x)!=s)||(sizeof(x)!=sizeof(t))) typerr(n, s, sizeof(t), sign_of(x), sizeof(x)); - -#define fchecktype(x, n, t) if (sizeof(x) != sizeof(t)) ftyperr(n, sizeof(x), sizeof(t)); - -Procedure check_defines() { - /* ensure that all #defines are present and have the correct type */ -#ifdef VERIFY - int usign; - -#ifdef NO_UI - usign= Signed; -#else - /* Implementations promote unsigned short differently */ - usign= is_signed((unsigned short) 0); -#endif - - if (L) { -#ifdef CHAR_BIT - checktype(CHAR_BIT, "CHAR_BIT", Signed, int); -#else - missing("CHAR_BIT"); -#endif -#ifdef CHAR_MAX - checktype(CHAR_MAX, "CHAR_MAX", Signed, int); -#else - missing("CHAR_MAX"); -#endif -#ifdef CHAR_MIN - checktype(CHAR_MIN, "CHAR_MIN", Signed, int); -#else - missing("CHAR_MIN"); -#endif -#ifdef SCHAR_MAX - checktype(SCHAR_MAX, "SCHAR_MAX", Signed, int); -#else - missing("SCHAR_MAX"); -#endif -#ifdef SCHAR_MIN - checktype(SCHAR_MIN, "SCHAR_MIN", Signed, int); -#else - missing("SCHAR_MIN"); -#endif -#ifdef UCHAR_MAX - checktype(UCHAR_MAX, "UCHAR_MAX", Signed, int); -#else - missing("UCHAR_MAX"); -#endif -#ifdef SHRT_MAX - checktype(SHRT_MAX, "SHRT_MAX", Signed, int); -#else - missing("SHRT_MAX"); -#endif -#ifdef SHRT_MIN - checktype(SHRT_MIN, "SHRT_MIN", Signed, int); -#else - missing("SHRT_MIN"); -#endif -#ifdef INT_MAX - checktype(INT_MAX, "INT_MAX", Signed, int); -#else - missing("INT_MAX"); -#endif -#ifdef INT_MIN - checktype(INT_MIN, "INT_MIN", Signed, int); -#else - missing("INT_MIN"); -#endif -#ifdef LONG_MAX - checktype(LONG_MAX, "LONG_MAX", Signed, long); -#else - missing("LONG_MAX"); -#endif -#ifdef LONG_MIN - checktype(LONG_MIN, "LONG_MIN", Signed, long); -#else - missing("LONG_MIN"); -#endif -#ifdef USHRT_MAX - checktype(USHRT_MAX, "USHRT_MAX", usign, int); -#else - missing("USHRT_MAX"); -#endif -#ifdef UINT_MAX - checktype(UINT_MAX, "UINT_MAX", Unsigned, int); -#else - missing("UINT_MAX"); -#endif -#ifdef ULONG_MAX - checktype(ULONG_MAX, "ULONG_MAX", Unsigned, long); -#else - missing("ULONG_MAX"); -#endif - } /* if (L) */ - - if (F) { -#ifdef FLT_RADIX - checktype(FLT_RADIX, "FLT_RADIX", Signed, int); -#else - fmissing("FLT_RADIX"); -#endif -#ifdef FLT_MANT_DIG - checktype(FLT_MANT_DIG, "FLT_MANT_DIG", Signed, int); -#else - fmissing("FLT_MANT_DIG"); -#endif -#ifdef FLT_DIG - checktype(FLT_DIG, "FLT_DIG", Signed, int); -#else - fmissing("FLT_DIG"); -#endif -#ifdef FLT_ROUNDS - checktype(FLT_ROUNDS, "FLT_ROUNDS", Signed, int); -#else - fmissing("FLT_ROUNDS"); -#endif -#ifdef FLT_EPSILON - fchecktype(FLT_EPSILON, "FLT_EPSILON", float); -#else - fmissing("FLT_EPSILON"); -#endif -#ifdef FLT_MIN_EXP - checktype(FLT_MIN_EXP, "FLT_MIN_EXP", Signed, int); -#else - fmissing("FLT_MIN_EXP"); -#endif -#ifdef FLT_MIN - fchecktype(FLT_MIN, "FLT_MIN", float); -#else - fmissing("FLT_MIN"); -#endif -#ifdef FLT_MIN_10_EXP - checktype(FLT_MIN_10_EXP, "FLT_MIN_10_EXP", Signed, int); -#else - fmissing("FLT_MIN_10_EXP"); -#endif -#ifdef FLT_MAX_EXP - checktype(FLT_MAX_EXP, "FLT_MAX_EXP", Signed, int); -#else - fmissing("FLT_MAX_EXP"); -#endif -#ifdef FLT_MAX - fchecktype(FLT_MAX, "FLT_MAX", float); -#else - fmissing("FLT_MAX"); -#endif -#ifdef FLT_MAX_10_EXP - checktype(FLT_MAX_10_EXP, "FLT_MAX_10_EXP", Signed, int); -#else - fmissing("FLT_MAX_10_EXP"); -#endif -#ifdef DBL_MANT_DIG - checktype(DBL_MANT_DIG, "DBL_MANT_DIG", Signed, int); -#else - fmissing("DBL_MANT_DIG"); -#endif -#ifdef DBL_DIG - checktype(DBL_DIG, "DBL_DIG", Signed, int); -#else - fmissing("DBL_DIG"); -#endif -#ifdef DBL_EPSILON - fchecktype(DBL_EPSILON, "DBL_EPSILON", double); -#else - fmissing("DBL_EPSILON"); -#endif -#ifdef DBL_MIN_EXP - checktype(DBL_MIN_EXP, "DBL_MIN_EXP", Signed, int); -#else - fmissing("DBL_MIN_EXP"); -#endif -#ifdef DBL_MIN - fchecktype(DBL_MIN, "DBL_MIN", double); -#else - fmissing("DBL_MIN"); -#endif -#ifdef DBL_MIN_10_EXP - checktype(DBL_MIN_10_EXP, "DBL_MIN_10_EXP", Signed, int); -#else - fmissing("DBL_MIN_10_EXP"); -#endif -#ifdef DBL_MAX_EXP - checktype(DBL_MAX_EXP, "DBL_MAX_EXP", Signed, int); -#else - fmissing("DBL_MAX_EXP"); -#endif -#ifdef DBL_MAX - fchecktype(DBL_MAX, "DBL_MAX", double); -#else - fmissing("DBL_MAX"); -#endif -#ifdef DBL_MAX_10_EXP - checktype(DBL_MAX_10_EXP, "DBL_MAX_10_EXP", Signed, int); -#else - fmissing("DBL_MAX_10_EXP"); -#endif -#ifdef STDC -#ifdef LDBL_MANT_DIG - checktype(LDBL_MANT_DIG, "LDBL_MANT_DIG", Signed, int); -#else - fmissing("LDBL_MANT_DIG"); -#endif -#ifdef LDBL_DIG - checktype(LDBL_DIG, "LDBL_DIG", Signed, int); -#else - fmissing("LDBL_DIG"); -#endif -#ifdef LDBL_EPSILON - fchecktype(LDBL_EPSILON, "LDBL_EPSILON", long double); -#else - fmissing("LDBL_EPSILON"); -#endif -#ifdef LDBL_MIN_EXP - checktype(LDBL_MIN_EXP, "LDBL_MIN_EXP", Signed, int); -#else - fmissing("LDBL_MIN_EXP"); -#endif -#ifdef LDBL_MIN - fchecktype(LDBL_MIN, "LDBL_MIN", long double); -#else - fmissing("LDBL_MIN"); -#endif -#ifdef LDBL_MIN_10_EXP - checktype(LDBL_MIN_10_EXP, "LDBL_MIN_10_EXP", Signed, int); -#else - fmissing("LDBL_MIN_10_EXP"); -#endif -#ifdef LDBL_MAX_EXP - checktype(LDBL_MAX_EXP, "LDBL_MAX_EXP", Signed, int); -#else - fmissing("LDBL_MAX_EXP"); -#endif -#ifdef LDBL_MAX - fchecktype(LDBL_MAX, "LDBL_MAX", long double); -#else - fmissing("LDBL_MAX"); -#endif -#ifdef LDBL_MAX_10_EXP - checktype(LDBL_MAX_10_EXP, "LDBL_MAX_10_EXP", Signed, int); -#else - fmissing("LDBL_MAX_10_EXP"); -#endif -#endif /* STDC */ - } /* if (F) */ -#endif /* VERIFY */ -} - -#ifdef VERIFY -#ifndef SCHAR_MAX -#define SCHAR_MAX char_max -#endif -#ifndef SCHAR_MIN -#define SCHAR_MIN char_min -#endif -#ifndef UCHAR_MAX -#define UCHAR_MAX char_max -#endif -#endif /* VERIFY */ - -#ifndef CHAR_BIT -#define CHAR_BIT char_bit -#endif -#ifndef CHAR_MAX -#define CHAR_MAX char_max -#endif -#ifndef CHAR_MIN -#define CHAR_MIN char_min -#endif -#ifndef SCHAR_MAX -#define SCHAR_MAX char_max -#endif -#ifndef SCHAR_MIN -#define SCHAR_MIN char_min -#endif -#ifndef UCHAR_MAX -#define UCHAR_MAX char_max -#endif - -int cprop() { - /* Properties of type char */ - Volatile char c, char_max, char_min; - Volatile int bits_per_byte, c_signed; - long char_bit; - - Unexpected(2); - - /* Calculate number of bits per character *************************/ - c=1; bits_per_byte=0; - do { c=c<<1; bits_per_byte++; } while(c!=0); - c= (char)(-1); - if (((int)c)<0) c_signed=1; - else c_signed=0; - Vprintf("%schar = %d bits, %ssigned%s\n", - co, (int)sizeof(c)*bits_per_byte, (c_signed?"":"un"), oc); - char_bit=(long)(sizeof(c)*bits_per_byte); - if (L) i_define(D_CHAR_BIT, "", "CHAR", "_BIT", - char_bit, 0L, (long) CHAR_BIT, ""); - - c=0; char_max=0; - c++; - if (bits_per_byte <= 16) { - if (setjmp(lab)==0) { /* Yields char_max */ - while (c>char_max) { - char_max=c; - c++; - } - } else { - Vprintf("%sCharacter overflow generates a trap!%s\n", - co, oc); - } - c=0; char_min=0; - c--; - if (setjmp(lab)==0) { /* Yields char_min */ - while (c char_max) - char_max = ~0; - c = 0; - char_min = 0; - c--; - if (c < char_min) { - c = (1 << (bits_per_byte - 1)) - 1; - c = -c; - char_min = c; - c--; - if (c < char_min) - char_min = c; - } - } - if (c_signed && char_min == 0) { - Vprintf("%sBEWARE! Chars are pseudo-unsigned:%s\n", co, oc); - Vprintf("%s %s%s%s\n", - "They contain only nonnegative values, ", - "but sign extend when used as integers.", co, oc); - } - Unexpected(3); - - if (L) { - /* Because of the integer promotions, you must use a U after - the MAX_CHARS in the following cases */ - if ((sizeof(char) == sizeof(int)) && !c_signed) { - u_define(D_CHAR_MAX, "", "CHAR", "_MAX", - (long) char_max, - (long) CHAR_MAX, ""); - } else { - i_define(D_CHAR_MAX, "", "CHAR", "_MAX", - (long) char_max, 0L, - (long) CHAR_MAX, ""); - } - i_define(D_CHAR_MIN, "", "CHAR", "_MIN", - (long) char_min, (long) maxint, - (long) CHAR_MIN, ""); - if (c_signed) { - i_define(D_SCHAR_MAX, "", "SCHAR", "_MAX", - (long) char_max, 0L, - (long) SCHAR_MAX, ""); - i_define(D_SCHAR_MIN, "", "SCHAR", "_MIN", - (long) char_min, (long) maxint, - (long) SCHAR_MIN, ""); - } else { - if (sizeof(char) == sizeof(int)) { - u_define(D_UCHAR_MAX, "", "UCHAR", "_MAX", - (long) char_max, - (long) UCHAR_MAX, ""); - } else { - i_define(D_UCHAR_MAX, "", "UCHAR", "_MAX", - (long) char_max, 0L, - (long) UCHAR_MAX, ""); - } - } - - if (c_signed) { -#ifndef NO_UC - Volatile unsigned char c, char_max; - c=0; char_max=0; - c++; - if (setjmp(lab)==0) { /* Yields char_max */ - while (c>char_max) { - char_max=c; - c++; - } - } - Unexpected(4); - if (sizeof(char) == sizeof(int)) { - u_define(D_UCHAR_MAX, "", "UCHAR", "_MAX", - (long) char_max, - (long) UCHAR_MAX, ""); - } else { - i_define(D_UCHAR_MAX, "", "UCHAR", "_MAX", - (long) char_max, 0L, - (long) UCHAR_MAX, ""); - } -#endif - } else { -#ifndef NO_SC -/* Define NO_SC if this gives a syntax error */ Volatile signed char c, char_max, char_min; - c=0; char_max=0; - c++; - if (setjmp(lab)==0) { /* Yields char_max */ - while (c>char_max) { - char_max=c; - c++; - } - } - c=0; char_min=0; - c--; - if (setjmp(lab)==0) { /* Yields char_min */ - while (csizeof(int)?" BEWARE! larger than int!":"", - oc); - Vprintf("%sint* =%d bits%s%s\n", - co, (int)sizeof(int *)*bits_per_byte, - sizeof(int *)>sizeof(int)?" BEWARE! larger than int!":"", - oc); - Vprintf("%sfunc*=%d bits%s%s\n", - co, (int)sizeof(function *)*bits_per_byte, - sizeof(function *)>sizeof(int)?" BEWARE! larger than int!":"", - oc); -if (V) printf ("%s%s %s %s%s\n", co, "Type size_t is", - ((((false()?( sizeof(int)):(-1)) < 0) )? - "signed":"unsigned") , - type_of(sizeof( - sizeof(int)+0 - ) - ), - oc); - showtype("Type size_t is", sizeof(0)); - - /* Alignment constants ********************************************/ - -#define alignment(TYPE) \ - ((long)((char *)&((struct{char c; TYPE d;}*)0)->d - (char *) 0)) - - Vprintf("\n%sALIGNMENTS%s\n", co, oc); - - Vprintf("%schar=%ld short=%ld int=%ld long=%ld%s\n", - co, - alignment(char), alignment(short), - alignment(int), alignment(long), - oc); - - Vprintf("%sfloat=%ld double=%ld%s\n", - co, - alignment(float), alignment(double), - oc); - - if (stdc) { - Vprintf("%slong double=%ld%s\n", - co, - alignment(Long_double), - oc); - } - Vprintf("%schar*=%ld int*=%ld func*=%ld%s\n", - co, - alignment(char *), alignment(int *), alignment(function *), - oc); - - Vprintf("\n"); - - /* Ten little endians *********************************************/ - - endian(bits_per_byte); - - /* Pointers *******************************************************/ - - Vprintf("\n%sPROPERTIES OF POINTERS%s\n", co, oc); - - if ((long) (char *) &variable == (long) (int *) &variable) { - Vprintf("%sChar and int pointer formats seem identical%s\n", - co, oc); - } else { - Vprintf("%sChar and int pointer formats are different%s\n", - co, oc); - } - if ((long) (char *) &variable == (long) (function *) &variable) { - Vprintf("%sChar and function pointer formats seem identical%s\n", - co, oc); - } else { - Vprintf("%sChar and function pointer formats are different%s\n", - co, oc); - } - - if (V) { - if ("abcd"=="abcd") - printf("%sStrings are shared%s\n", co, oc); - else printf("%sStrings are not shared%s\n", co, oc); - } - - p=0; q=0; - showtype("Type ptrdiff_t is", p-q); - - Vprintf("\n%sPROPERTIES OF INTEGRAL TYPES%s\n", co, oc); - - sprop(); - iprop(); - lprop(); - usprop(); - uiprop(); - ulprop(); - - promotions(); - - Unexpected(6); - - return bits_per_byte; -} - -#else /* not PASS0 */ - -#ifdef SEP -extern jmp_buf lab; -extern int V, L, F, bugs, bits_per_byte; -extern char co[], oc[]; -extern char *f_rep(); -#endif /* SEP */ -#endif /* ifdef PASS0 */ - -/* As I said, I apologise for the contortions below. The functions are - expanded by the preprocessor twice or three times (for float and double, - and maybe for long double, and for short, int and long). That way, - I never make a change to one that I forget to make to the other. - You can look on it as C's fault for not supporting multi-line macro's. - This whole file is read 3 times by the preprocessor, with PASSn set for - n=1, 2 or 3, to decide which parts to reprocess. -*/ - -/* #undef on an already undefined thing is (wrongly) flagged as an error - by some compilers, therefore the #ifdef that follows: -*/ -#ifdef Number -#undef Number -#undef THING -#undef Thing -#undef thing -#undef FPROP -#undef Fname -#undef Store -#undef Sum -#undef Diff -#undef Mul -#undef Div -#undef ZERO -#undef HALF -#undef ONE -#undef TWO -#undef THREE -#undef FOUR -#undef Self -#undef F_check -#undef Validate -#undef EPROP -#undef MARK - -/* These are the float.h constants */ -#undef F_RADIX -#undef F_MANT_DIG -#undef F_DIG -#undef F_ROUNDS -#undef F_EPSILON -#undef F_MIN_EXP -#undef F_MIN -#undef F_MIN_10_EXP -#undef F_MAX_EXP -#undef F_MAX -#undef F_MAX_10_EXP -#endif - -#ifdef Integer -#undef Integer -#undef INT -#undef IPROP -#undef Iname -#undef UPROP -#undef Uname -#undef OK_UI -#undef IMARK - -#undef I_MAX -#undef I_MIN -#undef U_MAX -#endif - -#ifdef PASS1 - -/* Define the things we're going to use this pass */ - -#define Number float -#define THING "FLOAT" -#define Thing "Float" -#define thing "float" -#define Fname "FLT" -#define FPROP fprop -#define Store fStore -#define Sum fSum -#define Diff fDiff -#define Mul fMul -#define Div fDiv -#define ZERO 0.0 -#define HALF 0.5 -#define ONE 1.0 -#define TWO 2.0 -#define THREE 3.0 -#define FOUR 4.0 -#define Self fSelf -#define F_check fCheck -#define MARK "F" -#ifdef VERIFY -#define Validate(prec, val, req, same) fValidate(prec, val, req, same) -#endif - -#define EPROP efprop - -#define Integer short -#define INT "short" -#define IPROP sprop -#define Iname "SHRT" -#ifndef NO_UI -#define OK_UI 1 -#endif -#define IMARK "" - -#define UPROP usprop -#define Uname "USHRT" - -#ifdef SHRT_MAX -#define I_MAX SHRT_MAX -#endif -#ifdef SHRT_MIN -#define I_MIN SHRT_MIN -#endif -#ifdef USHRT_MAX -#define U_MAX USHRT_MAX -#endif - -#ifdef FLT_RADIX -#define F_RADIX FLT_RADIX -#endif -#ifdef FLT_MANT_DIG -#define F_MANT_DIG FLT_MANT_DIG -#endif -#ifdef FLT_DIG -#define F_DIG FLT_DIG -#endif -#ifdef FLT_ROUNDS -#define F_ROUNDS FLT_ROUNDS -#endif -#ifdef FLT_EPSILON -#define F_EPSILON FLT_EPSILON -#endif -#ifdef FLT_MIN_EXP -#define F_MIN_EXP FLT_MIN_EXP -#endif -#ifdef FLT_MIN -#define F_MIN FLT_MIN -#endif -#ifdef FLT_MIN_10_EXP -#define F_MIN_10_EXP FLT_MIN_10_EXP -#endif -#ifdef FLT_MAX_EXP -#define F_MAX_EXP FLT_MAX_EXP -#endif -#ifdef FLT_MAX -#define F_MAX FLT_MAX -#endif -#ifdef FLT_MAX_10_EXP -#define F_MAX_10_EXP FLT_MAX_10_EXP -#endif - -#endif /* PASS1 */ - -#ifdef PASS2 - -#define Number double -#define THING "DOUBLE" -#define Thing "Double" -#define thing "double" -#define Fname "DBL" -#define FPROP dprop -#define Store dStore -#define Sum dSum -#define Diff dDiff -#define Mul dMul -#define Div dDiv -#define ZERO 0.0 -#define HALF 0.5 -#define ONE 1.0 -#define TWO 2.0 -#define THREE 3.0 -#define FOUR 4.0 -#define Self dSelf -#define F_check dCheck -#define MARK "" -#ifdef VERIFY -#define Validate(prec, val, req, same) dValidate(prec, val, req, same) -#endif - -#define EPROP edprop - -#define Integer int -#define INT "int" -#define IPROP iprop -#define Iname "INT" -#define OK_UI 1 /* Unsigned int is always possible */ -#define IMARK "" - -#define UPROP uiprop -#define Uname "UINT" - -#ifdef INT_MAX -#define I_MAX INT_MAX -#endif -#ifdef INT_MIN -#define I_MIN INT_MIN -#endif -#ifdef UINT_MAX -#define U_MAX UINT_MAX -#endif - -#ifdef DBL_MANT_DIG -#define F_MANT_DIG DBL_MANT_DIG -#endif -#ifdef DBL_DIG -#define F_DIG DBL_DIG -#endif -#ifdef DBL_EPSILON -#define F_EPSILON DBL_EPSILON -#endif -#ifdef DBL_MIN_EXP -#define F_MIN_EXP DBL_MIN_EXP -#endif -#ifdef DBL_MIN -#define F_MIN DBL_MIN -#endif -#ifdef DBL_MIN_10_EXP -#define F_MIN_10_EXP DBL_MIN_10_EXP -#endif -#ifdef DBL_MAX_EXP -#define F_MAX_EXP DBL_MAX_EXP -#endif -#ifdef DBL_MAX -#define F_MAX DBL_MAX -#endif -#ifdef DBL_MAX_10_EXP -#define F_MAX_10_EXP DBL_MAX_10_EXP -#endif - -#endif /* PASS2 */ - -#ifdef PASS3 - -#ifdef STDC -#define Number long double - -#define ZERO 0.0L -#define HALF 0.5L -#define ONE 1.0L -#define TWO 2.0L -#define THREE 3.0L -#define FOUR 4.0L -#endif - -#define THING "LONG DOUBLE" -#define Thing "Long double" -#define thing "long double" -#define Fname "LDBL" -#define FPROP ldprop -#define Store ldStore -#define Sum ldSum -#define Diff ldDiff -#define Mul ldMul -#define Div ldDiv -#define Self ldSelf -#define F_check ldCheck -#define MARK "L" -#ifdef VERIFY -#define Validate(prec, val, req, same) ldValidate(prec, val, req, same) -#endif - -#define EPROP eldprop - -#define Integer long -#define INT "long" -#define IPROP lprop -#define Iname "LONG" -#ifndef NO_UI -#define OK_UI 1 -#endif -#define IMARK "L" - -#define UPROP ulprop -#define Uname "ULONG" - -#ifdef LONG_MAX -#define I_MAX LONG_MAX -#endif -#ifdef LONG_MIN -#define I_MIN LONG_MIN -#endif -#ifdef ULONG_MAX -#define U_MAX ULONG_MAX -#endif - -#ifdef LDBL_MANT_DIG -#define F_MANT_DIG LDBL_MANT_DIG -#endif -#ifdef LDBL_DIG -#define F_DIG LDBL_DIG -#endif -#ifdef LDBL_EPSILON -#define F_EPSILON LDBL_EPSILON -#endif -#ifdef LDBL_MIN_EXP -#define F_MIN_EXP LDBL_MIN_EXP -#endif -#ifdef LDBL_MIN -#define F_MIN LDBL_MIN -#endif -#ifdef LDBL_MIN_10_EXP -#define F_MIN_10_EXP LDBL_MIN_10_EXP -#endif -#ifdef LDBL_MAX_EXP -#define F_MAX_EXP LDBL_MAX_EXP -#endif -#ifdef LDBL_MAX -#define F_MAX LDBL_MAX -#endif -#ifdef LDBL_MAX_10_EXP -#define F_MAX_10_EXP LDBL_MAX_10_EXP -#endif - -#endif /* PASS3 */ - -#define UNDEFINED (-2) - -#ifndef I_MAX -#define I_MAX ((unsigned long) UNDEFINED) -#endif -#ifndef I_MIN -#define I_MIN ((unsigned long) UNDEFINED) -#endif -#ifndef U_MAX -#define U_MAX ((unsigned long) UNDEFINED) -#endif - -#ifndef F_RADIX -#define F_RADIX UNDEFINED -#endif -#ifndef F_MANT_DIG -#define F_MANT_DIG UNDEFINED -#endif -#ifndef F_DIG -#define F_DIG UNDEFINED -#endif -#ifndef F_ROUNDS -#define F_ROUNDS UNDEFINED -#endif -#ifndef F_EPSILON -#define F_EPSILON ((Number) UNDEFINED) -#endif -#ifndef F_MIN_EXP -#define F_MIN_EXP UNDEFINED -#endif -#ifndef F_MIN -#define F_MIN ((Number) UNDEFINED) -#endif -#ifndef F_MIN_10_EXP -#define F_MIN_10_EXP UNDEFINED -#endif -#ifndef F_MAX_EXP -#define F_MAX_EXP UNDEFINED -#endif -#ifndef F_MAX -#define F_MAX ((Number) UNDEFINED) -#endif -#ifndef F_MAX_10_EXP -#define F_MAX_10_EXP UNDEFINED -#endif - -#ifndef VERIFY -#define Validate(prec, val, req, same) {;} -#endif - -#ifdef Integer - -Procedure IPROP() { - /* the properties of short, int, and long */ - Volatile Integer newi, int_max, maxeri, int_min, minneri; - Volatile int ibits, ipower, two=2; - - /* Calculate max short/int/long ***********************************/ - /* Calculate 2**n-1 until overflow - then use the previous value */ - - newi=1; int_max=0; - - if (setjmp(lab)==0) { /* Yields int_max */ - for(ipower=0; newi>int_max; ipower++) { - int_max=newi; - newi=newi*two+1; - } - Vprintf("%sOverflow of a%s %s does not generate a trap%s\n", - co, INT[0]=='i'?"n":"", INT, oc); - } else { - Vprintf("%sOverflow of a%s %s generates a trap%s\n", - co, INT[0]=='i'?"n":"", INT, oc); - } - Unexpected(7); - - /* Minimum value: assume either two's or one's complement *********/ - int_min= -int_max; - if (setjmp(lab)==0) { /* Yields int_min */ - if (int_min-1 < int_min) int_min--; - } - Unexpected(8); - - /* Now for those daft Cybers */ - - maxeri=0; newi=int_max; - - if (setjmp(lab)==0) { /* Yields maxeri */ - for(ibits=ipower; newi>maxeri; ibits++) { - maxeri=newi; - newi=newi+newi+1; - } - } - Unexpected(9); - - minneri= -maxeri; - if (setjmp(lab)==0) { /* Yields minneri */ - if (minneri-1 < minneri) minneri--; - } - Unexpected(10); - - Vprintf("%sMaximum %s = %ld (= 2**%d-1)%s\n", - co, INT, (long)int_max, ipower, oc); - Vprintf("%sMinimum %s = %ld%s\n", co, INT, (long)int_min, oc); - - if (L) i_define(D_INT_MAX, INT, Iname, "_MAX", - (long) int_max, 0L, - (long) I_MAX, IMARK); - if (L) i_define(D_INT_MIN, INT, Iname, "_MIN", - (long) int_min, (long) (PASS==1?maxint:int_max), - (long) I_MIN, IMARK); - - if(int_max < 0) { /* It has happened */ - eek_a_bug("signed integral comparison faulty?"); - } - - if (maxeri>int_max) { - Vprintf("%sThere is a larger %s, %ld (= 2**%d-1), %s %s%s\n", - co, INT, (long)maxeri, ibits, - "but only for addition, not multiplication", - "(I smell a Cyber!)", - oc); - } - - if (minneriu_max) { - u_max=newi; - newi=newi*two+1; - } - } - Unexpected(11); - Vprintf("%sMaximum unsigned %s = %lu%s\n", - co, INT, (unsigned long) u_max, oc); - - /* Oh woe: new standard C defines value preserving promotions */ - if (L) { - if (PASS == 1 && sizeof(short) < sizeof(int)) { - /* Special only for short */ - i_define(D_UINT_MAX, INT, Uname, "_MAX", - (unsigned long) u_max, 0L, - (unsigned long) U_MAX, IMARK); - } else { - u_define(D_UINT_MAX, INT, Uname, "_MAX", - (unsigned long) u_max, - (unsigned long) U_MAX, IMARK); - } - } -#endif -} - -#endif /* Integer */ - -#ifdef Number - -/* The following routines are intended to defeat any attempt at optimisation - or use of extended precision, and to defeat faulty narrowing casts. - The weird prototypes are because of widening incompatibilities. -*/ -#ifdef STDC -#define ARGS1(atype, a) (atype a) -#define ARGS2(atype, a, btype, b) (atype a, btype b) -#else -#define ARGS1(atype, a) (a) atype a; -#define ARGS2(atype, a, btype, b) (a, b) atype a; btype b; -#endif - -Procedure Store ARGS2(Number, a, Number *, b) { *b=a; } -Number Sum ARGS2(Number, a, Number, b) {Number r; Store(a+b, &r); return (r); } -Number Diff ARGS2(Number, a, Number, b){Number r; Store(a-b, &r); return (r); } -Number Mul ARGS2(Number, a, Number, b) {Number r; Store(a*b, &r); return (r); } -Number Div ARGS2(Number, a, Number, b) {Number r; Store(a/b, &r); return (r); } -Number Self ARGS1(Number, a) {Number r; Store(a, &r); return (r); } - -Procedure F_check ARGS((int precision, Long_double val1)); - -Procedure F_check(precision, val1) int precision; Long_double val1; { - /* You don't think I'm going to go to all the trouble of writing - a program that works out what all sorts of values are, only to - have printf go and print the wrong values out, do you? - No, you're right, so this function tries to see if printf - has written the right value, by reading it back again. - This introduces a new problem of course: suppose printf writes - the correct value, and scanf reads it back wrong... oh well. - But I'm adamant about this: the precision given is enough - to uniquely identify the printed number, therefore I insist - that sscanf read the number back identically. Harsh yes, but - sometimes you've got to be cruel to be kind. - */ - Number val, new, diff; - double rem; - int e; - char *rep; - char *f2; - -#ifdef NO_LONG_DOUBLE_IO - double new1; - /* On the Sun 3, sscanf clobbers 4 words, - which leads to a crash when this function tries to return. */ - f2= "%le"; /* Input */ - /* It is no use checking long doubles if we can't - read and write them. */ - if (sizeof (Number) > sizeof(double)) - return; -#else - Long_double new1; - if (sizeof(double) == sizeof(Long_double)) { - /* Assume they're the same, and use non-stdc format */ - /* This is for stdc compilers using non-stdc libraries */ - f2= "%le"; /* Input */ - } else { - /* It had better support Le then */ - f2= "%Le"; - } -#endif - val= val1; - rep= f_rep(precision, (Long_double) val); - if (setjmp(lab)==0) { - sscanf(rep, f2, &new1); - } else { - eek_a_bug("sscanf caused a trap"); - printf("%s scanning: %s format: %s%s\n\n", co, rep, f2, oc); - Unexpected(12); - return; - } - - if (setjmp(lab)==0) { /* See if new is usable */ - new= new1; - if (new != 0.0) { - diff= val/new - 1.0; - if (diff < 0.1) diff= 1.0; - /* That should be enough to generate a trap */ - } - } else { - eek_a_bug("sscanf returned an unusable number"); - printf("%s scanning: %s with format: %s%s\n\n", - co, rep, f2, oc); - Unexpected(13); - return; - } - - Unexpected(14); - if (new != val) { - eek_a_bug("Possibly bad output from printf above"); - if (!exponent((Long_double)val, &rem, &e)) { - printf("%s but value was an unusable number%s\n\n", - co, oc); - return; - } - printf("%s expected value around %.*fe%d, bit pattern:\n ", - co, precision, rem, e); - bitpattern((char *) &val, (unsigned)sizeof(val)); - printf ("%s\n", oc); - printf("%s sscanf gave %s, bit pattern:\n ", - co, f_rep(precision, (Long_double) new)); - bitpattern((char *) &new, (unsigned)sizeof(new)); - printf ("%s\n", oc); - if (setjmp(lab) == 0) { - diff= val-new; - printf("%s difference= %s%s\n\n", - co, f_rep(precision, (Long_double) diff), oc); - } /* else forget it */ - Unexpected(15); - } -} - -#ifdef VERIFY -Procedure Validate(prec, val, req, same) int prec, same; Long_double val, req; { - /* Check that the compiler has read a #define value correctly */ - Unexpected(16); - if (!same) { - printf("%s*** Verify failed for above #define!\n", co); - if (setjmp(lab) == 0) { /* for the case that req == nan */ - printf(" Compiler has %s for value%s\n", - f_rep(prec, req), oc); - } else { - printf(" Compiler has %s for value%s\n", - "an unusable number", oc); - } - if (setjmp(lab) == 0) { - F_check(prec, (Long_double) req); - } /*else forget it*/ - if (setjmp(lab) == 0) { - if (req > 0.0 && val > 0.0) { - printf("%s difference= %s%s\n", - co, f_rep(prec, val-req), oc); - } - } /*else forget it*/ - Unexpected(17); - printf("\n"); - bugs++; - } else if (val != req) { - if (stdc) eek_a_bug("constant has the wrong precision"); - else eek_a_bug("the cast didn't work"); - printf("\n"); - } -} -#endif /* VERIFY */ - -int FPROP(bits_per_byte) int bits_per_byte; { - /* Properties of floating types, using algorithms by Cody and Waite - from MA Malcolm, as modified by WM Gentleman and SB Marovich. - Further extended by S Pemberton. - - Returns the number of digits in the fraction. - */ - - Volatile int - i, f_radix, iexp, irnd, mrnd, f_rounds, f_mant_dig, - iz, k, inf, machep, f_max_exp, f_min_exp, mx, negeps, - mantbits, digs, f_dig, trap, - hidden, normal, f_min_10_exp, f_max_10_exp; - Volatile Number - a, b, base, basein, basem1, f_epsilon, epsneg, - eps, epsp1, etop, ebot, - f_max, newxmax, f_min, xminner, y, y1, z, z1, z2; - - Unexpected(18); - - Vprintf("%sPROPERTIES OF %s%s\n", co, THING, oc); - - /* Base and size of significand **************************************/ - /* First repeatedly double until adding 1 has no effect. */ - /* For instance, if base is 10, with 3 significant digits */ - /* it will try 1, 2, 4, 8, ... 512, 1024, and stop there, */ - /* since 1024 is only representable as 1020. */ - a=1.0; - if (setjmp(lab)==0) { /* inexact trap? */ - do { a=Sum(a, a); } - while (Diff(Diff(Sum(a, ONE), a), ONE) == ZERO); - } else { - fprintf(stderr, "*** Program got loss-of-precision trap!\n"); - /* And supporting those is just TOO much trouble! */ - farewell(bugs+1); - } - Unexpected(19); - /* Now double until you find a number that can be added to the */ - /* above number. For 1020 this is 8 or 16, depending whether the */ - /* result is rounded or truncated. */ - /* In either case the result is 1030. 1030-1020= the base, 10. */ - b=1.0; - do { b=Sum(b, b); } while ((base=Diff(Sum(a, b), a)) == ZERO); - f_radix=base; - Vprintf("%sBase = %d%s\n", co, f_radix, oc); - - /* Sanity check; if base<2, I can't guarantee the rest will work */ - if (f_radix < 2) { - eek_a_bug("Function return or parameter passing faulty? (This is a guess.)"); - printf("\n"); - return(0); - } - - if (PASS == 1) { /* only for FLT */ - flt_radix= f_radix; - if (F) i_define(D_FLT_RADIX, "", "FLT", "_RADIX", - (long) f_radix, 0L, (long) F_RADIX, ""); - } else if (f_radix != flt_radix) { - printf("\n%s*** WARNING: %s %s (%d) %s%s\n", - co, thing, "arithmetic has a different radix", - f_radix, "from float", oc); - bugs++; - } - - /* Now the number of digits precision */ - f_mant_dig=0; b=1.0; - do { f_mant_dig++; b=Mul(b, base); } - while (Diff(Diff(Sum(b, ONE), b), ONE) == ZERO); - f_dig=floor_log(10, (Long_double)(b/base)) + (base==10?1:0); - Vprintf("%sSignificant base digits = %d %s %d %s%s\n", - co, f_mant_dig, "(= at least", f_dig, "decimal digits)", oc); - if (F) i_define(D_MANT_DIG, thing, Fname, "_MANT_DIG", - (long) f_mant_dig, 0L, (long) F_MANT_DIG, ""); - if (F) i_define(D_DIG, thing, Fname, "_DIG", - (long) f_dig, 0L, (long) F_DIG, ""); - digs= ceil_log(10, (Long_double)b); /* the number of digits to printf */ - - /* Rounding *******************************************************/ - basem1=Diff(base, HALF); - if (Diff(Sum(a, basem1), a) != ZERO) { - if (f_radix == 2) basem1=0.375; - else basem1=1.0; - if (Diff(Sum(a, basem1), a) != ZERO) irnd=2; /* away from 0 */ - else irnd=1; /* to nearest */ - } else irnd=0; /* towards 0 */ - - basem1=Diff(base, HALF); - - if (Diff(Diff(-a, basem1), -a) != ZERO) { - if (f_radix == 2) basem1=0.375; - else basem1=1.0; - if (Diff(Diff(-a, basem1), -a) != ZERO) mrnd=2; /* away from 0*/ - else mrnd=1; /* to nearest */ - } else mrnd=0; /* towards 0 */ - - f_rounds= -1; /* Unknown rounding */ - if (irnd==0 && mrnd==0) f_rounds=0; /* zero = chops */ - if (irnd==1 && mrnd==1) f_rounds=1; /* nearest */ - if (irnd==2 && mrnd==0) f_rounds=2; /* +inf */ - if (irnd==0 && mrnd==2) f_rounds=3; /* -inf */ - - if (f_rounds != -1) { - Vprintf("%sArithmetic rounds towards ", co); - switch (f_rounds) { - case 0: Vprintf("zero (i.e. it chops)"); break; - case 1: Vprintf("nearest"); break; - case 2: Vprintf("+infinity"); break; - case 3: Vprintf("-infinity"); break; - default: Vprintf("???"); break; - } - Vprintf("%s\n", oc); - } else { /* Hmm, try to give some help here */ - Vprintf("%sArithmetic rounds oddly: %s\n", co, oc); - Vprintf("%s Negative numbers %s%s\n", - co, mrnd==0 ? "towards zero" : - mrnd==1 ? "to nearest" : - "away from zero", - oc); - Vprintf("%s Positive numbers %s%s\n", - co, irnd==0 ? "towards zero" : - irnd==1 ? "to nearest" : - "away from zero", - oc); - } - /* An extra goody */ - if (f_radix == 2 && f_rounds == 1) { - if (Diff(Sum(a, ONE), a) != ZERO) { - Vprintf("%s Tie breaking rounds up%s\n", co, oc); - } else if (Diff(Sum(a, THREE), a) == FOUR) { - Vprintf("%s Tie breaking rounds to even%s\n", co, oc); - } else { - Vprintf("%s Tie breaking rounds down%s\n", co, oc); - } - } - if (PASS == 1) { /* only for FLT */ - flt_rounds= f_rounds; - /* Prefer system float.h definition of F_ROUNDS, - since it's more likely to be right than our "1". */ - if (F && (!SYS_FLOAT_H_WRAP || F_ROUNDS == UNDEFINED)) - i_define(D_FLT_ROUNDS, "", "FLT", "_ROUNDS", - (long) f_rounds, 1L, (long) F_ROUNDS, ""); - } else if (f_rounds != flt_rounds) { - printf("\n%s*** WARNING: %s %s (%d) %s%s\n", - co, thing, "arithmetic rounds differently", - f_rounds, "from float", oc); - bugs++; - } - - /* Various flavours of epsilon ************************************/ - negeps=f_mant_dig+f_mant_dig; - basein=1.0/base; - a=1.0; - for(i=1; i<=negeps; i++) a*=basein; - - b=a; - while (Diff(Diff(ONE, a), ONE) == ZERO) { - a*=base; - negeps--; - } - negeps= -negeps; - Vprintf("%sSmallest x such that 1.0-base**x != 1.0 = %d%s\n", - co, negeps, oc); - - etop = ONE; - ebot = ZERO; - eps = Sum(ebot, Div(Diff(etop, ebot), TWO)); - /* find the smallest epsneg (1-epsneg != 1) by binary search. - ebot and etop are the current bounds */ - while (eps != ebot && eps != etop) { - epsp1 = Diff(ONE, eps); - if (epsp1 < ONE) etop = eps; - else ebot = eps; - eps = Sum(ebot, Div(Diff(etop, ebot), TWO)); - } - eps= etop; - /* Sanity check */ - if (Diff(ONE, etop) >= ONE || Diff(ONE, ebot) != ONE) { - eek_a_bug("internal error calculating epsneg"); - } - Vprintf("%sSmallest x such that 1.0-x != 1.0 = %s%s\n", - co, f_rep(digs, (Long_double) eps), oc); - if (V) F_check(digs, (Long_double) eps); - - epsneg=a; - if ((f_radix!=2) && irnd) { - /* a=(a*(1.0+a))/(1.0+1.0); => */ - a=Div(Mul(a, Sum(ONE, a)), Sum(ONE, ONE)); - /* if ((1.0-a)-1.0 != 0.0) epsneg=a; => */ - if (Diff(Diff(ONE, a), ONE) != ZERO) epsneg=a; - } - /* epsneg is used later */ - Unexpected(20); - - machep= -f_mant_dig-f_mant_dig; - a=b; - while (Diff(Sum(ONE, a), ONE) == ZERO) { a*=base; machep++; } - Vprintf("%sSmallest x such that 1.0+base**x != 1.0 = %d%s\n", - co, machep, oc); - - etop = ONE; - ebot = ZERO; - eps = Sum(ebot, Div(Diff(etop, ebot), TWO)); - /* find the smallest eps (1+eps != 1) by binary search. - ebot and etop are the current bounds */ - while (eps != ebot && eps != etop) { - epsp1 = Sum(ONE, eps); - if (epsp1 > ONE) etop = eps; - else ebot = eps; - eps = Sum(ebot, Div(Diff(etop, ebot), TWO)); - } - /* Sanity check */ - if (Sum(ONE, etop) <= ONE || Sum(ONE, ebot) != ONE) { - eek_a_bug("internal error calculating eps"); - } - f_epsilon=etop; - - Vprintf("%sSmallest x such that 1.0+x != 1.0 = %s%s\n", - co, f_rep(digs, (Long_double) f_epsilon), oc); - - f_epsilon= Diff(Sum(ONE, f_epsilon), ONE); /* New C standard defn */ - Vprintf("%s(Above number + 1.0) - 1.0 = %s%s\n", - co, f_rep(digs, (Long_double) (f_epsilon)), oc); - - /* Possible loss of precision warnings here from non-stdc compilers */ - if (F) f_define(D_EPSILON, thing, - Fname, "_EPSILON", digs, - (Long_double) f_epsilon, - (Long_double) F_EPSILON, MARK); - if (V || F) F_check(digs, (Long_double) f_epsilon); - Unexpected(21); - if (F) Validate(digs, (Long_double) f_epsilon, (Long_double) F_EPSILON, - f_epsilon == Self(F_EPSILON)); - Unexpected(22); - - /* Extra chop info *************************************************/ - if (f_rounds == 0) { - if (Diff(Mul(Sum(ONE,f_epsilon),ONE),ONE) != ZERO) { - Vprintf("%sAlthough arithmetic chops, it uses guard digits%s\n", co, oc); - } - } - - /* Size of and minimum normalised exponent ************************/ - y=0; i=0; k=1; z=basein; z1=(1.0+f_epsilon)/base; - - /* Coarse search for the largest power of two */ - if (setjmp(lab)==0) { /* for underflow trap */ /* Yields i, k, y, y1 */ - do { - y=z; y1=z1; - z=Mul(y,y); z1=Mul(z1, y); - a=Mul(z,ONE); - z2=Div(z1,y); - if (z2 != y1) break; - if ((Sum(a,a) == ZERO) || (fabs(z) >= y)) break; - i++; - k+=k; - } while(1); - } else { - Vprintf("%s%s underflow generates a trap%s\n", co, Thing, oc); - } - Unexpected(23); - - if (f_radix != 10) { - iexp=i+1; /* for the sign */ - mx=k+k; - } else { - iexp=2; - iz=f_radix; - while (k >= iz) { iz*=f_radix; iexp++; } - mx=iz+iz-1; - } - - /* Fine tune starting with y and y1 */ - if (setjmp(lab)==0) { /* for underflow trap */ /* Yields k, f_min */ - do { - f_min=y; z1=y1; - y=Div(y,base); y1=Div(y1,base); - a=Mul(y,ONE); - z2=Mul(y1,base); - if (z2 != z1) break; - if ((Sum(a,a) == ZERO) || (fabs(y) >= f_min)) break; - k++; - } while (1); - } - Unexpected(24); - - f_min_exp=(-k)+1; - - if ((mx <= k+k-3) && (f_radix != 10)) { mx+=mx; iexp+=1; } - Vprintf("%sNumber of bits used for exponent = %d%s\n", co, iexp, oc); - Vprintf("%sMinimum normalised exponent = %d%s\n", co, f_min_exp-1, oc); - if (F) - i_define(D_MIN_EXP, thing, Fname, "_MIN_EXP", - (long) f_min_exp, (long) maxint, (long) F_MIN_EXP, ""); - - if (setjmp(lab)==0) { - Vprintf("%sMinimum normalised positive number = %s%s\n", - co, f_rep(digs, (Long_double) f_min), oc); - } else { - eek_a_bug("printf can't print the smallest normalised number"); - printf("\n"); - } - Unexpected(25); - /* Possible loss of precision warnings here from non-stdc compilers */ - if (setjmp(lab) == 0) { - if (F) f_define(D_MIN, thing, - Fname, "_MIN", digs, - (Long_double) f_min, - (Long_double) F_MIN, MARK); - if (V || F) F_check(digs, (Long_double) f_min); - } else { - eek_a_bug("xxx_MIN caused a trap"); - printf("\n"); - } - - if (setjmp(lab) == 0) { - if (F) Validate(digs, (Long_double) f_min, (Long_double) F_MIN, - f_min == Self(F_MIN)); - } else { - printf("%s*** Verify failed for above #define!\n %s %s\n\n", - co, "Compiler has an unusable number for value", oc); - bugs++; - } - Unexpected(26); - - a=1.0; f_min_10_exp=0; - while (a > f_min*10.0) { a/=10.0; f_min_10_exp--; } - if (F) i_define(D_MIN_10_EXP, thing, Fname, "_MIN_10_EXP", - (long) f_min_10_exp, (long) maxint, - (long) F_MIN_10_EXP, ""); - - /* Minimum exponent ************************************************/ - if (setjmp(lab)==0) { /* for underflow trap */ /* Yields xminner */ - do { - xminner=y; - y=Div(y,base); - a=Mul(y,ONE); - if ((Sum(a,a) == ZERO) || (fabs(y) >= xminner)) break; - } while (1); - } - Unexpected(27); - - if (xminner != 0.0 && xminner != f_min) { - normal= 0; - Vprintf("%sThe smallest numbers are not kept normalised%s\n", - co, oc); - if (setjmp(lab)==0) { - Vprintf("%sSmallest unnormalised positive number = %s%s\n", - co, f_rep(digs, (Long_double) xminner), oc); - if (V) F_check(digs, (Long_double) xminner); - } else { - eek_a_bug("printf can't print the smallest unnormalised number."); - printf("\n"); - } - Unexpected(28); - } else { - normal= 1; - Vprintf("%sThe smallest numbers are normalised%s\n", co, oc); - } - - /* Maximum exponent ************************************************/ - f_max_exp=2; f_max=1.0; newxmax=base+1.0; - inf=0; trap=0; - while (f_max