This commit was generated by cvs2svn to compensate for changes in r50397,
which included commits to RCS files with non-trunk default branches.
This commit is contained in:
commit
697859a410
@ -1,5 +1,5 @@
|
||||
If you think you may have found a bug in GNU CC, please
|
||||
read the Bugs section of the Emacs manual for advice on
|
||||
read the Bugs section of the GCC manual for advice on
|
||||
|
||||
(1) how to tell when to report a bug,
|
||||
(2) where to send your bug report, and
|
||||
|
18685
contrib/gcc/ChangeLog
18685
contrib/gcc/ChangeLog
File diff suppressed because it is too large
Load Diff
79
contrib/gcc/LANGUAGES
Normal file
79
contrib/gcc/LANGUAGES
Normal file
@ -0,0 +1,79 @@
|
||||
Right now there is no documentation for the GCC tree -> rtl interfaces
|
||||
(or more generally the interfaces for adding new languages).
|
||||
|
||||
Such documentation would be of great benefit to the project. Until such
|
||||
time as we can formally start documenting the interface this file will
|
||||
serve as a repository for information on these interface and any incompatable
|
||||
changes we've made.
|
||||
|
||||
Jun 10, 1998:
|
||||
The interface to lang_decode_option has changed. It now uses and argc/argv
|
||||
interface to allow for options that use more than one input string. The new
|
||||
declaration is: int lang_decode_option (int argc, char** argv). It now
|
||||
returns the number of input strings processed, or 0 if the option is
|
||||
unknown.
|
||||
|
||||
Jun 7, 1998:
|
||||
Front-ends must now define lang_init_options. It is safe for this
|
||||
function to do nothing. See c-lang.c.
|
||||
|
||||
Apr 21, 1998:
|
||||
Front ends which link with c-common or other files from the C/C++
|
||||
front-ends may need to handle TI types. Look for references to
|
||||
[unsigned]int_DI_type_node in your front end. If you have references
|
||||
to these variables, you'll need up update the front end.
|
||||
|
||||
To update the front end you must mirror all the code which currently
|
||||
deals with intDI_type_node to also handle intTI_type_node.
|
||||
|
||||
|
||||
Apr 7, 1998:
|
||||
The interface between toplev.c and the language front ends for opening the
|
||||
source file has changed:
|
||||
|
||||
o init_lex() has been renamed to init_parse (char *filename) where filename
|
||||
is the name of the source file.
|
||||
o The code in toplev.c which opened the source file should be moved to
|
||||
the new init_parse function.
|
||||
o toplev.c now calls finish_parse() instead of closing the source file
|
||||
using fclose(). This should now be done in finish_parse, if necessary.
|
||||
|
||||
Apr 1, 1998:
|
||||
Front-ends must now define lang_print_xnode. It is safe for this
|
||||
function to do nothing. See c-lang.c.
|
||||
|
||||
Feb 1, 1998:
|
||||
|
||||
GCC used to store structure sizes & offsets to elements as bitsize
|
||||
quantities. This causes problems because a structure can only be
|
||||
(target memsize / 8) bytes long (this may effect arrays too). This
|
||||
is particularly problematical on machines with small address spaces.
|
||||
|
||||
So:
|
||||
|
||||
All trees that represent sizes in bits should have a TREE_TYPE of
|
||||
bitsizetype (rather than sizetype).
|
||||
|
||||
Accordingly, when such values are computed / initialized, care has to
|
||||
be takes to use / compute the proper type.
|
||||
|
||||
When a size in bits is converted into a size in bytes, which is expressed
|
||||
in trees, care should be taken to change the tree's type again to sizetype.
|
||||
|
||||
We've updated C, C++, Fortran & Objective-C to work with the new
|
||||
scheme. Other languages will need to be updated accordingly.
|
||||
Contact amylaar@cygnus.com for additional information.
|
||||
|
||||
?? 1997:
|
||||
|
||||
In an effort to decrease cache thrashing and useless loads we've changed the
|
||||
third argument to the DEFTREECODE macro to be a single char. This will
|
||||
effect languages that defined their own tree codes (usually in a .def file).
|
||||
|
||||
Old way:
|
||||
|
||||
DEFTREECODE (CLASS_METHOD_DECL, "class_method_decl", "d", 0)
|
||||
|
||||
New way:
|
||||
|
||||
DEFTREECODE (CLASS_METHOD_DECL, "class_method_decl", 'd', 0)
|
340
contrib/gcc/NEWS
340
contrib/gcc/NEWS
@ -1,13 +1,336 @@
|
||||
Noteworthy changes in GCC version 2.7.2.1:
|
||||
Noteworthy changes in GCC for EGCS 1.1.
|
||||
---------------------------------------
|
||||
|
||||
This release fixes some serious bugs discovered since the 2.7.2 release.
|
||||
The compiler now implements global common subexpression elimination (gcse) as
|
||||
well as global constant/copy propagation. (link to gcse page).
|
||||
|
||||
Noteworthy changes in GCC version 2.7.2:
|
||||
More major improvements have been made to the alias analysis code. A new
|
||||
option to allow front-ends to provide alias information to the optimizers
|
||||
has also been added (-fstrict-aliasing). -fstrict-aliasing is off by default
|
||||
now, but will be enabled by default in the future. (link to alias page)
|
||||
|
||||
Major changes continue in the exception handling support. This release
|
||||
includes some changes to reduce static overhead for exception handling. It
|
||||
also includes some major changes to the setjmp/longjmp based EH mechanism to
|
||||
make it less pessimistic. And finally, major infrastructure improvements
|
||||
to the dwarf2 EH mechanism have been made to make our EH support extensible.
|
||||
|
||||
We have fixed the infamous security problems with temporary files.
|
||||
|
||||
The "regmove" optimization pass has been nearly completely rewritten. It now
|
||||
uses much more information about the target to determine profitability of
|
||||
transformations.
|
||||
|
||||
The compiler now recomputes register usage information immediately before
|
||||
register allocation. Previously such information was only not kept up to
|
||||
date after instruction combination which led to poor register allocation
|
||||
choices by our priority based register allocator.
|
||||
|
||||
The register reloading phase of the compiler has been improved to better
|
||||
optimize spill code. This primarily helps targets which generate lots of
|
||||
spills (like the x86 ports and many register poor embedded ports).
|
||||
|
||||
A few changes in the heuristics used by the register allocator and scheduler
|
||||
have been made which can significantly improve performance for certain
|
||||
applications.
|
||||
|
||||
The compiler's branch shortening algorithms have been significantly improved
|
||||
to work better on targets which align jump targets.
|
||||
|
||||
The compiler now supports the "ADDRESSOF" optimization which can significantly
|
||||
reduce the overhead for certain inline calls (and inline calls in general).
|
||||
|
||||
The compiler now supports a code size optimization switch (-Os). When enabled
|
||||
the compiler will prefer optimizations which improve code size over those
|
||||
which improve code speed.
|
||||
|
||||
The compiler has been improved to completely eliminate library calls which
|
||||
compute constant values. This is particularly useful on machines which
|
||||
do not have integer mul/div or floating point support on-chip.
|
||||
|
||||
GCC now supports a "--help" option to print detailed help information.
|
||||
|
||||
cpplib has been greatly improved. It is probably useable for some sites now
|
||||
(major missing feature is trigraphs).
|
||||
|
||||
Memory footprint for the compiler has been significantly reduced for certain
|
||||
pathalogical cases.
|
||||
|
||||
Build time improvements for targets which support lots of sched parameters
|
||||
(alpha and mips primarily).
|
||||
|
||||
Compile time for certain programs using large constant initializers has been
|
||||
improved (effects glibc significantly).
|
||||
|
||||
Plus an incredible number of infrastructure changes, warning fixes, bugfixes
|
||||
and local optimizations.
|
||||
|
||||
Various improvements have been made to better support cross compilations. They
|
||||
are still not easy, but they are improving.
|
||||
|
||||
Target specific NEWS
|
||||
|
||||
Sparc: Now includes V8 plus and V9 support, lots of tuning for Ultrasparcs
|
||||
and uses the Haifa scheduler by default.
|
||||
|
||||
Alpha: EV6 tuned, optimized expansion of memcpy/bzero.
|
||||
|
||||
x86: Data in the static store is aligned per Intel recommendations. Jump
|
||||
targets are aligned per Intel recommendations. Improved epilogue
|
||||
sequences for Pentium chips. Backend improvements which should help
|
||||
register allocation on all x86 variants. Support for PPro conditional
|
||||
move instructions has been fixed and enabled. Random changes
|
||||
throughout the port to make generated code more Pentium friendly.
|
||||
Improved support for 64bit integer operations.
|
||||
Unixware 7, a System V Release 5 target is now supported.
|
||||
SCO OpenServer targets can support GAS. See gcc/INSTALL for details.
|
||||
|
||||
RS6000/PowerPC: Includes AIX4.3 support as well as PowerPC64 support.
|
||||
Haifa instruction scheduling is enabled by default now.
|
||||
|
||||
MIPS: Multiply/Multiply-Add support has been largely rewritten to generate
|
||||
more efficient code. Includes mips16 support.
|
||||
|
||||
M68K: Various micro-optimizations and Coldfire fixes.
|
||||
|
||||
M32r: Major improvements to this port.
|
||||
|
||||
Arm: Includes Thumb and super interworking support.
|
||||
|
||||
EGCS includes all gcc2 changes up to and including the June 9, 1998 snapshot.
|
||||
|
||||
|
||||
Noteworthy changes in GCC version 2.8.1
|
||||
---------------------------------------
|
||||
|
||||
Numerous bugs have been fixed and some minor performance
|
||||
improvements (compilation speed) have been made.
|
||||
|
||||
Noteworthy changes in GCC version 2.8.0
|
||||
---------------------------------------
|
||||
|
||||
A major change in this release is the addition of a framework for
|
||||
exception handling, currently used by C++. Many internal changes and
|
||||
optimization improvements have been made. These increase the
|
||||
maintainability and portability of GCC. GCC now uses autoconf to
|
||||
compute many host parameters.
|
||||
|
||||
The following lists changes that add new features or targets.
|
||||
|
||||
See cp/NEWS for new features of C++ in this release.
|
||||
|
||||
New tools and features:
|
||||
|
||||
The Dwarf 2 debugging information format is supported on ELF systems, and
|
||||
is the default for -ggdb where available. It can also be used for C++.
|
||||
The Dwarf version 1 debugging format is also permitted for C++, but
|
||||
does not work well.
|
||||
|
||||
gcov.c is provided for test coverage analysis and branch profiling
|
||||
analysis is also supported; see -fprofile-arcs, -ftest-coverage,
|
||||
and -fbranch-probabilities.
|
||||
|
||||
Support for the Checker memory checking tool.
|
||||
|
||||
New switch, -fstack-check, to check for stack overflow on systems that
|
||||
don't have such built into their ABI.
|
||||
|
||||
New switches, -Wundef and -Wno-undef to warn if an undefined identifier
|
||||
is evaluated in an #if directive.
|
||||
|
||||
Options -Wall and -Wimplicit now cause GCC to warn about implicit int
|
||||
in declarations (e.g. `register i;'), since the C Standard committee
|
||||
has decided to disallow this in the next revision of the standard;
|
||||
-Wimplicit-function-declarations and -Wimplicit-int are subsets of
|
||||
this.
|
||||
|
||||
Option -Wsign-compare causes GCC to warn about comparison of signed and
|
||||
unsigned values.
|
||||
|
||||
Add -dI option of cccp for cxref.
|
||||
|
||||
New features in configuration, installation and specs file handling:
|
||||
|
||||
New option --enable-c-cpplib to configure script.
|
||||
|
||||
You can use --with-cpu on the configure command to specify the default
|
||||
CPU that GCC should generate code for.
|
||||
|
||||
The -specs=file switch allows you to override default specs used in
|
||||
invoking programs like cc1, as, etc.
|
||||
|
||||
Allow including one specs file from another and renaming a specs
|
||||
variable.
|
||||
|
||||
You can now relocate all GCC files with a single environment variable
|
||||
or a registry entry under Windows 95 and Windows NT.
|
||||
|
||||
Changes in Objective-C:
|
||||
|
||||
The Objective-C Runtime Library has been made thread-safe.
|
||||
|
||||
The Objective-C Runtime Library contains an interface for creating
|
||||
mutexes, condition mutexes, and threads; it requires a back-end
|
||||
implementation for the specific platform and/or thread package.
|
||||
Currently supported are DEC/OSF1, IRIX, Mach, OS/2, POSIX, PCThreads,
|
||||
Solaris, and Windows32. The --enable-threads parameter can be used
|
||||
when configuring GCC to enable and select a thread back-end.
|
||||
|
||||
Objective-C is now configured as separate front-end language to GCC,
|
||||
making it more convenient to conditionally build it.
|
||||
|
||||
The internal structures of the Objective-C Runtime Library have
|
||||
changed sufficiently to warrant a new version number; now version 8.
|
||||
Programs compiled with an older version must be recompiled.
|
||||
|
||||
The Objective-C Runtime Library can be built as a DLL on Windows 95
|
||||
and Windows NT systems.
|
||||
|
||||
The Objective-C Runtime Library implements +load.
|
||||
|
||||
The following new targets are supported (see also list under each
|
||||
individual CPU below):
|
||||
|
||||
Embedded target m32r-elf.
|
||||
Embedded Hitachi Super-H using ELF.
|
||||
RTEMS real-time system on various CPU targets.
|
||||
ARC processor.
|
||||
NEC V850 processor.
|
||||
Matsushita MN10200 processor.
|
||||
Matsushita MN10300 processor.
|
||||
Sparc and PowerPC running on VxWorks.
|
||||
Support both glibc versions 1 and 2 on Linux-based GNU systems.
|
||||
|
||||
New features for DEC Alpha systems:
|
||||
|
||||
Allow detailed specification of IEEE fp support:
|
||||
-mieee, -mieee-with-inexact, and -mieee-conformant
|
||||
-mfp-trap-mode=xxx, -mfp-round-mode=xxx, -mtrap-precision=xxx
|
||||
-mcpu=xxx for CPU selection
|
||||
Support scheduling parameters for EV5.
|
||||
Add support for BWX, CIX, and MAX instruction set extensions.
|
||||
Support Linux-based GNU systems.
|
||||
Support VMS.
|
||||
|
||||
Additional supported processors and systems for MIPS targets:
|
||||
|
||||
MIPS4 instruction set.
|
||||
R4100, R4300 and R5000 processors.
|
||||
N32 and N64 ABI.
|
||||
IRIX 6.2.
|
||||
SNI SINIX.
|
||||
|
||||
New features for Intel x86 family:
|
||||
|
||||
Add scheduling parameters for Pentium and Pentium Pro.
|
||||
Support stabs on Solaris-x86.
|
||||
Intel x86 processors running the SCO OpenServer 5 family.
|
||||
Intel x86 processors running DG/UX.
|
||||
Intel x86 using Cygwin32 or Mingw32 on Windows 95 and Windows NT.
|
||||
|
||||
New features for Motorola 68k family:
|
||||
|
||||
Support for 68060 processor.
|
||||
More consistent switches to specify processor.
|
||||
Motorola 68k family running AUX.
|
||||
68040 running pSOS, ELF object files, DBX debugging.
|
||||
Coldfire variant of Motorola m68k family.
|
||||
|
||||
New features for the HP PA RISC:
|
||||
|
||||
-mspace and -mno-space
|
||||
-mlong-load-store and -mno-long-load-store
|
||||
-mbig-switch -mno-big-switch
|
||||
|
||||
GCC on the PA requires either gas-2.7 or the HP assembler; for best
|
||||
results using GAS is highly recommended. GAS is required for -g and
|
||||
exception handling support.
|
||||
|
||||
New features for SPARC-based systems:
|
||||
|
||||
The ultrasparc cpu.
|
||||
The sparclet cpu, supporting only a.out file format.
|
||||
Sparc running SunOS 4 with the GNU assembler.
|
||||
Sparc running the Linux-based GNU system.
|
||||
Embedded Sparc processors running the ELF object file format.
|
||||
-mcpu=xxx
|
||||
-mtune=xxx
|
||||
-malign-loops=xxx
|
||||
-malign-jumps=xxx
|
||||
-malign-functions=xxx
|
||||
-mimpure-text and -mno-impure-text
|
||||
|
||||
Options -mno-v8 and -mno-sparclite are no longer supported on SPARC
|
||||
targets. Options -mcypress, -mv8, -msupersparc, -msparclite, -mf930,
|
||||
and -mf934 are deprecated and will be deleted in GCC 2.9. Use
|
||||
-mcpu=xxx instead.
|
||||
|
||||
New features for rs6000 and PowerPC systems:
|
||||
|
||||
Solaris 2.51 running on PowerPC's.
|
||||
The Linux-based GNU system running on PowerPC's.
|
||||
-mcpu=604e,602,603e,620,801,823,mpc505,821,860,power2
|
||||
-mtune=xxx
|
||||
-mrelocatable-lib, -mno-relocatable-lib
|
||||
-msim, -mmve, -memb
|
||||
-mupdate, -mno-update
|
||||
-mfused-madd, -mno-fused-madd
|
||||
|
||||
-mregnames
|
||||
-meabi
|
||||
-mcall-linux, -mcall-solaris, -mcall-sysv-eabi, -mcall-sysv-noeabi
|
||||
-msdata, -msdata=none, -msdata=default, -msdata=sysv, -msdata=eabi
|
||||
-memb, -msim, -mmvme
|
||||
-myellowknife, -mads
|
||||
wchar_t is now of type long as per the ABI, not unsigned short.
|
||||
-p/-pg support
|
||||
-mcpu=403 now implies -mstrict-align.
|
||||
Implement System V profiling.
|
||||
|
||||
Aix 4.1 GCC targets now default to -mcpu=common so that programs
|
||||
compiled can be moved between rs6000 and powerpc based systems. A
|
||||
consequence of this is that -static won't work, and that some programs
|
||||
may be slightly slower.
|
||||
|
||||
You can select the default value to use for -mcpu=xxx on rs6000 and
|
||||
powerpc targets by using the --with-cpu=xxx option when configuring the
|
||||
compiler. In addition, a new options, -mtune=xxx was added that
|
||||
selects the machine to schedule for but does not select the
|
||||
architecture level.
|
||||
|
||||
Directory names used for storing the multilib libraries on System V
|
||||
and embedded PowerPC systems have been shortened to work with commands
|
||||
like tar that have fixed limits on pathname size.
|
||||
|
||||
New features for the Hitachi H8/300(H):
|
||||
|
||||
-malign-300
|
||||
-ms (for the Hitachi H8/S processor)
|
||||
-mint32
|
||||
|
||||
New features for the ARM:
|
||||
|
||||
-march=xxx, -mtune=xxx, -mcpu=xxx
|
||||
Support interworking with Thumb code.
|
||||
ARM processor with a.out object format, COFF, or AOF assembler.
|
||||
ARM on "semi-hosted" platform.
|
||||
ARM running NetBSD.
|
||||
ARM running the Linux-based GNU system.
|
||||
|
||||
New feature for Solaris systems:
|
||||
|
||||
GCC installation no longer makes a copy of system include files,
|
||||
thus insulating GCC better from updates to the operating system.
|
||||
|
||||
|
||||
Noteworthy changes in GCC version 2.7.2
|
||||
---------------------------------------
|
||||
|
||||
A few bugs have been fixed (most notably the generation of an
|
||||
invalid assembler opcode on some RS/6000 systems).
|
||||
|
||||
Noteworthy changes in GCC version 2.7.1:
|
||||
Noteworthy changes in GCC version 2.7.1
|
||||
---------------------------------------
|
||||
|
||||
This release fixes numerous bugs (mostly minor) in GCC 2.7.0, but
|
||||
also contains a few new features, mostly related to specific targets.
|
||||
@ -31,8 +354,9 @@ sequence used in GCC version 2.7.0. That calling sequence was based on the AIX
|
||||
calling sequence without function descriptors. To compile code for that older
|
||||
calling sequence, either configure the compiler for powerpc-*-eabiaix or use
|
||||
the -mcall-aix switch when compiling and linking.
|
||||
|
||||
Noteworthy changes in GCC version 2.7.0:
|
||||
|
||||
Noteworthy changes in GCC version 2.7.0
|
||||
---------------------------------------
|
||||
|
||||
GCC now works better on systems that use ".obj" and ".exe" instead of
|
||||
".o" and no extension. This involved changes to the driver program,
|
||||
@ -284,7 +608,7 @@ The following new configurations are supported:
|
||||
GNU on x86 (instead of treating it like MACH)
|
||||
NetBSD on Sparc and Motorola 68k
|
||||
AIX 4.1 on RS/6000 and PowerPC systems
|
||||
Sequent DYNUX/ptx 1.x and 2.x.
|
||||
Sequent DYNIX/ptx 1.x and 2.x.
|
||||
Both COFF and ELF configurations on AViiON without using /bin/gcc
|
||||
Windows/NT on x86 architecture; preliminary
|
||||
AT&T DSP1610 digital signal processor chips
|
||||
@ -508,7 +832,7 @@ to declare complex data types. See the manual for details.
|
||||
|
||||
* GCC now supports `long double' meaningfully on the Sparc (128-bit
|
||||
floating point) and on the 386 (96-bit floating point). The Sparc
|
||||
support is enabled on on Solaris 2.x because earlier system versions
|
||||
support is enabled on Solaris 2.x because earlier system versions
|
||||
(SunOS 4) have bugs in the emulation.
|
||||
|
||||
* All targets now have assertions for cpu, machine and system. So you
|
||||
|
@ -1,12 +1,64 @@
|
||||
0. Improved efficiency.
|
||||
C++ template friend functions (mmitchell@usa.net)
|
||||
|
||||
* Parse and output array initializers an element at a time, freeing
|
||||
storage after each, instead of parsing the whole initializer first and
|
||||
then outputting. This would reduce memory usage for large
|
||||
initializers.
|
||||
Haifa scheduler (haifa-sched.c, loop.[ch], unroll.[ch], genattrtab.c):
|
||||
(contact law@cygnus.com before starting any serious haifa work)
|
||||
|
||||
* See if the techniques describe in Oct 1991 SIGPLAN Notices
|
||||
(Frazer and Hanson) are applicable to GCC.
|
||||
* Fix all the formatting problems. Simple, mindless work.
|
||||
|
||||
* Fix/add comments throughout the code. Many of the comments are from
|
||||
the old scheduler and are out of date and misleading. Many new hunks
|
||||
of code don't have sufficient comments and documentation. Those which
|
||||
do have comments need to be rewritten to use complete sentences and
|
||||
proper formatting.
|
||||
|
||||
* Someone needs make one (or more) passes over the scheduler as a whole to
|
||||
just clean it up. Try to move the machine dependent bits into the target
|
||||
files where they belong, avoid re-creating functions where or near
|
||||
equivalents already exist (ie is_conditional_branch and friends), etc., etc.
|
||||
|
||||
* Document the new scheduling options. Remove those options which are
|
||||
not really useful (like reverse scheduling for example). In general
|
||||
the haifa scheduler adds _way_ too many options. I'm definitely of the
|
||||
opinion that gcc already has too many -foptions, and haifa doesn't help
|
||||
that situation.
|
||||
|
||||
* Testing and benchmarking. We've converted a few ports to using the
|
||||
Haifa scheduler (hppa, sparc, ppc, alpha). We need to continue testing
|
||||
and benchmarking the new scheduler on additional targets.
|
||||
|
||||
We need to have some kind of docs for how to best describe a machine to
|
||||
the haifa scheduler to get good performance. Some existing ports have
|
||||
been tuned to deal with the old scheduler -- they may need to be tuned
|
||||
to generate good schedules with haifa.
|
||||
|
||||
|
||||
|
||||
Improvements to global cse and partial redundancy elimination:
|
||||
|
||||
The current implementation of global cse uses partial redundancy elimination
|
||||
as described in Chow's thesis.
|
||||
|
||||
Long term we want to use lazy code motion as the basis for partial redundancy
|
||||
elimination. lcm will find as many (or more) redunancies *and* it will
|
||||
place the remaining computations at computationally optimal placement points
|
||||
within the function. This reduces the number of redundant operations performed
|
||||
as well as reducing register lifetimes. My experiments have shown that the
|
||||
cases were the current PRE code hurts performance are greatly helped by using
|
||||
lazy code motion.
|
||||
|
||||
lcm also provides the underlying framework for several additional optimizations
|
||||
such as shrink wrapping, spill code motion, dead store elimination, and generic
|
||||
load/store motion (all the other examples are subcases of load/store motion).
|
||||
|
||||
It can probably also be used to improve the reg-stack pass of the compiler.
|
||||
|
||||
Contact law@cygnus.com if you're interested in working on lazy code motion.
|
||||
|
||||
-------------
|
||||
|
||||
The old PROJECTS file. Stuff I know has been done has been deleted.
|
||||
Stuff in progress has a contact name associated with it.
|
||||
has been
|
||||
|
||||
1. Better optimization.
|
||||
|
||||
@ -20,28 +72,6 @@ The difficulty is in finding a clean way for the RTL which refers
|
||||
to the constant (currently, only by an assembler symbol name)
|
||||
to point to the constant and cause it to be output.
|
||||
|
||||
* More cse
|
||||
|
||||
The techniques for doing full global cse are described in the red
|
||||
dragon book, or (a different version) in Frederick Chow's thesis from
|
||||
Stanford. It is likely to be slow and use a lot of memory, but it
|
||||
might be worth offering as an additional option.
|
||||
|
||||
It is probably possible to extend cse to a few very frequent cases
|
||||
without so much expense.
|
||||
|
||||
For example, it is not very hard to handle cse through if-then
|
||||
statements with no else clauses. Here's how to do it. On reaching a
|
||||
label, notice that the label's use-count is 1 and that the last
|
||||
preceding jump jumps conditionally to this label. Now you know it
|
||||
is a simple if-then statement. Remove from the hash table
|
||||
all the expressions that were entered since that jump insn
|
||||
and you can continue with cse.
|
||||
|
||||
It is probably not hard to handle cse from the end of a loop
|
||||
around to the beginning, and a few loops would be greatly sped
|
||||
up by this.
|
||||
|
||||
* Optimize a sequence of if statements whose conditions are exclusive.
|
||||
|
||||
It is possible to optimize
|
||||
@ -174,42 +204,8 @@ or outside of a particular loop where the variable is not used. (The
|
||||
latter is nice because it might let the variable be in a register most
|
||||
of the time even though the loop needs all the registers.)
|
||||
|
||||
It might not be very hard to do this in global.c when a variable
|
||||
fails to get a hard register for its entire life span.
|
||||
|
||||
The first step is to find a loop in which the variable is live, but
|
||||
which is not the whole life span or nearly so. It's probably best to
|
||||
use a loop in which the variable is heavily used.
|
||||
|
||||
Then create a new pseudo-register to represent the variable in that loop.
|
||||
Substitute this for the old pseudo-register there, and insert move insns
|
||||
to copy between the two at the loop entry and all exits. (When several
|
||||
such moves are inserted at the same place, some new feature should be
|
||||
added to say that none of those registers conflict merely because of
|
||||
overlap between the new moves. And the reload pass should reorder them
|
||||
so that a store precedes a load, for any given hard register.)
|
||||
|
||||
After doing this for all the reasonable candidates, run global-alloc
|
||||
over again. With luck, one of the two pseudo-registers will be fit
|
||||
somewhere. It may even have a much higher priority due to its reduced
|
||||
life span.
|
||||
|
||||
There will be no room in general for the new pseudo-registers in
|
||||
basic_block_live_at_start, so there will need to be a second such
|
||||
matrix exclusively for the new ones. Various other vectors indexed by
|
||||
register number will have to be made bigger, or there will have to be
|
||||
secondary extender vectors just for global-alloc.
|
||||
|
||||
A simple new feature could arrange that both pseudo-registers get the
|
||||
same stack slot if they both fail to get hard registers.
|
||||
|
||||
Other compilers split live ranges when they are not connected, or
|
||||
try to split off pieces `at the edge'. I think splitting around loops
|
||||
will provide more speedup.
|
||||
|
||||
Creating a fake binding block and a new like-named variable with
|
||||
shorter life span and different address might succeed in describing
|
||||
this technique for the debugger.
|
||||
Contact meissner@cygnus.com before starting any work on live range
|
||||
splitting.
|
||||
|
||||
* Detect dead stores into memory?
|
||||
|
||||
@ -218,6 +214,10 @@ the same location; and, in between, there is no reference to anything
|
||||
that might be that location (including no reference to a variable
|
||||
address).
|
||||
|
||||
This can be modeled as a partial redundancy elimination/lazy code motion
|
||||
problem. Contact law@cygnus.com before working on dead store elimination
|
||||
optimizations.
|
||||
|
||||
* Loop optimization.
|
||||
|
||||
Strength reduction and iteration variable elimination could be
|
||||
@ -286,8 +286,9 @@ to the order in which to generate code for subexpressions of an expression.
|
||||
|
||||
* More code motion.
|
||||
|
||||
Consider hoisting common code up past conditional branches or
|
||||
tablejumps.
|
||||
Consider hoisting common code up past conditional branches or tablejumps.
|
||||
|
||||
Contact law@cygnus.com before working on code hoisting.
|
||||
|
||||
* Trace scheduling.
|
||||
|
||||
|
@ -1,10 +1,7 @@
|
||||
This directory contains the version 2.7.2.3 release of the GNU C
|
||||
This directory contains the egcs version 1.1.2 release of the GNU C
|
||||
compiler. It includes all of the support for compiling C++ and
|
||||
Objective C, including a run-time library for Objective C.
|
||||
|
||||
The reason for the 2.7.2.3 release is to correct the support for GNU C
|
||||
library version 2 on GNU/Linux systems.
|
||||
|
||||
The GNU C compiler is free software. See the file COPYING for copying
|
||||
permission.
|
||||
|
||||
|
144
contrib/gcc/README-bugs
Normal file
144
contrib/gcc/README-bugs
Normal file
@ -0,0 +1,144 @@
|
||||
The purpose of GCC pretesting is to verify that the new GCC
|
||||
distribution, about to be released, works properly on your system *with
|
||||
no change whatever*, when installed following the precise
|
||||
recommendations that come with the distribution.
|
||||
|
||||
Here are some guidelines on how to do pretesting so as to make it
|
||||
helpful. All of them follow from common sense together with the
|
||||
nature of the purpose and the situation.
|
||||
|
||||
* It is absolutely vital that you mention even the smallest change or
|
||||
departure from the standard sources and installation procedure.
|
||||
|
||||
Otherwise, you are not testing the same program that I wrote. Testing
|
||||
a different program is usually of no use whatever. It can even cause
|
||||
trouble if you fail to tell me that you tested some other program
|
||||
instead of what I know as GCC. I might think that GCC works, when in
|
||||
fact it has not been properly tried, and might have a glaring fault.
|
||||
|
||||
* Even changing the compilation options counts as a change in the
|
||||
program. The GCC sources specify which compilation options to use.
|
||||
Some of them are specified in makefiles, and some in machine-specific
|
||||
configuration files.
|
||||
|
||||
You have ways to override this--but if you do, then you are not
|
||||
testing what ordinary users will do. Therefore, when pretesting, it
|
||||
is vital to test with the default compilation options.
|
||||
|
||||
(It is okay to test with nonstandard options as well as testing with
|
||||
the standard ones.)
|
||||
|
||||
* The machine and system configuration files of GCC are parts of
|
||||
GCC. So when you test GCC, you need to do it with the
|
||||
configuration files that come with GCC.
|
||||
|
||||
If GCC does not come with configuration files for a certain machine,
|
||||
and you test it with configuration files that don't come with GCC,
|
||||
this is effectively changing GCC. Because the crucial fact about
|
||||
the planned release is that, without changes, it doesn't work on that
|
||||
machine.
|
||||
|
||||
To make GCC work on that machine, I would need to install new
|
||||
configuration files. That is not out of the question, since it is
|
||||
safe--it certainly won't break any other machines that already work.
|
||||
But you will have to rush me the legal papers to give the FSF
|
||||
permission to use a large piece of text.
|
||||
|
||||
* Look for recommendations for your system.
|
||||
|
||||
You can find these recommendations in the Installation node of the
|
||||
manual, and in the file INSTALL. (These two files have the same text.)
|
||||
|
||||
These files say which configuration name to use for your machine, so
|
||||
use the ones that are recommended. If you guess, you might guess
|
||||
wrong and encounter spurious difficulties. What's more, if you don't
|
||||
follow the recommendations then you aren't helping to test that its
|
||||
recommendations are valid.
|
||||
|
||||
These files may describe other things that you need to do to make GCC
|
||||
work on your machine. If so, you should follow these recommendations
|
||||
also, for the same reason.
|
||||
|
||||
Also look at the Trouble chapter of the manual for items that
|
||||
pertain to your machine.
|
||||
|
||||
* Don't delay sending information.
|
||||
|
||||
When you find a problem, please double check it if you can do so
|
||||
quickly. But don't spend a long time double-checking. A good rule is
|
||||
always to tell me about every problem on the same day you encounter
|
||||
it, even if that means you can't find a solution before you report the
|
||||
problem.
|
||||
|
||||
I'd much rather hear about a problem today and a solution tomorrow
|
||||
than get both of them tomorrow at the same time.
|
||||
|
||||
* Make each bug report self-contained.
|
||||
|
||||
If you refer back to another message, whether from you or from someone
|
||||
else, then it will be necessary for anyone who wants to investigate
|
||||
the bug to find the other message. This may be difficult, it is
|
||||
probably time-consuming.
|
||||
|
||||
To help me save time, simply copy the relevant parts of any previous
|
||||
messages into your own bug report.
|
||||
|
||||
In particular, if I ask you for more information because a bug report
|
||||
was incomplete, it is best to send me the *entire* collection of
|
||||
relevant information, all together. If you send just the additional
|
||||
information, that makes me do extra work. There is even a risk that
|
||||
I won't remember what question you are sending me the answer to.
|
||||
|
||||
* Always be precise when talking about changes you have made. Show
|
||||
things rather than describing them. Use exact filenames (relative to
|
||||
the main directory of the distribution), not partial ones. For
|
||||
example, say "I changed Makefile" rather than "I changed the
|
||||
makefile". Instead of saying "I defined the MUMBLE macro", send a
|
||||
diff that shows your change.
|
||||
|
||||
* Always use `diff -c' to make diffs. If you don't include context,
|
||||
it may be hard for me to figure out where you propose to make the
|
||||
changes. I might have to ignore your patch because I can't tell what
|
||||
it means.
|
||||
|
||||
* When you write a fix, keep in mind that I can't install a change
|
||||
that would break other systems.
|
||||
|
||||
People often suggest fixing a problem by changing machine-independent
|
||||
files such as toplev.c to do something special that a particular
|
||||
system needs. Sometimes it is totally obvious that such changes would
|
||||
break GCC for almost all users. I can't possibly make a change like
|
||||
that. All I can do is send it back to you and ask you to find a fix
|
||||
that is safe to install.
|
||||
|
||||
Sometimes people send fixes that *might* be an improvement in
|
||||
general--but it is hard to be sure of this. I can install such
|
||||
changes some of the time, but not during pretest, when I am trying to
|
||||
get a new version to work reliably as quickly as possible.
|
||||
|
||||
The safest changes for me to install are changes to the configuration
|
||||
files for a particular machine. At least I know those can't create
|
||||
bugs on other machines.
|
||||
|
||||
* Don't try changing GCC unless it fails to work if you don't change it.
|
||||
|
||||
* Don't even suggest changes that would only make GCC cleaner.
|
||||
Every change I install could introduce a bug, so I won't install
|
||||
a change unless I see it is necessary.
|
||||
|
||||
* If you would like to suggest changes for purposes other than fixing
|
||||
serious bugs, don't wait till pretest time. Instead, send them just
|
||||
after I make a release. That's the best time for me to install them.
|
||||
|
||||
* In some cases, if you don't follow these guidelines, your
|
||||
information might still be useful, but I might have to do more work to
|
||||
make use of it. Unfortunately, I am so far behind in my work that I
|
||||
just can't get the job done unless you help me to do it efficiently.
|
||||
|
||||
|
||||
Thank you
|
||||
rms
|
||||
|
||||
Local Variables:
|
||||
mode: text
|
||||
End:
|
@ -11,7 +11,7 @@ For general information about the DWARF debugging information language,
|
||||
you should obtain the DWARF version 1 specification document (and perhaps
|
||||
also the DWARF version 2 draft specification document) developed by the
|
||||
UNIX International Programming Languages Special Interest Group. A copy
|
||||
of the the DWARF version 1 specification (in PostScript form) may be
|
||||
of the DWARF version 1 specification (in PostScript form) may be
|
||||
obtained either from me <rfg@netcom.com> or from the main Data General
|
||||
FTP server. (See below.) The file you are looking at now only describes
|
||||
known deviations from the DWARF version 1 specification, together with
|
||||
@ -117,7 +117,7 @@ more of the formal parameter values, they may not have been "homed" yet,
|
||||
so you may get inaccurate answers (or perhaps even addressing errors).
|
||||
|
||||
Some people may consider this simply a non-feature, but I consider it a
|
||||
bug, and I hope to provide some some GNU-specific attributes (on function
|
||||
bug, and I hope to provide some GNU-specific attributes (on function
|
||||
DIEs) which will specify the address of the end of the prologue and the
|
||||
address of the beginning of the epilogue in a future release.
|
||||
|
||||
@ -159,7 +159,7 @@ is required by the current DWARF draft specification.
|
||||
Specifically, the current DWARF draft specification seems to require that
|
||||
the type of an non-unsigned integral bit-field member of a struct or union
|
||||
type be represented as either a "signed" type or as a "plain" type,
|
||||
depending upon the the exact set of keywords that were used in the
|
||||
depending upon the exact set of keywords that were used in the
|
||||
type specification for the given bit-field member. It was felt (by the
|
||||
UI/PLSIG) that this distinction between "plain" and "signed" integral types
|
||||
could have some significance (in the case of bit-fields) because ANSI C
|
||||
|
263
contrib/gcc/README.g77
Normal file
263
contrib/gcc/README.g77
Normal file
@ -0,0 +1,263 @@
|
||||
1998-08-11
|
||||
|
||||
This directory contains the egcs variant of version 0.5.24 of the
|
||||
GNU Fortran compiler (g77). The GNU Fortran compiler is free software.
|
||||
See the file COPYING.g77 for copying permission.
|
||||
|
||||
Currently, two variants of g77 exist. One is the Free Software Foundation
|
||||
(FSF) variant. The other is the egcs variant. As of egcs version 1.1,
|
||||
these variants are kept fairly similar in most respects. Pertinent
|
||||
differences, such as the layout of the source code, are specified below.
|
||||
|
||||
Below, `[FSF]' denotes information applicable to only the FSF variant of
|
||||
g77, while `[egcs]' denotes egcs-only information.
|
||||
|
||||
|
||||
* IMPORTANT: Things you *must* do (or avoid) are marked with a * at the
|
||||
beginning of the line in this file!!!
|
||||
|
||||
|
||||
The email address to which bugs are to be reported is either
|
||||
[FSF] <fortran@gnu.org> or [egcs] <egcs-bugs@cygnus.com>.
|
||||
|
||||
* *DO NOT* send any email (reporting bugs, asking questions, etc.) to
|
||||
either of these addresses without *first* reading the g77 documentation.
|
||||
Use `info', Info mode in GNU Emacs, or a text viewer such as `more' to
|
||||
do this.
|
||||
|
||||
The g77 documentation is in the source files named `g77.info',
|
||||
`g77.info-1', `g77.info-2', and so on in the `f' subdirectory. If these
|
||||
files are not present or you can't find them, contact the person or
|
||||
organization that put together the g77 distribution you are using (probably
|
||||
not the FSF or egcs), or ask your system administrator for help.
|
||||
|
||||
|
||||
This README applies to only the g77-specific portions of the source-code
|
||||
tree that contains it. These portions include:
|
||||
|
||||
- The README.g77 and [FSF] COPYING.g77 files, in this directory, "this
|
||||
directory" being [FSF] the top-level directory containing a g77
|
||||
distribution or [egcs] the gcc/ subdirectory of an egcs distribution.
|
||||
|
||||
- The g77 front end, in the f/ subdirectory of this directory.
|
||||
|
||||
- The libg2c library, in [FSF] the f/runtime/ subdirectory of this
|
||||
directory or [egcs] the libf2c/ directory under the top-level
|
||||
directory of the egcs distribution.
|
||||
|
||||
|
||||
* To build g77, you must have a source distribution of [FSF] gcc
|
||||
version 2.8 or [egcs] egcs version 1.1. Do not attempt to use
|
||||
any other version of gcc or egcs, because this version of g77 is
|
||||
designed to work with only those versions.
|
||||
|
||||
Note that you must have *source* copies of the gcc or egcs distribution!
|
||||
You cannot build g77 just using binaries of gcc or egcs. Also, unless
|
||||
you are an expert, avoid using any distribution of gcc or egcs not
|
||||
identical to the ones distributed by the FSF and Cygnus Support,
|
||||
respectively. The primary FSF distribution site is:
|
||||
|
||||
<ftp://ftp.gnu.org/pub/gnu/>
|
||||
|
||||
The primary egcs distribution site is:
|
||||
|
||||
<ftp://ftp.cygnus.com/pub/egcs/>
|
||||
|
||||
Both of these sites have approved mirror sites from which valid
|
||||
distributions also may be obtained.
|
||||
|
||||
* Do not attempt to combine the egcs version of g77 with the FSF
|
||||
gcc distribution, or the FSF version of g77 with the egcs gcc
|
||||
distribution. Although the differences are minor, they might
|
||||
be sufficient to prevent g77 from building properly, or from
|
||||
working properly if the build appears to succeed.
|
||||
|
||||
[FSF] g77 is distributed as g77-<version>/f/ so that unpacking the g77
|
||||
distribution is done in the normal GNU way, resulting in a directory having
|
||||
the version number in the name. However, to build g77, the g77 distribution
|
||||
must be merged with an appropriate gcc distribution, normally in a gcc
|
||||
source directory, before configuring, building, and installing g77.
|
||||
|
||||
[FSF] If you have just unpacked the g77 distribution, before proceeding,
|
||||
you must merge the contents of the g77 distribution with the appropriate
|
||||
gcc distribution on your system.
|
||||
|
||||
* [FSF] Read and follow the instructions in f/INSTALL that
|
||||
explain how to merge a g77 source directory into a gcc source
|
||||
directory. You can use Info to read the same installation
|
||||
instructions via:
|
||||
|
||||
info -f f/g77.info -n Unpacking
|
||||
|
||||
[FSF] The resulting directory layout includes the following, where gcc/
|
||||
might be a link to, for example, gcc-2.8.1/:
|
||||
|
||||
gcc/ Non-g77 files in gcc
|
||||
gcc/COPYING.g77 A copy of the GPL, under which g77 is licensed
|
||||
gcc/README.g77 This file
|
||||
gcc/f/ GNU Fortran front end
|
||||
gcc/f/runtime/ libg2c configuration and g2c.h file generation
|
||||
gcc/f/runtime/libF77/ Non-I/O portion of libg2c
|
||||
gcc/f/runtime/libI77/ I/O portion of libg2c
|
||||
gcc/f/runtime/libU77/ Additional interfaces to libc for libg2c
|
||||
|
||||
[FSF] Applying g77 patches in the form of .diff files is done by typing
|
||||
`patch -p1 -d gcc' (where gcc/ contains the f/ subdirectory). That is,
|
||||
g77 patches are distributed in the same form, and at the same directory
|
||||
level, as patches to the gcc distribution. (Note: make sure you're
|
||||
using GNU patch, version 2.5 or later! Other versions of patch
|
||||
have trouble with g77-related patches.)
|
||||
|
||||
[egcs] The egcs version of g77 is distributed already merged with
|
||||
the rest of egcs (such as the gcc back end).
|
||||
|
||||
[egcs] The resulting directory layout includes the following, where egcs/
|
||||
might be a link to, for example, egcs-1.1/:
|
||||
|
||||
egcs/gcc/ Non-g77 files in gcc
|
||||
egcs/gcc/README.g77 This file
|
||||
egcs/gcc/f/ GNU Fortran front end
|
||||
egcs/libf2c/ libg2c configuration and g2c.h file generation
|
||||
egcs/libf2c/libF77/ Non-I/O portion of libg2c
|
||||
egcs/libf2c/libI77/ I/O portion of libg2c
|
||||
egcs/libf2c/libU77/ Additional interfaces to libc for libg2c
|
||||
|
||||
[egcs] Applying g77-specific patches to egcs is done the same way as
|
||||
applying other egcs patches.
|
||||
|
||||
|
||||
Below, `libf2c/' shall denote [FSF] gcc/f/runtime/ or [egcs] egcs/libf2c/,
|
||||
while `f/' shall denote [FSF] the rest of gcc/f/ or [egcs] egcs/gcc/f/.
|
||||
|
||||
|
||||
Components of note in g77 are described below.
|
||||
|
||||
f/ as a whole contains the program GNU Fortran (g77), while libf2c/
|
||||
contains a portion of the separate program f2c. Note: The libf2c
|
||||
code is not part of the program g77, just distributed with it.
|
||||
|
||||
f/ contains text files that document the Fortran compiler, source
|
||||
files for the GNU Fortran Front End (FFE), and some other stuff.
|
||||
The g77 compiler code is placed in f/ because it, along with its contents,
|
||||
is designed to be a subdirectory of a GNU CC (gcc) source directory, gcc/,
|
||||
which is structured so that language-specific front ends can be "dropped
|
||||
in" as subdirectories. The C++ front end (g++), is an example of this --
|
||||
it resides in the cp/ subdirectory. Note that the C front end (also
|
||||
referred to as gcc) is an exception to this, as its source files reside
|
||||
in the gcc/ directory itself.
|
||||
|
||||
libf2c/ contains the run-time libraries for the f2c program, also used
|
||||
by g77. These libraries normally referred to collectively as libf2c.
|
||||
When built as part of g77, libf2c is installed under the name libg2c to avoid
|
||||
conflict with any existing version of libf2c, and thus is often referred
|
||||
to as libg2c when the g77 version is specifically being referred to.
|
||||
|
||||
The netlib version of libf2c/ contains two distinct libraries, libF77 and
|
||||
libI77, each in their own subdirectories. In g77, this distinction is not
|
||||
made, beyond maintaining the subdirectory structure in the source-code tree.
|
||||
|
||||
libf2c/ is not part of the program g77, just distributed with it. It
|
||||
contains files not present in the official (netlib) version of libf2c,
|
||||
and also contains some minor changes made from libf2c, to fix some bugs,
|
||||
and to facilitate automatic configuration, building, and installation of
|
||||
libf2c (as libg2c) for use by g77 users.
|
||||
|
||||
* See libf2c/README for more information, including licensing conditions
|
||||
governing distribution of programs containing code from libg2c.
|
||||
|
||||
libg2c, g77's version of libf2c, adds Dave Love's implementation of
|
||||
libU77, in the libf2c/libU77/ directory. This library is distributed
|
||||
under the GNU Library General Public License (LGPL) -- see the
|
||||
file libf2c/libU77/COPYING.LIB for more information, as this license
|
||||
governs distribution conditions for programs containing code from
|
||||
this portion of the library.
|
||||
|
||||
|
||||
Files of note in g77 are described below.
|
||||
|
||||
f/BUGS lists some important bugs known to be in g77. Or:
|
||||
|
||||
info -f f/g77.info -n "Actual Bugs"
|
||||
|
||||
f/ChangeLog lists recent changes to g77 internals.
|
||||
|
||||
libf2c/ChangeLog lists recent changes to libg2c internals.
|
||||
|
||||
[FSF] f/INSTALL describes how to build and install GNU Fortran. Or:
|
||||
|
||||
info -f f/g77.info -n Installation
|
||||
|
||||
f/NEWS contains the per-release changes. These include the user-visible
|
||||
changes described under "Changes" in the g77 documentation, plus internal
|
||||
changes of import. Or:
|
||||
|
||||
info -f f/g77.info -n News
|
||||
|
||||
* All users of g77 (not just installers) should read f/g77.info*
|
||||
as well, using the `more' command if neither the `info' command,
|
||||
nor GNU Emacs (with its Info mode), are available, or if they
|
||||
aren't yet accustomed to using these tools. Read f/BUGS and f/NEWS
|
||||
plus, if you are planning on building or installing the FSF version
|
||||
of g77, f/INSTALL, at the very least! All of these files are
|
||||
readable as "plain text" files.
|
||||
|
||||
* Also see <ftp://alpha.gnu.org/g77.plan> for up-to-date information
|
||||
regarding g77 bug reports, known bugs, bug-fixes, and new versions.
|
||||
|
||||
|
||||
The rest of this file is of note to only those who wish to
|
||||
debug, modify, or test the FFE (in conjunction with the gcc back end).
|
||||
|
||||
If you want to explore the FFE code, which lives entirely in f/, here
|
||||
are a few clues. The file g77spec.c contains the g77-specific source code
|
||||
for the `g77' command only -- this just forms a variant of the `gcc'
|
||||
command, so, just as the `gcc' command itself does not contain
|
||||
the C front end, the `g77' command does not contain the Fortran front
|
||||
end (FFE). The FFE code ends up in an executable named `f771', which
|
||||
does the actual compiling, so it contains the FFE plus the gcc back end
|
||||
(the latter to do most of the optimization, and the code generation).
|
||||
|
||||
The file parse.c is the source file for main() for a stand-alone FFE and
|
||||
yyparse() for f771. (Stand-alone building of the FFE doesn't work these days.)
|
||||
The file top.c contains the top-level FFE function ffe_file and it (along
|
||||
with top.h) define all ffe_[a-z].*, ffe[A-Z].*, and FFE_[A-Za-z].* symbols.
|
||||
The file fini.c is a main() program that is used when building the FFE to
|
||||
generate C header and source files for recognizing keywords. The files
|
||||
malloc.c and malloc.h comprise a memory manager that defines all
|
||||
malloc_[a-z].*, malloc[A-Z].*, and MALLOC_[A-Za-z].* symbols. All other
|
||||
modules named <xyz> are comprised of all files named <xyz>*.<ext> and
|
||||
define all ffe<xyz>_[a-z].*, ffe<xyz>[A-Z].*, and FFE<XYZ>_[A-Za-z].* symbols.
|
||||
If you understand all this, congratulations -- it's easier for me to remember
|
||||
how it works than to type in these grep patterns (such as they are). But it
|
||||
does make it easy to find where a symbol is defined -- for example,
|
||||
the symbol "ffexyz_set_something" would be defined in xyz.h and implemented
|
||||
there (if it's a macro) or in xyz.c.
|
||||
|
||||
The "porting" files of note currently are: proj.h, which defines the
|
||||
"language" used by all the other source files (the language being
|
||||
Standard C plus some useful things like ARRAY_SIZE and such) -- change
|
||||
this file when you find your system doesn't properly define a Standard C
|
||||
macro or function, for example; target.h and target.c, which describe
|
||||
the target machine in terms of what data types are supported, how they are
|
||||
denoted (what C type does an INTEGER*8 map to, for example), how to convert
|
||||
between them, and so on (though as of 0.5.3, more and more of this information
|
||||
is being dynamically configured by ffecom_init_0); com.h and com.c, which
|
||||
interface to the target back end (currently only FFE stand-alone and the GBE);
|
||||
ste.c, which contains code for implementing recognized executable statements
|
||||
in the target back end (again currently either FFE or GBE); src.h and src.c,
|
||||
which describe information on the format(s) of source files (such as whether
|
||||
they are never to be processed as case-insensitive with regard to Fortran
|
||||
keywords); and proj.c, which contains whatever code is needed to support
|
||||
the language defined by proj.h.
|
||||
|
||||
If you want to debug the f771 executable, for example if it crashes,
|
||||
note that the global variables "lineno" and "input_filename" are set
|
||||
to reflect the current line being read by the lexer during the first-pass
|
||||
analysis of a program unit and to reflect the current line being
|
||||
processed during the second-pass compilation of a program unit. If
|
||||
an invocation of the function ffestd_exec_end() is on the stack,
|
||||
the compiler is in the second pass, otherwise it is in the first.
|
||||
(This information might help you reduce a test case and/or work around
|
||||
a bug in g77 until a fix is available.)
|
||||
|
||||
Any questions or comments on these topics? Read the g77 documentation!
|
1761
contrib/gcc/SERVICE
1761
contrib/gcc/SERVICE
File diff suppressed because it is too large
Load Diff
79
contrib/gcc/acconfig.h
Normal file
79
contrib/gcc/acconfig.h
Normal file
@ -0,0 +1,79 @@
|
||||
/* Define if printf supports "%p". */
|
||||
#undef HAVE_PRINTF_PTR
|
||||
|
||||
/* Define if you want expensive run-time checks. */
|
||||
#undef ENABLE_CHECKING
|
||||
|
||||
/* Define if your cpp understands the stringify operator. */
|
||||
#undef HAVE_CPP_STRINGIFY
|
||||
|
||||
/* Define if your compiler understands volatile. */
|
||||
#undef HAVE_VOLATILE
|
||||
|
||||
/* Define if your assembler supports specifying the maximum number
|
||||
of bytes to skip when using the GAS .p2align command. */
|
||||
#undef HAVE_GAS_MAX_SKIP_P2ALIGN
|
||||
|
||||
/* Define if your assembler supports .balign and .p2align. */
|
||||
#undef HAVE_GAS_BALIGN_AND_P2ALIGN
|
||||
|
||||
/* Define if you have a working <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Whether malloc must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_MALLOC
|
||||
|
||||
/* Whether realloc must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_REALLOC
|
||||
|
||||
/* Whether calloc must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_CALLOC
|
||||
|
||||
/* Whether free must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_FREE
|
||||
|
||||
/* Whether bcopy must be declared even if <string.h> is included. */
|
||||
#undef NEED_DECLARATION_BCOPY
|
||||
|
||||
/* Whether bcmp must be declared even if <string.h> is included. */
|
||||
#undef NEED_DECLARATION_BCMP
|
||||
|
||||
/* Whether bzero must be declared even if <string.h> is included. */
|
||||
#undef NEED_DECLARATION_BZERO
|
||||
|
||||
/* Whether index must be declared even if <string.h> is included. */
|
||||
#undef NEED_DECLARATION_INDEX
|
||||
|
||||
/* Whether rindex must be declared even if <string.h> is included. */
|
||||
#undef NEED_DECLARATION_RINDEX
|
||||
|
||||
/* Whether getenv must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_GETENV
|
||||
|
||||
/* Whether atol must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_ATOL
|
||||
|
||||
/* Whether sbrk must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_SBRK
|
||||
|
||||
/* Whether abort must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_ABORT
|
||||
|
||||
/* Whether strerror must be declared even if <string.h> is included. */
|
||||
#undef NEED_DECLARATION_STRERROR
|
||||
|
||||
/* Whether getcwd must be declared even if <unistd.h> is included. */
|
||||
#undef NEED_DECLARATION_GETCWD
|
||||
|
||||
/* Whether getwd must be declared even if <unistd.h> is included. */
|
||||
#undef NEED_DECLARATION_GETWD
|
||||
|
||||
/* Whether getrlimit must be declared even if <sys/resource.h> is included. */
|
||||
#undef NEED_DECLARATION_GETRLIMIT
|
||||
|
||||
/* Whether setrlimit must be declared even if <sys/resource.h> is included. */
|
||||
#undef NEED_DECLARATION_SETRLIMIT
|
||||
|
||||
/* Define if you want expensive run-time checks. */
|
||||
#undef ENABLE_CHECKING
|
||||
@TOP@
|
221
contrib/gcc/aclocal.m4
vendored
Normal file
221
contrib/gcc/aclocal.m4
vendored
Normal file
@ -0,0 +1,221 @@
|
||||
dnl See whether we need a declaration for a function.
|
||||
dnl GCC_NEED_DECLARATION(FUNCTION [, EXTRA-HEADER-FILES])
|
||||
AC_DEFUN(GCC_NEED_DECLARATION,
|
||||
[AC_MSG_CHECKING([whether $1 must be declared])
|
||||
AC_CACHE_VAL(gcc_cv_decl_needed_$1,
|
||||
[AC_TRY_COMPILE([
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#else
|
||||
#ifdef HAVE_STRINGS_H
|
||||
#include <strings.h>
|
||||
#endif
|
||||
#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#ifndef HAVE_RINDEX
|
||||
#define rindex strrchr
|
||||
#endif
|
||||
#ifndef HAVE_INDEX
|
||||
#define index strchr
|
||||
#endif
|
||||
$2],
|
||||
[char *(*pfn) = (char *(*)) $1],
|
||||
eval "gcc_cv_decl_needed_$1=no", eval "gcc_cv_decl_needed_$1=yes")])
|
||||
if eval "test \"`echo '$gcc_cv_decl_needed_'$1`\" = yes"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
gcc_tr_decl=NEED_DECLARATION_`echo $1 | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
|
||||
AC_DEFINE_UNQUOTED($gcc_tr_decl)
|
||||
else
|
||||
AC_MSG_RESULT(no)
|
||||
fi
|
||||
])dnl
|
||||
|
||||
dnl Check multiple functions to see whether each needs a declaration.
|
||||
dnl GCC_NEED_DECLARATIONS(FUNCTION... [, EXTRA-HEADER-FILES])
|
||||
AC_DEFUN(GCC_NEED_DECLARATIONS,
|
||||
[for ac_func in $1
|
||||
do
|
||||
GCC_NEED_DECLARATION($ac_func, $2)
|
||||
done
|
||||
])
|
||||
|
||||
dnl Check if we have vprintf and possibly _doprnt.
|
||||
dnl Note autoconf checks for vprintf even though we care about vfprintf.
|
||||
AC_DEFUN(GCC_FUNC_VFPRINTF_DOPRNT,
|
||||
[AC_FUNC_VPRINTF
|
||||
vfprintf=
|
||||
doprint=
|
||||
if test $ac_cv_func_vprintf != yes ; then
|
||||
vfprintf=vfprintf.o
|
||||
if test $ac_cv_func__doprnt != yes ; then
|
||||
doprint=doprint.o
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(vfprintf)
|
||||
AC_SUBST(doprint)
|
||||
])
|
||||
|
||||
dnl See if the printf functions in libc support %p in format strings.
|
||||
AC_DEFUN(GCC_FUNC_PRINTF_PTR,
|
||||
[AC_CACHE_CHECK(whether the printf functions support %p,
|
||||
gcc_cv_func_printf_ptr,
|
||||
[AC_TRY_RUN([#include <stdio.h>
|
||||
|
||||
main()
|
||||
{
|
||||
char buf[64];
|
||||
char *p = buf, *q = NULL;
|
||||
sprintf(buf, "%p", p);
|
||||
sscanf(buf, "%p", &q);
|
||||
exit (p != q);
|
||||
}], gcc_cv_func_printf_ptr=yes, gcc_cv_func_printf_ptr=no,
|
||||
gcc_cv_func_printf_ptr=no)
|
||||
rm -f core core.* *.core])
|
||||
if test $gcc_cv_func_printf_ptr = yes ; then
|
||||
AC_DEFINE(HAVE_PRINTF_PTR)
|
||||
fi
|
||||
])
|
||||
|
||||
dnl See if symbolic links work and if not, try to substitute either hard links or simple copy.
|
||||
AC_DEFUN(GCC_PROG_LN_S,
|
||||
[AC_MSG_CHECKING(whether ln -s works)
|
||||
AC_CACHE_VAL(gcc_cv_prog_LN_S,
|
||||
[rm -f conftestdata_t
|
||||
echo >conftestdata_f
|
||||
if ln -s conftestdata_f conftestdata_t 2>/dev/null
|
||||
then
|
||||
gcc_cv_prog_LN_S="ln -s"
|
||||
else
|
||||
if ln conftestdata_f conftestdata_t 2>/dev/null
|
||||
then
|
||||
gcc_cv_prog_LN_S=ln
|
||||
else
|
||||
gcc_cv_prog_LN_S=cp
|
||||
fi
|
||||
fi
|
||||
rm -f conftestdata_f conftestdata_t
|
||||
])dnl
|
||||
LN_S="$gcc_cv_prog_LN_S"
|
||||
if test "$gcc_cv_prog_LN_S" = "ln -s"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
if test "$gcc_cv_prog_LN_S" = "ln"; then
|
||||
AC_MSG_RESULT([no, using ln])
|
||||
else
|
||||
AC_MSG_RESULT([no, and neither does ln, so using cp])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(LN_S)dnl
|
||||
])
|
||||
|
||||
dnl See if hard links work and if not, try to substitute either symbolic links or simple copy.
|
||||
AC_DEFUN(GCC_PROG_LN,
|
||||
[AC_MSG_CHECKING(whether ln works)
|
||||
AC_CACHE_VAL(gcc_cv_prog_LN,
|
||||
[rm -f conftestdata_t
|
||||
echo >conftestdata_f
|
||||
if ln conftestdata_f conftestdata_t 2>/dev/null
|
||||
then
|
||||
gcc_cv_prog_LN="ln"
|
||||
else
|
||||
if ln -s conftestdata_f conftestdata_t 2>/dev/null
|
||||
then
|
||||
gcc_cv_prog_LN="ln -s"
|
||||
else
|
||||
gcc_cv_prog_LN=cp
|
||||
fi
|
||||
fi
|
||||
rm -f conftestdata_f conftestdata_t
|
||||
])dnl
|
||||
LN="$gcc_cv_prog_LN"
|
||||
if test "$gcc_cv_prog_LN" = "ln"; then
|
||||
AC_MSG_RESULT(yes)
|
||||
else
|
||||
if test "$gcc_cv_prog_LN" = "ln -s"; then
|
||||
AC_MSG_RESULT([no, using ln -s])
|
||||
else
|
||||
AC_MSG_RESULT([no, and neither does ln -s, so using cp])
|
||||
fi
|
||||
fi
|
||||
AC_SUBST(LN)dnl
|
||||
])
|
||||
|
||||
dnl See whether the stage1 host compiler accepts the volatile keyword.
|
||||
AC_DEFUN(GCC_C_VOLATILE,
|
||||
[AC_CACHE_CHECK([for volatile], gcc_cv_c_volatile,
|
||||
[AC_TRY_COMPILE(, [volatile int foo;],
|
||||
gcc_cv_c_volatile=yes, gcc_cv_c_volatile=no)])
|
||||
if test $gcc_cv_c_volatile = yes ; then
|
||||
AC_DEFINE(HAVE_VOLATILE)
|
||||
fi
|
||||
])
|
||||
|
||||
AC_DEFUN(EGCS_PROG_INSTALL,
|
||||
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
|
||||
# Find a good install program. We prefer a C program (faster),
|
||||
# so one script is as good as another. But avoid the broken or
|
||||
# incompatible versions:
|
||||
# SysV /etc/install, /usr/sbin/install
|
||||
# SunOS /usr/etc/install
|
||||
# IRIX /sbin/install
|
||||
# AIX /bin/install
|
||||
# AFS /usr/afsws/bin/install, which mishandles nonexistent args
|
||||
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
|
||||
# ./install, which can be erroneously created by make from ./install.sh.
|
||||
AC_MSG_CHECKING(for a BSD compatible install)
|
||||
if test -z "$INSTALL"; then
|
||||
AC_CACHE_VAL(ac_cv_path_install,
|
||||
[ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS="${IFS}:"
|
||||
for ac_dir in $PATH; do
|
||||
# Account for people who put trailing slashes in PATH elements.
|
||||
case "$ac_dir/" in
|
||||
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
|
||||
*)
|
||||
# OSF1 and SCO ODT 3.0 have their own names for install.
|
||||
for ac_prog in ginstall scoinst install; do
|
||||
if test -f $ac_dir/$ac_prog; then
|
||||
if test $ac_prog = install &&
|
||||
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
|
||||
# AIX install. It has an incompatible calling convention.
|
||||
# OSF/1 installbsd also uses dspmsg, but is usable.
|
||||
:
|
||||
else
|
||||
ac_cv_path_install="$ac_dir/$ac_prog -c"
|
||||
break 2
|
||||
fi
|
||||
fi
|
||||
done
|
||||
;;
|
||||
esac
|
||||
done
|
||||
IFS="$ac_save_IFS"
|
||||
])dnl
|
||||
if test "${ac_cv_path_install+set}" = set; then
|
||||
INSTALL="$ac_cv_path_install"
|
||||
else
|
||||
# As a last resort, use the slow shell script. We don't cache a
|
||||
# path for INSTALL within a source directory, because that will
|
||||
# break other packages using the cache if that directory is
|
||||
# removed, or if the path is relative.
|
||||
INSTALL="$ac_install_sh"
|
||||
fi
|
||||
fi
|
||||
dnl We do special magic for INSTALL instead of AC_SUBST, to get
|
||||
dnl relative paths right.
|
||||
AC_MSG_RESULT($INSTALL)
|
||||
AC_SUBST(INSTALL)dnl
|
||||
|
||||
# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
|
||||
# It thinks the first close brace ends the variable substitution.
|
||||
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
|
||||
AC_SUBST(INSTALL_PROGRAM)dnl
|
||||
|
||||
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
|
||||
AC_SUBST(INSTALL_DATA)dnl
|
||||
])
|
1261
contrib/gcc/alias.c
Normal file
1261
contrib/gcc/alias.c
Normal file
File diff suppressed because it is too large
Load Diff
@ -25,6 +25,13 @@
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_STRING_H
|
||||
#include <string.h>
|
||||
#endif
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef emacs
|
||||
#include "blockinput.h"
|
||||
#endif
|
||||
@ -66,7 +73,9 @@ typedef void *pointer;
|
||||
typedef char *pointer;
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
/* Different portions of Emacs need to call different versions of
|
||||
malloc. The Emacs executable needs alloca to call xmalloc, because
|
||||
@ -171,7 +180,7 @@ alloca (size)
|
||||
#endif
|
||||
|
||||
/* Reclaim garbage, defined as all alloca'd storage that
|
||||
was allocated from deeper in the stack than currently. */
|
||||
was allocated from deeper in the stack than currently. */
|
||||
|
||||
{
|
||||
register header *hp; /* Traverses linked list. */
|
||||
@ -209,6 +218,9 @@ alloca (size)
|
||||
register pointer new = malloc (sizeof (header) + size);
|
||||
/* Address of header. */
|
||||
|
||||
if (new == 0)
|
||||
abort();
|
||||
|
||||
((header *) new)->h.next = last_alloca_header;
|
||||
((header *) new)->h.deep = depth;
|
||||
|
||||
@ -338,7 +350,7 @@ struct stk_trailer
|
||||
|
||||
#ifdef CRAY2
|
||||
/* Determine a "stack measure" for an arbitrary ADDRESS.
|
||||
I doubt that "lint" will like this much. */
|
||||
I doubt that "lint" will like this much. */
|
||||
|
||||
static long
|
||||
i00afunc (long *address)
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Define control and data flow tables, and regsets.
|
||||
Copyright (C) 1987 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@ -19,26 +19,82 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
/* Number of bits in each actual element of a regset. */
|
||||
#include "bitmap.h"
|
||||
|
||||
#define REGSET_ELT_BITS HOST_BITS_PER_WIDE_INT
|
||||
typedef bitmap regset; /* Head of register set linked list. */
|
||||
|
||||
/* Type to use for a regset element. Note that lots of code assumes
|
||||
that the initial part of a regset that contains information on the
|
||||
hard registers is the same format as a HARD_REG_SET. */
|
||||
/* Clear a register set by freeing up the linked list. */
|
||||
#define CLEAR_REG_SET(HEAD) bitmap_clear (HEAD)
|
||||
|
||||
#define REGSET_ELT_TYPE unsigned HOST_WIDE_INT
|
||||
/* Copy a register set to another register set. */
|
||||
#define COPY_REG_SET(TO, FROM) bitmap_copy (TO, FROM)
|
||||
|
||||
/* Define the type for a pointer to a set with a bit for each
|
||||
(hard or pseudo) register. */
|
||||
/* `and' a register set with a second register set. */
|
||||
#define AND_REG_SET(TO, FROM) bitmap_operation (TO, TO, FROM, BITMAP_AND)
|
||||
|
||||
typedef REGSET_ELT_TYPE *regset;
|
||||
/* `and' the complement of a register set with a register set. */
|
||||
#define AND_COMPL_REG_SET(TO, FROM) \
|
||||
bitmap_operation (TO, TO, FROM, BITMAP_AND_COMPL)
|
||||
|
||||
/* Size of a regset for the current function,
|
||||
in (1) bytes and (2) elements. */
|
||||
/* Inclusive or a register set with a second register set. */
|
||||
#define IOR_REG_SET(TO, FROM) bitmap_operation (TO, TO, FROM, BITMAP_IOR)
|
||||
|
||||
extern int regset_bytes;
|
||||
extern int regset_size;
|
||||
/* Or into TO the register set FROM1 `and'ed with the complement of FROM2. */
|
||||
#define IOR_AND_COMPL_REG_SET(TO, FROM1, FROM2) \
|
||||
bitmap_ior_and_compl (TO, FROM1, FROM2)
|
||||
|
||||
/* Clear a single register in a register set. */
|
||||
#define CLEAR_REGNO_REG_SET(HEAD, REG) bitmap_clear_bit (HEAD, REG)
|
||||
|
||||
/* Set a single register in a register set. */
|
||||
#define SET_REGNO_REG_SET(HEAD, REG) bitmap_set_bit (HEAD, REG)
|
||||
|
||||
/* Return true if a register is set in a register set. */
|
||||
#define REGNO_REG_SET_P(TO, REG) bitmap_bit_p (TO, REG)
|
||||
|
||||
/* Copy the hard registers in a register set to the hard register set. */
|
||||
#define REG_SET_TO_HARD_REG_SET(TO, FROM) \
|
||||
do { \
|
||||
int i_; \
|
||||
CLEAR_HARD_REG_SET (TO); \
|
||||
for (i_ = 0; i_ < FIRST_PSEUDO_REGISTER; i_++) \
|
||||
if (REGNO_REG_SET_P (FROM, i_)) \
|
||||
SET_HARD_REG_BIT (TO, i_); \
|
||||
} while (0)
|
||||
|
||||
/* Loop over all registers in REGSET, starting with MIN, setting REGNUM to the
|
||||
register number and executing CODE for all registers that are set. */
|
||||
#define EXECUTE_IF_SET_IN_REG_SET(REGSET, MIN, REGNUM, CODE) \
|
||||
EXECUTE_IF_SET_IN_BITMAP (REGSET, MIN, REGNUM, CODE)
|
||||
|
||||
/* Loop over all registers in REGSET1 and REGSET2, starting with MIN, setting
|
||||
REGNUM to the register number and executing CODE for all registers that are
|
||||
set in the first regset and not set in the second. */
|
||||
#define EXECUTE_IF_AND_COMPL_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, CODE) \
|
||||
EXECUTE_IF_AND_COMPL_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, CODE)
|
||||
|
||||
/* Loop over all registers in REGSET1 and REGSET2, starting with MIN, setting
|
||||
REGNUM to the register number and executing CODE for all registers that are
|
||||
set in both regsets. */
|
||||
#define EXECUTE_IF_AND_IN_REG_SET(REGSET1, REGSET2, MIN, REGNUM, CODE) \
|
||||
EXECUTE_IF_AND_IN_BITMAP (REGSET1, REGSET2, MIN, REGNUM, CODE)
|
||||
|
||||
/* Allocate a register set with oballoc. */
|
||||
#define OBSTACK_ALLOC_REG_SET(OBSTACK) BITMAP_OBSTACK_ALLOC (OBSTACK)
|
||||
|
||||
/* Allocate a register set with alloca. */
|
||||
#define ALLOCA_REG_SET() BITMAP_ALLOCA ()
|
||||
|
||||
/* Do any cleanup needed on a regset when it is no longer used. */
|
||||
#define FREE_REG_SET(REGSET) BITMAP_FREE(REGSET)
|
||||
|
||||
/* Do any one-time initializations needed for regsets. */
|
||||
#define INIT_ONCE_REG_SET() BITMAP_INIT_ONCE ()
|
||||
|
||||
/* Grow any tables needed when the number of registers is calculated
|
||||
or extended. For the linked list allocation, nothing needs to
|
||||
be done, other than zero the statistics on the first allocation. */
|
||||
#define MAX_REGNO_REG_SET(NUM_REGS, NEW_P, RENUMBER_P)
|
||||
|
||||
/* Number of basic blocks in the current function. */
|
||||
|
||||
@ -52,11 +108,20 @@ extern rtx *basic_block_head;
|
||||
|
||||
extern rtx *basic_block_end;
|
||||
|
||||
/* Index by basic block number, determine whether the block can be reached
|
||||
through a computed jump. */
|
||||
|
||||
extern char *basic_block_computed_jump_target;
|
||||
|
||||
/* Index by basic block number, get address of regset
|
||||
describing the registers live at the start of that block. */
|
||||
|
||||
extern regset *basic_block_live_at_start;
|
||||
|
||||
/* What registers are live at the setjmp call. */
|
||||
|
||||
extern regset regs_live_at_setjmp;
|
||||
|
||||
/* Indexed by n, gives number of basic block that (REG n) is used in.
|
||||
If the value is REG_BLOCK_GLOBAL (-2),
|
||||
it means (REG n) is used in more than one basic block.
|
||||
@ -66,4 +131,136 @@ extern regset *basic_block_live_at_start;
|
||||
|
||||
#define REG_BLOCK_UNKNOWN -1
|
||||
#define REG_BLOCK_GLOBAL -2
|
||||
extern int *reg_basic_block;
|
||||
|
||||
#define REG_BASIC_BLOCK(N) (VARRAY_REG (reg_n_info, N)->basic_block)
|
||||
|
||||
/* List of integers.
|
||||
These are used for storing things like predecessors, etc.
|
||||
|
||||
This scheme isn't very space efficient, especially on 64 bit machines.
|
||||
The interface is designed so that the implementation can be replaced with
|
||||
something more efficient if desirable. */
|
||||
|
||||
typedef struct int_list {
|
||||
struct int_list *next;
|
||||
int val;
|
||||
} int_list;
|
||||
|
||||
typedef int_list *int_list_ptr;
|
||||
|
||||
/* Integer list elements are allocated in blocks to reduce the frequency
|
||||
of calls to malloc and to reduce the associated space overhead. */
|
||||
|
||||
typedef struct int_list_block {
|
||||
struct int_list_block *next;
|
||||
int nodes_left;
|
||||
#define INT_LIST_NODES_IN_BLK 500
|
||||
struct int_list nodes[INT_LIST_NODES_IN_BLK];
|
||||
} int_list_block;
|
||||
|
||||
/* Given a pointer to the list, return pointer to first element. */
|
||||
#define INT_LIST_FIRST(il) (il)
|
||||
|
||||
/* Given a pointer to a list element, return pointer to next element. */
|
||||
#define INT_LIST_NEXT(p) ((p)->next)
|
||||
|
||||
/* Return non-zero if P points to the end of the list. */
|
||||
#define INT_LIST_END(p) ((p) == NULL)
|
||||
|
||||
/* Return element pointed to by P. */
|
||||
#define INT_LIST_VAL(p) ((p)->val)
|
||||
|
||||
#define INT_LIST_SET_VAL(p, new_val) ((p)->val = (new_val))
|
||||
|
||||
extern void free_int_list PROTO ((int_list_block **));
|
||||
|
||||
/* Stuff for recording basic block info. */
|
||||
|
||||
#define BLOCK_HEAD(B) basic_block_head[(B)]
|
||||
#define BLOCK_END(B) basic_block_end[(B)]
|
||||
|
||||
/* Special block numbers [markers] for entry and exit. */
|
||||
#define ENTRY_BLOCK (-1)
|
||||
#define EXIT_BLOCK (-2)
|
||||
|
||||
/* from flow.c */
|
||||
extern void free_regset_vector PROTO ((regset *, int nelts));
|
||||
extern int *uid_block_number;
|
||||
#define BLOCK_NUM(INSN) uid_block_number[INSN_UID (INSN)]
|
||||
|
||||
extern void compute_preds_succs PROTO ((int_list_ptr *, int_list_ptr *,
|
||||
int *, int *));
|
||||
extern void dump_bb_data PROTO ((FILE *, int_list_ptr *, int_list_ptr *));
|
||||
extern void free_bb_mem PROTO ((void));
|
||||
extern void free_basic_block_vars PROTO ((int));
|
||||
|
||||
|
||||
/* Simple bitmaps.
|
||||
It's not clear yet whether using bitmap.[ch] will be a win.
|
||||
It should be straightforward to convert so for now we keep things simple
|
||||
while more important issues are dealt with. */
|
||||
|
||||
#define SBITMAP_ELT_BITS HOST_BITS_PER_WIDE_INT
|
||||
#define SBITMAP_ELT_TYPE unsigned HOST_WIDE_INT
|
||||
|
||||
typedef struct simple_bitmap_def {
|
||||
/* Number of bits. */
|
||||
int n_bits;
|
||||
/* Size in elements. */
|
||||
int size;
|
||||
/* Size in bytes. */
|
||||
int bytes;
|
||||
/* The elements. */
|
||||
SBITMAP_ELT_TYPE elms[1];
|
||||
} *sbitmap;
|
||||
|
||||
typedef SBITMAP_ELT_TYPE *sbitmap_ptr;
|
||||
|
||||
/* Return the set size needed for N elements. */
|
||||
#define SBITMAP_SET_SIZE(n) (((n) + SBITMAP_ELT_BITS - 1) / SBITMAP_ELT_BITS)
|
||||
|
||||
/* set bit number bitno in the bitmap */
|
||||
#define SET_BIT(bitmap, bitno) \
|
||||
do { \
|
||||
(bitmap)->elms [(bitno) / SBITMAP_ELT_BITS] |= (SBITMAP_ELT_TYPE) 1 << (bitno) % SBITMAP_ELT_BITS; \
|
||||
} while (0)
|
||||
|
||||
/* test if bit number bitno in the bitmap is set */
|
||||
#define TEST_BIT(bitmap, bitno) \
|
||||
((bitmap)->elms [(bitno) / SBITMAP_ELT_BITS] & ((SBITMAP_ELT_TYPE) 1 << (bitno) % SBITMAP_ELT_BITS))
|
||||
|
||||
/* reset bit number bitno in the bitmap */
|
||||
#define RESET_BIT(bitmap, bitno) \
|
||||
do { \
|
||||
(bitmap)->elms [(bitno) / SBITMAP_ELT_BITS] &= ~((SBITMAP_ELT_TYPE) 1 << (bitno) % SBITMAP_ELT_BITS); \
|
||||
} while (0)
|
||||
|
||||
extern void dump_sbitmap PROTO ((FILE *, sbitmap));
|
||||
extern void dump_sbitmap_vector PROTO ((FILE *, char *, char *,
|
||||
sbitmap *, int));
|
||||
extern sbitmap sbitmap_alloc PROTO ((int));
|
||||
extern sbitmap *sbitmap_vector_alloc PROTO ((int, int));
|
||||
extern void sbitmap_copy PROTO ((sbitmap, sbitmap));
|
||||
extern void sbitmap_zero PROTO ((sbitmap));
|
||||
extern void sbitmap_ones PROTO ((sbitmap));
|
||||
extern void sbitmap_vector_zero PROTO ((sbitmap *, int));
|
||||
extern void sbitmap_vector_ones PROTO ((sbitmap *, int));
|
||||
extern int sbitmap_union_of_diff PROTO ((sbitmap, sbitmap, sbitmap, sbitmap));
|
||||
extern void sbitmap_difference PROTO ((sbitmap, sbitmap, sbitmap));
|
||||
extern void sbitmap_not PROTO ((sbitmap, sbitmap));
|
||||
extern int sbitmap_a_or_b_and_c PROTO ((sbitmap, sbitmap, sbitmap, sbitmap));
|
||||
extern int sbitmap_a_and_b_or_c PROTO ((sbitmap, sbitmap, sbitmap, sbitmap));
|
||||
extern int sbitmap_a_and_b PROTO ((sbitmap, sbitmap, sbitmap));
|
||||
extern int sbitmap_a_or_b PROTO ((sbitmap, sbitmap, sbitmap));
|
||||
extern void sbitmap_intersect_of_predsucc PROTO ((sbitmap, sbitmap *,
|
||||
int, int_list_ptr *));
|
||||
extern void sbitmap_intersect_of_predecessors PROTO ((sbitmap, sbitmap *, int,
|
||||
int_list_ptr *));
|
||||
extern void sbitmap_intersect_of_successors PROTO ((sbitmap, sbitmap *, int,
|
||||
int_list_ptr *));
|
||||
extern void sbitmap_union_of_predecessors PROTO ((sbitmap, sbitmap *, int,
|
||||
int_list_ptr *));
|
||||
extern void sbitmap_union_of_successors PROTO ((sbitmap, sbitmap *, int,
|
||||
int_list_ptr *));
|
||||
extern void compute_dominators PROTO ((sbitmap *, sbitmap *,
|
||||
int_list_ptr *, int_list_ptr *));
|
||||
|
642
contrib/gcc/bitmap.c
Normal file
642
contrib/gcc/bitmap.c
Normal file
@ -0,0 +1,642 @@
|
||||
/* Functions to support general ended bitmaps.
|
||||
Copyright (C) 1997, 1998 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 "flags.h"
|
||||
#include "obstack.h"
|
||||
#include "regs.h"
|
||||
#include "basic-block.h"
|
||||
|
||||
/* Obstack to allocate bitmap elements from. */
|
||||
static struct obstack bitmap_obstack;
|
||||
static int bitmap_obstack_init = FALSE;
|
||||
|
||||
|
||||
#ifndef INLINE
|
||||
#ifndef __GNUC__
|
||||
#define INLINE
|
||||
#else
|
||||
#define INLINE __inline__
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Global data */
|
||||
bitmap_element bitmap_zero; /* An element of all zero bits. */
|
||||
bitmap_element *bitmap_free; /* Freelist of bitmap elements. */
|
||||
|
||||
static void bitmap_element_free PROTO((bitmap, bitmap_element *));
|
||||
static bitmap_element *bitmap_element_allocate PROTO((void));
|
||||
static int bitmap_element_zerop PROTO((bitmap_element *));
|
||||
static void bitmap_element_link PROTO((bitmap, bitmap_element *));
|
||||
static bitmap_element *bitmap_find_bit PROTO((bitmap, unsigned int));
|
||||
|
||||
/* Free a bitmap element */
|
||||
|
||||
static INLINE void
|
||||
bitmap_element_free (head, elt)
|
||||
bitmap head;
|
||||
bitmap_element *elt;
|
||||
{
|
||||
bitmap_element *next = elt->next;
|
||||
bitmap_element *prev = elt->prev;
|
||||
|
||||
if (prev)
|
||||
prev->next = next;
|
||||
|
||||
if (next)
|
||||
next->prev = prev;
|
||||
|
||||
if (head->first == elt)
|
||||
head->first = next;
|
||||
|
||||
/* Since the first thing we try is to insert before current,
|
||||
make current the next entry in preference to the previous. */
|
||||
if (head->current == elt)
|
||||
head->current = next != 0 ? next : prev;
|
||||
|
||||
elt->next = bitmap_free;
|
||||
bitmap_free = elt;
|
||||
}
|
||||
|
||||
/* Allocate a bitmap element. The bits are cleared, but nothing else is. */
|
||||
|
||||
static INLINE bitmap_element *
|
||||
bitmap_element_allocate ()
|
||||
{
|
||||
bitmap_element *element;
|
||||
#if BITMAP_ELEMENT_WORDS != 2
|
||||
int i;
|
||||
#endif
|
||||
|
||||
if (bitmap_free != 0)
|
||||
{
|
||||
element = bitmap_free;
|
||||
bitmap_free = element->next;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* We can't use gcc_obstack_init to initialize the obstack since
|
||||
print-rtl.c now calls bitmap functions, and bitmap is linked
|
||||
into the gen* functions. */
|
||||
if (!bitmap_obstack_init)
|
||||
{
|
||||
bitmap_obstack_init = TRUE;
|
||||
|
||||
/* Let particular systems override the size of a chunk. */
|
||||
#ifndef OBSTACK_CHUNK_SIZE
|
||||
#define OBSTACK_CHUNK_SIZE 0
|
||||
#endif
|
||||
/* Let them override the alloc and free routines too. */
|
||||
#ifndef OBSTACK_CHUNK_ALLOC
|
||||
#define OBSTACK_CHUNK_ALLOC xmalloc
|
||||
#endif
|
||||
#ifndef OBSTACK_CHUNK_FREE
|
||||
#define OBSTACK_CHUNK_FREE free
|
||||
#endif
|
||||
|
||||
#if !defined(__GNUC__) || (__GNUC__ < 2)
|
||||
#define __alignof__(type) 0
|
||||
#endif
|
||||
|
||||
obstack_specify_allocation (&bitmap_obstack, OBSTACK_CHUNK_SIZE,
|
||||
__alignof__ (bitmap_element),
|
||||
(void *(*) ()) OBSTACK_CHUNK_ALLOC,
|
||||
(void (*) ()) OBSTACK_CHUNK_FREE);
|
||||
}
|
||||
|
||||
element = (bitmap_element *) obstack_alloc (&bitmap_obstack,
|
||||
sizeof (bitmap_element));
|
||||
}
|
||||
|
||||
#if BITMAP_ELEMENT_WORDS == 2
|
||||
element->bits[0] = element->bits[1] = 0;
|
||||
#else
|
||||
for (i = 0; i < BITMAP_ELEMENT_WORDS; i++)
|
||||
element->bits[i] = 0;
|
||||
#endif
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
/* Return nonzero if all bits in an element are zero. */
|
||||
|
||||
static INLINE int
|
||||
bitmap_element_zerop (element)
|
||||
bitmap_element *element;
|
||||
{
|
||||
#if BITMAP_ELEMENT_WORDS == 2
|
||||
return (element->bits[0] | element->bits[1]) == 0;
|
||||
#else
|
||||
int i;
|
||||
|
||||
for (i = 0; i < BITMAP_ELEMENT_WORDS; i++)
|
||||
if (element->bits[i] != 0)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Link the bitmap element into the current bitmap linked list. */
|
||||
|
||||
static INLINE void
|
||||
bitmap_element_link (head, element)
|
||||
bitmap head;
|
||||
bitmap_element *element;
|
||||
{
|
||||
unsigned int indx = element->indx;
|
||||
bitmap_element *ptr;
|
||||
|
||||
/* If this is the first and only element, set it in. */
|
||||
if (head->first == 0)
|
||||
{
|
||||
element->next = element->prev = 0;
|
||||
head->first = element;
|
||||
}
|
||||
|
||||
/* If this index is less than that of the current element, it goes someplace
|
||||
before the current element. */
|
||||
else if (indx < head->indx)
|
||||
{
|
||||
for (ptr = head->current;
|
||||
ptr->prev != 0 && ptr->prev->indx > indx;
|
||||
ptr = ptr->prev)
|
||||
;
|
||||
|
||||
if (ptr->prev)
|
||||
ptr->prev->next = element;
|
||||
else
|
||||
head->first = element;
|
||||
|
||||
element->prev = ptr->prev;
|
||||
element->next = ptr;
|
||||
ptr->prev = element;
|
||||
}
|
||||
|
||||
/* Otherwise, it must go someplace after the current element. */
|
||||
else
|
||||
{
|
||||
for (ptr = head->current;
|
||||
ptr->next != 0 && ptr->next->indx < indx;
|
||||
ptr = ptr->next)
|
||||
;
|
||||
|
||||
if (ptr->next)
|
||||
ptr->next->prev = element;
|
||||
|
||||
element->next = ptr->next;
|
||||
element->prev = ptr;
|
||||
ptr->next = element;
|
||||
}
|
||||
|
||||
/* Set up so this is the first element searched. */
|
||||
head->current = element;
|
||||
head->indx = indx;
|
||||
}
|
||||
|
||||
/* Clear a bitmap by freeing the linked list. */
|
||||
|
||||
INLINE void
|
||||
bitmap_clear (head)
|
||||
bitmap head;
|
||||
{
|
||||
bitmap_element *element, *next;
|
||||
|
||||
for (element = head->first; element != 0; element = next)
|
||||
{
|
||||
next = element->next;
|
||||
element->next = bitmap_free;
|
||||
bitmap_free = element;
|
||||
}
|
||||
|
||||
head->first = head->current = 0;
|
||||
}
|
||||
|
||||
/* Copy a bitmap to another bitmap */
|
||||
|
||||
void
|
||||
bitmap_copy (to, from)
|
||||
bitmap to;
|
||||
bitmap from;
|
||||
{
|
||||
bitmap_element *from_ptr, *to_ptr = 0;
|
||||
#if BITMAP_ELEMENT_WORDS != 2
|
||||
int i;
|
||||
#endif
|
||||
|
||||
bitmap_clear (to);
|
||||
|
||||
/* Copy elements in forward direction one at a time */
|
||||
for (from_ptr = from->first; from_ptr; from_ptr = from_ptr->next)
|
||||
{
|
||||
bitmap_element *to_elt = bitmap_element_allocate ();
|
||||
|
||||
to_elt->indx = from_ptr->indx;
|
||||
|
||||
#if BITMAP_ELEMENT_WORDS == 2
|
||||
to_elt->bits[0] = from_ptr->bits[0];
|
||||
to_elt->bits[1] = from_ptr->bits[1];
|
||||
#else
|
||||
for (i = 0; i < BITMAP_ELEMENT_WORDS; i++)
|
||||
to_elt->bits[i] = from_ptr->bits[i];
|
||||
#endif
|
||||
|
||||
/* Here we have a special case of bitmap_element_link, for the case
|
||||
where we know the links are being entered in sequence. */
|
||||
if (to_ptr == 0)
|
||||
{
|
||||
to->first = to->current = to_elt;
|
||||
to->indx = from_ptr->indx;
|
||||
to_elt->next = to_elt->prev = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
to_elt->prev = to_ptr;
|
||||
to_elt->next = 0;
|
||||
to_ptr->next = to_elt;
|
||||
}
|
||||
|
||||
to_ptr = to_elt;
|
||||
}
|
||||
}
|
||||
|
||||
/* Find a bitmap element that would hold a bitmap's bit.
|
||||
Update the `current' field even if we can't find an element that
|
||||
would hold the bitmap's bit to make eventual allocation
|
||||
faster. */
|
||||
|
||||
static INLINE bitmap_element *
|
||||
bitmap_find_bit (head, bit)
|
||||
bitmap head;
|
||||
unsigned int bit;
|
||||
{
|
||||
bitmap_element *element;
|
||||
unsigned HOST_WIDE_INT indx = bit / BITMAP_ELEMENT_ALL_BITS;
|
||||
|
||||
if (head->current == 0)
|
||||
return 0;
|
||||
|
||||
if (head->indx > indx)
|
||||
for (element = head->current;
|
||||
element->prev != 0 && element->indx > indx;
|
||||
element = element->prev)
|
||||
;
|
||||
|
||||
else
|
||||
for (element = head->current;
|
||||
element->next != 0 && element->indx < indx;
|
||||
element = element->next)
|
||||
;
|
||||
|
||||
/* `element' is the nearest to the one we want. If it's not the one we
|
||||
want, the one we want doesn't exist. */
|
||||
head->current = element;
|
||||
head->indx = element->indx;
|
||||
if (element != 0 && element->indx != indx)
|
||||
element = 0;
|
||||
|
||||
return element;
|
||||
}
|
||||
|
||||
/* Clear a single bit in a bitmap. */
|
||||
|
||||
void
|
||||
bitmap_clear_bit (head, bit)
|
||||
bitmap head;
|
||||
int bit;
|
||||
{
|
||||
bitmap_element *ptr = bitmap_find_bit (head, bit);
|
||||
|
||||
if (ptr != 0)
|
||||
{
|
||||
unsigned bit_num = bit % (unsigned) HOST_BITS_PER_WIDE_INT;
|
||||
unsigned word_num = ((bit / (unsigned) HOST_BITS_PER_WIDE_INT)
|
||||
% BITMAP_ELEMENT_WORDS);
|
||||
ptr->bits[word_num] &= ~ (((unsigned HOST_WIDE_INT) 1) << bit_num);
|
||||
|
||||
/* If we cleared the entire word, free up the element */
|
||||
if (bitmap_element_zerop (ptr))
|
||||
bitmap_element_free (head, ptr);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* Set a single bit in a bitmap. */
|
||||
|
||||
void
|
||||
bitmap_set_bit (head, bit)
|
||||
bitmap head;
|
||||
int bit;
|
||||
{
|
||||
bitmap_element *ptr = bitmap_find_bit (head, bit);
|
||||
unsigned word_num
|
||||
= ((bit / (unsigned) HOST_BITS_PER_WIDE_INT) % BITMAP_ELEMENT_WORDS);
|
||||
unsigned bit_num = bit % (unsigned) HOST_BITS_PER_WIDE_INT;
|
||||
unsigned HOST_WIDE_INT bit_val = ((unsigned HOST_WIDE_INT) 1) << bit_num;
|
||||
|
||||
if (ptr == 0)
|
||||
{
|
||||
ptr = bitmap_element_allocate ();
|
||||
ptr->indx = bit / BITMAP_ELEMENT_ALL_BITS;
|
||||
ptr->bits[word_num] = bit_val;
|
||||
bitmap_element_link (head, ptr);
|
||||
}
|
||||
else
|
||||
ptr->bits[word_num] |= bit_val;
|
||||
}
|
||||
|
||||
/* Return whether a bit is set within a bitmap. */
|
||||
|
||||
int
|
||||
bitmap_bit_p (head, bit)
|
||||
bitmap head;
|
||||
int bit;
|
||||
{
|
||||
bitmap_element *ptr;
|
||||
unsigned bit_num;
|
||||
unsigned word_num;
|
||||
|
||||
ptr = bitmap_find_bit (head, bit);
|
||||
if (ptr == 0)
|
||||
return 0;
|
||||
|
||||
bit_num = bit % (unsigned) HOST_BITS_PER_WIDE_INT;
|
||||
word_num
|
||||
= ((bit / (unsigned) HOST_BITS_PER_WIDE_INT) % BITMAP_ELEMENT_WORDS);
|
||||
|
||||
return
|
||||
(ptr->bits[word_num] & (((unsigned HOST_WIDE_INT) 1) << bit_num)) != 0;
|
||||
}
|
||||
|
||||
/* Store in bitmap TO the result of combining bitmap FROM1 and
|
||||
FROM2 using a specific bit manipulation. */
|
||||
|
||||
void
|
||||
bitmap_operation (to, from1, from2, operation)
|
||||
bitmap to;
|
||||
bitmap from1;
|
||||
bitmap from2;
|
||||
enum bitmap_bits operation;
|
||||
{
|
||||
bitmap_element *delete_list = 0;
|
||||
bitmap_element *from1_ptr = from1->first;
|
||||
bitmap_element *from2_ptr = from2->first;
|
||||
unsigned int indx1
|
||||
= (from1_ptr) ? from1_ptr->indx : ~ (unsigned HOST_WIDE_INT) 0;
|
||||
unsigned int indx2
|
||||
= (from2_ptr) ? from2_ptr->indx : ~ (unsigned HOST_WIDE_INT) 0;
|
||||
bitmap_element *to_ptr = 0;
|
||||
bitmap_element *from1_tmp;
|
||||
bitmap_element *from2_tmp;
|
||||
unsigned int indx;
|
||||
#if BITMAP_ELEMENT_WORDS != 2
|
||||
int i;
|
||||
#endif
|
||||
|
||||
/* To simplify things, always create a new list. If the old list was one
|
||||
of the inputs, free it later. Otherwise, free it now. */
|
||||
if (to == from1 || to == from2)
|
||||
{
|
||||
delete_list = to->first;
|
||||
to->first = to->current = 0;
|
||||
}
|
||||
else
|
||||
bitmap_clear (to);
|
||||
|
||||
while (from1_ptr != 0 || from2_ptr != 0)
|
||||
{
|
||||
/* Figure out whether we need to substitute zero elements for
|
||||
missing links. */
|
||||
if (indx1 == indx2)
|
||||
{
|
||||
indx = indx1;
|
||||
from1_tmp = from1_ptr;
|
||||
from2_tmp = from2_ptr;
|
||||
from1_ptr = from1_ptr->next;
|
||||
indx1 = (from1_ptr) ? from1_ptr->indx : ~ (unsigned HOST_WIDE_INT) 0;
|
||||
from2_ptr = from2_ptr->next;
|
||||
indx2 = (from2_ptr) ? from2_ptr->indx : ~ (unsigned HOST_WIDE_INT) 0;
|
||||
}
|
||||
else if (indx1 < indx2)
|
||||
{
|
||||
indx = indx1;
|
||||
from1_tmp = from1_ptr;
|
||||
from2_tmp = &bitmap_zero;
|
||||
from1_ptr = from1_ptr->next;
|
||||
indx1 = (from1_ptr) ? from1_ptr->indx : ~ (unsigned HOST_WIDE_INT) 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
indx = indx2;
|
||||
from1_tmp = &bitmap_zero;
|
||||
from2_tmp = from2_ptr;
|
||||
from2_ptr = from2_ptr->next;
|
||||
indx2 = (from2_ptr) ? from2_ptr->indx : ~ (unsigned HOST_WIDE_INT) 0;
|
||||
}
|
||||
|
||||
if (to_ptr == 0)
|
||||
to_ptr = bitmap_element_allocate ();
|
||||
|
||||
/* Do the operation, and if any bits are set, link it into the
|
||||
linked list. */
|
||||
switch (operation)
|
||||
{
|
||||
default:
|
||||
abort ();
|
||||
|
||||
case BITMAP_AND:
|
||||
#if BITMAP_ELEMENT_WORDS == 2
|
||||
to_ptr->bits[0] = from1_tmp->bits[0] & from2_tmp->bits[0];
|
||||
to_ptr->bits[1] = from1_tmp->bits[1] & from2_tmp->bits[1];
|
||||
#else
|
||||
for (i = BITMAP_ELEMENT_WORDS - 1; i >= 0; i--)
|
||||
to_ptr->bits[i] = from1_tmp->bits[i] & from2_tmp->bits[i];
|
||||
#endif
|
||||
break;
|
||||
|
||||
case BITMAP_AND_COMPL:
|
||||
#if BITMAP_ELEMENT_WORDS == 2
|
||||
to_ptr->bits[0] = from1_tmp->bits[0] & ~ from2_tmp->bits[0];
|
||||
to_ptr->bits[1] = from1_tmp->bits[1] & ~ from2_tmp->bits[1];
|
||||
#else
|
||||
for (i = BITMAP_ELEMENT_WORDS - 1; i >= 0; i--)
|
||||
to_ptr->bits[i] = from1_tmp->bits[i] & ~ from2_tmp->bits[i];
|
||||
#endif
|
||||
break;
|
||||
|
||||
case BITMAP_IOR:
|
||||
#if BITMAP_ELEMENT_WORDS == 2
|
||||
to_ptr->bits[0] = from1_tmp->bits[0] | from2_tmp->bits[0];
|
||||
to_ptr->bits[1] = from1_tmp->bits[1] | from2_tmp->bits[1];
|
||||
#else
|
||||
for (i = BITMAP_ELEMENT_WORDS - 1; i >= 0; i--)
|
||||
to_ptr->bits[i] = from1_tmp->bits[i] | from2_tmp->bits[i];
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
if (! bitmap_element_zerop (to_ptr))
|
||||
{
|
||||
to_ptr->indx = indx;
|
||||
bitmap_element_link (to, to_ptr);
|
||||
to_ptr = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/* If we have an unallocated element due to the last element being 0,
|
||||
release it back to the free pool. Don't bother calling
|
||||
bitmap_element_free since it was never linked into a bitmap. */
|
||||
if (to_ptr != 0)
|
||||
{
|
||||
to_ptr->next = bitmap_free;
|
||||
bitmap_free = to_ptr;
|
||||
}
|
||||
|
||||
/* If the output bitmap was one of the inputs, free up its
|
||||
elements now that we're done. */
|
||||
for (; delete_list != 0; delete_list = to_ptr)
|
||||
{
|
||||
to_ptr = delete_list->next;
|
||||
delete_list->next = bitmap_free;
|
||||
bitmap_free = delete_list;
|
||||
}
|
||||
}
|
||||
|
||||
/* Or into bitmap TO bitmap FROM1 and'ed with the complement of
|
||||
bitmap FROM2. */
|
||||
|
||||
void
|
||||
bitmap_ior_and_compl (to, from1, from2)
|
||||
bitmap to;
|
||||
bitmap from1;
|
||||
bitmap from2;
|
||||
{
|
||||
bitmap_head tmp;
|
||||
|
||||
tmp.first = tmp.current = 0;
|
||||
|
||||
bitmap_operation (&tmp, from1, from2, BITMAP_AND_COMPL);
|
||||
bitmap_operation (to, to, &tmp, BITMAP_IOR);
|
||||
bitmap_clear (&tmp);
|
||||
}
|
||||
|
||||
/* Initialize a bitmap header. */
|
||||
|
||||
bitmap
|
||||
bitmap_initialize (head)
|
||||
bitmap head;
|
||||
{
|
||||
head->first = head->current = 0;
|
||||
|
||||
return head;
|
||||
}
|
||||
|
||||
/* Debugging function to print out the contents of a bitmap. */
|
||||
|
||||
void
|
||||
bitmap_debug_file (file, head)
|
||||
FILE *file;
|
||||
bitmap head;
|
||||
{
|
||||
bitmap_element *ptr;
|
||||
|
||||
fprintf (file, "\nfirst = ");
|
||||
fprintf (file, HOST_PTR_PRINTF, head->first);
|
||||
fprintf (file, " current = ");
|
||||
fprintf (file, HOST_PTR_PRINTF, head->current);
|
||||
fprintf (file, " indx = %u\n", head->indx);
|
||||
|
||||
for (ptr = head->first; ptr; ptr = ptr->next)
|
||||
{
|
||||
int i, j, col = 26;
|
||||
|
||||
fprintf (file, "\t");
|
||||
fprintf (file, HOST_PTR_PRINTF, ptr);
|
||||
fprintf (file, " next = ");
|
||||
fprintf (file, HOST_PTR_PRINTF, ptr->next);
|
||||
fprintf (file, " prev = ");
|
||||
fprintf (file, HOST_PTR_PRINTF, ptr->prev);
|
||||
fprintf (file, " indx = %u\n\t\tbits = {", ptr->indx);
|
||||
|
||||
for (i = 0; i < BITMAP_ELEMENT_WORDS; i++)
|
||||
for (j = 0; j < HOST_BITS_PER_WIDE_INT; j++)
|
||||
if ((ptr->bits[i] & (((unsigned HOST_WIDE_INT) 1) << j)) != 0)
|
||||
{
|
||||
if (col > 70)
|
||||
{
|
||||
fprintf (file, "\n\t\t\t");
|
||||
col = 24;
|
||||
}
|
||||
|
||||
fprintf (file, " %u", (ptr->indx * BITMAP_ELEMENT_ALL_BITS
|
||||
+ i * HOST_BITS_PER_WIDE_INT + j));
|
||||
col += 4;
|
||||
}
|
||||
|
||||
fprintf (file, " }\n");
|
||||
}
|
||||
}
|
||||
|
||||
/* Function to be called from the debugger to print the contents
|
||||
of a bitmap. */
|
||||
|
||||
void
|
||||
debug_bitmap (head)
|
||||
bitmap head;
|
||||
{
|
||||
bitmap_debug_file (stdout, head);
|
||||
}
|
||||
|
||||
/* Function to print out the contents of a bitmap. Unlike bitmap_debug_file,
|
||||
it does not print anything but the bits. */
|
||||
|
||||
void
|
||||
bitmap_print (file, head, prefix, suffix)
|
||||
FILE *file;
|
||||
bitmap head;
|
||||
char *prefix;
|
||||
char *suffix;
|
||||
{
|
||||
char *comma = "";
|
||||
int i;
|
||||
|
||||
fputs (prefix, file);
|
||||
EXECUTE_IF_SET_IN_BITMAP (head, 0, i,
|
||||
{
|
||||
fprintf (file, "%s%d", comma, i);
|
||||
comma = ", ";
|
||||
});
|
||||
fputs (suffix, file);
|
||||
}
|
||||
|
||||
/* Release any memory allocated by bitmaps. */
|
||||
|
||||
void
|
||||
bitmap_release_memory ()
|
||||
{
|
||||
bitmap_free = 0;
|
||||
if (bitmap_obstack_init)
|
||||
{
|
||||
bitmap_obstack_init = FALSE;
|
||||
obstack_free (&bitmap_obstack, NULL_PTR);
|
||||
}
|
||||
}
|
317
contrib/gcc/bitmap.h
Normal file
317
contrib/gcc/bitmap.h
Normal file
@ -0,0 +1,317 @@
|
||||
/* Functions to support general ended bitmaps.
|
||||
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. */
|
||||
|
||||
/* Number of words to use for each element in the linked list. */
|
||||
|
||||
#ifndef BITMAP_ELEMENT_WORDS
|
||||
#define BITMAP_ELEMENT_WORDS 2
|
||||
#endif
|
||||
|
||||
/* Number of bits in each actual element of a bitmap. We get slightly better
|
||||
code for bit % BITMAP_ELEMENT_ALL_BITS and bit / BITMAP_ELEMENT_ALL_BITS if
|
||||
bits is unsigned, assuming it is a power of 2. */
|
||||
|
||||
#define BITMAP_ELEMENT_ALL_BITS \
|
||||
((unsigned) (BITMAP_ELEMENT_WORDS * HOST_BITS_PER_WIDE_INT))
|
||||
|
||||
/* Bitmap set element. We use a linked list to hold only the bits that
|
||||
are set. This allows for use to grow the bitset dynamically without
|
||||
having to realloc and copy a giant bit array. The `prev' field is
|
||||
undefined for an element on the free list. */
|
||||
|
||||
typedef struct bitmap_element_def
|
||||
{
|
||||
struct bitmap_element_def *next; /* Next element. */
|
||||
struct bitmap_element_def *prev; /* Previous element. */
|
||||
unsigned int indx; /* regno/BITMAP_ELEMENT_ALL_BITS. */
|
||||
unsigned HOST_WIDE_INT bits[BITMAP_ELEMENT_WORDS]; /* Bits that are set. */
|
||||
} bitmap_element;
|
||||
|
||||
/* Head of bitmap linked list. */
|
||||
typedef struct bitmap_head_def {
|
||||
bitmap_element *first; /* First element in linked list. */
|
||||
bitmap_element *current; /* Last element looked at. */
|
||||
int indx; /* Index of last element looked at. */
|
||||
} bitmap_head, *bitmap;
|
||||
|
||||
/* Enumeration giving the various operations we support. */
|
||||
enum bitmap_bits {
|
||||
BITMAP_AND, /* TO = FROM1 & FROM2 */
|
||||
BITMAP_AND_COMPL, /* TO = FROM1 & ~ FROM2 */
|
||||
BITMAP_IOR /* TO = FROM1 | FROM2 */
|
||||
};
|
||||
|
||||
/* Global data */
|
||||
extern bitmap_element *bitmap_free; /* Freelist of bitmap elements */
|
||||
extern bitmap_element bitmap_zero; /* Zero bitmap element */
|
||||
|
||||
/* Clear a bitmap by freeing up the linked list. */
|
||||
extern void bitmap_clear PROTO((bitmap));
|
||||
|
||||
/* Copy a bitmap to another bitmap. */
|
||||
extern void bitmap_copy PROTO((bitmap, bitmap));
|
||||
|
||||
/* Perform an operation on two bitmaps, yielding a third. */
|
||||
extern void bitmap_operation PROTO((bitmap, bitmap, bitmap, enum bitmap_bits));
|
||||
|
||||
/* `or' into one bitmap the `and' of a second bitmap witih the complement
|
||||
of a third. */
|
||||
extern void bitmap_ior_and_compl PROTO((bitmap, bitmap, bitmap));
|
||||
|
||||
/* Clear a single register in a register set. */
|
||||
extern void bitmap_clear_bit PROTO((bitmap, int));
|
||||
|
||||
/* Set a single register in a register set. */
|
||||
extern void bitmap_set_bit PROTO((bitmap, int));
|
||||
|
||||
/* Return true if a register is set in a register set. */
|
||||
extern int bitmap_bit_p PROTO((bitmap, int));
|
||||
|
||||
/* Debug functions to print a bitmap linked list. */
|
||||
extern void bitmap_debug PROTO((bitmap));
|
||||
extern void bitmap_debug_file PROTO((FILE *, bitmap));
|
||||
|
||||
/* Print a bitmap */
|
||||
extern void bitmap_print PROTO((FILE *, bitmap, char *, char *));
|
||||
|
||||
/* Initialize a bitmap header. */
|
||||
extern bitmap bitmap_initialize PROTO((bitmap));
|
||||
|
||||
/* Release all memory held by bitmaps. */
|
||||
extern void bitmap_release_memory PROTO((void));
|
||||
|
||||
extern void debug_bitmap PROTO((bitmap));
|
||||
|
||||
/* Allocate a bitmap with oballoc. */
|
||||
#define BITMAP_OBSTACK_ALLOC(OBSTACK) \
|
||||
bitmap_initialize ((bitmap) obstack_alloc (OBSTACK, sizeof (bitmap_head)))
|
||||
|
||||
/* Allocate a bitmap with alloca. */
|
||||
#define BITMAP_ALLOCA() \
|
||||
bitmap_initialize ((bitmap) alloca (sizeof (bitmap_head)))
|
||||
|
||||
/* Do any cleanup needed on a bitmap when it is no longer used. */
|
||||
#define BITMAP_FREE(BITMAP) \
|
||||
do { \
|
||||
if (BITMAP) \
|
||||
{ \
|
||||
bitmap_clear (BITMAP); \
|
||||
(BITMAP) = 0; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* Do any one-time initializations needed for bitmaps. */
|
||||
#define BITMAP_INIT_ONCE()
|
||||
|
||||
/* Loop over all bits in BITMAP, starting with MIN, setting BITNUM to the
|
||||
bit number and executing CODE for all bits that are set. */
|
||||
|
||||
#define EXECUTE_IF_SET_IN_BITMAP(BITMAP, MIN, BITNUM, CODE) \
|
||||
do { \
|
||||
bitmap_element *ptr_ = (BITMAP)->first; \
|
||||
unsigned int indx_ = (MIN) / BITMAP_ELEMENT_ALL_BITS; \
|
||||
unsigned bit_num_ = (MIN) % ((unsigned) HOST_BITS_PER_WIDE_INT); \
|
||||
unsigned word_num_ = (((MIN) / ((unsigned) HOST_BITS_PER_WIDE_INT)) \
|
||||
% BITMAP_ELEMENT_WORDS); \
|
||||
\
|
||||
\
|
||||
/* Find the block the minimum bit is in. */ \
|
||||
while (ptr_ != 0 && ptr_->indx < indx_) \
|
||||
ptr_ = ptr_->next; \
|
||||
\
|
||||
if (ptr_ != 0 && ptr_->indx != indx_) \
|
||||
{ \
|
||||
bit_num_ = 0; \
|
||||
word_num_ = 0; \
|
||||
} \
|
||||
\
|
||||
for (; ptr_ != 0; ptr_ = ptr_->next) \
|
||||
{ \
|
||||
for (; word_num_ < BITMAP_ELEMENT_WORDS; word_num_++) \
|
||||
{ \
|
||||
unsigned HOST_WIDE_INT word_ = ptr_->bits[word_num_]; \
|
||||
\
|
||||
if (word_ != 0) \
|
||||
{ \
|
||||
for (; bit_num_ < HOST_BITS_PER_WIDE_INT; bit_num_++) \
|
||||
{ \
|
||||
unsigned HOST_WIDE_INT mask_ \
|
||||
= ((unsigned HOST_WIDE_INT) 1) << bit_num_; \
|
||||
\
|
||||
if ((word_ & mask_) != 0) \
|
||||
{ \
|
||||
word_ &= ~ mask_; \
|
||||
(BITNUM) = (ptr_->indx * BITMAP_ELEMENT_ALL_BITS \
|
||||
+ word_num_ * HOST_BITS_PER_WIDE_INT \
|
||||
+ bit_num_); \
|
||||
CODE; \
|
||||
\
|
||||
if (word_ == 0) \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
bit_num_ = 0; \
|
||||
} \
|
||||
\
|
||||
word_num_ = 0; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* Loop over all bits in BITMAP1 and BITMAP2, starting with MIN, setting
|
||||
BITNUM to the bit number and executing CODE for all bits that are set in
|
||||
the first bitmap and not set in the second. */
|
||||
|
||||
#define EXECUTE_IF_AND_COMPL_IN_BITMAP(BITMAP1, BITMAP2, MIN, BITNUM, CODE) \
|
||||
do { \
|
||||
bitmap_element *ptr1_ = (BITMAP1)->first; \
|
||||
bitmap_element *ptr2_ = (BITMAP2)->first; \
|
||||
unsigned int indx_ = (MIN) / BITMAP_ELEMENT_ALL_BITS; \
|
||||
unsigned bit_num_ = (MIN) % ((unsigned) HOST_BITS_PER_WIDE_INT); \
|
||||
unsigned word_num_ = (((MIN) / ((unsigned) HOST_BITS_PER_WIDE_INT)) \
|
||||
% BITMAP_ELEMENT_WORDS); \
|
||||
\
|
||||
/* Find the block the minimum bit is in in the first bitmap. */ \
|
||||
while (ptr1_ != 0 && ptr1_->indx < indx_) \
|
||||
ptr1_ = ptr1_->next; \
|
||||
\
|
||||
if (ptr1_ != 0 && ptr1_->indx != indx_) \
|
||||
{ \
|
||||
bit_num_ = 0; \
|
||||
word_num_ = 0; \
|
||||
} \
|
||||
\
|
||||
for (; ptr1_ != 0 ; ptr1_ = ptr1_->next) \
|
||||
{ \
|
||||
/* Advance BITMAP2 to the equivalent link, using an all \
|
||||
zero element if an equivalent link doesn't exist. */ \
|
||||
bitmap_element *tmp2_; \
|
||||
\
|
||||
while (ptr2_ != 0 && ptr2_->indx < ptr1_->indx) \
|
||||
ptr2_ = ptr2_->next; \
|
||||
\
|
||||
tmp2_ = ((ptr2_ != 0 && ptr2_->indx == ptr1_->indx) \
|
||||
? ptr2_ : &bitmap_zero); \
|
||||
\
|
||||
for (; word_num_ < BITMAP_ELEMENT_WORDS; word_num_++) \
|
||||
{ \
|
||||
unsigned HOST_WIDE_INT word_ = (ptr1_->bits[word_num_] \
|
||||
& ~ tmp2_->bits[word_num_]); \
|
||||
if (word_ != 0) \
|
||||
{ \
|
||||
for (; bit_num_ < HOST_BITS_PER_WIDE_INT; bit_num_++) \
|
||||
{ \
|
||||
unsigned HOST_WIDE_INT mask_ \
|
||||
= ((unsigned HOST_WIDE_INT)1) << bit_num_; \
|
||||
\
|
||||
if ((word_ & mask_) != 0) \
|
||||
{ \
|
||||
word_ &= ~ mask_; \
|
||||
(BITNUM) = (ptr1_->indx * BITMAP_ELEMENT_ALL_BITS \
|
||||
+ word_num_ * HOST_BITS_PER_WIDE_INT \
|
||||
+ bit_num_); \
|
||||
\
|
||||
CODE; \
|
||||
if (word_ == 0) \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
bit_num_ = 0; \
|
||||
} \
|
||||
\
|
||||
word_num_ = 0; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* Loop over all bits in BITMAP1 and BITMAP2, starting with MIN, setting
|
||||
BITNUM to the bit number and executing CODE for all bits that are set in
|
||||
the both bitmaps. */
|
||||
|
||||
#define EXECUTE_IF_AND_IN_BITMAP(BITMAP1, BITMAP2, MIN, BITNUM, CODE) \
|
||||
do { \
|
||||
bitmap_element *ptr1_ = (BITMAP1)->first; \
|
||||
bitmap_element *ptr2_ = (BITMAP2)->first; \
|
||||
unsigned int indx_ = (MIN) / BITMAP_ELEMENT_ALL_BITS; \
|
||||
unsigned bit_num_ = (MIN) % ((unsigned) HOST_BITS_PER_WIDE_INT); \
|
||||
unsigned word_num_ = (((MIN) / ((unsigned) HOST_BITS_PER_WIDE_INT)) \
|
||||
% BITMAP_ELEMENT_WORDS); \
|
||||
\
|
||||
/* Find the block the minimum bit is in in the first bitmap. */ \
|
||||
while (ptr1_ != 0 && ptr1_->indx < indx_) \
|
||||
ptr1_ = ptr1_->next; \
|
||||
\
|
||||
if (ptr1_ != 0 && ptr1_->indx != indx_) \
|
||||
{ \
|
||||
bit_num_ = 0; \
|
||||
word_num_ = 0; \
|
||||
} \
|
||||
\
|
||||
for (; ptr1_ != 0 ; ptr1_ = ptr1_->next) \
|
||||
{ \
|
||||
/* Advance BITMAP2 to the equivalent link */ \
|
||||
while (ptr2_ != 0 && ptr2_->indx < ptr1_->indx) \
|
||||
ptr2_ = ptr2_->next; \
|
||||
\
|
||||
if (ptr2_ == 0) \
|
||||
{ \
|
||||
/* If there are no more elements in BITMAP2, exit loop now.*/ \
|
||||
ptr1_ = (bitmap_element *)0; \
|
||||
break; \
|
||||
} \
|
||||
else if (ptr2_->indx > ptr1_->indx) \
|
||||
{ \
|
||||
bit_num_ = word_num_ = 0; \
|
||||
continue; \
|
||||
} \
|
||||
\
|
||||
for (; word_num_ < BITMAP_ELEMENT_WORDS; word_num_++) \
|
||||
{ \
|
||||
unsigned HOST_WIDE_INT word_ = (ptr1_->bits[word_num_] \
|
||||
& ptr2_->bits[word_num_]); \
|
||||
if (word_ != 0) \
|
||||
{ \
|
||||
for (; bit_num_ < HOST_BITS_PER_WIDE_INT; bit_num_++) \
|
||||
{ \
|
||||
unsigned HOST_WIDE_INT mask_ \
|
||||
= ((unsigned HOST_WIDE_INT)1) << bit_num_; \
|
||||
\
|
||||
if ((word_ & mask_) != 0) \
|
||||
{ \
|
||||
word_ &= ~ mask_; \
|
||||
(BITNUM) = (ptr1_->indx * BITMAP_ELEMENT_ALL_BITS \
|
||||
+ word_num_ * HOST_BITS_PER_WIDE_INT \
|
||||
+ bit_num_); \
|
||||
\
|
||||
CODE; \
|
||||
if (word_ == 0) \
|
||||
break; \
|
||||
} \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
bit_num_ = 0; \
|
||||
} \
|
||||
\
|
||||
word_num_ = 0; \
|
||||
} \
|
||||
} while (0)
|
@ -1,5 +1,5 @@
|
||||
# We have to use the cross-compiler we just built to compile it.
|
||||
CC = gcc -b $(target)
|
||||
CC = gcc -b $(host)
|
||||
|
||||
# Need those to compile binaries running on host machine.
|
||||
# It is configured by
|
||||
@ -24,9 +24,12 @@ HOST_OBSTACK=$(OBSTACK)
|
||||
# target.
|
||||
FIXINCLUDES=Makefile.in
|
||||
|
||||
# Don't run fixproto either
|
||||
STMP_FIXPROTO =
|
||||
|
||||
# Cause installation using install-build. We do nothing here.
|
||||
INSTALL_TARGET = install-build
|
||||
#INSTALL_TARGET = install-build
|
||||
|
||||
# Don't try to compile the things we can't compile or we have made
|
||||
# while making gcc with the cross-compiler.
|
||||
ALL = all.build
|
||||
#ALL = all.build
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Generate information regarding function declarations and definitions based
|
||||
on information stored in GCC's tree structure. This code implements the
|
||||
-aux-info option.
|
||||
Copyright (C) 1989, 1991, 1994, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989, 91, 94, 95, 97, 1998 Free Software Foundation, Inc.
|
||||
Contributed by Ron Guilmette (rfg@segfault.us.com).
|
||||
|
||||
This file is part of GNU CC.
|
||||
@ -21,14 +21,12 @@ 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 <stdio.h>
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "flags.h"
|
||||
#include "tree.h"
|
||||
#include "c-tree.h"
|
||||
|
||||
extern char* xmalloc ();
|
||||
|
||||
enum formals_style_enum {
|
||||
ansi,
|
||||
k_and_r_names,
|
||||
@ -37,26 +35,26 @@ enum formals_style_enum {
|
||||
typedef enum formals_style_enum formals_style;
|
||||
|
||||
|
||||
static char* data_type;
|
||||
static char *data_type;
|
||||
|
||||
static char * concat ();
|
||||
static char * concat3 ();
|
||||
static char * gen_formal_list_for_type ();
|
||||
static int deserves_ellipsis ();
|
||||
static char * gen_formal_list_for_func_def ();
|
||||
static char * gen_type ();
|
||||
static char * gen_decl ();
|
||||
void gen_aux_info_record ();
|
||||
static char *concat PROTO((char *, char *));
|
||||
static char *concat3 PROTO((char *, char *, char *));
|
||||
static char *affix_data_type PROTO((char *));
|
||||
static char *gen_formal_list_for_type PROTO((tree, formals_style));
|
||||
static int deserves_ellipsis PROTO((tree));
|
||||
static char *gen_formal_list_for_func_def PROTO((tree, formals_style));
|
||||
static char *gen_type PROTO((char *, tree, formals_style));
|
||||
static char *gen_decl PROTO((tree, int, formals_style));
|
||||
|
||||
/* Take two strings and mash them together into a newly allocated area. */
|
||||
|
||||
static char*
|
||||
static char *
|
||||
concat (s1, s2)
|
||||
char* s1;
|
||||
char* s2;
|
||||
char *s1;
|
||||
char *s2;
|
||||
{
|
||||
int size1, size2;
|
||||
char* ret_val;
|
||||
char *ret_val;
|
||||
|
||||
if (!s1)
|
||||
s1 = "";
|
||||
@ -73,14 +71,14 @@ concat (s1, s2)
|
||||
|
||||
/* Take three strings and mash them together into a newly allocated area. */
|
||||
|
||||
static char*
|
||||
static char *
|
||||
concat3 (s1, s2, s3)
|
||||
char* s1;
|
||||
char* s2;
|
||||
char* s3;
|
||||
char *s1;
|
||||
char *s2;
|
||||
char *s3;
|
||||
{
|
||||
int size1, size2, size3;
|
||||
char* ret_val;
|
||||
char *ret_val;
|
||||
|
||||
if (!s1)
|
||||
s1 = "";
|
||||
@ -113,7 +111,7 @@ concat3 (s1, s2, s3)
|
||||
`const char *foo;' and *not* `char const *foo;' so we try to create types
|
||||
that look as expected. */
|
||||
|
||||
static char*
|
||||
static char *
|
||||
affix_data_type (type_or_decl)
|
||||
char *type_or_decl;
|
||||
{
|
||||
@ -156,14 +154,14 @@ affix_data_type (type_or_decl)
|
||||
this function type. Return the whole formal parameter list (including
|
||||
a pair of surrounding parens) as a string. Note that if the style
|
||||
we are currently aiming for is non-ansi, then we just return a pair
|
||||
of empty parens here. */
|
||||
of empty parens here. */
|
||||
|
||||
static char*
|
||||
static char *
|
||||
gen_formal_list_for_type (fntype, style)
|
||||
tree fntype;
|
||||
formals_style style;
|
||||
{
|
||||
char* formal_list = "";
|
||||
char *formal_list = "";
|
||||
tree formal_type;
|
||||
|
||||
if (style != ansi)
|
||||
@ -172,16 +170,16 @@ gen_formal_list_for_type (fntype, style)
|
||||
formal_type = TYPE_ARG_TYPES (fntype);
|
||||
while (formal_type && TREE_VALUE (formal_type) != void_type_node)
|
||||
{
|
||||
char* this_type;
|
||||
char *this_type;
|
||||
|
||||
if (*formal_list)
|
||||
formal_list = concat (formal_list, ", ");
|
||||
|
||||
this_type = gen_type ("", TREE_VALUE (formal_type), ansi);
|
||||
formal_list =
|
||||
(strlen (this_type))
|
||||
? concat (formal_list, affix_data_type (this_type))
|
||||
: concat (formal_list, data_type);
|
||||
formal_list
|
||||
= ((strlen (this_type))
|
||||
? concat (formal_list, affix_data_type (this_type))
|
||||
: concat (formal_list, data_type));
|
||||
|
||||
formal_type = TREE_CHAIN (formal_type);
|
||||
}
|
||||
@ -278,12 +276,12 @@ deserves_ellipsis (fntype)
|
||||
This routine returns a string which is the source form for the entire
|
||||
function formal parameter list. */
|
||||
|
||||
static char*
|
||||
static char *
|
||||
gen_formal_list_for_func_def (fndecl, style)
|
||||
tree fndecl;
|
||||
formals_style style;
|
||||
{
|
||||
char* formal_list = "";
|
||||
char *formal_list = "";
|
||||
tree formal_decl;
|
||||
|
||||
formal_decl = DECL_ARGUMENTS (fndecl);
|
||||
@ -353,15 +351,16 @@ gen_formal_list_for_func_def (fndecl, style)
|
||||
to do at this point is for the initial caller to prepend the "data_type"
|
||||
string onto the returned "seed". */
|
||||
|
||||
static char*
|
||||
static char *
|
||||
gen_type (ret_val, t, style)
|
||||
char* ret_val;
|
||||
char *ret_val;
|
||||
tree t;
|
||||
formals_style style;
|
||||
{
|
||||
tree chain_p;
|
||||
|
||||
if (TYPE_NAME (t) && DECL_NAME (TYPE_NAME (t)))
|
||||
/* If there is a typedef name for this type, use it. */
|
||||
if (TYPE_NAME (t) && TREE_CODE (TYPE_NAME (t)) == TYPE_DECL)
|
||||
data_type = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (t)));
|
||||
else
|
||||
{
|
||||
@ -517,13 +516,13 @@ gen_type (ret_val, t, style)
|
||||
associated with a function definition. In this case, we can assume that
|
||||
an attached list of DECL nodes for function formal arguments is present. */
|
||||
|
||||
static char*
|
||||
static char *
|
||||
gen_decl (decl, is_func_definition, style)
|
||||
tree decl;
|
||||
int is_func_definition;
|
||||
formals_style style;
|
||||
{
|
||||
char* ret_val;
|
||||
char *ret_val;
|
||||
|
||||
if (DECL_NAME (decl))
|
||||
ret_val = IDENTIFIER_POINTER (DECL_NAME (decl));
|
||||
@ -581,7 +580,7 @@ gen_decl (decl, is_func_definition, style)
|
||||
|
||||
ret_val = affix_data_type (ret_val);
|
||||
|
||||
if (DECL_REGISTER (decl))
|
||||
if (TREE_CODE (decl) != FUNCTION_DECL && DECL_REGISTER (decl))
|
||||
ret_val = concat ("register ", ret_val);
|
||||
if (TREE_PUBLIC (decl))
|
||||
ret_val = concat ("extern ", ret_val);
|
||||
@ -591,7 +590,7 @@ gen_decl (decl, is_func_definition, style)
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
extern FILE* aux_info_file;
|
||||
extern FILE *aux_info_file;
|
||||
|
||||
/* Generate and write a new line of info to the aux-info (.X) file. This
|
||||
routine is called once for each function declaration, and once for each
|
||||
|
@ -28,6 +28,7 @@ Boston, MA 02111-1307, USA. */
|
||||
#include "tree.h"
|
||||
#include "flags.h"
|
||||
#include "convert.h"
|
||||
#include "toplev.h"
|
||||
|
||||
/* Change of width--truncation and extension of integers or reals--
|
||||
is represented with NOP_EXPR. Proper functioning of many things
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/* Build expressions with type checking for C compiler.
|
||||
Copyright (C) 1987, 1988, 1989, 1992, 1993 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987, 88, 89, 92, 93, 96, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@ -24,26 +24,14 @@ Boston, MA 02111-1307, USA. */
|
||||
both their declarations and the expansion of statements using them. */
|
||||
|
||||
#include "config.h"
|
||||
#include <stdio.h>
|
||||
#include "system.h"
|
||||
#include "tree.h"
|
||||
#include "c-tree.h"
|
||||
#include "flags.h"
|
||||
#include "obstack.h"
|
||||
#include "rtl.h"
|
||||
|
||||
static void expand_stmt_with_iterators_1 ();
|
||||
static tree collect_iterators ();
|
||||
static void iterator_loop_prologue ();
|
||||
static void iterator_loop_epilogue ();
|
||||
static void add_ixpansion ();
|
||||
static void delete_ixpansion();
|
||||
static int top_level_ixpansion_p ();
|
||||
static void istack_sublevel_to_current ();
|
||||
|
||||
/* A special obstack, and a pointer to the start of
|
||||
all the data in it (so we can free everything easily). */
|
||||
static struct obstack ixp_obstack;
|
||||
static char *ixp_firstobj;
|
||||
#include "toplev.h"
|
||||
#include "expr.h"
|
||||
|
||||
/*
|
||||
KEEPING TRACK OF EXPANSIONS
|
||||
@ -96,11 +84,26 @@ struct iter_stack_node
|
||||
};
|
||||
|
||||
struct iter_stack_node *iter_stack;
|
||||
|
||||
struct iter_stack_node sublevel_ixpansions;
|
||||
|
||||
/* A special obstack, and a pointer to the start of
|
||||
all the data in it (so we can free everything easily). */
|
||||
static struct obstack ixp_obstack;
|
||||
static char *ixp_firstobj;
|
||||
|
||||
/* During collect_iterators, a list of SAVE_EXPRs already scanned. */
|
||||
static tree save_exprs;
|
||||
|
||||
static void expand_stmt_with_iterators_1 PROTO((tree, tree));
|
||||
static tree collect_iterators PROTO((tree, tree));
|
||||
static void iterator_loop_prologue PROTO((tree, rtx *, rtx *));
|
||||
static void iterator_loop_epilogue PROTO((tree, rtx *, rtx *));
|
||||
static int top_level_ixpansion_p PROTO((void));
|
||||
static void isn_append PROTO((struct iter_stack_node *,
|
||||
struct iter_stack_node *));
|
||||
static void istack_sublevel_to_current PROTO((void));
|
||||
static void add_ixpansion PROTO((tree, rtx, rtx, rtx, rtx));
|
||||
static void delete_ixpansion PROTO((tree));
|
||||
|
||||
/* Initialize our obstack once per compilation. */
|
||||
|
||||
@ -254,6 +257,8 @@ collect_iterators (exp, list)
|
||||
break;
|
||||
case RTL_EXPR:
|
||||
return list;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < num_args; i++)
|
||||
@ -283,7 +288,8 @@ iterator_loop_prologue (idecl, start_note, end_note)
|
||||
|
||||
/* Force the save_expr in DECL_INITIAL to be calculated
|
||||
if it hasn't been calculated yet. */
|
||||
expand_expr (DECL_INITIAL (idecl), const0_rtx, VOIDmode, 0);
|
||||
expand_expr (DECL_INITIAL (idecl), const0_rtx, VOIDmode,
|
||||
EXPAND_NORMAL);
|
||||
|
||||
if (DECL_RTL (idecl) == 0)
|
||||
expand_decl (idecl);
|
||||
@ -294,7 +300,7 @@ iterator_loop_prologue (idecl, start_note, end_note)
|
||||
/* Initialize counter. */
|
||||
expr = build (MODIFY_EXPR, TREE_TYPE (idecl), idecl, integer_zero_node);
|
||||
TREE_SIDE_EFFECTS (expr) = 1;
|
||||
expand_expr (expr, const0_rtx, VOIDmode, 0);
|
||||
expand_expr (expr, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
|
||||
expand_start_loop_continue_elsewhere (1);
|
||||
|
||||
@ -335,7 +341,7 @@ iterator_loop_epilogue (idecl, start_note, end_note)
|
||||
incr = build_binary_op (PLUS_EXPR, idecl, integer_one_node, 0);
|
||||
incr = build (MODIFY_EXPR, TREE_TYPE (idecl), idecl, incr);
|
||||
TREE_SIDE_EFFECTS (incr) = 1;
|
||||
expand_expr (incr, const0_rtx, VOIDmode, 0);
|
||||
expand_expr (incr, const0_rtx, VOIDmode, EXPAND_NORMAL);
|
||||
test = build_binary_op (LT_EXPR, idecl, DECL_INITIAL (idecl), 0);
|
||||
expand_exit_loop_if_false (0, test);
|
||||
expand_end_loop ();
|
||||
@ -343,7 +349,9 @@ iterator_loop_epilogue (idecl, start_note, end_note)
|
||||
ITERATOR_BOUND_P (idecl) = 0;
|
||||
/* we can reset rtl since there is not chance that this expansion */
|
||||
/* would be superseded by a higher level one */
|
||||
if (top_level_ixpansion_p ())
|
||||
/* but don't do this if the decl is static, since we need to share */
|
||||
/* the same decl in that case. */
|
||||
if (top_level_ixpansion_p () && ! TREE_STATIC (idecl))
|
||||
DECL_RTL (idecl) = 0;
|
||||
if (end_note)
|
||||
*end_note = emit_note (0, NOTE_INSN_DELETED);
|
||||
@ -409,7 +417,7 @@ void
|
||||
push_iterator_stack ()
|
||||
{
|
||||
struct iter_stack_node *new_top
|
||||
= (struct iter_stack_node*)
|
||||
= (struct iter_stack_node *)
|
||||
obstack_alloc (&ixp_obstack, sizeof (struct iter_stack_node));
|
||||
|
||||
new_top->first = 0;
|
||||
@ -442,15 +450,15 @@ add_ixpansion (idecl, pro_start, pro_end, epi_start, epi_end)
|
||||
tree idecl;
|
||||
rtx pro_start, pro_end, epi_start, epi_end;
|
||||
{
|
||||
struct ixpansion* newix;
|
||||
struct ixpansion *newix;
|
||||
|
||||
/* Do nothing if we are not inside "({...})",
|
||||
as in that case this expansion can't need subsequent RTL modification. */
|
||||
if (iter_stack == 0)
|
||||
return;
|
||||
|
||||
newix = (struct ixpansion*) obstack_alloc (&ixp_obstack,
|
||||
sizeof (struct ixpansion));
|
||||
newix = (struct ixpansion *) obstack_alloc (&ixp_obstack,
|
||||
sizeof (struct ixpansion));
|
||||
newix->ixdecl = idecl;
|
||||
newix->ixprologue_start = pro_start;
|
||||
newix->ixprologue_end = pro_end;
|
||||
@ -471,7 +479,7 @@ static void
|
||||
delete_ixpansion (idecl)
|
||||
tree idecl;
|
||||
{
|
||||
struct ixpansion* previx = 0, *ix;
|
||||
struct ixpansion *previx = 0, *ix;
|
||||
|
||||
for (ix = sublevel_ixpansions.first; ix; ix = ix->next)
|
||||
if (ix->ixdecl == idecl)
|
||||
@ -577,7 +585,7 @@ pixl (head)
|
||||
return head;
|
||||
}
|
||||
|
||||
/* Print Iterator Stack*/
|
||||
/* Print Iterator Stack. */
|
||||
|
||||
void
|
||||
pis ()
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Language-specific hook definitions for C front end.
|
||||
Copyright (C) 1991, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1991, 1995, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@ -20,27 +20,39 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "tree.h"
|
||||
#include <stdio.h>
|
||||
#include "input.h"
|
||||
#include "c-tree.h"
|
||||
#include "c-lex.h"
|
||||
#include "toplev.h"
|
||||
#include "output.h"
|
||||
|
||||
/* Each of the functions defined here
|
||||
is an alternative to a function in objc-actions.c. */
|
||||
|
||||
int
|
||||
lang_decode_option (p)
|
||||
char *p;
|
||||
lang_decode_option (argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
return c_decode_option (argc, argv);
|
||||
}
|
||||
|
||||
void
|
||||
lang_init_options ()
|
||||
{
|
||||
return c_decode_option (p);
|
||||
}
|
||||
|
||||
void
|
||||
lang_init ()
|
||||
{
|
||||
#if !USE_CPPLIB
|
||||
/* the beginning of the file is a new line; check for # */
|
||||
/* With luck, we discover the real source file's name from that
|
||||
and put it in input_filename. */
|
||||
ungetc (check_newline (), finput);
|
||||
#endif
|
||||
}
|
||||
|
||||
void
|
||||
@ -59,39 +71,50 @@ print_lang_statistics ()
|
||||
{
|
||||
}
|
||||
|
||||
/* used by print-tree.c */
|
||||
|
||||
void
|
||||
lang_print_xnode (file, node, indent)
|
||||
FILE *file ATTRIBUTE_UNUSED;
|
||||
tree node ATTRIBUTE_UNUSED;
|
||||
int indent ATTRIBUTE_UNUSED;
|
||||
{
|
||||
}
|
||||
|
||||
/* Used by c-lex.c, but only for objc. */
|
||||
|
||||
tree
|
||||
lookup_interface (arg)
|
||||
tree arg;
|
||||
tree arg ATTRIBUTE_UNUSED;
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
tree
|
||||
is_class_name (arg)
|
||||
tree arg;
|
||||
tree arg ATTRIBUTE_UNUSED;
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void
|
||||
maybe_objc_check_decl (decl)
|
||||
tree decl;
|
||||
tree decl ATTRIBUTE_UNUSED;
|
||||
{
|
||||
}
|
||||
|
||||
int
|
||||
maybe_objc_comptypes (lhs, rhs, reflexive)
|
||||
tree lhs, rhs;
|
||||
int reflexive;
|
||||
tree lhs ATTRIBUTE_UNUSED;
|
||||
tree rhs ATTRIBUTE_UNUSED;
|
||||
int reflexive ATTRIBUTE_UNUSED;
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
tree
|
||||
maybe_objc_method_name (decl)
|
||||
tree decl;
|
||||
tree decl ATTRIBUTE_UNUSED;
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@ -110,33 +133,28 @@ recognize_objc_keyword ()
|
||||
|
||||
tree
|
||||
build_objc_string (len, str)
|
||||
int len;
|
||||
char *str;
|
||||
int len ATTRIBUTE_UNUSED;
|
||||
char *str ATTRIBUTE_UNUSED;
|
||||
{
|
||||
abort ();
|
||||
return NULL_TREE;
|
||||
}
|
||||
|
||||
void
|
||||
GNU_xref_begin ()
|
||||
{
|
||||
fatal ("GCC does not yet support XREF");
|
||||
}
|
||||
/* Called at end of parsing, but before end-of-file processing. */
|
||||
|
||||
void
|
||||
GNU_xref_end ()
|
||||
{
|
||||
fatal ("GCC does not yet support XREF");
|
||||
}
|
||||
|
||||
/* called at end of parsing, but before end-of-file processing. */
|
||||
void
|
||||
finish_file ()
|
||||
{
|
||||
extern tree static_ctors, static_dtors;
|
||||
extern tree get_file_function_name ();
|
||||
#ifndef ASM_OUTPUT_CONSTRUCTOR
|
||||
extern tree static_ctors;
|
||||
#endif
|
||||
#ifndef ASM_OUTPUT_DESTRUCTOR
|
||||
extern tree static_dtors;
|
||||
#endif
|
||||
extern tree build_function_call PROTO((tree, tree));
|
||||
#if !defined(ASM_OUTPUT_CONSTRUCTOR) || !defined(ASM_OUTPUT_DESTRUCTOR)
|
||||
tree void_list_node = build_tree_list (NULL_TREE, void_type_node);
|
||||
#endif
|
||||
#ifndef ASM_OUTPUT_CONSTRUCTOR
|
||||
if (static_ctors)
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -73,8 +73,14 @@ extern tree lastiddecl;
|
||||
|
||||
extern char *token_buffer; /* Pointer to token buffer. */
|
||||
|
||||
extern tree make_pointer_declarator ();
|
||||
extern void reinit_parse_for_function ();
|
||||
extern int yylex ();
|
||||
extern tree make_pointer_declarator PROTO((tree, tree));
|
||||
extern void reinit_parse_for_function PROTO((void));
|
||||
extern void position_after_white_space PROTO((void));
|
||||
extern int check_newline PROTO((void));
|
||||
|
||||
extern char *get_directive_line ();
|
||||
extern int yylex PROTO((void));
|
||||
extern void yyerror PROTO((char *));
|
||||
|
||||
extern void forget_protocol_qualifiers PROTO((void));
|
||||
extern void remember_protocol_qualifiers PROTO((void));
|
||||
extern tree is_class_name PROTO((tree));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* YACC parser for C syntax and for Objective C. -*-c-*-
|
||||
Copyright (C) 1987, 88, 89, 92, 93, 94, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1987, 88, 89, 92-97, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@ -28,10 +28,10 @@ Boston, MA 02111-1307, USA. */
|
||||
written by AT&T, but I have never seen it. */
|
||||
|
||||
ifobjc
|
||||
%expect 48
|
||||
%expect 66
|
||||
end ifobjc
|
||||
ifc
|
||||
%expect 34
|
||||
%expect 46
|
||||
|
||||
/* These are the 23 conflicts you should get in parse.output;
|
||||
the state numbers may vary if minor changes in the grammar are made.
|
||||
@ -58,19 +58,19 @@ State 434 contains 2 shift/reduce conflicts. (Four ways to parse this.) */
|
||||
end ifc
|
||||
|
||||
%{
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include <setjmp.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "tree.h"
|
||||
#include "input.h"
|
||||
#include "c-lex.h"
|
||||
#include "c-tree.h"
|
||||
#include "flags.h"
|
||||
#include "output.h"
|
||||
#include "toplev.h"
|
||||
|
||||
#ifdef MULTIBYTE_CHARS
|
||||
#include <stdlib.h>
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
@ -87,12 +87,6 @@ ifc
|
||||
char *language_string = "GNU C";
|
||||
end ifc
|
||||
|
||||
#ifndef errno
|
||||
extern int errno;
|
||||
#endif
|
||||
|
||||
void yyerror ();
|
||||
|
||||
/* Like YYERROR but do call yyerror. */
|
||||
#define YYERROR1 { yyerror ("syntax error"); YYERROR; }
|
||||
|
||||
@ -185,6 +179,8 @@ void yyerror ();
|
||||
%type <ttype> typed_declspecs reserved_declspecs
|
||||
%type <ttype> typed_typespecs reserved_typespecquals
|
||||
%type <ttype> declmods typespec typespecqual_reserved
|
||||
%type <ttype> typed_declspecs_no_prefix_attr reserved_declspecs_no_prefix_attr
|
||||
%type <ttype> declmods_no_prefix_attr
|
||||
%type <ttype> SCSPEC TYPESPEC TYPE_QUAL nonempty_type_quals maybe_type_qual
|
||||
%type <ttype> initdecls notype_initdecls initdcl notype_initdcl
|
||||
%type <ttype> init maybeasm
|
||||
@ -201,6 +197,7 @@ void yyerror ();
|
||||
%type <ttype> structsp component_decl_list component_decl_list2
|
||||
%type <ttype> component_decl components component_declarator
|
||||
%type <ttype> enumlist enumerator
|
||||
%type <ttype> struct_head union_head enum_head
|
||||
%type <ttype> typename absdcl absdcl1 type_quals
|
||||
%type <ttype> xexpr parms parm identifiers
|
||||
|
||||
@ -224,21 +221,24 @@ ifobjc
|
||||
%type <ttype> keywordexpr keywordarglist keywordarg
|
||||
%type <ttype> myparms myparm optparmlist reservedwords objcselectorexpr
|
||||
%type <ttype> selectorarg keywordnamelist keywordname objcencodeexpr
|
||||
%type <ttype> objc_string protocolrefs identifier_list objcprotocolexpr
|
||||
%type <ttype> objc_string non_empty_protocolrefs protocolrefs identifier_list objcprotocolexpr
|
||||
|
||||
%type <ttype> CLASSNAME OBJC_STRING OBJECTNAME
|
||||
end ifobjc
|
||||
|
||||
%{
|
||||
/* Number of statements (loosely speaking) seen so far. */
|
||||
/* Number of statements (loosely speaking) and compound statements
|
||||
seen so far. */
|
||||
static int stmt_count;
|
||||
|
||||
static int compstmt_count;
|
||||
|
||||
/* Input file and line number of the end of the body of last simple_if;
|
||||
used by the stmt-rule immediately after simple_if returns. */
|
||||
static char *if_stmt_file;
|
||||
static int if_stmt_line;
|
||||
|
||||
/* List of types and structure classes of the current declaration. */
|
||||
static tree current_declspecs;
|
||||
static tree current_declspecs = NULL_TREE;
|
||||
static tree prefix_attributes = NULL_TREE;
|
||||
|
||||
/* Stack of saved values of current_declspecs and prefix_attributes. */
|
||||
@ -264,7 +264,7 @@ end ifobjc
|
||||
/* Tell yyparse how to print a token's value, if yydebug is set. */
|
||||
|
||||
#define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL)
|
||||
extern void yyprint ();
|
||||
extern void yyprint PROTO ((FILE *, int, YYSTYPE));
|
||||
%}
|
||||
|
||||
%%
|
||||
@ -306,6 +306,8 @@ end ifobjc
|
||||
assemble_asm ($3);
|
||||
else
|
||||
error ("argument of `asm' is not a constant string"); }
|
||||
| extension extdef
|
||||
{ pedantic = $<itype>1; }
|
||||
;
|
||||
|
||||
datadef:
|
||||
@ -342,11 +344,11 @@ datadef:
|
||||
|
||||
fndef:
|
||||
typed_declspecs setspecs declarator
|
||||
{ if (! start_function ($1, $3, prefix_attributes,
|
||||
NULL_TREE, 0))
|
||||
{ if (! start_function (current_declspecs, $3,
|
||||
prefix_attributes, NULL_TREE, 0))
|
||||
YYERROR1;
|
||||
reinit_parse_for_function (); }
|
||||
xdecls
|
||||
old_style_parm_decls
|
||||
{ store_parm_decls (); }
|
||||
compstmt_or_error
|
||||
{ finish_function (0);
|
||||
@ -360,11 +362,11 @@ fndef:
|
||||
declspec_stack = TREE_CHAIN (declspec_stack);
|
||||
resume_momentary ($2); }
|
||||
| declmods setspecs notype_declarator
|
||||
{ if (! start_function ($1, $3, prefix_attributes,
|
||||
NULL_TREE, 0))
|
||||
{ if (! start_function (current_declspecs, $3,
|
||||
prefix_attributes, NULL_TREE, 0))
|
||||
YYERROR1;
|
||||
reinit_parse_for_function (); }
|
||||
xdecls
|
||||
old_style_parm_decls
|
||||
{ store_parm_decls (); }
|
||||
compstmt_or_error
|
||||
{ finish_function (0);
|
||||
@ -382,7 +384,7 @@ fndef:
|
||||
prefix_attributes, NULL_TREE, 0))
|
||||
YYERROR1;
|
||||
reinit_parse_for_function (); }
|
||||
xdecls
|
||||
old_style_parm_decls
|
||||
{ store_parm_decls (); }
|
||||
compstmt_or_error
|
||||
{ finish_function (0);
|
||||
@ -444,11 +446,8 @@ unary_expr:
|
||||
| '*' cast_expr %prec UNARY
|
||||
{ $$ = build_indirect_ref ($2, "unary *"); }
|
||||
/* __extension__ turns off -pedantic for following primary. */
|
||||
| EXTENSION
|
||||
{ $<itype>1 = pedantic;
|
||||
pedantic = 0; }
|
||||
cast_expr %prec UNARY
|
||||
{ $$ = $3;
|
||||
| extension cast_expr %prec UNARY
|
||||
{ $$ = $2;
|
||||
pedantic = $<itype>1; }
|
||||
| unop cast_expr %prec UNARY
|
||||
{ $$ = build_unary_op ($1, $2, 0);
|
||||
@ -482,23 +481,35 @@ unary_expr:
|
||||
$$ = build_unary_op (ADDR_EXPR, $$, 0);
|
||||
} }
|
||||
*/
|
||||
| SIZEOF unary_expr %prec UNARY
|
||||
{ if (TREE_CODE ($2) == COMPONENT_REF
|
||||
&& DECL_BIT_FIELD (TREE_OPERAND ($2, 1)))
|
||||
| sizeof unary_expr %prec UNARY
|
||||
{ skip_evaluation--;
|
||||
if (TREE_CODE ($2) == COMPONENT_REF
|
||||
&& DECL_C_BIT_FIELD (TREE_OPERAND ($2, 1)))
|
||||
error ("`sizeof' applied to a bit-field");
|
||||
$$ = c_sizeof (TREE_TYPE ($2)); }
|
||||
| SIZEOF '(' typename ')' %prec HYPERUNARY
|
||||
{ $$ = c_sizeof (groktypename ($3)); }
|
||||
| ALIGNOF unary_expr %prec UNARY
|
||||
{ $$ = c_alignof_expr ($2); }
|
||||
| ALIGNOF '(' typename ')' %prec HYPERUNARY
|
||||
{ $$ = c_alignof (groktypename ($3)); }
|
||||
| sizeof '(' typename ')' %prec HYPERUNARY
|
||||
{ skip_evaluation--;
|
||||
$$ = c_sizeof (groktypename ($3)); }
|
||||
| alignof unary_expr %prec UNARY
|
||||
{ skip_evaluation--;
|
||||
$$ = c_alignof_expr ($2); }
|
||||
| alignof '(' typename ')' %prec HYPERUNARY
|
||||
{ skip_evaluation--;
|
||||
$$ = c_alignof (groktypename ($3)); }
|
||||
| REALPART cast_expr %prec UNARY
|
||||
{ $$ = build_unary_op (REALPART_EXPR, $2, 0); }
|
||||
| IMAGPART cast_expr %prec UNARY
|
||||
{ $$ = build_unary_op (IMAGPART_EXPR, $2, 0); }
|
||||
;
|
||||
|
||||
sizeof:
|
||||
SIZEOF { skip_evaluation++; }
|
||||
;
|
||||
|
||||
alignof:
|
||||
ALIGNOF { skip_evaluation++; }
|
||||
;
|
||||
|
||||
cast_expr:
|
||||
unary_expr
|
||||
| '(' typename ')' cast_expr %prec UNARY
|
||||
@ -561,12 +572,37 @@ expr_no_commas:
|
||||
{ $$ = parser_build_binary_op ($2, $1, $3); }
|
||||
| expr_no_commas '^' expr_no_commas
|
||||
{ $$ = parser_build_binary_op ($2, $1, $3); }
|
||||
| expr_no_commas ANDAND expr_no_commas
|
||||
{ $$ = parser_build_binary_op (TRUTH_ANDIF_EXPR, $1, $3); }
|
||||
| expr_no_commas OROR expr_no_commas
|
||||
{ $$ = parser_build_binary_op (TRUTH_ORIF_EXPR, $1, $3); }
|
||||
| expr_no_commas '?' xexpr ':' expr_no_commas
|
||||
{ $$ = build_conditional_expr ($1, $3, $5); }
|
||||
| expr_no_commas ANDAND
|
||||
{ $1 = truthvalue_conversion (default_conversion ($1));
|
||||
skip_evaluation += $1 == boolean_false_node; }
|
||||
expr_no_commas
|
||||
{ skip_evaluation -= $1 == boolean_false_node;
|
||||
$$ = parser_build_binary_op (TRUTH_ANDIF_EXPR, $1, $4); }
|
||||
| expr_no_commas OROR
|
||||
{ $1 = truthvalue_conversion (default_conversion ($1));
|
||||
skip_evaluation += $1 == boolean_true_node; }
|
||||
expr_no_commas
|
||||
{ skip_evaluation -= $1 == boolean_true_node;
|
||||
$$ = parser_build_binary_op (TRUTH_ORIF_EXPR, $1, $4); }
|
||||
| expr_no_commas '?'
|
||||
{ $1 = truthvalue_conversion (default_conversion ($1));
|
||||
skip_evaluation += $1 == boolean_false_node; }
|
||||
expr ':'
|
||||
{ skip_evaluation += (($1 == boolean_true_node)
|
||||
- ($1 == boolean_false_node)); }
|
||||
expr_no_commas
|
||||
{ skip_evaluation -= $1 == boolean_true_node;
|
||||
$$ = build_conditional_expr ($1, $4, $7); }
|
||||
| expr_no_commas '?'
|
||||
{ if (pedantic)
|
||||
pedwarn ("ANSI C forbids omitting the middle term of a ?: expression");
|
||||
/* Make sure first operand is calculated only once. */
|
||||
$<ttype>2 = save_expr ($1);
|
||||
$1 = truthvalue_conversion (default_conversion ($<ttype>2));
|
||||
skip_evaluation += $1 == boolean_true_node; }
|
||||
':' expr_no_commas
|
||||
{ skip_evaluation -= $1 == boolean_true_node;
|
||||
$$ = build_conditional_expr ($1, $<ttype>2, $5); }
|
||||
| expr_no_commas '=' expr_no_commas
|
||||
{ $$ = build_modify_expr ($1, NOP_EXPR, $3);
|
||||
C_SET_EXP_ORIGINAL_CODE ($$, MODIFY_EXPR); }
|
||||
@ -640,7 +676,7 @@ end ifobjc
|
||||
if (IDENTIFIER_GLOBAL_VALUE ($1) != error_mark_node
|
||||
|| IDENTIFIER_ERROR_LOCUS ($1) != current_function_decl)
|
||||
{
|
||||
error ("`%s' undeclared (first use this function)",
|
||||
error ("`%s' undeclared (first use in this function)",
|
||||
IDENTIFIER_POINTER ($1));
|
||||
|
||||
if (! undeclared_variable_notice)
|
||||
@ -861,7 +897,7 @@ objc_string:
|
||||
;
|
||||
end ifobjc
|
||||
|
||||
xdecls:
|
||||
old_style_parm_decls:
|
||||
/* empty */
|
||||
| datadecls
|
||||
| datadecls ELLIPSIS
|
||||
@ -886,21 +922,25 @@ datadecls:
|
||||
| lineno_datadecl errstmt
|
||||
;
|
||||
|
||||
/* We don't allow prefix attributes here because they cause reduce/reduce
|
||||
conflicts: we can't know whether we're parsing a function decl with
|
||||
attribute suffix, or function defn with attribute prefix on first old
|
||||
style parm. */
|
||||
datadecl:
|
||||
typed_declspecs setspecs initdecls ';'
|
||||
typed_declspecs_no_prefix_attr setspecs initdecls ';'
|
||||
{ current_declspecs = TREE_VALUE (declspec_stack);
|
||||
prefix_attributes = TREE_PURPOSE (declspec_stack);
|
||||
declspec_stack = TREE_CHAIN (declspec_stack);
|
||||
resume_momentary ($2); }
|
||||
| declmods setspecs notype_initdecls ';'
|
||||
| declmods_no_prefix_attr setspecs notype_initdecls ';'
|
||||
{ current_declspecs = TREE_VALUE (declspec_stack);
|
||||
prefix_attributes = TREE_PURPOSE (declspec_stack);
|
||||
declspec_stack = TREE_CHAIN (declspec_stack);
|
||||
resume_momentary ($2); }
|
||||
| typed_declspecs ';'
|
||||
| typed_declspecs_no_prefix_attr ';'
|
||||
{ shadow_tag_warned ($1, 1);
|
||||
pedwarn ("empty declaration"); }
|
||||
| declmods ';'
|
||||
| declmods_no_prefix_attr ';'
|
||||
{ pedwarn ("empty declaration"); }
|
||||
;
|
||||
|
||||
@ -930,10 +970,11 @@ setspecs: /* empty */
|
||||
declspec_stack = tree_cons (prefix_attributes,
|
||||
current_declspecs,
|
||||
declspec_stack);
|
||||
current_declspecs = $<ttype>0;
|
||||
prefix_attributes = NULL_TREE; }
|
||||
split_specs_attrs ($<ttype>0,
|
||||
¤t_declspecs, &prefix_attributes); }
|
||||
;
|
||||
|
||||
/* ??? Yuck. See after_type_declarator. */
|
||||
setattrs: /* empty */
|
||||
{ prefix_attributes = chainon (prefix_attributes, $<ttype>0); }
|
||||
;
|
||||
@ -963,11 +1004,14 @@ decl:
|
||||
{ shadow_tag ($1); }
|
||||
| declmods ';'
|
||||
{ pedwarn ("empty declaration"); }
|
||||
| extension decl
|
||||
{ pedantic = $<itype>1; }
|
||||
;
|
||||
|
||||
/* Declspecs which contain at least one type specifier or typedef name.
|
||||
(Just `const' or `volatile' is not enough.)
|
||||
A typedef'd name following these is taken as a name to be declared. */
|
||||
A typedef'd name following these is taken as a name to be declared.
|
||||
Declspecs have a non-NULL TREE_VALUE, attributes do not. */
|
||||
|
||||
typed_declspecs:
|
||||
typespec reserved_declspecs
|
||||
@ -985,22 +1029,55 @@ reserved_declspecs: /* empty */
|
||||
warning ("`%s' is not at beginning of declaration",
|
||||
IDENTIFIER_POINTER ($2));
|
||||
$$ = tree_cons (NULL_TREE, $2, $1); }
|
||||
| reserved_declspecs attributes
|
||||
{ $$ = tree_cons ($2, NULL_TREE, $1); }
|
||||
;
|
||||
|
||||
/* List of just storage classes and type modifiers.
|
||||
typed_declspecs_no_prefix_attr:
|
||||
typespec reserved_declspecs_no_prefix_attr
|
||||
{ $$ = tree_cons (NULL_TREE, $1, $2); }
|
||||
| declmods_no_prefix_attr typespec reserved_declspecs_no_prefix_attr
|
||||
{ $$ = chainon ($3, tree_cons (NULL_TREE, $2, $1)); }
|
||||
;
|
||||
|
||||
reserved_declspecs_no_prefix_attr:
|
||||
/* empty */
|
||||
{ $$ = NULL_TREE; }
|
||||
| reserved_declspecs_no_prefix_attr typespecqual_reserved
|
||||
{ $$ = tree_cons (NULL_TREE, $2, $1); }
|
||||
| reserved_declspecs_no_prefix_attr SCSPEC
|
||||
{ if (extra_warnings)
|
||||
warning ("`%s' is not at beginning of declaration",
|
||||
IDENTIFIER_POINTER ($2));
|
||||
$$ = tree_cons (NULL_TREE, $2, $1); }
|
||||
;
|
||||
|
||||
/* List of just storage classes, type modifiers, and prefix attributes.
|
||||
A declaration can start with just this, but then it cannot be used
|
||||
to redeclare a typedef-name. */
|
||||
to redeclare a typedef-name.
|
||||
Declspecs have a non-NULL TREE_VALUE, attributes do not. */
|
||||
|
||||
declmods:
|
||||
declmods_no_prefix_attr
|
||||
{ $$ = $1; }
|
||||
| attributes
|
||||
{ $$ = tree_cons ($1, NULL_TREE, NULL_TREE); }
|
||||
| declmods declmods_no_prefix_attr
|
||||
{ $$ = chainon ($2, $1); }
|
||||
| declmods attributes
|
||||
{ $$ = tree_cons ($2, NULL_TREE, $1); }
|
||||
;
|
||||
|
||||
declmods_no_prefix_attr:
|
||||
TYPE_QUAL
|
||||
{ $$ = tree_cons (NULL_TREE, $1, NULL_TREE);
|
||||
TREE_STATIC ($$) = 1; }
|
||||
| SCSPEC
|
||||
{ $$ = tree_cons (NULL_TREE, $1, NULL_TREE); }
|
||||
| declmods TYPE_QUAL
|
||||
| declmods_no_prefix_attr TYPE_QUAL
|
||||
{ $$ = tree_cons (NULL_TREE, $2, $1);
|
||||
TREE_STATIC ($$) = 1; }
|
||||
| declmods SCSPEC
|
||||
| declmods_no_prefix_attr SCSPEC
|
||||
{ if (extra_warnings && TREE_STATIC ($1))
|
||||
warning ("`%s' is not at beginning of declaration",
|
||||
IDENTIFIER_POINTER ($2));
|
||||
@ -1041,6 +1118,11 @@ ifobjc
|
||||
{ $$ = get_static_reference ($1, $2); }
|
||||
| OBJECTNAME protocolrefs
|
||||
{ $$ = get_object_reference ($2); }
|
||||
|
||||
/* Make "<SomeProtocol>" equivalent to "id <SomeProtocol>"
|
||||
- nisse@lysator.liu.se */
|
||||
| non_empty_protocolrefs
|
||||
{ $$ = get_object_reference ($1); }
|
||||
end ifobjc
|
||||
| TYPEOF '(' expr ')'
|
||||
{ $$ = TREE_TYPE ($3); }
|
||||
@ -1232,7 +1314,7 @@ nested_function:
|
||||
YYERROR1;
|
||||
}
|
||||
reinit_parse_for_function (); }
|
||||
xdecls
|
||||
old_style_parm_decls
|
||||
{ store_parm_decls (); }
|
||||
/* This used to use compstmt_or_error.
|
||||
That caused a bug with input `f(g) int g {}',
|
||||
@ -1255,7 +1337,7 @@ notype_nested_function:
|
||||
YYERROR1;
|
||||
}
|
||||
reinit_parse_for_function (); }
|
||||
xdecls
|
||||
old_style_parm_decls
|
||||
{ store_parm_decls (); }
|
||||
/* This used to use compstmt_or_error.
|
||||
That caused a bug with input `f(g) int g {}',
|
||||
@ -1292,6 +1374,11 @@ after_type_declarator:
|
||||
{ $$ = build_nt (ARRAY_REF, $1, NULL_TREE); }
|
||||
| '*' type_quals after_type_declarator %prec UNARY
|
||||
{ $$ = make_pointer_declarator ($2, $3); }
|
||||
/* ??? Yuck. setattrs is a quick hack. We can't use
|
||||
prefix_attributes because $1 only applies to this
|
||||
declarator. We assume setspecs has already been done.
|
||||
setattrs also avoids 5 reduce/reduce conflicts (otherwise multiple
|
||||
attributes could be recognized here or in `attributes'). */
|
||||
| attributes setattrs after_type_declarator
|
||||
{ $$ = $3; }
|
||||
| TYPENAME
|
||||
@ -1317,6 +1404,11 @@ parm_declarator:
|
||||
{ $$ = build_nt (ARRAY_REF, $1, NULL_TREE); }
|
||||
| '*' type_quals parm_declarator %prec UNARY
|
||||
{ $$ = make_pointer_declarator ($2, $3); }
|
||||
/* ??? Yuck. setattrs is a quick hack. We can't use
|
||||
prefix_attributes because $1 only applies to this
|
||||
declarator. We assume setspecs has already been done.
|
||||
setattrs also avoids 5 reduce/reduce conflicts (otherwise multiple
|
||||
attributes could be recognized here or in `attributes'). */
|
||||
| attributes setattrs parm_declarator
|
||||
{ $$ = $3; }
|
||||
| TYPENAME
|
||||
@ -1339,47 +1431,73 @@ notype_declarator:
|
||||
{ $$ = build_nt (ARRAY_REF, $1, $3); }
|
||||
| notype_declarator '[' ']' %prec '.'
|
||||
{ $$ = build_nt (ARRAY_REF, $1, NULL_TREE); }
|
||||
/* ??? Yuck. setattrs is a quick hack. We can't use
|
||||
prefix_attributes because $1 only applies to this
|
||||
declarator. We assume setspecs has already been done.
|
||||
setattrs also avoids 5 reduce/reduce conflicts (otherwise multiple
|
||||
attributes could be recognized here or in `attributes'). */
|
||||
| attributes setattrs notype_declarator
|
||||
{ $$ = $3; }
|
||||
| IDENTIFIER
|
||||
;
|
||||
|
||||
struct_head:
|
||||
STRUCT
|
||||
{ $$ = NULL_TREE; }
|
||||
| STRUCT attributes
|
||||
{ $$ = $2; }
|
||||
;
|
||||
|
||||
union_head:
|
||||
UNION
|
||||
{ $$ = NULL_TREE; }
|
||||
| UNION attributes
|
||||
{ $$ = $2; }
|
||||
;
|
||||
|
||||
enum_head:
|
||||
ENUM
|
||||
{ $$ = NULL_TREE; }
|
||||
| ENUM attributes
|
||||
{ $$ = $2; }
|
||||
;
|
||||
|
||||
structsp:
|
||||
STRUCT identifier '{'
|
||||
struct_head identifier '{'
|
||||
{ $$ = start_struct (RECORD_TYPE, $2);
|
||||
/* Start scope of tag before parsing components. */
|
||||
}
|
||||
component_decl_list '}' maybe_attribute
|
||||
{ $$ = finish_struct ($<ttype>4, $5, $7); }
|
||||
| STRUCT '{' component_decl_list '}' maybe_attribute
|
||||
{ $$ = finish_struct ($<ttype>4, $5, chainon ($1, $7)); }
|
||||
| struct_head '{' component_decl_list '}' maybe_attribute
|
||||
{ $$ = finish_struct (start_struct (RECORD_TYPE, NULL_TREE),
|
||||
$3, $5);
|
||||
$3, chainon ($1, $5));
|
||||
}
|
||||
| STRUCT identifier
|
||||
| struct_head identifier
|
||||
{ $$ = xref_tag (RECORD_TYPE, $2); }
|
||||
| UNION identifier '{'
|
||||
| union_head identifier '{'
|
||||
{ $$ = start_struct (UNION_TYPE, $2); }
|
||||
component_decl_list '}' maybe_attribute
|
||||
{ $$ = finish_struct ($<ttype>4, $5, $7); }
|
||||
| UNION '{' component_decl_list '}' maybe_attribute
|
||||
{ $$ = finish_struct ($<ttype>4, $5, chainon ($1, $7)); }
|
||||
| union_head '{' component_decl_list '}' maybe_attribute
|
||||
{ $$ = finish_struct (start_struct (UNION_TYPE, NULL_TREE),
|
||||
$3, $5);
|
||||
$3, chainon ($1, $5));
|
||||
}
|
||||
| UNION identifier
|
||||
| union_head identifier
|
||||
{ $$ = xref_tag (UNION_TYPE, $2); }
|
||||
| ENUM identifier '{'
|
||||
| enum_head identifier '{'
|
||||
{ $<itype>3 = suspend_momentary ();
|
||||
$$ = start_enum ($2); }
|
||||
enumlist maybecomma_warn '}' maybe_attribute
|
||||
{ $$ = finish_enum ($<ttype>4, nreverse ($5), $8);
|
||||
{ $$= finish_enum ($<ttype>4, nreverse ($5), chainon ($1, $8));
|
||||
resume_momentary ($<itype>3); }
|
||||
| ENUM '{'
|
||||
| enum_head '{'
|
||||
{ $<itype>2 = suspend_momentary ();
|
||||
$$ = start_enum (NULL_TREE); }
|
||||
enumlist maybecomma_warn '}' maybe_attribute
|
||||
{ $$ = finish_enum ($<ttype>3, nreverse ($4), $7);
|
||||
{ $$= finish_enum ($<ttype>3, nreverse ($4), chainon ($1, $7));
|
||||
resume_momentary ($<itype>2); }
|
||||
| ENUM identifier
|
||||
| enum_head identifier
|
||||
{ $$ = xref_tag (ENUMERAL_TYPE, $2); }
|
||||
;
|
||||
|
||||
@ -1461,6 +1579,9 @@ component_decl:
|
||||
$$ = NULL_TREE; }
|
||||
| error
|
||||
{ $$ = NULL_TREE; }
|
||||
| extension component_decl
|
||||
{ $$ = $2;
|
||||
pedantic = $<itype>1; }
|
||||
;
|
||||
|
||||
components:
|
||||
@ -1553,8 +1674,8 @@ absdcl1: /* a nonempty absolute declarator */
|
||||
{ $$ = build_nt (ARRAY_REF, NULL_TREE, $2); }
|
||||
| '[' ']' %prec '.'
|
||||
{ $$ = build_nt (ARRAY_REF, NULL_TREE, NULL_TREE); }
|
||||
| attributes setattrs absdcl1
|
||||
{ $$ = $3; }
|
||||
/* ??? It appears we have to support attributes here, however
|
||||
using prefix_attributes is wrong. */
|
||||
;
|
||||
|
||||
/* at least one statement, the first of which parses without error. */
|
||||
@ -1632,9 +1753,11 @@ compstmt_or_error:
|
||||
| error compstmt
|
||||
;
|
||||
|
||||
compstmt: '{' '}'
|
||||
compstmt_start: '{' { compstmt_count++; }
|
||||
|
||||
compstmt: compstmt_start '}'
|
||||
{ $$ = convert (void_type_node, integer_zero_node); }
|
||||
| '{' pushlevel maybe_label_decls decls xstmts '}'
|
||||
| compstmt_start pushlevel maybe_label_decls decls xstmts '}'
|
||||
{ emit_line_note (input_filename, lineno);
|
||||
expand_end_bindings (getdecls (), 1, 0);
|
||||
$$ = poplevel (1, 1, 0);
|
||||
@ -1642,7 +1765,7 @@ compstmt: '{' '}'
|
||||
pop_momentary_nofree ();
|
||||
else
|
||||
pop_momentary (); }
|
||||
| '{' pushlevel maybe_label_decls error '}'
|
||||
| compstmt_start pushlevel maybe_label_decls error '}'
|
||||
{ emit_line_note (input_filename, lineno);
|
||||
expand_end_bindings (getdecls (), kept_level_p (), 0);
|
||||
$$ = poplevel (kept_level_p (), 0, 0);
|
||||
@ -1650,7 +1773,7 @@ compstmt: '{' '}'
|
||||
pop_momentary_nofree ();
|
||||
else
|
||||
pop_momentary (); }
|
||||
| '{' pushlevel maybe_label_decls stmts '}'
|
||||
| compstmt_start pushlevel maybe_label_decls stmts '}'
|
||||
{ emit_line_note (input_filename, lineno);
|
||||
expand_end_bindings (getdecls (), kept_level_p (), 0);
|
||||
$$ = poplevel (kept_level_p (), 0, 0);
|
||||
@ -1663,8 +1786,8 @@ compstmt: '{' '}'
|
||||
/* Value is number of statements counted as of the closeparen. */
|
||||
simple_if:
|
||||
if_prefix lineno_labeled_stmt
|
||||
/* Make sure expand_end_cond is run once
|
||||
for each call to expand_start_cond.
|
||||
/* Make sure c_expand_end_cond is run once
|
||||
for each call to c_expand_start_cond.
|
||||
Otherwise a crash is likely. */
|
||||
| if_prefix error
|
||||
;
|
||||
@ -1672,7 +1795,8 @@ simple_if:
|
||||
if_prefix:
|
||||
IF '(' expr ')'
|
||||
{ emit_line_note ($<filename>-1, $<lineno>0);
|
||||
expand_start_cond (truthvalue_conversion ($3), 0);
|
||||
c_expand_start_cond (truthvalue_conversion ($3), 0,
|
||||
compstmt_count);
|
||||
$<itype>$ = stmt_count;
|
||||
if_stmt_file = $<filename>-1;
|
||||
if_stmt_line = $<lineno>0;
|
||||
@ -1685,6 +1809,7 @@ if_prefix:
|
||||
do_stmt_start:
|
||||
DO
|
||||
{ stmt_count++;
|
||||
compstmt_count++;
|
||||
emit_line_note ($<filename>-1, $<lineno>0);
|
||||
/* See comment in `while' alternative, above. */
|
||||
emit_nop ();
|
||||
@ -1747,15 +1872,15 @@ stmt:
|
||||
iterator_expand ($1);
|
||||
clear_momentary (); }
|
||||
| simple_if ELSE
|
||||
{ expand_start_else ();
|
||||
{ c_expand_start_else ();
|
||||
$<itype>1 = stmt_count;
|
||||
position_after_white_space (); }
|
||||
lineno_labeled_stmt
|
||||
{ expand_end_cond ();
|
||||
{ c_expand_end_cond ();
|
||||
if (extra_warnings && stmt_count == $<itype>1)
|
||||
warning ("empty body in an else-statement"); }
|
||||
| simple_if %prec IF
|
||||
{ expand_end_cond ();
|
||||
{ c_expand_end_cond ();
|
||||
/* This warning is here instead of in simple_if, because we
|
||||
do not want a warning if an empty if is followed by an
|
||||
else statement. Increment stmt_count so we don't
|
||||
@ -1763,11 +1888,11 @@ stmt:
|
||||
if (extra_warnings && stmt_count++ == $<itype>1)
|
||||
warning_with_file_and_line (if_stmt_file, if_stmt_line,
|
||||
"empty body in an if-statement"); }
|
||||
/* Make sure expand_end_cond is run once
|
||||
for each call to expand_start_cond.
|
||||
/* Make sure c_expand_end_cond is run once
|
||||
for each call to c_expand_start_cond.
|
||||
Otherwise a crash is likely. */
|
||||
| simple_if ELSE error
|
||||
{ expand_end_cond (); }
|
||||
{ c_expand_end_cond (); }
|
||||
| WHILE
|
||||
{ stmt_count++;
|
||||
emit_line_note ($<filename>-1, $<lineno>0);
|
||||
@ -1919,7 +2044,9 @@ stmt:
|
||||
}
|
||||
}
|
||||
| GOTO '*' expr ';'
|
||||
{ stmt_count++;
|
||||
{ if (pedantic)
|
||||
pedwarn ("ANSI C forbids `goto *expr;'");
|
||||
stmt_count++;
|
||||
emit_line_note ($<filename>-1, $<lineno>0);
|
||||
expand_computed_goto (convert (ptr_type_node, $3)); }
|
||||
| ';'
|
||||
@ -1997,8 +2124,14 @@ label: CASE expr_no_commas ':'
|
||||
if (value != error_mark_node)
|
||||
{
|
||||
tree duplicate;
|
||||
int success = pushcase (value, convert_and_check,
|
||||
label, &duplicate);
|
||||
int success;
|
||||
|
||||
if (pedantic && ! INTEGRAL_TYPE_P (TREE_TYPE (value)))
|
||||
pedwarn ("label must have integral type in ANSI C");
|
||||
|
||||
success = pushcase (value, convert_and_check,
|
||||
label, &duplicate);
|
||||
|
||||
if (success == 1)
|
||||
error ("case label not within a switch statement");
|
||||
else if (success == 2)
|
||||
@ -2018,6 +2151,8 @@ label: CASE expr_no_commas ':'
|
||||
register tree label
|
||||
= build_decl (LABEL_DECL, NULL_TREE, NULL_TREE);
|
||||
|
||||
if (pedantic)
|
||||
pedwarn ("ANSI C forbids case ranges");
|
||||
stmt_count++;
|
||||
|
||||
if (value1 != error_mark_node && value2 != error_mark_node)
|
||||
@ -2250,6 +2385,12 @@ identifiers_or_typenames:
|
||||
| identifiers_or_typenames ',' identifier
|
||||
{ $$ = chainon ($1, build_tree_list (NULL_TREE, $3)); }
|
||||
;
|
||||
|
||||
extension:
|
||||
EXTENSION
|
||||
{ $<itype>$ = pedantic;
|
||||
pedantic = 0; }
|
||||
;
|
||||
|
||||
ifobjc
|
||||
/* Objective-C productions. */
|
||||
@ -2436,7 +2577,11 @@ protocolrefs:
|
||||
{
|
||||
$$ = NULL_TREE;
|
||||
}
|
||||
| ARITHCOMPARE identifier_list ARITHCOMPARE
|
||||
| non_empty_protocolrefs
|
||||
;
|
||||
|
||||
non_empty_protocolrefs:
|
||||
ARITHCOMPARE identifier_list ARITHCOMPARE
|
||||
{
|
||||
if ($1 == LT_EXPR && $3 == GT_EXPR)
|
||||
$$ = $2;
|
||||
@ -2602,20 +2747,28 @@ semi_or_error:
|
||||
methodproto:
|
||||
'+'
|
||||
{
|
||||
/* Remember protocol qualifiers in prototypes. */
|
||||
remember_protocol_qualifiers ();
|
||||
objc_inherit_code = CLASS_METHOD_DECL;
|
||||
}
|
||||
methoddecl
|
||||
{
|
||||
/* Forget protocol qualifiers here. */
|
||||
forget_protocol_qualifiers ();
|
||||
add_class_method (objc_interface_context, $3);
|
||||
}
|
||||
semi_or_error
|
||||
|
||||
| '-'
|
||||
{
|
||||
/* Remember protocol qualifiers in prototypes. */
|
||||
remember_protocol_qualifiers ();
|
||||
objc_inherit_code = INSTANCE_METHOD_DECL;
|
||||
}
|
||||
methoddecl
|
||||
{
|
||||
/* Forget protocol qualifiers here. */
|
||||
forget_protocol_qualifiers ();
|
||||
add_instance_method (objc_interface_context, $3);
|
||||
}
|
||||
semi_or_error
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Handle #pragma, system V.4 style. Supports #pragma weak and #pragma pack.
|
||||
Copyright (C) 1992 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1997 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@ -18,18 +18,22 @@ 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 <stdio.h>
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "rtl.h"
|
||||
#include "tree.h"
|
||||
#include "except.h"
|
||||
#include "function.h"
|
||||
#include "defaults.h"
|
||||
#include "c-pragma.h"
|
||||
#include "flags.h"
|
||||
#include "toplev.h"
|
||||
|
||||
#ifdef HANDLE_SYSV_PRAGMA
|
||||
|
||||
/* When structure field packing is in effect, this variable is the
|
||||
number of bits to use as the maximum alignment. When packing is not
|
||||
in effect, this is zero. */
|
||||
in effect, this is zero. */
|
||||
|
||||
extern int maximum_field_alignment;
|
||||
|
||||
@ -64,7 +68,7 @@ handle_pragma_token (string, token)
|
||||
if (HANDLE_PRAGMA_WEAK)
|
||||
handle_pragma_weak (state, name, value);
|
||||
|
||||
#endif /* HANDLE_PRAMA_WEAK */
|
||||
#endif /* HANDLE_PRAGMA_WEAK */
|
||||
}
|
||||
|
||||
type = state = ps_start;
|
||||
@ -81,7 +85,16 @@ handle_pragma_token (string, token)
|
||||
else if (strcmp (IDENTIFIER_POINTER (token), "weak") == 0)
|
||||
type = state = ps_weak;
|
||||
else
|
||||
type = state = ps_done;
|
||||
{
|
||||
type = state = ps_done;
|
||||
|
||||
/* Issue a warning message if we have been asked to do so.
|
||||
Ignoring unknown pragmas in system header file unless
|
||||
an explcit -Wunknown-pragmas has been given. */
|
||||
if (warn_unknown_pragmas > 1
|
||||
|| (warn_unknown_pragmas && ! in_system_header))
|
||||
warning ("ignoring pragma: %s", string);
|
||||
}
|
||||
}
|
||||
else
|
||||
type = state = ps_done;
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,5 +1,5 @@
|
||||
/* Save and restore call-clobbered registers which are live across a call.
|
||||
Copyright (C) 1989, 1992, 1994, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1989, 1992, 94-95, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@ -19,6 +19,7 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
#include "config.h"
|
||||
#include "system.h"
|
||||
#include "rtl.h"
|
||||
#include "insn-config.h"
|
||||
#include "flags.h"
|
||||
@ -28,6 +29,7 @@ Boston, MA 02111-1307, USA. */
|
||||
#include "basic-block.h"
|
||||
#include "reload.h"
|
||||
#include "expr.h"
|
||||
#include "toplev.h"
|
||||
|
||||
#ifndef MAX_MOVE_MAX
|
||||
#define MAX_MOVE_MAX MOVE_MAX
|
||||
@ -143,11 +145,11 @@ init_caller_save ()
|
||||
if (i == FIRST_PSEUDO_REGISTER)
|
||||
abort ();
|
||||
|
||||
addr_reg = gen_rtx (REG, Pmode, i);
|
||||
addr_reg = gen_rtx_REG (Pmode, i);
|
||||
|
||||
for (offset = 1 << (HOST_BITS_PER_INT / 2); offset; offset >>= 1)
|
||||
{
|
||||
address = gen_rtx (PLUS, Pmode, addr_reg, GEN_INT (offset));
|
||||
address = gen_rtx_PLUS (Pmode, addr_reg, GEN_INT (offset));
|
||||
|
||||
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
|
||||
if (regno_save_mode[i][1] != VOIDmode
|
||||
@ -171,10 +173,10 @@ init_caller_save ()
|
||||
for (j = 1; j <= MOVE_MAX / UNITS_PER_WORD; j++)
|
||||
if (regno_save_mode[i][j] != VOIDmode)
|
||||
{
|
||||
rtx mem = gen_rtx (MEM, regno_save_mode[i][j], address);
|
||||
rtx reg = gen_rtx (REG, regno_save_mode[i][j], i);
|
||||
rtx savepat = gen_rtx (SET, VOIDmode, mem, reg);
|
||||
rtx restpat = gen_rtx (SET, VOIDmode, reg, mem);
|
||||
rtx mem = gen_rtx_MEM (regno_save_mode[i][j], address);
|
||||
rtx reg = gen_rtx_REG (regno_save_mode[i][j], i);
|
||||
rtx savepat = gen_rtx_SET (VOIDmode, mem, reg);
|
||||
rtx restpat = gen_rtx_SET (VOIDmode, reg, mem);
|
||||
rtx saveinsn = emit_insn (savepat);
|
||||
rtx restinsn = emit_insn (restpat);
|
||||
int ok;
|
||||
@ -182,7 +184,8 @@ init_caller_save ()
|
||||
reg_save_code[i][j] = recog_memoized (saveinsn);
|
||||
reg_restore_code[i][j] = recog_memoized (restinsn);
|
||||
|
||||
/* Now extract both insns and see if we can meet their constraints. */
|
||||
/* Now extract both insns and see if we can meet their
|
||||
constraints. */
|
||||
ok = (reg_save_code[i][j] != -1 && reg_restore_code[i][j] != -1);
|
||||
if (ok)
|
||||
{
|
||||
@ -261,7 +264,7 @@ setup_save_areas (pchanged)
|
||||
/* Find and record all call-used hard-registers in this function. */
|
||||
CLEAR_HARD_REG_SET (hard_regs_used);
|
||||
for (i = FIRST_PSEUDO_REGISTER; i < max_regno; i++)
|
||||
if (reg_renumber[i] >= 0 && reg_n_calls_crossed[i] > 0)
|
||||
if (reg_renumber[i] >= 0 && REG_N_CALLS_CROSSED (i) > 0)
|
||||
{
|
||||
int regno = reg_renumber[i];
|
||||
int endregno
|
||||
@ -307,7 +310,7 @@ setup_save_areas (pchanged)
|
||||
ok &= (TEST_HARD_REG_BIT (hard_regs_used, regno) != 0);
|
||||
}
|
||||
|
||||
/* We have found an acceptable mode to store in. */
|
||||
/* We have found an acceptable mode to store in. */
|
||||
if (ok)
|
||||
{
|
||||
|
||||
@ -315,13 +318,13 @@ setup_save_areas (pchanged)
|
||||
= assign_stack_local (regno_save_mode[i][j],
|
||||
GET_MODE_SIZE (regno_save_mode[i][j]), 0);
|
||||
|
||||
/* Setup single word save area just in case... */
|
||||
/* Setup single word save area just in case... */
|
||||
for (k = 0; k < j; k++)
|
||||
{
|
||||
/* This should not depend on WORDS_BIG_ENDIAN.
|
||||
The order of words in regs is the same as in memory. */
|
||||
rtx temp = gen_rtx (MEM, regno_save_mode[i+k][1],
|
||||
XEXP (regno_save_mem[i][j], 0));
|
||||
rtx temp = gen_rtx_MEM (regno_save_mode[i+k][1],
|
||||
XEXP (regno_save_mem[i][j], 0));
|
||||
|
||||
regno_save_mem[i+k][1]
|
||||
= adj_offsettable_operand (temp, k * UNITS_PER_WORD);
|
||||
@ -356,8 +359,7 @@ save_call_clobbered_regs (insn_mode)
|
||||
{
|
||||
regset regs_live = basic_block_live_at_start[b];
|
||||
rtx prev_block_last = PREV_INSN (basic_block_head[b]);
|
||||
REGSET_ELT_TYPE bit;
|
||||
int offset, i, j;
|
||||
int i, j;
|
||||
int regno;
|
||||
|
||||
/* Compute hard regs live at start of block -- this is the
|
||||
@ -366,31 +368,20 @@ save_call_clobbered_regs (insn_mode)
|
||||
saved because we restore all of them before the end of the basic
|
||||
block. */
|
||||
|
||||
#ifdef HARD_REG_SET
|
||||
hard_regs_live = *regs_live;
|
||||
#else
|
||||
COPY_HARD_REG_SET (hard_regs_live, regs_live);
|
||||
#endif
|
||||
|
||||
REG_SET_TO_HARD_REG_SET (hard_regs_live, regs_live);
|
||||
CLEAR_HARD_REG_SET (hard_regs_saved);
|
||||
CLEAR_HARD_REG_SET (hard_regs_need_restore);
|
||||
n_regs_saved = 0;
|
||||
|
||||
for (offset = 0, i = 0; offset < regset_size; offset++)
|
||||
{
|
||||
if (regs_live[offset] == 0)
|
||||
i += REGSET_ELT_BITS;
|
||||
else
|
||||
for (bit = 1; bit && i < max_regno; bit <<= 1, i++)
|
||||
if ((regs_live[offset] & bit)
|
||||
&& (regno = reg_renumber[i]) >= 0)
|
||||
for (j = regno;
|
||||
j < regno + HARD_REGNO_NREGS (regno,
|
||||
PSEUDO_REGNO_MODE (i));
|
||||
j++)
|
||||
SET_HARD_REG_BIT (hard_regs_live, j);
|
||||
|
||||
}
|
||||
EXECUTE_IF_SET_IN_REG_SET (regs_live, 0, i,
|
||||
{
|
||||
if ((regno = reg_renumber[i]) >= 0)
|
||||
for (j = regno;
|
||||
j < regno + HARD_REGNO_NREGS (regno,
|
||||
PSEUDO_REGNO_MODE (i));
|
||||
j++)
|
||||
SET_HARD_REG_BIT (hard_regs_live, j);
|
||||
});
|
||||
|
||||
/* Now scan the insns in the block, keeping track of what hard
|
||||
regs are live as we go. When we see a call, save the live
|
||||
@ -515,7 +506,8 @@ save_call_clobbered_regs (insn_mode)
|
||||
|
||||
static void
|
||||
set_reg_live (reg, setter)
|
||||
rtx reg, setter;
|
||||
rtx reg;
|
||||
rtx setter ATTRIBUTE_UNUSED;
|
||||
{
|
||||
register int regno, endregno, i;
|
||||
enum machine_mode mode = GET_MODE (reg);
|
||||
@ -650,9 +642,9 @@ insert_save_restore (insn, save_p, regno, insn_mode, maxrestore)
|
||||
enum machine_mode insn_mode;
|
||||
int maxrestore;
|
||||
{
|
||||
rtx pat;
|
||||
enum insn_code code;
|
||||
int i, numregs;
|
||||
rtx pat = NULL_RTX;
|
||||
enum insn_code code = CODE_FOR_nothing;
|
||||
int numregs = 0;
|
||||
|
||||
/* A common failure mode if register status is not correct in the RTL
|
||||
is for this routine to be called with a REGNO we didn't expect to
|
||||
@ -702,8 +694,9 @@ insert_save_restore (insn, save_p, regno, insn_mode, maxrestore)
|
||||
if (! ok)
|
||||
continue;
|
||||
|
||||
pat = gen_rtx (SET, VOIDmode, regno_save_mem[regno][i],
|
||||
gen_rtx (REG, GET_MODE (regno_save_mem[regno][i]), regno));
|
||||
pat = gen_rtx_SET (VOIDmode, regno_save_mem[regno][i],
|
||||
gen_rtx_REG (GET_MODE (regno_save_mem[regno][i]),
|
||||
regno));
|
||||
code = reg_save_code[regno][i];
|
||||
|
||||
/* Set hard_regs_saved for all the registers we saved. */
|
||||
@ -741,9 +734,9 @@ insert_save_restore (insn, save_p, regno, insn_mode, maxrestore)
|
||||
if (! ok)
|
||||
continue;
|
||||
|
||||
pat = gen_rtx (SET, VOIDmode,
|
||||
gen_rtx (REG, GET_MODE (regno_save_mem[regno][i]),
|
||||
regno),
|
||||
pat = gen_rtx_SET (VOIDmode,
|
||||
gen_rtx_REG (GET_MODE (regno_save_mem[regno][i]),
|
||||
regno),
|
||||
regno_save_mem[regno][i]);
|
||||
code = reg_restore_code[regno][i];
|
||||
|
||||
|
1268
contrib/gcc/calls.c
1268
contrib/gcc/calls.c
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
211
contrib/gcc/choose-temp.c
Normal file
211
contrib/gcc/choose-temp.c
Normal file
@ -0,0 +1,211 @@
|
||||
/* Utility to pick a temporary filename prefix.
|
||||
Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of the libiberty library.
|
||||
Libiberty is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Library General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2 of the License, or (at your option) any later version.
|
||||
|
||||
Libiberty 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
|
||||
Library General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Library General Public
|
||||
License along with libiberty; see the file COPYING.LIB. If not,
|
||||
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This file exports two functions: choose_temp_base and make_temp_file. */
|
||||
|
||||
/* This file lives in at least two places: libiberty and gcc.
|
||||
Don't change one without the other. */
|
||||
|
||||
#if defined (IN_GCC) || defined (HAVE_CONFIG_H)
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef IN_GCC
|
||||
#include "system.h"
|
||||
#else
|
||||
|
||||
/* If we are in gcc, system.h has handled everything. When not in
|
||||
gcc, if we have a config.h we assume that HAVE_SYS_FILE_H tells us
|
||||
whether to include sys/file.h. However, libiberty does not have a
|
||||
config.h, and instead arranges to define NO_SYS_FILE_H on the
|
||||
command line when there is no sys/file.h. */
|
||||
|
||||
#if defined (HAVE_CONFIG_H) ? defined (HAVE_SYS_FILE_H) : ! defined (NO_SYS_FILE_H)
|
||||
#include <sys/types.h>
|
||||
#include <sys/file.h> /* May get R_OK, etc. on some systems. */
|
||||
#endif
|
||||
|
||||
#ifndef R_OK
|
||||
#define R_OK 4
|
||||
#define W_OK 2
|
||||
#define X_OK 1
|
||||
#endif
|
||||
|
||||
#include <stdio.h> /* May get P_tmpdir. */
|
||||
#endif /* IN_GCC */
|
||||
|
||||
#ifdef IN_GCC
|
||||
#include "gansidecl.h"
|
||||
extern char *xmalloc ();
|
||||
#else
|
||||
#include "ansidecl.h"
|
||||
#include "libiberty.h"
|
||||
#if defined (__MSDOS__) || defined (_WIN32)
|
||||
#define DIR_SEPARATOR '\\'
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef DIR_SEPARATOR
|
||||
#define DIR_SEPARATOR '/'
|
||||
#endif
|
||||
|
||||
/* On MSDOS, write temp files in current dir
|
||||
because there's no place else we can expect to use. */
|
||||
/* ??? Although the current directory is tried as a last resort,
|
||||
this is left in so that on MSDOS it is preferred to /tmp on the
|
||||
off chance that someone requires this, since that was the previous
|
||||
behaviour. */
|
||||
#ifdef __MSDOS__
|
||||
#ifndef P_tmpdir
|
||||
#define P_tmpdir "."
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Name of temporary file.
|
||||
mktemp requires 6 trailing X's. */
|
||||
#define TEMP_FILE "ccXXXXXX"
|
||||
|
||||
/* Subroutine of choose_temp_base.
|
||||
If BASE is non-NULL, return it.
|
||||
Otherwise it checks if DIR is a usable directory.
|
||||
If success, DIR is returned.
|
||||
Otherwise NULL is returned. */
|
||||
|
||||
static char *
|
||||
try (dir, base)
|
||||
char *dir, *base;
|
||||
{
|
||||
if (base != 0)
|
||||
return base;
|
||||
if (dir != 0
|
||||
&& access (dir, R_OK | W_OK | X_OK) == 0)
|
||||
return dir;
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Return a prefix for temporary file names or NULL if unable to find one.
|
||||
The current directory is chosen if all else fails so the program is
|
||||
exited if a temporary directory can't be found (mktemp fails).
|
||||
The buffer for the result is obtained with xmalloc.
|
||||
|
||||
This function is provided for backwards compatability only. It use
|
||||
is not recommended. */
|
||||
|
||||
char *
|
||||
choose_temp_base ()
|
||||
{
|
||||
char *base = 0;
|
||||
char *temp_filename;
|
||||
int len;
|
||||
static char tmp[] = { DIR_SEPARATOR, 't', 'm', 'p', 0 };
|
||||
static char usrtmp[] = { DIR_SEPARATOR, 'u', 's', 'r', DIR_SEPARATOR, 't', 'm', 'p', 0 };
|
||||
|
||||
base = try (getenv ("TMPDIR"), base);
|
||||
base = try (getenv ("TMP"), base);
|
||||
base = try (getenv ("TEMP"), base);
|
||||
|
||||
#ifdef P_tmpdir
|
||||
base = try (P_tmpdir, base);
|
||||
#endif
|
||||
|
||||
/* Try /usr/tmp, then /tmp. */
|
||||
base = try (usrtmp, base);
|
||||
base = try (tmp, base);
|
||||
|
||||
/* If all else fails, use the current directory! */
|
||||
if (base == 0)
|
||||
base = ".";
|
||||
|
||||
len = strlen (base);
|
||||
temp_filename = xmalloc (len + 1 /*DIR_SEPARATOR*/
|
||||
+ strlen (TEMP_FILE) + 1);
|
||||
strcpy (temp_filename, base);
|
||||
|
||||
if (len != 0
|
||||
&& temp_filename[len-1] != '/'
|
||||
&& temp_filename[len-1] != DIR_SEPARATOR)
|
||||
temp_filename[len++] = DIR_SEPARATOR;
|
||||
strcpy (temp_filename + len, TEMP_FILE);
|
||||
|
||||
mktemp (temp_filename);
|
||||
if (strlen (temp_filename) == 0)
|
||||
abort ();
|
||||
return temp_filename;
|
||||
}
|
||||
/* Return a temporary file name (as a string) or NULL if unable to create
|
||||
one. */
|
||||
|
||||
char *
|
||||
make_temp_file (suffix)
|
||||
char *suffix;
|
||||
{
|
||||
char *base = 0;
|
||||
char *temp_filename;
|
||||
int base_len, suffix_len;
|
||||
int fd;
|
||||
static char tmp[] = { DIR_SEPARATOR, 't', 'm', 'p', 0 };
|
||||
static char usrtmp[] = { DIR_SEPARATOR, 'u', 's', 'r', DIR_SEPARATOR, 't', 'm', 'p', 0 };
|
||||
|
||||
base = try (getenv ("TMPDIR"), base);
|
||||
base = try (getenv ("TMP"), base);
|
||||
base = try (getenv ("TEMP"), base);
|
||||
|
||||
#ifdef P_tmpdir
|
||||
base = try (P_tmpdir, base);
|
||||
#endif
|
||||
|
||||
/* Try /usr/tmp, then /tmp. */
|
||||
base = try (usrtmp, base);
|
||||
base = try (tmp, base);
|
||||
|
||||
/* If all else fails, use the current directory! */
|
||||
if (base == 0)
|
||||
base = ".";
|
||||
|
||||
base_len = strlen (base);
|
||||
|
||||
if (suffix)
|
||||
suffix_len = strlen (suffix);
|
||||
else
|
||||
suffix_len = 0;
|
||||
|
||||
temp_filename = xmalloc (base_len + 1 /*DIR_SEPARATOR*/
|
||||
+ strlen (TEMP_FILE)
|
||||
+ suffix_len + 1);
|
||||
strcpy (temp_filename, base);
|
||||
|
||||
if (base_len != 0
|
||||
&& temp_filename[base_len-1] != '/'
|
||||
&& temp_filename[base_len-1] != DIR_SEPARATOR)
|
||||
temp_filename[base_len++] = DIR_SEPARATOR;
|
||||
strcpy (temp_filename + base_len, TEMP_FILE);
|
||||
|
||||
if (suffix)
|
||||
strcat (temp_filename, suffix);
|
||||
|
||||
fd = mkstemps (temp_filename, suffix_len);
|
||||
/* If mkstemps failed, then something bad is happening. Maybe we should
|
||||
issue a message about a possible security attack in progress? */
|
||||
if (fd == -1)
|
||||
abort ();
|
||||
/* Similarly if we can not close the file. */
|
||||
if (close (fd))
|
||||
abort ();
|
||||
return temp_filename;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -85,6 +85,8 @@ extern CC_STATUS cc_status;
|
||||
|
||||
/* This bit means that the current setting of the overflow flag
|
||||
is bogus and conditional jumps should pretend there is no overflow. */
|
||||
/* ??? Note that for most targets this macro is misnamed as it applies
|
||||
to the carry flag, not the overflow flag. */
|
||||
#define CC_NO_OVERFLOW 010
|
||||
|
||||
/* This bit means that what ought to be in the Z bit
|
||||
|
579
contrib/gcc/config.guess
vendored
579
contrib/gcc/config.guess
vendored
@ -1,575 +1,4 @@
|
||||
#! /bin/sh
|
||||
# Attempt to guess a canonical system name.
|
||||
# Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
#
|
||||
# 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 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful, but
|
||||
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not, write to the Free Software
|
||||
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
#
|
||||
# As a special exception to the GNU General Public License, if you
|
||||
# distribute this file as part of a program that contains a
|
||||
# configuration script generated by Autoconf, you may include it under
|
||||
# the same distribution terms that you use for the rest of that program.
|
||||
|
||||
# Written by Per Bothner <bothner@cygnus.com>.
|
||||
# The master version of this file is at the FSF in /home/gd/gnu/lib.
|
||||
#
|
||||
# This script attempts to guess a canonical system name similar to
|
||||
# config.sub. If it succeeds, it prints the system name on stdout, and
|
||||
# exits with 0. Otherwise, it exits with 1.
|
||||
#
|
||||
# The plan is that this can be called by configure scripts if you
|
||||
# don't specify an explicit system type (host/target name).
|
||||
#
|
||||
# Only a few systems have been added to this list; please add others
|
||||
# (but try to keep the structure clean).
|
||||
#
|
||||
|
||||
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
|
||||
# (ghazi@noc.rutgers.edu 8/24/94.)
|
||||
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
|
||||
PATH=$PATH:/.attbin ; export PATH
|
||||
fi
|
||||
|
||||
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
|
||||
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
|
||||
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
|
||||
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
|
||||
|
||||
trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
|
||||
|
||||
# Note: order is significant - the case branches are not exclusive.
|
||||
|
||||
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
|
||||
alpha:OSF1:V*:*)
|
||||
# After 1.2, OSF1 uses "V1.3" for uname -r.
|
||||
echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'`
|
||||
exit 0 ;;
|
||||
alpha:OSF1:*:*)
|
||||
# 1.2 uses "1.2" for uname -r.
|
||||
echo alpha-dec-osf${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
21064:Windows_NT:50:3)
|
||||
echo alpha-dec-winnt3.5
|
||||
exit 0 ;;
|
||||
amiga:NetBSD:*:*)
|
||||
echo m68k-cbm-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
|
||||
echo arm-acorn-riscix${UNAME_RELEASE}
|
||||
exit 0;;
|
||||
Pyramid*:OSx*:*:*)
|
||||
if test "`(/bin/universe) 2>/dev/null`" = att ; then
|
||||
echo pyramid-pyramid-sysv3
|
||||
else
|
||||
echo pyramid-pyramid-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:5.*:*)
|
||||
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
i86pc:SunOS:5.*:*)
|
||||
echo i386-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:6*:*)
|
||||
# According to config.sub, this is the proper way to canonicalize
|
||||
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
|
||||
# it's likely to be more like Solaris than SunOS4.
|
||||
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
|
||||
exit 0 ;;
|
||||
sun4*:SunOS:*:*)
|
||||
case "`/usr/bin/arch -k`" in
|
||||
Series*|S4*)
|
||||
UNAME_RELEASE=`uname -v`
|
||||
;;
|
||||
esac
|
||||
# Japanese Language versions have a version number like `4.1.3-JL'.
|
||||
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
|
||||
exit 0 ;;
|
||||
sun3*:SunOS:*:*)
|
||||
echo m68k-sun-sunos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
atari*:NetBSD:*:*)
|
||||
echo m68k-atari-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
sun3*:NetBSD:*:*)
|
||||
echo m68k-sun-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mac68k:NetBSD:*:*)
|
||||
echo m68k-apple-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
RISC*:ULTRIX:*:*)
|
||||
echo mips-dec-ultrix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
VAX*:ULTRIX*:*:*)
|
||||
echo vax-dec-ultrix${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mips:*:4*:UMIPS)
|
||||
echo mips-mips-riscos4sysv
|
||||
exit 0 ;;
|
||||
mips:*:5*:RISCos)
|
||||
echo mips-mips-riscos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
m88k:CX/UX:7*:*)
|
||||
echo m88k-harris-cxux7
|
||||
exit 0 ;;
|
||||
m88k:*:4*:R4*)
|
||||
echo m88k-motorola-sysv4
|
||||
exit 0 ;;
|
||||
m88k:*:3*:R3*)
|
||||
echo m88k-motorola-sysv3
|
||||
exit 0 ;;
|
||||
AViiON:dgux:*:*)
|
||||
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
|
||||
-o ${TARGET_BINARY_INTERFACE}x = x ] ; then
|
||||
echo m88k-dg-dgux${UNAME_RELEASE}
|
||||
else
|
||||
echo m88k-dg-dguxbcs${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
|
||||
echo m88k-dolphin-sysv3
|
||||
exit 0 ;;
|
||||
M88*:*:R3*:*)
|
||||
# Delta 88k system running SVR3
|
||||
echo m88k-motorola-sysv3
|
||||
exit 0 ;;
|
||||
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
|
||||
echo m88k-tektronix-sysv3
|
||||
exit 0 ;;
|
||||
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
|
||||
echo m68k-tektronix-bsd
|
||||
exit 0 ;;
|
||||
*:IRIX*:*:*)
|
||||
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
|
||||
exit 0 ;;
|
||||
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
|
||||
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
|
||||
exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
|
||||
i[34]86:AIX:*:*)
|
||||
echo i386-ibm-aix
|
||||
exit 0 ;;
|
||||
*:AIX:2:3)
|
||||
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
sed 's/^ //' << EOF >dummy.c
|
||||
#include <sys/systemcfg.h>
|
||||
|
||||
main()
|
||||
{
|
||||
if (!__power_pc())
|
||||
exit(1);
|
||||
puts("powerpc-ibm-aix3.2.5");
|
||||
exit(0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
echo rs6000-ibm-aix3.2.5
|
||||
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
|
||||
echo rs6000-ibm-aix3.2.4
|
||||
else
|
||||
echo rs6000-ibm-aix3.2
|
||||
fi
|
||||
exit 0 ;;
|
||||
*:AIX:*:4)
|
||||
if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
|
||||
IBM_ARCH=rs6000
|
||||
else
|
||||
IBM_ARCH=powerpc
|
||||
fi
|
||||
if [ -x /usr/bin/oslevel ] ; then
|
||||
IBM_REV=`/usr/bin/oslevel`
|
||||
else
|
||||
IBM_REV=4.${UNAME_RELEASE}
|
||||
fi
|
||||
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
|
||||
exit 0 ;;
|
||||
*:AIX:*:*)
|
||||
echo rs6000-ibm-aix
|
||||
exit 0 ;;
|
||||
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
|
||||
echo romp-ibm-bsd4.4
|
||||
exit 0 ;;
|
||||
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
|
||||
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
|
||||
exit 0 ;; # report: romp-ibm BSD 4.3
|
||||
*:BOSX:*:*)
|
||||
echo rs6000-bull-bosx
|
||||
exit 0 ;;
|
||||
DPX/2?00:B.O.S.:*:*)
|
||||
echo m68k-bull-sysv3
|
||||
exit 0 ;;
|
||||
9000/[34]??:4.3bsd:1.*:*)
|
||||
echo m68k-hp-bsd
|
||||
exit 0 ;;
|
||||
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
|
||||
echo m68k-hp-bsd4.4
|
||||
exit 0 ;;
|
||||
9000/[3478]??:HP-UX:*:*)
|
||||
case "${UNAME_MACHINE}" in
|
||||
9000/31? ) HP_ARCH=m68000 ;;
|
||||
9000/[34]?? ) HP_ARCH=m68k ;;
|
||||
9000/7?? | 9000/8?[79] ) HP_ARCH=hppa1.1 ;;
|
||||
9000/8?? ) HP_ARCH=hppa1.0 ;;
|
||||
esac
|
||||
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
|
||||
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
|
||||
exit 0 ;;
|
||||
3050*:HI-UX:*:*)
|
||||
sed 's/^ //' << EOF >dummy.c
|
||||
#include <unistd.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
long cpu = sysconf (_SC_CPU_VERSION);
|
||||
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
|
||||
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
|
||||
results, however. */
|
||||
if (CPU_IS_PA_RISC (cpu))
|
||||
{
|
||||
switch (cpu)
|
||||
{
|
||||
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
|
||||
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
|
||||
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
|
||||
default: puts ("hppa-hitachi-hiuxwe2"); break;
|
||||
}
|
||||
}
|
||||
else if (CPU_IS_HP_MC68K (cpu))
|
||||
puts ("m68k-hitachi-hiuxwe2");
|
||||
else puts ("unknown-hitachi-hiuxwe2");
|
||||
exit (0);
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
echo unknown-hitachi-hiuxwe2
|
||||
exit 0 ;;
|
||||
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
|
||||
echo hppa1.1-hp-bsd
|
||||
exit 0 ;;
|
||||
9000/8??:4.3bsd:*:*)
|
||||
echo hppa1.0-hp-bsd
|
||||
exit 0 ;;
|
||||
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
|
||||
echo hppa1.1-hp-osf
|
||||
exit 0 ;;
|
||||
hp8??:OSF1:*:*)
|
||||
echo hppa1.0-hp-osf
|
||||
exit 0 ;;
|
||||
parisc*:Lites*:*:*)
|
||||
echo hppa1.1-hp-lites
|
||||
exit 0 ;;
|
||||
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
|
||||
echo c1-convex-bsd
|
||||
exit 0 ;;
|
||||
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
|
||||
if getsysinfo -f scalar_acc
|
||||
then echo c32-convex-bsd
|
||||
else echo c2-convex-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
|
||||
echo c34-convex-bsd
|
||||
exit 0 ;;
|
||||
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
|
||||
echo c38-convex-bsd
|
||||
exit 0 ;;
|
||||
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
|
||||
echo c4-convex-bsd
|
||||
exit 0 ;;
|
||||
CRAY*X-MP:*:*:*)
|
||||
echo xmp-cray-unicos
|
||||
exit 0 ;;
|
||||
CRAY*Y-MP:*:*:*)
|
||||
echo ymp-cray-unicos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
CRAY*C90:*:*:*)
|
||||
echo c90-cray-unicos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
CRAY-2:*:*:*)
|
||||
echo cray2-cray-unicos
|
||||
exit 0 ;;
|
||||
hp3[0-9][05]:NetBSD:*:*)
|
||||
echo m68k-hp-netbsd${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
i[34]86:BSD/386:*:* | *:BSD/OS:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
*:FreeBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
|
||||
exit 0 ;;
|
||||
*:NetBSD:*:*)
|
||||
echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
|
||||
exit 0 ;;
|
||||
*:GNU:*:*)
|
||||
echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
|
||||
exit 0 ;;
|
||||
*:Linux:*:*)
|
||||
# The BFD linker knows what the default object file format is, so
|
||||
# first see if it will tell us.
|
||||
ld_help_string=`ld --help 2>&1`
|
||||
# if echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: elf_i[345]86"; then
|
||||
# echo "${UNAME_MACHINE}-unknown-linux" ; exit 0
|
||||
if echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: i[345]86linux"; then
|
||||
echo "${UNAME_MACHINE}-unknown-linuxaout" ; exit 0
|
||||
elif echo $ld_help_string | grep >/dev/null 2>&1 "supported emulations: i[345]86coff"; then
|
||||
echo "${UNAME_MACHINE}-unknown-linuxcoff" ; exit 0
|
||||
elif test "${UNAME_MACHINE}" = "alpha" ; then
|
||||
echo alpha-unknown-linux ; exit 0
|
||||
else
|
||||
# Either a pre-BFD a.out linker (linuxoldld) or one that does not give us
|
||||
# useful --help. Gcc wants to distinguish between linuxoldld and linuxaout,
|
||||
# and between different C library versions.
|
||||
echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:"
|
||||
test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0
|
||||
# Determine whether the default compiler is a.out or elf
|
||||
cat >dummy.c <<EOF
|
||||
#include <features.h>
|
||||
main(argc, argv)
|
||||
int argc;
|
||||
char *argv[];
|
||||
{
|
||||
#ifdef __ELF__
|
||||
# ifdef __GLIBC__
|
||||
# if __GLIBC__ >= 2
|
||||
printf ("%s-unknown-linux\n", argv[1]);
|
||||
# else
|
||||
printf ("%s-unknown-linux-gnulibc1\n", argv[1]);
|
||||
# endif
|
||||
# else
|
||||
printf ("%s-unknown-linux-gnulibc1\n", argv[1]);
|
||||
# endif
|
||||
#else
|
||||
printf ("%s-unknown-linuxaout\n", argv[1]);
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
fi ;;
|
||||
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
|
||||
# are messed up and put the nodename in both sysname and nodename.
|
||||
i[34]86:DYNIX/ptx:4*:*)
|
||||
echo i386-sequent-sysv4
|
||||
exit 0 ;;
|
||||
i[34]86:*:4.*:* | i[34]86:SYSTEM_V:4.*:*)
|
||||
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
|
||||
echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
|
||||
fi
|
||||
exit 0 ;;
|
||||
i[34]86:*:3.2:*)
|
||||
if test -f /usr/options/cb.name; then
|
||||
UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
|
||||
echo ${UNAME_MACHINE}-unknown-isc$UNAME_REL
|
||||
elif /bin/uname -X 2>/dev/null >/dev/null ; then
|
||||
UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
|
||||
(/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
|
||||
echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
|
||||
else
|
||||
echo ${UNAME_MACHINE}-unknown-sysv32
|
||||
fi
|
||||
exit 0 ;;
|
||||
Intel:Mach:3*:*)
|
||||
echo i386-unknown-mach3
|
||||
exit 0 ;;
|
||||
paragon:*:*:*)
|
||||
echo i860-intel-osf1
|
||||
exit 0 ;;
|
||||
i860:*:4.*:*) # i860-SVR4
|
||||
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
|
||||
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
|
||||
else # Add other i860-SVR4 vendors below as they are discovered.
|
||||
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
|
||||
fi
|
||||
exit 0 ;;
|
||||
mini*:CTIX:SYS*5:*)
|
||||
# "miniframe"
|
||||
echo m68010-convergent-sysv
|
||||
exit 0 ;;
|
||||
M680[234]0:*:R3V[567]*:*)
|
||||
test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
|
||||
3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0)
|
||||
uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& echo i486-ncr-sysv4.3 && exit 0 ;;
|
||||
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
|
||||
uname -p 2>/dev/null | grep 86 >/dev/null \
|
||||
&& echo i486-ncr-sysv4 && exit 0 ;;
|
||||
m680[234]0:LynxOS:2.[23]*:*)
|
||||
echo m68k-lynx-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
mc68030:UNIX_System_V:4.*:*)
|
||||
echo m68k-atari-sysv4
|
||||
exit 0 ;;
|
||||
i[34]86:LynxOS:2.[23]*:*)
|
||||
echo i386-lynx-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
TSUNAMI:LynxOS:2.[23]*:*)
|
||||
echo sparc-lynx-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
rs6000:LynxOS:2.[23]*:*)
|
||||
echo rs6000-lynx-lynxos${UNAME_RELEASE}
|
||||
exit 0 ;;
|
||||
RM*:SINIX-*:*:*)
|
||||
echo mips-sni-sysv4
|
||||
exit 0 ;;
|
||||
*:SINIX-*:*:*)
|
||||
if uname -p 2>/dev/null >/dev/null ; then
|
||||
UNAME_MACHINE=`(uname -p) 2>/dev/null`
|
||||
echo ${UNAME_MACHINE}-sni-sysv4
|
||||
else
|
||||
echo ns32k-sni-sysv
|
||||
fi
|
||||
exit 0 ;;
|
||||
esac
|
||||
|
||||
#echo '(No uname command or uname output not recognized.)' 1>&2
|
||||
#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
|
||||
|
||||
cat >dummy.c <<EOF
|
||||
#ifdef _SEQUENT_
|
||||
# include <sys/types.h>
|
||||
# include <sys/utsname.h>
|
||||
#endif
|
||||
main ()
|
||||
{
|
||||
#if defined (sony)
|
||||
#if defined (MIPSEB)
|
||||
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
|
||||
I don't know.... */
|
||||
printf ("mips-sony-bsd\n"); exit (0);
|
||||
#else
|
||||
#include <sys/param.h>
|
||||
printf ("m68k-sony-newsos%s\n",
|
||||
#ifdef NEWSOS4
|
||||
"4"
|
||||
#else
|
||||
""
|
||||
#endif
|
||||
); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__arm) && defined (__acorn) && defined (__unix)
|
||||
printf ("arm-acorn-riscix"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (hp300) && !defined (hpux)
|
||||
printf ("m68k-hp-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (NeXT)
|
||||
#if !defined (__ARCHITECTURE__)
|
||||
#define __ARCHITECTURE__ "m68k"
|
||||
#endif
|
||||
int version;
|
||||
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
|
||||
printf ("%s-next-nextstep%s\n", __ARCHITECTURE__, version==2 ? "2" : "3");
|
||||
exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (MULTIMAX) || defined (n16)
|
||||
#if defined (UMAXV)
|
||||
printf ("ns32k-encore-sysv\n"); exit (0);
|
||||
#else
|
||||
#if defined (CMU)
|
||||
printf ("ns32k-encore-mach\n"); exit (0);
|
||||
#else
|
||||
printf ("ns32k-encore-bsd\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (__386BSD__)
|
||||
printf ("i386-unknown-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
#if defined (sequent)
|
||||
#if defined (i386)
|
||||
printf ("i386-sequent-dynix\n"); exit (0);
|
||||
#endif
|
||||
#if defined (ns32000)
|
||||
printf ("ns32k-sequent-dynix\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (_SEQUENT_)
|
||||
struct utsname un;
|
||||
|
||||
uname(&un);
|
||||
|
||||
if (strncmp(un.version, "V2", 2) == 0) {
|
||||
printf ("i386-sequent-ptx2\n"); exit (0);
|
||||
}
|
||||
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
|
||||
printf ("i386-sequent-ptx1\n"); exit (0);
|
||||
}
|
||||
printf ("i386-sequent-ptx\n"); exit (0);
|
||||
|
||||
#endif
|
||||
|
||||
#if defined (vax)
|
||||
#if !defined (ultrix)
|
||||
printf ("vax-dec-bsd\n"); exit (0);
|
||||
#else
|
||||
printf ("vax-dec-ultrix\n"); exit (0);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined (alliant) && defined (i860)
|
||||
printf ("i860-alliant-bsd\n"); exit (0);
|
||||
#endif
|
||||
|
||||
exit (1);
|
||||
}
|
||||
EOF
|
||||
|
||||
${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
|
||||
rm -f dummy.c dummy
|
||||
|
||||
# Apollos put the system type in the environment.
|
||||
|
||||
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
|
||||
|
||||
# Convex versions that predate uname can use getsysinfo(1)
|
||||
|
||||
if [ -x /usr/convex/getsysinfo ]
|
||||
then
|
||||
case `getsysinfo -f cpu_type` in
|
||||
c1*)
|
||||
echo c1-convex-bsd
|
||||
exit 0 ;;
|
||||
c2*)
|
||||
if getsysinfo -f scalar_acc
|
||||
then echo c32-convex-bsd
|
||||
else echo c2-convex-bsd
|
||||
fi
|
||||
exit 0 ;;
|
||||
c34*)
|
||||
echo c34-convex-bsd
|
||||
exit 0 ;;
|
||||
c38*)
|
||||
echo c38-convex-bsd
|
||||
exit 0 ;;
|
||||
c4*)
|
||||
echo c4-convex-bsd
|
||||
exit 0 ;;
|
||||
esac
|
||||
fi
|
||||
|
||||
#echo '(Unable to guess system type)' 1>&2
|
||||
|
||||
exit 1
|
||||
#!/bin/sh
|
||||
# Use the top-level config.guess so that we don't have two of them.
|
||||
guesssys=`echo $0 | sed 's|config.guess|../config.guess|'`
|
||||
exec ${guesssys} "$@"
|
||||
|
202
contrib/gcc/config.in
Normal file
202
contrib/gcc/config.in
Normal file
@ -0,0 +1,202 @@
|
||||
/* config.in. Generated automatically from configure.in by autoheader. */
|
||||
/* Define if printf supports "%p". */
|
||||
#undef HAVE_PRINTF_PTR
|
||||
|
||||
/* Define if you want expensive run-time checks. */
|
||||
#undef ENABLE_CHECKING
|
||||
|
||||
/* Define if your cpp understands the stringify operator. */
|
||||
#undef HAVE_CPP_STRINGIFY
|
||||
|
||||
/* Define if your compiler understands volatile. */
|
||||
#undef HAVE_VOLATILE
|
||||
|
||||
/* Define if your assembler supports specifying the maximum number
|
||||
of bytes to skip when using the GAS .p2align command. */
|
||||
#undef HAVE_GAS_MAX_SKIP_P2ALIGN
|
||||
|
||||
/* Define if your assembler supports .balign and .p2align. */
|
||||
#undef HAVE_GAS_BALIGN_AND_P2ALIGN
|
||||
|
||||
/* Define if you have a working <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Whether malloc must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_MALLOC
|
||||
|
||||
/* Whether realloc must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_REALLOC
|
||||
|
||||
/* Whether calloc must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_CALLOC
|
||||
|
||||
/* Whether free must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_FREE
|
||||
|
||||
/* Whether bcopy must be declared even if <string.h> is included. */
|
||||
#undef NEED_DECLARATION_BCOPY
|
||||
|
||||
/* Whether bcmp must be declared even if <string.h> is included. */
|
||||
#undef NEED_DECLARATION_BCMP
|
||||
|
||||
/* Whether bzero must be declared even if <string.h> is included. */
|
||||
#undef NEED_DECLARATION_BZERO
|
||||
|
||||
/* Whether index must be declared even if <string.h> is included. */
|
||||
#undef NEED_DECLARATION_INDEX
|
||||
|
||||
/* Whether rindex must be declared even if <string.h> is included. */
|
||||
#undef NEED_DECLARATION_RINDEX
|
||||
|
||||
/* Whether getenv must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_GETENV
|
||||
|
||||
/* Whether atol must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_ATOL
|
||||
|
||||
/* Whether sbrk must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_SBRK
|
||||
|
||||
/* Whether abort must be declared even if <stdlib.h> is included. */
|
||||
#undef NEED_DECLARATION_ABORT
|
||||
|
||||
/* Whether strerror must be declared even if <string.h> is included. */
|
||||
#undef NEED_DECLARATION_STRERROR
|
||||
|
||||
/* Whether getcwd must be declared even if <unistd.h> is included. */
|
||||
#undef NEED_DECLARATION_GETCWD
|
||||
|
||||
/* Whether getwd must be declared even if <unistd.h> is included. */
|
||||
#undef NEED_DECLARATION_GETWD
|
||||
|
||||
/* Whether getrlimit must be declared even if <sys/resource.h> is included. */
|
||||
#undef NEED_DECLARATION_GETRLIMIT
|
||||
|
||||
/* Whether setrlimit must be declared even if <sys/resource.h> is included. */
|
||||
#undef NEED_DECLARATION_SETRLIMIT
|
||||
|
||||
/* Define if you want expensive run-time checks. */
|
||||
#undef ENABLE_CHECKING
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||
#undef SYS_SIGLIST_DECLARED
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Define if you have the atoll function. */
|
||||
#undef HAVE_ATOLL
|
||||
|
||||
/* Define if you have the atoq function. */
|
||||
#undef HAVE_ATOQ
|
||||
|
||||
/* Define if you have the bcmp function. */
|
||||
#undef HAVE_BCMP
|
||||
|
||||
/* Define if you have the bcopy function. */
|
||||
#undef HAVE_BCOPY
|
||||
|
||||
/* Define if you have the bsearch function. */
|
||||
#undef HAVE_BSEARCH
|
||||
|
||||
/* Define if you have the bzero function. */
|
||||
#undef HAVE_BZERO
|
||||
|
||||
/* Define if you have the getrlimit function. */
|
||||
#undef HAVE_GETRLIMIT
|
||||
|
||||
/* Define if you have the gettimeofday function. */
|
||||
#undef HAVE_GETTIMEOFDAY
|
||||
|
||||
/* Define if you have the index function. */
|
||||
#undef HAVE_INDEX
|
||||
|
||||
/* Define if you have the isascii function. */
|
||||
#undef HAVE_ISASCII
|
||||
|
||||
/* Define if you have the kill function. */
|
||||
#undef HAVE_KILL
|
||||
|
||||
/* Define if you have the popen function. */
|
||||
#undef HAVE_POPEN
|
||||
|
||||
/* Define if you have the putenv function. */
|
||||
#undef HAVE_PUTENV
|
||||
|
||||
/* Define if you have the rindex function. */
|
||||
#undef HAVE_RINDEX
|
||||
|
||||
/* Define if you have the setrlimit function. */
|
||||
#undef HAVE_SETRLIMIT
|
||||
|
||||
/* Define if you have the strchr function. */
|
||||
#undef HAVE_STRCHR
|
||||
|
||||
/* Define if you have the strerror function. */
|
||||
#undef HAVE_STRERROR
|
||||
|
||||
/* Define if you have the strrchr function. */
|
||||
#undef HAVE_STRRCHR
|
||||
|
||||
/* Define if you have the strtoul function. */
|
||||
#undef HAVE_STRTOUL
|
||||
|
||||
/* Define if you have the sysconf function. */
|
||||
#undef HAVE_SYSCONF
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
/* Define if you have the <limits.h> header file. */
|
||||
#undef HAVE_LIMITS_H
|
||||
|
||||
/* Define if you have the <stab.h> header file. */
|
||||
#undef HAVE_STAB_H
|
||||
|
||||
/* Define if you have the <stddef.h> header file. */
|
||||
#undef HAVE_STDDEF_H
|
||||
|
||||
/* Define if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define if you have the <sys/file.h> header file. */
|
||||
#undef HAVE_SYS_FILE_H
|
||||
|
||||
/* Define if you have the <sys/param.h> header file. */
|
||||
#undef HAVE_SYS_PARAM_H
|
||||
|
||||
/* Define if you have the <sys/resource.h> header file. */
|
||||
#undef HAVE_SYS_RESOURCE_H
|
||||
|
||||
/* Define if you have the <sys/time.h> header file. */
|
||||
#undef HAVE_SYS_TIME_H
|
||||
|
||||
/* Define if you have the <sys/times.h> header file. */
|
||||
#undef HAVE_SYS_TIMES_H
|
||||
|
||||
/* Define if you have the <sys/wait.h> header file. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if you have the <time.h> header file. */
|
||||
#undef HAVE_TIME_H
|
||||
|
||||
/* Define if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if you have the <wait.h> header file. */
|
||||
#undef HAVE_WAIT_H
|
221
contrib/gcc/config.sub
vendored
221
contrib/gcc/config.sub
vendored
@ -1,9 +1,9 @@
|
||||
#! /bin/sh
|
||||
# Configuration validation subroutine script, version 1.1.
|
||||
# Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc.
|
||||
# This file is (in principle) common to ALL GNU software.
|
||||
# The presence of a machine in this file suggests that SOME GNU software
|
||||
# can handle that machine. It does not imply ALL GNU software can.
|
||||
# can handle that machine. It does not imply ALL GNU software can.
|
||||
#
|
||||
# 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
|
||||
@ -41,6 +41,8 @@
|
||||
# The goal of this file is to map all the various variations of a given
|
||||
# machine specification into a single specification in the form:
|
||||
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
|
||||
# or in some cases, the newer four-part form:
|
||||
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
|
||||
# It is wrong to echo any other type of specification.
|
||||
|
||||
if [ x$1 = x ]
|
||||
@ -62,7 +64,7 @@ case $1 in
|
||||
;;
|
||||
esac
|
||||
|
||||
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
|
||||
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
|
||||
# Here we must recognize all the valid KERNEL-OS combinations.
|
||||
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
|
||||
case $maybe_os in
|
||||
@ -91,38 +93,43 @@ case $os in
|
||||
-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
|
||||
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
|
||||
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
|
||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp )
|
||||
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
|
||||
-apple)
|
||||
os=
|
||||
basic_machine=$1
|
||||
;;
|
||||
-hiux*)
|
||||
os=-hiuxwe2
|
||||
;;
|
||||
-sco5)
|
||||
os=-sco3.2v5
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco4)
|
||||
os=-sco3.2v4
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco3.2.[4-9]*)
|
||||
os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco3.2v[4-9]*)
|
||||
# Don't forget version if it is 3.2v4 or newer.
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-sco*)
|
||||
os=-sco3.2v2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-isc)
|
||||
os=-isc2.2
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-clix*)
|
||||
basic_machine=clipper-intergraph
|
||||
;;
|
||||
-isc*)
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
|
||||
basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
|
||||
;;
|
||||
-lynx*)
|
||||
os=-lynxos
|
||||
@ -133,35 +140,52 @@ case $os in
|
||||
-windowsnt*)
|
||||
os=`echo $os | sed -e 's/windowsnt/winnt/'`
|
||||
;;
|
||||
-psos*)
|
||||
os=-psos
|
||||
;;
|
||||
esac
|
||||
|
||||
# Decode aliases for certain CPU-COMPANY combinations.
|
||||
case $basic_machine in
|
||||
# Recognize the basic CPU types without company name.
|
||||
# Some are omitted here because they have special meanings below.
|
||||
tahoe | i[3456]86 | i860 | m68k | m68000 | m88k | ns32k | arm \
|
||||
| arme[lb] | pyramid \
|
||||
| tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \
|
||||
| alpha | we32k | ns16k | clipper | sparclite | i370 | sh \
|
||||
| powerpc | powerpcle | sparc64 | 1750a | dsp16xx | mips64 | mipsel \
|
||||
| pdp11 | mips64el | mips64orion | mips64orionel \
|
||||
| sparc)
|
||||
tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \
|
||||
| arme[lb] | pyramid | mn10200 | mn10300 \
|
||||
| tron | a29k | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 \
|
||||
| alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \
|
||||
| i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \
|
||||
| mips64 | mipsel | mips64el | mips64orion | mips64orionel \
|
||||
| mipstx39 | mipstx39el \
|
||||
| sparc | sparclet | sparclite | sparc64 | v850)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
thumb | thumbel)
|
||||
basic_machine=$basic_machine-unknown
|
||||
;;
|
||||
# We use `pc' rather than `unknown'
|
||||
# because (1) that's what they normally are, and
|
||||
# (2) the word "unknown" tends to confuse beginning users.
|
||||
i[34567]86)
|
||||
basic_machine=$basic_machine-pc
|
||||
;;
|
||||
# Object if more than one company name word.
|
||||
*-*-*)
|
||||
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
|
||||
exit 1
|
||||
;;
|
||||
# Recognize the basic CPU types with company name.
|
||||
vax-* | tahoe-* | i[3456]86-* | i860-* | m68k-* | m68000-* | m88k-* \
|
||||
| sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
|
||||
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
|
||||
| none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
|
||||
| hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
|
||||
| pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
|
||||
| pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
|
||||
| mips64el-* | mips64orion-* | mips64orionel-*)
|
||||
vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \
|
||||
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \
|
||||
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
|
||||
| power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \
|
||||
| xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* \
|
||||
| alpha-* | alphaev5-* | alphaev56-* | we32k-* | cydra-* \
|
||||
| ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \
|
||||
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
|
||||
| sparc64-* | mips64-* | mipsel-* \
|
||||
| mips64el-* | mips64orion-* | mips64orionel-* \
|
||||
| mipstx39-* | mipstx39el-* \
|
||||
| f301-*)
|
||||
;;
|
||||
# Recognize the various machine names and aliases which stand
|
||||
# for a CPU type and a company and sometimes even an OS.
|
||||
@ -188,9 +212,9 @@ case $basic_machine in
|
||||
amiga | amiga-*)
|
||||
basic_machine=m68k-cbm
|
||||
;;
|
||||
amigados)
|
||||
amigaos | amigados)
|
||||
basic_machine=m68k-cbm
|
||||
os=-amigados
|
||||
os=-amigaos
|
||||
;;
|
||||
amigaunix | amix)
|
||||
basic_machine=m68k-cbm
|
||||
@ -200,6 +224,10 @@ case $basic_machine in
|
||||
basic_machine=m68k-apollo
|
||||
os=-sysv
|
||||
;;
|
||||
aux)
|
||||
basic_machine=m68k-apple
|
||||
os=-aux
|
||||
;;
|
||||
balance)
|
||||
basic_machine=ns32k-sequent
|
||||
os=-dynix
|
||||
@ -232,6 +260,10 @@ case $basic_machine in
|
||||
basic_machine=cray2-cray
|
||||
os=-unicos
|
||||
;;
|
||||
[ctj]90-cray)
|
||||
basic_machine=c90-cray
|
||||
os=-unicos
|
||||
;;
|
||||
crds | unos)
|
||||
basic_machine=m68k-crds
|
||||
;;
|
||||
@ -307,31 +339,49 @@ case $basic_machine in
|
||||
hp9k3[2-9][0-9])
|
||||
basic_machine=m68k-hp
|
||||
;;
|
||||
hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
|
||||
hp9k6[0-9][0-9] | hp6[0-9][0-9] )
|
||||
basic_machine=hppa1.0-hp
|
||||
;;
|
||||
hp9k7[0-79][0-9] | hp7[0-79][0-9] )
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k78[0-9] | hp78[0-9] )
|
||||
# FIXME: really hppa2.0-hp
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | \
|
||||
hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893 )
|
||||
# FIXME: really hppa2.0-hp
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k8[0-9][13679] | hp8[0-9][13679] )
|
||||
basic_machine=hppa1.1-hp
|
||||
;;
|
||||
hp9k8[0-9][0-9] | hp8[0-9][0-9])
|
||||
basic_machine=hppa1.0-hp
|
||||
;;
|
||||
hppa-next)
|
||||
os=-nextstep3
|
||||
;;
|
||||
i370-ibm* | ibm*)
|
||||
basic_machine=i370-ibm
|
||||
os=-mvs
|
||||
;;
|
||||
# I'm not sure what "Sysv32" means. Should this be sysv3.2?
|
||||
i[3456]86v32)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
|
||||
i[34567]86v32)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv32
|
||||
;;
|
||||
i[3456]86v4*)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
|
||||
i[34567]86v4*)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv4
|
||||
;;
|
||||
i[3456]86v)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
|
||||
i[34567]86v)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-sysv
|
||||
;;
|
||||
i[3456]86sol2)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
|
||||
i[34567]86sol2)
|
||||
basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
|
||||
os=-solaris2
|
||||
;;
|
||||
iris | iris4d)
|
||||
@ -362,6 +412,14 @@ case $basic_machine in
|
||||
miniframe)
|
||||
basic_machine=m68000-convergent
|
||||
;;
|
||||
mipsel*-linux*)
|
||||
basic_machine=mipsel-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
mips*-linux*)
|
||||
basic_machine=mips-unknown
|
||||
os=-linux-gnu
|
||||
;;
|
||||
mips3*-*)
|
||||
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
|
||||
;;
|
||||
@ -429,21 +487,23 @@ case $basic_machine in
|
||||
pc532 | pc532-*)
|
||||
basic_machine=ns32k-pc532
|
||||
;;
|
||||
pentium | p5 | p6)
|
||||
# We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium
|
||||
basic_machine=i586-intel
|
||||
pentium | p5 | k5 | nexen)
|
||||
basic_machine=i586-pc
|
||||
;;
|
||||
pentium-* | p5-* | p6-*)
|
||||
# We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium
|
||||
pentiumpro | p6 | k6 | 6x86)
|
||||
basic_machine=i686-pc
|
||||
;;
|
||||
pentiumii | pentium2)
|
||||
basic_machine=i786-pc
|
||||
;;
|
||||
pentium-* | p5-* | k5-* | nexen-*)
|
||||
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
k5)
|
||||
# We don't have specific support for AMD's K5 yet, so just call it a Pentium
|
||||
basic_machine=i586-amd
|
||||
pentiumpro-* | p6-* | k6-* | 6x86-*)
|
||||
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
nexen)
|
||||
# We don't have specific support for Nexgen yet, so just call it a Pentium
|
||||
basic_machine=i586-nexgen
|
||||
pentiumii-* | pentium2-*)
|
||||
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
|
||||
;;
|
||||
pn)
|
||||
basic_machine=pn-gould
|
||||
@ -527,6 +587,12 @@ case $basic_machine in
|
||||
basic_machine=i386-sequent
|
||||
os=-dynix
|
||||
;;
|
||||
tx39)
|
||||
basic_machine=mipstx39-unknown
|
||||
;;
|
||||
tx39el)
|
||||
basic_machine=mipstx39el-unknown
|
||||
;;
|
||||
tower | tower-32)
|
||||
basic_machine=m68k-ncr
|
||||
;;
|
||||
@ -546,6 +612,9 @@ case $basic_machine in
|
||||
basic_machine=vax-dec
|
||||
os=-vms
|
||||
;;
|
||||
vpp*|vx|vx-*)
|
||||
basic_machine=f301-fujitsu
|
||||
;;
|
||||
vxworks960)
|
||||
basic_machine=i960-wrs
|
||||
os=-vxworks
|
||||
@ -573,7 +642,11 @@ case $basic_machine in
|
||||
# Here we handle the default manufacturer of certain CPU types. It is in
|
||||
# some cases the only manufacturer, in others, it is the most popular.
|
||||
mips)
|
||||
basic_machine=mips-mips
|
||||
if [ x$os = x-linux-gnu ]; then
|
||||
basic_machine=mips-unknown
|
||||
else
|
||||
basic_machine=mips-mips
|
||||
fi
|
||||
;;
|
||||
romp)
|
||||
basic_machine=romp-ibm
|
||||
@ -625,6 +698,8 @@ esac
|
||||
if [ x"$os" != x"" ]
|
||||
then
|
||||
case $os in
|
||||
# First match some system type aliases
|
||||
# that might get confused with valid system types.
|
||||
# -solaris* is a basic system type, with this one exception.
|
||||
-solaris1 | -solaris1.*)
|
||||
os=`echo $os | sed -e 's|solaris1|sunos4|'`
|
||||
@ -632,28 +707,37 @@ case $os in
|
||||
-solaris)
|
||||
os=-solaris2
|
||||
;;
|
||||
-unixware* | svr4*)
|
||||
-svr4*)
|
||||
os=-sysv4
|
||||
;;
|
||||
-unixware*)
|
||||
os=-sysv4.2uw
|
||||
;;
|
||||
-gnu/linux*)
|
||||
os=`echo $os | sed -e 's|gnu/linux|linux|'`
|
||||
os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
|
||||
;;
|
||||
# First accept the basic system types.
|
||||
# The portable systems comes first.
|
||||
# Each alternative MUST END IN A *, to match a version number.
|
||||
# -sysv* is not here because it comes later, after sysvr4.
|
||||
-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
|
||||
| -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[345]* \
|
||||
| -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
|
||||
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
|
||||
| -amigados* | -msdos* | -newsos* | -unicos* | -aos* \
|
||||
| -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
|
||||
| -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \
|
||||
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
|
||||
| -aos* \
|
||||
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
|
||||
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
|
||||
| -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \
|
||||
| -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
|
||||
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
|
||||
| -udi* | -eabi* | -lites* )
|
||||
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
|
||||
| -cygwin32* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
|
||||
| -mingw32* | -linux-gnu* | -uxpv* | -beos* )
|
||||
# Remember, each alternative MUST END IN *, to match a version number.
|
||||
;;
|
||||
-linux*)
|
||||
os=`echo $os | sed -e 's|linux|linux-gnu|'`
|
||||
;;
|
||||
-sunos5*)
|
||||
os=`echo $os | sed -e 's|sunos5|solaris2|'`
|
||||
;;
|
||||
@ -678,6 +762,9 @@ case $os in
|
||||
-ctix* | -uts*)
|
||||
os=-sysv
|
||||
;;
|
||||
-ns2 )
|
||||
os=-nextstep2
|
||||
;;
|
||||
# Preserve the version number of sinix5.
|
||||
-sinix5.*)
|
||||
os=`echo $os | sed -e 's|sinix|sysv|'`
|
||||
@ -771,7 +858,7 @@ case $basic_machine in
|
||||
os=-sysv
|
||||
;;
|
||||
*-cbm)
|
||||
os=-amigados
|
||||
os=-amigaos
|
||||
;;
|
||||
*-dg)
|
||||
os=-dgux
|
||||
@ -785,6 +872,9 @@ case $basic_machine in
|
||||
m88k-omron*)
|
||||
os=-luna
|
||||
;;
|
||||
*-next )
|
||||
os=-nextstep
|
||||
;;
|
||||
*-sequent)
|
||||
os=-ptx
|
||||
;;
|
||||
@ -818,6 +908,12 @@ case $basic_machine in
|
||||
*-masscomp)
|
||||
os=-rtu
|
||||
;;
|
||||
f301-fujitsu)
|
||||
os=-uxpv
|
||||
;;
|
||||
*-be)
|
||||
os=-beos
|
||||
;;
|
||||
*)
|
||||
os=-none
|
||||
;;
|
||||
@ -836,9 +932,6 @@ case $basic_machine in
|
||||
-sunos*)
|
||||
vendor=sun
|
||||
;;
|
||||
-lynxos*)
|
||||
vendor=lynx
|
||||
;;
|
||||
-aix*)
|
||||
vendor=ibm
|
||||
;;
|
||||
@ -866,9 +959,15 @@ case $basic_machine in
|
||||
-ptx*)
|
||||
vendor=sequent
|
||||
;;
|
||||
-vxworks*)
|
||||
-vxsim* | -vxworks*)
|
||||
vendor=wrs
|
||||
;;
|
||||
-aux*)
|
||||
vendor=apple
|
||||
;;
|
||||
-beos*)
|
||||
vendor=be
|
||||
;;
|
||||
esac
|
||||
basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
|
||||
;;
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
111
contrib/gcc/config/alpha/crtbegin.asm
Normal file
111
contrib/gcc/config/alpha/crtbegin.asm
Normal file
@ -0,0 +1,111 @@
|
||||
# Copyright (C) 1996, 1998 Free Software Foundation, Inc.
|
||||
# Contributed by Richard Henderson (rth@tamu.edu)
|
||||
#
|
||||
# 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.
|
||||
|
||||
#
|
||||
# Heads of the constructor/destructor lists.
|
||||
#
|
||||
|
||||
# The __*TOR_LIST__ symbols are not global because when this file is used
|
||||
# in a shared library, we do not want the symbol to fall over to the
|
||||
# application's lists.
|
||||
|
||||
.section .ctors,"aw"
|
||||
|
||||
.align 3
|
||||
__CTOR_LIST__:
|
||||
.quad -1
|
||||
|
||||
.section .dtors,"aw"
|
||||
|
||||
.align 3
|
||||
__DTOR_LIST__:
|
||||
.quad -1
|
||||
|
||||
|
||||
#
|
||||
# Fragment of the ELF _fini routine that invokes our dtor cleanup.
|
||||
#
|
||||
|
||||
.section .fini,"ax"
|
||||
|
||||
# Since the bits of the _fini function are spread across many
|
||||
# object files, each potentially with its own GP, we must
|
||||
# assume we need to load ours. Further, our .fini section
|
||||
# can easily be more than 4MB away from our .text bits so we
|
||||
# can't use bsr.
|
||||
|
||||
br $29,1f
|
||||
1: ldgp $29,0($29)
|
||||
jsr $26,__do_global_dtors_aux
|
||||
|
||||
# Must match the alignment we got from crti.o else we get
|
||||
# zero-filled holes in our _fini function and then SIGILL.
|
||||
.align 3
|
||||
|
||||
#
|
||||
# Invoke our destructors in order.
|
||||
#
|
||||
|
||||
.data
|
||||
|
||||
# Support recursive calls to exit.
|
||||
9: .quad __DTOR_LIST__
|
||||
|
||||
.text
|
||||
|
||||
.align 3
|
||||
.ent __do_global_dtors_aux
|
||||
|
||||
__do_global_dtors_aux:
|
||||
ldgp $29,0($27)
|
||||
lda $30,-16($30)
|
||||
.frame $30,16,$26,0
|
||||
stq $9,8($30)
|
||||
stq $26,0($30)
|
||||
.mask 0x4000200,-16
|
||||
.prologue 1
|
||||
|
||||
lda $9,9b
|
||||
br 1f
|
||||
0: stq $1,0($9)
|
||||
jsr $26,($27)
|
||||
1: ldq $1,0($9)
|
||||
ldq $27,8($1)
|
||||
addq $1,8,$1
|
||||
bne $27,0b
|
||||
|
||||
ldq $26,0($30)
|
||||
ldq $9,8($30)
|
||||
lda $30,16($30)
|
||||
ret
|
||||
|
||||
.end __do_global_dtors_aux
|
105
contrib/gcc/config/alpha/crtend.asm
Normal file
105
contrib/gcc/config/alpha/crtend.asm
Normal file
@ -0,0 +1,105 @@
|
||||
# Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
# Contributed by Richard Henderson (rth@tamu.edu)
|
||||
#
|
||||
# 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.
|
||||
|
||||
#
|
||||
# Tails of the constructor/destructor lists.
|
||||
#
|
||||
|
||||
# The __*TOR_END__ symbols are not global because when this file is used
|
||||
# in a shared library, we do not want the symbol to fall over to the
|
||||
# application's lists.
|
||||
|
||||
.section .ctors,"aw"
|
||||
|
||||
.align 3
|
||||
__CTOR_END__:
|
||||
.quad 0
|
||||
|
||||
.section .dtors,"aw"
|
||||
|
||||
.align 3
|
||||
__DTOR_END__:
|
||||
.quad 0
|
||||
|
||||
|
||||
#
|
||||
# Fragment of the ELF _init routine that invokes our ctor startup
|
||||
#
|
||||
|
||||
.section .init,"ax"
|
||||
|
||||
# Since the bits of the _init function are spread across many
|
||||
# object files, each potentially with its own GP, we must
|
||||
# assume we need to load ours. Further, our .init section
|
||||
# can easily be more than 4MB away from our .text bits so we
|
||||
# can't use bsr.
|
||||
|
||||
br $29,1f
|
||||
1: ldgp $29,0($29)
|
||||
jsr $26,__do_global_ctors_aux
|
||||
|
||||
# Must match the alignment we got from crti.o else we get
|
||||
# zero-filled holes in our _init function and thense SIGILL.
|
||||
.align 3
|
||||
|
||||
#
|
||||
# Invoke our destructors in order.
|
||||
#
|
||||
|
||||
.text
|
||||
|
||||
.align 3
|
||||
.ent __do_global_ctors_aux
|
||||
|
||||
__do_global_ctors_aux:
|
||||
ldgp $29,0($27)
|
||||
lda $30,-16($30)
|
||||
.frame $30,16,$26,0
|
||||
stq $9,8($30)
|
||||
stq $26,0($30)
|
||||
.mask 0x4000200,-16
|
||||
.prologue 1
|
||||
|
||||
lda $9,__CTOR_END__
|
||||
br 1f
|
||||
0: jsr $26,($27)
|
||||
1: ldq $27,-8($9)
|
||||
subq $9,8,$9
|
||||
not $27,$0
|
||||
bne $0,0b
|
||||
|
||||
ldq $26,0($30)
|
||||
ldq $9,8($30)
|
||||
lda $30,16($30)
|
||||
ret
|
||||
|
||||
.end __do_global_ctors_aux
|
36
contrib/gcc/config/alpha/linux-ecoff.h
Normal file
36
contrib/gcc/config/alpha/linux-ecoff.h
Normal file
@ -0,0 +1,36 @@
|
||||
/* 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#undef TARGET_VERSION
|
||||
#define TARGET_VERSION fprintf (stderr, " (Alpha GNU/Linux for ECOFF)");
|
||||
|
||||
#undef SUB_CPP_PREDEFINES
|
||||
#define SUB_CPP_PREDEFINES "-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
|
47
contrib/gcc/config/alpha/linux-elf.h
Normal file
47
contrib/gcc/config/alpha/linux-elf.h
Normal file
@ -0,0 +1,47 @@
|
||||
/* Definitions of target machine for GNU compiler
|
||||
for Alpha Linux-based GNU systems using ELF.
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson.
|
||||
|
||||
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#undef TARGET_VERSION
|
||||
#define TARGET_VERSION fprintf (stderr, " (Alpha GNU/Linux for ELF)");
|
||||
|
||||
#undef SUBTARGET_EXTRA_SPECS
|
||||
#define SUBTARGET_EXTRA_SPECS \
|
||||
{ "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
|
||||
|
||||
#undef SUB_CPP_PREDEFINES
|
||||
#define SUB_CPP_PREDEFINES "-D__ELF__"
|
||||
|
||||
#ifdef USE_GNULIBC_1
|
||||
#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
|
||||
#else
|
||||
#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
|
||||
#endif
|
||||
|
||||
#ifndef USE_GNULIBC_1
|
||||
#undef DEFAULT_VTABLE_THUNKS
|
||||
#define DEFAULT_VTABLE_THUNKS 1
|
||||
#endif
|
||||
|
||||
#ifndef USE_GNULIBC_1
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC \
|
||||
"%{shared:-lc}%{!shared:%{pthread:-lpthread }%{profile:-lc_p}%{!profile:-lc}} "
|
||||
#endif
|
44
contrib/gcc/config/alpha/linux.h
Normal file
44
contrib/gcc/config/alpha/linux.h
Normal file
@ -0,0 +1,44 @@
|
||||
/* Definitions of target machine for GNU compiler,
|
||||
for Alpha Linux-based GNU systems.
|
||||
Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
Contributed by Richard Henderson.
|
||||
|
||||
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#undef TARGET_DEFAULT
|
||||
#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES \
|
||||
"-Dlinux -Dunix -Asystem(linux) -D_LONGLONG -D__alpha__ " SUB_CPP_PREDEFINES
|
||||
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC "%{pg:-lgmon} %{pg:-lc_p} %{!pg:-lc}"
|
||||
|
||||
/* Generate calls to memcpy, etc., not bcopy, etc. */
|
||||
#define TARGET_MEM_FUNCTIONS 1
|
||||
|
||||
#undef FUNCTION_PROFILER
|
||||
#define FUNCTION_PROFILER(FILE, LABELNO) \
|
||||
fputs ("\tlda $28,_mcount\n\tjsr $28,($28),_mcount\n", (FILE))
|
||||
|
||||
/* Show that we need a GP when profiling. */
|
||||
#define TARGET_PROFILING_NEEDS_GP 1
|
||||
|
||||
/* Don't care about faults in the prologue. */
|
||||
#undef TARGET_CAN_FAULT_IN_PROLOGUE
|
||||
#define TARGET_CAN_FAULT_IN_PROLOGUE 1
|
31
contrib/gcc/config/alpha/netbsd-elf.h
Normal file
31
contrib/gcc/config/alpha/netbsd-elf.h
Normal file
@ -0,0 +1,31 @@
|
||||
/* Definitions of target machine for GNU compiler
|
||||
for Alpha NetBSD systems using ELF.
|
||||
Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#undef TARGET_VERSION
|
||||
#define TARGET_VERSION fprintf (stderr, " (Alpha NetBSD/ELF)");
|
||||
|
||||
#undef SUB_CPP_PREDEFINES
|
||||
#define SUB_CPP_PREDEFINES "-D__ELF__"
|
||||
|
||||
#undef SUBTARGET_EXTRA_SPECS
|
||||
#define SUBTARGET_EXTRA_SPECS \
|
||||
{ "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
|
||||
|
||||
#define ELF_DYNAMIC_LINKER "/usr/libexec/ld.elf_so"
|
38
contrib/gcc/config/alpha/netbsd.h
Normal file
38
contrib/gcc/config/alpha/netbsd.h
Normal file
@ -0,0 +1,38 @@
|
||||
/* Definitions of target machine for GNU compiler,
|
||||
for Alpha NetBSD systems.
|
||||
Copyright (C) 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#undef TARGET_DEFAULT
|
||||
#define TARGET_DEFAULT (MASK_FP | MASK_FPREGS | MASK_GAS)
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-D_LONGLONG -Dnetbsd -Dunix " SUB_CPP_PREDEFINES
|
||||
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC "%{pg:-lgmon} %{pg:-lc_p} %{!pg:-lc}"
|
||||
|
||||
/* Generate calls to memcpy, etc., not bcopy, etc. */
|
||||
#define TARGET_MEM_FUNCTIONS
|
||||
|
||||
#undef FUNCTION_PROFILER
|
||||
#define FUNCTION_PROFILER(FILE, LABELNO) \
|
||||
fputs ("\tlda $28,_mcount\n\tjsr $28,($28),_mcount\n", (FILE))
|
||||
|
||||
/* Show that we need a GP when profiling. */
|
||||
#define TARGET_PROFILING_NEEDS_GP
|
126
contrib/gcc/config/alpha/openbsd.h
Normal file
126
contrib/gcc/config/alpha/openbsd.h
Normal file
@ -0,0 +1,126 @@
|
||||
/* Configuration file for an alpha OpenBSD target.
|
||||
Copyright (C) 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. */
|
||||
|
||||
/* We settle for little endian for now. */
|
||||
#define TARGET_ENDIAN_DEFAULT 0
|
||||
|
||||
#include <alpha/alpha.h>
|
||||
|
||||
#define OBSD_NO_DYNAMIC_LIBRARIES
|
||||
#define OBSD_HAS_DECLARE_FUNCTION_NAME
|
||||
#define OBSD_HAS_DECLARE_FUNCTION_SIZE
|
||||
#define OBSD_HAS_DECLARE_OBJECT
|
||||
|
||||
/* alpha ecoff supports only weak aliases, see below. */
|
||||
#define ASM_WEAKEN_LABEL(FILE,NAME) ASM_OUTPUT_WEAK_ALIAS (FILE,NAME,0)
|
||||
|
||||
#include <openbsd.h>
|
||||
|
||||
/* Controlling the compilation driver. */
|
||||
|
||||
/* alpha needs __start. */
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC \
|
||||
"%{!nostdlib:%{!r*:%{!e*:-e __start}}} -dc -dp %{assert*}"
|
||||
|
||||
/* run-time target specifications */
|
||||
#define CPP_PREDEFINES "-D__unix__ -D__ANSI_COMPAT -Asystem(unix) \
|
||||
-D__OpenBSD__ -D__alpha__ -D__alpha"
|
||||
|
||||
/* Layout of source language data types. */
|
||||
|
||||
/* This must agree with <machine/ansi.h> */
|
||||
#undef SIZE_TYPE
|
||||
#define SIZE_TYPE "long unsigned int"
|
||||
|
||||
#undef PTRDIFF_TYPE
|
||||
#define PTRDIFF_TYPE "long int"
|
||||
|
||||
#undef WCHAR_TYPE
|
||||
#define WCHAR_TYPE "int"
|
||||
|
||||
#undef WCHAR_TYPE_SIZE
|
||||
#define WCHAR_TYPE_SIZE 32
|
||||
|
||||
|
||||
#undef PREFERRED_DEBUGGING_TYPE
|
||||
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
|
||||
|
||||
#define LOCAL_LABEL_PREFIX "."
|
||||
|
||||
/* We don't have an init section yet. */
|
||||
#undef HAS_INIT_SECTION
|
||||
|
||||
/* collect2 support (assembler format: macros for initialization). */
|
||||
|
||||
/* Don't tell collect2 we use COFF as we don't have (yet ?) a dynamic ld
|
||||
library with the proper functions to handle this -> collect2 will
|
||||
default to using nm. */
|
||||
#undef OBJECT_FORMAT_COFF
|
||||
#undef EXTENDED_COFF
|
||||
|
||||
/* Assembler format: exception region output. */
|
||||
|
||||
/* All configurations that don't use elf must be explicit about not using
|
||||
dwarf unwind information. egcs doesn't try too hard to check internal
|
||||
configuration files... */
|
||||
#ifdef INCOMING_RETURN_ADDR_RTX
|
||||
#undef DWARF2_UNWIND_INFO
|
||||
#define DWARF2_UNWIND_INFO 0
|
||||
#endif
|
||||
|
||||
/* Assembler format: file framework. */
|
||||
|
||||
/* Taken from alpha/osf.h. This used to be common to all alpha
|
||||
configurations, but elf has departed from it.
|
||||
Check alpha/alpha.h, alpha/osf.h for it when egcs is upgraded. */
|
||||
#ifndef ASM_FILE_START
|
||||
#define ASM_FILE_START(FILE) \
|
||||
{ \
|
||||
alpha_write_verstamp (FILE); \
|
||||
fprintf (FILE, "\t.set noreorder\n"); \
|
||||
fprintf (FILE, "\t.set volatile\n"); \
|
||||
fprintf (FILE, "\t.set noat\n"); \
|
||||
if (TARGET_SUPPORT_ARCH) \
|
||||
fprintf (FILE, "\t.arch %s\n", \
|
||||
alpha_cpu == PROCESSOR_EV6 ? "ev6" \
|
||||
: (alpha_cpu == PROCESSOR_EV5 \
|
||||
? (TARGET_MAX ? "pca56" : TARGET_BWX ? "ev56" : "ev5") \
|
||||
: "ev4")); \
|
||||
\
|
||||
ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Assembler format: label output. */
|
||||
|
||||
#define ASM_OUTPUT_WEAK_ALIAS(FILE,NAME,VALUE) \
|
||||
do { \
|
||||
fputs ("\t.weakext\t", FILE); \
|
||||
assemble_name (FILE, NAME); \
|
||||
if (VALUE) \
|
||||
{ \
|
||||
fputs (" , ", FILE); \
|
||||
assemble_name (FILE, VALUE); \
|
||||
} \
|
||||
fputc ('\n', FILE); \
|
||||
} while (0)
|
||||
|
||||
|
127
contrib/gcc/config/alpha/osf.h
Normal file
127
contrib/gcc/config/alpha/osf.h
Normal file
@ -0,0 +1,127 @@
|
||||
/* Definitions of target machine for GNU compiler, for DEC Alpha on OSF/1.
|
||||
Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
|
||||
Contributed by Richard Kenner (kenner@vlsi1.ultra.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. */
|
||||
|
||||
/* As of OSF 4.0, as can subtract adjacent labels. */
|
||||
|
||||
#undef TARGET_AS_CAN_SUBTRACT_LABELS
|
||||
#define TARGET_AS_CAN_SUBTRACT_LABELS 1
|
||||
|
||||
/* Names to predefine in the preprocessor for this target machine. */
|
||||
|
||||
#define CPP_PREDEFINES "\
|
||||
-Dunix -D__osf__ -D_LONGLONG -DSYSTYPE_BSD \
|
||||
-D_SYSTYPE_BSD -Asystem(unix) -Asystem(xpg4)"
|
||||
|
||||
/* Under OSF4, -p and -pg require -lprof1, and -lprof1 requires -lpdf. */
|
||||
|
||||
#define LIB_SPEC "%{p:-lprof1 -lpdf} %{pg:-lprof1 -lpdf} %{a:-lprof2} -lc"
|
||||
|
||||
/* Pass "-G 8" to ld because Alpha's CC does. Pass -O3 if we are
|
||||
optimizing, -O1 if we are not. Pass -shared, -non_shared or
|
||||
-call_shared as appropriate. Also pass -pg. */
|
||||
#define LINK_SPEC \
|
||||
"-G 8 %{O*:-O3} %{!O*:-O1} %{static:-non_shared} \
|
||||
%{!static:%{shared:-shared} %{!shared:-call_shared}} %{pg} %{taso} \
|
||||
%{rpath*}"
|
||||
|
||||
#define STARTFILE_SPEC \
|
||||
"%{!shared:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}"
|
||||
|
||||
#define MD_STARTFILE_PREFIX "/usr/lib/cmplrs/cc/"
|
||||
|
||||
#define ASM_FILE_START(FILE) \
|
||||
{ \
|
||||
alpha_write_verstamp (FILE); \
|
||||
fprintf (FILE, "\t.set noreorder\n"); \
|
||||
fprintf (FILE, "\t.set volatile\n"); \
|
||||
fprintf (FILE, "\t.set noat\n"); \
|
||||
if (TARGET_SUPPORT_ARCH) \
|
||||
fprintf (FILE, "\t.arch %s\n", \
|
||||
alpha_cpu == PROCESSOR_EV6 ? "ev6" \
|
||||
: (alpha_cpu == PROCESSOR_EV5 \
|
||||
? (TARGET_MAX ? "pca56" : TARGET_BWX ? "ev56" : "ev5") \
|
||||
: "ev4")); \
|
||||
\
|
||||
ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \
|
||||
}
|
||||
|
||||
/* No point in running CPP on our assembler output. */
|
||||
#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_GAS) != 0
|
||||
/* Don't pass -g to GNU as, because some versions don't accept this option. */
|
||||
#define ASM_SPEC "%{malpha-as:-g} -nocpp %{pg}"
|
||||
#else
|
||||
/* In OSF/1 v3.2c, the assembler by default does not output file names which
|
||||
causes mips-tfile to fail. Passing -g to the assembler fixes this problem.
|
||||
??? Strictly speaking, we need -g only if the user specifies -g. Passing
|
||||
it always means that we get slightly larger than necessary object files
|
||||
if the user does not specify -g. If we don't pass -g, then mips-tfile
|
||||
will need to be fixed to work in this case. Pass -O0 since some
|
||||
optimization are broken and don't help us anyway. */
|
||||
#define ASM_SPEC "%{!mgas:-g} -nocpp %{pg} -O0"
|
||||
#endif
|
||||
|
||||
/* Specify to run a post-processor, mips-tfile after the assembler
|
||||
has run to stuff the ecoff debug information into the object file.
|
||||
This is needed because the Alpha assembler provides no way
|
||||
of specifying such information in the assembly file. */
|
||||
|
||||
#if ((TARGET_DEFAULT | TARGET_CPU_DEFAULT) & MASK_GAS) != 0
|
||||
|
||||
#define ASM_FINAL_SPEC "\
|
||||
%{malpha-as: %{!mno-mips-tfile: \
|
||||
\n mips-tfile %{v*: -v} \
|
||||
%{K: -I %b.o~} \
|
||||
%{!K: %{save-temps: -I %b.o~}} \
|
||||
%{c:%W{o*}%{!o*:-o %b.o}}%{!c:-o %U.o} \
|
||||
%{.s:%i} %{!.s:%g.s}}}"
|
||||
|
||||
#else
|
||||
#define ASM_FINAL_SPEC "\
|
||||
%{!mgas: %{!mno-mips-tfile: \
|
||||
\n mips-tfile %{v*: -v} \
|
||||
%{K: -I %b.o~} \
|
||||
%{!K: %{save-temps: -I %b.o~}} \
|
||||
%{c:%W{o*}%{!o*:-o %b.o}}%{!c:-o %U.o} \
|
||||
%{.s:%i} %{!.s:%g.s}}}"
|
||||
|
||||
#endif
|
||||
|
||||
/* Indicate that we have a stamp.h to use. */
|
||||
#ifndef CROSS_COMPILE
|
||||
#define HAVE_STAMP_H 1
|
||||
#endif
|
||||
|
||||
/* Attempt to turn on access permissions for the stack. */
|
||||
|
||||
#define TRANSFER_FROM_TRAMPOLINE \
|
||||
void \
|
||||
__enable_execute_stack (addr) \
|
||||
void *addr; \
|
||||
{ \
|
||||
long size = getpagesize (); \
|
||||
long mask = ~(size-1); \
|
||||
char *page = (char *) (((long) addr) & mask); \
|
||||
char *end = (char *) ((((long) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
|
||||
\
|
||||
/* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ \
|
||||
if (mprotect (page, end - page, 7) < 0) \
|
||||
perror ("mprotect of trampoline code"); \
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
/* Definitions of target machine for GNU compiler, for DEC Alpha.
|
||||
Copyright (C) 1992, 1993, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1992, 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
Contributed by Richard Kenner (kenner@nyu.edu)
|
||||
|
||||
This file is part of GNU CC.
|
||||
@ -19,9 +19,6 @@ 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 "alpha/alpha.h"
|
||||
|
||||
/* In OSF 1.2, there is a linker bug that prevents use of -O3 to
|
||||
the linker. */
|
||||
|
||||
@ -29,3 +26,8 @@ Boston, MA 02111-1307, USA. */
|
||||
#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
|
||||
|
30
contrib/gcc/config/alpha/osf2or3.h
Normal file
30
contrib/gcc/config/alpha/osf2or3.h
Normal file
@ -0,0 +1,30 @@
|
||||
/* 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
|
||||
|
9
contrib/gcc/config/alpha/t-crtbe
Normal file
9
contrib/gcc/config/alpha/t-crtbe
Normal file
@ -0,0 +1,9 @@
|
||||
# Effectively disable the crtbegin/end rules using crtstuff.c
|
||||
T = disable
|
||||
|
||||
# Assemble startup files.
|
||||
crtbegin.o: $(srcdir)/config/alpha/crtbegin.asm $(GCC_PASSES)
|
||||
$(GCC_FOR_TARGET) -c -o crtbegin.o -x assembler $(srcdir)/config/alpha/crtbegin.asm
|
||||
|
||||
crtend.o: $(srcdir)/config/alpha/crtend.asm $(GCC_PASSES)
|
||||
$(GCC_FOR_TARGET) -c -o crtend.o -x assembler $(srcdir)/config/alpha/crtend.asm
|
6
contrib/gcc/config/alpha/t-vms
Normal file
6
contrib/gcc/config/alpha/t-vms
Normal file
@ -0,0 +1,6 @@
|
||||
# Do not build libgcc1.
|
||||
LIBGCC1 =
|
||||
CROSS_LIBGCC1 =
|
||||
|
||||
LIB2FUNCS_EXTRA = tramp.s
|
||||
|
16
contrib/gcc/config/alpha/va_list.h
Normal file
16
contrib/gcc/config/alpha/va_list.h
Normal file
@ -0,0 +1,16 @@
|
||||
/* A replacement for Digital Unix's <va_list.h>. */
|
||||
|
||||
#include <va-alpha.h>
|
||||
|
||||
#if !defined(_VA_LIST) && !defined(_HIDDEN_VA_LIST)
|
||||
#define _VA_LIST
|
||||
typedef __gnuc_va_list va_list;
|
||||
|
||||
#elif defined(_HIDDEN_VA_LIST) && !defined(_HIDDEN_VA_LIST_DONE)
|
||||
#define _HIDDEN_VA_LIST_DONE
|
||||
typedef __gnuc_va_list __va_list;
|
||||
|
||||
#elif defined(_HIDDEN_VA_LIST) && defined(_VA_LIST)
|
||||
#undef _HIDDEN_VA_LIST
|
||||
|
||||
#endif
|
22
contrib/gcc/config/alpha/vms-tramp.asm
Normal file
22
contrib/gcc/config/alpha/vms-tramp.asm
Normal file
@ -0,0 +1,22 @@
|
||||
;# New Alpha OpenVMS trampoline
|
||||
;#
|
||||
.set noreorder
|
||||
.set volatile
|
||||
.set noat
|
||||
.file 1 "tramp.s"
|
||||
.text
|
||||
.align 3
|
||||
.globl __tramp
|
||||
.ent __tramp
|
||||
__tramp..en:
|
||||
|
||||
.link
|
||||
.align 3
|
||||
__tramp:
|
||||
.pdesc __tramp..en,null
|
||||
.text
|
||||
ldq $1,24($27)
|
||||
ldq $27,16($27)
|
||||
ldq $28,8($27)
|
||||
jmp $31,($28),0
|
||||
.end __tramp
|
510
contrib/gcc/config/alpha/vms.h
Normal file
510
contrib/gcc/config/alpha/vms.h
Normal file
@ -0,0 +1,510 @@
|
||||
/* Output variables, constants and external declarations, for GNU compiler.
|
||||
Copyright (C) 1996, 1997, 1998 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 OPEN_VMS 1
|
||||
|
||||
/* This enables certain macros in alpha.h, which will make an indirect
|
||||
reference to an external symbol an invalid address. This needs to be
|
||||
defined before we include alpha.h, since it determines which macros
|
||||
are used for GO_IF_*. */
|
||||
|
||||
#define NO_EXTERNAL_INDIRECT_ADDRESS
|
||||
|
||||
#include "alpha/alpha.h"
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES \
|
||||
"-D__ALPHA -Dvms -DVMS -D__vms__ -D__VMS__ -Asystem(vms)"
|
||||
|
||||
#undef CPP_SUBTARGET_SPEC
|
||||
#define CPP_SUBTARGET_SPEC "\
|
||||
%{mfloat-ieee:-D__IEEE_FLOAT} \
|
||||
%{mfloat-vax:-D__G_FLOAT} \
|
||||
%{!mfloat-vax:-D__IEEE_FLOAT}"
|
||||
|
||||
/* Under OSF4, -p and -pg require -lprof1, and -lprof1 requires -lpdf. */
|
||||
|
||||
#define LIB_SPEC "%{p:-lprof1 -lpdf} %{pg:-lprof1 -lpdf} %{a:-lprof2} -lc"
|
||||
|
||||
/* Pass "-G 8" to ld because Alpha's CC does. Pass -O3 if we are
|
||||
optimizing, -O1 if we are not. Pass -shared, -non_shared or
|
||||
-call_shared as appropriate. Also pass -pg. */
|
||||
#define LINK_SPEC \
|
||||
"-G 8 %{O*:-O3} %{!O*:-O1} %{static:-non_shared} \
|
||||
%{!static:%{shared:-shared} %{!shared:-call_shared}} %{pg} %{taso} \
|
||||
%{rpath*}"
|
||||
|
||||
/* We allow $'s in identifiers unless -ansi is used .. */
|
||||
|
||||
#define DOLLARS_IN_IDENTIFIERS 2
|
||||
|
||||
/* These match the definitions used in DECCRTL, the VMS C run-time library
|
||||
|
||||
#define SIZE_TYPE "unsigned int"
|
||||
#define PTRDIFF_TYPE "int"
|
||||
*/
|
||||
|
||||
/* Use memcpy for structure copying, and so forth. */
|
||||
#define TARGET_MEM_FUNCTIONS
|
||||
|
||||
/* By default, allow $ to be part of an identifier. */
|
||||
#define DOLLARS_IN_IDENTIFIERS 2
|
||||
|
||||
#undef TARGET_DEFAULT
|
||||
#define TARGET_DEFAULT (MASK_FP|MASK_FPREGS|MASK_GAS)
|
||||
#undef TARGET_OPEN_VMS
|
||||
#define TARGET_OPEN_VMS 1
|
||||
|
||||
#undef TARGET_NAME
|
||||
#define TARGET_NAME "OpenVMS/Alpha"
|
||||
#undef TARGET_VERSION
|
||||
#define TARGET_VERSION fprintf (stderr, " (%s)", TARGET_NAME);
|
||||
|
||||
/* The structure return address arrives as an "argument" on VMS. */
|
||||
#undef STRUCT_VALUE_REGNUM
|
||||
#define STRUCT_VALUE 0
|
||||
#undef PCC_STATIC_STRUCT_RETURN
|
||||
|
||||
/* no floating emulation. */
|
||||
#undef REAL_ARITHMETIC
|
||||
|
||||
/* "long" is 32 bits. */
|
||||
#undef LONG_TYPE_SIZE
|
||||
#define LONG_TYPE_SIZE 32
|
||||
|
||||
/* Pointer is 32 bits but the hardware has 64-bit addresses, sign extended. */
|
||||
#undef POINTER_SIZE
|
||||
#define POINTER_SIZE 32
|
||||
#define POINTERS_EXTEND_UNSIGNED 0
|
||||
|
||||
#define MAX_OFILE_ALIGNMENT 524288 /* 8 x 2^16 by DEC Ada Test CD40VRA */
|
||||
|
||||
#undef FIXED_REGISTERS
|
||||
#define FIXED_REGISTERS \
|
||||
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }
|
||||
|
||||
#undef CALL_USED_REGISTERS
|
||||
#define CALL_USED_REGISTERS \
|
||||
{1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
|
||||
1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, \
|
||||
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }
|
||||
|
||||
#undef HARD_FRAME_POINTER_REGNUM
|
||||
#define HARD_FRAME_POINTER_REGNUM 29
|
||||
|
||||
#undef CAN_ELIMINATE
|
||||
#define CAN_ELIMINATE(FROM, TO) \
|
||||
((TO) != STACK_POINTER_REGNUM || ! alpha_using_fp ())
|
||||
|
||||
#undef INITIAL_ELIMINATION_OFFSET
|
||||
#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
|
||||
{ if ((FROM) == FRAME_POINTER_REGNUM) \
|
||||
(OFFSET) = alpha_sa_size () + alpha_pv_save_size (); \
|
||||
else if ((FROM) == ARG_POINTER_REGNUM) \
|
||||
(OFFSET) = (ALPHA_ROUND (alpha_sa_size () + alpha_pv_save_size () \
|
||||
+ get_frame_size () \
|
||||
+ current_function_pretend_args_size) \
|
||||
- current_function_pretend_args_size); \
|
||||
if ((TO) == STACK_POINTER_REGNUM) \
|
||||
(OFFSET) += ALPHA_ROUND (current_function_outgoing_args_size); \
|
||||
}
|
||||
|
||||
/* Define a data type for recording info about an argument list
|
||||
during the scan of that argument list. This data type should
|
||||
hold all necessary information about the function itself
|
||||
and about the args processed so far, enough to enable macros
|
||||
such as FUNCTION_ARG to determine where the next arg should go.
|
||||
|
||||
On Alpha/VMS, this is a structure that contains the number of
|
||||
arguments and, for each argument, the datatype of that argument.
|
||||
|
||||
The number of arguments is a number of words of arguments scanned so far.
|
||||
Thus 6 or more means all following args should go on the stack. */
|
||||
|
||||
enum avms_arg_type {I64, FF, FD, FG, FS, FT};
|
||||
typedef struct {char num_args; enum avms_arg_type atypes[6];} avms_arg_info;
|
||||
|
||||
#undef CUMULATIVE_ARGS
|
||||
#define CUMULATIVE_ARGS avms_arg_info
|
||||
|
||||
/* Initialize a variable CUM of type CUMULATIVE_ARGS
|
||||
for a call to a function whose data type is FNTYPE.
|
||||
For a library call, FNTYPE is 0. */
|
||||
|
||||
#undef INIT_CUMULATIVE_ARGS
|
||||
#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
|
||||
(CUM).num_args = 0; \
|
||||
(CUM).atypes[0] = (CUM).atypes[1] = (CUM).atypes[2] = I64; \
|
||||
(CUM).atypes[3] = (CUM).atypes[4] = (CUM).atypes[5] = I64;
|
||||
|
||||
/* Update the data in CUM to advance over an argument
|
||||
of mode MODE and data type TYPE.
|
||||
(TYPE is null for libcalls where that information may not be available.) */
|
||||
|
||||
extern enum avms_arg_type alpha_arg_type ();
|
||||
|
||||
/* Determine where to put an argument to a function.
|
||||
Value is zero to push the argument on the stack,
|
||||
or a hard register in which to store the argument.
|
||||
|
||||
MODE is the argument's machine mode (or VOIDmode for no more args).
|
||||
TYPE is the data type of the argument (as a tree).
|
||||
This is null for libcalls where that information may
|
||||
not be available.
|
||||
CUM is a variable of type CUMULATIVE_ARGS which gives info about
|
||||
the preceding args and about the function being called.
|
||||
NAMED is nonzero if this argument is a named parameter
|
||||
(otherwise it is an extra parameter matching an ellipsis).
|
||||
|
||||
On Alpha the first 6 words of args are normally in registers
|
||||
and the rest are pushed. */
|
||||
|
||||
extern struct rtx_def *alpha_arg_info_reg_val ();
|
||||
#undef FUNCTION_ARG
|
||||
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
|
||||
((MODE) == VOIDmode ? alpha_arg_info_reg_val (CUM) \
|
||||
: ((CUM.num_args) < 6 && ! MUST_PASS_IN_STACK (MODE, TYPE) \
|
||||
? gen_rtx(REG, (MODE), \
|
||||
((CUM).num_args + 16 \
|
||||
+ ((TARGET_FPREGS \
|
||||
&& (GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT \
|
||||
|| GET_MODE_CLASS (MODE) == MODE_FLOAT)) \
|
||||
* 32))) \
|
||||
: 0))
|
||||
|
||||
#undef FUNCTION_ARG_ADVANCE
|
||||
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
|
||||
if (MUST_PASS_IN_STACK (MODE, TYPE)) \
|
||||
(CUM).num_args += 6; \
|
||||
else \
|
||||
{ \
|
||||
if ((CUM).num_args < 6) \
|
||||
(CUM).atypes[(CUM).num_args] = alpha_arg_type (MODE); \
|
||||
\
|
||||
(CUM).num_args += ALPHA_ARG_SIZE (MODE, TYPE, NAMED); \
|
||||
}
|
||||
|
||||
/* For an arg passed partly in registers and partly in memory,
|
||||
this is the number of registers used.
|
||||
For args passed entirely in registers or entirely in memory, zero. */
|
||||
|
||||
#undef FUNCTION_ARG_PARTIAL_NREGS
|
||||
#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
|
||||
((CUM).num_args < 6 && 6 < (CUM).num_args \
|
||||
+ ALPHA_ARG_SIZE (MODE, TYPE, NAMED) \
|
||||
? 6 - (CUM).num_args : 0)
|
||||
|
||||
/* Perform any needed actions needed for a function that is receiving a
|
||||
variable number of arguments.
|
||||
|
||||
CUM is as for INIT_CUMULATIVE_ARGS.
|
||||
|
||||
MODE and TYPE are the mode and type of the current parameter.
|
||||
|
||||
PRETEND_SIZE is a variable that should be set to the amount of stack
|
||||
that must be pushed by the prolog to pretend that our caller pushed
|
||||
it.
|
||||
|
||||
Normally, this macro will push all remaining incoming registers on the
|
||||
stack and set PRETEND_SIZE to the length of the registers pushed.
|
||||
|
||||
For VMS, we allocate space for all 6 arg registers plus a count.
|
||||
|
||||
However, if NO registers need to be saved, don't allocate any space.
|
||||
This is not only because we won't need the space, but because AP includes
|
||||
the current_pretend_args_size and we don't want to mess up any
|
||||
ap-relative addresses already made. */
|
||||
|
||||
#undef SETUP_INCOMING_VARARGS
|
||||
#define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \
|
||||
{ if ((CUM).num_args < 6) \
|
||||
{ \
|
||||
if (! (NO_RTL)) \
|
||||
{ \
|
||||
emit_move_insn (gen_rtx (REG, DImode, 1), \
|
||||
virtual_incoming_args_rtx); \
|
||||
emit_insn (gen_arg_home ()); \
|
||||
} \
|
||||
\
|
||||
PRETEND_SIZE = 7 * UNITS_PER_WORD; \
|
||||
} \
|
||||
}
|
||||
|
||||
#undef ASM_FILE_START
|
||||
#define ASM_FILE_START(FILE) \
|
||||
{ \
|
||||
alpha_write_verstamp (FILE); \
|
||||
fprintf (FILE, "\t.set noreorder\n"); \
|
||||
fprintf (FILE, "\t.set volatile\n"); \
|
||||
ASM_OUTPUT_SOURCE_FILENAME (FILE, main_input_filename); \
|
||||
}
|
||||
|
||||
#undef ASM_OUTPUT_FLOAT
|
||||
#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
|
||||
{ \
|
||||
if (REAL_VALUE_ISINF (VALUE) \
|
||||
|| REAL_VALUE_ISNAN (VALUE) \
|
||||
|| REAL_VALUE_MINUS_ZERO (VALUE)) \
|
||||
{ \
|
||||
long t; \
|
||||
REAL_VALUE_TO_TARGET_SINGLE ((VALUE), t); \
|
||||
fprintf (FILE, "\t.long 0x%lx\n", t & 0xffffffff); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
char str[30]; \
|
||||
REAL_VALUE_TO_DECIMAL ((VALUE), "%.20e", str); \
|
||||
fprintf (FILE, "\t.%c_floating %s\n", (TARGET_FLOAT_VAX)?'f':'s', str); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define LINK_SECTION_ASM_OP ".link"
|
||||
#define READONLY_SECTION_ASM_OP ".rdata"
|
||||
#define LITERALS_SECTION_ASM_OP ".literals"
|
||||
#define CTORS_SECTION_ASM_OP ".ctors"
|
||||
#define DTORS_SECTION_ASM_OP ".dtors"
|
||||
|
||||
#undef EXTRA_SECTIONS
|
||||
#define EXTRA_SECTIONS in_link, in_rdata, in_literals, in_ctors, in_dtors
|
||||
|
||||
#undef EXTRA_SECTION_FUNCTIONS
|
||||
#define EXTRA_SECTION_FUNCTIONS \
|
||||
void \
|
||||
readonly_section () \
|
||||
{ \
|
||||
if (in_section != in_rdata) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", READONLY_SECTION_ASM_OP); \
|
||||
in_section = in_rdata; \
|
||||
} \
|
||||
} \
|
||||
void \
|
||||
link_section () \
|
||||
{ \
|
||||
if (in_section != in_link) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", LINK_SECTION_ASM_OP); \
|
||||
in_section = in_link; \
|
||||
} \
|
||||
} \
|
||||
void \
|
||||
literals_section () \
|
||||
{ \
|
||||
if (in_section != in_literals) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", LITERALS_SECTION_ASM_OP); \
|
||||
in_section = in_literals; \
|
||||
} \
|
||||
} \
|
||||
void \
|
||||
ctors_section () \
|
||||
{ \
|
||||
if (in_section != in_ctors) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", CTORS_SECTION_ASM_OP); \
|
||||
in_section = in_ctors; \
|
||||
} \
|
||||
} \
|
||||
void \
|
||||
dtors_section () \
|
||||
{ \
|
||||
if (in_section != in_dtors) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", DTORS_SECTION_ASM_OP); \
|
||||
in_section = in_dtors; \
|
||||
} \
|
||||
}
|
||||
|
||||
#undef ASM_OUTPUT_ADDR_DIFF_ELT
|
||||
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) abort ()
|
||||
|
||||
#undef ASM_OUTPUT_ADDR_VEC_ELT
|
||||
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
|
||||
fprintf (FILE, "\t.quad $L%d\n", (VALUE))
|
||||
|
||||
#undef READONLY_DATA_SECTION
|
||||
#define READONLY_DATA_SECTION readonly_section
|
||||
|
||||
#define ASM_FILE_END(FILE) alpha_write_linkage (FILE);
|
||||
|
||||
#undef CASE_VECTOR_MODE
|
||||
#define CASE_VECTOR_MODE DImode
|
||||
#undef CASE_VECTOR_PC_RELATIVE
|
||||
|
||||
#undef ASM_OUTPUT_CASE_LABEL
|
||||
#define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLEINSN) \
|
||||
{ ASM_OUTPUT_ALIGN (FILE, 3); ASM_OUTPUT_INTERNAL_LABEL (FILE, PREFIX, NUM); }
|
||||
|
||||
/* This says how to output assembler code to declare an
|
||||
uninitialized external linkage data object. */
|
||||
|
||||
#define COMMON_ASM_OP ".comm"
|
||||
|
||||
#undef ASM_OUTPUT_ALIGNED_COMMON
|
||||
#define ASM_OUTPUT_ALIGNED_COMMON(FILE, NAME, SIZE, ALIGN) \
|
||||
do { \
|
||||
fprintf ((FILE), "\t%s\t", COMMON_ASM_OP); \
|
||||
assemble_name ((FILE), (NAME)); \
|
||||
fprintf ((FILE), ",%u,%u\n", (SIZE), (ALIGN) / BITS_PER_UNIT); \
|
||||
} while (0)
|
||||
|
||||
#define NO_MD_PROTOTYPES
|
||||
|
||||
/* Output assembler code for a block containing the constant parts
|
||||
of a trampoline, leaving space for the variable parts.
|
||||
|
||||
The trampoline should set the static chain pointer to value placed
|
||||
into the trampoline and should branch to the specified routine.
|
||||
Note that $27 has been set to the address of the trampoline, so we can
|
||||
use it for addressability of the two data items. Trampolines are always
|
||||
aligned to FUNCTION_BOUNDARY, which is 64 bits. */
|
||||
|
||||
#undef TRAMPOLINE_TEMPLATE
|
||||
#define TRAMPOLINE_TEMPLATE(FILE) \
|
||||
{ \
|
||||
fprintf (FILE, "\t.quad 0\n"); \
|
||||
fprintf (FILE, "\t.linkage __tramp\n"); \
|
||||
fprintf (FILE, "\t.quad 0\n"); \
|
||||
}
|
||||
|
||||
/* Length in units of the trampoline for entering a nested function. */
|
||||
|
||||
#undef TRAMPOLINE_SIZE
|
||||
#define TRAMPOLINE_SIZE 32
|
||||
|
||||
/* Emit RTL insns to initialize the variable parts of a trampoline.
|
||||
FNADDR is an RTX for the address of the function's pure code.
|
||||
CXT is an RTX for the static chain value for the function. */
|
||||
|
||||
#undef INITIALIZE_TRAMPOLINE
|
||||
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
|
||||
alpha_initialize_trampoline (TRAMP, FNADDR, CXT, 16, 24, -1)
|
||||
|
||||
/* A C statement (sans semicolon) to output an element in the table of
|
||||
global constructors. */
|
||||
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
|
||||
do { \
|
||||
ctors_section (); \
|
||||
fprintf (FILE, "\t.quad "); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fprintf (FILE, "\n"); \
|
||||
} while (0)
|
||||
|
||||
/* A C statement (sans semicolon) to output an element in the table of
|
||||
global destructors. */
|
||||
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
|
||||
do { \
|
||||
dtors_section (); \
|
||||
fprintf (FILE, "\t.quad "); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fprintf (FILE, "\n"); \
|
||||
} while (0)
|
||||
|
||||
#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, NAME, ARGS) \
|
||||
(vms_valid_decl_attribute_p (DECL, ATTRIBUTES, NAME, ARGS))
|
||||
extern int vms_valid_decl_attribute_p ();
|
||||
|
||||
#undef SDB_DEBUGGING_INFO
|
||||
#undef MIPS_DEBUGGING_INFO
|
||||
#undef DBX_DEBUGGING_INFO
|
||||
|
||||
#define DWARF2_DEBUGGING_INFO
|
||||
|
||||
/* This is how to output an assembler line
|
||||
that says to advance the location counter
|
||||
to a multiple of 2**LOG bytes. */
|
||||
|
||||
#undef ASM_OUTPUT_ALIGN
|
||||
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
|
||||
fprintf (FILE, "\t.align %d\n", LOG);
|
||||
|
||||
#define UNALIGNED_SHORT_ASM_OP ".word"
|
||||
#define UNALIGNED_INT_ASM_OP ".long"
|
||||
#define UNALIGNED_DOUBLE_INT_ASM_OP ".quad"
|
||||
|
||||
#define ASM_OUTPUT_SECTION(FILE,SECTION) \
|
||||
(strcmp (SECTION, ".text") == 0) \
|
||||
? text_section () \
|
||||
: named_section (NULL_TREE, SECTION, 0), \
|
||||
ASM_OUTPUT_ALIGN (FILE, 0) \
|
||||
|
||||
#define ASM_OUTPUT_SECTION_NAME(FILE,DECL,NAME,RELOC) \
|
||||
do \
|
||||
{ \
|
||||
char *flags; \
|
||||
int ovr = 0; \
|
||||
if (DECL && DECL_MACHINE_ATTRIBUTES (DECL) \
|
||||
&& lookup_attribute \
|
||||
("overlaid", DECL_MACHINE_ATTRIBUTES (DECL))) \
|
||||
flags = ",OVR", ovr = 1; \
|
||||
else if (strncmp (NAME,".debug", 6) == 0) \
|
||||
flags = ",NOWRT"; \
|
||||
else \
|
||||
flags = ""; \
|
||||
fputc ('\n', (FILE)); \
|
||||
fprintf (FILE, ".section\t%s%s\n", NAME, flags); \
|
||||
if (ovr) \
|
||||
(NAME) = ""; \
|
||||
} while (0)
|
||||
|
||||
#define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
|
||||
do { literals_section(); \
|
||||
fprintf ((FILE), "\t"); \
|
||||
assemble_name (FILE, LABEL1); \
|
||||
fprintf (FILE, " = "); \
|
||||
assemble_name (FILE, LABEL2); \
|
||||
fprintf (FILE, "\n"); \
|
||||
} while (0)
|
||||
|
||||
#undef PREFERRED_DEBUGGING_TYPE
|
||||
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
|
||||
|
||||
#undef ASM_FORMAT_PRIVATE_NAME
|
||||
#define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
|
||||
( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12), \
|
||||
sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
|
||||
|
||||
/* ??? VMS uses different linkage. */
|
||||
#undef ASM_OUTPUT_MI_THUNK
|
||||
|
||||
#undef ASM_SPEC
|
||||
#undef ASM_FINAL_SPEC
|
||||
#undef LINK_SPEC
|
||||
#undef STARTFILE_SPEC
|
||||
#define ASM_SPEC "-nocpp %{pg}"
|
||||
#define LINK_SPEC "%{g3:-g3} %{g0:-g0} %{shared:-shared} %{v:-v}"
|
||||
|
||||
/* Define the names of the division and modulus functions. */
|
||||
#define DIVSI3_LIBCALL "OTS$DIV_I"
|
||||
#define DIVDI3_LIBCALL "OTS$DIV_L"
|
||||
#define UDIVSI3_LIBCALL "OTS$DIV_UI"
|
||||
#define UDIVDI3_LIBCALL "OTS$DIV_UL"
|
||||
#define MODSI3_LIBCALL "OTS$REM_I"
|
||||
#define MODDI3_LIBCALL "OTS$REM_L"
|
||||
#define UMODSI3_LIBCALL "OTS$REM_UI"
|
||||
#define UMODDI3_LIBCALL "OTS$REM_UL"
|
||||
|
||||
#define DIR_SEPARATOR ']'
|
||||
|
||||
#define PREFIX "GNU_ROOT:"
|
51
contrib/gcc/config/alpha/vxworks.h
Normal file
51
contrib/gcc/config/alpha/vxworks.h
Normal file
@ -0,0 +1,51 @@
|
||||
/* Definitions of target machine for GNU compiler. Vxworks Alpha version.
|
||||
Copyright (C) 1998 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 file just exists to give specs for the Alpha running on VxWorks. */
|
||||
|
||||
#undef CPP_SUBTARGET_SPEC
|
||||
#define CPP_SUBTARGET_SPEC "\
|
||||
%{mvxsim:-DCPU=SIMALPHADUNIX} \
|
||||
%{!mvxsim: %{!mcpu*|mcpu=21064:-DCPU=21064} %{mcpu=21164:-DCPU=21164}} \
|
||||
%{posix: -D_POSIX_SOURCE}"
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "\
|
||||
-D__vxworks -D__alpha_vxworks -Asystem(vxworks) \
|
||||
-Asystem(embedded) -D_LONGLONG"
|
||||
|
||||
/* VxWorks does all the library stuff itself. */
|
||||
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC ""
|
||||
|
||||
/* VxWorks uses object files, not loadable images. make linker just
|
||||
combine objects. */
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "-r"
|
||||
|
||||
/* VxWorks provides the functionality of crt0.o and friends itself. */
|
||||
|
||||
#undef STARTFILE_SPEC
|
||||
#define STARTFILE_SPEC ""
|
||||
|
||||
#undef ENDFILE_SPEC
|
||||
#define ENDFILE_SPEC ""
|
23
contrib/gcc/config/alpha/xm-openbsd.h
Normal file
23
contrib/gcc/config/alpha/xm-openbsd.h
Normal file
@ -0,0 +1,23 @@
|
||||
/* Configuration file for an host running alpha OpenBSD.
|
||||
Copyright (C) 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 <xm-openbsd.h>
|
||||
#include <alpha/xm-alpha.h>
|
||||
|
93
contrib/gcc/config/alpha/xm-vms.h
Normal file
93
contrib/gcc/config/alpha/xm-vms.h
Normal file
@ -0,0 +1,93 @@
|
||||
/* Configuration for GNU C-compiler for openVMS/Alpha.
|
||||
Copyright (C) 1996, 1997 Free Software Foundation, Inc.
|
||||
Contributed by Klaus Kaempf (kkaempf@progis.de).
|
||||
|
||||
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. */
|
||||
|
||||
/* If compiling with DECC, need to fix problem with <stdio.h>
|
||||
which defines a macro called FILE_TYPE that breaks "tree.h".
|
||||
Fortunately it uses #ifndef to suppress multiple inclusions.
|
||||
Three possible cases:
|
||||
1) <stdio.h> has already been included -- ours will be no-op;
|
||||
2) <stdio.h> will be included after us -- "theirs" will be no-op;
|
||||
3) <stdio.h> isn't needed -- including it here shouldn't hurt.
|
||||
In all three cases, the problem macro will be removed here. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef __DECC
|
||||
#undef FILE_TYPE
|
||||
#endif
|
||||
|
||||
#undef HOST_BITS_PER_LONG
|
||||
#define HOST_BITS_PER_LONG 32
|
||||
|
||||
#define HOST_WIDE_INT long long
|
||||
#define HOST_BITS_PER_WIDE_INT 64
|
||||
|
||||
#undef SUCCESS_EXIT_CODE
|
||||
#define SUCCESS_EXIT_CODE 1
|
||||
#undef FATAL_EXIT_CODE
|
||||
#define FATAL_EXIT_CODE (44 | 0x10000000) /* Abort, and no DCL message. */
|
||||
|
||||
/* A couple of conditionals for execution machine are controlled here. */
|
||||
#ifndef VMS
|
||||
#define VMS
|
||||
#endif
|
||||
|
||||
#define GCC_INCLUDE_DIR ""
|
||||
/* Specify the list of include file directories. */
|
||||
#define INCLUDE_DEFAULTS \
|
||||
{ \
|
||||
{ "GNU_GXX_INCLUDE:", "G++", 1, 1 }, \
|
||||
{ "GNU_CC_INCLUDE:", "GCC", 0, 0 }, \
|
||||
{ ".", 0, 0, 1 }, \
|
||||
{ 0, 0, 0, 0 } \
|
||||
}
|
||||
|
||||
/* Define a local equivalent (sort of) for unlink */
|
||||
#define unlink remove
|
||||
|
||||
#define NEED_ATEXIT
|
||||
#define HAVE_VPRINTF
|
||||
#define HAVE_PUTENV
|
||||
#define HAVE_STRERROR
|
||||
#define HAVE_ATOLL
|
||||
|
||||
#define NO_SYS_PARAMS_H /* Don't have <sys/params.h> */
|
||||
#define USE_C_ALLOCA /* Using alloca.c */
|
||||
|
||||
#define HAVE_FCNTL_H 1
|
||||
#define HAVE_STDLIB_H 1
|
||||
#define HAVE_UNISTD_H 1
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_LIMITS_H 1
|
||||
#define HAVE_STDDEF_H 1
|
||||
#define HAVE_TIME_H 1
|
||||
#define STDC_HEADERS 1
|
||||
#define HAVE_CPP_STRINGIFY 1
|
||||
|
||||
#if __STDC__
|
||||
extern void *alloca (size_t);
|
||||
#else
|
||||
extern char *alloca (unsigned int);
|
||||
#endif
|
||||
|
||||
#define OBJECT_SUFFIX ".obj"
|
||||
#define EXECUTABLE_SUFFIX ".exe"
|
@ -39,50 +39,3 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Define a symbol indicating that we are using aoutos.h. */
|
||||
#define USING_AOUTOS_H
|
||||
|
||||
/* A C statement (sans semicolon) to output an element in the table of
|
||||
global constructors.
|
||||
If using GNU LD, tell it that this is part of the static destructor set.
|
||||
This code works for any machine provided you use GNU as/ld.
|
||||
If not using GNU LD, rely on a "collect" program to look for names defined
|
||||
in the particular form we choose as global constructor function names. */
|
||||
|
||||
#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
|
||||
do { \
|
||||
if (flag_gnu_linker) \
|
||||
{ \
|
||||
/* Output an N_SETT (0x16, 22.) for the name. */ \
|
||||
fprintf (FILE, "%s \"___CTOR_LIST__\",22,0,0,", ASM_STABS_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fputc ('\n', FILE); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
/* A C statement (sans semicolon) to output an element in the table of
|
||||
global destructors. */
|
||||
|
||||
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
|
||||
do { \
|
||||
if (flag_gnu_linker) \
|
||||
{ \
|
||||
/* Output an N_SETT (0x16, 22.) for the name. */ \
|
||||
fprintf (FILE, "%s \"___DTOR_LIST__\",22,0,0,", ASM_STABS_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fputc ('\n', FILE); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/* Likewise for entries we want to record for garbage collection.
|
||||
Garbage collection is still under development. */
|
||||
|
||||
#define ASM_OUTPUT_GC_ENTRY(FILE,NAME) \
|
||||
do { \
|
||||
if (flag_gnu_linker) \
|
||||
{ \
|
||||
/* Output an N_SETT (0x16, 22.) for the name. */ \
|
||||
fprintf (FILE, "%s \"___PTR_LIST__\",22,0,0,", ASM_STABS_OP); \
|
||||
assemble_name (FILE, NAME); \
|
||||
fputc ('\n', FILE); \
|
||||
} \
|
||||
} while (0)
|
||||
|
30
contrib/gcc/config/dbx.h
Normal file
30
contrib/gcc/config/dbx.h
Normal file
@ -0,0 +1,30 @@
|
||||
/* Prefer DBX (stabs) debugging information.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This file causes gcc to prefer using DBX (stabs) debugging
|
||||
information. The configure script will add a #include of this file
|
||||
to tm.h when --with-stabs is used for certain targets. */
|
||||
|
||||
#ifndef DBX_DEBUGGING_INFO
|
||||
#define DBX_DEBUGGING_INFO
|
||||
#endif
|
||||
|
||||
#undef PREFERRED_DEBUGGING_TYPE
|
||||
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
|
87
contrib/gcc/config/dbxcoff.h
Normal file
87
contrib/gcc/config/dbxcoff.h
Normal file
@ -0,0 +1,87 @@
|
||||
/* Definitions needed when using stabs embedded in COFF sections.
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
GNU CC is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2, or (at your option)
|
||||
any later version.
|
||||
|
||||
GNU CC is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with GNU CC; see the file COPYING. If not, write to
|
||||
the Free Software Foundation, 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* This file may be included by any COFF target which wishes to
|
||||
support -gstabs generating stabs in sections, as produced by gas
|
||||
and understood by gdb. */
|
||||
|
||||
/* Output DBX (stabs) debugging information if doing -gstabs. */
|
||||
|
||||
#undef DBX_DEBUGGING_INFO
|
||||
#define DBX_DEBUGGING_INFO
|
||||
|
||||
/* Generate SDB debugging information by default. */
|
||||
|
||||
#ifndef PREFERRED_DEBUGGING_TYPE
|
||||
#define PREFERRED_DEBUGGING_TYPE SDB_DEBUG
|
||||
#endif
|
||||
|
||||
/* Be function-relative for block and source line stab directives. */
|
||||
|
||||
#undef DBX_BLOCKS_FUNCTION_RELATIVE
|
||||
#define DBX_BLOCKS_FUNCTION_RELATIVE 1
|
||||
|
||||
/* but, to make this work, functions must appear prior to line info. */
|
||||
|
||||
#undef DBX_FUNCTION_FIRST
|
||||
#define DBX_FUNCTION_FIRST
|
||||
|
||||
/* Generate a blank trailing N_SO to mark the end of the .o file, since
|
||||
we can't depend upon the linker to mark .o file boundaries with
|
||||
embedded stabs. */
|
||||
|
||||
#undef DBX_OUTPUT_MAIN_SOURCE_FILE_END
|
||||
#define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME) \
|
||||
fprintf (FILE, \
|
||||
"\t.text\n\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO)
|
||||
|
||||
/* Like block addresses, stabs line numbers are relative to the
|
||||
current function. */
|
||||
|
||||
#undef ASM_OUTPUT_SOURCE_LINE
|
||||
#define ASM_OUTPUT_SOURCE_LINE(FILE, LINE) \
|
||||
{ if (write_symbols == SDB_DEBUG) { \
|
||||
fprintf ((FILE), "\t.ln\t%d\n", \
|
||||
((sdb_begin_function_line > -1) \
|
||||
? (LINE) - sdb_begin_function_line : 1)); \
|
||||
} else if (write_symbols == DBX_DEBUG) { \
|
||||
static int sym_lineno = 1; \
|
||||
char buffer[256]; \
|
||||
ASM_GENERATE_INTERNAL_LABEL (buffer, "LM", sym_lineno); \
|
||||
fprintf (FILE, ".stabn 68,0,%d,", LINE); \
|
||||
assemble_name (FILE, buffer); \
|
||||
putc ('-', FILE); \
|
||||
assemble_name (FILE, \
|
||||
XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0)); \
|
||||
putc ('\n', FILE); \
|
||||
ASM_OUTPUT_INTERNAL_LABEL (FILE, "LM", sym_lineno); \
|
||||
sym_lineno++; \
|
||||
} }
|
||||
|
||||
/* When generating stabs debugging, use N_BINCL entries. */
|
||||
|
||||
#undef DBX_USE_BINCL
|
||||
#define DBX_USE_BINCL
|
||||
|
||||
/* There is no limit to the length of stabs strings. */
|
||||
|
||||
#ifndef DBX_CONTIN_LENGTH
|
||||
#define DBX_CONTIN_LENGTH 0
|
||||
#endif
|
96
contrib/gcc/config/float-i128.h
Normal file
96
contrib/gcc/config/float-i128.h
Normal file
@ -0,0 +1,96 @@
|
||||
/* 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
|
||||
|
||||
#endif /* _FLOAT_H_ */
|
96
contrib/gcc/config/float-i32.h
Normal file
96
contrib/gcc/config/float-i32.h
Normal file
@ -0,0 +1,96 @@
|
||||
/* 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
|
||||
|
||||
#endif /* _FLOAT_H_ */
|
104
contrib/gcc/config/float-i386.h
Normal file
104
contrib/gcc/config/float-i386.h
Normal file
@ -0,0 +1,104 @@
|
||||
/* 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
|
||||
#ifndef __LDBL_UNION__
|
||||
#define __LDBL_UNION__
|
||||
union __convert_long_double {
|
||||
unsigned __convert_long_double_i[4];
|
||||
long double __convert_long_double_d;
|
||||
};
|
||||
#endif
|
||||
#define LDBL_EPSILON (__extension__ ((union __convert_long_double) {__convert_long_double_i: {0x0, 0x80000000, 0x3fc0, 0x0}}).__convert_long_double_d)
|
||||
/* 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 (__extension__ ((union __convert_long_double) {__convert_long_double_i: {0x0, 0x80000000, 0x1, 0x0}}).__convert_long_double_d)
|
||||
/* 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 (__extension__ ((union __convert_long_double) {__convert_long_double_i: {0xffffffff, 0xffffffff, 0x107ffe, 0x0}}).__convert_long_double_d)
|
||||
/* Maximum int x such that 10**x is a representable long double */
|
||||
#undef LDBL_MAX_10_EXP
|
||||
#define LDBL_MAX_10_EXP 4932
|
||||
|
||||
#endif /* _FLOAT_H___ */
|
96
contrib/gcc/config/float-i64.h
Normal file
96
contrib/gcc/config/float-i64.h
Normal file
@ -0,0 +1,96 @@
|
||||
/* 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
|
||||
|
||||
#endif /* _FLOAT_H_ */
|
97
contrib/gcc/config/float-m68k.h
Normal file
97
contrib/gcc/config/float-m68k.h
Normal file
@ -0,0 +1,97 @@
|
||||
/* 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
|
||||
|
||||
#endif /* _FLOAT_H_ */
|
130
contrib/gcc/config/float-sh.h
Normal file
130
contrib/gcc/config/float-sh.h
Normal file
@ -0,0 +1,130 @@
|
||||
/* 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
|
||||
|
||||
#ifdef __SH3E__
|
||||
|
||||
/* 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
|
||||
|
||||
/* 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-16
|
||||
/* 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-308
|
||||
/* 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+308
|
||||
/* Maximum int x such that 10**x is a representable long double */
|
||||
#undef LDBL_MAX_10_EXP
|
||||
#define LDBL_MAX_10_EXP 308
|
||||
|
||||
#endif /* _FLOAT_H_ */
|
96
contrib/gcc/config/float-vax.h
Normal file
96
contrib/gcc/config/float-vax.h
Normal file
@ -0,0 +1,96 @@
|
||||
/* 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
|
||||
|
||||
/* 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.70141183460469229e+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-17
|
||||
/* 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-39
|
||||
/* 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.70141183460469229e+38
|
||||
/* 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_ */
|
@ -1,8 +1,7 @@
|
||||
/* This is a software floating point library which can be used instead of
|
||||
the floating point routines in libgcc1.c for targets without hardware
|
||||
floating point. */
|
||||
|
||||
/* Copyright (C) 1994, 1995 Free Software Foundation, Inc.
|
||||
floating point.
|
||||
Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
|
||||
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
|
||||
@ -44,6 +43,55 @@ Boston, MA 02111-1307, USA. */
|
||||
/* The intended way to use this file is to make two copies, add `#define FLOAT'
|
||||
to one copy, then compile both copies and add them to libgcc.a. */
|
||||
|
||||
/* Defining FINE_GRAINED_LIBRARIES allows one to select which routines
|
||||
from this file are compiled via additional -D options.
|
||||
|
||||
This avoids the need to pull in the entire fp emulation library
|
||||
when only a small number of functions are needed.
|
||||
|
||||
If FINE_GRAINED_LIBRARIES is not defined, then compile every
|
||||
suitable routine. */
|
||||
#ifndef FINE_GRAINED_LIBRARIES
|
||||
#define L_pack_df
|
||||
#define L_unpack_df
|
||||
#define L_pack_sf
|
||||
#define L_unpack_sf
|
||||
#define L_addsub_sf
|
||||
#define L_addsub_df
|
||||
#define L_mul_sf
|
||||
#define L_mul_df
|
||||
#define L_div_sf
|
||||
#define L_div_df
|
||||
#define L_fpcmp_parts_sf
|
||||
#define L_fpcmp_parts_df
|
||||
#define L_compare_sf
|
||||
#define L_compare_df
|
||||
#define L_eq_sf
|
||||
#define L_eq_df
|
||||
#define L_ne_sf
|
||||
#define L_ne_df
|
||||
#define L_gt_sf
|
||||
#define L_gt_df
|
||||
#define L_ge_sf
|
||||
#define L_ge_df
|
||||
#define L_lt_sf
|
||||
#define L_lt_df
|
||||
#define L_le_sf
|
||||
#define L_le_df
|
||||
#define L_si_to_sf
|
||||
#define L_si_to_df
|
||||
#define L_sf_to_si
|
||||
#define L_df_to_si
|
||||
#define L_f_to_usi
|
||||
#define L_df_to_usi
|
||||
#define L_negate_sf
|
||||
#define L_negate_df
|
||||
#define L_make_sf
|
||||
#define L_make_df
|
||||
#define L_sf_to_df
|
||||
#define L_df_to_sf
|
||||
#endif
|
||||
|
||||
/* The following macros can be defined to change the behaviour of this file:
|
||||
FLOAT: Implement a `float', aka SFmode, fp library. If this is not
|
||||
defined, then this file implements a `double', aka DFmode, fp library.
|
||||
@ -62,6 +110,52 @@ Boston, MA 02111-1307, USA. */
|
||||
SMALL_MACHINE: Useful when operations on QIs and HIs are faster
|
||||
than on an SI */
|
||||
|
||||
/* We don't currently support extended floats (long doubles) on machines
|
||||
without hardware to deal with them.
|
||||
|
||||
These stubs are just to keep the linker from complaining about unresolved
|
||||
references which can be pulled in from libio & libstdc++, even if the
|
||||
user isn't using long doubles. However, they may generate an unresolved
|
||||
external to abort if abort is not used by the function, and the stubs
|
||||
are referenced from within libc, since libgcc goes before and after the
|
||||
system library. */
|
||||
|
||||
#ifdef EXTENDED_FLOAT_STUBS
|
||||
__truncxfsf2 (){ abort(); }
|
||||
__extendsfxf2 (){ abort(); }
|
||||
__addxf3 (){ abort(); }
|
||||
__divxf3 (){ abort(); }
|
||||
__eqxf2 (){ abort(); }
|
||||
__extenddfxf2 (){ abort(); }
|
||||
__gtxf2 (){ abort(); }
|
||||
__lexf2 (){ abort(); }
|
||||
__ltxf2 (){ abort(); }
|
||||
__mulxf3 (){ abort(); }
|
||||
__negxf2 (){ abort(); }
|
||||
__nexf2 (){ abort(); }
|
||||
__subxf3 (){ abort(); }
|
||||
__truncxfdf2 (){ abort(); }
|
||||
|
||||
__trunctfsf2 (){ abort(); }
|
||||
__extendsftf2 (){ abort(); }
|
||||
__addtf3 (){ abort(); }
|
||||
__divtf3 (){ abort(); }
|
||||
__eqtf2 (){ abort(); }
|
||||
__extenddftf2 (){ abort(); }
|
||||
__gttf2 (){ abort(); }
|
||||
__letf2 (){ abort(); }
|
||||
__lttf2 (){ abort(); }
|
||||
__multf3 (){ abort(); }
|
||||
__negtf2 (){ abort(); }
|
||||
__netf2 (){ abort(); }
|
||||
__subtf3 (){ abort(); }
|
||||
__trunctfdf2 (){ abort(); }
|
||||
__gexf2 (){ abort(); }
|
||||
__fixxfsi (){ abort(); }
|
||||
__floatsixf (){ abort(); }
|
||||
#else /* !EXTENDED_FLOAT_STUBS, rest of file */
|
||||
|
||||
|
||||
typedef SFtype __attribute__ ((mode (SF)));
|
||||
typedef DFtype __attribute__ ((mode (DF)));
|
||||
|
||||
@ -99,8 +193,9 @@ typedef unsigned int UDItype __attribute__ ((mode (DI)));
|
||||
# define FRAC_NBITS 32
|
||||
# define FRACHIGH 0x80000000L
|
||||
# define FRACHIGH2 0xc0000000L
|
||||
# define pack_d pack_f
|
||||
# define unpack_d unpack_f
|
||||
# define pack_d __pack_f
|
||||
# define unpack_d __unpack_f
|
||||
# define __fpcmp_parts __fpcmp_parts_f
|
||||
typedef USItype fractype;
|
||||
typedef UHItype halffractype;
|
||||
typedef SFtype FLO_type;
|
||||
@ -121,6 +216,9 @@ typedef unsigned int UDItype __attribute__ ((mode (DI)));
|
||||
# define FRAC_NBITS 64
|
||||
# define FRACHIGH 0x8000000000000000LL
|
||||
# define FRACHIGH2 0xc000000000000000LL
|
||||
# define pack_d __pack_d
|
||||
# define unpack_d __unpack_d
|
||||
# define __fpcmp_parts __fpcmp_parts_d
|
||||
typedef UDItype fractype;
|
||||
typedef USItype halffractype;
|
||||
typedef DFtype FLO_type;
|
||||
@ -191,7 +289,9 @@ typedef unsigned int UDItype __attribute__ ((mode (DI)));
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef INLINE
|
||||
#define INLINE __inline__
|
||||
#endif
|
||||
|
||||
/* Preserve the sticky-bit when shifting fractions to the right. */
|
||||
#define LSHIFT(a) { a = (a & 1) | (a >> 1); }
|
||||
@ -199,7 +299,7 @@ typedef unsigned int UDItype __attribute__ ((mode (DI)));
|
||||
/* numeric parameters */
|
||||
/* F_D_BITOFF is the number of bits offset between the MSB of the mantissa
|
||||
of a float and of a double. Assumes there are only two float types.
|
||||
(double::FRAC_BITS+double::NGARGS-(float::FRAC_BITS-float::NGARDS))
|
||||
(double::FRAC_BITS+double::NGARDS-(float::FRAC_BITS-float::NGARDS))
|
||||
*/
|
||||
#define F_D_BITOFF (52+8-(23+7))
|
||||
|
||||
@ -328,7 +428,10 @@ flip_sign ( fp_number_type * x)
|
||||
x->sign = !x->sign;
|
||||
}
|
||||
|
||||
static FLO_type
|
||||
extern FLO_type pack_d ( fp_number_type * );
|
||||
|
||||
#if defined(L_pack_df) || defined(L_pack_sf)
|
||||
FLO_type
|
||||
pack_d ( fp_number_type * src)
|
||||
{
|
||||
FLO_union_type dst;
|
||||
@ -414,7 +517,7 @@ pack_d ( fp_number_type * src)
|
||||
}
|
||||
|
||||
/* We previously used bitfields to store the number, but this doesn't
|
||||
handle little/big endian systems conviently, so use shifts and
|
||||
handle little/big endian systems conveniently, so use shifts and
|
||||
masks */
|
||||
#ifdef FLOAT_BIT_ORDER_MISMATCH
|
||||
dst.bits.fraction = fraction;
|
||||
@ -436,12 +539,16 @@ pack_d ( fp_number_type * src)
|
||||
|
||||
return dst.value;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
extern void unpack_d (FLO_union_type *, fp_number_type *);
|
||||
|
||||
#if defined(L_unpack_df) || defined(L_unpack_sf)
|
||||
void
|
||||
unpack_d (FLO_union_type * src, fp_number_type * dst)
|
||||
{
|
||||
/* We previously used bitfields to store the number, but this doesn't
|
||||
handle little/big endian systems conviently, so use shifts and
|
||||
handle little/big endian systems conveniently, so use shifts and
|
||||
masks */
|
||||
fractype fraction;
|
||||
int exp;
|
||||
@ -504,13 +611,13 @@ unpack_d (FLO_union_type * src, fp_number_type * dst)
|
||||
else
|
||||
{
|
||||
/* Non zero fraction, means nan */
|
||||
if (sign)
|
||||
if (fraction & QUIET_NAN)
|
||||
{
|
||||
dst->class = CLASS_SNAN;
|
||||
dst->class = CLASS_QNAN;
|
||||
}
|
||||
else
|
||||
{
|
||||
dst->class = CLASS_QNAN;
|
||||
dst->class = CLASS_SNAN;
|
||||
}
|
||||
/* Keep the fraction part as the nan number */
|
||||
dst->fraction.ll = fraction;
|
||||
@ -524,7 +631,9 @@ unpack_d (FLO_union_type * src, fp_number_type * dst)
|
||||
dst->fraction.ll = (fraction << NGARDS) | IMPLICIT_1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(L_addsub_sf) || defined(L_addsub_df)
|
||||
static fp_number_type *
|
||||
_fpadd_parts (fp_number_type * a,
|
||||
fp_number_type * b,
|
||||
@ -559,6 +668,12 @@ _fpadd_parts (fp_number_type * a,
|
||||
}
|
||||
if (iszero (b))
|
||||
{
|
||||
if (iszero (a))
|
||||
{
|
||||
*tmp = *a;
|
||||
tmp->sign = a->sign & b->sign;
|
||||
return tmp;
|
||||
}
|
||||
return a;
|
||||
}
|
||||
if (iszero (a))
|
||||
@ -692,8 +807,10 @@ sub (FLO_type arg_a, FLO_type arg_b)
|
||||
|
||||
return pack_d (res);
|
||||
}
|
||||
#endif
|
||||
|
||||
static fp_number_type *
|
||||
#if defined(L_mul_sf) || defined(L_mul_df)
|
||||
static INLINE fp_number_type *
|
||||
_fpmul_parts ( fp_number_type * a,
|
||||
fp_number_type * b,
|
||||
fp_number_type * tmp)
|
||||
@ -741,13 +858,13 @@ _fpmul_parts ( fp_number_type * a,
|
||||
/* Calculate the mantissa by multiplying both 64bit numbers to get a
|
||||
128 bit number */
|
||||
{
|
||||
fractype x = a->fraction.ll;
|
||||
fractype ylow = b->fraction.ll;
|
||||
fractype yhigh = 0;
|
||||
int bit;
|
||||
|
||||
#if defined(NO_DI_MODE)
|
||||
{
|
||||
fractype x = a->fraction.ll;
|
||||
fractype ylow = b->fraction.ll;
|
||||
fractype yhigh = 0;
|
||||
int bit;
|
||||
|
||||
/* ??? This does multiplies one bit at a time. Optimize. */
|
||||
for (bit = 0; bit < FRAC_NBITS; bit++)
|
||||
{
|
||||
@ -878,20 +995,18 @@ multiply (FLO_type arg_a, FLO_type arg_b)
|
||||
|
||||
return pack_d (res);
|
||||
}
|
||||
#endif
|
||||
|
||||
static fp_number_type *
|
||||
#if defined(L_div_sf) || defined(L_div_df)
|
||||
static INLINE fp_number_type *
|
||||
_fpdiv_parts (fp_number_type * a,
|
||||
fp_number_type * b,
|
||||
fp_number_type * tmp)
|
||||
{
|
||||
fractype low = 0;
|
||||
fractype high = 0;
|
||||
fractype r0, r1, y0, y1, bit;
|
||||
fractype q;
|
||||
fractype bit;
|
||||
fractype numerator;
|
||||
fractype denominator;
|
||||
fractype quotient;
|
||||
fractype remainder;
|
||||
|
||||
if (isnan (a))
|
||||
{
|
||||
@ -901,13 +1016,15 @@ _fpdiv_parts (fp_number_type * a,
|
||||
{
|
||||
return b;
|
||||
}
|
||||
|
||||
a->sign = a->sign ^ b->sign;
|
||||
|
||||
if (isinf (a) || iszero (a))
|
||||
{
|
||||
if (a->class == b->class)
|
||||
return nan ();
|
||||
return a;
|
||||
}
|
||||
a->sign = a->sign ^ b->sign;
|
||||
|
||||
if (isinf (b))
|
||||
{
|
||||
@ -918,15 +1035,12 @@ _fpdiv_parts (fp_number_type * a,
|
||||
if (iszero (b))
|
||||
{
|
||||
a->class = CLASS_INFINITY;
|
||||
return b;
|
||||
return a;
|
||||
}
|
||||
|
||||
/* Calculate the mantissa by multiplying both 64bit numbers to get a
|
||||
128 bit number */
|
||||
{
|
||||
int carry;
|
||||
intfrac d0, d1; /* weren't unsigned before ??? */
|
||||
|
||||
/* quotient =
|
||||
( numerator / denominator) * 2^(numerator exponent - denominator exponent)
|
||||
*/
|
||||
@ -989,15 +1103,19 @@ divide (FLO_type arg_a, FLO_type arg_b)
|
||||
|
||||
return pack_d (res);
|
||||
}
|
||||
#endif
|
||||
|
||||
int __fpcmp_parts (fp_number_type * a, fp_number_type *b);
|
||||
|
||||
#if defined(L_fpcmp_parts_sf) || defined(L_fpcmp_parts_df)
|
||||
/* according to the demo, fpcmp returns a comparison with 0... thus
|
||||
a<b -> -1
|
||||
a==b -> 0
|
||||
a>b -> +1
|
||||
*/
|
||||
|
||||
static int
|
||||
_fpcmp_parts (fp_number_type * a, fp_number_type * b)
|
||||
int
|
||||
__fpcmp_parts (fp_number_type * a, fp_number_type * b)
|
||||
{
|
||||
#if 0
|
||||
/* either nan -> unordered. Must be checked outside of this routine. */
|
||||
@ -1072,7 +1190,9 @@ _fpcmp_parts (fp_number_type * a, fp_number_type * b)
|
||||
/* after all that, they're equal. */
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(L_compare_sf) || defined(L_compare_df)
|
||||
CMPtype
|
||||
compare (FLO_type arg_a, FLO_type arg_b)
|
||||
{
|
||||
@ -1082,13 +1202,15 @@ compare (FLO_type arg_a, FLO_type arg_b)
|
||||
unpack_d ((FLO_union_type *) & arg_a, &a);
|
||||
unpack_d ((FLO_union_type *) & arg_b, &b);
|
||||
|
||||
return _fpcmp_parts (&a, &b);
|
||||
return __fpcmp_parts (&a, &b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef US_SOFTWARE_GOFAST
|
||||
|
||||
/* These should be optimized for their specific tasks someday. */
|
||||
|
||||
#if defined(L_eq_sf) || defined(L_eq_df)
|
||||
CMPtype
|
||||
_eq_f2 (FLO_type arg_a, FLO_type arg_b)
|
||||
{
|
||||
@ -1101,9 +1223,11 @@ _eq_f2 (FLO_type arg_a, FLO_type arg_b)
|
||||
if (isnan (&a) || isnan (&b))
|
||||
return 1; /* false, truth == 0 */
|
||||
|
||||
return _fpcmp_parts (&a, &b) ;
|
||||
return __fpcmp_parts (&a, &b) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(L_ne_sf) || defined(L_ne_df)
|
||||
CMPtype
|
||||
_ne_f2 (FLO_type arg_a, FLO_type arg_b)
|
||||
{
|
||||
@ -1116,9 +1240,11 @@ _ne_f2 (FLO_type arg_a, FLO_type arg_b)
|
||||
if (isnan (&a) || isnan (&b))
|
||||
return 1; /* true, truth != 0 */
|
||||
|
||||
return _fpcmp_parts (&a, &b) ;
|
||||
return __fpcmp_parts (&a, &b) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(L_gt_sf) || defined(L_gt_df)
|
||||
CMPtype
|
||||
_gt_f2 (FLO_type arg_a, FLO_type arg_b)
|
||||
{
|
||||
@ -1131,9 +1257,11 @@ _gt_f2 (FLO_type arg_a, FLO_type arg_b)
|
||||
if (isnan (&a) || isnan (&b))
|
||||
return -1; /* false, truth > 0 */
|
||||
|
||||
return _fpcmp_parts (&a, &b);
|
||||
return __fpcmp_parts (&a, &b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(L_ge_sf) || defined(L_ge_df)
|
||||
CMPtype
|
||||
_ge_f2 (FLO_type arg_a, FLO_type arg_b)
|
||||
{
|
||||
@ -1145,9 +1273,11 @@ _ge_f2 (FLO_type arg_a, FLO_type arg_b)
|
||||
|
||||
if (isnan (&a) || isnan (&b))
|
||||
return -1; /* false, truth >= 0 */
|
||||
return _fpcmp_parts (&a, &b) ;
|
||||
return __fpcmp_parts (&a, &b) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(L_lt_sf) || defined(L_lt_df)
|
||||
CMPtype
|
||||
_lt_f2 (FLO_type arg_a, FLO_type arg_b)
|
||||
{
|
||||
@ -1160,9 +1290,11 @@ _lt_f2 (FLO_type arg_a, FLO_type arg_b)
|
||||
if (isnan (&a) || isnan (&b))
|
||||
return 1; /* false, truth < 0 */
|
||||
|
||||
return _fpcmp_parts (&a, &b);
|
||||
return __fpcmp_parts (&a, &b);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(L_le_sf) || defined(L_le_df)
|
||||
CMPtype
|
||||
_le_f2 (FLO_type arg_a, FLO_type arg_b)
|
||||
{
|
||||
@ -1175,11 +1307,13 @@ _le_f2 (FLO_type arg_a, FLO_type arg_b)
|
||||
if (isnan (&a) || isnan (&b))
|
||||
return 1; /* false, truth <= 0 */
|
||||
|
||||
return _fpcmp_parts (&a, &b) ;
|
||||
return __fpcmp_parts (&a, &b) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ! US_SOFTWARE_GOFAST */
|
||||
|
||||
#if defined(L_si_to_sf) || defined(L_si_to_df)
|
||||
FLO_type
|
||||
si_to_float (SItype arg_a)
|
||||
{
|
||||
@ -1215,7 +1349,9 @@ si_to_float (SItype arg_a)
|
||||
}
|
||||
return pack_d (&in);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(L_sf_to_si) || defined(L_df_to_si)
|
||||
SItype
|
||||
float_to_si (FLO_type arg_a)
|
||||
{
|
||||
@ -1229,7 +1365,7 @@ float_to_si (FLO_type arg_a)
|
||||
return 0;
|
||||
/* get reasonable MAX_SI_INT... */
|
||||
if (isinf (&a))
|
||||
return a.sign ? MAX_SI_INT : (-MAX_SI_INT)-1;
|
||||
return a.sign ? (-MAX_SI_INT)-1 : MAX_SI_INT;
|
||||
/* it is a number, but a small one */
|
||||
if (a.normal_exp < 0)
|
||||
return 0;
|
||||
@ -1238,7 +1374,9 @@ float_to_si (FLO_type arg_a)
|
||||
tmp = a.fraction.ll >> ((FRACBITS + NGARDS) - a.normal_exp);
|
||||
return a.sign ? (-tmp) : (tmp);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(L_sf_to_usi) || defined(L_df_to_usi)
|
||||
#ifdef US_SOFTWARE_GOFAST
|
||||
/* While libgcc2.c defines its own __fixunssfsi and __fixunsdfsi routines,
|
||||
we also define them for GOFAST because the ones in libgcc2.c have the
|
||||
@ -1256,24 +1394,26 @@ float_to_usi (FLO_type arg_a)
|
||||
return 0;
|
||||
if (isnan (&a))
|
||||
return 0;
|
||||
/* get reasonable MAX_USI_INT... */
|
||||
if (isinf (&a))
|
||||
return a.sign ? MAX_USI_INT : 0;
|
||||
/* it is a negative number */
|
||||
if (a.sign)
|
||||
return 0;
|
||||
/* get reasonable MAX_USI_INT... */
|
||||
if (isinf (&a))
|
||||
return MAX_USI_INT;
|
||||
/* it is a number, but a small one */
|
||||
if (a.normal_exp < 0)
|
||||
return 0;
|
||||
if (a.normal_exp > 31)
|
||||
return MAX_USI_INT;
|
||||
else if (a.normal_exp > (FRACBITS + NGARDS))
|
||||
return a.fraction.ll << ((FRACBITS + NGARDS) - a.normal_exp);
|
||||
return a.fraction.ll << (a.normal_exp - (FRACBITS + NGARDS));
|
||||
else
|
||||
return a.fraction.ll >> ((FRACBITS + NGARDS) - a.normal_exp);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(L_negate_sf) || defined(L_negate_df)
|
||||
FLO_type
|
||||
negate (FLO_type arg_a)
|
||||
{
|
||||
@ -1283,9 +1423,11 @@ negate (FLO_type arg_a)
|
||||
flip_sign (&a);
|
||||
return pack_d (&a);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FLOAT
|
||||
|
||||
#if defined(L_make_sf)
|
||||
SFtype
|
||||
__make_fp(fp_class_type class,
|
||||
unsigned int sign,
|
||||
@ -1300,6 +1442,7 @@ __make_fp(fp_class_type class,
|
||||
in.fraction.ll = frac;
|
||||
return pack_d (&in);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef FLOAT_ONLY
|
||||
|
||||
@ -1310,6 +1453,7 @@ __make_fp(fp_class_type class,
|
||||
|
||||
extern DFtype __make_dp (fp_class_type, unsigned int, int, UDItype frac);
|
||||
|
||||
#if defined(L_sf_to_df)
|
||||
DFtype
|
||||
sf_to_df (SFtype arg_a)
|
||||
{
|
||||
@ -1319,6 +1463,7 @@ sf_to_df (SFtype arg_a)
|
||||
return __make_dp (in.class, in.sign, in.normal_exp,
|
||||
((UDItype) in.fraction.ll) << F_D_BITOFF);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif
|
||||
@ -1327,6 +1472,7 @@ sf_to_df (SFtype arg_a)
|
||||
|
||||
extern SFtype __make_fp (fp_class_type, unsigned int, int, USItype);
|
||||
|
||||
#if defined(L_make_df)
|
||||
DFtype
|
||||
__make_dp (fp_class_type class, unsigned int sign, int exp, UDItype frac)
|
||||
{
|
||||
@ -1338,15 +1484,27 @@ __make_dp (fp_class_type class, unsigned int sign, int exp, UDItype frac)
|
||||
in.fraction.ll = frac;
|
||||
return pack_d (&in);
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(L_df_to_sf)
|
||||
SFtype
|
||||
df_to_sf (DFtype arg_a)
|
||||
{
|
||||
fp_number_type in;
|
||||
USItype sffrac;
|
||||
|
||||
unpack_d ((FLO_union_type *) & arg_a, &in);
|
||||
return __make_fp (in.class, in.sign, in.normal_exp,
|
||||
in.fraction.ll >> F_D_BITOFF);
|
||||
|
||||
sffrac = in.fraction.ll >> F_D_BITOFF;
|
||||
|
||||
/* We set the lowest guard bit in SFFRAC if we discarded any non
|
||||
zero bits. */
|
||||
if ((in.fraction.ll & (((USItype) 1 << F_D_BITOFF) - 1)) != 0)
|
||||
sffrac |= 1;
|
||||
|
||||
return __make_fp (in.class, in.sign, in.normal_exp, sffrac);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* !EXTENDED_FLOAT_STUBS */
|
||||
|
@ -1,12 +1,5 @@
|
||||
/* Configuration common to all targets running the GNU system. */
|
||||
|
||||
/* Macro to produce CPP_PREDEFINES for GNU on a given machine. */
|
||||
#define GNU_CPP_PREDEFINES(machine) \
|
||||
"-D" machine " -Acpu(" machine ") -Amachine(" machine ")" \
|
||||
"-Dunix -Asystem(unix) \
|
||||
-DMACH -Asystem(mach) \
|
||||
-D__GNU__ -Asystem(gnu)"
|
||||
|
||||
/* Provide GCC options for standard feature-test macros. */
|
||||
#undef CPP_SPEC
|
||||
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{bsd:-D_BSD_SOURCE}"
|
||||
|
@ -49,11 +49,6 @@
|
||||
} \
|
||||
}
|
||||
|
||||
/* There are conflicting reports about whether this system uses
|
||||
a different assembler syntax. wilson@cygnus.com says # is right. */
|
||||
#undef COMMENT_BEGIN
|
||||
#define COMMENT_BEGIN "#"
|
||||
|
||||
#undef ASM_APP_ON
|
||||
#define ASM_APP_ON "#APP\n"
|
||||
|
||||
@ -68,13 +63,13 @@
|
||||
i386.md for an explanation of the expression this outputs. */
|
||||
|
||||
#undef ASM_OUTPUT_ADDR_DIFF_ELT
|
||||
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
|
||||
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
|
||||
fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
|
||||
|
||||
/* Indicate that jump tables go in the text section. This is
|
||||
necessary when compiling PIC code. */
|
||||
|
||||
#define JUMP_TABLES_IN_TEXT_SECTION
|
||||
#define JUMP_TABLES_IN_TEXT_SECTION 1
|
||||
|
||||
/* Don't default to pcc-struct-return, because gcc is the only compiler, and
|
||||
we want to retain compatibility with older gcc versions. */
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Definitions for IBM PS2 running AIX/386.
|
||||
From: Minh Tran-Le <TRANLE@intellicorp.com>
|
||||
Copyright (C) 1988 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988, 1996 Free Software Foundation, Inc.
|
||||
Contributed by Minh Tran-Le <TRANLE@intellicorp.com>.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA. */
|
||||
#include "svr3.h"
|
||||
|
||||
/* Use the ATT assembler syntax.
|
||||
This overrides at least one macro (ASM_OUTPUT_LABELREF) from svr3.h. */
|
||||
This overrides at least one macro (USER_LABEL_PREFIX) from svr3.h. */
|
||||
|
||||
#include "i386/att.h"
|
||||
|
||||
@ -44,10 +44,10 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Specify predefined symbols in preprocessor. */
|
||||
|
||||
#define CPP_PREDEFINES "-Dps2 -Dunix -Di386 -Asystem(unix) -Asystem(aix) -Acpu(i386) -Amachine(i386)"
|
||||
#define CPP_PREDEFINES "-Dps2 -Dunix -Asystem(aix)"
|
||||
|
||||
#define CPP_SPEC \
|
||||
"%{posix:-D_POSIX_SOURCE}%{!posix:-DAIX} -D_I386 -D_AIX -D_MBCS"
|
||||
#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 */
|
||||
@ -132,8 +132,7 @@ const_section () \
|
||||
|
||||
# undef EXTRA_SECTION_FUNCTIONS
|
||||
# define EXTRA_SECTION_FUNCTIONS \
|
||||
CONST_SECTION_FUNCTION \
|
||||
BSS_SECTION_FUNCTION
|
||||
CONST_SECTION_FUNCTION
|
||||
|
||||
/* for collect2 */
|
||||
# define OBJECT_FORMAT_COFF
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Definitions for AT&T assembler syntax for the Intel 80386.
|
||||
Copyright (C) 1988 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988, 1996 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@ -68,18 +68,6 @@ do \
|
||||
/* Can't use ASM_OUTPUT_SKIP in text section; it doesn't leave 0s. */
|
||||
|
||||
#define ASM_NO_SKIP_IN_TEXT 1
|
||||
|
||||
#undef BSS_SECTION_FUNCTION /* Override the definition from svr3.h. */
|
||||
#define BSS_SECTION_FUNCTION \
|
||||
void \
|
||||
bss_section () \
|
||||
{ \
|
||||
if (in_section != in_bss) \
|
||||
{ \
|
||||
fprintf (asm_out_file, "%s\n", BSS_SECTION_ASM_OP); \
|
||||
in_section = in_bss; \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Define the syntax of labels and symbol definitions/declarations. */
|
||||
|
||||
@ -99,8 +87,7 @@ bss_section () \
|
||||
#define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
|
||||
fprintf (FILE, ".%s%d:\n", PREFIX, NUM)
|
||||
|
||||
/* This is how to output a reference to a user-level label named NAME. */
|
||||
/* The prefix to add to user-visible assembler symbols. */
|
||||
|
||||
#undef ASM_OUTPUT_LABELREF
|
||||
#define ASM_OUTPUT_LABELREF(FILE,NAME) \
|
||||
fprintf (FILE, "%s", NAME)
|
||||
#undef USER_LABEL_PREFIX
|
||||
#define USER_LABEL_PREFIX ""
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* Definitions for BSD assembler syntax for Intel 386
|
||||
(actually AT&T syntax for insns and operands,
|
||||
adapted to BSD conventions for symbol names and debugging.)
|
||||
Copyright (C) 1988 Free Software Foundation, Inc.
|
||||
Copyright (C) 1988, 1996 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@ -115,12 +115,12 @@ Boston, MA 02111-1307, USA. */
|
||||
fprintf (FILE, "%s%d:\n", PREFIX, NUM)
|
||||
#endif
|
||||
|
||||
/* This is how to output a reference to a user-level label named NAME. */
|
||||
/* The prefix to add to user-visible assembler symbols. */
|
||||
|
||||
#ifdef NO_UNDERSCORES
|
||||
#define ASM_OUTPUT_LABELREF(FILE,NAME) fprintf (FILE, "%s", NAME)
|
||||
#define USER_LABEL_PREFIX ""
|
||||
#else
|
||||
#define ASM_OUTPUT_LABELREF(FILE,NAME) fprintf (FILE, "_%s", NAME)
|
||||
#define USER_LABEL_PREFIX "_"
|
||||
#endif /* not NO_UNDERSCORES */
|
||||
|
||||
/* Sequent has some changes in the format of DBX symbols. */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Configuration for an i386 running BSDI's BSD/386 1.1 as the target
|
||||
machine. */
|
||||
/* Configuration for an i386 running BSDI's BSD/OS (formerly known as BSD/386)
|
||||
as the target machine. */
|
||||
|
||||
#include "i386/386bsd.h"
|
||||
|
||||
@ -16,3 +16,18 @@
|
||||
|
||||
#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))
|
||||
|
42
contrib/gcc/config/i386/crtdll.h
Normal file
42
contrib/gcc/config/i386/crtdll.h
Normal file
@ -0,0 +1,42 @@
|
||||
/* Operating system specific defines to be used when targeting GCC for
|
||||
hosting on Windows32, using GNU tools and the Windows32 API Library,
|
||||
as distinct from winnt.h, which is used to build GCC for use with a
|
||||
windows style library and tool set and uses the Microsoft tools.
|
||||
This variant uses CRTDLL.DLL insted of MSVCRTDLL.DLL.
|
||||
Copyright (C) 1998 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. */
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-Di386 -D_WIN32 -DWIN32 -D__WIN32__ \
|
||||
-D__MINGW32__ -DWINNT -D_X86_=1 -D__STDC__=1\
|
||||
-D__stdcall=__attribute__((__stdcall__)) \
|
||||
-D_stdcall=__attribute__((__stdcall__)) \
|
||||
-D__cdecl=__attribute__((__cdecl__)) \
|
||||
-D__declspec(x)=__attribute__((x)) \
|
||||
-Asystem(winnt) -Acpu(i386) -Amachine(i386)"
|
||||
|
||||
#undef LIBGCC_SPEC
|
||||
#define LIBGCC_SPEC "-lmingw32 -lgcc -lmoldname -lcrtdll"
|
||||
|
||||
/* Specify a different entry point when linking a DLL */
|
||||
#undef STARTFILE_SPEC
|
||||
#define STARTFILE_SPEC "%{mdll:dllcrt1%O%s} %{!mdll:crt1%O%s}"
|
||||
|
||||
#undef MATH_LIBRARY
|
||||
#define MATH_LIBRARY "-lcrtdll"
|
190
contrib/gcc/config/i386/dgux.c
Normal file
190
contrib/gcc/config/i386/dgux.c
Normal file
@ -0,0 +1,190 @@
|
||||
/* Subroutines for GNU compiler for Intel 80x86 running DG/ux
|
||||
Copyright (C) 1993, 1995, 1997 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
#include <time.h>
|
||||
#include "i386/i386.c"
|
||||
|
||||
|
||||
extern char *version_string;
|
||||
|
||||
struct option
|
||||
{
|
||||
char *string;
|
||||
int *variable;
|
||||
int on_value;
|
||||
};
|
||||
|
||||
static int
|
||||
output_option (file, sep, type, name, indent, pos, max)
|
||||
FILE *file;
|
||||
char *sep;
|
||||
char *type;
|
||||
char *name;
|
||||
char *indent;
|
||||
int pos;
|
||||
int max;
|
||||
{
|
||||
if (strlen (sep) + strlen (type) + strlen (name) + pos > max)
|
||||
{
|
||||
fprintf (file, indent);
|
||||
return fprintf (file, "%s%s", type, name);
|
||||
}
|
||||
return pos + fprintf (file, "%s%s%s", sep, type, name);
|
||||
}
|
||||
|
||||
static struct { char *name; int value; } m_options[] = TARGET_SWITCHES;
|
||||
|
||||
static void
|
||||
output_options (file, f_options, f_len, W_options, W_len,
|
||||
pos, max, sep, indent, term)
|
||||
FILE *file;
|
||||
struct option *f_options;
|
||||
struct option *W_options;
|
||||
int f_len, W_len;
|
||||
int pos;
|
||||
int max;
|
||||
char *indent;
|
||||
char *term;
|
||||
{
|
||||
register int j;
|
||||
|
||||
if (optimize)
|
||||
pos = output_option (file, sep, "-O", "", indent, pos, max);
|
||||
if (write_symbols != NO_DEBUG)
|
||||
pos = output_option (file, sep, "-g", "", indent, pos, max);
|
||||
/* if (flag_traditional)
|
||||
pos = output_option (file, sep, "-traditional", "", indent, pos, max);*/
|
||||
if (profile_flag)
|
||||
pos = output_option (file, sep, "-p", "", indent, pos, max);
|
||||
if (profile_block_flag)
|
||||
pos = output_option (file, sep, "-a", "", indent, pos, max);
|
||||
|
||||
for (j = 0; j < f_len; j++)
|
||||
if (*f_options[j].variable == f_options[j].on_value)
|
||||
pos = output_option (file, sep, "-f", f_options[j].string,
|
||||
indent, pos, max);
|
||||
|
||||
for (j = 0; j < W_len; j++)
|
||||
if (*W_options[j].variable == W_options[j].on_value)
|
||||
pos = output_option (file, sep, "-W", W_options[j].string,
|
||||
indent, pos, max);
|
||||
|
||||
for (j = 0; j < sizeof m_options / sizeof m_options[0]; j++)
|
||||
if (m_options[j].name[0] != '\0'
|
||||
&& m_options[j].value > 0
|
||||
&& ((m_options[j].value & target_flags)
|
||||
== m_options[j].value))
|
||||
pos = output_option (file, sep, "-m", m_options[j].name,
|
||||
indent, pos, max);
|
||||
|
||||
pos = output_option (file, sep, "-mcpu=", ix86_cpu_string, indent, pos, max);
|
||||
pos = output_option (file, sep, "-march=", ix86_arch_string, indent, pos, max);
|
||||
fprintf (file, term);
|
||||
}
|
||||
|
||||
/* Output to FILE the start of the assembler file. */
|
||||
|
||||
void
|
||||
output_file_start (file, f_options, f_len, W_options, W_len)
|
||||
FILE *file;
|
||||
struct option *f_options;
|
||||
struct option *W_options;
|
||||
int f_len, W_len;
|
||||
{
|
||||
register int pos;
|
||||
|
||||
output_file_directive (file, main_input_filename);
|
||||
fprintf (file, "\t.version\t\"01.01\"\n"); \
|
||||
/* Switch to the data section so that the coffsem symbol and the
|
||||
gcc2_compiled. symbol aren't in the text section. */
|
||||
data_section ();
|
||||
|
||||
pos = fprintf (file, "\n// cc1 (%s) arguments:", VERSION_STRING);
|
||||
output_options (file, f_options, f_len, W_options, W_len,
|
||||
pos, 75, " ", "\n// ", "\n\n");
|
||||
|
||||
#ifdef TARGET_IDENTIFY_REVISION
|
||||
if (TARGET_IDENTIFY_REVISION)
|
||||
{
|
||||
char indent[256];
|
||||
|
||||
time_t now = time ((time_t *)0);
|
||||
sprintf (indent, "]\"\n\t%s\t \"@(#)%s [", IDENT_ASM_OP, main_input_filename);
|
||||
fprintf (file, indent+3);
|
||||
pos = fprintf (file, "gcc %s, %.24s,", VERSION_STRING, ctime (&now));
|
||||
output_options (file, f_options, f_len, W_options, W_len,
|
||||
pos, 150 - strlen (indent), " ", indent, "]\"\n\n");
|
||||
}
|
||||
#endif /* TARGET_IDENTIFY_REVISION */
|
||||
}
|
||||
|
||||
#ifndef CROSS_COMPILE
|
||||
#if defined (_abort_aux)
|
||||
/* Debugging aid to be registered via `atexit'. See the definition
|
||||
of abort in dgux.h. */
|
||||
void
|
||||
abort_aux ()
|
||||
{
|
||||
extern int insn_;
|
||||
extern char * file_;
|
||||
extern int line_;
|
||||
static int done;
|
||||
rtx line_note;
|
||||
|
||||
if (done++)
|
||||
return;
|
||||
if (file_ || line_)
|
||||
{
|
||||
if (write_symbols != NO_DEBUG)
|
||||
{
|
||||
for (line_note = (rtx) insn_ ; line_note != 0 ; line_note = PREV_INSN (line_note))
|
||||
if (GET_CODE (line_note) == NOTE && NOTE_LINE_NUMBER (line_note) > 0)
|
||||
break;
|
||||
if (line_note != 0)
|
||||
{
|
||||
error_with_file_and_line (NOTE_SOURCE_FILE (line_note),
|
||||
NOTE_LINE_NUMBER (line_note),
|
||||
"Internal gcc abort from %s:%d",
|
||||
file_ ? file_ : "<nofile>", line_);
|
||||
if (insn_ && file_ && strcmp (file_, "toplev.c"))
|
||||
{
|
||||
error_with_file_and_line (NOTE_SOURCE_FILE (line_note),
|
||||
NOTE_LINE_NUMBER (line_note),
|
||||
"The local variable `insn' has the value:", 0);
|
||||
debug_rtx ((rtx) insn_);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (write_symbols == NO_DEBUG || line_note == 0)
|
||||
{
|
||||
error ("Internal gcc abort from %s:%d",
|
||||
file_ ? file_ : "<nofile>", line_);
|
||||
if (insn_ && file_ && strcmp (file_, "toplev.c"))
|
||||
{
|
||||
error ("The local variable `insn' has the value:", 0);
|
||||
debug_rtx ((rtx) insn_);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
265
contrib/gcc/config/i386/dgux.h
Normal file
265
contrib/gcc/config/i386/dgux.h
Normal file
@ -0,0 +1,265 @@
|
||||
/* Target definitions for GNU compiler for Intel 80x86 running DG/ux
|
||||
Copyright (C) 1993, 1995, 1996, 1997, 1998 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, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* for now, we are just like the sysv4 version with a
|
||||
few hacks
|
||||
*/
|
||||
|
||||
#include "i386/sysv4.h"
|
||||
|
||||
#ifndef VERSION_INFO2
|
||||
#define VERSION_INFO2 "$Revision: 1.3 $"
|
||||
#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 /* Emit 'ident' to .s */
|
||||
|
||||
#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 }, \
|
||||
{ "legend", -MASK_NOLEGEND }, \
|
||||
{ "no-legend", MASK_NOLEGEND }, \
|
||||
{ "external-legend", MASK_EXTERNAL_LEGEND }, \
|
||||
{ "identify-revision", MASK_IDENTIFY_REVISION }, \
|
||||
{ "warn-passed-structs", MASK_WARN_PASS_STRUCT },
|
||||
|
||||
#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
|
||||
|
||||
#define PREFERRED_DEBUGGING_TYPE DWARF_DEBUG
|
||||
|
||||
/* Override svr[34].h. */
|
||||
#undef ASM_FILE_START
|
||||
#define ASM_FILE_START(FILE) \
|
||||
output_file_start (FILE, f_options, sizeof f_options / sizeof f_options[0], \
|
||||
W_options, sizeof W_options / sizeof W_options[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; \
|
||||
abort_helper (); \
|
||||
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 <varargs.h> and <stdarg.h> 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 "-Di386 -D__ix86 -Dunix -DDGUX -D__CLASSIFY_TYPE__=2\
|
||||
-Asystem(unix) -Asystem(svr4) -Acpu(i386) -Amachine(i386)"
|
||||
|
||||
/*
|
||||
If not -ansi, -traditional, or restricting include files to one
|
||||
specific source target, specify full DG/UX features.
|
||||
*/
|
||||
#undef CPP_SPEC
|
||||
#define CPP_SPEC "%{!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 */
|
||||
|
||||
#if !defined (no_abort) || defined (CRT_BEGIN) || defined (CRT_END)
|
||||
#undef abort
|
||||
|
||||
char insn; int insn_; char * file_; int line_;
|
||||
#define abort() \
|
||||
(insn_ = (int) insn, \
|
||||
file_ = __FILE__, \
|
||||
line_ = __LINE__, \
|
||||
fancy_abort ())
|
||||
#define abort_helper() \
|
||||
do { \
|
||||
extern void abort_aux (); \
|
||||
atexit (abort_aux); \
|
||||
} while (0)
|
||||
#define _abort_aux
|
||||
#endif /* no abort */
|
||||
|
||||
/* 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) \
|
||||
{ \
|
||||
if (flag_pic && symbolic_operand (RTX)) \
|
||||
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 ".section\t.rodata\n\t.align 1"
|
@ -1,5 +1,5 @@
|
||||
/* Definitions for Intel 386 running system V with gnu tools
|
||||
Copyright (C) 1988, 1993, 1994 Free Software Foundation, Inc.
|
||||
/* Definitions for Intel 386 using GAS.
|
||||
Copyright (C) 1988, 1993, 1994, 1996 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@ -56,8 +56,8 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Specify predefined symbols in preprocessor. */
|
||||
|
||||
#define CPP_PREDEFINES "-Dunix -Di386 -Asystem(unix) -Acpu(i386) -Amachine(i386)"
|
||||
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
|
||||
#define CPP_PREDEFINES "-Dunix"
|
||||
#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE}"
|
||||
|
||||
/* Allow #sccs in preprocessor. */
|
||||
|
||||
@ -71,27 +71,33 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
#define TARGET_MEM_FUNCTIONS
|
||||
|
||||
#if 0 /* People say gas uses the log as the arg to .align. */
|
||||
/* When using gas, .align N aligns to an N-byte boundary. */
|
||||
/* In the past there was confusion as to what the argument to .align was
|
||||
in GAS. For the last several years the rule has been this: for a.out
|
||||
file formats that argument is LOG, and for all other file formats the
|
||||
argument is 1<<LOG.
|
||||
|
||||
However, GAS now has .p2align and .balign pseudo-ops so to remove any
|
||||
doubt or guess work, and since this file is used for both a.out and other
|
||||
file formats, we use one of them. */
|
||||
|
||||
#ifdef HAVE_GAS_BALIGN_AND_P2ALIGN
|
||||
#undef ASM_OUTPUT_ALIGN
|
||||
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
|
||||
if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))
|
||||
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
|
||||
if ((LOG)!=0) fprintf ((FILE), "\t.balign %d\n", 1<<(LOG))
|
||||
#endif
|
||||
|
||||
/* Align labels, etc. at 4-byte boundaries.
|
||||
For the 486, align to 16-byte boundary for sake of cache. */
|
||||
/* A C statement to output to the stdio stream FILE an assembler
|
||||
command to advance the location counter to a multiple of 1<<LOG
|
||||
bytes if it is within MAX_SKIP bytes.
|
||||
|
||||
#undef ASM_OUTPUT_ALIGN_CODE
|
||||
#define ASM_OUTPUT_ALIGN_CODE(FILE) \
|
||||
fprintf ((FILE), "\t.align %d,0x90\n", i386_align_jumps)
|
||||
|
||||
/* Align start of loop at 4-byte boundary. */
|
||||
|
||||
#undef ASM_OUTPUT_LOOP_ALIGN
|
||||
#define ASM_OUTPUT_LOOP_ALIGN(FILE) \
|
||||
fprintf ((FILE), "\t.align %d,0x90\n", i386_align_loops)
|
||||
This is used to align code labels according to Intel recommendations. */
|
||||
|
||||
#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
|
||||
# define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
|
||||
if ((LOG)!=0) \
|
||||
if ((MAX_SKIP)==0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
|
||||
else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP))
|
||||
#endif
|
||||
|
||||
/* A C statement or statements which output an assembler instruction
|
||||
opcode to the stdio stream STREAM. The macro-operand PTR is a
|
||||
@ -126,8 +132,8 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
GAS requires the %cl argument, so override i386/unix.h. */
|
||||
|
||||
#undef AS3_SHIFT_DOUBLE
|
||||
#define AS3_SHIFT_DOUBLE(a,b,c,d) AS3 (a,b,c,d)
|
||||
#undef SHIFT_DOUBLE_OMITS_COUNT
|
||||
#define SHIFT_DOUBLE_OMITS_COUNT 0
|
||||
|
||||
/* Print opcodes the way that GAS expects them. */
|
||||
#define GAS_MNEMONICS 1
|
||||
|
409
contrib/gcc/config/i386/gmon-sol2.c
Normal file
409
contrib/gcc/config/i386/gmon-sol2.c
Normal file
@ -0,0 +1,409 @@
|
||||
/*-
|
||||
* Copyright (c) 1991 The Regents of the University of California.
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
|
||||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
* This is a modified gmon.c by J.W.Hawtin <oolon@ankh.org>,
|
||||
* 14/8/96 based on the original gmon.c in GCC and the hacked version
|
||||
* solaris 2 sparc version (config/sparc/gmon-sol.c) by Mark Eichin. To do
|
||||
* process profiling on solaris 2.X X86
|
||||
*
|
||||
* It must be used in conjunction with sol2-gc1.asm, which is used to start
|
||||
* and stop process monitoring.
|
||||
*
|
||||
* Differences.
|
||||
*
|
||||
* On Solaris 2 _mcount is called by library functions not mcount, so support
|
||||
* has been added for both.
|
||||
*
|
||||
* Also the prototype for profil() is different
|
||||
*
|
||||
* Solaris 2 does not seem to have char *minbrk whcih allows the setting of
|
||||
* the minimum SBRK region so this code has been removed and lets pray malloc
|
||||
* does not mess it up.
|
||||
*
|
||||
* Notes
|
||||
*
|
||||
* This code could easily be integrated with the original gmon.c and perhaps
|
||||
* should be.
|
||||
*/
|
||||
|
||||
#ifndef lint
|
||||
static char sccsid[] = "@(#)gmon.c 5.3 (Berkeley) 5/22/91";
|
||||
#endif /* not lint */
|
||||
|
||||
#if 0
|
||||
#include <unistd.h>
|
||||
|
||||
#endif
|
||||
#ifdef DEBUG
|
||||
#include <stdio.h>
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
#include "i386/gmon.h"
|
||||
#else
|
||||
|
||||
struct phdr {
|
||||
char *lpc;
|
||||
char *hpc;
|
||||
int ncnt;
|
||||
};
|
||||
|
||||
|
||||
#define HISTFRACTION 2
|
||||
#define HISTCOUNTER unsigned short
|
||||
#define HASHFRACTION 1
|
||||
#define ARCDENSITY 2
|
||||
#define MINARCS 50
|
||||
#define BASEADDRESS 0x8000000 /* On Solaris 2 X86 all executables start here
|
||||
and not at 0 */
|
||||
|
||||
struct tostruct {
|
||||
char *selfpc;
|
||||
long count;
|
||||
unsigned short link;
|
||||
};
|
||||
struct rawarc {
|
||||
unsigned long raw_frompc;
|
||||
unsigned long raw_selfpc;
|
||||
long raw_count;
|
||||
};
|
||||
#define ROUNDDOWN(x,y) (((x)/(y))*(y))
|
||||
#define ROUNDUP(x,y) ((((x)+(y)-1)/(y))*(y))
|
||||
#endif
|
||||
|
||||
/* char *minbrk; */
|
||||
|
||||
#ifdef __alpha
|
||||
extern char *sbrk ();
|
||||
#endif
|
||||
|
||||
/*
|
||||
* froms is actually a bunch of unsigned shorts indexing tos
|
||||
*/
|
||||
static int profiling = 3;
|
||||
static unsigned short *froms;
|
||||
static struct tostruct *tos = 0;
|
||||
static long tolimit = 0;
|
||||
static char *s_lowpc = 0;
|
||||
static char *s_highpc = 0;
|
||||
static unsigned long s_textsize = 0;
|
||||
|
||||
static int ssiz;
|
||||
static char *sbuf;
|
||||
static int s_scale;
|
||||
/* see profil(2) where this is describe (incorrectly) */
|
||||
#define SCALE_1_TO_1 0x10000L
|
||||
|
||||
#define MSG "No space for profiling buffer(s)\n"
|
||||
|
||||
extern int errno;
|
||||
|
||||
monstartup(lowpc, highpc)
|
||||
char *lowpc;
|
||||
char *highpc;
|
||||
{
|
||||
int monsize;
|
||||
char *buffer;
|
||||
register int o;
|
||||
|
||||
/*
|
||||
* round lowpc and highpc to multiples of the density we're using
|
||||
* so the rest of the scaling (here and in gprof) stays in ints.
|
||||
*/
|
||||
lowpc = (char *)
|
||||
ROUNDDOWN((unsigned)lowpc, HISTFRACTION*sizeof(HISTCOUNTER));
|
||||
s_lowpc = lowpc;
|
||||
highpc = (char *)
|
||||
ROUNDUP((unsigned)highpc, HISTFRACTION*sizeof(HISTCOUNTER));
|
||||
s_highpc = highpc;
|
||||
s_textsize = highpc - lowpc;
|
||||
monsize = (s_textsize / HISTFRACTION) + sizeof(struct phdr);
|
||||
buffer = (char *) sbrk( monsize );
|
||||
if ( buffer == (char *) -1 ) {
|
||||
write( 2 , MSG , sizeof(MSG) );
|
||||
return;
|
||||
}
|
||||
froms = (unsigned short *) sbrk( s_textsize / HASHFRACTION );
|
||||
if ( froms == (unsigned short *) -1 ) {
|
||||
write( 2 , MSG , sizeof(MSG) );
|
||||
froms = 0;
|
||||
return;
|
||||
}
|
||||
tolimit = s_textsize * ARCDENSITY / 100;
|
||||
if ( tolimit < MINARCS ) {
|
||||
tolimit = MINARCS;
|
||||
} else if ( tolimit > 65534 ) {
|
||||
tolimit = 65534;
|
||||
}
|
||||
tos = (struct tostruct *) sbrk( tolimit * sizeof( struct tostruct ) );
|
||||
if ( tos == (struct tostruct *) -1 ) {
|
||||
write( 2 , MSG , sizeof(MSG) );
|
||||
froms = 0;
|
||||
tos = 0;
|
||||
return;
|
||||
}
|
||||
/* minbrk = (char *) sbrk(0);*/
|
||||
tos[0].link = 0;
|
||||
sbuf = buffer;
|
||||
ssiz = monsize;
|
||||
( (struct phdr *) buffer ) -> lpc = lowpc;
|
||||
( (struct phdr *) buffer ) -> hpc = highpc;
|
||||
( (struct phdr *) buffer ) -> ncnt = ssiz;
|
||||
monsize -= sizeof(struct phdr);
|
||||
if ( monsize <= 0 )
|
||||
return;
|
||||
o = highpc - lowpc;
|
||||
if( monsize < o )
|
||||
#ifndef hp300
|
||||
s_scale = ( (float) monsize / o ) * SCALE_1_TO_1;
|
||||
#else /* avoid floating point */
|
||||
{
|
||||
int quot = o / monsize;
|
||||
|
||||
if (quot >= 0x10000)
|
||||
s_scale = 1;
|
||||
else if (quot >= 0x100)
|
||||
s_scale = 0x10000 / quot;
|
||||
else if (o >= 0x800000)
|
||||
s_scale = 0x1000000 / (o / (monsize >> 8));
|
||||
else
|
||||
s_scale = 0x1000000 / ((o << 8) / monsize);
|
||||
}
|
||||
#endif
|
||||
else
|
||||
s_scale = SCALE_1_TO_1;
|
||||
moncontrol(1);
|
||||
}
|
||||
|
||||
_mcleanup()
|
||||
{
|
||||
int fd;
|
||||
int fromindex;
|
||||
int endfrom;
|
||||
char *frompc;
|
||||
int toindex;
|
||||
struct rawarc rawarc;
|
||||
|
||||
moncontrol(0);
|
||||
fd = creat( "gmon.out" , 0666 );
|
||||
if ( fd < 0 ) {
|
||||
perror( "mcount: gmon.out" );
|
||||
return;
|
||||
}
|
||||
# ifdef DEBUG
|
||||
fprintf( stderr , "[mcleanup] sbuf 0x%x ssiz %d\n" , sbuf , ssiz );
|
||||
# endif DEBUG
|
||||
|
||||
write( fd , sbuf , ssiz );
|
||||
endfrom = s_textsize / (HASHFRACTION * sizeof(*froms));
|
||||
for ( fromindex = 0 ; fromindex < endfrom ; fromindex++ ) {
|
||||
if ( froms[fromindex] == 0 ) {
|
||||
continue;
|
||||
}
|
||||
frompc = s_lowpc + (fromindex * HASHFRACTION * sizeof(*froms));
|
||||
for (toindex=froms[fromindex]; toindex!=0; toindex=tos[toindex].link) {
|
||||
# ifdef DEBUG
|
||||
fprintf( stderr ,
|
||||
"[mcleanup] frompc 0x%x selfpc 0x%x count %d\n" ,
|
||||
frompc , tos[toindex].selfpc , tos[toindex].count );
|
||||
# endif DEBUG
|
||||
rawarc.raw_frompc = (unsigned long) frompc;
|
||||
rawarc.raw_selfpc = (unsigned long) tos[toindex].selfpc;
|
||||
rawarc.raw_count = tos[toindex].count;
|
||||
write( fd , &rawarc , sizeof rawarc );
|
||||
}
|
||||
}
|
||||
close( fd );
|
||||
}
|
||||
|
||||
/* Solaris 2 libraries use _mcount. */
|
||||
asm(".globl _mcount; _mcount: jmp internal_mcount");
|
||||
/* This is for compatibility with old versions of gcc which used mcount. */
|
||||
asm(".globl mcount; mcount: jmp internal_mcount");
|
||||
|
||||
internal_mcount()
|
||||
{
|
||||
register char *selfpc;
|
||||
register unsigned short *frompcindex;
|
||||
register struct tostruct *top;
|
||||
register struct tostruct *prevtop;
|
||||
register long toindex;
|
||||
static char already_setup;
|
||||
|
||||
/*
|
||||
* find the return address for mcount,
|
||||
* and the return address for mcount's caller.
|
||||
*/
|
||||
|
||||
/* selfpc = pc pushed by mcount call.
|
||||
This identifies the function that was just entered. */
|
||||
selfpc = (void *) __builtin_return_address (0);
|
||||
/* frompcindex = pc in preceding frame.
|
||||
This identifies the caller of the function just entered. */
|
||||
frompcindex = (void *) __builtin_return_address (1);
|
||||
|
||||
if(!already_setup) {
|
||||
extern etext();
|
||||
already_setup = 1;
|
||||
/* monstartup(0, etext); */
|
||||
monstartup(0x08040000, etext);
|
||||
#ifdef USE_ONEXIT
|
||||
on_exit(_mcleanup, 0);
|
||||
#else
|
||||
atexit(_mcleanup);
|
||||
#endif
|
||||
}
|
||||
/*
|
||||
* check that we are profiling
|
||||
* and that we aren't recursively invoked.
|
||||
*/
|
||||
if (profiling) {
|
||||
goto out;
|
||||
}
|
||||
profiling++;
|
||||
/*
|
||||
* check that frompcindex is a reasonable pc value.
|
||||
* for example: signal catchers get called from the stack,
|
||||
* not from text space. too bad.
|
||||
*/
|
||||
frompcindex = (unsigned short *)((long)frompcindex - (long)s_lowpc);
|
||||
if ((unsigned long)frompcindex > s_textsize) {
|
||||
goto done;
|
||||
}
|
||||
frompcindex =
|
||||
&froms[((long)frompcindex) / (HASHFRACTION * sizeof(*froms))];
|
||||
toindex = *frompcindex;
|
||||
if (toindex == 0) {
|
||||
/*
|
||||
* first time traversing this arc
|
||||
*/
|
||||
toindex = ++tos[0].link;
|
||||
if (toindex >= tolimit) {
|
||||
goto overflow;
|
||||
}
|
||||
*frompcindex = toindex;
|
||||
top = &tos[toindex];
|
||||
top->selfpc = selfpc;
|
||||
top->count = 1;
|
||||
top->link = 0;
|
||||
goto done;
|
||||
}
|
||||
top = &tos[toindex];
|
||||
if (top->selfpc == selfpc) {
|
||||
/*
|
||||
* arc at front of chain; usual case.
|
||||
*/
|
||||
top->count++;
|
||||
goto done;
|
||||
}
|
||||
/*
|
||||
* have to go looking down chain for it.
|
||||
* top points to what we are looking at,
|
||||
* prevtop points to previous top.
|
||||
* we know it is not at the head of the chain.
|
||||
*/
|
||||
for (; /* goto done */; ) {
|
||||
if (top->link == 0) {
|
||||
/*
|
||||
* top is end of the chain and none of the chain
|
||||
* had top->selfpc == selfpc.
|
||||
* so we allocate a new tostruct
|
||||
* and link it to the head of the chain.
|
||||
*/
|
||||
toindex = ++tos[0].link;
|
||||
if (toindex >= tolimit) {
|
||||
goto overflow;
|
||||
}
|
||||
top = &tos[toindex];
|
||||
top->selfpc = selfpc;
|
||||
top->count = 1;
|
||||
top->link = *frompcindex;
|
||||
*frompcindex = toindex;
|
||||
goto done;
|
||||
}
|
||||
/*
|
||||
* otherwise, check the next arc on the chain.
|
||||
*/
|
||||
prevtop = top;
|
||||
top = &tos[top->link];
|
||||
if (top->selfpc == selfpc) {
|
||||
/*
|
||||
* there it is.
|
||||
* increment its count
|
||||
* move it to the head of the chain.
|
||||
*/
|
||||
top->count++;
|
||||
toindex = prevtop->link;
|
||||
prevtop->link = top->link;
|
||||
top->link = *frompcindex;
|
||||
*frompcindex = toindex;
|
||||
goto done;
|
||||
}
|
||||
|
||||
}
|
||||
done:
|
||||
profiling--;
|
||||
/* and fall through */
|
||||
out:
|
||||
return; /* normal return restores saved registers */
|
||||
|
||||
overflow:
|
||||
profiling++; /* halt further profiling */
|
||||
# define TOLIMIT "mcount: tos overflow\n"
|
||||
write(2, TOLIMIT, sizeof(TOLIMIT));
|
||||
goto out;
|
||||
}
|
||||
|
||||
/*
|
||||
* Control profiling
|
||||
* profiling is what mcount checks to see if
|
||||
* all the data structures are ready.
|
||||
*/
|
||||
moncontrol(mode)
|
||||
int mode;
|
||||
{
|
||||
if (mode)
|
||||
{
|
||||
/* start */
|
||||
profil((unsigned short *)(sbuf + sizeof(struct phdr)),
|
||||
ssiz - sizeof(struct phdr),
|
||||
(int)s_lowpc, s_scale);
|
||||
|
||||
profiling = 0;
|
||||
} else {
|
||||
/* stop */
|
||||
profil((unsigned short *)0, 0, 0, 0);
|
||||
profiling = 3;
|
||||
}
|
||||
}
|
@ -4,16 +4,19 @@
|
||||
#include <i386/linux.h>
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES GNU_CPP_PREDEFINES("i386")
|
||||
#define CPP_PREDEFINES "-Di386 -Acpu(i386) -Amachine(i386) \
|
||||
-Dunix -Asystem(unix) -DMACH -Asystem(mach) -D__GNU__ -Asystem(gnu)"
|
||||
|
||||
#undef TARGET_VERSION
|
||||
#define TARGET_VERSION fprintf (stderr, " (i386 GNU)");
|
||||
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{!ibcs: \
|
||||
%{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
%{!dynamic-linker:-dynamic-linker /lib/ld.so} \
|
||||
%{!rpath:-rpath /lib/}} %{static:-static}}}"
|
||||
%{!static: \
|
||||
%{rdynamic:-export-dynamic} \
|
||||
%{!dynamic-linker:-dynamic-linker /lib/ld.so}} \
|
||||
%{static:-static}}"
|
||||
|
||||
|
||||
/* Get machine-independent configuration parameters for the GNU system. */
|
||||
|
@ -1,5 +1,7 @@
|
||||
/* Configuration for an i386 running MS-DOS with djgpp/go32. */
|
||||
|
||||
#include "dbxcoff.h"
|
||||
|
||||
/* Don't assume anything about the header files. */
|
||||
#define NO_IMPLICIT_EXTERN_C
|
||||
|
||||
@ -53,7 +55,13 @@ dtor_section () \
|
||||
fprintf (FILE, "\n"); \
|
||||
} while (0)
|
||||
|
||||
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
|
||||
/* Allow (eg) __attribute__((section "locked")) to work */
|
||||
#define ASM_OUTPUT_SECTION_NAME(FILE, DECL, NAME, RELOC)\
|
||||
do { \
|
||||
fprintf (FILE, "\t.section %s\n", NAME); \
|
||||
} while (0)
|
||||
|
||||
#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
|
||||
do { \
|
||||
dtor_section (); \
|
||||
fprintf (FILE, "%s\t", ASM_LONG); \
|
||||
@ -61,4 +69,28 @@ dtor_section () \
|
||||
fprintf (FILE, "\n"); \
|
||||
} while (0)
|
||||
|
||||
/* Output at beginning of assembler file. */
|
||||
/* The .file command should always begin the output. */
|
||||
/* Use the main_input_filename instead of dump_base_name */
|
||||
|
||||
#undef ASM_FILE_START
|
||||
#define ASM_FILE_START(FILE) \
|
||||
do { \
|
||||
output_file_directive (FILE, main_input_filename); \
|
||||
} while (0)
|
||||
|
||||
/* This is how to output an assembler line
|
||||
that says to advance the location counter
|
||||
to a multiple of 2**LOG bytes. */
|
||||
|
||||
#undef ASM_OUTPUT_ALIGN
|
||||
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
|
||||
if ((LOG) != 0) fprintf ((FILE), "\t.p2align %d\n", LOG)
|
||||
|
||||
/* djgpp has atexit (). */
|
||||
#undef HAVE_ATEXIT
|
||||
#define HAVE_ATEXIT
|
||||
|
||||
/* djgpp automatically calls its own version of __main, so don't define one
|
||||
in libgcc, nor call one in main(). */
|
||||
#define HAS_INIT_SECTION
|
||||
|
@ -19,7 +19,7 @@
|
||||
#define LIB_SPEC "%{shlib:-lc_s} %{posix:-lcposix} %{Xp:-lcposix} -lc -lg"
|
||||
|
||||
#undef CPP_SPEC
|
||||
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{Xp:-D_POSIX_SOURCE}"
|
||||
#define CPP_SPEC "%(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{Xp:-D_POSIX_SOURCE}"
|
||||
|
||||
/* ISC 2.2 uses `char' for `wchar_t'. */
|
||||
#undef WCHAR_TYPE
|
||||
@ -37,7 +37,7 @@
|
||||
|
||||
#undef RETURN_POPS_ARGS
|
||||
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
|
||||
(TREE_CODE (FUNTYPE) == IDENTIFIER_NODE ? 0 \
|
||||
((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \
|
||||
: (TARGET_RTD \
|
||||
&& (TYPE_ARG_TYPES (FUNTYPE) == 0 \
|
||||
|| (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \
|
||||
@ -87,3 +87,7 @@
|
||||
} \
|
||||
fputs ("\"\n", FILE); \
|
||||
} while (0)
|
||||
|
||||
/* Work around assembler forward label references generated in exception
|
||||
handling code. */
|
||||
#define DWARF2_UNWIND_INFO 0
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Definitions for Intel 386 running Linux
|
||||
Copyright (C) 1992, 1994, 1995 Free Software Foundation, Inc.
|
||||
/* Definitions for Intel 386 running Linux-based GNU systems using a.out.
|
||||
Copyright (C) 1992, 1994, 1995, 1997, 1998 Free Software Foundation, Inc.
|
||||
Contributed by H.J. Lu (hjl@nynexst.com)
|
||||
|
||||
This file is part of GNU CC.
|
||||
@ -25,17 +25,16 @@ Boston, MA 02111-1307, USA. */
|
||||
#include <i386/gstabs.h>
|
||||
#include <linux-aout.h> /* some common stuff */
|
||||
|
||||
#undef ASM_COMMENT_START
|
||||
#define ASM_COMMENT_START "#"
|
||||
|
||||
/* Specify predefined symbols in preprocessor. */
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-Dunix -Di386 -Dlinux -Asystem(unix) -Asystem(posix) -Acpu(i386) -Amachine(i386)"
|
||||
#define CPP_PREDEFINES "-Dunix -Dlinux -Asystem(posix)"
|
||||
|
||||
#undef CPP_SPEC
|
||||
#if TARGET_CPU_DEFAULT == 2
|
||||
#define CPP_SPEC "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{!m386:-D__i486__} %{posix:-D_POSIX_SOURCE}"
|
||||
#else
|
||||
#define CPP_SPEC "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{m486:-D__i486__} %{posix:-D_POSIX_SOURCE}"
|
||||
#endif
|
||||
#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"
|
||||
@ -57,9 +56,8 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
#if 1
|
||||
/* We no longer link with libc_p.a or libg.a by default. If you
|
||||
* want to profile or debug the Linux C library, please add
|
||||
* -lc_p or -ggdb to LDFLAGS at the link time, respectively.
|
||||
*/
|
||||
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
|
||||
|
@ -1,5 +1,6 @@
|
||||
/* Definitions for Intel 386 running Linux with pre-BFD a.out linkers
|
||||
Copyright (C) 1995 Free Software Foundation, Inc.
|
||||
/* Definitions for Intel 386 running Linux-based GNU systems with pre-BFD
|
||||
a.out linkers.
|
||||
Copyright (C) 1995, 1997, 1998 Free Software Foundation, Inc.
|
||||
Contributed by Michael Meissner (meissner@cygnus.com)
|
||||
|
||||
This file is part of GNU CC.
|
||||
@ -25,17 +26,16 @@ Boston, MA 02111-1307, USA. */
|
||||
#include <i386/gstabs.h>
|
||||
#include <linux-aout.h> /* some common stuff */
|
||||
|
||||
#undef ASM_COMMENT_START
|
||||
#define ASM_COMMENT_START "#"
|
||||
|
||||
/* Specify predefined symbols in preprocessor. */
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-Dunix -Di386 -Dlinux -Asystem(unix) -Asystem(posix) -Acpu(i386) -Amachine(i386)"
|
||||
#define CPP_PREDEFINES "-Dunix -Dlinux -Asystem(posix)"
|
||||
|
||||
#undef CPP_SPEC
|
||||
#if TARGET_CPU_DEFAULT == 2
|
||||
#define CPP_SPEC "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{!m386:-D__i486__} %{posix:-D_POSIX_SOURCE}"
|
||||
#else
|
||||
#define CPP_SPEC "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{m486:-D__i486__} %{posix:-D_POSIX_SOURCE}"
|
||||
#endif
|
||||
#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"
|
||||
@ -57,9 +57,8 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
#if 1
|
||||
/* We no longer link with libc_p.a or libg.a by default. If you
|
||||
* want to profile or debug the Linux C library, please add
|
||||
* -lc_p or -ggdb to LDFLAGS at the link time, respectively.
|
||||
*/
|
||||
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
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Definitions for Intel 386 running Linux with ELF format
|
||||
Copyright (C) 1994, 1995 Free Software Foundation, Inc.
|
||||
/* Definitions for Intel 386 running Linux-based GNU systems with ELF format.
|
||||
Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
|
||||
Contributed by Eric Youngdale.
|
||||
Modified for stabs-in-ELF by H.J. Lu.
|
||||
|
||||
@ -37,16 +37,19 @@ Boston, MA 02111-1307, USA. */
|
||||
#undef DEFAULT_PCC_STRUCT_RETURN
|
||||
#define DEFAULT_PCC_STRUCT_RETURN 1
|
||||
|
||||
#undef ASM_COMMENT_START
|
||||
#define ASM_COMMENT_START "#"
|
||||
|
||||
/* 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, VALUE, REL) \
|
||||
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
|
||||
fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
|
||||
|
||||
/* Indicate that jump tables go in the text section. This is
|
||||
necessary when compiling PIC code. */
|
||||
#define JUMP_TABLES_IN_TEXT_SECTION
|
||||
#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
|
||||
|
||||
/* Copy this from the svr4 specifications... */
|
||||
/* Define the register numbers to be used in Dwarf debugging information.
|
||||
@ -147,44 +150,19 @@ Boston, MA 02111-1307, USA. */
|
||||
#undef WCHAR_TYPE_SIZE
|
||||
#define WCHAR_TYPE_SIZE BITS_PER_WORD
|
||||
|
||||
/* The egcs-1.1 branch is the last time we will have -Di386. -D__i386__ is the thing to use. */
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-D__ELF__ -Dunix -Di386 -Dlinux -Asystem(unix) -Asystem(posix) -Acpu(i386) -Amachine(i386)"
|
||||
#define CPP_PREDEFINES "-D__ELF__ -Dunix -Di386 -D__i386__ -Dlinux -Asystem(posix)"
|
||||
|
||||
#undef CPP_SPEC
|
||||
#ifdef USE_GNULIBC_1
|
||||
#if TARGET_CPU_DEFAULT == 2
|
||||
#define CPP_SPEC "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{!m386:-D__i486__} %{posix:-D_POSIX_SOURCE}"
|
||||
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE}"
|
||||
#else
|
||||
#define CPP_SPEC "%{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{m486:-D__i486__} %{posix:-D_POSIX_SOURCE}"
|
||||
#define CPP_SPEC "%(cpp_cpu) %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
|
||||
#endif
|
||||
#else /* not USE_GNULIBC_1 */
|
||||
#define CPP_SPEC "%(cpp_cpu) %[cpp_cpu] %{fPIC:-D__PIC__ -D__pic__} %{fpic:-D__PIC__ -D__pic__} %{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
|
||||
#endif /* not USE_GNULIBC_1 */
|
||||
|
||||
#undef LIBGCC_SPEC
|
||||
#define LIBGCC_SPEC "-lgcc"
|
||||
|
||||
#undef LIB_SPEC
|
||||
#ifdef USE_GNULIBC_1
|
||||
#if 1
|
||||
/* We no longer link with libc_p.a or libg.a by default. If you
|
||||
* want to profile or debug the Linux C library, please add
|
||||
* -lc_p or -ggdb to LDFLAGS at the link time, respectively.
|
||||
*/
|
||||
#define LIB_SPEC \
|
||||
"%{!shared: %{mieee-fp:-lieee} %{p:-lgmon} %{pg:-lgmon} \
|
||||
%{!ggdb:-lc} %{ggdb:-lg}}"
|
||||
#else
|
||||
#define LIB_SPEC \
|
||||
"%{!shared: \
|
||||
%{mieee-fp:-lieee} %{p:-lgmon -lc_p} %{pg:-lgmon -lc_p} \
|
||||
%{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
|
||||
#endif
|
||||
#else
|
||||
#define LIB_SPEC \
|
||||
"%{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \
|
||||
%{profile:-lc_p} %{!profile: -lc}}"
|
||||
#endif /* not USE_GNULIBC_1 */
|
||||
#undef CC1_SPEC
|
||||
#define CC1_SPEC "%(cc1_cpu) %{profile:-p}"
|
||||
|
||||
/* Provide a LINK_SPEC appropriate for Linux. Here we provide support
|
||||
for the special GCC options -static and -shared, which allow us to
|
||||
@ -221,7 +199,7 @@ Boston, MA 02111-1307, USA. */
|
||||
%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \
|
||||
%{static:-static}}}"
|
||||
#endif
|
||||
#else /* not USE_GNULIBC_1 */
|
||||
#else
|
||||
#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
|
||||
%{!shared: \
|
||||
%{!ibcs: \
|
||||
@ -229,7 +207,28 @@ Boston, MA 02111-1307, USA. */
|
||||
%{rdynamic:-export-dynamic} \
|
||||
%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
|
||||
%{static:-static}}}"
|
||||
#endif /* not USE_GNULIBC_1 */
|
||||
#endif
|
||||
|
||||
/* Get perform_* macros to build libgcc.a. */
|
||||
#include "i386/perform.h"
|
||||
|
||||
/* A C statement (sans semicolon) to output to the stdio stream
|
||||
FILE the assembler definition of uninitialized global DECL named
|
||||
NAME whose size is SIZE bytes and alignment is ALIGN bytes.
|
||||
Try to use asm_output_aligned_bss to implement this macro. */
|
||||
|
||||
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
|
||||
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
|
||||
|
||||
/* A C statement to output to the stdio stream FILE an assembler
|
||||
command to advance the location counter to a multiple of 1<<LOG
|
||||
bytes if it is within MAX_SKIP bytes.
|
||||
|
||||
This is used to align code labels according to Intel recommendations. */
|
||||
|
||||
#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
|
||||
#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
|
||||
if ((LOG)!=0) \
|
||||
if ((MAX_SKIP)==0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
|
||||
else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP))
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Definitions for Intel 386 running LynxOS.
|
||||
Copyright (C) 1993, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@ -24,12 +24,12 @@ Boston, MA 02111-1307, USA. */
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-Dunix -Di386 -DI386 -DLynx -DIBITS32 -Asystem(unix) -Asystem(lynx) -Acpu(i386) -Amachine(i386)"
|
||||
|
||||
/* This is how to output a reference to a user-level label named NAME. */
|
||||
/* The prefix to add to user-visible assembler symbols. */
|
||||
|
||||
/* Override the svr3 convention of adding a leading underscore. */
|
||||
|
||||
#undef ASM_OUTPUT_LABELREF
|
||||
#define ASM_OUTPUT_LABELREF(FILE,NAME) fprintf (FILE, "%s", NAME)
|
||||
#undef USER_LABEL_PREFIX
|
||||
#define USER_LABEL_PREFIX ""
|
||||
|
||||
/* Apparently LynxOS clobbers ebx when you call into the OS. */
|
||||
|
||||
|
95
contrib/gcc/config/i386/mingw32.h
Normal file
95
contrib/gcc/config/i386/mingw32.h
Normal file
@ -0,0 +1,95 @@
|
||||
/* Operating system specific defines to be used when targeting GCC for
|
||||
hosting on Windows32, using GNU tools and the Windows32 API Library,
|
||||
as distinct from winnt.h, which is used to build GCC for use with a
|
||||
windows style library and tool set and uses the Microsoft tools.
|
||||
Copyright (C) 1997, 1998 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. */
|
||||
|
||||
/* Most of this is the same as for Cygwin32, except for changing some
|
||||
specs. */
|
||||
|
||||
#include "i386/cygwin32.h"
|
||||
|
||||
/* Please keep changes to CPP_PREDEFINES in sync with i386/crtdll. The
|
||||
only difference between the two should be __MSVCRT__ needed to
|
||||
distinguish MSVC from CRTDLL runtime in mingw headers. */
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-Di386 -D_WIN32 -DWIN32 -D__WIN32__ \
|
||||
-D__MINGW32__ -D__MSVCRT__ -DWINNT -D_X86_=1 -D__STDC__=1\
|
||||
-D__stdcall=__attribute__((__stdcall__)) \
|
||||
-D_stdcall=__attribute__((__stdcall__)) \
|
||||
-D__cdecl=__attribute__((__cdecl__)) \
|
||||
-D__declspec(x)=__attribute__((x)) \
|
||||
-Asystem(winnt) -Acpu(i386) -Amachine(i386)"
|
||||
|
||||
/* Specific a different directory for the standard include files. */
|
||||
#undef STANDARD_INCLUDE_DIR
|
||||
#define STANDARD_INCLUDE_DIR "/usr/local/i386-mingw32/include"
|
||||
|
||||
#define STANDARD_INCLUDE_COMPONENT "MINGW32"
|
||||
|
||||
/* For Windows applications, include more libraries, but always include
|
||||
kernel32. */
|
||||
#undef LIB_SPEC
|
||||
#define LIB_SPEC \
|
||||
"%{mwindows:-luser32 -lgdi32 -lcomdlg32} -lkernel32 -ladvapi32 -lshell32"
|
||||
|
||||
/* Include in the mingw32 libraries with libgcc */
|
||||
#undef LIBGCC_SPEC
|
||||
#define LIBGCC_SPEC "-lmingw32 -lgcc -lmoldname -lmsvcrt"
|
||||
|
||||
/* Specify a different entry point when linking a DLL */
|
||||
#undef LINK_SPEC
|
||||
#define LINK_SPEC \
|
||||
"%{mwindows:--subsystem windows} %{mdll:--dll -e _DllMainCRTStartup@12}"
|
||||
|
||||
#undef STARTFILE_SPEC
|
||||
#define STARTFILE_SPEC "%{mdll:dllcrt2%O%s} %{!mdll:crt2%O%s}"
|
||||
|
||||
#define MATH_LIBRARY "-lmsvcrt"
|
||||
|
||||
/* Output STRING, a string representing a filename, to FILE. We canonicalize
|
||||
it to be in MS-DOS format. */
|
||||
#define OUTPUT_QUOTED_STRING(FILE, STRING) \
|
||||
do { \
|
||||
char c; \
|
||||
\
|
||||
putc ('\"', asm_file); \
|
||||
if (STRING[1] == ':' \
|
||||
&& (STRING[2] == '/' || STRING[2] == '\\')) \
|
||||
{ \
|
||||
putc ('/', asm_file); \
|
||||
putc ('/', asm_file); \
|
||||
putc (*string, asm_file); \
|
||||
string += 2; \
|
||||
} \
|
||||
\
|
||||
while ((c = *string++) != 0) \
|
||||
{ \
|
||||
if (c == '\\') \
|
||||
c = '/'; \
|
||||
\
|
||||
if (c == '\"') \
|
||||
putc ('\\', asm_file); \
|
||||
putc (c, asm_file); \
|
||||
} \
|
||||
\
|
||||
putc ('\"', asm_file); \
|
||||
} while (0)
|
||||
|
34
contrib/gcc/config/i386/moss.h
Normal file
34
contrib/gcc/config/i386/moss.h
Normal file
@ -0,0 +1,34 @@
|
||||
/* Definitions for Intel 386 running MOSS
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
Contributed by Bryan Ford <baford@cs.utah.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, 675 Mass Ave, Cambridge, MA 02139, USA. */
|
||||
|
||||
/* I believe in reuse... */
|
||||
#include "i386/linux.h"
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-D__ELF__ -Di386 -Dmoss -Asystem(posix) -Acpu(i386) -Amachine(i386)"
|
||||
|
||||
#undef STARTFILE_SPEC
|
||||
#define STARTFILE_SPEC "crt0.o%s"
|
||||
|
||||
#undef ENDFILE_SPEC
|
||||
#define ENDFILE_SPEC "crtn.o%s"
|
||||
|
||||
#undef LINK_SPEC
|
||||
|
@ -30,13 +30,6 @@
|
||||
#undef WCHAR_TYPE_SIZE
|
||||
#define WCHAR_TYPE_SIZE 32
|
||||
|
||||
#define HANDLE_SYSV_PRAGMA
|
||||
|
||||
/* There are conflicting reports about whether this system uses
|
||||
a different assembler syntax. wilson@cygnus.com says # is right. */
|
||||
#undef COMMENT_BEGIN
|
||||
#define COMMENT_BEGIN "#"
|
||||
|
||||
#undef ASM_APP_ON
|
||||
#define ASM_APP_ON "#APP\n"
|
||||
|
||||
@ -51,18 +44,25 @@
|
||||
i386.md for an explanation of the expression this outputs. */
|
||||
|
||||
#undef ASM_OUTPUT_ADDR_DIFF_ELT
|
||||
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
|
||||
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
|
||||
fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
|
||||
|
||||
/* Indicate that jump tables go in the text section. This is
|
||||
necessary when compiling PIC code. */
|
||||
|
||||
#define JUMP_TABLES_IN_TEXT_SECTION
|
||||
#define JUMP_TABLES_IN_TEXT_SECTION 1
|
||||
|
||||
/* 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
|
||||
|
||||
/* i386 netbsd 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))
|
||||
|
||||
/* Profiling routines, partially copied from i386/osfrose.h. */
|
||||
|
||||
/* Redefine this to use %eax instead of %edx. */
|
||||
@ -78,3 +78,8 @@
|
||||
fprintf (FILE, "\tcall mcount\n"); \
|
||||
} \
|
||||
}
|
||||
|
||||
/* Until they use ELF or something that handles dwarf2 unwinds
|
||||
and initialization stuff better. */
|
||||
#define DWARF2_UNWIND_INFO 0
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* Target definitions for GNU compiler for Intel x86 CPU running NeXTSTEP
|
||||
Copyright (C) 1993, 1995 Free Software Foundation, Inc.
|
||||
Copyright (C) 1993, 1995, 1996 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@ -124,8 +124,8 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
GAS requires the %cl argument, so override unx386.h. */
|
||||
|
||||
#undef AS3_SHIFT_DOUBLE
|
||||
#define AS3_SHIFT_DOUBLE(a,b,c,d) AS3 (a,b,c,d)
|
||||
#undef SHIFT_DOUBLE_OMITS_COUNT
|
||||
#define SHIFT_DOUBLE_OMITS_COUNT 0
|
||||
|
||||
/* Print opcodes the way that GAS expects them. */
|
||||
#define GAS_MNEMONICS 1
|
||||
@ -216,7 +216,7 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
#undef RETURN_POPS_ARGS
|
||||
#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
|
||||
(TREE_CODE (FUNTYPE) == IDENTIFIER_NODE \
|
||||
((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE \
|
||||
? 0 \
|
||||
: (TARGET_RTD \
|
||||
&& (TYPE_ARG_TYPES (FUNTYPE) == 0 \
|
||||
@ -224,3 +224,10 @@ Boston, MA 02111-1307, USA. */
|
||||
== 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))
|
||||
|
130
contrib/gcc/config/i386/openbsd.h
Normal file
130
contrib/gcc/config/i386/openbsd.h
Normal file
@ -0,0 +1,130 @@
|
||||
/* Configuration for an OpenBSD i386 target.
|
||||
|
||||
Copyright (C) 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. */
|
||||
|
||||
/* This is tested by i386gas.h. */
|
||||
#define YES_UNDERSCORES
|
||||
|
||||
#include <i386/gstabs.h>
|
||||
|
||||
/* Get perform_* macros to build libgcc.a. */
|
||||
#include <i386/perform.h>
|
||||
|
||||
/* Get generic OpenBSD definitions. */
|
||||
#define OBSD_OLD_GAS
|
||||
#include <openbsd.h>
|
||||
|
||||
/* Run-time target specifications */
|
||||
#define CPP_PREDEFINES "-D__unix__ -D__i386__ -D__OpenBSD__ -Asystem(unix) -Asystem(OpenBSD) -Acpu(i386) -Amachine(i386)"
|
||||
|
||||
/* Layout of source language data types. */
|
||||
|
||||
/* This must agree with <machine/ansi.h> */
|
||||
#undef SIZE_TYPE
|
||||
#define SIZE_TYPE "unsigned int"
|
||||
|
||||
#undef PTRDIFF_TYPE
|
||||
#define PTRDIFF_TYPE "int"
|
||||
|
||||
#undef WCHAR_TYPE
|
||||
#define WCHAR_TYPE "int"
|
||||
|
||||
#undef WCHAR_TYPE_SIZE
|
||||
#define WCHAR_TYPE_SIZE 32
|
||||
|
||||
/* Assembler format: overall framework. */
|
||||
|
||||
#undef ASM_APP_ON
|
||||
#define ASM_APP_ON "#APP\n"
|
||||
|
||||
#undef ASM_APP_OFF
|
||||
#define ASM_APP_OFF "#NO_APP\n"
|
||||
|
||||
/* The following macros were originally stolen from i386v4.h.
|
||||
These have to be defined to get PIC code correct. */
|
||||
|
||||
/* Assembler format: dispatch tables. */
|
||||
|
||||
/* 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)
|
||||
|
||||
/* Assembler format: sections. */
|
||||
|
||||
/* Indicate when jump tables go in the text section. This is
|
||||
necessary when compiling PIC code. */
|
||||
#define JUMP_TABLES_IN_TEXT_SECTION (flag_pic)
|
||||
|
||||
/* Stack & calling: aggregate returns. */
|
||||
|
||||
/* 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
|
||||
|
||||
/* Assembler format: alignment output. */
|
||||
|
||||
/* Kludgy test: when gas is upgraded, it will have p2align, and no problems
|
||||
with nops. */
|
||||
#ifndef HAVE_GAS_MAX_SKIP_P2ALIGN
|
||||
/* i386 OpenBSD still uses an older gas that doesn'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))
|
||||
#endif
|
||||
|
||||
/* Stack & calling: profiling. */
|
||||
|
||||
/* OpenBSD's profiler recovers all information from the stack pointer.
|
||||
The icky part is not here, but in machine/profile.h. */
|
||||
#undef FUNCTION_PROFILER
|
||||
#define FUNCTION_PROFILER(FILE, LABELNO) \
|
||||
fputs (flag_pic ? "\tcall mcount@PLT\n": "\tcall mcount\n", FILE);
|
||||
|
||||
/* Assembler format: exception region output. */
|
||||
|
||||
/* All configurations that don't use elf must be explicit about not using
|
||||
dwarf unwind information. egcs doesn't try too hard to check internal
|
||||
configuration files... */
|
||||
#define DWARF2_UNWIND_INFO 0
|
||||
|
||||
/* Assembler format: alignment output. */
|
||||
|
||||
/* A C statement to output to the stdio stream FILE an assembler
|
||||
command to advance the location counter to a multiple of 1<<LOG
|
||||
bytes if it is within MAX_SKIP bytes.
|
||||
|
||||
This will be used to align code labels according to Intel
|
||||
recommendations, in prevision of binutils upgrade. */
|
||||
#ifdef HAVE_GAS_MAX_SKIP_P2ALIGN
|
||||
#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \
|
||||
do { \
|
||||
if ((LOG) != 0) \
|
||||
if ((MAX_SKIP) == 0) fprintf ((FILE), "\t.p2align %d\n", (LOG)); \
|
||||
else fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \
|
||||
} while (0)
|
||||
#endif
|
||||
|
||||
/* Note that we pick up ASM_OUTPUT_MI_THUNK from unix.h. */
|
||||
|
65
contrib/gcc/config/i386/osf1-ci.asm
Normal file
65
contrib/gcc/config/i386/osf1-ci.asm
Normal file
@ -0,0 +1,65 @@
|
||||
! 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
|
46
contrib/gcc/config/i386/osf1-cn.asm
Normal file
46
contrib/gcc/config/i386/osf1-cn.asm
Normal file
@ -0,0 +1,46 @@
|
||||
! 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
|
260
contrib/gcc/config/i386/osf1elf.h
Normal file
260
contrib/gcc/config/i386/osf1elf.h
Normal file
@ -0,0 +1,260 @@
|
||||
/* OSF/1 1.3 now is compitable with SVR4, so include sysv4.h, and
|
||||
put difference here. */
|
||||
|
||||
#include <stdio.h>
|
||||
#include "i386/sysv4.h" /* Base i386 target machine definitions */
|
||||
#define _sys_siglist sys_siglist
|
||||
extern char *sys_siglist[];
|
||||
|
||||
#undef TARGET_VERSION
|
||||
#define TARGET_VERSION fprintf (stderr, " (i386 OSF/1)");
|
||||
|
||||
/* 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 "\
|
||||
%{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 "%{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 -Di386 -Dunix -Asystem(xpg4) -Asystem(osf1) -Acpu(i386) -Amachine(i386)"
|
||||
|
||||
/* 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}}"
|
||||
|
||||
/* A C statement to output assembler commands which will identify the object
|
||||
file as having been compile with GNU CC. We don't need or want this for
|
||||
OSF1. */
|
||||
#undef ASM_IDENTIFY_GCC
|
||||
#define ASM_IDENTIFY_GCC(FILE)
|
||||
|
||||
/* Identify the front-end which produced this file. To keep symbol
|
||||
space down, and not confuse kdb, only do this if the language is
|
||||
not C. */
|
||||
#define ASM_IDENTIFY_LANGUAGE(STREAM) \
|
||||
{ \
|
||||
if (strcmp (lang_identify (), "c") != 0) \
|
||||
output_lang_identify (STREAM); \
|
||||
}
|
||||
|
||||
/* 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}, \
|
||||
{ "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
|
||||
#undef FUNCTION_PROLOGUE
|
||||
#define FUNCTION_PROLOGUE(FILE, SIZE) \
|
||||
do \
|
||||
{ \
|
||||
char *prefix = ""; \
|
||||
char *lprefix = LPREFIX; \
|
||||
int labelno = profile_label_no; \
|
||||
\
|
||||
if (profile_flag && OSF_PROFILE_BEFORE_PROLOGUE) \
|
||||
{ \
|
||||
if (!flag_pic) \
|
||||
{ \
|
||||
fprintf (FILE, "\tmovl $%sP%d,%%edx\n", lprefix, labelno); \
|
||||
fprintf (FILE, "\tcall *%s_mcount_ptr\n", prefix); \
|
||||
} \
|
||||
\
|
||||
else \
|
||||
{ \
|
||||
static int call_no = 0; \
|
||||
\
|
||||
fprintf (FILE, "\tcall %sPc%d\n", lprefix, call_no); \
|
||||
fprintf (FILE, "%sPc%d:\tpopl %%eax\n", lprefix, call_no); \
|
||||
fprintf (FILE, "\taddl $_GLOBAL_OFFSET_TABLE_+[.-%sPc%d],%%eax\n", \
|
||||
lprefix, call_no++); \
|
||||
fprintf (FILE, "\tleal %sP%d@GOTOFF(%%eax),%%edx\n", \
|
||||
lprefix, labelno); \
|
||||
fprintf (FILE, "\tmovl %s_mcount_ptr@GOT(%%eax),%%eax\n", \
|
||||
prefix); \
|
||||
fprintf (FILE, "\tcall *(%%eax)\n"); \
|
||||
} \
|
||||
} \
|
||||
\
|
||||
function_prologue (FILE, SIZE); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* 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) \
|
||||
{ \
|
||||
char *prefix = ""; \
|
||||
char *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
|
7
contrib/gcc/config/i386/osf1elfgdb.h
Normal file
7
contrib/gcc/config/i386/osf1elfgdb.h
Normal file
@ -0,0 +1,7 @@
|
||||
/* Target definitions for GNU compiler for Intel 80386 running OSF/1 1.3+
|
||||
with gas and gdb. */
|
||||
|
||||
/* Use stabs instead of DWARF debug format. */
|
||||
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
|
||||
|
||||
#include "i386/osf1elf.h"
|
@ -22,10 +22,10 @@ Boston, MA 02111-1307, USA. */
|
||||
#include "config/i386/osfrose.h"
|
||||
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-DOSF -DOSF1 -Dunix -Di386 -Asystem(unix) -Asystem(xpg4) -Acpu(i386) -Amachine(i386)"
|
||||
#define CPP_PREDEFINES "-DOSF -DOSF1 -Dunix -Asystem(xpg4)"
|
||||
|
||||
#undef CPP_SPEC
|
||||
#define 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__} \
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Definitions of target machine for GNU compiler.
|
||||
Intel 386 (OSF/1 with OSF/rose) version.
|
||||
Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
|
||||
Copyright (C) 1991, 1992, 1993, 1996 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU CC.
|
||||
|
||||
@ -36,16 +36,7 @@ Boston, MA 02111-1307, USA. */
|
||||
-z* options (for the linker). */
|
||||
|
||||
#define SWITCH_TAKES_ARG(CHAR) \
|
||||
( (CHAR) == 'D' \
|
||||
|| (CHAR) == 'U' \
|
||||
|| (CHAR) == 'o' \
|
||||
|| (CHAR) == 'e' \
|
||||
|| (CHAR) == 'T' \
|
||||
|| (CHAR) == 'u' \
|
||||
|| (CHAR) == 'I' \
|
||||
|| (CHAR) == 'm' \
|
||||
|| (CHAR) == 'L' \
|
||||
|| (CHAR) == 'A' \
|
||||
(DEFAULT_SWITCH_TAKES_ARG(CHAR) \
|
||||
|| (CHAR) == 'h' \
|
||||
|| (CHAR) == 'z')
|
||||
|
||||
@ -99,10 +90,10 @@ Boston, MA 02111-1307, USA. */
|
||||
|
||||
/* Change default predefines. */
|
||||
#undef CPP_PREDEFINES
|
||||
#define CPP_PREDEFINES "-DOSF -DOSF1 -Dunix -Di386 -Asystem(unix) -Asystem(xpg4) -Acpu(i386) -Amachine(i386)"
|
||||
#define CPP_PREDEFINES "-DOSF -DOSF1 -Dunix -Asystem(xpg4)"
|
||||
|
||||
#undef CPP_SPEC
|
||||
#define 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__} \
|
||||
@ -373,6 +364,12 @@ while (0)
|
||||
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
|
||||
@ -384,7 +381,7 @@ while (0)
|
||||
i386.md for an explanation of the expression this outputs. */
|
||||
|
||||
#undef ASM_OUTPUT_ADDR_DIFF_ELT
|
||||
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
|
||||
#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 */
|
||||
@ -407,10 +404,9 @@ while (0)
|
||||
alignment to be done at such a time. Most machine descriptions do
|
||||
not currently define the macro. */
|
||||
|
||||
#undef ASM_OUTPUT_ALIGN_CODE
|
||||
#define ASM_OUTPUT_ALIGN_CODE(STREAM) \
|
||||
fprintf (STREAM, "\t.align\t%d\n", \
|
||||
(!TARGET_LARGE_ALIGN && i386_align_jumps > 2) ? 2 : i386_align_jumps)
|
||||
#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.
|
||||
@ -419,9 +415,8 @@ while (0)
|
||||
alignment to be done at such a time. Most machine descriptions do
|
||||
not currently define the macro. */
|
||||
|
||||
#undef ASM_OUTPUT_LOOP_ALIGN
|
||||
#define ASM_OUTPUT_LOOP_ALIGN(STREAM) \
|
||||
fprintf (STREAM, "\t.align\t%d\n", i386_align_loops)
|
||||
#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
|
||||
|
247
contrib/gcc/config/i386/ptx4-i.h
Normal file
247
contrib/gcc/config/i386/ptx4-i.h
Normal file
@ -0,0 +1,247 @@
|
||||
/* Target definitions for GNU compiler for Intel 80386 running Dynix/ptx v4
|
||||
Copyright (C) 1996 Free Software Foundation, Inc.
|
||||
|
||||
Modified from sysv4.h
|
||||
Originally written by Ron Guilmette (rfg@netcom.com).
|
||||
Modified by Tim Wright (timw@sequent.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. */
|
||||
|
||||
#include "i386/i386.h" /* Base i386 target machine definitions */
|
||||
#include "i386/att.h" /* Use the i386 AT&T assembler syntax */
|
||||
#include "ptx4.h" /* Rest of definitions (non architecture dependent) */
|
||||
|
||||
#undef TARGET_VERSION
|
||||
#define TARGET_VERSION fprintf (stderr, " (i386 Sequent Dynix/ptx Version 4)");
|
||||
|
||||
/* The svr4 ABI for the i386 says that records and unions are returned
|
||||
in memory. */
|
||||
|
||||
#undef RETURN_IN_MEMORY
|
||||
#define RETURN_IN_MEMORY(TYPE) \
|
||||
(TYPE_MODE (TYPE) == BLKmode)
|
||||
|
||||
/* Define which macros to predefine. _SEQUENT_ is our extension. */
|
||||
/* This used to define X86, but james@bigtex.cactus.org says that
|
||||
is supposed to be defined optionally by user programs--not by default. */
|
||||
#define CPP_PREDEFINES \
|
||||
"-Di386 -Dunix -D_SEQUENT_ -Asystem(unix) -Asystem(ptx4) -Acpu(i386) -Amachine(i386)"
|
||||
|
||||
/* This is how to output assembly code to define a `float' constant.
|
||||
We always have to use a .long pseudo-op to do this because the native
|
||||
SVR4 ELF assembler is buggy and it generates incorrect values when we
|
||||
try to use the .float pseudo-op instead. */
|
||||
|
||||
#undef ASM_OUTPUT_FLOAT
|
||||
#define ASM_OUTPUT_FLOAT(FILE,VALUE) \
|
||||
do { long value; \
|
||||
REAL_VALUE_TO_TARGET_SINGLE ((VALUE), value); \
|
||||
if (sizeof (int) == sizeof (long)) \
|
||||
fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value); \
|
||||
else \
|
||||
fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value); \
|
||||
} while (0)
|
||||
|
||||
/* This is how to output assembly code to define a `double' constant.
|
||||
We always have to use a pair of .long pseudo-ops to do this because
|
||||
the native SVR4 ELF assembler is buggy and it generates incorrect
|
||||
values when we try to use the .double pseudo-op instead. */
|
||||
|
||||
#undef ASM_OUTPUT_DOUBLE
|
||||
#define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
|
||||
do { long value[2]; \
|
||||
REAL_VALUE_TO_TARGET_DOUBLE ((VALUE), value); \
|
||||
if (sizeof (int) == sizeof (long)) \
|
||||
{ \
|
||||
fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[0]); \
|
||||
fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[1]); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[0]); \
|
||||
fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[1]); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
|
||||
#undef ASM_OUTPUT_LONG_DOUBLE
|
||||
#define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE) \
|
||||
do { long value[3]; \
|
||||
REAL_VALUE_TO_TARGET_LONG_DOUBLE ((VALUE), value); \
|
||||
if (sizeof (int) == sizeof (long)) \
|
||||
{ \
|
||||
fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[0]); \
|
||||
fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[1]); \
|
||||
fprintf((FILE), "%s\t0x%x\n", ASM_LONG, value[2]); \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[0]); \
|
||||
fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[1]); \
|
||||
fprintf((FILE), "%s\t0x%lx\n", ASM_LONG, value[2]); \
|
||||
} \
|
||||
} 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 { \
|
||||
output_file_directive (FILE, main_input_filename); \
|
||||
fprintf (FILE, "\t.version\t\"01.01\"\n"); \
|
||||
} while (0)
|
||||
|
||||
/* Define the register numbers to be used in Dwarf debugging information.
|
||||
The SVR4 reference port C compiler uses the following register numbers
|
||||
in its Dwarf output code:
|
||||
|
||||
0 for %eax (gnu regno = 0)
|
||||
1 for %ecx (gnu regno = 2)
|
||||
2 for %edx (gnu regno = 1)
|
||||
3 for %ebx (gnu regno = 3)
|
||||
4 for %esp (gnu regno = 7)
|
||||
5 for %ebp (gnu regno = 6)
|
||||
6 for %esi (gnu regno = 4)
|
||||
7 for %edi (gnu regno = 5)
|
||||
|
||||
The following three DWARF register numbers are never generated by
|
||||
the SVR4 C compiler or by the GNU compilers, but SDB on x86/svr4
|
||||
believes these numbers have these meanings.
|
||||
|
||||
8 for %eip (no gnu equivalent)
|
||||
9 for %eflags (no gnu equivalent)
|
||||
10 for %trapno (no gnu equivalent)
|
||||
|
||||
It is not at all clear how we should number the FP stack registers
|
||||
for the x86 architecture. If the version of SDB on x86/svr4 were
|
||||
a bit less brain dead with respect to floating-point then we would
|
||||
have a precedent to follow with respect to DWARF register numbers
|
||||
for x86 FP registers, but the SDB on x86/svr4 is so completely
|
||||
broken with respect to FP registers that it is hardly worth thinking
|
||||
of it as something to strive for compatibility with.
|
||||
|
||||
The version of x86/svr4 SDB I have at the moment does (partially)
|
||||
seem to believe that DWARF register number 11 is associated with
|
||||
the x86 register %st(0), but that's about all. Higher DWARF
|
||||
register numbers don't seem to be associated with anything in
|
||||
particular, and even for DWARF regno 11, SDB only seems to under-
|
||||
stand that it should say that a variable lives in %st(0) (when
|
||||
asked via an `=' command) if we said it was in DWARF regno 11,
|
||||
but SDB still prints garbage when asked for the value of the
|
||||
variable in question (via a `/' command).
|
||||
|
||||
(Also note that the labels SDB prints for various FP stack regs
|
||||
when doing an `x' command are all wrong.)
|
||||
|
||||
Note that these problems generally don't affect the native SVR4
|
||||
C compiler because it doesn't allow the use of -O with -g and
|
||||
because when it is *not* optimizing, it allocates a memory
|
||||
location for each floating-point variable, and the memory
|
||||
location is what gets described in the DWARF AT_location
|
||||
attribute for the variable in question.
|
||||
|
||||
Regardless of the severe mental illness of the x86/svr4 SDB, we
|
||||
do something sensible here and we use the following DWARF
|
||||
register numbers. Note that these are all stack-top-relative
|
||||
numbers.
|
||||
|
||||
11 for %st(0) (gnu regno = 8)
|
||||
12 for %st(1) (gnu regno = 9)
|
||||
13 for %st(2) (gnu regno = 10)
|
||||
14 for %st(3) (gnu regno = 11)
|
||||
15 for %st(4) (gnu regno = 12)
|
||||
16 for %st(5) (gnu regno = 13)
|
||||
17 for %st(6) (gnu regno = 14)
|
||||
18 for %st(7) (gnu regno = 15)
|
||||
*/
|
||||
|
||||
#undef DBX_REGISTER_NUMBER
|
||||
#define DBX_REGISTER_NUMBER(n) \
|
||||
((n) == 0 ? 0 \
|
||||
: (n) == 1 ? 2 \
|
||||
: (n) == 2 ? 1 \
|
||||
: (n) == 3 ? 3 \
|
||||
: (n) == 4 ? 6 \
|
||||
: (n) == 5 ? 7 \
|
||||
: (n) == 6 ? 5 \
|
||||
: (n) == 7 ? 4 \
|
||||
: ((n) >= FIRST_STACK_REG && (n) <= LAST_STACK_REG) ? (n)+3 \
|
||||
: (-1))
|
||||
|
||||
/* The routine used to output sequences of byte values. We use a special
|
||||
version of this for most svr4 targets because doing so makes the
|
||||
generated assembly code more compact (and thus faster to assemble)
|
||||
as well as more readable. Note that if we find subparts of the
|
||||
character sequence which end with NUL (and which are shorter than
|
||||
STRING_LIMIT) we output those using ASM_OUTPUT_LIMITED_STRING. */
|
||||
|
||||
#undef ASM_OUTPUT_ASCII
|
||||
#define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
|
||||
do \
|
||||
{ \
|
||||
register unsigned char *_ascii_bytes = (unsigned char *) (STR); \
|
||||
register unsigned char *limit = _ascii_bytes + (LENGTH); \
|
||||
register unsigned bytes_in_chunk = 0; \
|
||||
for (; _ascii_bytes < limit; _ascii_bytes++) \
|
||||
{ \
|
||||
register unsigned char *p; \
|
||||
if (bytes_in_chunk >= 64) \
|
||||
{ \
|
||||
fputc ('\n', (FILE)); \
|
||||
bytes_in_chunk = 0; \
|
||||
} \
|
||||
for (p = _ascii_bytes; p < limit && *p != '\0'; p++) \
|
||||
continue; \
|
||||
if (p < limit && (p - _ascii_bytes) <= STRING_LIMIT) \
|
||||
{ \
|
||||
if (bytes_in_chunk > 0) \
|
||||
{ \
|
||||
fputc ('\n', (FILE)); \
|
||||
bytes_in_chunk = 0; \
|
||||
} \
|
||||
ASM_OUTPUT_LIMITED_STRING ((FILE), _ascii_bytes); \
|
||||
_ascii_bytes = p; \
|
||||
} \
|
||||
else \
|
||||
{ \
|
||||
if (bytes_in_chunk == 0) \
|
||||
fprintf ((FILE), "\t.byte\t"); \
|
||||
else \
|
||||
fputc (',', (FILE)); \
|
||||
fprintf ((FILE), "0x%02x", *_ascii_bytes); \
|
||||
bytes_in_chunk += 5; \
|
||||
} \
|
||||
} \
|
||||
if (bytes_in_chunk > 0) \
|
||||
fprintf ((FILE), "\n"); \
|
||||
} \
|
||||
while (0)
|
||||
|
||||
/* 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)
|
||||
|
||||
/* Indicate that jump tables go in the text section. This is
|
||||
necessary when compiling PIC code. */
|
||||
|
||||
#define JUMP_TABLES_IN_TEXT_SECTION 1
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user