diff -Nru ChangeLog ChangeLog --- ChangeLog 2010-10-14 22:28:01.000000000 +0200 +++ ChangeLog 2012-12-31 17:06:00.000000000 +0100 @@ -1,3 +1,27 @@ +2008-05-19 Release Manager + + * GCC 4.2.4 released. + +2008-03-13 David Edelsohn + + * ltcf-c.sh: Add AIX 6 support. + * ltcf-cxx.sh: Add AIX 6 support. + * ltcf-gcj.sh: Add AIX 6 support. + * ltconfig: Add AIX 6 support. + +2008-02-01 Release Manager + + * GCC 4.2.3 released. + +2007-10-07 Release Manager + + * GCC 4.2.2 released. + +2007-09-15 Alan Modra + + * configure.in: Correct makeinfo version check. + * configure: Regenerate. + 2007-07-19 Release Manager * GCC 4.2.1 released. @@ -2370,7 +2394,7 @@ of libf2c. * configure, Makefile.in: Regenerate. -2004-05-13 Tobias Schlüter +2004-05-13 Tobias Schl¼ter * MAINTAINERS (Write After Approval): Add myself. diff -Nru INSTALL/binaries.html INSTALL/binaries.html --- INSTALL/binaries.html 1970-01-01 01:00:00.000000000 +0100 +++ INSTALL/binaries.html 2012-12-31 17:06:08.000000000 +0100 @@ -0,0 +1,120 @@ + + +Installing GCC: Binaries + + + + + + + + + + +

Installing GCC: Binaries

+ +We are often asked about pre-compiled versions of GCC. While we cannot +provide these for all platforms, below you'll find links to binaries for +various platforms where creating them by yourself is not easy due to various +reasons. + +

Please note that we did not create these binaries, nor do we +support them. If you have any problems installing them, please +contact their makers. + +

+ +

In addition to those specific offerings, you can get a binary +distribution CD-ROM from the +Free Software Foundation. +It contains binaries for a number of platforms, and +includes not only GCC, but other stuff as well. The current CD does +not contain the latest version of GCC, but it should allow +bootstrapping the compiler. An updated version of that disk is in the +works. + +


+

Return to the GCC Installation page + + + + + + + + diff -Nru INSTALL/build.html INSTALL/build.html --- INSTALL/build.html 1970-01-01 01:00:00.000000000 +0100 +++ INSTALL/build.html 2012-12-31 17:06:08.000000000 +0100 @@ -0,0 +1,293 @@ + + +Installing GCC: Building + + + + + + + + + + +

Installing GCC: Building

+ +Now that GCC is configured, you are ready to build the compiler and +runtime libraries. + +

Some commands executed when making the compiler may fail (return a +nonzero status) and be ignored by make. These failures, which +are often due to files that were not found, are expected, and can safely +be ignored. + +

It is normal to have compiler warnings when compiling certain files. +Unless you are a GCC developer, you can generally ignore these warnings +unless they cause compilation to fail. Developers should attempt to fix +any warnings encountered, however they can temporarily continue past +warnings-as-errors by specifying the configure flag +--disable-werror. + +

On certain old systems, defining certain environment variables such as +CC can interfere with the functioning of make. + +

If you encounter seemingly strange errors when trying to build the +compiler in a directory other than the source directory, it could be +because you have previously configured the compiler in the source +directory. Make sure you have done all the necessary preparations. + +

If you build GCC on a BSD system using a directory stored in an old System +V file system, problems may occur in running fixincludes if the +System V file system doesn't support symbolic links. These problems +result in a failure to fix the declaration of size_t in +sys/types.h. If you find that size_t is a signed type and +that type mismatches occur, this could be the cause. + +

The solution is not to use such a directory for building GCC. + +

When building from SVN or snapshots, or if you modify parser sources, +you need the Bison parser generator installed. If you do not modify +parser sources, releases contain the Bison-generated files and you do +not need Bison installed to build them. + +

When building from SVN or snapshots, or if you modify Texinfo +documentation, you need version 4.4 or later of Texinfo installed if you +want Info documentation to be regenerated. Releases contain Info +documentation pre-built for the unmodified documentation in the release. + +

0.1 Building a native compiler

+ +

For a native build, the default configuration is to perform +a 3-stage bootstrap of the compiler when `make' is invoked. +This will build the entire GCC system and ensure that it compiles +itself correctly. It can be disabled with the --disable-bootstrap +parameter to `configure', but bootstrapping is suggested because +the compiler will be tested more completely and could also have +better performance. + +

The bootstrapping process will complete the following steps: + +

    +
  • Build tools necessary to build the compiler. + +
  • Perform a 3-stage bootstrap of the compiler. This includes building +three times the target tools for use by the compiler such as binutils +(bfd, binutils, gas, gprof, ld, and opcodes) if they have been +individually linked or moved into the top level GCC source tree before +configuring. + +
  • Perform a comparison test of the stage2 and stage3 compilers. + +
  • Build runtime libraries using the stage3 compiler from the previous step. + +
+ +

If you are short on disk space you might consider `make +bootstrap-lean' instead. The sequence of compilation is the +same described above, but object files from the stage1 and +stage2 of the 3-stage bootstrap of the compiler are deleted as +soon as they are no longer needed. + +

If you want to save additional space during the bootstrap and in +the final installation as well, you can build the compiler binaries +without debugging information as in the following example. This will save +roughly 40% of disk space both for the bootstrap and the final installation. +(Libraries will still contain debugging information.) + +

          make CFLAGS='-O' LIBCFLAGS='-g -O2' \
+            LIBCXXFLAGS='-g -O2 -fno-implicit-templates' bootstrap
+
+

If you wish to use non-default GCC flags when compiling the stage2 and +stage3 compilers, set BOOT_CFLAGS on the command line when doing +`make'. Non-default optimization flags are less well +tested here than the default of `-g -O2', but should still work. +In a few cases, you may find that you need to specify special flags such +as -msoft-float here to complete the bootstrap; or, if the +native compiler miscompiles the stage1 compiler, you may need to work +around this, by choosing BOOT_CFLAGS to avoid the parts of the +stage1 compiler that were miscompiled, or by using `make +bootstrap4' to increase the number of stages of bootstrap. + +

Note that using non-standard CFLAGS can cause bootstrap to fail +if these trigger a warning with the new compiler. For example using +`-O2 -g -mcpu=i686' on i686-pc-linux-gnu will cause bootstrap +failure as -mcpu= is deprecated in 3.4.0 and above. + +

If you used the flag --enable-languages=... to restrict +the compilers to be built, only those you've actually enabled will be +built. This will of course only build those runtime libraries, for +which the particular compiler has been built. Please note, +that re-defining LANGUAGES when calling `make' +does not work anymore! + +

If the comparison of stage2 and stage3 fails, this normally indicates +that the stage2 compiler has compiled GCC incorrectly, and is therefore +a potentially serious bug which you should investigate and report. (On +a few systems, meaningful comparison of object files is impossible; they +always appear “different”. If you encounter this problem, you will +need to disable comparison in the Makefile.) + +

If you do not want to bootstrap your compiler, you can configure with +--disable-bootstrap. In particular cases, you may want to +bootstrap your compiler even if the target system is not the same as +the one you are building on: for example, you could build a +powerpc-unknown-linux-gnu toolchain on a +powerpc64-unknown-linux-gnu host. In this case, pass +--enable-bootstrap to the configure script. + +

0.2 Building a cross compiler

+ +

When building a cross compiler, it is not generally possible to do a +3-stage bootstrap of the compiler. This makes for an interesting problem +as parts of GCC can only be built with GCC. + +

To build a cross compiler, we first recommend building and installing a +native compiler. You can then use the native GCC compiler to build the +cross compiler. The installed native compiler needs to be GCC version +2.95 or later. + +

Assuming you have already installed a native copy of GCC and configured +your cross compiler, issue the command make, which performs the +following steps: + +

    +
  • Build host tools necessary to build the compiler. + +
  • Build target tools for use by the compiler such as binutils (bfd, +binutils, gas, gprof, ld, and opcodes) +if they have been individually linked or moved into the top level GCC source +tree before configuring. + +
  • Build the compiler (single stage only). + +
  • Build runtime libraries using the compiler from the previous step. +
+ +

Note that if an error occurs in any step the make process will exit. + +

If you are not building GNU binutils in the same source tree as GCC, +you will need a cross-assembler and cross-linker installed before +configuring GCC. Put them in the directory +prefix/target/bin. Here is a table of the tools +you should put in this directory: + +

+
as
This should be the cross-assembler. + +
ld
This should be the cross-linker. + +
ar
This should be the cross-archiver: a program which can manipulate +archive files (linker libraries) in the target machine's format. + +
ranlib
This should be a program to construct a symbol table in an archive file. +
+ +

The installation of GCC will find these programs in that directory, +and copy or link them to the proper place to for the cross-compiler to +find them when run later. + +

The easiest way to provide these files is to build the Binutils package. +Configure it with the same --host and --target +options that you use for configuring GCC, then build and install +them. They install their executables automatically into the proper +directory. Alas, they do not support all the targets that GCC +supports. + +

If you are not building a C library in the same source tree as GCC, +you should also provide the target libraries and headers before +configuring GCC, specifying the directories with +--with-sysroot or --with-headers and +--with-libs. Many targets also require “start files” such +as crt0.o and +crtn.o which are linked into each executable. There may be several +alternatives for crt0.o, for use with profiling or other +compilation options. Check your target's definition of +STARTFILE_SPEC to find out what start files it uses. + +

0.3 Building in parallel

+ +

GNU Make 3.79 and above, which is necessary to build GCC, support +building in parallel. To activate this, you can use `make -j 2' +instead of `make'. You can also specify a bigger number, and +in most cases using a value greater than the number of processors in +your machine will result in fewer and shorter I/O latency hits, thus +improving overall throughput; this is especially true for slow drives +and network filesystems. + +

0.4 Building the Ada compiler

+ +

In order to build GNAT, the Ada compiler, you need a working GNAT +compiler (GNAT version 3.14 or later, or GCC version 3.1 or later). +This includes GNAT tools such as gnatmake and +gnatlink, since the Ada front end is written in Ada and +uses some GNAT-specific extensions. + +

In order to build a cross compiler, it is suggested to install +the new compiler as native first, and then use it to build the cross +compiler. + +

configure does not test whether the GNAT installation works +and has a sufficiently recent version; if too old a GNAT version is +installed, the build will fail unless --enable-languages is +used to disable building the Ada front end. + +

0.5 Building with profile feedback

+ +

It is possible to use profile feedback to optimize the compiler itself. This +should result in a faster compiler binary. Experiments done on x86 using gcc +3.3 showed approximately 7 percent speedup on compiling C programs. To +bootstrap the compiler with profile feedback, use make profiledbootstrap. + +

When `make profiledbootstrap' is run, it will first build a stage1 +compiler. This compiler is used to build a stageprofile compiler +instrumented to collect execution counts of instruction and branch +probabilities. Then runtime libraries are compiled with profile collected. +Finally a stagefeedback compiler is built using the information collected. + +

Unlike standard bootstrap, several additional restrictions apply. The +compiler used to build stage1 needs to support a 64-bit integral type. +It is recommended to only use GCC for this. Also parallel make is currently +not supported since collisions in profile collecting may occur. + +


+

Return to the GCC Installation page + + + + + + + + + + + diff -Nru INSTALL/configure.html INSTALL/configure.html --- INSTALL/configure.html 1970-01-01 01:00:00.000000000 +0100 +++ INSTALL/configure.html 2012-12-31 17:06:08.000000000 +0100 @@ -0,0 +1,919 @@ + + +Installing GCC: Configuration + + + + + + + + + + +

Installing GCC: Configuration

+ +Like most GNU software, GCC must be configured before it can be built. +This document describes the recommended configuration procedure +for both native and cross targets. + +

We use srcdir to refer to the toplevel source directory for +GCC; we use objdir to refer to the toplevel build/object directory. + +

If you obtained the sources via SVN, srcdir must refer to the top +gcc directory, the one where the MAINTAINERS can be found, +and not its gcc subdirectory, otherwise the build will fail. + +

If either srcdir or objdir is located on an automounted NFS +file system, the shell's built-in pwd command will return +temporary pathnames. Using these can lead to various sorts of build +problems. To avoid this issue, set the PWDCMD environment +variable to an automounter-aware pwd command, e.g., +pawd or `amq -w', during the configuration and build +phases. + +

First, we highly recommend that GCC be built into a +separate directory than the sources which does not reside +within the source tree. This is how we generally build GCC; building +where srcdir == objdir should still work, but doesn't +get extensive testing; building where objdir is a subdirectory +of srcdir is unsupported. + +

If you have previously built GCC in the same directory for a +different target machine, do `make distclean' to delete all files +that might be invalid. One of the files this deletes is Makefile; +if `make distclean' complains that Makefile does not exist +or issues a message like “don't know how to make distclean” it probably +means that the directory is already suitably clean. However, with the +recommended method of building in a separate objdir, you should +simply use a different objdir for each target. + +

Second, when configuring a native system, either cc or +gcc must be in your path or you must set CC in +your environment before running configure. Otherwise the configuration +scripts may fail. + +

To configure GCC: + +

        % mkdir objdir
+        % cd objdir
+        % srcdir/configure [options] [target]
+
+

Target specification

+ +
    +
  • GCC has code to correctly determine the correct value for target +for nearly all native systems. Therefore, we highly recommend you not +provide a configure target when configuring a native compiler. + +
  • target must be specified as --target=target +when configuring a cross compiler; examples of valid targets would be +m68k-coff, sh-elf, etc. + +
  • Specifying just target instead of --target=target +implies that the host defaults to target. +
+ +

Options specification

+ +

Use options to override several configure time options for +GCC. A list of supported options follows; `configure +--help' may list other options, but those not listed below may not +work and should not normally be used. + +

Note that each --enable option has a corresponding +--disable option and that each --with option has a +corresponding --without option. + +

+
--prefix=dirname
Specify the toplevel installation +directory. This is the recommended way to install the tools into a directory +other than the default. The toplevel installation directory defaults to +/usr/local. + +

We highly recommend against dirname being the same or a +subdirectory of objdir or vice versa. If specifying a directory +beneath a user's home directory tree, some shells will not expand +dirname correctly if it contains the `~' metacharacter; use +$HOME instead. + +

The following standard autoconf options are supported. Normally you +should not need to use these options. +

+
--exec-prefix=dirname
Specify the toplevel installation directory for architecture-dependent +files. The default is prefix. + +
--bindir=dirname
Specify the installation directory for the executables called by users +(such as gcc and g++). The default is +exec-prefix/bin. + +
--libdir=dirname
Specify the installation directory for object code libraries and +internal data files of GCC. The default is exec-prefix/lib. + +
--libexecdir=dirname
Specify the installation directory for internal executables of GCC. + The default is exec-prefix/libexec. + +
--with-slibdir=dirname
Specify the installation directory for the shared libgcc library. The +default is libdir. + +
--infodir=dirname
Specify the installation directory for documentation in info format. +The default is prefix/info. + +
--datadir=dirname
Specify the installation directory for some architecture-independent +data files referenced by GCC. The default is prefix/share. + +
--mandir=dirname
Specify the installation directory for manual pages. The default is +prefix/man. (Note that the manual pages are only extracts from +the full GCC manuals, which are provided in Texinfo format. The manpages +are derived by an automatic conversion process from parts of the full +manual.) + +
--with-gxx-include-dir=dirname
Specify +the installation directory for G++ header files. The default is +prefix/include/c++/version. + +
+ +
--program-prefix=prefix
GCC supports some transformations of the names of its programs when +installing them. This option prepends prefix to the names of +programs to install in bindir (see above). For example, specifying +--program-prefix=foo- would result in `gcc' +being installed as /usr/local/bin/foo-gcc. + +
--program-suffix=suffix
Appends suffix to the names of programs to install in bindir +(see above). For example, specifying --program-suffix=-3.1 +would result in `gcc' being installed as +/usr/local/bin/gcc-3.1. + +
--program-transform-name=pattern
Applies the `sed' script pattern to be applied to the names +of programs to install in bindir (see above). pattern has to +consist of one or more basic `sed' editing commands, separated by +semicolons. For example, if you want the `gcc' program name to be +transformed to the installed program /usr/local/bin/myowngcc and +the `g++' program name to be transformed to +/usr/local/bin/gspecial++ without changing other program names, +you could use the pattern +--program-transform-name='s/^gcc$/myowngcc/; s/^g++$/gspecial++/' +to achieve this effect. + +

All three options can be combined and used together, resulting in more +complex conversion patterns. As a basic rule, prefix (and +suffix) are prepended (appended) before further transformations +can happen with a special transformation script pattern. + +

As currently implemented, this option only takes effect for native +builds; cross compiler binaries' names are not transformed even when a +transformation is explicitly asked for by one of these options. + +

For native builds, some of the installed programs are also installed +with the target alias in front of their name, as in +`i686-pc-linux-gnu-gcc'. All of the above transformations happen +before the target alias is prepended to the name—so, specifying +--program-prefix=foo- and program-suffix=-3.1, the +resulting binary would be installed as +/usr/local/bin/i686-pc-linux-gnu-foo-gcc-3.1. + +

As a last shortcoming, none of the installed Ada programs are +transformed yet, which will be fixed in some time. + +

--with-local-prefix=dirname
Specify the +installation directory for local include files. The default is +/usr/local. Specify this option if you want the compiler to +search directory dirname/include for locally installed +header files instead of /usr/local/include. + +

You should specify --with-local-prefix only if your +site has a different convention (not /usr/local) for where to put +site-specific files. + +

The default value for --with-local-prefix is /usr/local +regardless of the value of --prefix. Specifying +--prefix has no effect on which directory GCC searches for +local header files. This may seem counterintuitive, but actually it is +logical. + +

The purpose of --prefix is to specify where to install +GCC. The local header files in /usr/local/include—if you put +any in that directory—are not part of GCC. They are part of other +programs—perhaps many others. (GCC installs its own header files in +another directory which is based on the --prefix value.) + +

Both the local-prefix include directory and the GCC-prefix include +directory are part of GCC's “system include” directories. Although these +two directories are not fixed, they need to be searched in the proper +order for the correct processing of the include_next directive. The +local-prefix include directory is searched before the GCC-prefix +include directory. Another characteristic of system include directories +is that pedantic warnings are turned off for headers in these directories. + +

Some autoconf macros add -I directory options to the +compiler command line, to ensure that directories containing installed +packages' headers are searched. When directory is one of GCC's +system include directories, GCC will ignore the option so that system +directories continue to be processed in the correct order. This +may result in a search order different from what was specified but the +directory will still be searched. + +

GCC automatically searches for ordinary libraries using +GCC_EXEC_PREFIX. Thus, when the same installation prefix is +used for both GCC and packages, GCC will automatically search for +both headers and libraries. This provides a configuration that is +easy to use. GCC behaves in a manner similar to that when it is +installed as a system compiler in /usr. + +

Sites that need to install multiple versions of GCC may not want to +use the above simple configuration. It is possible to use the +--program-prefix, --program-suffix and +--program-transform-name options to install multiple versions +into a single directory, but it may be simpler to use different prefixes +and the --with-local-prefix option to specify the location of the +site-specific files for each version. It will then be necessary for +users to specify explicitly the location of local site libraries +(e.g., with LIBRARY_PATH). + +

The same value can be used for both --with-local-prefix and +--prefix provided it is not /usr. This can be used +to avoid the default search of /usr/local/include. + +

Do not specify /usr as the --with-local-prefix! +The directory you use for --with-local-prefix must not +contain any of the system's standard header files. If it did contain +them, certain programs would be miscompiled (including GNU Emacs, on +certain targets), because this would override and nullify the header +file corrections made by the fixincludes script. + +

Indications are that people who use this option use it based on mistaken +ideas of what it is for. People use it as if it specified where to +install part of GCC. Perhaps they make this assumption because +installing GCC creates the directory. + +

--enable-shared[=package[,...]]
Build shared versions of libraries, if shared libraries are supported on +the target platform. Unlike GCC 2.95.x and earlier, shared libraries +are enabled by default on all platforms that support shared libraries. + +

If a list of packages is given as an argument, build shared libraries +only for the listed packages. For other packages, only static libraries +will be built. Package names currently recognized in the GCC tree are +`libgcc' (also known as `gcc'), `libstdc++' (not +`libstdc++-v3'), `libffi', `zlib', `boehm-gc', +`ada', `libada', `libjava' and `libobjc'. +Note `libiberty' does not support shared libraries at all. + +

Use --disable-shared to build only static libraries. Note that +--disable-shared does not accept a list of package names as +argument, only --enable-shared does. + +

--with-gnu-as
Specify that the compiler should assume that the +assembler it finds is the GNU assembler. However, this does not modify +the rules to find an assembler and will result in confusion if the +assembler found is not actually the GNU assembler. (Confusion may also +result if the compiler finds the GNU assembler but has not been +configured with --with-gnu-as.) If you have more than one +assembler installed on your system, you may want to use this option in +connection with --with-as=pathname or +--with-build-time-tools=pathname. + +

The following systems are the only ones where it makes a difference +whether you use the GNU assembler. On any other system, +--with-gnu-as has no effect. + +

    +
  • `hppa1.0-any-any' +
  • `hppa1.1-any-any' +
  • `i386-any-sysv' +
  • `m68k-bull-sysv' +
  • `m68k-hp-hpux' +
  • `m68000-hp-hpux' +
  • `m68000-att-sysv' +
  • `sparc-sun-solaris2.any' +
  • `sparc64-any-solaris2.any' +
+ +

On the systems listed above (except for the HP-PA, the SPARC, for ISC on +the 386, if you use the GNU assembler, you should also use the GNU linker +(and specify --with-gnu-ld). + +

--with-as=pathname
Specify that the compiler should use the assembler pointed to by +pathname, rather than the one found by the standard rules to find +an assembler, which are: +
    +
  • Unless GCC is being built with a cross compiler, check the +libexec/gcc/target/version directory. +libexec defaults to exec-prefix/libexec; +exec-prefix defaults to prefix, which +defaults to /usr/local unless overridden by the +--prefix=pathname switch described above. target +is the target system triple, such as `sparc-sun-solaris2.7', and +version denotes the GCC version, such as 3.0. + +
  • If the target system is the same that you are building on, check +operating system specific directories (e.g. /usr/ccs/bin on +Sun Solaris 2). + +
  • Check in the PATH for a tool whose name is prefixed by the +target system triple. + +
  • Check in the PATH for a tool whose name is not prefixed by the +target system triple, if the host and target system triple are +the same (in other words, we use a host tool if it can be used for +the target as well). +
+ +

You may want to use --with-as if no assembler +is installed in the directories listed above, or if you have multiple +assemblers installed and want to choose one that is not found by the +above rules. + +

--with-gnu-ld
Same as --with-gnu-as +but for the linker. + +
--with-ld=pathname
Same as --with-as +but for the linker. + +
--with-stabs
Specify that stabs debugging +information should be used instead of whatever format the host normally +uses. Normally GCC uses the same debug format as the host system. + +

On MIPS based systems and on Alphas, you must specify whether you want +GCC to create the normal ECOFF debugging format, or to use BSD-style +stabs passed through the ECOFF symbol table. The normal ECOFF debug +format cannot fully handle languages other than C. BSD stabs format can +handle other languages, but it only works with the GNU debugger GDB. + +

Normally, GCC uses the ECOFF debugging format by default; if you +prefer BSD stabs, specify --with-stabs when you configure GCC. + +

No matter which default you choose when you configure GCC, the user +can use the -gcoff and -gstabs+ options to specify explicitly +the debug format for a particular compilation. + +

--with-stabs is meaningful on the ISC system on the 386, also, if +--with-gas is used. It selects use of stabs debugging +information embedded in COFF output. This kind of debugging information +supports C++ well; ordinary COFF debugging information does not. + +

--with-stabs is also meaningful on 386 systems running SVR4. It +selects use of stabs debugging information embedded in ELF output. The +C++ compiler currently (2.6.0) does not support the DWARF debugging +information normally used on 386 SVR4 platforms; stabs provide a +workable alternative. This requires gas and gdb, as the normal SVR4 +tools can not generate or interpret stabs. + +

--disable-multilib
Specify that multiple target +libraries to support different target variants, calling +conventions, etc. should not be built. The default is to build a +predefined set of them. + +

Some targets provide finer-grained control over which multilibs are built +(e.g., --disable-softfloat): +

+
arc-*-elf*
biendian. + +
arm-*-*
fpu, 26bit, underscore, interwork, biendian, nofmult. + +
m68*-*-*
softfloat, m68881, m68000, m68020. + +
mips*-*-*
single-float, biendian, softfloat. + +
powerpc*-*-*, rs6000*-*-*
aix64, pthread, softfloat, powercpu, powerpccpu, powerpcos, biendian, +sysv, aix. + +
+ +
--enable-threads
Specify that the target +supports threads. This affects the Objective-C compiler and runtime +library, and exception handling for other languages like C++ and Java. +On some systems, this is the default. + +

In general, the best (and, in many cases, the only known) threading +model available will be configured for use. Beware that on some +systems, GCC has not been taught what threading models are generally +available for the system. In this case, --enable-threads is an +alias for --enable-threads=single. + +

--disable-threads
Specify that threading support should be disabled for the system. +This is an alias for --enable-threads=single. + +
--enable-threads=lib
Specify that +lib is the thread support library. This affects the Objective-C +compiler and runtime library, and exception handling for other languages +like C++ and Java. The possibilities for lib are: + +
+
aix
AIX thread support. +
dce
DCE thread support. +
gnat
Ada tasking support. For non-Ada programs, this setting is equivalent +to `single'. When used in conjunction with the Ada run time, it +causes GCC to use the same thread primitives as Ada uses. This option +is necessary when using both Ada and the back end exception handling, +which is the default for most Ada targets. +
mach
Generic MACH thread support, known to work on NeXTSTEP. (Please note +that the file needed to support this configuration, gthr-mach.h, is +missing and thus this setting will cause a known bootstrap failure.) +
no
This is an alias for `single'. +
posix
Generic POSIX/Unix98 thread support. +
posix95
Generic POSIX/Unix95 thread support. +
rtems
RTEMS thread support. +
single
Disable thread support, should work for all platforms. +
solaris
Sun Solaris 2 thread support. +
vxworks
VxWorks thread support. +
win32
Microsoft Win32 API thread support. +
nks
Novell Kernel Services thread support. +
+ +
--enable-tls
Specify that the target supports TLS (Thread Local Storage). Usually +configure can correctly determine if TLS is supported. In cases where +it guesses incorrectly, TLS can be explicitly enabled or disabled with +--enable-tls or --disable-tls. This can happen if +the assembler supports TLS but the C library does not, or if the +assumptions made by the configure test are incorrect. + +
--disable-tls
Specify that the target does not support TLS. +This is an alias for --enable-tls=no. + +
--with-cpu=cpu
Specify which cpu variant the compiler should generate code for by default. +cpu will be used as the default value of the -mcpu= switch. +This option is only supported on some targets, including ARM, i386, PowerPC, +and SPARC. + +
--with-schedule=cpu
--with-arch=cpu
--with-tune=cpu
--with-abi=abi
--with-fpu=type
--with-float=type
These configure options provide default values for the -mschedule=, +-march=, -mtune=, -mabi=, and -mfpu= +options and for -mhard-float or -msoft-float. As with +--with-cpu, which switches will be accepted and acceptable values +of the arguments depend on the target. + +
--with-mode=mode
Specify if the compiler should default to -marm or -mthumb. +This option is only supported on ARM targets. + +
--with-divide=type
Specify how the compiler should generate code for checking for +division by zero. This option is only supported on the MIPS target. +The possibilities for type are: +
+
traps
Division by zero checks use conditional traps (this is the default on +systems that support conditional traps). +
breaks
Division by zero checks use the break instruction. +
+ +
--enable-__cxa_atexit
Define if you want to use __cxa_atexit, rather than atexit, to +register C++ destructors for local statics and global objects. +This is essential for fully standards-compliant handling of +destructors, but requires __cxa_atexit in libc. This option is currently +only available on systems with GNU libc. When enabled, this will cause +-fuse-cxa-exit to be passed by default. + +
--enable-target-optspace
Specify that target +libraries should be optimized for code space instead of code speed. +This is the default for the m32r platform. + +
--disable-cpp
Specify that a user visible cpp program should not be installed. + +
--with-cpp-install-dir=dirname
Specify that the user visible cpp program should be installed +in prefix/dirname/cpp, in addition to bindir. + +
--enable-initfini-array
Force the use of sections .init_array and .fini_array +(instead of .init and .fini) for constructors and +destructors. Option --disable-initfini-array has the +opposite effect. If neither option is specified, the configure script +will try to guess whether the .init_array and +.fini_array sections are supported and, if they are, use them. + +
--enable-maintainer-mode
The build rules that +regenerate the GCC master message catalog gcc.pot are normally +disabled. This is because it can only be rebuilt if the complete source +tree is present. If you have changed the sources and want to rebuild the +catalog, configuring with --enable-maintainer-mode will enable +this. Note that you need a recent version of the gettext tools +to do so. + +
--disable-bootstrap
For a native build, the default configuration is to perform +a 3-stage bootstrap of the compiler when `make' is invoked, +testing that GCC can compile itself correctly. If you want to disable +this process, you can configure with --disable-bootstrap. + +
--enable-bootstrap
In special cases, you may want to perform a 3-stage build +even if the target and host triplets are different. +This could happen when the host can run code compiled for +the target (e.g. host is i686-linux, target is i486-linux). +Starting from GCC 4.2, to do this you have to configure explicitly +with --enable-bootstrap. + +
--enable-generated-files-in-srcdir
Neither the .c and .h files that are generated from Bison and flex nor the +info manuals and man pages that are built from the .texi files are present +in the SVN development tree. When building GCC from that development tree, +or from one of our snapshots, those generated files are placed in your +build directory, which allows for the source to be in a readonly +directory. + +

If you configure with --enable-generated-files-in-srcdir then those +generated files will go into the source directory. This is mainly intended +for generating release or prerelease tarballs of the GCC sources, since it +is not a requirement that the users of source releases to have flex, Bison, +or makeinfo. + +

--enable-version-specific-runtime-libs
Specify +that runtime libraries should be installed in the compiler specific +subdirectory (libdir/gcc) rather than the usual places. In +addition, `libstdc++''s include files will be installed into +libdir unless you overruled it by using +--with-gxx-include-dir=dirname. Using this option is +particularly useful if you intend to use several versions of GCC in +parallel. This is currently supported by `libgfortran', +`libjava', `libmudflap', `libstdc++', and `libobjc'. + +
--with-java-home=dirname
This `libjava' option overrides the default value of the +`java.home' system property. It is also used to set +`sun.boot.class.path' to dirname/lib/rt.jar. By +default `java.home' is set to prefix and +`sun.boot.class.path' to +datadir/java/libgcj-version.jar. + +
--enable-languages=lang1,lang2,...
Specify that only a particular subset of compilers and +their runtime libraries should be built. For a list of valid values for +langN you can issue the following command in the +gcc directory of your GCC source tree:
+
          grep language= */config-lang.in
+     
+

Currently, you can use any of the following: +all, ada, c, c++, fortran, java, +objc, obj-c++, treelang. +Building the Ada compiler has special requirements, see below. +If you do not pass this flag, or specify the option all, then all +default languages available in the gcc sub-tree will be configured. +Ada, Objective-C++, and treelang are not default languages; the rest are. +Re-defining LANGUAGES when calling `make' does not +work anymore, as those language sub-directories might not have been +configured! + +

--disable-libada
Specify that the run-time libraries and tools used by GNAT should not +be built. This can be useful for debugging, or for compatibility with +previous Ada build procedures, when it was required to explicitly +do a `make -C gcc gnatlib_and_tools'. + +
--disable-libssp
Specify that the run-time libraries for stack smashing protection +should not be built. + +
--disable-libgomp
Specify that the run-time libraries used by GOMP should not be built. + +
--with-dwarf2
Specify that the compiler should +use DWARF 2 debugging information as the default. + +
--enable-targets=all
--enable-targets=target_list
Some GCC targets, e.g. powerpc64-linux, build bi-arch compilers. +These are compilers that are able to generate either 64-bit or 32-bit +code. Typically, the corresponding 32-bit target, e.g. +powerpc-linux for powerpc64-linux, only generates 32-bit code. This +option enables the 32-bit target to be a bi-arch compiler, which is +useful when you want a bi-arch compiler that defaults to 32-bit, and +you are building a bi-arch or multi-arch binutils in a combined tree. +Currently, this option only affects powerpc-linux. + +
--enable-secureplt
This option enables -msecure-plt by default for powerpc-linux. +See “RS/6000 and PowerPC Options” in the main manual + +
--enable-win32-registry
--enable-win32-registry=key
--disable-win32-registry
The --enable-win32-registry option enables Microsoft Windows-hosted GCC +to look up installations paths in the registry using the following key: + +
          HKEY_LOCAL_MACHINE\SOFTWARE\Free Software Foundation\key
+     
+

key defaults to GCC version number, and can be overridden by the +--enable-win32-registry=key option. Vendors and distributors +who use custom installers are encouraged to provide a different key, +perhaps one comprised of vendor name and GCC version number, to +avoid conflict with existing installations. This feature is enabled +by default, and can be disabled by --disable-win32-registry +option. This option has no effect on the other hosts. + +

--nfp
Specify that the machine does not have a floating point unit. This +option only applies to `m68k-sun-sunosn'. On any other +system, --nfp has no effect. + +
--enable-werror
--disable-werror
--enable-werror=yes
--enable-werror=no
When you specify this option, it controls whether certain files in the +compiler are built with -Werror in bootstrap stage2 and later. +If you don't specify it, -Werror is turned on for the main +development trunk. However it defaults to off for release branches and +final releases. The specific files which get -Werror are +controlled by the Makefiles. + +
--enable-checking
--enable-checking=list
When you specify this option, the compiler is built to perform internal +consistency checks of the requested complexity. This does not change the +generated code, but adds error checking within the compiler. This will +slow down the compiler and may only work properly if you are building +the compiler with GCC. This is `yes' by default when building +from SVN or snapshots, but `release' for releases. More control +over the checks may be had by specifying list. The categories of +checks available are `yes' (most common checks +`assert,misc,tree,gc,rtlflag,runtime'), `no' (no checks at +all), `all' (all but `valgrind'), `release' (cheapest +checks `assert,runtime') or `none' (same as `no'). +Individual checks can be enabled with these flags `assert', +`fold', `gc', `gcac' `misc', `rtl', +`rtlflag', `runtime', `tree', and `valgrind'. + +

The `valgrind' check requires the external valgrind +simulator, available from http://valgrind.org/. The +`rtl', `gcac' and `valgrind' checks are very expensive. +To disable all checking, `--disable-checking' or +`--enable-checking=none' must be explicitly requested. Disabling +assertions will make the compiler and runtime slightly faster but +increase the risk of undetected internal errors causing wrong code to be +generated. + +

--enable-coverage
--enable-coverage=level
With this option, the compiler is built to collect self coverage +information, every time it is run. This is for internal development +purposes, and only works when the compiler is being built with gcc. The +level argument controls whether the compiler is built optimized or +not, values are `opt' and `noopt'. For coverage analysis you +want to disable optimization, for performance analysis you want to +enable optimization. When coverage is enabled, the default level is +without optimization. + +
--enable-gather-detailed-mem-stats
When this option is specified more detailed information on memory +allocation is gathered. This information is printed when using +-fmem-report. + +
--with-gc
--with-gc=choice
With this option you can specify the garbage collector implementation +used during the compilation process. choice can be one of +`page' and `zone', where `page' is the default. + +
--enable-nls
--disable-nls
The --enable-nls option enables Native Language Support (NLS), +which lets GCC output diagnostics in languages other than American +English. Native Language Support is enabled by default if not doing a +canadian cross build. The --disable-nls option disables NLS. + +
--with-included-gettext
If NLS is enabled, the --with-included-gettext option causes the build +procedure to prefer its copy of GNU gettext. + +
--with-catgets
If NLS is enabled, and if the host lacks gettext but has the +inferior catgets interface, the GCC build procedure normally +ignores catgets and instead uses GCC's copy of the GNU +gettext library. The --with-catgets option causes the +build procedure to use the host's catgets in this situation. + +
--with-libiconv-prefix=dir
Search for libiconv header files in dir/include and +libiconv library files in dir/lib. + +
--enable-obsolete
Enable configuration for an obsoleted system. If you attempt to +configure GCC for a system (build, host, or target) which has been +obsoleted, and you do not specify this flag, configure will halt with an +error message. + +

All support for systems which have been obsoleted in one release of GCC +is removed entirely in the next major release, unless someone steps +forward to maintain the port. + +

--enable-decimal-float
--disable-decimal-float
Enable (or disable) support for the C decimal floating point +extension. This is enabled by default only on PowerPC GNU/Linux +systems. Other systems may also support it, but require the user to +specifically enable it. + +
--with-long-double-128
Specify if long double type should be 128-bit by default on selected +GNU/Linux architectures. If using --without-long-double-128, +long double will be by default 64-bit, the same as double type. +When neither of these configure options are used, the default will be +128-bit long double when built against GNU C Library 2.4 and later, +64-bit long double otherwise. + +
+ +

Cross-Compiler-Specific Options

+ +

The following options only apply to building cross compilers. +

+
--with-sysroot
--with-sysroot=dir
Tells GCC to consider dir as the root of a tree that contains a +(subset of) the root filesystem of the target operating system. +Target system headers, libraries and run-time object files will be +searched in there. The specified directory is not copied into the +install tree, unlike the options --with-headers and +--with-libs that this option obsoletes. The default value, +in case --with-sysroot is not given an argument, is +${gcc_tooldir}/sys-root. If the specified directory is a +subdirectory of ${exec_prefix}, then it will be found relative to +the GCC binaries if the installation tree is moved. + +
--with-build-sysroot
--with-build-sysroot=dir
Tells GCC to consider dir as the system root (see +--with-sysroot) while building target libraries, instead of +the directory specified with --with-sysroot. This option is +only useful when you are already using --with-sysroot. You +can use --with-build-sysroot when you are configuring with +--prefix set to a directory that is different from the one in +which you are installing GCC and your target libraries. + +

This option affects the system root for the compiler used to build +target libraries (which runs on the build system); it does not affect +the compiler which is used to build GCC itself. + +

--with-headers
--with-headers=dir
Deprecated in favor of --with-sysroot. +Specifies that target headers are available when building a cross compiler. +The dir argument specifies a directory which has the target include +files. These include files will be copied into the gcc install +directory. This option with the dir argument is required when +building a cross compiler, if prefix/target/sys-include +doesn't pre-exist. If prefix/target/sys-include does +pre-exist, the dir argument may be omitted. fixincludes +will be run on these files to make them compatible with GCC. + +
--without-headers
Tells GCC not use any target headers from a libc when building a cross +compiler. When crossing to GNU/Linux, you need the headers so GCC +can build the exception handling for libgcc. + +
--with-libs
--with-libs=``dir1 dir2 ... dirN''
Deprecated in favor of --with-sysroot. +Specifies a list of directories which contain the target runtime +libraries. These libraries will be copied into the gcc install +directory. If the directory list is omitted, this option has no +effect. + +
--with-newlib
Specifies that `newlib' is +being used as the target C library. This causes __eprintf to be +omitted from libgcc.a on the assumption that it will be provided by +`newlib'. + +
--with-build-time-tools=dir
Specifies where to find the set of target tools (assembler, linker, etc.) +that will be used while building GCC itself. This option can be useful +if the directory layouts are different between the system you are building +GCC on, and the system where you will deploy it. + +

For example, on a ia64-hp-hpux system, you may have the GNU +assembler and linker in /usr/bin, and the native tools in a +different path, and build a toolchain that expects to find the +native tools in /usr/bin. + +

When you use this option, you should ensure that dir includes +ar, as, ld, nm, +ranlib and strip if necessary, and possibly +objdump. Otherwise, GCC may use an inconsistent set of +tools. +

+ +

Fortran-Specific Options

+ +

The following options apply to the build of the Fortran front end. + +

+
--with-gmp=pathname
--with-gmp-include=pathname
--with-gmp-lib=pathname
--with-mpfr=pathname
--with-mpfr-include=pathname
--with-mpfr-lib=pathname
If you do not have GMP (the GNU Multiple Precision library) and the +MPFR Libraries installed in a standard location and you want to build +the Fortran front-end, you can explicitly specify the directory where +they are installed (`--with-gmp=gmpinstalldir', +`--with-mpfr=mpfrinstalldir'). The +--with-gmp=gmpinstalldir option is shorthand for +--with-gmp-lib=gmpinstalldir/lib and +--with-gmp-include=gmpinstalldir/include. Likewise the +--with-mpfr=mpfrinstalldir option is shorthand for +--with-mpfr-lib=mpfrinstalldir/lib and +--with-mpfr-include=mpfrinstalldir/include. If these +shorthand assumptions are not correct, you can use the explicit +include and lib options directly. + +
+ +

Java-Specific Options

+ +

The following option applies to the build of the Java front end. + +

+
--disable-libgcj
Specify that the run-time libraries +used by GCJ should not be built. This is useful in case you intend +to use GCJ with some other run-time, or you're going to install it +separately, or it just happens not to build on your particular +machine. In general, if the Java front end is enabled, the GCJ +libraries will be enabled too, unless they're known to not work on +the target platform. If GCJ is enabled but `libgcj' isn't built, you +may need to port it; in this case, before modifying the top-level +configure.in so that `libgcj' is enabled by default on this platform, +you may use --enable-libgcj to override the default. + +
+ +

The following options apply to building `libgcj'. + +

General Options
+ +
+
--disable-getenv-properties
Don't set system properties from GCJ_PROPERTIES. + +
--enable-hash-synchronization
Use a global hash table for monitor locks. Ordinarily, +`libgcj''s `configure' script automatically makes +the correct choice for this option for your platform. Only use +this if you know you need the library to be configured differently. + +
--enable-interpreter
Enable the Java interpreter. The interpreter is automatically +enabled by default on all platforms that support it. This option +is really only useful if you want to disable the interpreter +(using --disable-interpreter). + +
--disable-java-net
Disable java.net. This disables the native part of java.net only, +using non-functional stubs for native method implementations. + +
--disable-jvmpi
Disable JVMPI support. + +
--with-ecos
Enable runtime eCos target support. + +
--without-libffi
Don't use `libffi'. This will disable the interpreter and JNI +support as well, as these require `libffi' to work. + +
--enable-libgcj-debug
Enable runtime debugging code. + +
--enable-libgcj-multifile
If specified, causes all .java source files to be +compiled into .class files in one invocation of +`gcj'. This can speed up build time, but is more +resource-intensive. If this option is unspecified or +disabled, `gcj' is invoked once for each .java +file to compile into a .class file. + +
--with-libiconv-prefix=DIR
Search for libiconv in DIR/include and DIR/lib. + +
--enable-sjlj-exceptions
Force use of the setjmp/longjmp-based scheme for exceptions. +`configure' ordinarily picks the correct value based on the platform. +Only use this option if you are sure you need a different setting. + +
--with-system-zlib
Use installed `zlib' rather than that included with GCC. + +
--with-win32-nlsapi=ansi, unicows or unicode
Indicates how MinGW `libgcj' translates between UNICODE +characters and the Win32 API. +
+
ansi
Use the single-byte char and the Win32 A functions natively, +translating to and from UNICODE when using these functions. If +unspecified, this is the default. + +
unicows
Use the WCHAR and Win32 W functions natively. Adds +-lunicows to libgcj.spec to link with `libunicows'. +unicows.dll needs to be deployed on Microsoft Windows 9X machines +running built executables. libunicows.a, an open-source +import library around Microsoft's unicows.dll, is obtained from +http://libunicows.sourceforge.net/, which also gives details +on getting unicows.dll from Microsoft. + +
unicode
Use the WCHAR and Win32 W functions natively. Does not +add -lunicows to libgcj.spec. The built executables will +only run on Microsoft Windows NT and above. +
+
+ +
AWT-Specific Options
+ +
+
--with-x
Use the X Window System. + +
--enable-java-awt=PEER(S)
Specifies the AWT peer library or libraries to build alongside +`libgcj'. If this option is unspecified or disabled, AWT +will be non-functional. Current valid values are gtk and +xlib. Multiple libraries should be separated by a +comma (i.e. --enable-java-awt=gtk,xlib). + +
--enable-gtk-cairo
Build the cairo Graphics2D implementation on GTK. + +
--enable-java-gc=TYPE
Choose garbage collector. Defaults to boehm if unspecified. + +
--disable-gtktest
Do not try to compile and run a test GTK+ program. + +
--disable-glibtest
Do not try to compile and run a test GLIB program. + +
--with-libart-prefix=PFX
Prefix where libart is installed (optional). + +
--with-libart-exec-prefix=PFX
Exec prefix where libart is installed (optional). + +
--disable-libarttest
Do not try to compile and run a test libart program. + +
+ +


+

Return to the GCC Installation page + + + + + + + + + + + + diff -Nru INSTALL/download.html INSTALL/download.html --- INSTALL/download.html 1970-01-01 01:00:00.000000000 +0100 +++ INSTALL/download.html 2012-12-31 17:06:08.000000000 +0100 @@ -0,0 +1,90 @@ + + +Downloading GCC + + + + + + + + + + +

Downloading GCC

+ +GCC is distributed via SVN and FTP +tarballs compressed with gzip or +bzip2. It is possible to download a full distribution or specific +components. + +

Please refer to the releases web page +for information on how to obtain GCC. + +

The full distribution includes the C, C++, Objective-C, Fortran, Java, +and Ada (in the case of GCC 3.1 and later) compilers. The full +distribution also includes runtime libraries for C++, Objective-C, +Fortran, and Java. In GCC 3.0 and later versions, the GNU compiler +testsuites are also included in the full distribution. + +

If you choose to download specific components, you must download the core +GCC distribution plus any language specific distributions you wish to +use. The core distribution includes the C language front end as well as the +shared components. Each language has a tarball which includes the language +front end as well as the language runtime (when appropriate). + +

Unpack the core distribution as well as any language specific +distributions in the same directory. + +

If you also intend to build binutils (either to upgrade an existing +installation or for use in place of the corresponding tools of your +OS), unpack the binutils distribution either in the same directory or +a separate one. In the latter case, add symbolic links to any +components of the binutils you intend to build alongside the compiler +(bfd, binutils, gas, gprof, ld, +opcodes, ...) to the directory containing the GCC sources. + +


+

Return to the GCC Installation page + + + + + + + + + + + + + diff -Nru INSTALL/finalinstall.html INSTALL/finalinstall.html --- INSTALL/finalinstall.html 1970-01-01 01:00:00.000000000 +0100 +++ INSTALL/finalinstall.html 2012-12-31 17:06:08.000000000 +0100 @@ -0,0 +1,166 @@ + + +Installing GCC: Final installation + + + + + + + + + + +

Installing GCC: Final installation

+Now that GCC has been built (and optionally tested), you can install it with +
     cd objdir; make install
+
+

We strongly recommend to install into a target directory where there is +no previous version of GCC present. + +

That step completes the installation of GCC; user level binaries can +be found in prefix/bin where prefix is the value +you specified with the --prefix to configure (or +/usr/local by default). (If you specified --bindir, +that directory will be used instead; otherwise, if you specified +--exec-prefix, exec-prefix/bin will be used.) +Headers for the C++ and Java libraries are installed in +prefix/include; libraries in libdir +(normally prefix/lib); internal parts of the compiler in +libdir/gcc and libexecdir/gcc; documentation +in info format in infodir (normally +prefix/info). + +

When installing cross-compilers, GCC's executables +are not only installed into bindir, that +is, exec-prefix/bin, but additionally into +exec-prefix/target-alias/bin, if that directory +exists. Typically, such tooldirs hold target-specific +binutils, including assembler and linker. + +

Installation into a temporary staging area or into a chroot +jail can be achieved with the command + +

     make DESTDIR=path-to-rootdir install
+
+

where path-to-rootdir is the absolute path of +a directory relative to which all installation paths will be +interpreted. Note that the directory specified by DESTDIR +need not exist yet; it will be created if necessary. + +

There is a subtle point with tooldirs and DESTDIR: +If you relocate a cross-compiler installation with +e.g. `DESTDIR=rootdir', then the directory +rootdir/exec-prefix/target-alias/bin will +be filled with duplicated GCC executables only if it already exists, +it will not be created otherwise. This is regarded as a feature, +not as a bug, because it gives slightly more control to the packagers +using the DESTDIR feature. + +

If you are bootstrapping a released version of GCC then please +quickly review the build status page for your release, available from +http://gcc.gnu.org/buildstat.html. +If your system is not listed for the version of GCC that you built, +send a note to +gcc@gcc.gnu.org indicating +that you successfully built and installed GCC. +Include the following information: + +

    +
  • Output from running srcdir/config.guess. Do not send +that file itself, just the one-line output from running it. + +
  • The output of `gcc -v' for your newly installed gcc. +This tells us which version of GCC you built and the options you passed to +configure. + +
  • Whether you enabled all languages or a subset of them. If you used a +full distribution then this information is part of the configure +options in the output of `gcc -v', but if you downloaded the +“core” compiler plus additional front ends then it isn't apparent +which ones you built unless you tell us about it. + +
  • If the build was for GNU/Linux, also include: +
      +
    • The distribution name and version (e.g., Red Hat 7.1 or Debian 2.2.3); +this information should be available from /etc/issue. + +
    • The version of the Linux kernel, available from `uname --version' +or `uname -a'. + +
    • The version of glibc you used; for RPM-based systems like Red Hat, +Mandrake, and SuSE type `rpm -q glibc' to get the glibc version, +and on systems like Debian and Progeny use `dpkg -l libc6'. +
    + For other systems, you can include similar information if you think it is +relevant. + +
  • Any other information that you think would be useful to people building +GCC on the same configuration. The new entry in the build status list +will include a link to the archived copy of your message. +
+ +

We'd also like to know if the +host/target specific installation notes +didn't include your host/target information or if that information is +incomplete or out of date. Send a note to +gcc@gcc.gnu.org detailing how the information should be changed. + +

If you find a bug, please report it following the +bug reporting guidelines. + +

If you want to print the GCC manuals, do `cd objdir; make +dvi'. You will need to have texi2dvi (version at least 4.4) +and TeX installed. This creates a number of .dvi files in +subdirectories of objdir; these may be converted for +printing with programs such as dvips. Alternately, by using +`make pdf' in place of `make dvi', you can create documentation +in the form of .pdf files; this requires texi2pdf, which +is included with Texinfo version 4.8 and later. You can also +buy printed manuals from the Free Software Foundation, though such manuals may not be for the most +recent version of GCC. + +

If you would like to generate online HTML documentation, do `cd +objdir; make html' and HTML will be generated for the gcc manuals in +objdir/gcc/HTML. + +


+

Return to the GCC Installation page + + + + + + + + + diff -Nru INSTALL/gfdl.html INSTALL/gfdl.html --- INSTALL/gfdl.html 1970-01-01 01:00:00.000000000 +0100 +++ INSTALL/gfdl.html 2012-12-31 17:06:08.000000000 +0100 @@ -0,0 +1,462 @@ + + +Installing GCC: GNU Free Documentation License + + + + + + + + + + +

Installing GCC: GNU Free Documentation License

+

Installing GCC: GNU Free Documentation License

+ +

Version 1.2, November 2002
+ +
     Copyright © 2000,2001,2002 Free Software Foundation, Inc.
+     51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+     
+     Everyone is permitted to copy and distribute verbatim copies
+     of this license document, but changing it is not allowed.
+
+
    +
  1. PREAMBLE + +

    The purpose of this License is to make a manual, textbook, or other +functional and useful document free in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +

    This License is a kind of “copyleft”, which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +

    We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + +

  2. APPLICABILITY AND DEFINITIONS + +

    This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The “Document”, below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as “you”. You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +

    A “Modified Version” of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +

    A “Secondary Section” is a named appendix or a front-matter section +of the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +

    The “Invariant Sections” are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +

    The “Cover Texts” are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +

    A “Transparent” copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not “Transparent” is called “Opaque”. + +

    Examples of suitable formats for Transparent copies include plain +ascii without markup, Texinfo input format, LaTeX input +format, SGML or XML using a publicly available +DTD, and standard-conforming simple HTML, +PostScript or PDF designed for human modification. Examples +of transparent image formats include PNG, XCF and +JPG. Opaque formats include proprietary formats that can be +read and edited only by proprietary word processors, SGML or +XML for which the DTD and/or processing tools are +not generally available, and the machine-generated HTML, +PostScript or PDF produced by some word processors for +output purposes only. + +

    The “Title Page” means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, “Title Page” means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +

    A section “Entitled XYZ” means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as “Acknowledgements”, +“Dedications”, “Endorsements”, or “History”.) To “Preserve the Title” +of such a section when you modify the Document means that it remains a +section “Entitled XYZ” according to this definition. + +

    The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + +

  3. VERBATIM COPYING + +

    You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +

    You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + +

  4. COPYING IN QUANTITY + +

    If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +

    If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +

    If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +

    It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + +

  5. MODIFICATIONS + +

    You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +

      +
    1. Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. + +
    2. List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has fewer than five), +unless they release you from this requirement. + +
    3. State on the Title page the name of the publisher of the +Modified Version, as the publisher. + +
    4. Preserve all the copyright notices of the Document. + +
    5. Add an appropriate copyright notice for your modifications +adjacent to the other copyright notices. + +
    6. Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. + +
    7. Preserve in that license notice the full lists of Invariant Sections +and required Cover Texts given in the Document's license notice. + +
    8. Include an unaltered copy of this License. + +
    9. Preserve the section Entitled “History”, Preserve its Title, and add +to it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section Entitled “History” in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. + +
    10. Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise +the network locations given in the Document for previous versions +it was based on. These may be placed in the “History” section. +You may omit a network location for a work that was published at +least four years before the Document itself, or if the original +publisher of the version it refers to gives permission. + +
    11. For any section Entitled “Acknowledgements” or “Dedications”, Preserve +the Title of the section, and preserve in the section all the +substance and tone of each of the contributor acknowledgements and/or +dedications given therein. + +
    12. Preserve all the Invariant Sections of the Document, +unaltered in their text and in their titles. Section numbers +or the equivalent are not considered part of the section titles. + +
    13. Delete any section Entitled “Endorsements”. Such a section +may not be included in the Modified Version. + +
    14. Do not retitle any existing section to be Entitled “Endorsements” or +to conflict in title with any Invariant Section. + +
    15. Preserve any Warranty Disclaimers. +
    + +

    If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +

    You may add a section Entitled “Endorsements”, provided it contains +nothing but endorsements of your Modified Version by various +parties—for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +

    You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +

    The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + +

  6. COMBINING DOCUMENTS + +

    You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +

    The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +

    In the combination, you must combine any sections Entitled “History” +in the various original documents, forming one section Entitled +“History”; likewise combine any sections Entitled “Acknowledgements”, +and any sections Entitled “Dedications”. You must delete all +sections Entitled “Endorsements.” + +

  7. COLLECTIONS OF DOCUMENTS + +

    You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +

    You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + +

  8. AGGREGATION WITH INDEPENDENT WORKS + +

    A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an “aggregate” if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +

    If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + +

  9. TRANSLATION + +

    Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +

    If a section in the Document is Entitled “Acknowledgements”, +“Dedications”, or “History”, the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + +

  10. TERMINATION + +

    You may not copy, modify, sublicense, or distribute the Document except +as expressly provided for under this License. Any other attempt to +copy, modify, sublicense or distribute the Document is void, and will +automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such +parties remain in full compliance. + +

  11. FUTURE REVISIONS OF THIS LICENSE + +

    The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. + +

    Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License “or any later version” applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. +

+ +

ADDENDUM: How to use this License for your documents

+ +

To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + +

       Copyright (C)  year  your name.
+       Permission is granted to copy, distribute and/or modify this document
+       under the terms of the GNU Free Documentation License, Version 1.2
+       or any later version published by the Free Software Foundation;
+       with no Invariant Sections, no Front-Cover Texts, and no Back-Cover
+       Texts.  A copy of the license is included in the section entitled ``GNU
+       Free Documentation License''.
+
+

If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the “with...Texts.” line with this: + +

         with the Invariant Sections being list their titles, with
+         the Front-Cover Texts being list, and with the Back-Cover Texts
+         being list.
+
+

If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +

If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. + + + + + +


+

Return to the GCC Installation page + + + + + diff -Nru INSTALL/index.html INSTALL/index.html --- INSTALL/index.html 1970-01-01 01:00:00.000000000 +0100 +++ INSTALL/index.html 2012-12-31 17:06:08.000000000 +0100 @@ -0,0 +1,123 @@ + + +Installing GCC + + + + + + + + + + +

Installing GCC

+The latest version of this document is always available at +http://gcc.gnu.org/install/. + +

This document describes the generic installation procedure for GCC as well +as detailing some target specific installation instructions. + +

GCC includes several components that previously were separate distributions +with their own installation instructions. This document supersedes all +package specific installation instructions. + +

Before starting the build/install procedure please check the +host/target specific installation notes. +We recommend you browse the entire generic installation instructions before +you proceed. + +

Lists of successful builds for released versions of GCC are +available at http://gcc.gnu.org/buildstat.html. +These lists are updated as new information becomes available. + +

The installation procedure itself is broken into five steps. + +

    +
  1. Prerequisites +
  2. Downloading the source +
  3. Configuration +
  4. Building +
  5. Testing (optional) +
  6. Final install +
+ +

Please note that GCC does not support `make uninstall' and probably +won't do so in the near future as this would open a can of worms. Instead, +we suggest that you install GCC into a directory of its own and simply +remove that directory when you do not need that specific version of GCC +any longer, and, if shared libraries are installed there as well, no +more binaries exist that use them. + +

There are also some old installation instructions, +which are mostly obsolete but still contain some information which has +not yet been merged into the main part of this manual. + +


+

Return to the GCC Installation page + +

Copyright © 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, +1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +

+
+
+Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no +Invariant Sections, the Front-Cover texts being (a) (see below), and +with the Back-Cover Texts being (b) (see below). A copy of the +license is included in the section entitled “GNU Free Documentation License”. + +

(a) The FSF's Front-Cover Text is: + +

A GNU Manual + +

(b) The FSF's Back-Cover Text is: + +

You have freedom to copy and modify this GNU Manual, like GNU + software. Copies published by the Free Software Foundation raise + funds for GNU development. + + + + + + + + + + + + + + + diff -Nru INSTALL/old.html INSTALL/old.html --- INSTALL/old.html 1970-01-01 01:00:00.000000000 +0100 +++ INSTALL/old.html 2012-12-31 17:06:08.000000000 +0100 @@ -0,0 +1,212 @@ + + +Installing GCC: Old documentation + + + + + + + + + + +

Installing GCC: Old documentation

+

Old installation documentation

+ +

Note most of this information is out of date and superseded by the +previous chapters of this manual. It is provided for historical +reference only, because of a lack of volunteers to merge it into the +main manual. + +

Here is the procedure for installing GCC on a GNU or Unix system. + +

    +
  1. If you have chosen a configuration for GCC which requires other GNU +tools (such as GAS or the GNU linker) instead of the standard system +tools, install the required tools in the build directory under the names +as, ld or whatever is appropriate. + +

    Alternatively, you can do subsequent compilation using a value of the +PATH environment variable such that the necessary GNU tools come +before the standard system tools. + +

  2. Specify the host, build and target machine configurations. You do this +when you run the configure script. + +

    The build machine is the system which you are using, the +host machine is the system where you want to run the resulting +compiler (normally the build machine), and the target machine is +the system for which you want the compiler to generate code. + +

    If you are building a compiler to produce code for the machine it runs +on (a native compiler), you normally do not need to specify any operands +to configure; it will try to guess the type of machine you are on +and use that as the build, host and target machines. So you don't need +to specify a configuration when building a native compiler unless +configure cannot figure out what your configuration is or guesses +wrong. + +

    In those cases, specify the build machine's configuration name +with the --host option; the host and target will default to be +the same as the host machine. + +

    Here is an example: + +

              ./configure --host=sparc-sun-sunos4.1
    +     
    +

    A configuration name may be canonical or it may be more or less +abbreviated. + +

    A canonical configuration name has three parts, separated by dashes. +It looks like this: `cpu-company-system'. +(The three parts may themselves contain dashes; configure +can figure out which dashes serve which purpose.) For example, +`m68k-sun-sunos4.1' specifies a Sun 3. + +

    You can also replace parts of the configuration by nicknames or aliases. +For example, `sun3' stands for `m68k-sun', so +`sun3-sunos4.1' is another way to specify a Sun 3. + +

    You can specify a version number after any of the system types, and some +of the CPU types. In most cases, the version is irrelevant, and will be +ignored. So you might as well specify the version if you know it. + +

    See Configurations, for a list of supported configuration names and +notes on many of the configurations. You should check the notes in that +section before proceeding any further with the installation of GCC. + +

+ +

Configurations Supported by GCC

+Here are the possible CPU types: + +
+ +1750a, a29k, alpha, arm, avr, cn, clipper, dsp16xx, elxsi, fr30, h8300, +hppa1.0, hppa1.1, i370, i386, i486, i586, i686, i786, i860, i960, ip2k, m32r, +m68000, m68k, m6811, m6812, m88k, mcore, mips, mipsel, mips64, mips64el, +mn10200, mn10300, ns32k, pdp11, powerpc, powerpcle, romp, rs6000, sh, sparc, +sparclite, sparc64, v850, vax, we32k. +
+ +

Here are the recognized company names. As you can see, customary +abbreviations are used rather than the longer official names. + + +

+acorn, alliant, altos, apollo, apple, att, bull, +cbm, convergent, convex, crds, dec, dg, dolphin, +elxsi, encore, harris, hitachi, hp, ibm, intergraph, isi, +mips, motorola, ncr, next, ns, omron, plexus, +sequent, sgi, sony, sun, tti, unicom, wrs. +
+ +

The company name is meaningful only to disambiguate when the rest of +the information supplied is insufficient. You can omit it, writing +just `cpu-system', if it is not needed. For example, +`vax-ultrix4.2' is equivalent to `vax-dec-ultrix4.2'. + +

Here is a list of system types: + +

+386bsd, aix, acis, amigaos, aos, aout, aux, bosx, bsd, clix, coff, ctix, cxux, +dgux, dynix, ebmon, ecoff, elf, esix, freebsd, hms, genix, gnu, linux, +linux-gnu, hiux, hpux, iris, irix, isc, luna, lynxos, mach, minix, msdos, mvs, +netbsd, newsos, nindy, ns, osf, osfrose, ptx, riscix, riscos, rtu, sco, sim, +solaris, sunos, sym, sysv, udi, ultrix, unicos, uniplus, unos, vms, vsta, +vxworks, winnt, xenix. +
+ +

You can omit the system type; then configure guesses the +operating system from the CPU and company. + +

You can add a version number to the system type; this may or may not +make a difference. For example, you can write `bsd4.3' or +`bsd4.4' to distinguish versions of BSD. In practice, the version +number is most needed for `sysv3' and `sysv4', which are often +treated differently. + +

`linux-gnu' is the canonical name for the GNU/Linux target; however +GCC will also accept `linux'. The version of the kernel in use is +not relevant on these systems. A suffix such as `libc1' or `aout' +distinguishes major versions of the C library; all of the suffixed versions +are obsolete. + +

If you specify an impossible combination such as `i860-dg-vms', +then you may get an error message from configure, or it may +ignore part of the information and do the best it can with the rest. +configure always prints the canonical name for the alternative +that it used. GCC does not support all possible alternatives. + +

Often a particular model of machine has a name. Many machine names are +recognized as aliases for CPU/company combinations. Thus, the machine +name `sun3', mentioned above, is an alias for `m68k-sun'. +Sometimes we accept a company name as a machine name, when the name is +popularly used for a particular machine. Here is a table of the known +machine names: + +

+3300, 3b1, 3bn, 7300, altos3068, altos, +apollo68, att-7300, balance, +convex-cn, crds, decstation-3100, +decstation, delta, encore, +fx2800, gmicro, hp7nn, hp8nn, +hp9k2nn, hp9k3nn, hp9k7nn, +hp9k8nn, iris4d, iris, isi68, +m3230, magnum, merlin, miniframe, +mmax, news-3600, news800, news, next, +pbd, pc532, pmax, powerpc, powerpcle, ps2, risc-news, +rtpc, sun2, sun386i, sun386, sun3, +sun4, symmetry, tower-32, tower. +
+ +

Remember that a machine name specifies both the cpu type and the company +name. +If you want to install your own homemade configuration files, you can +use `local' as the company name to access them. If you use +configuration `cpu-local', the configuration name +without the cpu prefix +is used to form the configuration file names. + +

Thus, if you specify `m68k-local', configuration uses +files m68k.md, local.h, m68k.c, +xm-local.h, t-local, and x-local, all in the +directory config/m68k. +


+

Return to the GCC Installation page + + + + + + diff -Nru INSTALL/prerequisites.html INSTALL/prerequisites.html --- INSTALL/prerequisites.html 1970-01-01 01:00:00.000000000 +0100 +++ INSTALL/prerequisites.html 2012-12-31 17:06:08.000000000 +0100 @@ -0,0 +1,236 @@ + + +Prerequisites for GCC + + + + + + + + + + +

Prerequisites for GCC

+ +GCC requires that various tools and packages be available for use in the +build procedure. Modifying GCC sources requires additional tools +described below. + +

Tools/packages necessary for building GCC

+ +
+
ISO C90 compiler
Necessary to bootstrap GCC, although versions of GCC prior +to 3.4 also allow bootstrapping with a traditional (K&R) C compiler. + +

To build all languages in a cross-compiler or other configuration where +3-stage bootstrap is not performed, you need to start with an existing +GCC binary (version 2.95 or later) because source code for language +frontends other than C might use GCC extensions. + +

GNAT
+In order to build the Ada compiler (GNAT) you must already have GNAT +installed because portions of the Ada frontend are written in Ada (with +GNAT extensions.) Refer to the Ada installation instructions for more +specific information. + +
A “working” POSIX compatible shell, or GNU bash
+Necessary when running configure because some +/bin/sh shells have bugs and may crash when configuring the +target libraries. In other cases, /bin/sh or ksh +have disastrous corner-case performance problems. This +can cause target configure runs to literally take days to +complete in some cases. + +

So on some platforms /bin/ksh is sufficient, on others it +isn't. See the host/target specific instructions for your platform, or +use bash to be sure. Then set CONFIG_SHELL in your +environment to your “good” shell prior to running +configure/make. + +

zsh is not a fully compliant POSIX shell and will not +work when configuring GCC. + +

GNU binutils
+Necessary in some circumstances, optional in others. See the +host/target specific instructions for your platform for the exact +requirements. + +
gzip version 1.2.4 (or later) or
bzip2 version 1.0.2 (or later)
+Necessary to uncompress GCC tar files when source code is +obtained via FTP mirror sites. + +
GNU make version 3.79.1 (or later)
+You must have GNU make installed to build GCC. + +
GNU tar version 1.14 (or later)
+Necessary (only on some platforms) to untar the source code. Many +systems' tar programs will also work, only try GNU +tar if you have problems. + +
GNU Multiple Precision Library (GMP) version 4.1 (or later)
+Necessary to build the Fortran frontend. If you do not have it +installed in your library search path, you will have to configure with +the --with-gmp configure option. See also +--with-gmp-lib and --with-gmp-include. + +
MPFR Library version 2.2.1 (or later)
+Necessary to build the Fortran frontend. It can be downloaded from +http://www.mpfr.org/. The version of MPFR that is bundled with +GMP 4.1.x contains numerous bugs. Although GNU Fortran will appear +to function with the buggy versions of MPFR, there are a few GNU Fortran +bugs that will not be fixed when using this version. It is strongly +recommended to upgrade to the recommended version of MPFR. + +

The --with-mpfr configure option should be used if your MPFR +Library is not installed in your default library search path. See +also --with-mpfr-lib and --with-mpfr-include. + +

jar, or InfoZIP (zip and unzip)
+Necessary to build libgcj, the GCJ runtime. + +
+ +

Tools/packages necessary for modifying GCC

+ +
+
autoconf versions 2.13 and 2.59
GNU m4 version 1.4 (or later)
+Necessary when modifying configure.ac, aclocal.m4, etc. +to regenerate configure and config.in files. Most +directories require autoconf 2.59 (exactly), but the toplevel +still requires autoconf 2.13 (exactly). + +
automake version 1.9.6
+Necessary when modifying a Makefile.am file to regenerate its +associated Makefile.in. + +

Much of GCC does not use automake, so directly edit the Makefile.in +file. Specifically this applies to the gcc, intl, +libcpp, libiberty, libobjc directories as well +as any of their subdirectories. + +

For directories that use automake, GCC requires the latest release in +the 1.9.x series, which is currently 1.9.6. When regenerating a directory +to a newer version, please update all the directories using an older 1.9.x +to the latest released version. + +

gettext version 0.14.5 (or later)
+Needed to regenerate gcc.pot. + +
gperf version 2.7.2 (or later)
+Necessary when modifying gperf input files, e.g. +gcc/cp/cfns.gperf to regenerate its associated header file, e.g. +gcc/cp/cfns.h. + +
DejaGnu 1.4.4
Expect
Tcl
+Necessary to run the GCC testsuite; see the section on testing for details. + +
autogen version 5.5.4 (or later) and
guile version 1.4.1 (or later)
+Necessary to regenerate fixinc/fixincl.x from +fixinc/inclhack.def and fixinc/*.tpl. + +

Necessary to run `make check' for fixinc. + +

Necessary to regenerate the top level Makefile.in file from +Makefile.tpl and Makefile.def. + +

GNU Bison version 1.28 (or later)
Berkeley yacc (byacc) is also reported to work other +than for GCJ. + +

Necessary when modifying *.y files. + +

Necessary to build GCC during development because the generated output +files are not included in the SVN repository. They are included in +releases. + +

Flex version 2.5.4 (or later)
+Necessary when modifying *.l files. + +

Necessary to build GCC during development because the generated output +files are not included in the SVN repository. They are included in +releases. + +

Texinfo version 4.4 (or later)
+Necessary for running makeinfo when modifying *.texi +files to test your changes. + +

Necessary for running make dvi or make pdf to +create printable documentation in DVI or PDF format. Texinfo version +4.8 or later is required for make pdf. + +

Necessary to build GCC documentation during development because the +generated output files are not included in the SVN repository. They are +included in releases. + +

TeX (any working version)
+Necessary for running texi2dvi and texi2pdf, which +are used when running make dvi or make pdf to create +DVI or PDF files, respectively. + +
SVN (any version)
SSH (any version)
+Necessary to access the SVN repository. Public releases and weekly +snapshots of the development sources are also available via FTP. + +
Perl version 5.6.1 (or later)
+Necessary when regenerating Makefile dependencies in libiberty. +Necessary when regenerating libiberty/functions.texi. +Necessary when generating manpages from Texinfo manuals. +Necessary when targetting Darwin, building libstdc++, +and not using --disable-symvers. +Used by various scripts to generate some files included in SVN (mainly +Unicode-related and rarely changing) from source tables. + +
GNU diffutils version 2.7 (or later)
+Useful when submitting patches for the GCC source code. + +
patch version 2.5.4 (or later)
+Necessary when applying patches, created with diff, to one's +own sources. + +
+ +


+

Return to the GCC Installation page + + + + + + + + + + + + + + diff -Nru INSTALL/specific.html INSTALL/specific.html --- INSTALL/specific.html 1970-01-01 01:00:00.000000000 +0100 +++ INSTALL/specific.html 2012-12-31 17:06:08.000000000 +0100 @@ -0,0 +1,1687 @@ + + +Host/Target specific installation notes for GCC + + + + + + + + + + +

Host/Target specific installation notes for GCC

+ +Please read this document carefully before installing the +GNU Compiler Collection on your machine. + +

Note that this list of install notes is not a list of supported +hosts or targets. Not all supported hosts and targets are listed +here, only the ones that require host-specific or target-specific +information are. + +

+ + + +

+


+ +

alpha*-*-*

+ +

This section contains general configuration information for all +alpha-based platforms using ELF (in particular, ignore this section for +DEC OSF/1, Digital UNIX and Tru64 UNIX). In addition to reading this +section, please read all other sections that match your target. + +

We require binutils 2.11.2 or newer. +Previous binutils releases had a number of problems with DWARF 2 +debugging information, not the least of which is incorrect linking of +shared libraries. + +


+ +

alpha*-dec-osf*

+ +

Systems using processors that implement the DEC Alpha architecture and +are running the DEC/Compaq Unix (DEC OSF/1, Digital UNIX, or Compaq +Tru64 UNIX) operating system, for example the DEC Alpha AXP systems. + +

As of GCC 3.2, versions before alpha*-dec-osf4 are no longer +supported. (These are the versions which identify themselves as DEC +OSF/1.) + +

In Digital Unix V4.0, virtual memory exhausted bootstrap failures +may be fixed by configuring with --with-gc=simple, +reconfiguring Kernel Virtual Memory and Swap parameters +per the /usr/sbin/sys_check Tuning Suggestions, +or applying the patch in +http://gcc.gnu.org/ml/gcc/2002-08/msg00822.html. + +

In Tru64 UNIX V5.1, Compaq introduced a new assembler that does not +currently (2001-06-13) work with mips-tfile. As a workaround, +we need to use the old assembler, invoked via the barely documented +-oldas option. To bootstrap GCC, you either need to use the +Compaq C Compiler: + +

        % CC=cc srcdir/configure [options] [target]
+
+

or you can use a copy of GCC 2.95.3 or higher built on Tru64 UNIX V4.0: + +

        % CC=gcc -Wa,-oldas srcdir/configure [options] [target]
+
+

As of GNU binutils 2.11.2, neither GNU as nor GNU ld +are supported on Tru64 UNIX, so you must not configure GCC with +--with-gnu-as or --with-gnu-ld. + +

GCC writes a `.verstamp' directive to the assembler output file +unless it is built as a cross-compiler. It gets the version to use from +the system header file /usr/include/stamp.h. If you install a +new version of DEC Unix, you should rebuild GCC to pick up the new version +stamp. + +

Note that since the Alpha is a 64-bit architecture, cross-compilers from +32-bit machines will not generate code as efficient as that generated +when the compiler is running on a 64-bit machine because many +optimizations that depend on being able to represent a word on the +target in an integral value on the host cannot be performed. Building +cross-compilers on the Alpha for 32-bit machines has only been tested in +a few cases and may not work properly. + +

`make compare' may fail on old versions of DEC Unix unless you add +-save-temps to CFLAGS. On these systems, the name of the +assembler input file is stored in the object file, and that makes +comparison fail if it differs between the stage1 and +stage2 compilations. The option -save-temps forces a +fixed name to be used for the assembler input file, instead of a +randomly chosen name in /tmp. Do not add -save-temps +unless the comparisons fail without that option. If you add +-save-temps, you will have to manually delete the `.i' and +`.s' files after each series of compilations. + +

GCC now supports both the native (ECOFF) debugging format used by DBX +and GDB and an encapsulated STABS format for use only with GDB. See the +discussion of the --with-stabs option of configure above +for more information on these formats and how to select them. + +

There is a bug in DEC's assembler that produces incorrect line numbers +for ECOFF format when the `.align' directive is used. To work +around this problem, GCC will not emit such alignment directives +while writing ECOFF format debugging information even if optimization is +being performed. Unfortunately, this has the very undesirable +side-effect that code addresses when -O is specified are +different depending on whether or not -g is also specified. + +

To avoid this behavior, specify -gstabs+ and use GDB instead of +DBX. DEC is now aware of this problem with the assembler and hopes to +provide a fix shortly. + +


+ +

alphaev5-cray-unicosmk*

+ +

Cray T3E systems running Unicos/Mk. + +

This port is incomplete and has many known bugs. We hope to improve the +support for this target soon. Currently, only the C front end is supported, +and it is not possible to build parallel applications. Cray modules are not +supported; in particular, Craylibs are assumed to be in +/opt/ctl/craylibs/craylibs. + +

On this platform, you need to tell GCC where to find the assembler and +the linker. The simplest way to do so is by providing --with-as +and --with-ld to configure, e.g. + +

         configure --with-as=/opt/ctl/bin/cam --with-ld=/opt/ctl/bin/cld \
+           --enable-languages=c
+
+

The comparison test at the end of the bootstrapping process fails on Unicos/Mk +because the assembler inserts timestamps into object files. You should +be able to work around this by doing `make all' after getting this +failure. + +


+ +

arc-*-elf

+ +

Argonaut ARC processor. +This configuration is intended for embedded systems. + +


+ +

arm-*-elf

+ +

xscale-*-*

+ +

ARM-family processors. Subtargets that use the ELF object format +require GNU binutils 2.13 or newer. Such subtargets include: +arm-*-freebsd, arm-*-netbsdelf, arm-*-*linux, +arm-*-rtems and arm-*-kaos. + +


+ +

arm-*-coff

+ +

ARM-family processors. Note that there are two different varieties +of PE format subtarget supported: arm-wince-pe and +arm-pe as well as a standard COFF target arm-*-coff. + +


+ +

arm-*-aout

+ +

ARM-family processors. These targets support the AOUT file format: +arm-*-aout, arm-*-netbsd. + +


+ +

avr

+ +

ATMEL AVR-family micro controllers. These are used in embedded +applications. There are no standard Unix configurations. +See “AVR Options” in the main manual +for the list of supported MCU types. + +

Use `configure --target=avr --enable-languages="c"' to configure GCC. + +

Further installation notes and other useful information about AVR tools +can also be obtained from: + +

+ +

We strongly recommend using binutils 2.13 or newer. + +

The following error: +

       Error: register required
+
+

indicates that you should upgrade to a newer version of the binutils. + +


+ +

Blackfin

+ +

The Blackfin processor, an Analog Devices DSP. +See “Blackfin Options” in the main manual + +

More information, and a version of binutils with support for this processor, +is available at http://blackfin.uclinux.org + +


+ +

c4x

+ +

Texas Instruments TMS320C3x and TMS320C4x Floating Point Digital Signal +Processors. These are used in embedded applications. There are no +standard Unix configurations. +See “TMS320C3x/C4x Options” in the main manual +for the list of supported MCU types. + +

GCC can be configured as a cross compiler for both the C3x and C4x +architectures on the same system. Use `configure --target=c4x +--enable-languages="c,c++"' to configure. + +

Further installation notes and other useful information about C4x tools +can also be obtained from: + +

+ +


+ +

CRIS

+ +

CRIS is the CPU architecture in Axis Communications ETRAX system-on-a-chip +series. These are used in embedded applications. + +

See “CRIS Options” in the main manual +for a list of CRIS-specific options. + +

There are a few different CRIS targets: +

+
cris-axis-aout
Old target. Includes a multilib for the `elinux' a.out-based +target. No multilibs for newer architecture variants. +
cris-axis-elf
Mainly for monolithic embedded systems. Includes a multilib for the +`v10' core used in `ETRAX 100 LX'. +
cris-axis-linux-gnu
A GNU/Linux port for the CRIS architecture, currently targeting +`ETRAX 100 LX' by default. +
+ +

For cris-axis-aout and cris-axis-elf you need binutils 2.11 +or newer. For cris-axis-linux-gnu you need binutils 2.12 or newer. + +

Pre-packaged tools can be obtained from +ftp://ftp.axis.com/pub/axis/tools/cris/compiler-kit/. More +information about this platform is available at +http://developer.axis.com/. + +


+ +

CRX

+ +

The CRX CompactRISC architecture is a low-power 32-bit architecture with +fast context switching and architectural extensibility features. + +

See “CRX Options” in the main manual for a list of CRX-specific options. + +

Use `configure --target=crx-elf --enable-languages=c,c++' to configure +GCC for building a CRX cross-compiler. The option `--target=crx-elf' +is also used to build the `newlib' C library for CRX. + +

It is also possible to build libstdc++-v3 for the CRX architecture. This +needs to be done in a separate step with the following configure settings: +`gcc/libstdc++-v3/configure --host=crx-elf --with-newlib +--enable-sjlj-exceptions --enable-cxx-flags='-fexceptions -frtti'' + +


+ +

DOS

+ +

Please have a look at the binaries page. + +

You cannot install GCC by itself on MSDOS; it will not compile under +any MSDOS compiler except itself. You need to get the complete +compilation package DJGPP, which includes binaries as well as sources, +and includes all the necessary compilation tools and libraries. + +


+ +

*-*-freebsd*

+ +

The version of binutils installed in /usr/bin probably works with +this release of GCC. However, on FreeBSD 4, bootstrapping against the +latest FSF binutils is known to improve overall testsuite results; and, +on FreeBSD/alpha, using binutils 2.14 or later is required to build libjava. + +

Support for FreeBSD 1 was discontinued in GCC 3.2. + +

Support for FreeBSD 2 will be discontinued after GCC 3.4. The +following was true for GCC 3.1 but the current status is unknown. +For FreeBSD 2 or any mutant a.out versions of FreeBSD 3: All +configuration support and files as shipped with GCC 2.95 are still in +place. FreeBSD 2.2.7 has been known to bootstrap completely; however, +it is unknown which version of binutils was used (it is assumed that it +was the system copy in /usr/bin) and C++ EH failures were noted. + +

For FreeBSD using the ELF file format: DWARF 2 debugging is now the +default for all CPU architectures. It had been the default on +FreeBSD/alpha since its inception. You may use -gstabs instead +of -g, if you really want the old debugging format. There are +no known issues with mixing object files and libraries with different +debugging formats. Otherwise, this release of GCC should now match more +of the configuration used in the stock FreeBSD configuration of GCC. In +particular, --enable-threads is now configured by default. +However, as a general user, do not attempt to replace the system +compiler with this release. Known to bootstrap and check with good +results on FreeBSD 4.9-STABLE and 5-CURRENT. In the past, known to +bootstrap and check with good results on FreeBSD 3.0, 3.4, 4.0, 4.2, +4.3, 4.4, 4.5, 4.8-STABLE. + +

In principle, --enable-threads is now compatible with +--enable-libgcj on FreeBSD. However, it has only been built +and tested on `i386-*-freebsd[45]' and `alpha-*-freebsd[45]'. +The static +library may be incorrectly built (symbols are missing at link time). +There is a rare timing-based startup hang (probably involves an +assumption about the thread library). Multi-threaded boehm-gc (required for +libjava) exposes severe threaded signal-handling bugs on FreeBSD before +4.5-RELEASE. Other CPU architectures +supported by FreeBSD will require additional configuration tuning in, at +the very least, both boehm-gc and libffi. + +

Shared libgcc_s.so is now built and installed by default. + +


+ +

h8300-hms

+ +

Renesas H8/300 series of processors. + +

Please have a look at the binaries page. + +

The calling convention and structure layout has changed in release 2.6. +All code must be recompiled. The calling convention now passes the +first three arguments in function calls in registers. Structures are no +longer a multiple of 2 bytes. + +


+ +

hppa*-hp-hpux*

+ +

Support for HP-UX version 9 and older was discontinued in GCC 3.4. + +

We require using gas/binutils on all hppa platforms; +you may encounter a variety of problems if you try to use the HP assembler. + +

Specifically, -g does not work on HP-UX (since that system +uses a peculiar debugging format which GCC does not know about), unless +you use GAS and GDB. It may be helpful to configure GCC with the +--with-gnu-as and +--with-as=... options to ensure that GCC can find GAS. + +

If you wish to use the pa-risc 2.0 architecture support with a 32-bit +runtime, you must use gas/binutils 2.11 or newer. + +

There are two default scheduling models for instructions. These are +PROCESSOR_7100LC and PROCESSOR_8000. They are selected from the pa-risc +architecture specified for the target machine when configuring. +PROCESSOR_8000 is the default. PROCESSOR_7100LC is selected when +the target is a `hppa1*' machine. + +

The PROCESSOR_8000 model is not well suited to older processors. Thus, +it is important to completely specify the machine architecture when +configuring if you want a model other than PROCESSOR_8000. The macro +TARGET_SCHED_DEFAULT can be defined in BOOT_CFLAGS if a different +default scheduling model is desired. + +

As of GCC 4.0, GCC uses the UNIX 95 namespace for HP-UX 10.10 +through 11.00, and the UNIX 98 namespace for HP-UX 11.11 and later. +This namespace change might cause problems when bootstrapping with +an earlier version of GCC or the HP compiler as essentially the same +namespace is required for an entire build. This problem can be avoided +in a number of ways. With HP cc, UNIX_STD can be set to `95' +or `98'. Another way is to add an appropriate set of predefines +to CC. The description for the munix= option contains +a list of the predefines used with each standard. + +

As of GCC 4.1, DWARF2 exception handling is available on HP-UX. +It is now the default. This exposed a bug in the handling of data +relocations in the GAS assembler. The handling of 64-bit data relocations +was seriously broken, affecting debugging and exception support on all +`hppa64-*-*' targets. Under some circumstances, 32-bit data relocations +could also be handled incorrectly. This problem is fixed in GAS version +2.16.91 20051125. + +

GCC versions prior to 4.1 incorrectly passed and returned complex +values. They are now passed in the same manner as aggregates. + +

More specific information to `hppa*-hp-hpux*' targets follows. + +


+ +

hppa*-hp-hpux10

+ +

For hpux10.20, we highly recommend you pick up the latest sed patch +PHCO_19798 from HP. HP has two sites which provide patches free of +charge: + +

+ +

The HP assembler on these systems has some problems. Most notably the +assembler inserts timestamps into each object file it creates, causing +the 3-stage comparison test to fail during a bootstrap. +You should be able to continue by saying `make all-host all-target' +after getting the failure from `make'. + +

GCC 4.0 requires CVS binutils as of April 28, 2004 or later. Earlier +versions require binutils 2.8 or later. + +

The C++ ABI has changed incompatibly in GCC 4.0. COMDAT subspaces are +used for one-only code and data. This resolves many of the previous +problems in using C++ on this target. However, the ABI is not compatible +with the one implemented under HP-UX 11 using secondary definitions. + +


+ +

hppa*-hp-hpux11

+ +

GCC 3.0 and up support HP-UX 11. GCC 2.95.x is not supported and cannot +be used to compile GCC 3.0 and up. + +

Refer to binaries for information about obtaining +precompiled GCC binaries for HP-UX. Precompiled binaries must be obtained +to build the Ada language as it can't be bootstrapped using C. Ada is +only available for the 32-bit PA-RISC runtime. The libffi and libjava +haven't been ported to HP-UX and don't build. + +

Starting with GCC 3.4 an ISO C compiler is required to bootstrap. The +bundled compiler supports only traditional C; you will need either HP's +unbundled compiler, or a binary distribution of GCC. + +

It is possible to build GCC 3.3 starting with the bundled HP compiler, +but the process requires several steps. GCC 3.3 can then be used to +build later versions. The fastjar program contains ISO C code and +can't be built with the HP bundled compiler. This problem can be +avoided by not building the Java language. For example, use the +--enable-languages="c,c++,f77,objc" option in your configure +command. + +

There are several possible approaches to building the distribution. +Binutils can be built first using the HP tools. Then, the GCC +distribution can be built. The second approach is to build GCC +first using the HP tools, then build binutils, then rebuild GCC. +There have been problems with various binary distributions, so it +is best not to start from a binary distribution. + +

On 64-bit capable systems, there are two distinct targets. Different +installation prefixes must be used if both are to be installed on +the same system. The `hppa[1-2]*-hp-hpux11*' target generates code +for the 32-bit PA-RISC runtime architecture and uses the HP linker. +The `hppa64-hp-hpux11*' target generates 64-bit code for the +PA-RISC 2.0 architecture. The HP and GNU linkers are both supported +for this target. + +

The script config.guess now selects the target type based on the compiler +detected during configuration. You must define PATH or CC so +that configure finds an appropriate compiler for the initial bootstrap. +When CC is used, the definition should contain the options that are +needed whenever CC is used. + +

Specifically, options that determine the runtime architecture must be +in CC to correctly select the target for the build. It is also +convenient to place many other compiler options in CC. For example, +CC="cc -Ac +DA2.0W -Wp,-H16376 -D_CLASSIC_TYPES -D_HPUX_SOURCE" +can be used to bootstrap the GCC 3.3 branch with the HP compiler in +64-bit K&R/bundled mode. The +DA2.0W option will result in +the automatic selection of the `hppa64-hp-hpux11*' target. The +macro definition table of cpp needs to be increased for a successful +build with the HP compiler. _CLASSIC_TYPES and _HPUX_SOURCE need to +be defined when building with the bundled compiler, or when using the +-Ac option. These defines aren't necessary with -Ae. + +

It is best to explicitly configure the `hppa64-hp-hpux11*' target +with the --with-ld=... option. This overrides the standard +search for ld. The two linkers supported on this target require different +commands. The default linker is determined during configuration. As a +result, it's not possible to switch linkers in the middle of a GCC build. +This has been been reported to sometimes occur in unified builds of +binutils and GCC. + +

GCC 3.0 through 3.2 require binutils 2.11 or above. GCC 3.3 through +GCC 4.0 require binutils 2.14 or later. + +

Although the HP assembler can be used for an initial build, it shouldn't +be used with any languages other than C and perhaps Fortran due to its +many limitations. For example, it does not support weak symbols or alias +definitions. As a result, explicit template instantiations are required +when using C++. This makes it difficult if not impossible to build many +C++ applications. You can't generate debugging information when using +the HP assembler. Finally, bootstrapping fails in the final +comparison of object modules due to the time stamps that it inserts into +the modules. The bootstrap can be continued from this point with +`make all-host all-target'. + +

A recent linker patch must be installed for the correct operation of +GCC 3.3 and later. PHSS_26559 and PHSS_24304 are the +oldest linker patches that are known to work. They are for HP-UX +11.00 and 11.11, respectively. PHSS_24303, the companion to +PHSS_24304, might be usable but it hasn't been tested. These +patches have been superseded. Consult the HP patch database to obtain +the currently recommended linker patch for your system. + +

The patches are necessary for the support of weak symbols on the +32-bit port, and for the running of initializers and finalizers. Weak +symbols are implemented using SOM secondary definition symbols. Prior +to HP-UX 11, there are bugs in the linker support for secondary symbols. +The patches correct a problem of linker core dumps creating shared +libraries containing secondary symbols, as well as various other +linking issues involving secondary symbols. + +

GCC 3.3 uses the ELF DT_INIT_ARRAY and DT_FINI_ARRAY capabilities to +run initializers and finalizers on the 64-bit port. The 32-bit port +uses the linker +init and +fini options for the same +purpose. The patches correct various problems with the +init/+fini +options, including program core dumps. Binutils 2.14 corrects a +problem on the 64-bit port resulting from HP's non-standard use of +the .init and .fini sections for array initializers and finalizers. + +

There are a number of issues to consider in selecting which linker to +use with the 64-bit port. The GNU 64-bit linker can only create dynamic +binaries. The -static option causes linking with archive +libraries but doesn't produce a truly static binary. Dynamic binaries +still require final binding by the dynamic loader to resolve a set of +dynamic-loader-defined symbols. The default behavior of the HP linker +is the same as the GNU linker. However, it can generate true 64-bit +static binaries using the +compat option. + +

The HP 64-bit linker doesn't support linkonce semantics. As a +result, C++ programs have many more sections than they should. + +

The GNU 64-bit linker has some issues with shared library support +and exceptions. As a result, we only support libgcc in archive +format. For similar reasons, dwarf2 unwind and exception support +are disabled. The GNU linker also has problems creating binaries +with -static. It doesn't provide stubs for internal +calls to global functions in shared libraries, so these calls +can't be overloaded. + +

Thread support is not implemented in GCC 3.0 through 3.2, so the +--enable-threads configure option does not work. In 3.3 +and later, POSIX threads are supported. The optional DCE thread +library is not supported. + +

This port still is undergoing significant development. + +


+ +

*-*-linux-gnu

+ +

Versions of libstdc++-v3 starting with 3.2.1 require bugfixes present +in glibc 2.2.5 and later. More information is available in the +libstdc++-v3 documentation. + +


+ +

i?86-*-linux*aout

+ +

Use this configuration to generate a.out binaries on Linux-based +GNU systems. This configuration is being superseded. + +


+ +

i?86-*-linux*

+ +

As of GCC 3.3, binutils 2.13.1 or later is required for this platform. +See bug 10877 for more information. + +

If you receive Signal 11 errors when building on GNU/Linux, then it is +possible you have a hardware problem. Further information on this can be +found on www.bitwizard.nl. + +


+ +

i?86-*-sco3.2v5*

+ +

Use this for the SCO OpenServer Release 5 family of operating systems. + +

Unlike earlier versions of GCC, the ability to generate COFF with this +target is no longer provided. + +

Earlier versions of GCC emitted DWARF 1 when generating ELF to allow +the system debugger to be used. That support was too burdensome to +maintain. GCC now emits only DWARF 2 for this target. This means you +may use either the UDK debugger or GDB to debug programs built by this +version of GCC. + +

GCC is now only supported on releases 5.0.4 and later, and requires that +you install Support Level Supplement OSS646B or later, and Support Level +Supplement OSS631C or later. If you are using release 5.0.7 of +OpenServer, you must have at least the first maintenance pack installed +(this includes the relevant portions of OSS646). OSS646, also known as +the “Execution Environment Update”, provides updated link editors and +assemblers, as well as updated standard C and math libraries. The C +startup modules are also updated to support the System V gABI draft, and +GCC relies on that behavior. OSS631 provides a collection of commonly +used open source libraries, some of which GCC depends on (such as GNU +gettext and zlib). SCO OpenServer Release 5.0.7 has all of this built +in by default, but OSS631C and later also apply to that release. Please +visit +ftp://ftp.sco.com/pub/openserver5 +for the latest versions of these (and other potentially useful) +supplements. + +

Although there is support for using the native assembler, it is +recommended that you configure GCC to use the GNU assembler. You do +this by using the flags +--with-gnu-as. You should +use a modern version of GNU binutils. Version 2.13.2.1 was used for all +testing. In general, only the --with-gnu-as option is tested. +A modern bintuils (as well as a plethora of other development related +GNU utilities) can be found in Support Level Supplement OSS658A, the +“GNU Development Tools” package. See the SCO web and ftp sites for details. +That package also contains the currently “officially supported” version of +GCC, version 2.95.3. It is useful for bootstrapping this version. + +


+ +

i?86-*-solaris2.10

+ +

Use this for Solaris 10 or later on x86 and x86-64 systems. This +configuration is supported by GCC 4.0 and later versions only. + +

It is recommended that you configure GCC to use the GNU assembler in +/usr/sfw/bin/gas but the Sun linker, using the options +--with-gnu-as --with-as=/usr/sfw/bin/gas --without-gnu-ld +--with-ld=/usr/ccs/bin/ld. + +


+ +

i?86-*-udk

+ +

This target emulates the SCO Universal Development Kit and requires that +package be installed. (If it is installed, you will have a +/udk/usr/ccs/bin/cc file present.) It's very much like the +`i?86-*-unixware7*' target +but is meant to be used when hosting on a system where UDK isn't the +default compiler such as OpenServer 5 or Unixware 2. This target will +generate binaries that will run on OpenServer, Unixware 2, or Unixware 7, +with the same warnings and caveats as the SCO UDK. + +

This target is a little tricky to build because we have to distinguish +it from the native tools (so it gets headers, startups, and libraries +from the right place) while making the tools not think we're actually +building a cross compiler. The easiest way to do this is with a configure +command like this: + +

         CC=/udk/usr/ccs/bin/cc /your/path/to/gcc/configure \
+           --host=i686-pc-udk --target=i686-pc-udk --program-prefix=udk-
+
+

You should substitute `i686' in the above command with the appropriate +processor for your host. + +

After the usual `make' and +`make install', you can then access the UDK-targeted GCC +tools by adding udk- before the commonly known name. For +example, to invoke the C compiler, you would use udk-gcc. +They will coexist peacefully with any native-target GCC tools you may +have installed. + +


+ +

ia64-*-linux

+ +

IA-64 processor (also known as IPF, or Itanium Processor Family) +running GNU/Linux. + +

If you are using the installed system libunwind library with +--with-system-libunwind, then you must use libunwind 0.98 or +later. + +

None of the following versions of GCC has an ABI that is compatible +with any of the other versions in this list, with the exception that +Red Hat 2.96 and Trillian 000171 are compatible with each other: +3.1, 3.0.2, 3.0.1, 3.0, Red Hat 2.96, and Trillian 000717. +This primarily affects C++ programs and programs that create shared libraries. +GCC 3.1 or later is recommended for compiling linux, the kernel. +As of version 3.1 GCC is believed to be fully ABI compliant, and hence no +more major ABI changes are expected. + +


+ +

ia64-*-hpux*

+ +

Building GCC on this target requires the GNU Assembler. The bundled HP +assembler will not work. To prevent GCC from using the wrong assembler, +the option --with-gnu-as may be necessary. + +

The GCC libunwind library has not been ported to HPUX. This means that for +GCC versions 3.2.3 and earlier, --enable-libunwind-exceptions +is required to build GCC. For GCC 3.3 and later, this is the default. +For gcc 3.4.3 and later, --enable-libunwind-exceptions is +removed and the system libunwind library will always be used. + +


+ + +

*-ibm-aix*

+ +

Support for AIX version 3 and older was discontinued in GCC 3.4. + +

“out of memory” bootstrap failures may indicate a problem with +process resource limits (ulimit). Hard limits are configured in the +/etc/security/limits system configuration file. + +

To speed up the configuration phases of bootstrapping and installing GCC, +one may use GNU Bash instead of AIX /bin/sh, e.g., + +

        % CONFIG_SHELL=/opt/freeware/bin/bash
+        % export CONFIG_SHELL
+
+

and then proceed as described in the build instructions, where we strongly recommend specifying an absolute path +to invoke srcdir/configure. + +

Because GCC on AIX is built as a 32-bit executable by default, +(although it can generate 64-bit programs) the GMP and MPFR libraries +required by gfortran must be 32-bit libraries. Building GMP and MPFR +as static archive libraries works better than shared libraries. + +

Errors involving alloca when building GCC generally are due +to an incorrect definition of CC in the Makefile or mixing files +compiled with the native C compiler and GCC. During the stage1 phase of +the build, the native AIX compiler must be invoked as cc +(not xlc). Once configure has been informed of +xlc, one needs to use `make distclean' to remove the +configure cache files and ensure that CC environment variable +does not provide a definition that will confuse configure. +If this error occurs during stage2 or later, then the problem most likely +is the version of Make (see above). + +

The native as and ld are recommended for bootstrapping +on AIX 4 and required for bootstrapping on AIX 5L. The GNU Assembler +reports that it supports WEAK symbols on AIX 4, which causes GCC to try to +utilize weak symbol functionality although it is not supported. The GNU +Assembler and Linker do not support AIX 5L sufficiently to bootstrap GCC. +The native AIX tools do interoperate with GCC. + +

Building libstdc++.a requires a fix for an AIX Assembler bug +APAR IY26685 (AIX 4.3) or APAR IY25528 (AIX 5.1). It also requires a +fix for another AIX Assembler bug and a co-dependent AIX Archiver fix +referenced as APAR IY53606 (AIX 5.2) or a APAR IY54774 (AIX 5.1) + +

`libstdc++' in GCC 3.4 increments the major version number of the +shared object and GCC installation places the libstdc++.a +shared library in a common location which will overwrite the and GCC +3.3 version of the shared library. Applications either need to be +re-linked against the new shared library or the GCC 3.1 and GCC 3.3 +versions of the `libstdc++' shared object needs to be available +to the AIX runtime loader. The GCC 3.1 `libstdc++.so.4', if +present, and GCC 3.3 `libstdc++.so.5' shared objects can be +installed for runtime dynamic loading using the following steps to set +the `F_LOADONLY' flag in the shared object for each +multilib libstdc++.a installed: + +

Extract the shared objects from the currently installed +libstdc++.a archive: +

        % ar -x libstdc++.a libstdc++.so.4 libstdc++.so.5
+
+

Enable the `F_LOADONLY' flag so that the shared object will be +available for runtime dynamic loading, but not linking: +

        % strip -e libstdc++.so.4 libstdc++.so.5
+
+

Archive the runtime-only shared object in the GCC 3.4 +libstdc++.a archive: +

        % ar -q libstdc++.a libstdc++.so.4 libstdc++.so.5
+
+

Linking executables and shared libraries may produce warnings of +duplicate symbols. The assembly files generated by GCC for AIX always +have included multiple symbol definitions for certain global variable +and function declarations in the original program. The warnings should +not prevent the linker from producing a correct library or runnable +executable. + +

AIX 4.3 utilizes a “large format” archive to support both 32-bit and +64-bit object modules. The routines provided in AIX 4.3.0 and AIX 4.3.1 +to parse archive libraries did not handle the new format correctly. +These routines are used by GCC and result in error messages during +linking such as “not a COFF file”. The version of the routines shipped +with AIX 4.3.1 should work for a 32-bit environment. The -g +option of the archive command may be used to create archives of 32-bit +objects using the original “small format”. A correct version of the +routines is shipped with AIX 4.3.2 and above. + +

Some versions of the AIX binder (linker) can fail with a relocation +overflow severe error when the -bbigtoc option is used to link +GCC-produced object files into an executable that overflows the TOC. A fix +for APAR IX75823 (OVERFLOW DURING LINK WHEN USING GCC AND -BBIGTOC) is +available from IBM Customer Support and from its +techsupport.services.ibm.com +website as PTF U455193. + +

The AIX 4.3.2.1 linker (bos.rte.bind_cmds Level 4.3.2.1) will dump core +with a segmentation fault when invoked by any version of GCC. A fix for +APAR IX87327 is available from IBM Customer Support and from its +techsupport.services.ibm.com +website as PTF U461879. This fix is incorporated in AIX 4.3.3 and above. + +

The initial assembler shipped with AIX 4.3.0 generates incorrect object +files. A fix for APAR IX74254 (64BIT DISASSEMBLED OUTPUT FROM COMPILER FAILS +TO ASSEMBLE/BIND) is available from IBM Customer Support and from its +techsupport.services.ibm.com +website as PTF U453956. This fix is incorporated in AIX 4.3.1 and above. + +

AIX provides National Language Support (NLS). Compilers and assemblers +use NLS to support locale-specific representations of various data +formats including floating-point numbers (e.g., `.' vs `,' for +separating decimal fractions). There have been problems reported where +GCC does not produce the same floating-point formats that the assembler +expects. If one encounters this problem, set the LANG +environment variable to `C' or `En_US'. + +

By default, GCC for AIX 4.1 and above produces code that can be used on +both Power or PowerPC processors. + +

A default can be specified with the -mcpu=cpu_type +switch and using the configure option --with-cpu-cpu_type. + +


+ +

iq2000-*-elf

+ +

Vitesse IQ2000 processors. These are used in embedded +applications. There are no standard Unix configurations. + +


+ +

m32c-*-elf

+ +

Renesas M32C processor. +This configuration is intended for embedded systems. + +


+ +

m32r-*-elf

+ +

Renesas M32R processor. +This configuration is intended for embedded systems. + +


+ +

m6811-elf

+ +

Motorola 68HC11 family micro controllers. These are used in embedded +applications. There are no standard Unix configurations. + +


+ +

m6812-elf

+ +

Motorola 68HC12 family micro controllers. These are used in embedded +applications. There are no standard Unix configurations. + +


+ +

m68k-hp-hpux

+ +

HP 9000 series 300 or 400 running HP-UX. HP-UX version 8.0 has a bug in +the assembler that prevents compilation of GCC. This +bug manifests itself during the first stage of compilation, while +building libgcc2.a: + +

     _floatdisf
+     cc1: warning: `-g' option not supported on this version of GCC
+     cc1: warning: `-g1' option not supported on this version of GCC
+     ./xgcc: Internal compiler error: program as got fatal signal 11
+
+

A patched version of the assembler is available as the file +ftp://altdorf.ai.mit.edu/archive/cph/hpux-8.0-assembler. If you +have HP software support, the patch can also be obtained directly from +HP, as described in the following note: + +

+This is the patched assembler, to patch SR#1653-010439, where the +assembler aborts on floating point constants. + +

The bug is not really in the assembler, but in the shared library +version of the function “cvtnum(3c)”. The bug on “cvtnum(3c)” is +SR#4701-078451. Anyway, the attached assembler uses the archive +library version of “cvtnum(3c)” and thus does not exhibit the bug. +

+ +

This patch is also known as PHCO_4484. + +

In addition gdb does not understand that native HP-UX format, so +you must use gas if you wish to use gdb. + +

On HP-UX version 8.05, but not on 8.07 or more recent versions, the +fixproto shell script triggers a bug in the system shell. If you +encounter this problem, upgrade your operating system or use BASH (the +GNU shell) to run fixproto. This bug will cause the fixproto +program to report an error of the form: + +

     ./fixproto: sh internal 1K buffer overflow
+
+

To fix this, you can also change the first line of the fixproto script +to look like: + +

     #!/bin/ksh
+
+


+ +

mips-*-*

+ +

If on a MIPS system you get an error message saying “does not have gp +sections for all it's [sic] sectons [sic]”, don't worry about it. This +happens whenever you use GAS with the MIPS linker, but there is not +really anything wrong, and it is okay to use the output file. You can +stop such warnings by installing the GNU linker. + +

It would be nice to extend GAS to produce the gp tables, but they are +optional, and there should not be a warning about their absence. + +

The libstdc++ atomic locking routines for MIPS targets requires MIPS II +and later. A patch went in just after the GCC 3.3 release to +make `mips*-*-*' use the generic implementation instead. You can also +configure for `mipsel-elf' as a workaround. The +`mips*-*-linux*' target continues to use the MIPS II routines. More +work on this is expected in future releases. + +

MIPS systems check for division by zero (unless +-mno-check-zero-division is passed to the compiler) by +generating either a conditional trap or a break instruction. Using +trap results in smaller code, but is only supported on MIPS II and +later. Also, some versions of the Linux kernel have a bug that +prevents trap from generating the proper signal (SIGFPE). To enable +the use of break, use the --with-divide=breaks +configure option when configuring GCC. The default is to +use traps on systems that support them. + +

Cross-compilers for the MIPS as target using the MIPS assembler +currently do not work, because the auxiliary programs +mips-tdump.c and mips-tfile.c can't be compiled on +anything but a MIPS. It does work to cross compile for a MIPS +if you use the GNU assembler and linker. + +

The assembler from GNU binutils 2.17 and earlier has a bug in the way +it sorts relocations for REL targets (o32, o64, EABI). This can cause +bad code to be generated for simple C++ programs. Also the linker +from GNU binutils versions prior to 2.17 has a bug which causes the +runtime linker stubs in very large programs, like libgcj.so, to +be incorrectly generated. Binutils CVS snapshots and releases made +after Nov. 9, 2006 are thought to be free from both of these problems. + +


+ +

mips-sgi-irix5

+ +

In order to compile GCC on an SGI running IRIX 5, the `compiler_dev.hdr' +subsystem must be installed from the IDO CD-ROM supplied by SGI. +It is also available for download from +ftp://ftp.sgi.com/sgi/IRIX5.3/iris-development-option-5.3.tardist. + +

If you use the MIPS C compiler to bootstrap, it may be necessary +to increase its table size for switch statements with the +-Wf,-XNg1500 option. If you use the -O2 +optimization option, you also need to use -Olimit 3000. + +

To enable debugging under IRIX 5, you must use GNU binutils 2.15 or +later, and use the --with-gnu-ld configure option +when configuring GCC. You need to use GNU ar and nm, +also distributed with GNU binutils. + +

Some users have reported that /bin/sh will hang during bootstrap. +This problem can be avoided by running the commands: + +

        % CONFIG_SHELL=/bin/ksh
+        % export CONFIG_SHELL
+
+

before starting the build. + +


+ +

mips-sgi-irix6

+ +

If you are using SGI's MIPSpro cc as your bootstrap compiler, you must +ensure that the N32 ABI is in use. To test this, compile a simple C +file with cc and then run file on the +resulting object file. The output should look like: + +

     test.o: ELF N32 MSB ...
+
+

If you see: + +

     test.o: ELF 32-bit MSB ...
+
+

or + +

     test.o: ELF 64-bit MSB ...
+
+

then your version of cc uses the O32 or N64 ABI by default. You +should set the environment variable CC to `cc -n32' +before configuring GCC. + +

If you want the resulting gcc to run on old 32-bit systems +with the MIPS R4400 CPU, you need to ensure that only code for the `mips3' +instruction set architecture (ISA) is generated. While GCC 3.x does +this correctly, both GCC 2.95 and SGI's MIPSpro cc may change +the ISA depending on the machine where GCC is built. Using one of them +as the bootstrap compiler may result in `mips4' code, which won't run at +all on `mips3'-only systems. For the test program above, you should see: + +

     test.o: ELF N32 MSB mips-3 ...
+
+

If you get: + +

     test.o: ELF N32 MSB mips-4 ...
+
+

instead, you should set the environment variable CC to `cc +-n32 -mips3' or `gcc -mips3' respectively before configuring GCC. + +

MIPSpro C 7.4 may cause bootstrap failures, due to a bug when inlining +memcmp. Either add -U__INLINE_INTRINSICS to the CC +environment variable as a workaround or upgrade to MIPSpro C 7.4.1m. + +

GCC on IRIX 6 is usually built to support the N32, O32 and N64 ABIs. If +you build GCC on a system that doesn't have the N64 libraries installed +or cannot run 64-bit binaries, +you need to configure with --disable-multilib so GCC doesn't +try to use them. This will disable building the O32 libraries, too. +Look for /usr/lib64/libc.so.1 to see if you +have the 64-bit libraries installed. + +

To enable debugging for the O32 ABI, you must use GNU as from +GNU binutils 2.15 or later. You may also use GNU ld, but +this is not required and currently causes some problems with Ada. + +

The --enable-threads option doesn't currently work, a patch is +in preparation for a future release. The --enable-libgcj +option is disabled by default: IRIX 6 uses a very low default limit +(20480) for the command line length. Although libtool contains a +workaround for this problem, at least the N64 `libgcj' is known not +to build despite this, running into an internal error of the native +ld. A sure fix is to increase this limit (`ncargs') to +its maximum of 262144 bytes. If you have root access, you can use the +systune command to do this. + +

wchar_t support in `libstdc++' is not available for old +IRIX 6.5.x releases, x < 19. The problem cannot be autodetected +and in order to build GCC for such targets you need to configure with +--disable-wchar_t. + +

See http://freeware.sgi.com/ for more +information about using GCC on IRIX platforms. + +


+ +

powerpc-*-*

+ +

You can specify a default version for the -mcpu=cpu_type +switch by using the configure option --with-cpu-cpu_type. + +


+ +

powerpc-*-darwin*

+ +

PowerPC running Darwin (Mac OS X kernel). + +

Pre-installed versions of Mac OS X may not include any developer tools, +meaning that you will not be able to build GCC from source. Tool +binaries are available at +http://developer.apple.com/darwin/projects/compiler/ (free +registration required). + +

This version of GCC requires at least cctools-590.7. + +

The version of GCC shipped by Apple typically includes a number of +extensions not available in a standard GCC release. These extensions +are generally for backwards compatibility and best avoided. + +


+ +

powerpc-*-elf, powerpc-*-sysv4

+ +

PowerPC system in big endian mode, running System V.4. + +


+ +

powerpc*-*-linux-gnu*

+ +

You will need +binutils 2.15 +or newer for a working GCC. + +


+ +

powerpc-*-netbsd*

+ +

PowerPC system in big endian mode running NetBSD. To build the +documentation you will need Texinfo version 4.4 (NetBSD 1.5.1 included +Texinfo version 3.12). + +


+ +

powerpc-*-eabisim

+ +

Embedded PowerPC system in big endian mode for use in running under the +PSIM simulator. + +


+ +

powerpc-*-eabi

+ +

Embedded PowerPC system in big endian mode. + +


+ +

powerpcle-*-elf, powerpcle-*-sysv4

+ +

PowerPC system in little endian mode, running System V.4. + +


+ +

powerpcle-*-eabisim

+ +

Embedded PowerPC system in little endian mode for use in running under +the PSIM simulator. + +


+ +

powerpcle-*-eabi

+ +

Embedded PowerPC system in little endian mode. + +


+ +

s390-*-linux*

+ +

S/390 system running GNU/Linux for S/390. + +


+ +

s390x-*-linux*

+ +

zSeries system (64-bit) running GNU/Linux for zSeries. + +


+ +

s390x-ibm-tpf*

+ +

zSeries system (64-bit) running TPF. This platform is +supported as cross-compilation target only. + +


+ + + + +

*-*-solaris2*

+ +

Sun does not ship a C compiler with Solaris 2. To bootstrap and install +GCC you first have to install a pre-built compiler, see the +binaries page for details. + +

The Solaris 2 /bin/sh will often fail to configure +libstdc++-v3, boehm-gc or libjava. We therefore +recommend using the following initial sequence of commands + +

        % CONFIG_SHELL=/bin/ksh
+        % export CONFIG_SHELL
+
+

and proceed as described in the configure instructions. +In addition we strongly recommend specifying an absolute path to invoke +srcdir/configure. + +

Solaris 2 comes with a number of optional OS packages. Some of these +are needed to use GCC fully, namely SUNWarc, +SUNWbtool, SUNWesu, SUNWhea, SUNWlibm, +SUNWsprot, and SUNWtoo. If you did not install all +optional packages when installing Solaris 2, you will need to verify that +the packages that GCC needs are installed. + +

To check whether an optional package is installed, use +the pkginfo command. To add an optional package, use the +pkgadd command. For further details, see the Solaris 2 +documentation. + +

Trying to use the linker and other tools in +/usr/ucb to install GCC has been observed to cause trouble. +For example, the linker may hang indefinitely. The fix is to remove +/usr/ucb from your PATH. + +

The build process works more smoothly with the legacy Sun tools so, if you +have /usr/xpg4/bin in your PATH, we recommend that you place +/usr/bin before /usr/xpg4/bin for the duration of the build. + +

All releases of GNU binutils prior to 2.11.2 have known bugs on this +platform. We recommend the use of GNU binutils 2.11.2 or later, or the +vendor tools (Sun as, Sun ld). Note that your mileage +may vary if you use a combination of the GNU tools and the Sun tools: while +the combination GNU as + Sun ld should reasonably work, +the reverse combination Sun as + GNU ld is known to +cause memory corruption at runtime in some cases for C++ programs. + +

The stock GNU binutils 2.15 release is broken on this platform because of a +single bug. It has been fixed on the 2.15 branch in the CVS repository. +You can obtain a working version by checking out the binutils-2_15-branch +from the CVS repository or applying the patch +http://sourceware.org/ml/binutils-cvs/2004-09/msg00036.html to the +release. + +

We recommend using GNU binutils 2.16 or later in conjunction with GCC 4.x, +or the vendor tools (Sun as, Sun ld). However, for +Solaris 10 and above, an additional patch is required in order for the GNU +linker to be able to cope with a new flavor of shared libraries. You +can obtain a working version by checking out the binutils-2_16-branch from +the CVS repository or applying the patch +http://sourceware.org/ml/binutils-cvs/2005-07/msg00122.html to the +release. + +

Sun bug 4296832 turns up when compiling X11 headers with GCC 2.95 or +newer: g++ will complain that types are missing. These headers assume +that omitting the type means int; this assumption worked for C89 but +is wrong for C++, and is now wrong for C99 also. + +

g++ accepts such (invalid) constructs with the option +-fpermissive; it +will assume that any missing type is int (as defined by C89). + +

There are patches for Solaris 2.6 (105633-56 or newer for SPARC, +106248-42 or newer for Intel), Solaris 7 (108376-21 or newer for SPARC, +108377-20 for Intel), and Solaris 8 (108652-24 or newer for SPARC, +108653-22 for Intel) that fix this bug. + +

Sun bug 4927647 sometimes causes random spurious testsuite failures +related to missing diagnostic output. This bug doesn't affect GCC +itself, rather it is a kernel bug triggered by the expect +program which is used only by the GCC testsuite driver. When the bug +causes the expect program to miss anticipated output, extra +testsuite failures appear. + +

There are patches for Solaris 8 (117350-12 or newer for SPARC, +117351-12 or newer for Intel) and Solaris 9 (117171-11 or newer for +SPARC, 117172-11 or newer for Intel) that address this problem. + +


+ +

sparc-sun-solaris2*

+ +

When GCC is configured to use binutils 2.11.2 or later the binaries +produced are smaller than the ones produced using Sun's native tools; +this difference is quite significant for binaries containing debugging +information. + +

Sun as 4.x is broken in that it cannot cope with long symbol names. +A typical error message might look similar to the following: + +

     /usr/ccs/bin/as: "/var/tmp/ccMsw135.s", line 11041: error:
+       can't compute value of an expression involving an external symbol.
+
+

This is Sun bug 4237974. This is fixed with patch 108908-02 for Solaris +2.6 and has been fixed in later (5.x) versions of the assembler, +starting with Solaris 7. + +

Starting with Solaris 7, the operating system is capable of executing +64-bit SPARC V9 binaries. GCC 3.1 and later properly supports +this; the -m64 option enables 64-bit code generation. +However, if all you want is code tuned for the UltraSPARC CPU, you +should try the -mtune=ultrasparc option instead, which produces +code that, unlike full 64-bit code, can still run on non-UltraSPARC +machines. + +

When configuring on a Solaris 7 or later system that is running a kernel +that supports only 32-bit binaries, one must configure with +--disable-multilib, since we will not be able to build the +64-bit target libraries. + +

GCC 3.3 and GCC 3.4 trigger code generation bugs in earlier versions of +the GNU compiler (especially GCC 3.0.x versions), which lead to the +miscompilation of the stage1 compiler and the subsequent failure of the +bootstrap process. A workaround is to use GCC 3.2.3 as an intermediary +stage, i.e. to bootstrap that compiler with the base compiler and then +use it to bootstrap the final compiler. + +

GCC 3.4 triggers a code generation bug in versions 5.4 (Sun ONE Studio 7) +and 5.5 (Sun ONE Studio 8) of the Sun compiler, which causes a bootstrap +failure in form of a miscompilation of the stage1 compiler by the Sun +compiler. This is Sun bug 4974440. This is fixed with patch 112760-07. + +

GCC 3.4 changed the default debugging format from STABS to DWARF-2 for +32-bit code on Solaris 7 and later. If you use the Sun assembler, this +change apparently runs afoul of Sun bug 4910101 (which is referenced as +a x86-only problem by Sun, probably because they do not use DWARF-2). +A symptom of the problem is that you cannot compile C++ programs like +groff 1.19.1 without getting messages similar to the following: + +

     ld: warning: relocation error: R_SPARC_UA32: ...
+       external symbolic relocation against non-allocatable section
+       .debug_info cannot be processed at runtime: relocation ignored.
+
+

To work around this problem, compile with -gstabs+ instead of +plain -g. + +

When configuring the GNU Multiple Precision Library (GMP) or the MPFR +library on a Solaris 7 or later system, the canonical target triplet +must be specified as the build parameter on the configure +line. This triplet can be obtained by invoking ./config.guess in +the toplevel source directory of GCC (and not that of GMP or MPFR). +For example on a Solaris 7 system: + +

        % ./configure --build=sparc-sun-solaris2.7 --prefix=xxx
+
+


+ +

sparc-sun-solaris2.7

+ +

Sun patch 107058-01 (1999-01-13) for Solaris 7/SPARC triggers a bug in +the dynamic linker. This problem (Sun bug 4210064) affects GCC 2.8 +and later, including all EGCS releases. Sun formerly recommended +107058-01 for all Solaris 7 users, but around 1999-09-01 it started to +recommend it only for people who use Sun's compilers. + +

Here are some workarounds to this problem: +

    +
  • Do not install Sun patch 107058-01 until after Sun releases a +complete patch for bug 4210064. This is the simplest course to take, +unless you must also use Sun's C compiler. Unfortunately 107058-01 +is preinstalled on some new Solaris 7-based hosts, so you may have to +back it out. + +
  • Copy the original, unpatched Solaris 7 +/usr/ccs/bin/as into +/usr/local/libexec/gcc/sparc-sun-solaris2.7/3.4/as, +adjusting the latter name to fit your local conventions and software +version numbers. + +
  • Install Sun patch 106950-03 (1999-05-25) or later. Nobody with +both 107058-01 and 106950-03 installed has reported the bug with GCC +and Sun's dynamic linker. This last course of action is riskiest, +for two reasons. First, you must install 106950 on all hosts that +run code generated by GCC; it doesn't suffice to install it only on +the hosts that run GCC itself. Second, Sun says that 106950-03 is +only a partial fix for bug 4210064, but Sun doesn't know whether the +partial fix is adequate for GCC. Revision -08 or later should fix +the bug. The current (as of 2004-05-23) revision is -24, and is included in +the Solaris 7 Recommended Patch Cluster. +
+ +

GCC 3.3 triggers a bug in version 5.0 Alpha 03/27/98 of the Sun assembler, +which causes a bootstrap failure when linking the 64-bit shared version of +libgcc. A typical error message is: + +

     ld: fatal: relocation error: R_SPARC_32: file libgcc/sparcv9/_muldi3.o:
+       symbol <unknown>:  offset 0xffffffff7ec133e7 is non-aligned.
+
+

This bug has been fixed in the final 5.0 version of the assembler. + +

A similar problem was reported for version Sun WorkShop 6 99/08/18 of the +Sun assembler, which causes a bootstrap failure with GCC 4.0.0: + +

     ld: fatal: relocation error: R_SPARC_DISP32:
+       file .libs/libstdc++.lax/libsupc++convenience.a/vterminate.o:
+         symbol <unknown>: offset 0xfccd33ad is non-aligned
+
+

This bug has been fixed in more recent revisions of the assembler. + +


+ +

sparc-*-linux*

+ +

GCC versions 3.0 and higher require binutils 2.11.2 and glibc 2.2.4 +or newer on this platform. All earlier binutils and glibc +releases mishandled unaligned relocations on sparc-*-* targets. + +


+ +

sparc64-*-solaris2*

+ +

When configuring the GNU Multiple Precision Library (GMP) or the +MPFR library, the canonical target triplet must be specified as +the build parameter on the configure line. For example +on a Solaris 7 system: + +

        % ./configure --build=sparc64-sun-solaris2.7 --prefix=xxx
+
+

The following compiler flags must be specified in the configure +step in order to bootstrap this target with the Sun compiler: + +

        % CC="cc -xarch=v9 -xildoff" srcdir/configure [options] [target]
+
+

-xarch=v9 specifies the SPARC-V9 architecture to the Sun toolchain +and -xildoff turns off the incremental linker. + +


+ +

sparcv9-*-solaris2*

+ +

This is a synonym for sparc64-*-solaris2*. + +


+ +

*-*-sysv*

+ +

On System V release 3, you may get this error message +while linking: + +

     ld fatal: failed to write symbol name something
+      in strings table for file whatever
+
+

This probably indicates that the disk is full or your ulimit won't allow +the file to be as large as it needs to be. + +

This problem can also result because the kernel parameter MAXUMEM +is too small. If so, you must regenerate the kernel and make the value +much larger. The default value is reported to be 1024; a value of 32768 +is said to work. Smaller values may also work. + +

On System V, if you get an error like this, + +

     /usr/local/lib/bison.simple: In function `yyparse':
+     /usr/local/lib/bison.simple:625: virtual memory exhausted
+
+

that too indicates a problem with disk space, ulimit, or MAXUMEM. + +

On a System V release 4 system, make sure /usr/bin precedes +/usr/ucb in PATH. The cc command in +/usr/ucb uses libraries which have bugs. + +


+ +

vax-dec-ultrix

+ +

Don't try compiling with VAX C (vcc). It produces incorrect code +in some cases (for example, when alloca is used). + +


+ +

*-*-vxworks*

+ +

Support for VxWorks is in flux. At present GCC supports only the +very recent VxWorks 5.5 (aka Tornado 2.2) release, and only on PowerPC. +We welcome patches for other architectures supported by VxWorks 5.5. +Support for VxWorks AE would also be welcome; we believe this is merely +a matter of writing an appropriate “configlette” (see below). We are +not interested in supporting older, a.out or COFF-based, versions of +VxWorks in GCC 3. + +

VxWorks comes with an older version of GCC installed in +$WIND_BASE/host; we recommend you do not overwrite it. +Choose an installation prefix entirely outside $WIND_BASE. +Before running configure, create the directories prefix +and prefix/bin. Link or copy the appropriate assembler, +linker, etc. into prefix/bin, and set your PATH to +include that directory while running both configure and +make. + +

You must give configure the +--with-headers=$WIND_BASE/target/h switch so that it can +find the VxWorks system headers. Since VxWorks is a cross compilation +target only, you must also specify --target=target. +configure will attempt to create the directory +prefix/target/sys-include and copy files into it; +make sure the user running configure has sufficient privilege +to do so. + +

GCC's exception handling runtime requires a special “configlette” +module, contrib/gthr_supp_vxw_5x.c. Follow the instructions in +that file to add the module to your kernel build. (Future versions of +VxWorks will incorporate this module.) + +


+ +

x86_64-*-*, amd64-*-*

+ +

GCC supports the x86-64 architecture implemented by the AMD64 processor +(amd64-*-* is an alias for x86_64-*-*) on GNU/Linux, FreeBSD and NetBSD. +On GNU/Linux the default is a bi-arch compiler which is able to generate +both 64-bit x86-64 and 32-bit x86 code (via the -m32 switch). + +


+ +

xtensa-*-elf

+ +

This target is intended for embedded Xtensa systems using the +`newlib' C library. It uses ELF but does not support shared +objects. Designed-defined instructions specified via the +Tensilica Instruction Extension (TIE) language are only supported +through inline assembly. + +

The Xtensa configuration information must be specified prior to +building GCC. The include/xtensa-config.h header +file contains the configuration information. If you created your +own Xtensa configuration with the Xtensa Processor Generator, the +downloaded files include a customized copy of this header file, +which you can use to replace the default header file. + +


+ +

xtensa-*-linux*

+ +

This target is for Xtensa systems running GNU/Linux. It supports ELF +shared objects and the GNU C library (glibc). It also generates +position-independent code (PIC) regardless of whether the +-fpic or -fPIC options are used. In other +respects, this target is the same as the +`xtensa-*-elf' target. + +


+ +

Microsoft Windows (32-bit)

+ +

Ports of GCC are included with the +Cygwin environment. + +

GCC will build under Cygwin without modification; it does not build +with Microsoft's C++ compiler and there are no plans to make it do so. + +


+ +

OS/2

+ +

GCC does not currently support OS/2. However, Andrew Zabolotny has been +working on a generic OS/2 port with pgcc. The current code can be found +at http://www.goof.com/pcg/os2/. + +


+ +

Older systems

+ +

GCC contains support files for many older (1980s and early +1990s) Unix variants. For the most part, support for these systems +has not been deliberately removed, but it has not been maintained for +several years and may suffer from bitrot. + +

Starting with GCC 3.1, each release has a list of “obsoleted” systems. +Support for these systems is still present in that release, but +configure will fail unless the --enable-obsolete +option is given. Unless a maintainer steps forward, support for these +systems will be removed from the next release of GCC. + +

Support for old systems as hosts for GCC can cause problems if the +workarounds for compiler, library and operating system bugs affect the +cleanliness or maintainability of the rest of GCC. In some cases, to +bring GCC up on such a system, if still possible with current GCC, may +require first installing an old version of GCC which did work on that +system, and using it to compile a more recent GCC, to avoid bugs in the +vendor compiler. Old releases of GCC 1 and GCC 2 are available in the +old-releases directory on the GCC mirror sites. Header bugs may generally be avoided using +fixincludes, but bugs or deficiencies in libraries and the +operating system may still cause problems. + +

Support for older systems as targets for cross-compilation is less +problematic than support for them as hosts for GCC; if an enthusiast +wishes to make such a target work again (including resurrecting any of +the targets that never worked with GCC 2, starting from the last +version before they were removed), patches +following the usual requirements would be +likely to be accepted, since they should not affect the support for more +modern targets. + +

For some systems, old versions of GNU binutils may also be useful, +and are available from pub/binutils/old-releases on +sourceware.org mirror sites. + +

Some of the information on specific systems above relates to +such older systems, but much of the information +about GCC on such systems (which may no longer be applicable to +current GCC) is to be found in the GCC texinfo manual. + +


+ +

all ELF targets (SVR4, Solaris 2, etc.)

+ +

C++ support is significantly better on ELF targets if you use the +GNU linker; duplicate copies of +inlines, vtables and template instantiations will be discarded +automatically. + +


+

Return to the GCC Installation page + + + + + + + diff -Nru INSTALL/test.html INSTALL/test.html --- INSTALL/test.html 1970-01-01 01:00:00.000000000 +0100 +++ INSTALL/test.html 2012-12-31 17:06:08.000000000 +0100 @@ -0,0 +1,234 @@ + + +Installing GCC: Testing + + + + + + + + + + +

Installing GCC: Testing

+ +Before you install GCC, we encourage you to run the testsuites and to +compare your results with results from a similar configuration that have +been submitted to the +gcc-testresults mailing list. +Some of these archived results are linked from the build status lists +at http://gcc.gnu.org/buildstat.html, although not everyone who +reports a successful build runs the testsuites and submits the results. +This step is optional and may require you to download additional software, +but it can give you confidence in your new GCC installation or point out +problems before you install and start using your new GCC. + +

First, you must have downloaded the testsuites. +These are part of the full distribution, but if you downloaded the +“core” compiler plus any front ends, you must download the testsuites +separately. + +

Second, you must have the testing tools installed. This includes +DejaGnu, Tcl, and Expect; +the DejaGnu site has links to these. + +

If the directories where runtest and expect were +installed are not in the PATH, you may need to set the following +environment variables appropriately, as in the following example (which +assumes that DejaGnu has been installed under /usr/local): + +

          TCL_LIBRARY = /usr/local/share/tcl8.0
+          DEJAGNULIBS = /usr/local/share/dejagnu
+
+

(On systems such as Cygwin, these paths are required to be actual +paths, not mounts or links; presumably this is due to some lack of +portability in the DejaGnu code.) + +

Finally, you can run the testsuite (which may take a long time): +

          cd objdir; make -k check
+
+

This will test various components of GCC, such as compiler +front ends and runtime libraries. While running the testsuite, DejaGnu +might emit some harmless messages resembling +`WARNING: Couldn't find the global config file.' or +`WARNING: Couldn't find tool init file' that can be ignored. + +

0.1 How can you run the testsuite on selected tests?

+ +

In order to run sets of tests selectively, there are targets +`make check-gcc' and `make check-g++' +in the gcc subdirectory of the object directory. You can also +just run `make check' in a subdirectory of the object directory. + +

A more selective way to just run all gcc execute tests in the +testsuite is to use + +

         make check-gcc RUNTESTFLAGS="execute.exp other-options"
+
+

Likewise, in order to run only the g++ “old-deja” tests in +the testsuite with filenames matching `9805*', you would use + +

         make check-g++ RUNTESTFLAGS="old-deja.exp=9805* other-options"
+
+

The *.exp files are located in the testsuite directories of the GCC +source, the most important ones being compile.exp, +execute.exp, dg.exp and old-deja.exp. +To get a list of the possible *.exp files, pipe the +output of `make check' into a file and look at the +`Running ... .exp' lines. + +

0.2 Passing options and running multiple testsuites

+ +

You can pass multiple options to the testsuite using the +`--target_board' option of DejaGNU, either passed as part of +`RUNTESTFLAGS', or directly to runtest if you prefer to +work outside the makefiles. For example, + +

         make check-g++ RUNTESTFLAGS="--target_board=unix/-O3/-fno-strength-reduce"
+
+

will run the standard g++ testsuites (“unix” is the target name +for a standard native testsuite situation), passing +`-O3 -fno-strength-reduce' to the compiler on every test, i.e., +slashes separate options. + +

You can run the testsuites multiple times using combinations of options +with a syntax similar to the brace expansion of popular shells: + +

         ..."--target_board=arm-sim/{-mhard-float,-msoft-float}{-O1,-O2,-O3,}"
+
+

(Note the empty option caused by the trailing comma in the final group.) +The following will run each testsuite eight times using the `arm-sim' +target, as if you had specified all possible combinations yourself: + +

         --target_board=arm-sim/-mhard-float/-O1
+         --target_board=arm-sim/-mhard-float/-O2
+         --target_board=arm-sim/-mhard-float/-O3
+         --target_board=arm-sim/-mhard-float
+         --target_board=arm-sim/-msoft-float/-O1
+         --target_board=arm-sim/-msoft-float/-O2
+         --target_board=arm-sim/-msoft-float/-O3
+         --target_board=arm-sim/-msoft-float
+
+

They can be combined as many times as you wish, in arbitrary ways. This +list: + +

         ..."--target_board=unix/-Wextra{-O3,-fno-strength-reduce}{-fomit-frame-pointer,}"
+
+

will generate four combinations, all involving `-Wextra'. + +

The disadvantage to this method is that the testsuites are run in serial, +which is a waste on multiprocessor systems. For users with GNU Make and +a shell which performs brace expansion, you can run the testsuites in +parallel by having the shell perform the combinations and make +do the parallel runs. Instead of using `--target_board', use a +special makefile target: + +

         make -jN check-testsuite//test-target/option1/option2/...
+
+

For example, + +

         make -j3 check-gcc//sh-hms-sim/{-m1,-m2,-m3,-m3e,-m4}/{,-nofpu}
+
+

will run three concurrent “make-gcc” testsuites, eventually testing all +ten combinations as described above. Note that this is currently only +supported in the gcc subdirectory. (To see how this works, try +typing echo before the example given here.) + +

0.3 Additional testing for Java Class Libraries

+ +

The Java runtime tests can be executed via `make check' +in the target/libjava/testsuite directory in +the build tree. + +

The Mauve Project provides +a suite of tests for the Java Class Libraries. This suite can be run +as part of libgcj testing by placing the Mauve tree within the libjava +testsuite at libjava/testsuite/libjava.mauve/mauve, or by +specifying the location of that tree when invoking `make', as in +`make MAUVEDIR=~/mauve check'. + +

Jacks +is a free testsuite that tests Java compiler front ends. This suite +can be run as part of libgcj testing by placing the Jacks tree within +the libjava testsuite at libjava/testsuite/libjava.jacks/jacks. + +

0.4 How to interpret test results

+ +

The result of running the testsuite are various *.sum and *.log +files in the testsuite subdirectories. The *.log files contain a +detailed log of the compiler invocations and the corresponding +results, the *.sum files summarize the results. These summaries +contain status codes for all tests: + +

    +
  • PASS: the test passed as expected +
  • XPASS: the test unexpectedly passed +
  • FAIL: the test unexpectedly failed +
  • XFAIL: the test failed as expected +
  • UNSUPPORTED: the test is not supported on this platform +
  • ERROR: the testsuite detected an error +
  • WARNING: the testsuite detected a possible problem +
+ +

It is normal for some tests to report unexpected failures. At the +current time the testing harness does not allow fine grained control +over whether or not a test is expected to fail. This problem should +be fixed in future releases. + +

0.5 Submitting test results

+ +

If you want to report the results to the GCC project, use the +contrib/test_summary shell script. Start it in the objdir with + +

         srcdir/contrib/test_summary -p your_commentary.txt \
+             -m gcc-testresults@gcc.gnu.org |sh
+
+

This script uses the Mail program to send the results, so +make sure it is in your PATH. The file your_commentary.txt is +prepended to the testsuite summary and should contain any special +remarks you have on your results or your build environment. Please +do not edit the testsuite result block or the subject line, as these +messages may be automatically processed. + +


+

Return to the GCC Installation page + + + + + + + + + + diff -Nru config/ChangeLog config/ChangeLog --- config/ChangeLog 2010-10-14 22:27:59.000000000 +0200 +++ config/ChangeLog 2012-12-31 17:06:00.000000000 +0100 @@ -1,3 +1,15 @@ +2008-05-19 Release Manager + + * GCC 4.2.4 released. + +2008-02-01 Release Manager + + * GCC 4.2.3 released. + +2007-10-07 Release Manager + + * GCC 4.2.2 released. + 2007-07-19 Release Manager * GCC 4.2.1 released. diff -Nru configure configure --- configure 2010-10-14 22:28:01.000000000 +0200 +++ configure 2012-12-31 17:06:00.000000000 +0100 @@ -3762,7 +3762,7 @@ # For an installed makeinfo, we require it to be from texinfo 4.4 or # higher, else we use the "missing" dummy. if ${MAKEINFO} --version \ - | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then + | egrep 'texinfo[^0-9]*(4\.([4-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then : else MAKEINFO="$MISSING makeinfo" diff -Nru configure.in configure.in --- configure.in 2010-10-14 22:28:01.000000000 +0200 +++ configure.in 2012-12-31 17:06:00.000000000 +0100 @@ -2265,7 +2265,7 @@ # For an installed makeinfo, we require it to be from texinfo 4.4 or # higher, else we use the "missing" dummy. if ${MAKEINFO} --version \ - | egrep 'texinfo[^0-9]*([1-3][0-9]|4\.[4-9]|[5-9])' >/dev/null 2>&1; then + | egrep 'texinfo[^0-9]*(4\.([4-9]|[1-9][0-9])|[5-9]|[1-9][0-9])' >/dev/null 2>&1; then : else MAKEINFO="$MISSING makeinfo" diff -Nru contrib/ChangeLog contrib/ChangeLog --- contrib/ChangeLog 2010-10-14 22:27:59.000000000 +0200 +++ contrib/ChangeLog 2012-12-31 17:06:00.000000000 +0100 @@ -1,3 +1,19 @@ +2008-05-19 Release Manager + + * GCC 4.2.4 released. + +2008-04-01 Joseph Myers + + * texi2pod.pl: Update from trunk. + +2008-02-01 Release Manager + + * GCC 4.2.3 released. + +2007-10-07 Release Manager + + * GCC 4.2.2 released. + 2007-07-19 Release Manager * GCC 4.2.1 released. diff -Nru contrib/reghunt/ChangeLog contrib/reghunt/ChangeLog --- contrib/reghunt/ChangeLog 2010-10-14 22:27:58.000000000 +0200 +++ contrib/reghunt/ChangeLog 2012-12-31 17:06:00.000000000 +0100 @@ -1,3 +1,15 @@ +2008-05-19 Release Manager + + * GCC 4.2.4 released. + +2008-02-01 Release Manager + + * GCC 4.2.3 released. + +2007-10-07 Release Manager + + * GCC 4.2.2 released. + 2007-07-19 Release Manager * GCC 4.2.1 released. diff -Nru contrib/regression/ChangeLog contrib/regression/ChangeLog --- contrib/regression/ChangeLog 2010-10-14 22:27:58.000000000 +0200 +++ contrib/regression/ChangeLog 2012-12-31 17:06:00.000000000 +0100 @@ -1,3 +1,15 @@ +2008-05-19 Release Manager + + * GCC 4.2.4 released. + +2008-02-01 Release Manager + + * GCC 4.2.3 released. + +2007-10-07 Release Manager + + * GCC 4.2.2 released. + 2007-07-19 Release Manager * GCC 4.2.1 released. diff -Nru contrib/texi2pod.pl contrib/texi2pod.pl --- contrib/texi2pod.pl 2010-10-14 22:27:59.000000000 +0200 +++ contrib/texi2pod.pl 2012-12-31 17:06:00.000000000 +0100 @@ -6,7 +6,7 @@ # GCC is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) +# the Free Software Foundation; either version 3, or (at your option) # any later version. # GCC is distributed in the hope that it will be useful, @@ -218,9 +218,11 @@ s/\@\}/}/g; s/\@\@/&at;/g; - # Inside a verbatim block, handle @var specially. + # Inside a verbatim block, handle @var, @samp and @url specially. if ($shift ne "") { s/\@var\{([^\}]*)\}/<$1>/g; + s/\@samp\{([^\}]*)\}/"$1"/g; + s/\@url\{([^\}]*)\}/<$1>/g; } # POD doesn't interpret E<> inside a verbatim block. @@ -250,7 +252,7 @@ next; }; - /^\@(?:section|unnumbered|unnumberedsec|center)\s+(.+)$/ + /^\@(?:section|unnumbered|unnumberedsec|center|heading)\s+(.+)$/ and $_ = "\n=head2 $1\n"; /^\@subsection\s+(.+)$/ and $_ = "\n=head3 $1\n"; @@ -297,6 +299,7 @@ $ic =~ s/\@(?:code|kbd)/C/; $ic =~ s/\@(?:dfn|var|emph|cite|i)/I/; $ic =~ s/\@(?:file)/F/; + $ic =~ s/\@(?:asis)//; $_ = "\n=over 4\n"; }; @@ -319,8 +322,18 @@ /^\@itemx?\s*(.+)?$/ and do { if (defined $1) { - # Entity escapes prevent munging by the <> processing below. - $_ = "\n=item $ic\<$1\>\n"; + if ($ic) { + if ($endw eq "enumerate") { + $_ = "\n=item $ic $1\n"; + $ic =~ s/(\d+)/$1 + 1/eg; + } else { + # Entity escapes prevent munging by the <> + # processing below. + $_ = "\n=item $ic\<$1\>\n"; + } + } else { + $_ = "\n=item $1\n"; + } } else { $_ = "\n=item $ic\n"; $ic =~ y/A-Ya-y/B-Zb-z/; @@ -376,7 +389,7 @@ s/\@r\{([^\}]*)\}/R<$1>/g; s/\@(?:dfn|var|emph|cite|i)\{([^\}]*)\}/I<$1>/g; s/\@(?:code|kbd)\{([^\}]*)\}/C<$1>/g; - s/\@(?:gccoptlist|samp|strong|key|option|env|command|b)\{([^\}]*)\}/B<$1>/g; + s/\@(?:samp|strong|key|option|env|command|b)\{([^\}]*)\}/B<$1>/g; s/\@sc\{([^\}]*)\}/\U$1/g; s/\@file\{([^\}]*)\}/F<$1>/g; s/\@w\{([^\}]*)\}/S<$1>/g; @@ -412,6 +425,10 @@ s/\@uref\{([^\},]*),([^\},]*)\}/$2 (C<$1>)/g; s/\@uref\{([^\},]*),([^\},]*),([^\},]*)\}/$3/g; + # Handle gccoptlist here, so it can contain the above formatting + # commands. + s/\@gccoptlist\{([^\}]*)\}/B<$1>/g; + # Un-escape <> at this point. s/<//g; diff -Nru fixincludes/fixincl.x fixincludes/fixincl.x --- fixincludes/fixincl.x 2010-10-14 22:28:01.000000000 +0200 +++ fixincludes/fixincl.x 2012-12-31 17:06:00.000000000 +0100 @@ -5654,7 +5654,7 @@ static const char* apzSolaris_Math_4Patch[] = { "format", "#define\tfpclassify(x) \\\n\ - __extension__ ({ __typeof(x) __x_fp = (x); \\\n\ + __extension__ ({ const __typeof(x) __x_fp = (x); \\\n\ \t\t isnan(__x_fp) \\\n\ \t\t ? FP_NAN \\\n\ \t\t : isinf(__x_fp) \\\n\ @@ -5707,8 +5707,12 @@ static const char* apzSolaris_Math_5Patch[] = { "format", "#define\tisfinite(x) \\\n\ - __extension__ ({ __typeof (x) __x_f = (x); \\\n\ -\t\t __builtin_expect(!isnan(__x_f - __x_f), 1); })", + __extension__ ({ const __typeof (x) __x_f = (x); \\\n\ +\t\t __builtin_expect(sizeof(__x_f) == sizeof(float) \\\n\ +\t\t\t ? islessequal(__builtin_fabsf(__x_f),__FLT_MAX__) \\\n\ +\t\t\t : sizeof(__x_f) == sizeof(long double) \\\n\ +\t\t\t ? islessequal(__builtin_fabsl(__x_f),__LDBL_MAX__) \\\n\ +\t\t\t : islessequal(__builtin_fabs(__x_f),__DBL_MAX__), 1); })", "^#define[ \t]+isfinite\\(x\\)[ \t]+__builtin_isfinite\\(x\\)", (char*)NULL }; @@ -5752,8 +5756,12 @@ static const char* apzSolaris_Math_6Patch[] = { "format", "#define\tisinf(x) \\\n\ - __extension__ ({ __typeof (x) __x_i = (x); \\\n\ -\t\t __builtin_expect(!isnan(__x_i) && !isfinite(__x_i), 0); })", + __extension__ ({ const __typeof (x) __x_i = (x); \\\n\ +\t\t __builtin_expect(sizeof(__x_i) == sizeof(float) \\\n\ +\t\t\t ? isgreater(__builtin_fabsf(__x_i),__FLT_MAX__) \\\n\ +\t\t\t : sizeof(__x_i) == sizeof(long double) \\\n\ +\t\t\t ? isgreater(__builtin_fabsl(__x_i),__LDBL_MAX__) \\\n\ +\t\t\t : isgreater(__builtin_fabs(__x_i),__DBL_MAX__), 0); })", "^#define[ \t]+isinf\\(x\\)[ \t]+__builtin_isinf\\(x\\)", (char*)NULL }; @@ -5797,14 +5805,13 @@ static const char* apzSolaris_Math_7Patch[] = { "format", "#define\tisnormal(x) \\\n\ - __extension__ ({ __typeof(x) __x_n = (x); \\\n\ -\t\t if (__x_n < 0.0) __x_n = -__x_n; \\\n\ + __extension__ ({ const __typeof(x) __x_n = (x); \\\n\ \t\t __builtin_expect(isfinite(__x_n) \\\n\ \t\t\t\t && (sizeof(__x_n) == sizeof(float) \\\n\ -\t\t\t\t\t ? __x_n >= __FLT_MIN__ \\\n\ +\t\t\t\t\t ? isgreaterequal(__builtin_fabsf(__x_n),__FLT_MIN__) \\\n\ \t\t\t\t\t : sizeof(__x_n) == sizeof(long double) \\\n\ -\t\t\t\t\t ? __x_n >= __LDBL_MIN__ \\\n\ -\t\t\t\t\t : __x_n >= __DBL_MIN__), 1); })", +\t\t\t\t\t ? isgreaterequal(__builtin_fabsl(__x_n),__LDBL_MIN__) \\\n\ +\t\t\t\t\t : isgreaterequal(__builtin_fabs(__x_n),__DBL_MIN__)), 1); })", "^#define[ \t]+isnormal\\(x\\)[ \t]+__builtin_isnormal\\(x\\)", (char*)NULL }; @@ -5900,6 +5907,52 @@ /* * * * * * * * * * * * * * * * * * * * * * * * * * * + * Description of Solaris_Math_10 fix + */ +tSCC zSolaris_Math_10Name[] = + "solaris_math_10"; + +/* + * File name selection pattern + */ +tSCC zSolaris_Math_10List[] = + "|iso/math_c99.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzSolaris_Math_10Machs (const char**)NULL + +/* + * content selection pattern - do fix if pattern found + */ +tSCC zSolaris_Math_10Select0[] = + "@\\(#\\)math_c99.h[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + +#define SOLARIS_MATH_10_TEST_CT 1 +static tTestDesc aSolaris_Math_10Tests[] = { + { TT_EGREP, zSolaris_Math_10Select0, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Solaris_Math_10 + */ +static const char* apzSolaris_Math_10Patch[] = { + "format", + "#define isinf(x)\t__extension__ ( {\t\t\t\t\\\n\ +\t\t\tconst __typeof(x) __x_i = (x);\t\t\t\\\n\ +\t\t\t__builtin_expect(sizeof(__x_i) == sizeof(float)\t\\\n\ +\t\t\t? isgreater(__builtin_fabsf(__x_i),__FLT_MAX__) \\\n\ +\t\t\t: sizeof(__x_i) == sizeof(long double)\t\t\\\n\ +\t\t\t? isgreater(__builtin_fabsl(__x_i),__LDBL_MAX__)\\\n\ +\t\t\t: isgreater(__builtin_fabs(__x_i),__DBL_MAX__), 0);\\\n\ +\t})", + "^#define[ \t]+isinf\\(x\\)[ \t]+__extension__\\([ \t]*\\\\\n\ +[ \t]*\\{[ \t]*__typeof\\(x\\)[ \t]*__x_i[ \t]*=[ \t]*\\(x\\);[ \t]*\\\\\n\ +[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*INFINITY[ \t]*\\|\\|[ \t]*\\\\\n\ +[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*\\(-INFINITY\\);[ \t]*\\}\\)", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * * Description of Solaris_Mutex_Init_1 fix */ tSCC zSolaris_Mutex_Init_1Name[] = @@ -8581,9 +8634,9 @@ * * List of all fixes */ -#define REGEX_COUNT 253 +#define REGEX_COUNT 254 #define MACH_LIST_SIZE_LIMIT 261 -#define FIX_COUNT 211 +#define FIX_COUNT 212 /* * Enumerate the fixes @@ -8732,6 +8785,7 @@ SOLARIS_MATH_7_FIXIDX, SOLARIS_MATH_8_FIXIDX, SOLARIS_MATH_9_FIXIDX, + SOLARIS_MATH_10_FIXIDX, SOLARIS_MUTEX_INIT_1_FIXIDX, SOLARIS_MUTEX_INIT_2_FIXIDX, SOLARIS_RWLOCK_INIT_1_FIXIDX, @@ -9518,6 +9572,11 @@ SOLARIS_MATH_9_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, aSolaris_Math_9Tests, apzSolaris_Math_9Patch, 0 }, + { zSolaris_Math_10Name, zSolaris_Math_10List, + apzSolaris_Math_10Machs, + SOLARIS_MATH_10_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, + aSolaris_Math_10Tests, apzSolaris_Math_10Patch, 0 }, + { zSolaris_Mutex_Init_1Name, zSolaris_Mutex_Init_1List, apzSolaris_Mutex_Init_1Machs, SOLARIS_MUTEX_INIT_1_TEST_CT, FD_MACH_ONLY, diff -Nru fixincludes/inclhack.def fixincludes/inclhack.def --- fixincludes/inclhack.def 2010-10-14 22:28:01.000000000 +0200 +++ fixincludes/inclhack.def 2012-12-31 17:06:00.000000000 +0100 @@ -3097,7 +3097,7 @@ files = iso/math_c99.h; c_fix = format; c_fix_arg = "#define\tfpclassify(x) \\\n" - " __extension__ ({ __typeof(x) __x_fp = (x); \\\n" + " __extension__ ({ const __typeof(x) __x_fp = (x); \\\n" "\t\t isnan(__x_fp) \\\n" "\t\t ? FP_NAN \\\n" "\t\t : isinf(__x_fp) \\\n" @@ -3121,8 +3121,12 @@ files = iso/math_c99.h; c_fix = format; c_fix_arg = "#define\tisfinite(x) \\\n" - " __extension__ ({ __typeof (x) __x_f = (x); \\\n" - "\t\t __builtin_expect(!isnan(__x_f - __x_f), 1); })"; + " __extension__ ({ const __typeof (x) __x_f = (x); \\\n" + "\t\t __builtin_expect(sizeof(__x_f) == sizeof(float) \\\n" + "\t\t\t ? islessequal(__builtin_fabsf(__x_f),__FLT_MAX__) \\\n" + "\t\t\t : sizeof(__x_f) == sizeof(long double) \\\n" + "\t\t\t ? islessequal(__builtin_fabsl(__x_f),__LDBL_MAX__) \\\n" + "\t\t\t : islessequal(__builtin_fabs(__x_f),__DBL_MAX__), 1); })"; c_fix_arg = "^#define[ \t]+isfinite\\(x\\)[ \t]+__builtin_isfinite\\(x\\)"; test_text = '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n" @@ -3137,8 +3141,12 @@ files = iso/math_c99.h; c_fix = format; c_fix_arg = "#define\tisinf(x) \\\n" - " __extension__ ({ __typeof (x) __x_i = (x); \\\n" - "\t\t __builtin_expect(!isnan(__x_i) && !isfinite(__x_i), 0); })"; + " __extension__ ({ const __typeof (x) __x_i = (x); \\\n" + "\t\t __builtin_expect(sizeof(__x_i) == sizeof(float) \\\n" + "\t\t\t ? isgreater(__builtin_fabsf(__x_i),__FLT_MAX__) \\\n" + "\t\t\t : sizeof(__x_i) == sizeof(long double) \\\n" + "\t\t\t ? isgreater(__builtin_fabsl(__x_i),__LDBL_MAX__) \\\n" + "\t\t\t : isgreater(__builtin_fabs(__x_i),__DBL_MAX__), 0); })"; c_fix_arg = "^#define[ \t]+isinf\\(x\\)[ \t]+__builtin_isinf\\(x\\)"; test_text = '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n" @@ -3153,14 +3161,13 @@ files = iso/math_c99.h; c_fix = format; c_fix_arg = "#define\tisnormal(x) \\\n" - " __extension__ ({ __typeof(x) __x_n = (x); \\\n" - "\t\t if (__x_n < 0.0) __x_n = -__x_n; \\\n" + " __extension__ ({ const __typeof(x) __x_n = (x); \\\n" "\t\t __builtin_expect(isfinite(__x_n) \\\n" "\t\t\t\t && (sizeof(__x_n) == sizeof(float) \\\n" - "\t\t\t\t\t ? __x_n >= __FLT_MIN__ \\\n" + "\t\t\t\t\t ? isgreaterequal(__builtin_fabsf(__x_n),__FLT_MIN__) \\\n" "\t\t\t\t\t : sizeof(__x_n) == sizeof(long double) \\\n" - "\t\t\t\t\t ? __x_n >= __LDBL_MIN__ \\\n" - "\t\t\t\t\t : __x_n >= __DBL_MIN__), 1); })"; + "\t\t\t\t\t ? isgreaterequal(__builtin_fabsl(__x_n),__LDBL_MIN__) \\\n" + "\t\t\t\t\t : isgreaterequal(__builtin_fabs(__x_n),__DBL_MIN__)), 1); })"; c_fix_arg = "^#define[ \t]+isnormal\\(x\\)[ \t]+__builtin_isnormal\\(x\\)"; test_text = '#ident "@(#)math_c99.h 1.9 04/11/01 SMI"'"\n" @@ -3209,6 +3216,36 @@ "#undef isunordered\n" "#define isunordered(x, y) ((x) __builtin_isunordered(y))"; }; +/* + * On Solaris 11, if you do isinf(NaN) you'll get a floating point + * exception. Provide an alternative using GCC's builtin macros. + */ + +fix = { + hackname = solaris_math_10; + select = '@\(#\)math_c99.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI"; + files = iso/math_c99.h; + c_fix = format; + c_fix_arg = "#define isinf(x)\t__extension__ ( {\t\t\t\t\\\n" + "\t\t\tconst __typeof(x) __x_i = (x);\t\t\t\\\n" + "\t\t\t__builtin_expect(sizeof(__x_i) == sizeof(float)\t\\\n" + "\t\t\t? isgreater(__builtin_fabsf(__x_i),__FLT_MAX__) \\\n" + "\t\t\t: sizeof(__x_i) == sizeof(long double)\t\t\\\n" + "\t\t\t? isgreater(__builtin_fabsl(__x_i),__LDBL_MAX__)\\\n" + "\t\t\t: isgreater(__builtin_fabs(__x_i),__DBL_MAX__), 0);\\\n" + "\t})"; + c_fix_arg = "^#define[ \t]+isinf\\(x\\)[ \t]+__extension__\\([ \t]*\\\\\n" + "[ \t]*\\{[ \t]*__typeof\\(x\\)[ \t]*__x_i[ \t]*=[ \t]*\\(x\\);[ \t]*\\\\\n" + "[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*INFINITY[ \t]*\\|\\|[ \t]*\\\\\n" + "[ \t]*__x_i[ \t]*==[ \t]*\\(__typeof\\(__x_i\\)\\)[ \t]*\\(-INFINITY\\);[ \t]*\\}\\)"; + test_text = + '#pragma ident "@(#)math_c99.h 1.12 07/01/21 SMI"'"\n" + "#undef isinf\n" + "#define isinf(x) __extension__( \\\\\n" + " { __typeof(x) __x_i = (x); \\\\\n" + " __x_i == (__typeof(__x_i)) INFINITY || \\\\\n" + " __x_i == (__typeof(__x_i)) (-INFINITY); })"; +}; /* * Sun Solaris 2.5.1, 2.6 defines PTHREAD_{MUTEX|COND}_INITIALIZER diff -Nru fixincludes/tests/base/iso/math_c99.h fixincludes/tests/base/iso/math_c99.h --- fixincludes/tests/base/iso/math_c99.h 2010-10-14 22:28:01.000000000 +0200 +++ fixincludes/tests/base/iso/math_c99.h 2012-12-31 17:06:01.000000000 +0100 @@ -38,7 +38,7 @@ #ident "@(#)math_c99.h 1.9 04/11/01 SMI" #undef fpclassify #define fpclassify(x) \ - __extension__ ({ __typeof(x) __x_fp = (x); \ + __extension__ ({ const __typeof(x) __x_fp = (x); \ isnan(__x_fp) \ ? FP_NAN \ : isinf(__x_fp) \ @@ -55,8 +55,12 @@ #ident "@(#)math_c99.h 1.9 04/11/01 SMI" #undef isfinite #define isfinite(x) \ - __extension__ ({ __typeof (x) __x_f = (x); \ - __builtin_expect(!isnan(__x_f - __x_f), 1); }) + __extension__ ({ const __typeof (x) __x_f = (x); \ + __builtin_expect(sizeof(__x_f) == sizeof(float) \ + ? islessequal(__builtin_fabsf(__x_f),__FLT_MAX__) \ + : sizeof(__x_f) == sizeof(long double) \ + ? islessequal(__builtin_fabsl(__x_f),__LDBL_MAX__) \ + : islessequal(__builtin_fabs(__x_f),__DBL_MAX__), 1); }) #endif /* SOLARIS_MATH_5_CHECK */ @@ -64,8 +68,12 @@ #ident "@(#)math_c99.h 1.9 04/11/01 SMI" #undef isinf #define isinf(x) \ - __extension__ ({ __typeof (x) __x_i = (x); \ - __builtin_expect(!isnan(__x_i) && !isfinite(__x_i), 0); }) + __extension__ ({ const __typeof (x) __x_i = (x); \ + __builtin_expect(sizeof(__x_i) == sizeof(float) \ + ? isgreater(__builtin_fabsf(__x_i),__FLT_MAX__) \ + : sizeof(__x_i) == sizeof(long double) \ + ? isgreater(__builtin_fabsl(__x_i),__LDBL_MAX__) \ + : isgreater(__builtin_fabs(__x_i),__DBL_MAX__), 0); }) #endif /* SOLARIS_MATH_6_CHECK */ @@ -73,14 +81,13 @@ #ident "@(#)math_c99.h 1.9 04/11/01 SMI" #undef isnormal #define isnormal(x) \ - __extension__ ({ __typeof(x) __x_n = (x); \ - if (__x_n < 0.0) __x_n = -__x_n; \ + __extension__ ({ const __typeof(x) __x_n = (x); \ __builtin_expect(isfinite(__x_n) \ && (sizeof(__x_n) == sizeof(float) \ - ? __x_n >= __FLT_MIN__ \ + ? isgreaterequal(__builtin_fabsf(__x_n),__FLT_MIN__) \ : sizeof(__x_n) == sizeof(long double) \ - ? __x_n >= __LDBL_MIN__ \ - : __x_n >= __DBL_MIN__), 1); }) + ? isgreaterequal(__builtin_fabsl(__x_n),__LDBL_MIN__) \ + : isgreaterequal(__builtin_fabs(__x_n),__DBL_MIN__)), 1); }) #endif /* SOLARIS_MATH_7_CHECK */ @@ -110,3 +117,17 @@ #undef isunordered #define isunordered(x, y) __builtin_isunordered(x, y) #endif /* SOLARIS_MATH_9_CHECK */ + + +#if defined( SOLARIS_MATH_10_CHECK ) +#pragma ident "@(#)math_c99.h 1.12 07/01/21 SMI" +#undef isinf +#define isinf(x) __extension__ ( { \ + const __typeof(x) __x_i = (x); \ + __builtin_expect(sizeof(__x_i) == sizeof(float) \ + ? isgreater(__builtin_fabsf(__x_i),__FLT_MAX__) \ + : sizeof(__x_i) == sizeof(long double) \ + ? isgreater(__builtin_fabsl(__x_i),__LDBL_MAX__)\ + : isgreater(__builtin_fabs(__x_i),__DBL_MAX__), 0);\ + }) +#endif /* SOLARIS_MATH_10_CHECK */ diff -Nru gcc/BASE-VER gcc/BASE-VER --- gcc/BASE-VER 2010-10-14 22:27:54.000000000 +0200 +++ gcc/BASE-VER 2012-12-31 17:06:01.000000000 +0100 @@ -1 +1 @@ -4.2.1 +4.2.4 diff -Nru gcc/COPYING3 gcc/COPYING3 --- gcc/COPYING3 1970-01-01 01:00:00.000000000 +0100 +++ gcc/COPYING3 2012-12-31 17:06:04.000000000 +0100 @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff -Nru gcc/COPYING3.LIB gcc/COPYING3.LIB --- gcc/COPYING3.LIB 1970-01-01 01:00:00.000000000 +0100 +++ gcc/COPYING3.LIB 2012-12-31 17:06:04.000000000 +0100 @@ -0,0 +1,165 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + + This version of the GNU Lesser General Public License incorporates +the terms and conditions of version 3 of the GNU General Public +License, supplemented by the additional permissions listed below. + + 0. Additional Definitions. + + As used herein, "this License" refers to version 3 of the GNU Lesser +General Public License, and the "GNU GPL" refers to version 3 of the GNU +General Public License. + + "The Library" refers to a covered work governed by this License, +other than an Application or a Combined Work as defined below. + + An "Application" is any work that makes use of an interface provided +by the Library, but which is not otherwise based on the Library. +Defining a subclass of a class defined by the Library is deemed a mode +of using an interface provided by the Library. + + A "Combined Work" is a work produced by combining or linking an +Application with the Library. The particular version of the Library +with which the Combined Work was made is also called the "Linked +Version". + + The "Minimal Corresponding Source" for a Combined Work means the +Corresponding Source for the Combined Work, excluding any source code +for portions of the Combined Work that, considered in isolation, are +based on the Application, and not on the Linked Version. + + The "Corresponding Application Code" for a Combined Work means the +object code and/or source code for the Application, including any data +and utility programs needed for reproducing the Combined Work from the +Application, but excluding the System Libraries of the Combined Work. + + 1. Exception to Section 3 of the GNU GPL. + + You may convey a covered work under sections 3 and 4 of this License +without being bound by section 3 of the GNU GPL. + + 2. Conveying Modified Versions. + + If you modify a copy of the Library, and, in your modifications, a +facility refers to a function or data to be supplied by an Application +that uses the facility (other than as an argument passed when the +facility is invoked), then you may convey a copy of the modified +version: + + a) under this License, provided that you make a good faith effort to + ensure that, in the event an Application does not supply the + function or data, the facility still operates, and performs + whatever part of its purpose remains meaningful, or + + b) under the GNU GPL, with none of the additional permissions of + this License applicable to that copy. + + 3. Object Code Incorporating Material from Library Header Files. + + The object code form of an Application may incorporate material from +a header file that is part of the Library. You may convey such object +code under terms of your choice, provided that, if the incorporated +material is not limited to numerical parameters, data structure +layouts and accessors, or small macros, inline functions and templates +(ten or fewer lines in length), you do both of the following: + + a) Give prominent notice with each copy of the object code that the + Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the object code with a copy of the GNU GPL and this license + document. + + 4. Combined Works. + + You may convey a Combined Work under terms of your choice that, +taken together, effectively do not restrict modification of the +portions of the Library contained in the Combined Work and reverse +engineering for debugging such modifications, if you also do each of +the following: + + a) Give prominent notice with each copy of the Combined Work that + the Library is used in it and that the Library and its use are + covered by this License. + + b) Accompany the Combined Work with a copy of the GNU GPL and this license + document. + + c) For a Combined Work that displays copyright notices during + execution, include the copyright notice for the Library among + these notices, as well as a reference directing the user to the + copies of the GNU GPL and this license document. + + d) Do one of the following: + + 0) Convey the Minimal Corresponding Source under the terms of this + License, and the Corresponding Application Code in a form + suitable for, and under terms that permit, the user to + recombine or relink the Application with a modified version of + the Linked Version to produce a modified Combined Work, in the + manner specified by section 6 of the GNU GPL for conveying + Corresponding Source. + + 1) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (a) uses at run time + a copy of the Library already present on the user's computer + system, and (b) will operate properly with a modified version + of the Library that is interface-compatible with the Linked + Version. + + e) Provide Installation Information, but only if you would otherwise + be required to provide such information under section 6 of the + GNU GPL, and only to the extent that such information is + necessary to install and execute a modified version of the + Combined Work produced by recombining or relinking the + Application with a modified version of the Linked Version. (If + you use option 4d0, the Installation Information must accompany + the Minimal Corresponding Source and Corresponding Application + Code. If you use option 4d1, you must provide the Installation + Information in the manner specified by section 6 of the GNU GPL + for conveying Corresponding Source.) + + 5. Combined Libraries. + + You may place library facilities that are a work based on the +Library side by side in a single library together with other library +facilities that are not Applications and are not covered by this +License, and convey such a combined library under terms of your +choice, if you do both of the following: + + a) Accompany the combined library with a copy of the same work based + on the Library, uncombined with any other library facilities, + conveyed under the terms of this License. + + b) Give prominent notice with the combined library that part of it + is a work based on the Library, and explaining where to find the + accompanying uncombined form of the same work. + + 6. Revised Versions of the GNU Lesser General Public License. + + The Free Software Foundation may publish revised and/or new versions +of the GNU Lesser General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + + Each version is given a distinguishing version number. If the +Library as you received it specifies that a certain numbered version +of the GNU Lesser General Public License "or any later version" +applies to it, you have the option of following the terms and +conditions either of that published version or of any later version +published by the Free Software Foundation. If the Library as you +received it does not specify a version number of the GNU Lesser +General Public License, you may choose any version of the GNU Lesser +General Public License ever published by the Free Software Foundation. + + If the Library as you received it specifies that a proxy can decide +whether future versions of the GNU Lesser General Public License shall +apply, that proxy's public statement of acceptance of any version is +permanent authorization for you to choose that version for the +Library. diff -Nru gcc/ChangeLog gcc/ChangeLog --- gcc/ChangeLog 2010-10-14 22:27:54.000000000 +0200 +++ gcc/ChangeLog 2012-12-31 17:06:01.000000000 +0100 @@ -862,7 +862,7 @@ * config/avr/avr.h (ASM_OUTPUT_ALIGN): Redefine. 2007-04-24 Andrew Pinski - Roger Sayle + Roger Sayle PR middle-end/30222 * expmed.c (make_tree): Use the correct type, i.e. the inner diff -Nru gcc/DATESTAMP gcc/DATESTAMP --- gcc/DATESTAMP 2010-10-14 22:27:54.000000000 +0200 +++ gcc/DATESTAMP 2012-12-31 17:06:05.000000000 +0100 @@ -1 +1 @@ -20070719 +20080519 diff -Nru gcc/Makefile.in gcc/Makefile.in --- gcc/Makefile.in 2010-10-14 22:27:55.000000000 +0200 +++ gcc/Makefile.in 2012-12-31 17:06:06.000000000 +0100 @@ -3,14 +3,14 @@ # Run 'configure' to generate Makefile from Makefile.in # Copyright (C) 1987, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 1996, -# 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 -# Free Software Foundation, Inc. +# 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, +# 2008 Free Software Foundation, Inc. #This file is part of GCC. #GCC is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by -#the Free Software Foundation; either version 2, or (at your option) +#the Free Software Foundation; either version 3, or (at your option) #any later version. #GCC is distributed in the hope that it will be useful, @@ -19,9 +19,8 @@ #GNU General Public License for more details. #You should have received a copy of the GNU General Public License -#along with GCC; see the file COPYING. If not, write to -#the Free Software Foundation, 51 Franklin Street, Fifth Floor, -#Boston MA 02110-1301, USA. +#along with GCC; see the file COPYING3. If not see +#. # The targets for external use include: # all, doc, proto, install, install-cross, install-cross-rest, @@ -277,6 +276,10 @@ # do not correctly set the timestamp due to buggy versions of `utime' # in the kernel. So, we use `echo' instead. STAMP = echo timestamp > +# If necessary (e.g., when using the MSYS shell on Microsoft Windows) +# translate the shell's notion of absolute pathnames to the native +# spelling. +build_file_translate = @build_file_translate@ # Make sure the $(MAKE) variable is defined. @SET_MAKE@ @@ -3427,7 +3430,7 @@ TEXI_GCC_FILES = gcc.texi gcc-common.texi gcc-vers.texi frontends.texi \ standards.texi invoke.texi extend.texi md.texi objc.texi \ gcov.texi trouble.texi bugreport.texi service.texi \ - contribute.texi compat.texi funding.texi gnu.texi gpl.texi \ + contribute.texi compat.texi funding.texi gnu.texi gpl_v3.texi \ fdl.texi contrib.texi cppenv.texi cppopts.texi \ implement-c.texi arm-neon-intrinsics.texi sourcecode.texi # APPLE LOCAL end GPL compliance @@ -3437,7 +3440,7 @@ portability.texi interface.texi passes.texi c-tree.texi \ rtl.texi md.texi tm.texi hostconfig.texi fragments.texi \ configfiles.texi collect2.texi headerdirs.texi funding.texi \ - gnu.texi gpl.texi fdl.texi contrib.texi languages.texi \ + gnu.texi gpl_v3.texi fdl.texi contrib.texi languages.texi \ sourcebuild.texi gty.texi libgcc.texi cfg.texi tree-ssa.texi \ loop.texi @@ -3453,7 +3456,7 @@ then echo "@set DEVELOPMENT"; \ else echo "@clear DEVELOPMENT"; \ fi) > $@T - echo "@set srcdir $(srcdir)" >> $@T + $(build_file_translate) echo @set srcdir $(abs_srcdir) >> $@T mv -f $@T $@ @@ -3584,6 +3587,9 @@ fsf-funding.pod: funding.texi $(STAMP) $@ -$(TEXI2POD) $< > $@ +gpl.pod: gpl_v3.texi + $(STAMP) $@ + -$(TEXI2POD) $< > $@ # # clean-target removes all files made by compilation. diff -Nru gcc/addresses.h gcc/addresses.h --- gcc/addresses.h 2010-10-14 22:27:55.000000000 +0200 +++ gcc/addresses.h 2012-12-31 17:06:01.000000000 +0100 @@ -1,11 +1,11 @@ /* Inline functions to test validity of reg classes for addressing modes. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Wrapper function to unify target macros MODE_CODE_BASE_REG_CLASS, MODE_BASE_REG_REG_CLASS, MODE_BASE_REG_CLASS and BASE_REG_CLASS. diff -Nru gcc/alias.c gcc/alias.c --- gcc/alias.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/alias.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,13 +1,13 @@ /* Alias analysis for GNU C - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, + 2007 Free Software Foundation, Inc. Contributed by John Carr (jfc@mit.edu). This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -16,9 +16,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/alias.h gcc/alias.h --- gcc/alias.h 2010-10-14 22:27:55.000000000 +0200 +++ gcc/alias.h 2012-12-31 17:06:01.000000000 +0100 @@ -1,11 +1,11 @@ /* Exported functions from alias.c - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_ALIAS_H #define GCC_ALIAS_H diff -Nru gcc/alloc-pool.c gcc/alloc-pool.c --- gcc/alloc-pool.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/alloc-pool.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,13 +1,13 @@ /* Functions to support a pool of allocatable objects. - Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. + Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, + 2007 Free Software Foundation, Inc. Contributed by Daniel Berlin This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -16,9 +16,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/alloc-pool.h gcc/alloc-pool.h --- gcc/alloc-pool.h 2010-10-14 22:27:54.000000000 +0200 +++ gcc/alloc-pool.h 2012-12-31 17:06:01.000000000 +0100 @@ -1,5 +1,5 @@ /* Functions to support a pool of allocatable objects - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2007 Free Software Foundation, Inc. Contributed by Daniel Berlin @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef ALLOC_POOL_H #define ALLOC_POOL_H diff -Nru gcc/attribs.c gcc/attribs.c --- gcc/attribs.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/attribs.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Functions dealing with attribute handling, used by most front ends. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" @@ -139,6 +138,9 @@ tree a; tree returned_attrs = NULL_TREE; + if (TREE_TYPE (*node) == error_mark_node) + return NULL_TREE; + if (!attributes_initialized) init_attributes (); diff -Nru gcc/basic-block.h gcc/basic-block.h --- gcc/basic-block.h 2010-10-14 22:27:55.000000000 +0200 +++ gcc/basic-block.h 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Define control and data flow tables, and regsets. - Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_BASIC_BLOCK_H #define GCC_BASIC_BLOCK_H diff -Nru gcc/bb-reorder.c gcc/bb-reorder.c --- gcc/bb-reorder.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/bb-reorder.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,11 +1,11 @@ /* Basic block reordering routines for the GNU compiler. - Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* This (greedy) algorithm constructs traces in several rounds. The construction starts from "seeds". The seed for the first round diff -Nru gcc/bitmap.c gcc/bitmap.c --- gcc/bitmap.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/bitmap.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Functions to support general ended bitmaps. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/bitmap.h gcc/bitmap.h --- gcc/bitmap.h 2010-10-14 22:27:54.000000000 +0200 +++ gcc/bitmap.h 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Functions to support general ended bitmaps. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_BITMAP_H #define GCC_BITMAP_H diff -Nru gcc/bt-load.c gcc/bt-load.c --- gcc/bt-load.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/bt-load.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Perform branch target register load optimizations. - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/builtin-attrs.def gcc/builtin-attrs.def --- gcc/builtin-attrs.def 2010-10-14 22:27:54.000000000 +0200 +++ gcc/builtin-attrs.def 2012-12-31 17:06:01.000000000 +0100 @@ -1,11 +1,11 @@ -/* Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2002, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Joseph Myers . This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This header provides a declarative way of describing the attributes that are applied to some functions by default. diff -Nru gcc/builtin-types.def gcc/builtin-types.def --- gcc/builtin-types.def 2010-10-14 22:27:54.000000000 +0200 +++ gcc/builtin-types.def 2012-12-31 17:06:01.000000000 +0100 @@ -1,11 +1,11 @@ -/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 +/* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This header provides a declarative way of describing the types that are used when declaring builtin functions. diff -Nru gcc/builtins.c gcc/builtins.c --- gcc/builtins.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/builtins.c 2013-01-01 12:29:53.000000000 +0100 @@ -1,12 +1,13 @@ /* Expand builtin functions. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +16,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" @@ -9396,12 +9396,11 @@ if (! POINTER_TYPE_P (TREE_TYPE (TREE_VALUE (arglist)))) goto end; } - /* APPLE LOCAL begin 5813921 */ - else if (code == INTEGER_TYPE - && (TREE_CODE (TREE_TYPE (TREE_VALUE (arglist))) - == ENUMERAL_TYPE)) - /* Allow ENUMERAL_TYPE to match INTEGER_TYPE. */ ; - /* APPLE LOCAL end 5813921 */ + else if (code == INTEGER_TYPE) + { + if (! INTEGRAL_TYPE_P (TREE_TYPE (TREE_VALUE (arglist)))) + goto end; + } else if (code != TREE_CODE (TREE_TYPE (TREE_VALUE (arglist)))) goto end; break; diff -Nru gcc/builtins.def gcc/builtins.def --- gcc/builtins.def 2010-10-14 22:27:54.000000000 +0200 +++ gcc/builtins.def 2012-12-31 17:06:01.000000000 +0100 @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -16,9 +16,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Before including this file, you should define a macro: diff -Nru gcc/c-aux-info.c gcc/c-aux-info.c --- gcc/c-aux-info.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/c-aux-info.c 2012-12-31 17:06:01.000000000 +0100 @@ -2,14 +2,14 @@ on information stored in GCC's tree structure. This code implements the -aux-info option. Copyright (C) 1989, 1991, 1994, 1995, 1997, 1998, - 1999, 2000, 2003, 2004 Free Software Foundation, Inc. + 1999, 2000, 2003, 2004, 2007 Free Software Foundation, Inc. Contributed by Ron Guilmette (rfg@segfault.us.com). This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,9 +18,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/c-common.c gcc/c-common.c --- gcc/c-common.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/c-common.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Subroutines shared by all languages that are variants of C. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" @@ -6893,6 +6892,16 @@ else type = c_build_qualified_type (main_type, quals); + if (COMPLETE_TYPE_P (type) + && TREE_CODE (TYPE_SIZE_UNIT (type)) == INTEGER_CST + && TREE_OVERFLOW (TYPE_SIZE_UNIT (type))) + { + error ("size of array is too large"); + /* If we proceed with the array type as it is, we'll eventually + crash in tree_low_cst(). */ + type = error_mark_node; + } + *ptype = type; return failure; } diff -Nru gcc/c-common.def gcc/c-common.def --- gcc/c-common.def 2010-10-14 22:27:55.000000000 +0200 +++ gcc/c-common.def 2012-12-31 17:06:01.000000000 +0100 @@ -2,14 +2,14 @@ additional tree codes used in the GNU C compiler (see tree.def for the standard codes). Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998, - 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Benjamin Chelf This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,9 +18,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Tree nodes used in the C frontend. These are also shared with the C++ and Objective C frontends. */ diff -Nru gcc/c-common.h gcc/c-common.h --- gcc/c-common.h 2010-10-14 22:27:55.000000000 +0200 +++ gcc/c-common.h 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions for c-common.c. Copyright (C) 1987, 1993, 1994, 1995, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_C_COMMON_H #define GCC_C_COMMON_H diff -Nru gcc/c-config-lang.in gcc/c-config-lang.in --- gcc/c-config-lang.in 2010-10-14 22:27:54.000000000 +0200 +++ gcc/c-config-lang.in 2012-12-31 17:06:01.000000000 +0100 @@ -1,11 +1,11 @@ # Top level configure fragment for GNU C - C language. -# Copyright (C) 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2005 Free Software Foundation, Inc. +# Copyright (C) 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2005, 2007 Free Software Foundation, Inc. #This file is part of GCC. #GCC is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by -#the Free Software Foundation; either version 2, or (at your option) +#the Free Software Foundation; either version 3, or (at your option) #any later version. #GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ #GNU General Public License for more details. #You should have received a copy of the GNU General Public License -#along with GCC; see the file COPYING. If not, write to -#the Free Software Foundation, 51 Franklin Street, Fifth Floor, -#Boston, MA 02110-1301, USA. +#along with GCC; see the file COPYING3. If not see +#. # This file c-config-lang.c is a special pseudo config-lang.in file # for the language C. It has limited use, specifically to record the diff -Nru gcc/c-convert.c gcc/c-convert.c --- gcc/c-convert.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/c-convert.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Language-level data type conversion for GNU C. - Copyright (C) 1987, 1988, 1991, 1998, 2002, 2003, 2004, 2005 + Copyright (C) 1987, 1988, 1991, 1998, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This file contains the functions for converting C expressions diff -Nru gcc/c-cppbuiltin.c gcc/c-cppbuiltin.c --- gcc/c-cppbuiltin.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/c-cppbuiltin.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,11 +1,12 @@ /* Define builtin-in macros for the C family front ends. - Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2007 + Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/c-decl.c gcc/c-decl.c --- gcc/c-decl.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/c-decl.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Process declarations and variables for C compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Process declarations and symbol lookup for C front end. Also constructs types; the standard scalar types at initialization, @@ -1757,6 +1756,9 @@ /* APPLE LOCAL end mainline aligned functions 5933878 */ } + /* Keep the old rtl since we can safely use it. */ + if (HAS_RTL_P (olddecl)) + COPY_DECL_RTL (olddecl, newdecl); /* Merge the type qualifiers. */ if (TREE_READONLY (newdecl)) diff -Nru gcc/c-dump.c gcc/c-dump.c --- gcc/c-dump.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/c-dump.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Tree-dumping functionality for C-family languages. - Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Mark Mitchell This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/c-errors.c gcc/c-errors.c --- gcc/c-errors.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/c-errors.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Various diagnostic subroutines for the GNU C language. - Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2003, 2007 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/c-format.c gcc/c-format.c --- gcc/c-format.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/c-format.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Check calls to formatted I/O functions (-Wformat). Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" @@ -2517,7 +2516,8 @@ locus = identifier_global_value (locus); if (locus) { - if (TREE_CODE (locus) != TYPE_DECL) + if (TREE_CODE (locus) != TYPE_DECL + || TREE_TYPE (locus) == error_mark_node) { error ("% is not defined as a type"); locus = 0; diff -Nru gcc/c-format.h gcc/c-format.h --- gcc/c-format.h 2010-10-14 22:27:54.000000000 +0200 +++ gcc/c-format.h 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Check calls to formatted I/O functions (-Wformat). Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_C_FORMAT_H #define GCC_C_FORMAT_H diff -Nru gcc/c-gimplify.c gcc/c-gimplify.c --- gcc/c-gimplify.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/c-gimplify.c 2012-12-31 17:06:01.000000000 +0100 @@ -2,7 +2,7 @@ by the C-based front ends. The structure of gimplified, or language-independent, trees is dictated by the grammar described in this file. - Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Lowering of expressions contributed by Sebastian Pop Re-written to support lowering of whole function trees, documentation and miscellaneous cleanups by Diego Novillo @@ -11,7 +11,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -20,9 +20,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/c-incpath.c gcc/c-incpath.c --- gcc/c-incpath.c 2013-01-03 11:23:37.000000000 +0100 +++ gcc/c-incpath.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,23 +1,23 @@ /* Set up combined include path chain for the preprocessor. Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Broken out of cppinit.c and cppfiles.c and rewritten Mar 2003. -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, 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; see the file COPYING3. If not see + . */ #include "config.h" #include "system.h" diff -Nru gcc/c-incpath.h gcc/c-incpath.h --- gcc/c-incpath.h 2010-10-14 22:27:55.000000000 +0200 +++ gcc/c-incpath.h 2012-12-31 17:06:01.000000000 +0100 @@ -1,19 +1,19 @@ /* Set up combined include path for the preprocessor. - Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, 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; see the file COPYING3. If not see + . */ extern void split_quote_chain (void); extern void add_path (char *, int, int, bool); diff -Nru gcc/c-lang.c gcc/c-lang.c --- gcc/c-lang.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/c-lang.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Language-specific hook definitions for C front end. Copyright (C) 1991, 1995, 1997, 1998, - 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" diff -Nru gcc/c-lex.c gcc/c-lex.c --- gcc/c-lex.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/c-lex.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,13 +1,13 @@ /* Mainly the interface between cpplib and the C front ends. Copyright (C) 1987, 1988, 1989, 1992, 1994, 1995, 1996, 1997 - 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -16,9 +16,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/c-objc-common.c gcc/c-objc-common.c --- gcc/c-objc-common.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/c-objc-common.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,11 +1,11 @@ /* Some code common to C and ObjC front ends. - Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/c-objc-common.h gcc/c-objc-common.h --- gcc/c-objc-common.h 2010-10-14 22:27:54.000000000 +0200 +++ gcc/c-objc-common.h 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Language hooks common to C and ObjC front ends. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Ziemowit Laski This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_C_OBJC_COMMON #define GCC_C_OBJC_COMMON diff -Nru gcc/c-omp.c gcc/c-omp.c --- gcc/c-omp.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/c-omp.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,7 +1,7 @@ /* This file contains routines to construct GNU OpenMP constructs, called from parsing in the C and C++ front ends. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005, 2007 Free Software Foundation, Inc. Contributed by Richard Henderson , Diego Novillo . @@ -9,7 +9,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,9 +18,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/c-opts.c gcc/c-opts.c --- gcc/c-opts.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/c-opts.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,5 +1,5 @@ /* C/ObjC/C++ command line option handling. - Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. Contributed by Neil Booth. @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -16,9 +16,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" @@ -435,8 +434,10 @@ if (c_dialect_cxx ()) warn_sign_compare = value; warn_switch = value; - warn_strict_aliasing = value; - warn_strict_overflow = value; + if (warn_strict_aliasing == -1) + warn_strict_aliasing = value; + if (warn_strict_overflow == -1) + warn_strict_overflow = value; warn_address = value; /* Only warn about unknown pragmas that are not in system @@ -1159,6 +1160,11 @@ if (warn_pointer_sign == -1) warn_pointer_sign = 0; + if (warn_strict_aliasing == -1) + warn_strict_aliasing = 0; + if (warn_strict_overflow == -1) + warn_strict_overflow = 0; + /* -Woverlength-strings is off by default, but is enabled by -pedantic. It is never enabled in C++, as the minimum limit is not normative in that standard. */ diff -Nru gcc/c-parser.c gcc/c-parser.c --- gcc/c-parser.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/c-parser.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,6 +1,6 @@ /* Parser for C and Objective-C. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Parser actions based on the old Bison parser; structure somewhat influenced by and fragments based on the C++ parser. @@ -9,7 +9,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,9 +18,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* TODO: diff -Nru gcc/c-pch.c gcc/c-pch.c --- gcc/c-pch.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/c-pch.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,11 +1,11 @@ /* Precompiled header implementation for the C languages. - Copyright (C) 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/c-ppoutput.c gcc/c-ppoutput.c --- gcc/c-ppoutput.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/c-ppoutput.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,21 +1,21 @@ /* Preprocess only, using cpplib. - Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Written by Per Bothner, 1994-95. -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, 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; see the file COPYING3. If not see + . */ #include "config.h" #include "system.h" diff -Nru gcc/c-pragma.c gcc/c-pragma.c --- gcc/c-pragma.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/c-pragma.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Handle #pragma, system V.4 style. Supports #pragma weak and #pragma pack. Copyright (C) 1992, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, - 2006 Free Software Foundation, Inc. + 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/c-pragma.h gcc/c-pragma.h --- gcc/c-pragma.h 2010-10-14 22:27:55.000000000 +0200 +++ gcc/c-pragma.h 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Pragma related interfaces. - Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright (C) 1995, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_C_PRAGMA_H #define GCC_C_PRAGMA_H diff -Nru gcc/c-pretty-print.c gcc/c-pretty-print.c --- gcc/c-pretty-print.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/c-pretty-print.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Subroutines common to both C and C++ pretty-printers. - Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/c-pretty-print.h gcc/c-pretty-print.h --- gcc/c-pretty-print.h 2010-10-14 22:27:54.000000000 +0200 +++ gcc/c-pretty-print.h 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Various declarations for the C and C++ pretty-printers. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_C_PRETTY_PRINTER #define GCC_C_PRETTY_PRINTER diff -Nru gcc/c-semantics.c gcc/c-semantics.c --- gcc/c-semantics.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/c-semantics.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,7 +1,7 @@ /* This file contains the definitions and documentation for the common tree codes used in the GNU C and C++ compilers (see c-common.def for the standard codes). - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Benjamin Chelf (chelf@codesourcery.com). @@ -9,7 +9,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -18,9 +18,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/c-tree.h gcc/c-tree.h --- gcc/c-tree.h 2010-10-14 22:27:54.000000000 +0200 +++ gcc/c-tree.h 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions for C parsing and type checking. - Copyright (C) 1987, 1993, 1994, 1995, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2000, 2001, + 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_C_TREE_H #define GCC_C_TREE_H diff -Nru gcc/c-typeck.c gcc/c-typeck.c --- gcc/c-typeck.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/c-typeck.c 2013-01-01 12:35:17.000000000 +0100 @@ -1,13 +1,13 @@ /* Build expressions with type checking for C compiler. Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -16,9 +16,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This file is part of the C front end. @@ -536,6 +535,7 @@ tree pointed_to_1, mv1; tree pointed_to_2, mv2; tree target; + unsigned target_quals; /* Save time if the two types are the same. */ @@ -567,10 +567,17 @@ if (TREE_CODE (mv2) != ARRAY_TYPE) mv2 = TYPE_MAIN_VARIANT (pointed_to_2); target = composite_type (mv1, mv2); + + /* For function types do not merge const qualifiers, but drop them + if used inconsistently. The middle-end uses these to mark const + and noreturn functions. */ + if (TREE_CODE (pointed_to_1) == FUNCTION_TYPE) + target_quals = TYPE_QUALS (pointed_to_1) & TYPE_QUALS (pointed_to_2); + else + target_quals = TYPE_QUALS (pointed_to_1) | TYPE_QUALS (pointed_to_2); + /* APPLE LOCAL begin blocks 6065211 */ - t1 = c_build_qualified_type (target, - TYPE_QUALS (pointed_to_1) | - TYPE_QUALS (pointed_to_2)); + t1 = c_build_qualified_type (target, target_quals); if (TREE_CODE (t2) == BLOCK_POINTER_TYPE) t1 = build_block_pointer_type (t1); else @@ -1721,14 +1728,19 @@ if (TREE_NO_WARNING (orig_exp)) TREE_NO_WARNING (exp) = 1; - if (INTEGRAL_TYPE_P (type)) - return perform_integral_promotions (exp); - if (code == VOID_TYPE) { error ("void value not ignored as it ought to be"); return error_mark_node; } + + exp = require_complete_type (exp); + if (exp == error_mark_node) + return error_mark_node; + + if (INTEGRAL_TYPE_P (type)) + return perform_integral_promotions (exp); + return exp; } @@ -3068,11 +3080,15 @@ /* No default_conversion here. It causes trouble for ADDR_EXPR. */ tree arg = xarg; tree argtype = 0; - enum tree_code typecode = TREE_CODE (TREE_TYPE (arg)); + enum tree_code typecode; tree val; int noconvert = flag; const char *invalid_op_diag; + if (code != ADDR_EXPR) + arg = require_complete_type (arg); + + typecode = TREE_CODE (TREE_TYPE (arg)); if (typecode == ERROR_MARK) return error_mark_node; if (typecode == ENUMERAL_TYPE || typecode == BOOLEAN_TYPE) @@ -3831,6 +3847,13 @@ return error_mark_node; } + if (!VOID_TYPE_P (type)) + { + value = require_complete_type (value); + if (value == error_mark_node) + return error_mark_node; + } + if (type == TYPE_MAIN_VARIANT (TREE_TYPE (value))) { if (pedantic) @@ -4401,6 +4424,9 @@ error ("void value not ignored as it ought to be"); return error_mark_node; } + rhs = require_complete_type (rhs); + if (rhs == error_mark_node) + return error_mark_node; /* A type converts to a reference to it. This code doesn't fully support references, it's just for the special case of va_start and va_copy. */ diff -Nru gcc/c.opt gcc/c.opt --- gcc/c.opt 2010-10-14 22:27:55.000000000 +0200 +++ gcc/c.opt 2012-12-31 17:06:01.000000000 +0100 @@ -1,11 +1,11 @@ ; Options for the C, ObjC, C++ and ObjC++ front ends. -; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +; Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. ; ; This file is part of GCC. ; ; GCC is free software; you can redistribute it and/or modify it under ; the terms of the GNU General Public License as published by the Free -; Software Foundation; either version 2, or (at your option) any later +; Software Foundation; either version 3, or (at your option) any later ; version. ; ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ ; for more details. ; ; You should have received a copy of the GNU General Public License -; along with GCC; see the file COPYING. If not, write to the Free -; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -; 02110-1301, USA. +; along with GCC; see the file COPYING3. If not see +; . ; See the GCC internals manual for a description of this file's format. diff -Nru gcc/caller-save.c gcc/caller-save.c --- gcc/caller-save.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/caller-save.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Save and restore call-clobbered registers which are live across a call. - Copyright (C) 1989, 1992, 1994, 1995, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1989, 1992, 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, + 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/calls.c gcc/calls.c --- gcc/calls.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/calls.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,13 +1,13 @@ /* Convert function calls to rtl insns, for GNU C compiler. Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -16,9 +16,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/cfg.c gcc/cfg.c --- gcc/cfg.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/cfg.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,13 +1,13 @@ /* Control flow graph manipulation code for GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -16,9 +16,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This file contains low level functions to manipulate the CFG and analyze it. All other modules should not transform the data structure diff -Nru gcc/cfganal.c gcc/cfganal.c --- gcc/cfganal.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/cfganal.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Control flow graph analysis code for GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This file contains various simple utilities to analyze the CFG. */ #include "config.h" diff -Nru gcc/cfgbuild.c gcc/cfgbuild.c --- gcc/cfgbuild.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/cfgbuild.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Control flow graph building code for GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* find_basic_blocks divides the current function's rtl into basic blocks and constructs the CFG. The blocks are recorded in the diff -Nru gcc/cfgcleanup.c gcc/cfgcleanup.c --- gcc/cfgcleanup.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/cfgcleanup.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Control flow optimization code for GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This file contains optimizer of the control flow. The main entry point is cleanup_cfg. Following optimizations are performed: diff -Nru gcc/cfgexpand.c gcc/cfgexpand.c --- gcc/cfgexpand.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/cfgexpand.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,11 +1,11 @@ /* A pass for lowering trees to RTL. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/cfghooks.c gcc/cfghooks.c --- gcc/cfghooks.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/cfghooks.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Hooks for cfg representation specific functions. - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Sebastian Pop This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/cfghooks.h gcc/cfghooks.h --- gcc/cfghooks.h 2010-10-14 22:27:54.000000000 +0200 +++ gcc/cfghooks.h 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Hooks for cfg representation specific functions. - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Sebastian Pop This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_CFGHOOKS_H #define GCC_CFGHOOKS_H diff -Nru gcc/cfglayout.c gcc/cfglayout.c --- gcc/cfglayout.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/cfglayout.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,11 +1,11 @@ /* Basic block reordering routines for the GNU compiler. - Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/cfglayout.h gcc/cfglayout.h --- gcc/cfglayout.h 2010-10-14 22:27:55.000000000 +0200 +++ gcc/cfglayout.h 2012-12-31 17:06:01.000000000 +0100 @@ -1,11 +1,11 @@ /* Basic block reordering routines for the GNU compiler. - Copyright (C) 2000, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #ifndef GCC_CFGLAYOUT_H #define GCC_CFGLAYOUT_H diff -Nru gcc/cfgloop.c gcc/cfgloop.c --- gcc/cfgloop.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/cfgloop.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,11 +1,11 @@ /* Natural loop discovery code for GNU compiler. - Copyright (C) 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/cfgloop.h gcc/cfgloop.h --- gcc/cfgloop.h 2010-10-14 22:27:55.000000000 +0200 +++ gcc/cfgloop.h 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Natural loop functions - Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright (C) 1987, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_CFGLOOP_H #define GCC_CFGLOOP_H diff -Nru gcc/cfgloopanal.c gcc/cfgloopanal.c --- gcc/cfgloopanal.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/cfgloopanal.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,11 +1,11 @@ /* Natural loop analysis code for GNU compiler. - Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/cfgloopmanip.c gcc/cfgloopmanip.c --- gcc/cfgloopmanip.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/cfgloopmanip.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,11 +1,11 @@ /* Loop manipulation code for GNU compiler. - Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/cfgrtl.c gcc/cfgrtl.c --- gcc/cfgrtl.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/cfgrtl.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Control flow graph manipulation code for GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This file contains low level functions to manipulate the CFG and analyze it that are aware of the RTL intermediate language. diff -Nru gcc/cgraph.c gcc/cgraph.c --- gcc/cgraph.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/cgraph.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Callgraph handling code. - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Jan Hubicka This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This file contains basic routines manipulating call graph and variable pool diff -Nru gcc/cgraph.h gcc/cgraph.h --- gcc/cgraph.h 2010-10-14 22:27:54.000000000 +0200 +++ gcc/cgraph.h 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Callgraph handling code. - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Jan Hubicka This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_CGRAPH_H #define GCC_CGRAPH_H diff -Nru gcc/cgraphunit.c gcc/cgraphunit.c --- gcc/cgraphunit.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/cgraphunit.c 2012-12-31 17:06:01.000000000 +0100 @@ -1,12 +1,12 @@ /* Callgraph based interprocedural optimizations. - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Jan Hubicka This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This module implements main driver of compilation process as well as few basic interprocedural optimizers. diff -Nru gcc/collect2.c gcc/collect2.c --- gcc/collect2.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/collect2.c 2012-12-31 17:06:02.000000000 +0100 @@ -1,7 +1,7 @@ /* Collect static initialization info into data structures that can be traversed by C++ initialization and finalization routines. - Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, + 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Chris Smith (csmith@convex.com). Heavily modified by Michael Meissner (meissner@cygnus.com), Per Bothner (bothner@cygnus.com), and John Gilmore (gnu@cygnus.com). @@ -10,7 +10,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -19,9 +19,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Build tables of static constructors and destructors and run ld. */ @@ -132,6 +131,10 @@ #define SCAN_LIBRARIES #endif +#ifndef SHLIB_SUFFIX +#define SHLIB_SUFFIX ".so" +#endif + #ifdef USE_COLLECT2 int do_collecting = 1; #else @@ -1803,9 +1806,9 @@ } else { - if (strncmp (q, ".so", 3) == 0) + if (strncmp (q, SHLIB_SUFFIX, strlen (SHLIB_SUFFIX)) == 0) { - q += 3; + q += strlen (SHLIB_SUFFIX); break; } else diff -Nru gcc/collect2.h gcc/collect2.h --- gcc/collect2.h 2010-10-14 22:27:55.000000000 +0200 +++ gcc/collect2.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,11 +1,11 @@ /* Header file for collect/tlink routines. - Copyright (C) 1998, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1998, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_COLLECT2_H #define GCC_COLLECT2_H diff -Nru gcc/combine.c gcc/combine.c --- gcc/combine.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/combine.c 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,13 @@ /* Optimize by combining instructions for GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +16,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This module is essentially the "combiner" phase of the U. of Arizona Portable Optimizer, but redone to work on our list-structured @@ -2454,12 +2454,17 @@ if (i1 && GET_CODE (newpat) != CLOBBER) { - /* Before we can do this substitution, we must redo the test done - above (see detailed comments there) that ensures that I1DEST - isn't mentioned in any SETs in NEWPAT that are field assignments. */ - - if (! combinable_i3pat (NULL_RTX, &newpat, i1dest, NULL_RTX, - 0, (rtx*) 0)) + /* Check that an autoincrement side-effect on I1 has not been lost. + This happens if I1DEST is mentioned in I2 and dies there, and + has disappeared from the new pattern. */ + if ((FIND_REG_INC_NOTE (i1, NULL_RTX) != 0 + && !i1_feeds_i3 + && dead_or_set_p (i2, i1dest) + && !reg_overlap_mentioned_p (i1dest, newpat)) + /* Before we can do this substitution, we must redo the test done + above (see detailed comments there) that ensures that I1DEST + isn't mentioned in any SETs in NEWPAT that are field assignments. */ + || !combinable_i3pat (NULL_RTX, &newpat, i1dest, NULL_RTX, 0, 0)) { undo_all (); return 0; @@ -5132,9 +5137,10 @@ /* Look for cases where we have (abs x) or (neg (abs X)). */ if (GET_MODE_CLASS (mode) == MODE_INT + && comparison_p + && XEXP (cond, 1) == const0_rtx && GET_CODE (false_rtx) == NEG && rtx_equal_p (true_rtx, XEXP (false_rtx, 0)) - && comparison_p && rtx_equal_p (true_rtx, XEXP (cond, 0)) && ! side_effects_p (true_rtx)) switch (true_code) diff -Nru gcc/common.opt gcc/common.opt --- gcc/common.opt 2010-10-14 22:27:55.000000000 +0200 +++ gcc/common.opt 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ ; Options for the language- and target-independent parts of the compiler. -; Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +; Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. ; ; This file is part of GCC. ; ; GCC is free software; you can redistribute it and/or modify it under ; the terms of the GNU General Public License as published by the Free -; Software Foundation; either version 2, or (at your option) any later +; Software Foundation; either version 3, or (at your option) any later ; version. ; ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ ; for more details. ; ; You should have received a copy of the GNU General Public License -; along with GCC; see the file COPYING. If not, write to the Free -; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -; 02110-1301, USA. +; along with GCC; see the file COPYING3. If not see +; . ; See the GCC internals manual for a description of this file's format. @@ -130,7 +129,7 @@ Warn about code which might break strict aliasing rules Wstrict-aliasing= -Common Joined UInteger +Common Joined UInteger Var(warn_strict_aliasing) Init(-1) Warn about code which might break strict aliasing rules Wstrict-overflow @@ -138,7 +137,7 @@ Warn about optimizations that assume that signed overflow is undefined Wstrict-overflow= -Common Joined UInteger +Common Joined UInteger Var(warn_strict_overflow) Init(-1) Warn about optimizations that assume that signed overflow is undefined Wswitch @@ -480,7 +479,7 @@ Perform unused type elimination in debug info femit-class-debug-always -Common Report Var(flag_emit_class_debug_always) Init(1) +Common Report Var(flag_emit_class_debug_always) Init(0) Do not suppress C++ class debug information. fexceptions diff -Nru gcc/conditions.h gcc/conditions.h --- gcc/conditions.h 2010-10-14 22:27:55.000000000 +0200 +++ gcc/conditions.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,11 +1,11 @@ /* Definitions for condition code handling in final.c and output routines. - Copyright (C) 1987 Free Software Foundation, Inc. + Copyright (C) 1987, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* None of the things in the files exist if we don't use CC0. */ diff -Nru gcc/config/arm/aof.h gcc/config/arm/aof.h --- gcc/config/arm/aof.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/aof.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for Advanced RISC Machines ARM compilation, AOF Assembler. - Copyright (C) 1995, 1996, 1997, 2000, 2003, 2004 + Copyright (C) 1995, 1996, 1997, 2000, 2003, 2004, 2007 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rearnsha@armltd.co.uk) @@ -8,7 +8,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -17,9 +17,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ diff -Nru gcc/config/arm/aout.h gcc/config/arm/aout.h --- gcc/config/arm/aout.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/aout.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for ARM with a.out - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2004 + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2004, 2007 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rearnsha@armltd.co.uk). @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -16,9 +16,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #ifndef ASM_APP_ON #define ASM_APP_ON "" diff -Nru gcc/config/arm/arm-cores.def gcc/config/arm/arm-cores.def --- gcc/config/arm/arm-cores.def 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/arm-cores.def 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ /* ARM CPU Cores - Copyright (C) 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2005, 2007 Free Software Foundation, Inc. Written by CodeSourcery, LLC This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but @@ -15,9 +15,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* Before using #include to read this file, define a macro: diff -Nru gcc/config/arm/arm-generic.md gcc/config/arm/arm-generic.md --- gcc/config/arm/arm-generic.md 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/arm-generic.md 2012-12-31 17:06:02.000000000 +0100 @@ -1,11 +1,11 @@ ;; Generic ARM Pipeline Description -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, but @@ -14,9 +14,8 @@ ;; General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the Free -;; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -;; 02110-1301, USA. */ +;; along with GCC; see the file COPYING3. If not see +;; . */ (define_automaton "arm") diff -Nru gcc/config/arm/arm-modes.def gcc/config/arm/arm-modes.def --- gcc/config/arm/arm-modes.def 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/arm-modes.def 2012-12-31 17:06:02.000000000 +0100 @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for ARM. - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2007 Free Software Foundation, Inc. Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) and Martin Simmons (@harleqn.co.uk). More major hacks by Richard Earnshaw (rearnsha@arm.com) @@ -9,7 +9,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -18,9 +18,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* Extended precision floating point. FIXME What format is this? */ diff -Nru gcc/config/arm/arm-protos.h gcc/config/arm/arm-protos.h --- gcc/config/arm/arm-protos.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/arm-protos.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,5 +1,5 @@ /* Prototypes for exported functions defined in arm.c and pe.c - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Richard Earnshaw (rearnsha@arm.com) Minor hacks by Nick Clifton (nickc@cygnus.com) @@ -8,7 +8,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -17,9 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #ifndef GCC_ARM_PROTOS_H #define GCC_ARM_PROTOS_H diff -Nru gcc/config/arm/arm.c gcc/config/arm/arm.c --- gcc/config/arm/arm.c 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/arm.c 2012-12-31 17:06:02.000000000 +0100 @@ -1,6 +1,6 @@ /* Output routines for GCC for ARM. Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, - 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) and Martin Simmons (@harleqn.co.uk). More major hacks by Richard Earnshaw (rearnsha@arm.com). @@ -9,7 +9,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -18,9 +18,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* APPLE LOCAL begin 6902792 Q register clobbers in inline asm */ #include diff -Nru gcc/config/arm/arm.h gcc/config/arm/arm.h --- gcc/config/arm/arm.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/arm.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for ARM. Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) and Martin Simmons (@harleqn.co.uk). More major hacks by Richard Earnshaw (rearnsha@arm.com) @@ -10,7 +10,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -19,9 +19,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #ifndef GCC_ARM_H #define GCC_ARM_H diff -Nru gcc/config/arm/arm.md gcc/config/arm/arm.md --- gcc/config/arm/arm.md 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/arm.md 2012-12-31 17:06:02.000000000 +0100 @@ -1,6 +1,6 @@ ;;- Machine description for ARM for GNU compiler ;; Copyright 1991, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, 2000, -;; 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +;; 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. ;; Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) ;; and Martin Simmons (@harleqn.co.uk). ;; More major hacks by Richard Earnshaw (rearnsha@arm.com). @@ -9,7 +9,7 @@ ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -18,9 +18,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al. diff -Nru gcc/config/arm/arm.opt gcc/config/arm/arm.opt --- gcc/config/arm/arm.opt 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/arm.opt 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ ; Options for the ARM port of the compiler. -; Copyright (C) 2005 Free Software Foundation, Inc. +; Copyright (C) 2005, 2007 Free Software Foundation, Inc. ; ; This file is part of GCC. ; ; GCC is free software; you can redistribute it and/or modify it under ; the terms of the GNU General Public License as published by the Free -; Software Foundation; either version 2, or (at your option) any later +; Software Foundation; either version 3, or (at your option) any later ; version. ; ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ ; for more details. ; ; You should have received a copy of the GNU General Public License -; along with GCC; see the file COPYING. If not, write to the Free -; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -; 02110-1301, USA. +; along with GCC; see the file COPYING3. If not see +; . mabi= Target RejectNegative Joined Var(target_abi_name) diff -Nru gcc/config/arm/arm1020e.md gcc/config/arm/arm1020e.md --- gcc/config/arm/arm1020e.md 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/arm1020e.md 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ ;; ARM 1020E & ARM 1022E Pipeline Description -;; Copyright (C) 2005 Free Software Foundation, Inc. +;; Copyright (C) 2005, 2007 Free Software Foundation, Inc. ;; Contributed by Richard Earnshaw (richard.earnshaw@arm.com) ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, but @@ -15,9 +15,8 @@ ;; General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the Free -;; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -;; 02110-1301, USA. */ +;; along with GCC; see the file COPYING3. If not see +;; . */ ;; These descriptions are based on the information contained in the ;; ARM1020E Technical Reference Manual, Copyright (c) 2003 ARM diff -Nru gcc/config/arm/arm1026ejs.md gcc/config/arm/arm1026ejs.md --- gcc/config/arm/arm1026ejs.md 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/arm1026ejs.md 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ ;; ARM 1026EJ-S Pipeline Description -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2007 Free Software Foundation, Inc. ;; Written by CodeSourcery, LLC. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, but @@ -15,9 +15,8 @@ ;; General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the Free -;; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -;; 02110-1301, USA. */ +;; along with GCC; see the file COPYING3. If not see +;; . */ ;; These descriptions are based on the information contained in the ;; ARM1026EJ-S Technical Reference Manual, Copyright (c) 2003 ARM diff -Nru gcc/config/arm/arm1136jfs.md gcc/config/arm/arm1136jfs.md --- gcc/config/arm/arm1136jfs.md 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/arm1136jfs.md 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ ;; ARM 1136J[F]-S Pipeline Description -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2007 Free Software Foundation, Inc. ;; Written by CodeSourcery, LLC. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, but @@ -15,9 +15,8 @@ ;; General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the Free -;; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -;; 02110-1301, USA. */ +;; along with GCC; see the file COPYING3. If not see +;; . */ ;; These descriptions are based on the information contained in the ;; ARM1136JF-S Technical Reference Manual, Copyright (c) 2003 ARM diff -Nru gcc/config/arm/arm926ejs.md gcc/config/arm/arm926ejs.md --- gcc/config/arm/arm926ejs.md 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/arm926ejs.md 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ ;; ARM 926EJ-S Pipeline Description -;; Copyright (C) 2003 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2007 Free Software Foundation, Inc. ;; Written by CodeSourcery, LLC. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, but @@ -15,9 +15,8 @@ ;; General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the Free -;; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -;; 02110-1301, USA. */ +;; along with GCC; see the file COPYING3. If not see +;; . */ ;; These descriptions are based on the information contained in the ;; ARM926EJ-S Technical Reference Manual, Copyright (c) 2002 ARM diff -Nru gcc/config/arm/bpabi.h gcc/config/arm/bpabi.h --- gcc/config/arm/bpabi.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/bpabi.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,5 +1,5 @@ /* Configuration file for ARM BPABI targets. - Copyright (C) 2004, 2005 + Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -16,9 +16,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* Use the AAPCS ABI by default. */ #define ARM_DEFAULT_ABI ARM_ABI_AAPCS diff -Nru gcc/config/arm/cirrus.md gcc/config/arm/cirrus.md --- gcc/config/arm/cirrus.md 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/cirrus.md 2012-12-31 17:06:02.000000000 +0100 @@ -1,5 +1,5 @@ ;; Cirrus EP9312 "Maverick" ARM floating point co-processor description. -;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. ;; Contributed by Red Hat. ;; Written by Aldy Hernandez (aldyh@redhat.com) @@ -7,7 +7,7 @@ ;; GCC is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; GCC is distributed in the hope that it will be useful, @@ -16,9 +16,8 @@ ;; GNU General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . ; Cirrus types for invalid insn combinations diff -Nru gcc/config/arm/coff.h gcc/config/arm/coff.h --- gcc/config/arm/coff.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/coff.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,14 +1,14 @@ /* Definitions of target machine for GNU compiler. For ARM with COFF object format. - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004, 2005, + 2007 Free Software Foundation, Inc. Contributed by Doug Evans (devans@cygnus.com). This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -17,9 +17,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* Note - it is important that this definition matches the one in tcoff.h. */ #undef USER_LABEL_PREFIX diff -Nru gcc/config/arm/constraints.md gcc/config/arm/constraints.md --- gcc/config/arm/constraints.md 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/constraints.md 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ ;; Constraint definitions for ARM and Thumb -;; Copyright (C) 2006 Free Software Foundation, Inc. +;; Copyright (C) 2006, 2007 Free Software Foundation, Inc. ;; Contributed by ARM Ltd. ;; This file is part of GCC. ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . ;; APPLE LOCAL begin v7 support. Merge from mainline ;; The following register constraints have been used: diff -Nru gcc/config/arm/ecos-elf.h gcc/config/arm/ecos-elf.h --- gcc/config/arm/ecos-elf.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/ecos-elf.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,11 +1,11 @@ /* Definitions for ecos based ARM systems using ELF - Copyright (C) 1998, 2001 Free Software Foundation, Inc. + Copyright (C) 1998, 2001, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ 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, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* Run-time Target Specification. */ #undef TARGET_VERSION diff -Nru gcc/config/arm/elf.h gcc/config/arm/elf.h --- gcc/config/arm/elf.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/elf.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,7 +1,7 @@ /* Definitions of target machine for GNU compiler. For ARM with ELF obj format. - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2004, 2005 - Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2004, 2005, + 2007 Free Software Foundation, Inc. Contributed by Philip Blundell and Catherine Moore @@ -9,7 +9,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -18,9 +18,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #ifndef OBJECT_FORMAT_ELF #error elf.h included before elfos.h diff -Nru gcc/config/arm/fpa.md gcc/config/arm/fpa.md --- gcc/config/arm/fpa.md 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/fpa.md 2012-12-31 17:06:02.000000000 +0100 @@ -1,6 +1,6 @@ ;;- Machine description for FPA co-processor for ARM cpus. ;; Copyright 1991, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, 2000, -;; 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +;; 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. ;; Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl) ;; and Martin Simmons (@harleqn.co.uk). ;; More major hacks by Richard Earnshaw (rearnsha@arm.com). @@ -9,7 +9,7 @@ ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -18,9 +18,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . ;; APPLE LOCAL begin v7 support. Merge from mainline ;; Some FPA mnemonics are ambiguous between conditional infixes and diff -Nru gcc/config/arm/freebsd.h gcc/config/arm/freebsd.h --- gcc/config/arm/freebsd.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/freebsd.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions for StrongARM running FreeBSD using the ELF format - Copyright (C) 2001, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2004, 2007 Free Software Foundation, Inc. Contributed by David E. O'Brien and BSDi. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #undef SUBTARGET_EXTRA_SPECS diff -Nru gcc/config/arm/iwmmxt.md gcc/config/arm/iwmmxt.md --- gcc/config/arm/iwmmxt.md 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/iwmmxt.md 2012-12-31 17:06:02.000000000 +0100 @@ -1,14 +1,14 @@ ;; APPLE LOCAL v7 support. Merge from mainline ;; ??? This file needs auditing for thumb2 ;; Patterns for the Intel Wireless MMX technology architecture. -;; Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. ;; Contributed by Red Hat. ;; This file is part of GCC. ;; GCC is free software; you can redistribute it and/or modify it under ;; the terms of the GNU General Public License as published by the Free -;; Software Foundation; either version 2, or (at your option) any later +;; Software Foundation; either version 3, or (at your option) any later ;; version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -17,9 +17,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . ;; APPLE LOCAL begin v7 support. Merge from Codesourcery ;; Integer element sizes implemented by IWMMXT. diff -Nru gcc/config/arm/kaos-arm.h gcc/config/arm/kaos-arm.h --- gcc/config/arm/kaos-arm.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/kaos-arm.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions of target machine for GNU compiler. kaOS on arm architecture version. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #undef TARGET_VERSION #define TARGET_VERSION fputs (" (ARM/kaOS[ELF])", stderr); diff -Nru gcc/config/arm/kaos-strongarm.h gcc/config/arm/kaos-strongarm.h --- gcc/config/arm/kaos-strongarm.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/kaos-strongarm.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions of target machine for GNU compiler. kaOS on strongarm architecture version. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #undef TARGET_VERSION #define TARGET_VERSION fputs (" (StrongARM/kaOS[ELF])", stderr); diff -Nru gcc/config/arm/linux-eabi.h gcc/config/arm/linux-eabi.h --- gcc/config/arm/linux-eabi.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/linux-eabi.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,5 +1,5 @@ /* Configuration file for ARM GNU/Linux EABI targets. - Copyright (C) 2004, 2005, 2006 + Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -16,9 +16,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* On EABI GNU/Linux, we want both the BPABI builtins and the GNU/Linux builtins. */ diff -Nru gcc/config/arm/linux-elf.h gcc/config/arm/linux-elf.h --- gcc/config/arm/linux-elf.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/linux-elf.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,6 +1,6 @@ /* Definitions for ARM running Linux-based GNU systems using ELF Copyright (C) 1993, 1994, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006 + 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Philip Blundell @@ -8,7 +8,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -17,9 +17,8 @@ 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, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* elfos.h should have already been included. Now just override any conflicting definitions and add any extras. */ diff -Nru gcc/config/arm/linux-gas.h gcc/config/arm/linux-gas.h --- gcc/config/arm/linux-gas.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/linux-gas.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. ARM Linux-based GNU systems version. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004 + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2004, 2007 Free Software Foundation, Inc. Contributed by Russell King . @@ -8,7 +8,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -17,9 +17,8 @@ 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, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* This is how we tell the assembler that a symbol is weak. GAS always supports weak symbols. */ diff -Nru gcc/config/arm/netbsd-elf.h gcc/config/arm/netbsd-elf.h --- gcc/config/arm/netbsd-elf.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/netbsd-elf.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions of target machine for GNU compiler, NetBSD/arm ELF version. - Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Wasabi Systems, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* Run-time Target Specification. */ #undef TARGET_VERSION diff -Nru gcc/config/arm/netbsd.h gcc/config/arm/netbsd.h --- gcc/config/arm/netbsd.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/netbsd.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,5 +1,5 @@ /* NetBSD/arm a.out version. - Copyright (C) 1993, 1994, 1997, 1998, 2003, 2004, 2005 + Copyright (C) 1993, 1994, 1997, 1998, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Mark Brinicombe (amb@physig.ph.kcl.ac.uk) @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -16,9 +16,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* Run-time Target Specification. */ #undef TARGET_VERSION diff -Nru gcc/config/arm/pe.c gcc/config/arm/pe.c --- gcc/config/arm/pe.c 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/pe.c 2012-12-31 17:06:02.000000000 +0100 @@ -1,5 +1,5 @@ /* Routines for GCC for ARM/pe. - Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004, 2005 + Copyright (C) 1995, 1996, 2000, 2001, 2002, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -16,9 +16,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #include "config.h" #include "system.h" diff -Nru gcc/config/arm/pe.h gcc/config/arm/pe.h --- gcc/config/arm/pe.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/pe.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for ARM with PE obj format. - Copyright (C) 1995, 1996, 1999, 2000, 2002, 2003, 2004, 2005 + Copyright (C) 1995, 1996, 1999, 2000, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -16,9 +16,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* Enable PE specific code. */ #define ARM_PE 1 diff -Nru gcc/config/arm/pe.opt gcc/config/arm/pe.opt --- gcc/config/arm/pe.opt 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/pe.opt 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ ; PE-specific options for the ARM port -; Copyright (C) 2005 Free Software Foundation, Inc. +; Copyright (C) 2005, 2007 Free Software Foundation, Inc. ; ; This file is part of GCC. ; ; GCC is free software; you can redistribute it and/or modify it under ; the terms of the GNU General Public License as published by the Free -; Software Foundation; either version 2, or (at your option) any later +; Software Foundation; either version 3, or (at your option) any later ; version. ; ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ ; for more details. ; ; You should have received a copy of the GNU General Public License -; along with GCC; see the file COPYING. If not, write to the Free -; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -; 02110-1301, USA. +; along with GCC; see the file COPYING3. If not see +; . mnop-fun-dllimport Target Report Mask(NOP_FUN_DLLIMPORT) diff -Nru gcc/config/arm/predicates.md gcc/config/arm/predicates.md --- gcc/config/arm/predicates.md 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/predicates.md 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ ;; Predicate definitions for ARM and Thumb -;; Copyright (C) 2004 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2007 Free Software Foundation, Inc. ;; Contributed by ARM Ltd. ;; This file is part of GCC. ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . (define_predicate "s_register_operand" (match_code "reg,subreg") diff -Nru gcc/config/arm/rtems-elf.h gcc/config/arm/rtems-elf.h --- gcc/config/arm/rtems-elf.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/rtems-elf.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,11 +1,11 @@ /* Definitions for RTEMS based ARM systems using ELF - Copyright (C) 2000, 2002, 2005 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ 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, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* Run-time Target Specification. */ #undef TARGET_VERSION @@ -27,6 +26,7 @@ #define TARGET_OS_CPP_BUILTINS() \ do { \ builtin_define ("__rtems__"); \ + builtin_define ("__USE_INIT_FINI__"); \ builtin_assert ("system=rtems"); \ } while (0) diff -Nru gcc/config/arm/semi.h gcc/config/arm/semi.h --- gcc/config/arm/semi.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/semi.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. ARM on semi-hosted platform - Copyright (C) 1994, 1995, 1996, 1997, 2001, 2004, 2005 + Copyright (C) 1994, 1995, 1996, 1997, 2001, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Richard Earnshaw (richard.earnshaw@arm.com) @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -16,9 +16,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #define STARTFILE_SPEC "crt0.o%s" diff -Nru gcc/config/arm/semiaof.h gcc/config/arm/semiaof.h --- gcc/config/arm/semiaof.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/semiaof.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,13 +1,13 @@ /* Definitions of target machine for GNU compiler. ARM on semi-hosted platform AOF Syntax assembler. - Copyright (C) 1995, 1996, 1997, 2004 Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 2004, 2007 Free Software Foundation, Inc. Contributed by Richard Earnshaw (richard.earnshaw@armltd.co.uk) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -16,9 +16,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #define TARGET_OS_CPP_BUILTINS() \ do { \ diff -Nru gcc/config/arm/strongarm-coff.h gcc/config/arm/strongarm-coff.h --- gcc/config/arm/strongarm-coff.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/strongarm-coff.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions for StrongARM systems using COFF - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2007 Free Software Foundation, Inc. Contributed by Catherine Moore This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ 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, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* Run-time Target Specification. */ #ifndef SUBTARGET_CPU_DEFAULT diff -Nru gcc/config/arm/strongarm-elf.h gcc/config/arm/strongarm-elf.h --- gcc/config/arm/strongarm-elf.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/strongarm-elf.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions for non-Linux based StrongARM systems using ELF - Copyright (C) 1999, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2007 Free Software Foundation, Inc. Contributed by Catherine Moore This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ 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, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* Run-time Target Specification. */ #ifndef TARGET_VERSION diff -Nru gcc/config/arm/strongarm-pe.h gcc/config/arm/strongarm-pe.h --- gcc/config/arm/strongarm-pe.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/strongarm-pe.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions of target machine for GNU compiler, for ARM with PE obj format. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2007 Free Software Foundation, Inc. Contributed by Doug Evans (dje@cygnus.com). This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #undef TARGET_VERSION #define TARGET_VERSION fputs (" (StrongARM/PE)", stderr); diff -Nru gcc/config/arm/symbian.h gcc/config/arm/symbian.h --- gcc/config/arm/symbian.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/symbian.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,5 +1,5 @@ /* Configuration file for Symbian OS on ARM processors. - Copyright (C) 2004, 2005 + Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -16,9 +16,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* Do not expand builtin functions (unless explicitly prefixed with "__builtin"). Symbian OS code relies on properties of the standard diff -Nru gcc/config/arm/uclinux-elf.h gcc/config/arm/uclinux-elf.h --- gcc/config/arm/uclinux-elf.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/uclinux-elf.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions for ARM running ucLinux using ELF - Copyright (C) 1999, 2001, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1999, 2001, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Philip Blundell This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ 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, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* We don't want a PLT. */ #undef NEED_PLT_RELOC diff -Nru gcc/config/arm/unknown-elf.h gcc/config/arm/unknown-elf.h --- gcc/config/arm/unknown-elf.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/unknown-elf.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,5 +1,5 @@ /* Definitions for non-Linux based ARM systems using ELF - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Contributed by Catherine Moore @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -16,9 +16,8 @@ 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, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* elfos.h should have already been included. Now just override any conflicting definitions and add any extras. */ diff -Nru gcc/config/arm/vfp.md gcc/config/arm/vfp.md --- gcc/config/arm/vfp.md 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/vfp.md 2012-12-31 17:06:02.000000000 +0100 @@ -7,7 +7,7 @@ ;; ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, but @@ -16,9 +16,8 @@ ;; General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the Free -;; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -;; 02110-1301, USA. */ +;; along with GCC; see the file COPYING3. If not see +;; . */ ;; Additional register numbers (define_constants diff -Nru gcc/config/arm/vxworks.h gcc/config/arm/vxworks.h --- gcc/config/arm/vxworks.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/vxworks.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,6 +1,6 @@ /* Definitions of target machine for GCC, for ARM with targetting the VXWorks run time environment. - Copyright (C) 1999, 2000, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2003, 2004, 2007 Free Software Foundation, Inc. Contributed by: Mike Stump Brought up to date by CodeSourcery, LLC. @@ -9,7 +9,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -18,9 +18,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #define TARGET_OS_CPP_BUILTINS() \ diff -Nru gcc/config/arm/wince-pe.h gcc/config/arm/wince-pe.h --- gcc/config/arm/wince-pe.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/wince-pe.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions of target machine for GNU compiler, for ARM with WINCE-PE obj format. - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Nick Clifton This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #undef TARGET_DEFAULT #define TARGET_DEFAULT (MASK_NOP_FUN_DLLIMPORT) diff -Nru gcc/config/arm/xscale-coff.h gcc/config/arm/xscale-coff.h --- gcc/config/arm/xscale-coff.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/xscale-coff.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions for XScale systems using COFF - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2007 Free Software Foundation, Inc. Contributed by Catherine Moore This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ 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, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* Run-time Target Specification. */ #undef SUBTARGET_CPU_DEFAULT diff -Nru gcc/config/arm/xscale-elf.h gcc/config/arm/xscale-elf.h --- gcc/config/arm/xscale-elf.h 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/arm/xscale-elf.h 2012-12-31 17:06:02.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions for XScale architectures using ELF - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2007 Free Software Foundation, Inc. Contributed by Catherine Moore This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ 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, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* Run-time Target Specification. */ #ifndef TARGET_VERSION diff -Nru gcc/config/chorus.h gcc/config/chorus.h --- gcc/config/chorus.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/chorus.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions of target machine for GNU compiler. Sun Chorus OS big-endian - Copyright (c) 2001 Free Software Foundation, Inc. + Copyright (c) 2001, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #define DWARF2_DEBUGGING_INFO 1 diff -Nru gcc/config/darwin-c.c gcc/config/darwin-c.c --- gcc/config/darwin-c.c 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/darwin-c.c 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* Darwin support needed only by C/C++ frontends. - Copyright (C) 2001, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Apple Computer Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/config/darwin-protos.h gcc/config/darwin-protos.h --- gcc/config/darwin-protos.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/darwin-protos.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ /* Prototypes. - Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ extern void darwin_init_sections (void); extern int name_needs_quotes (const char *); diff -Nru gcc/config/darwin.c gcc/config/darwin.c --- gcc/config/darwin.c 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/darwin.c 2012-12-31 17:06:03.000000000 +0100 @@ -1,6 +1,6 @@ /* Functions for generic Darwin as target machine for GNU C compiler. Copyright (C) 1989, 1990, 1991, 1992, 1993, 2000, 2001, 2002, 2003, 2004, - 2005 + 2005, 2007 Free Software Foundation, Inc. Contributed by Apple Computer Inc. @@ -8,7 +8,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -17,9 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/config/darwin.h gcc/config/darwin.h --- gcc/config/darwin.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/darwin.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,6 +1,6 @@ /* Target definitions for Darwin (Mac OS X) systems. Copyright (C) 1989, 1990, 1991, 1992, 1993, 2000, 2001, 2002, 2003, 2004, - 2005 + 2005, 2007 Free Software Foundation, Inc. Contributed by Apple Computer Inc. @@ -8,7 +8,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, diff -Nru gcc/config/darwin.opt gcc/config/darwin.opt --- gcc/config/darwin.opt 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/darwin.opt 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ ; Processor-independent options for Darwin. -; Copyright (C) 2005 Free Software Foundation, Inc. +; Copyright (C) 2005, 2007 Free Software Foundation, Inc. ; ; This file is part of GCC. ; ; GCC is free software; you can redistribute it and/or modify it under ; the terms of the GNU General Public License as published by the Free -; Software Foundation; either version 2, or (at your option) any later +; Software Foundation; either version 3, or (at your option) any later ; version. ; ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ ; for more details. ; ; You should have received a copy of the GNU General Public License -; along with GCC; see the file COPYING. If not, write to the Free -; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -; 02110-1301, USA. +; along with GCC; see the file COPYING3. If not see +; . mfix-and-continue Target Report Var(darwin_fix_and_continue) diff -Nru gcc/config/dbx.h gcc/config/dbx.h --- gcc/config/dbx.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/dbx.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ /* Prefer DBX (stabs) debugging information. - Copyright (C) 1996 Free Software Foundation, Inc. + Copyright (C) 1996, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This file causes gcc to prefer using DBX (stabs) debugging information. The configure script will add a #include of this file diff -Nru gcc/config/dbxcoff.h gcc/config/dbxcoff.h --- gcc/config/dbxcoff.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/dbxcoff.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ /* Definitions needed when using stabs embedded in COFF sections. - Copyright (C) 1996, 2004 Free Software Foundation, Inc. + Copyright (C) 1996, 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This file may be included by any COFF target which wishes to support -gstabs generating stabs in sections, as produced by gas diff -Nru gcc/config/dbxelf.h gcc/config/dbxelf.h --- gcc/config/dbxelf.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/dbxelf.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ /* Definitions needed when using stabs embedded in ELF sections. - Copyright (C) 1999, 2004 Free Software Foundation, Inc. + Copyright (C) 1999, 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This file may be included by any ELF target which wishes to support -gstabs generating stabs in sections, as produced by gas diff -Nru gcc/config/elfos.h gcc/config/elfos.h --- gcc/config/elfos.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/elfos.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,14 +1,14 @@ /* elfos.h -- operating system specific defines to be used when targeting GCC for some generic ELF system - Copyright (C) 1991, 1994, 1995, 1999, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright (C) 1991, 1994, 1995, 1999, 2000, 2001, 2002, 2003, 2004, + 2007 Free Software Foundation, Inc. Based on svr4.h contributed by Ron Guilmette (rfg@netcom.com). This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -17,9 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #define TARGET_OBJFMT_CPP_BUILTINS() \ do \ diff -Nru gcc/config/freebsd-nthr.h gcc/config/freebsd-nthr.h --- gcc/config/freebsd-nthr.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/freebsd-nthr.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* FreeBSD configuration setting for FreeBSD systems. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2007 Free Software Foundation, Inc. Contributed by Loren J. Rittle This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,8 +15,7 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #define FBSD_NO_THREADS diff -Nru gcc/config/freebsd-spec.h gcc/config/freebsd-spec.h --- gcc/config/freebsd-spec.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/freebsd-spec.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ /* Base configuration file for all FreeBSD targets. - Copyright (C) 1999, 2000, 2001, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Common FreeBSD configuration. All FreeBSD architectures should include this file, which will specify diff -Nru gcc/config/freebsd.h gcc/config/freebsd.h --- gcc/config/freebsd.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/freebsd.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ /* Base configuration file for all FreeBSD targets. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2001, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Common FreeBSD configuration. All FreeBSD architectures should include this file, which will specify diff -Nru gcc/config/gofast.h gcc/config/gofast.h --- gcc/config/gofast.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/gofast.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* US Software GOFAST floating point library support. - Copyright (C) 1994, 1998, 1999, 2002, 2003, 2004 + Copyright (C) 1994, 1998, 1999, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* The US Software GOFAST library requires special optabs support. This file is intended to be included by config/ARCH/ARCH.c. It diff -Nru gcc/config/host-darwin.c gcc/config/host-darwin.c --- gcc/config/host-darwin.c 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/host-darwin.c 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ /* Darwin host-specific hook definitions. - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #include "config.h" #include "system.h" diff -Nru gcc/config/host-darwin.h gcc/config/host-darwin.h --- gcc/config/host-darwin.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/host-darwin.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ /* Darwin host-specific hook definitions. - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ extern void * darwin_gt_pch_get_address (size_t sz, int fd); extern int darwin_gt_pch_use_address (void *addr, size_t sz, int fd, diff -Nru gcc/config/host-hpux.c gcc/config/host-hpux.c --- gcc/config/host-hpux.c 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/host-hpux.c 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ /* HP-UX host-specific hook definitions. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #include "config.h" #include "system.h" diff -Nru gcc/config/host-linux.c gcc/config/host-linux.c --- gcc/config/host-linux.c 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/host-linux.c 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ /* Linux host-specific hook definitions. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #include "config.h" #include "system.h" diff -Nru gcc/config/host-solaris.c gcc/config/host-solaris.c --- gcc/config/host-solaris.c 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/host-solaris.c 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ /* Solaris host-specific hook definitions. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #include "config.h" #include "system.h" diff -Nru gcc/config/i386/biarch64.h gcc/config/i386/biarch64.h --- gcc/config/i386/biarch64.h 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/biarch64.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,14 +1,14 @@ /* Make configure files to produce biarch compiler defaulting to 64bit mode. This file must be included very first, while the OS specific file later to overwrite otherwise wrong defaults. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2007 Free Software Foundation, Inc. Contributed by Bo Thorsen . This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -17,9 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #define TARGET_64BIT_DEFAULT MASK_64BIT #define TARGET_BI_ARCH 1 diff -Nru gcc/config/i386/constraints.md gcc/config/i386/constraints.md --- gcc/config/i386/constraints.md 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/constraints.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Constraint definitions for IA-32 and x86-64. -;; Copyright (C) 2006 Free Software Foundation, Inc. +;; Copyright (C) 2006, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . ;;; Unused letters: ;;; B H TU W diff -Nru gcc/config/i386/darwin.h gcc/config/i386/darwin.h --- gcc/config/i386/darwin.h 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/darwin.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,13 @@ /* Target definitions for x86 running Darwin. - Copyright (C) 2001, 2002, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2004, 2005, 2007 + Free Software Foundation, Inc. Contributed by Apple Computer Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Enable Mach-O bits in generic x86 code. */ #undef TARGET_MACHO diff -Nru gcc/config/i386/darwin64.h gcc/config/i386/darwin64.h --- gcc/config/i386/darwin64.h 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/darwin64.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* Target definitions for x86_64 running Darwin. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. Contributed by Apple Computer Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (x86_64 Darwin)"); diff -Nru gcc/config/i386/driver-i386.c gcc/config/i386/driver-i386.c --- gcc/config/i386/driver-i386.c 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/driver-i386.c 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ /* Subroutines for the gcc driver. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" @@ -26,7 +25,7 @@ const char *host_detect_local_cpu (int argc, const char **argv); -#ifdef GCC_VERSION +#ifdef __GNUC__ #define cpuid(num,a,b,c,d) \ asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" \ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \ @@ -297,4 +296,4 @@ return concat ("-m", argv[0], "=", cpu, NULL); } -#endif /* GCC_VERSION */ +#endif /* __GNUC__ */ diff -Nru gcc/config/i386/emmintrin.h gcc/config/i386/emmintrin.h --- gcc/config/i386/emmintrin.h 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/emmintrin.h 2012-12-31 17:06:03.000000000 +0100 @@ -1456,12 +1456,6 @@ { return (__m128i)__builtin_ia32_psradi128 ((__v4si)__A, __B); } -#else -#define _mm_srai_epi16(__A, __B) \ - ((__m128i)__builtin_ia32_psrawi128 ((__v8hi)(__A), __B)) -#define _mm_srai_epi32(__A, __B) \ - ((__m128i)__builtin_ia32_psradi128 ((__v8hi)(__A), __B)) -#endif #if 0 static __m128i __attribute__((__always_inline__)) @@ -1506,14 +1500,6 @@ { return (__m128i)__builtin_ia32_psrlqi128 ((__v2di)__A, __B); } -#else -#define _mm_srli_epi16(__A, __B) \ - ((__m128i)__builtin_ia32_psrlwi128 ((__v8hi)(__A), __B)) -#define _mm_srli_epi32(__A, __B) \ - ((__m128i)__builtin_ia32_psrldi128 ((__v4si)(__A), __B)) -#define _mm_srli_epi64(__A, __B) \ - ((__m128i)__builtin_ia32_psrlqi128 ((__v4si)(__A), __B)) -#endif /* APPLE LOCAL begin radar 5618945 */ __STATIC_INLINE __m128i __attribute__((__always_inline__)) diff -Nru gcc/config/i386/host-i386-darwin.c gcc/config/i386/host-i386-darwin.c --- gcc/config/i386/host-i386-darwin.c 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/host-i386-darwin.c 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ /* i386-darwin host-specific hook definitions. - Copyright (C) 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/config/i386/i386-modes.def gcc/config/i386/i386-modes.def --- gcc/config/i386/i386-modes.def 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/i386-modes.def 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ /* Definitions of target machine for GCC for IA-32. - Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* The x86_64 ABI specifies both XF and TF modes. XFmode is __float80 is IEEE extended; TFmode is __float128 diff -Nru gcc/config/i386/i386-protos.h gcc/config/i386/i386-protos.h --- gcc/config/i386/i386-protos.h 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/i386-protos.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,13 +1,13 @@ /* Definitions of target machine for GCC for IA-32. Copyright (C) 1988, 1992, 1994, 1995, 1996, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Functions in i386.c */ extern void override_options (void); diff -Nru gcc/config/i386/i386.c gcc/config/i386/i386.c --- gcc/config/i386/i386.c 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/i386.c 2012-12-31 17:06:03.000000000 +0100 @@ -6,7 +6,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" @@ -18719,8 +18718,10 @@ if (! (*insn_data[icode].operand[1].predicate) (op0, mode1)) op0 = copy_to_reg (op0); - op1 = simplify_gen_subreg (TImode, op1, GET_MODE (op1), 0); - if (! (*insn_data[icode].operand[2].predicate) (op1, TImode)) + if (!CONST_INT_P (op1)) + op1 = simplify_gen_subreg (SImode, op1, GET_MODE (op1), 0); + + if (! (*insn_data[icode].operand[2].predicate) (op1, SImode)) op1 = copy_to_reg (op1); target = gen_reg_rtx (tmode); @@ -19914,7 +19915,7 @@ nbits = 7; /* Compute costs correctly for widening multiplication. */ - if ((GET_CODE (op0) == SIGN_EXTEND || GET_CODE (op1) == ZERO_EXTEND) + if ((GET_CODE (op0) == SIGN_EXTEND || GET_CODE (op0) == ZERO_EXTEND) && GET_MODE_SIZE (GET_MODE (XEXP (op0, 0))) * 2 == GET_MODE_SIZE (mode)) { diff -Nru gcc/config/i386/i386.h gcc/config/i386/i386.h --- gcc/config/i386/i386.h 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/i386.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions of target machine for GCC for IA-32. Copyright (C) 1988, 1992, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* The purpose of this file is to define the characteristics of the i386, independent of assembler syntax or operating system. diff -Nru gcc/config/i386/i386.md gcc/config/i386/i386.md --- gcc/config/i386/i386.md 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/i386.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,6 +1,6 @@ ;; GCC machine description for IA-32 and x86-64. ;; Copyright (C) 1988, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -;; 2001, 2002, 2003, 2004, 2005, 2006 +;; 2001, 2002, 2003, 2004, 2005, 2006, 2007 ;; Free Software Foundation, Inc. ;; Mostly by William Schelter. ;; x86_64 support added by Jan Hubicka @@ -9,7 +9,7 @@ ;; ;; GCC is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, @@ -18,9 +18,8 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. */ +;; along with GCC; see the file COPYING3. If not see +;; . */ ;; ;; The original PO technology requires these to be ordered by speed, ;; so that assigner will pick the fastest. @@ -3800,7 +3799,8 @@ ; else { - rtx temp = assign_386_stack_local (SFmode, SLOT_VIRTUAL); + int slot = virtuals_instantiated ? SLOT_TEMP : SLOT_VIRTUAL; + rtx temp = assign_386_stack_local (SFmode, slot); emit_insn (gen_truncdfsf2_with_temp (operands[0], operands[1], temp)); DONE; } @@ -3958,7 +3958,10 @@ DONE; } else - operands[2] = assign_386_stack_local (SFmode, SLOT_VIRTUAL); + { + int slot = virtuals_instantiated ? SLOT_TEMP : SLOT_VIRTUAL; + operands[2] = assign_386_stack_local (SFmode, slot); + } }) (define_insn "*truncxfsf2_mixed" @@ -4056,7 +4059,10 @@ DONE; } else - operands[2] = assign_386_stack_local (DFmode, SLOT_VIRTUAL); + { + int slot = virtuals_instantiated ? SLOT_TEMP : SLOT_VIRTUAL; + operands[2] = assign_386_stack_local (DFmode, slot); + } }) (define_insn "*truncxfdf2_mixed" @@ -15945,11 +15951,20 @@ { rtx label = gen_label_rtx (); - emit_label (label); + rtx op2; + + if (rtx_equal_p (operands[1], operands[2])) + { + op2 = gen_reg_rtx (XFmode); + emit_move_insn (op2, operands[2]); + } + else + op2 = operands[2]; - emit_insn (gen_fpremxf4 (operands[1], operands[2], - operands[1], operands[2])); + emit_label (label); + emit_insn (gen_fpremxf4 (operands[1], op2, operands[1], op2)); ix86_emit_fp_unordered_jump (label); + LABEL_NUSES (label) = 1; emit_move_insn (operands[0], operands[1]); DONE; @@ -16030,11 +16045,20 @@ { rtx label = gen_label_rtx (); - emit_label (label); + rtx op2; - emit_insn (gen_fprem1xf4 (operands[1], operands[2], - operands[1], operands[2])); + if (rtx_equal_p (operands[1], operands[2])) + { + op2 = gen_reg_rtx (XFmode); + emit_move_insn (op2, operands[2]); + } + else + op2 = operands[2]; + + emit_label (label); + emit_insn (gen_fprem1xf4 (operands[1], op2, operands[1], op2)); ix86_emit_fp_unordered_jump (label); + LABEL_NUSES (label) = 1; emit_move_insn (operands[0], operands[1]); DONE; diff -Nru gcc/config/i386/i386.opt gcc/config/i386/i386.opt --- gcc/config/i386/i386.opt 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/i386.opt 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ ; Options for the IA-32 and AMD64 ports of the compiler. -; Copyright (C) 2005 Free Software Foundation, Inc. +; Copyright (C) 2005, 2007 Free Software Foundation, Inc. ; ; This file is part of GCC. ; ; GCC is free software; you can redistribute it and/or modify it under ; the terms of the GNU General Public License as published by the Free -; Software Foundation; either version 2, or (at your option) any later +; Software Foundation; either version 3, or (at your option) any later ; version. ; ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ ; for more details. ; ; You should have received a copy of the GNU General Public License -; along with GCC; see the file COPYING. If not, write to the Free -; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -; 02110-1301, USA. +; along with GCC; see the file COPYING3. If not see +; . m128bit-long-double Target RejectNegative Report Mask(128BIT_LONG_DOUBLE) diff -Nru gcc/config/i386/k6.md gcc/config/i386/k6.md --- gcc/config/i386/k6.md 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/k6.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ ;; AMD K6/K6-2 Scheduling -;; Copyright (C) 2002, 2004 +;; Copyright (C) 2002, 2004, 2007 ;; Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . ;; ;; The K6 architecture is quite similar to PPro. Important difference is ;; that there are only two decoders and they seems to be much slower than diff -Nru gcc/config/i386/mmx.md gcc/config/i386/mmx.md --- gcc/config/i386/mmx.md 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/mmx.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ ;; GCC machine description for MMX and 3dNOW! instructions -;; Copyright (C) 2005 +;; Copyright (C) 2005, 2007 ;; Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . ;; The MMX and 3dNOW! patterns are in the same file because they use ;; the same register file, and 3dNOW! adds a number of extensions to diff -Nru gcc/config/i386/pentium.md gcc/config/i386/pentium.md --- gcc/config/i386/pentium.md 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/pentium.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Pentium Scheduling -;; Copyright (C) 2002 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. */ +;; along with GCC; see the file COPYING3. If not see +;; . */ ;; ;; The Pentium is an in-order core with two integer pipelines. diff -Nru gcc/config/i386/ppro.md gcc/config/i386/ppro.md --- gcc/config/i386/ppro.md 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/ppro.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Scheduling for the Intel P6 family of processors -;; Copyright (C) 2004, 2005 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. */ +;; along with GCC; see the file COPYING3. If not see +;; . */ ;; The P6 family includes the Pentium Pro, Pentium II, Pentium III, Celeron ;; and Xeon lines of CPUs. The DFA scheduler description in this file is diff -Nru gcc/config/i386/predicates.md gcc/config/i386/predicates.md --- gcc/config/i386/predicates.md 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/predicates.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Predicate definitions for IA-32 and x86-64. -;; Copyright (C) 2004, 2005, 2006 Free Software Foundation, Inc. +;; Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . ;; Return nonzero if OP is either a i387 or SSE fp register. (define_predicate "any_fp_register_operand" diff -Nru gcc/config/i386/sse.md gcc/config/i386/sse.md --- gcc/config/i386/sse.md 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/sse.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,11 @@ ;; GCC machine description for SSE instructions -;; Copyright (C) 2005, 2006 -;; Free Software Foundation, Inc. +;; Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, @@ -15,9 +14,8 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . ;; 16 byte integral modes handled by SSE, minus TImode, which gets @@ -3019,7 +3017,7 @@ [(set (match_operand:SSEMODE24 0 "register_operand" "=x") (ashiftrt:SSEMODE24 (match_operand:SSEMODE24 1 "register_operand" "0") - (match_operand:TI 2 "nonmemory_operand" "xn")))] + (match_operand:SI 2 "nonmemory_operand" "xN")))] "TARGET_SSE2" "psra\t{%2, %0|%0, %2}" [(set_attr "type" "sseishft") @@ -3029,7 +3027,7 @@ [(set (match_operand:SSEMODE248 0 "register_operand" "=x") (lshiftrt:SSEMODE248 (match_operand:SSEMODE248 1 "register_operand" "0") - (match_operand:TI 2 "nonmemory_operand" "xn")))] + (match_operand:SI 2 "nonmemory_operand" "xN")))] "TARGET_SSE2" "psrl\t{%2, %0|%0, %2}" [(set_attr "type" "sseishft") @@ -3039,7 +3037,7 @@ [(set (match_operand:SSEMODE248 0 "register_operand" "=x") (ashift:SSEMODE248 (match_operand:SSEMODE248 1 "register_operand" "0") - (match_operand:TI 2 "nonmemory_operand" "xn")))] + (match_operand:SI 2 "nonmemory_operand" "xN")))] "TARGET_SSE2" "psll\t{%2, %0|%0, %2}" [(set_attr "type" "sseishft") @@ -3052,11 +3050,9 @@ (define_expand "vec_shl_" [(set (match_operand:SSEMODEI 0 "register_operand" "") (ashift:TI (match_operand:SSEMODEI 1 "register_operand" "") - (match_operand:SI 2 "general_operand" "")))] + (match_operand:SI 2 "const_0_to_255_mul_8_operand" "")))] "TARGET_SSE2" { - if (!const_0_to_255_mul_8_operand (operands[2], SImode)) - FAIL; operands[0] = gen_lowpart (TImode, operands[0]); operands[1] = gen_lowpart (TImode, operands[1]); }) @@ -3068,11 +3064,9 @@ (define_expand "vec_shr_" [(set (match_operand:SSEMODEI 0 "register_operand" "") (lshiftrt:TI (match_operand:SSEMODEI 1 "register_operand" "") - (match_operand:SI 2 "general_operand" "")))] + (match_operand:SI 2 "const_0_to_255_mul_8_operand" "")))] "TARGET_SSE2" { - if (!const_0_to_255_mul_8_operand (operands[2], SImode)) - FAIL; operands[0] = gen_lowpart (TImode, operands[0]); operands[1] = gen_lowpart (TImode, operands[1]); }) diff -Nru gcc/config/i386/sync.md gcc/config/i386/sync.md --- gcc/config/i386/sync.md 2010-10-14 22:27:48.000000000 +0200 +++ gcc/config/i386/sync.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ ;; GCC machine description for i386 synchronization instructions. -;; Copyright (C) 2005, 2006 +;; Copyright (C) 2005, 2006, 2007 ;; Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . (define_mode_macro IMODE [QI HI SI (DI "TARGET_64BIT")]) (define_mode_attr modesuffix [(QI "b") (HI "w") (SI "l") (DI "q")]) diff -Nru gcc/config/interix.h gcc/config/interix.h --- gcc/config/interix.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/interix.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,6 +1,7 @@ /* Operating system specific defines to be used when targeting GCC for Interix - Copyright (C) 1994, 1995, 1999, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1999, 2002, 2004, 2007 + Free Software Foundation, Inc. Donn Terry, Softway Systems, Inc. (donn@softway.com) Modified from code Contributed by Douglas B. Rupp (drupp@cs.washington.edu). @@ -9,7 +10,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -18,9 +19,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* POSIX/Uni-thread only for now. Look at the winnt version for windows/multi thread */ diff -Nru gcc/config/interix3.h gcc/config/interix3.h --- gcc/config/interix3.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/interix3.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,13 +1,13 @@ /* Operating system specific defines to be used when targeting GCC for Interix version 3. - Copyright (C) 2001 Free Software Foundation, Inc. + Copyright (C) 2001, 2007 Free Software Foundation, Inc. Contributed by Douglas B. Rupp (rupp@gnat.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Interix 3.x has a single rooted file system and properly named libraries, so LIB_SPEC can be simplified */ diff -Nru gcc/config/kaos.h gcc/config/kaos.h --- gcc/config/kaos.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/kaos.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions of target machine for GCC. common kaOS definitions for all architectures. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Specify predefined symbols in preprocessor. */ #define TARGET_OS_CPP_BUILTINS() \ diff -Nru gcc/config/kfreebsd-gnu.h gcc/config/kfreebsd-gnu.h --- gcc/config/kfreebsd-gnu.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/kfreebsd-gnu.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,5 +1,5 @@ /* Definitions for kFreeBSD-based GNU systems with ELF format - Copyright (C) 2004, 2006 + Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc. Contributed by Robert Millan. @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #undef LINUX_TARGET_OS_CPP_BUILTINS #define LINUX_TARGET_OS_CPP_BUILTINS() \ diff -Nru gcc/config/knetbsd-gnu.h gcc/config/knetbsd-gnu.h --- gcc/config/knetbsd-gnu.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/knetbsd-gnu.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,5 +1,5 @@ /* Definitions for kNetBSD-based GNU systems with ELF format - Copyright (C) 2004, 2006 + Copyright (C) 2004, 2006, 2007 Free Software Foundation, Inc. Contributed by Robert Millan. @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #undef LINUX_TARGET_OS_CPP_BUILTINS #define LINUX_TARGET_OS_CPP_BUILTINS() \ diff -Nru gcc/config/libgloss.h gcc/config/libgloss.h --- gcc/config/libgloss.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/libgloss.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* libgloss.h -- operating system specific defines to be used when targeting GCC for Libgloss supported targets. - Copyright (C) 1996, 2004 Free Software Foundation, Inc. + Copyright (C) 1996, 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This file should not be used for ELF targets, as this definition of STARTFILE_SPEC is all wrong. */ diff -Nru gcc/config/linux.h gcc/config/linux.h --- gcc/config/linux.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/linux.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,6 +1,6 @@ /* Definitions for Linux-based GNU systems with ELF format - Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2003, 2004, 2005, 2006, + 2007 Free Software Foundation, Inc. Contributed by Eric Youngdale. Modified for stabs-in-ELF by H.J. Lu (hjl@lucon.org). @@ -8,7 +8,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -17,9 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Don't assume anything about the header files. */ #define NO_IMPLICIT_EXTERN_C diff -Nru gcc/config/linux.opt gcc/config/linux.opt --- gcc/config/linux.opt 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/linux.opt 2012-12-31 17:06:03.000000000 +0100 @@ -1,13 +1,13 @@ ; Processor-independent options for GNU/Linux. ; -; Copyright (C) 2006 Free Software Foundation, Inc. +; Copyright (C) 2006, 2007 Free Software Foundation, Inc. ; Contributed by CodeSourcery. ; ; This file is part of GCC. ; ; GCC is free software; you can redistribute it and/or modify it under ; the terms of the GNU General Public License as published by the Free -; Software Foundation; either version 2, or (at your option) any later +; Software Foundation; either version 3, or (at your option) any later ; version. ; ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -16,9 +16,8 @@ ; for more details. ; ; You should have received a copy of the GNU General Public License -; along with GCC; see the file COPYING. If not, write to the Free -; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -; 02110-1301, USA. +; along with GCC; see the file COPYING3. If not see +; . muclibc Target RejectNegative Report Mask(UCLIBC) Var(linux_uclibc) Init(UCLIBC_DEFAULT ? OPTION_MASK_UCLIBC : 0) diff -Nru gcc/config/lynx.h gcc/config/lynx.h --- gcc/config/lynx.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/lynx.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* Target independent definitions for LynxOS. - Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2003, 2004, + 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* In this file we set up defaults that can be chosen by /lynx.h files. A target-specific lynx.h file can decide diff -Nru gcc/config/lynx.opt gcc/config/lynx.opt --- gcc/config/lynx.opt 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/lynx.opt 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ ; Processor-independent options for LynxOS. -; Copyright (C) 2005 Free Software Foundation, Inc. +; Copyright (C) 2005, 2007 Free Software Foundation, Inc. ; ; This file is part of GCC. ; ; GCC is free software; you can redistribute it and/or modify it under ; the terms of the GNU General Public License as published by the Free -; Software Foundation; either version 2, or (at your option) any later +; Software Foundation; either version 3, or (at your option) any later ; version. ; ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ ; for more details. ; ; You should have received a copy of the GNU General Public License -; along with GCC; see the file COPYING. If not, write to the Free -; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -; 02110-1301, USA. +; along with GCC; see the file COPYING3. If not see +; . mlegacy-threads Target RejectNegative diff -Nru gcc/config/netbsd-aout.h gcc/config/netbsd-aout.h --- gcc/config/netbsd-aout.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/netbsd-aout.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* Common configuration file for NetBSD a.out targets. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2007 Free Software Foundation, Inc. Contributed by Wasabi Systems, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* TARGET_OS_CPP_BUILTINS() common to all NetBSD a.out targets. */ #define NETBSD_OS_CPP_BUILTINS_AOUT() \ diff -Nru gcc/config/netbsd-elf.h gcc/config/netbsd-elf.h --- gcc/config/netbsd-elf.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/netbsd-elf.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* Common configuration file for NetBSD ELF targets. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2007 Free Software Foundation, Inc. Contributed by Wasabi Systems, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* TARGET_OS_CPP_BUILTINS() common to all NetBSD ELF targets. */ #define NETBSD_OS_CPP_BUILTINS_ELF() \ diff -Nru gcc/config/netbsd.h gcc/config/netbsd.h --- gcc/config/netbsd.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/netbsd.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* Base configuration file for all NetBSD targets. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* TARGET_OS_CPP_BUILTINS() common to all NetBSD targets. */ #define NETBSD_OS_CPP_BUILTINS_COMMON() \ diff -Nru gcc/config/openbsd-oldgas.h gcc/config/openbsd-oldgas.h --- gcc/config/openbsd-oldgas.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/openbsd-oldgas.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* Generic settings for a.out OpenBSD systems. - Copyright (C) 2002 Free Software Foundation, Inc. + Copyright (C) 2002, 2007 Free Software Foundation, Inc. Contributed by David E. O'Brien . This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #define OBSD_OLD_GAS diff -Nru gcc/config/openbsd.h gcc/config/openbsd.h --- gcc/config/openbsd.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/openbsd.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ /* Base configuration file for all OpenBSD targets. - Copyright (C) 1999, 2000, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1999, 2000, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Common OpenBSD configuration. All OpenBSD architectures include this file, which is intended as diff -Nru gcc/config/ptx4.h gcc/config/ptx4.h --- gcc/config/ptx4.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/ptx4.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,6 +1,6 @@ /* Operating system specific defines to be used when targeting GCC for Sequent's Dynix/ptx v4 and later. - Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004 + Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2007 Free Software Foundation, Inc. Generic SysV4 file Contributed by Ron Guilmette (rfg@monkeys.com). Renamed and changed to suit Dynix/ptx v4 and later. @@ -11,7 +11,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -20,9 +20,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. +along with GCC; see the file COPYING3. If not see +. */ diff -Nru gcc/config/rs6000/40x.md gcc/config/rs6000/40x.md --- gcc/config/rs6000/40x.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/40x.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Scheduling description for IBM PowerPC 403 and PowerPC 405 processors. -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the -;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . (define_automaton "ppc40x,ppc40xiu") (define_cpu_unit "bpu_40x,fpu_405" "ppc40x") diff -Nru gcc/config/rs6000/440.md gcc/config/rs6000/440.md --- gcc/config/rs6000/440.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/440.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Scheduling description for IBM PowerPC 440 processor. -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . ;; PPC440 Embedded PowerPC controller ;; dual issue diff -Nru gcc/config/rs6000/603.md gcc/config/rs6000/603.md --- gcc/config/rs6000/603.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/603.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Scheduling description for PowerPC 603 processor. -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the -;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . (define_automaton "ppc603,ppc603fp") (define_cpu_unit "iu_603" "ppc603") diff -Nru gcc/config/rs6000/6xx.md gcc/config/rs6000/6xx.md --- gcc/config/rs6000/6xx.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/6xx.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ ;; Scheduling description for PowerPC 604, PowerPC 604e, PowerPC 620, ;; and PowerPC 630 processors. -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the -;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . (define_automaton "ppc6xx,ppc6xxfp,ppc6xxfp2") (define_cpu_unit "iu1_6xx,iu2_6xx,mciu_6xx" "ppc6xx") diff -Nru gcc/config/rs6000/7450.md gcc/config/rs6000/7450.md --- gcc/config/rs6000/7450.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/7450.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Scheduling description for Motorola PowerPC 7450 processor. -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the -;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . (define_automaton "ppc7450,ppc7450mciu,ppc7450fp,ppc7450vec") (define_cpu_unit "iu1_7450,iu2_7450,iu3_7450" "ppc7450") diff -Nru gcc/config/rs6000/7xx.md gcc/config/rs6000/7xx.md --- gcc/config/rs6000/7xx.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/7xx.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Scheduling description for Motorola PowerPC 750 and PowerPC 7400 processors. -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the -;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . (define_automaton "ppc7xx,ppc7xxfp") (define_cpu_unit "iu1_7xx,iu2_7xx" "ppc7xx") diff -Nru gcc/config/rs6000/8540.md gcc/config/rs6000/8540.md --- gcc/config/rs6000/8540.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/8540.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Pipeline description for Motorola PowerPC 8540 processor. -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the -;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . (define_automaton "ppc8540_most,ppc8540_long,ppc8540_retire") (define_cpu_unit "ppc8540_decode_0,ppc8540_decode_1" "ppc8540_most") diff -Nru gcc/config/rs6000/aix61.h gcc/config/rs6000/aix61.h --- gcc/config/rs6000/aix61.h 1970-01-01 01:00:00.000000000 +0100 +++ gcc/config/rs6000/aix61.h 2012-12-31 17:06:03.000000000 +0100 @@ -0,0 +1,196 @@ +/* Definitions of target machine for GNU compiler, + for IBM RS/6000 POWER running AIX V6.1. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 + Free Software Foundation, Inc. + Contributed by David Edelsohn (edelsohn@gnu.org). + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +/* Sometimes certain combinations of command options do not make sense + on a particular target machine. You can define a macro + `OVERRIDE_OPTIONS' to take account of this. This macro, if + defined, is executed once just after all the command options have + been parsed. + + The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to + get control. */ + +#define NON_POWERPC_MASKS (MASK_POWER | MASK_POWER2) +#define SUBTARGET_OVERRIDE_OPTIONS \ +do { \ + if (TARGET_64BIT && (target_flags & NON_POWERPC_MASKS)) \ + { \ + target_flags &= ~NON_POWERPC_MASKS; \ + warning (0, "-maix64 and POWER architecture are incompatible"); \ + } \ + if (TARGET_64BIT && ! TARGET_POWERPC64) \ + { \ + target_flags |= MASK_POWERPC64; \ + warning (0, "-maix64 requires PowerPC64 architecture remain enabled"); \ + } \ + if (TARGET_SOFT_FLOAT && TARGET_LONG_DOUBLE_128) \ + { \ + rs6000_long_double_type_size = 64; \ + if (rs6000_explicit_options.long_double) \ + warning (0, "soft-float and long-double-128 are incompatible"); \ + } \ + if (TARGET_POWERPC64 && ! TARGET_64BIT) \ + { \ + error ("-maix64 required: 64-bit computation with 32-bit addressing not yet supported"); \ + } \ +} while (0); + +#undef ASM_SPEC +#define ASM_SPEC "-u %{maix64:-a64 %{!mcpu*:-mppc64}} %(asm_cpu)" + +/* Common ASM definitions used by ASM_SPEC amongst the various targets + for handling -mcpu=xxx switches. */ +#undef ASM_CPU_SPEC +#define ASM_CPU_SPEC \ +"%{!mcpu*: %{!maix64: \ + %{mpowerpc64: -mppc64} \ + %{!mpower64: %(asm_default)}}} \ +%{mcpu=power3: -m620} \ +%{mcpu=power4: -mpwr4} \ +%{mcpu=power5: -mpwr5} \ +%{mcpu=power5+: -mpwr5x} \ +%{mcpu=power6: -mpwr6} \ +%{mcpu=power6x: -mpwr6} \ +%{mcpu=powerpc: -mppc} \ +%{mcpu=rs64a: -mppc} \ +%{mcpu=603: -m603} \ +%{mcpu=603e: -m603} \ +%{mcpu=604: -m604} \ +%{mcpu=604e: -m604} \ +%{mcpu=620: -m620} \ +%{mcpu=630: -m620} \ +%{mcpu=970: -m970} \ +%{mcpu=G5: -m970}" + +#undef ASM_DEFAULT_SPEC +#define ASM_DEFAULT_SPEC "-mppc" + +#undef TARGET_OS_CPP_BUILTINS +#define TARGET_OS_CPP_BUILTINS() \ + do \ + { \ + builtin_define ("_AIX43"); \ + builtin_define ("_AIX51"); \ + builtin_define ("_AIX52"); \ + builtin_define ("_AIX53"); \ + builtin_define ("_AIX61"); \ + TARGET_OS_AIX_CPP_BUILTINS (); \ + } \ + while (0) + +#undef CPP_SPEC +#define CPP_SPEC "%{posix: -D_POSIX_SOURCE} \ + %{ansi: -D_ANSI_C_SOURCE} \ + %{maix64: -D__64BIT__} \ + %{mpe: -I/usr/lpp/ppe.poe/include} \ + %{pthread: -D_THREAD_SAFE}" + +/* The GNU C++ standard library requires that these macros be + defined. Synchronize with libstdc++ os_defines.h. */ +#undef CPLUSPLUS_CPP_SPEC +#define CPLUSPLUS_CPP_SPEC \ + "-D_ALL_SOURCE -D__COMPATMATH__ \ + %{maix64: -D__64BIT__} \ + %{mpe: -I/usr/lpp/ppe.poe/include} \ + %{pthread: -D_THREAD_SAFE}" + +#undef TARGET_DEFAULT +#define TARGET_DEFAULT (MASK_POWERPC | MASK_NEW_MNEMONICS) + +#undef PROCESSOR_DEFAULT +#define PROCESSOR_DEFAULT PROCESSOR_POWER5 +#undef PROCESSOR_DEFAULT64 +#define PROCESSOR_DEFAULT64 PROCESSOR_POWER5 + +#undef TARGET_POWER +#define TARGET_POWER 0 + +/* Define this macro as a C expression for the initializer of an + array of string to tell the driver program which options are + defaults for this target and thus do not need to be handled + specially when using `MULTILIB_OPTIONS'. + + Do not define this macro if `MULTILIB_OPTIONS' is not defined in + the target makefile fragment or if none of the options listed in + `MULTILIB_OPTIONS' are set by default. *Note Target Fragment::. */ + +#undef MULTILIB_DEFAULTS + +#undef LIB_SPEC +#define LIB_SPEC "%{pg:-L/lib/profiled -L/usr/lib/profiled}\ + %{p:-L/lib/profiled -L/usr/lib/profiled}\ + %{!maix64:%{!shared:%{g*:-lg}}}\ + %{mpe:-L/usr/lpp/ppe.poe/lib -lmpi -lvtd}\ + %{pthread:-lpthreads} -lc" + +#undef LINK_SPEC +#define LINK_SPEC "-bpT:0x10000000 -bpD:0x20000000 %{!r:-btextro} -bnodelcsect\ + %{static:-bnso %(link_syscalls) } %{shared:-bM:SRE %{!e:-bnoentry}}\ + %{!maix64:%{!shared:%{g*: %(link_libg) }}} %{maix64:-b64}\ + %{mpe:-binitfini:poe_remote_main}" + +#undef STARTFILE_SPEC +#define STARTFILE_SPEC "%{!shared:\ + %{maix64:%{pg:gcrt0_64%O%s}%{!pg:%{p:mcrt0_64%O%s}%{!p:crt0_64%O%s}}}\ + %{!maix64:\ + %{pthread:%{pg:gcrt0_r%O%s}%{!pg:%{p:mcrt0_r%O%s}%{!p:crt0_r%O%s}}}\ + %{!pthread:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}}}}}" + +/* AIX V5 typedefs ptrdiff_t as "long" while earlier releases used "int". */ + +#undef PTRDIFF_TYPE +#define PTRDIFF_TYPE "long int" + +/* Type used for wchar_t, as a string used in a declaration. */ +#undef WCHAR_TYPE +#define WCHAR_TYPE (!TARGET_64BIT ? "short unsigned int" : "unsigned int") + +/* Width of wchar_t in bits. */ +#undef WCHAR_TYPE_SIZE +#define WCHAR_TYPE_SIZE (!TARGET_64BIT ? 16 : 32) + +/* AIX V5 uses PowerPC nop (ori 0,0,0) instruction as call glue for PowerPC + and "cror 31,31,31" for POWER architecture. */ + +#undef RS6000_CALL_GLUE +#define RS6000_CALL_GLUE "{cror 31,31,31|nop}" + +/* AIX 4.2 and above provides initialization and finalization function + support from linker command line. */ +#undef HAS_INIT_SECTION +#define HAS_INIT_SECTION + +#undef LD_INIT_SWITCH +#define LD_INIT_SWITCH "-binitfini" + +/* AIX 5.2 has the float and long double forms of math functions. */ +#undef TARGET_C99_FUNCTIONS +#define TARGET_C99_FUNCTIONS 1 + +#ifndef _AIX52 +extern long long int atoll(const char *); +#endif + +/* This target uses the aix64.opt file. */ +#define TARGET_USES_AIX64_OPT 1 + +#define RS6000_DEFAULT_LONG_DOUBLE_SIZE 128 diff -Nru gcc/config/rs6000/altivec.md gcc/config/rs6000/altivec.md --- gcc/config/rs6000/altivec.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/altivec.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,13 @@ ;; AltiVec patterns. -;; Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 +;; Free Software Foundation, Inc. ;; Contributed by Aldy Hernandez (aldy@quesejoda.com) ;; This file is part of GCC. ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +16,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the -;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . (define_constants [(UNSPEC_VCMPBFP 50) diff -Nru gcc/config/rs6000/constraints.md gcc/config/rs6000/constraints.md --- gcc/config/rs6000/constraints.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/constraints.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Constraint definitions for RS6000 -;; Copyright (C) 2006 Free Software Foundation, Inc. +;; Copyright (C) 2006, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . ;; Register constraints diff -Nru gcc/config/rs6000/darwin.h gcc/config/rs6000/darwin.h --- gcc/config/rs6000/darwin.h 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/darwin.h 2013-01-01 12:16:54.000000000 +0100 @@ -1,5 +1,5 @@ /* Target definitions for PowerPC running Darwin (Mac OS X). - Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 + Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Apple Computer Inc. @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -16,9 +16,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (Darwin/PowerPC)"); diff -Nru gcc/config/rs6000/darwin.md gcc/config/rs6000/darwin.md --- gcc/config/rs6000/darwin.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/darwin.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* Machine description patterns for PowerPC running Darwin (Mac OS X). - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Apple Computer Inc. This file is part of GCC. 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) +the Free Software Foundation; either version 3, or (at your option) any later version. GNU CC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ 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, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +;; along with GCC; see the file COPYING3. If not see +;; . */ (define_insn "adddi3_high" [(set (match_operand:DI 0 "gpc_reg_operand" "=b") diff -Nru gcc/config/rs6000/darwin.opt gcc/config/rs6000/darwin.opt --- gcc/config/rs6000/darwin.opt 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/darwin.opt 2012-12-31 17:06:03.000000000 +0100 @@ -1,13 +1,13 @@ ; Darwin options for PPC port. ; -; Copyright (C) 2005 Free Software Foundation, Inc. +; Copyright (C) 2005, 2007 Free Software Foundation, Inc. ; Contributed by Aldy Hernandez . ; ; This file is part of GCC. ; ; GCC is free software; you can redistribute it and/or modify it under ; the terms of the GNU General Public License as published by the Free -; Software Foundation; either version 2, or (at your option) any later +; Software Foundation; either version 3, or (at your option) any later ; version. ; ; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -16,9 +16,8 @@ ; License for more details. ; ; You should have received a copy of the GNU General Public License -; along with GCC; see the file COPYING. If not, write to the Free -; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -; 02110-1301, USA. +; along with GCC; see the file COPYING3. If not see +; . m64 Target RejectNegative Mask(64BIT) diff -Nru gcc/config/rs6000/darwin64.h gcc/config/rs6000/darwin64.h --- gcc/config/rs6000/darwin64.h 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/darwin64.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* Target definitions for PowerPC running Darwin (Mac OS X). - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. Contributed by Apple Computer Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #undef TARGET_VERSION #define TARGET_VERSION fprintf (stderr, " (Darwin/PowerPC64)"); diff -Nru gcc/config/rs6000/darwin7.h gcc/config/rs6000/darwin7.h --- gcc/config/rs6000/darwin7.h 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/darwin7.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* Target definitions for Darwin 7.x (Mac OS X) systems. - Copyright (C) 2004, 2005 + Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Machine dependent libraries. Include libmx when compiling for Darwin 7.0 and above, but before libSystem, since the functions are diff -Nru gcc/config/rs6000/darwin8.h gcc/config/rs6000/darwin8.h --- gcc/config/rs6000/darwin8.h 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/darwin8.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* Target definitions for Darwin 8.0 and above (Mac OS X) systems. - Copyright (C) 2004, 2005 + Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Machine dependent libraries. Include libmx when compiling on Darwin 7.0 and above, but before libSystem, since the functions are diff -Nru gcc/config/rs6000/host-darwin.c gcc/config/rs6000/host-darwin.c --- gcc/config/rs6000/host-darwin.c 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/host-darwin.c 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* APPLE LOCAL file mainline 2006-06-02 4508814 */ /* Darwin/powerpc host-specific hook definitions. - Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #include "config.h" #include "system.h" diff -Nru gcc/config/rs6000/host-ppc64-darwin.c gcc/config/rs6000/host-ppc64-darwin.c --- gcc/config/rs6000/host-ppc64-darwin.c 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/host-ppc64-darwin.c 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ /* ppc64-darwin host-specific hook definitions. - Copyright (C) 2006 Free Software Foundation, Inc. + Copyright (C) 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/config/rs6000/mpc.md gcc/config/rs6000/mpc.md --- gcc/config/rs6000/mpc.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/mpc.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Scheduling description for Motorola PowerPC processor cores. -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ ;; License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the -;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . (define_automaton "mpc,mpcfp") (define_cpu_unit "iu_mpc,mciu_mpc" "mpc") diff -Nru gcc/config/rs6000/power4.md gcc/config/rs6000/power4.md --- gcc/config/rs6000/power4.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/power4.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Scheduling description for IBM Power4 and PowerPC 970 processors. -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ ;; License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the -;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . ;; Sources: IBM Red Book and White Paper on POWER4 diff -Nru gcc/config/rs6000/power5.md gcc/config/rs6000/power5.md --- gcc/config/rs6000/power5.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/power5.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Scheduling description for IBM POWER5 processor. -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ ;; License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the -;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . ;; Sources: IBM Red Book and White Paper on POWER5 diff -Nru gcc/config/rs6000/predicates.md gcc/config/rs6000/predicates.md --- gcc/config/rs6000/predicates.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/predicates.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Predicate definitions for POWER and PowerPC. -;; Copyright (C) 2005, 2006 Free Software Foundation, Inc. +;; Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; ;; GCC is free software; you can redistribute it and/or modify ;; it under the terms of the GNU General Public License as published by -;; the Free Software Foundation; either version 2, or (at your option) +;; the Free Software Foundation; either version 3, or (at your option) ;; any later version. ;; ;; GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to -;; the Free Software Foundation, 51 Franklin Street, Fifth Floor, -;; Boston, MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . ;; Return 1 for anything except PARALLEL. (define_predicate "any_operand" diff -Nru gcc/config/rs6000/rios1.md gcc/config/rs6000/rios1.md --- gcc/config/rs6000/rios1.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/rios1.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Scheduling description for IBM POWER processor. -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the -;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . (define_automaton "rios1,rios1fp") (define_cpu_unit "iu_rios1" "rios1") diff -Nru gcc/config/rs6000/rios2.md gcc/config/rs6000/rios2.md --- gcc/config/rs6000/rios2.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/rios2.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Scheduling description for IBM Power2 processor. -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the -;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . (define_automaton "rios2,rios2fp") (define_cpu_unit "iu1_rios2,iu2_rios2" "rios2") diff -Nru gcc/config/rs6000/rs6000-c.c gcc/config/rs6000/rs6000-c.c --- gcc/config/rs6000/rs6000-c.c 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/rs6000-c.c 2012-12-31 17:06:03.000000000 +0100 @@ -1,6 +1,5 @@ /* Subroutines for the C front end on the POWER and PowerPC architectures. - Copyright (C) 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Zack Weinberg and Paolo Bonzini @@ -9,7 +8,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -18,9 +17,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #include "config.h" #include "system.h" @@ -292,7 +290,10 @@ RS6000_CPU_CPP_ENDIAN_BUILTINS(); if (TARGET_LONG_DOUBLE_128) - builtin_define ("__LONG_DOUBLE_128__"); + { + builtin_define ("__LONG_DOUBLE_128__"); + builtin_define ("__LONGDOUBLE128"); + } switch (rs6000_current_abi) { diff -Nru gcc/config/rs6000/rs6000-modes.def gcc/config/rs6000/rs6000-modes.def --- gcc/config/rs6000/rs6000-modes.def 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/rs6000-modes.def 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000. - Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2007 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* 128-bit floating point. ABI_V4 uses IEEE quad, AIX/Darwin adjust this in rs6000_override_options. */ diff -Nru gcc/config/rs6000/rs6000-protos.h gcc/config/rs6000/rs6000-protos.h --- gcc/config/rs6000/rs6000-protos.h 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/rs6000-protos.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -16,9 +16,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #ifndef GCC_RS6000_PROTOS_H #define GCC_RS6000_PROTOS_H diff -Nru gcc/config/rs6000/rs6000.c gcc/config/rs6000/rs6000.c --- gcc/config/rs6000/rs6000.c 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/rs6000.c 2013-01-01 12:15:12.000000000 +0100 @@ -8,7 +8,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -17,9 +17,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ #include "config.h" #include "system.h" diff -Nru gcc/config/rs6000/rs6000.h gcc/config/rs6000/rs6000.h --- gcc/config/rs6000/rs6000.h 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/rs6000.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, for IBM RS/6000. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) @@ -8,7 +8,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published - by the Free Software Foundation; either version 2, or (at your + by the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT @@ -17,9 +17,8 @@ License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the - Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, - MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* Note that some other tm.h files include this one and then override many of the definitions. */ diff -Nru gcc/config/rs6000/rs6000.md gcc/config/rs6000/rs6000.md --- gcc/config/rs6000/rs6000.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/rs6000.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,6 +1,6 @@ ;; Machine description for IBM RISC System 6000 (POWER) for GNU C compiler ;; Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, -;; 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +;; 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 ;; Free Software Foundation, Inc. ;; Contributed by Richard Kenner (kenner@vlsi1.ultra.nyu.edu) @@ -8,7 +8,7 @@ ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -17,9 +17,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the -;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . ;;- See file "rtl.def" for documentation on define_insn, match_*, et. al. @@ -10110,6 +10109,7 @@ "" " { + operands[1] = force_reg (Pmode, operands[1]); operands[2] = gen_reg_rtx (Pmode); operands[3] = gen_frame_mem (Pmode, operands[0]); operands[4] = gen_frame_mem (Pmode, operands[1]); diff -Nru gcc/config/rs6000/rs6000.opt gcc/config/rs6000/rs6000.opt --- gcc/config/rs6000/rs6000.opt 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/rs6000.opt 2012-12-31 17:06:03.000000000 +0100 @@ -1,13 +1,13 @@ ; Options for the rs6000 port of the compiler ; -; Copyright (C) 2005 Free Software Foundation, Inc. +; Copyright (C) 2005, 2007 Free Software Foundation, Inc. ; Contributed by Aldy Hernandez . ; ; This file is part of GCC. ; ; GCC is free software; you can redistribute it and/or modify it under ; the terms of the GNU General Public License as published by the Free -; Software Foundation; either version 2, or (at your option) any later +; Software Foundation; either version 3, or (at your option) any later ; version. ; ; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -16,9 +16,8 @@ ; License for more details. ; ; You should have received a copy of the GNU General Public License -; along with GCC; see the file COPYING. If not, write to the Free -; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -; 02110-1301, USA. +; along with GCC; see the file COPYING3. If not see +; . mpower Target Report RejectNegative Mask(POWER) diff -Nru gcc/config/rs6000/rs64.md gcc/config/rs6000/rs64.md --- gcc/config/rs6000/rs64.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/rs64.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ ;; Scheduling description for IBM RS64 processors. -;; Copyright (C) 2003, 2004 Free Software Foundation, Inc. +;; Copyright (C) 2003, 2004, 2007 Free Software Foundation, Inc. ;; ;; This file is part of GCC. ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -14,9 +14,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the -;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . (define_automaton "rs64,rs64fp") (define_cpu_unit "iu_rs64" "rs64") diff -Nru gcc/config/rs6000/spe.md gcc/config/rs6000/spe.md --- gcc/config/rs6000/spe.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/spe.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ ;; e500 SPE description -;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc. +;; Copyright (C) 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. ;; Contributed by Aldy Hernandez (aldy@quesejoda.com) ;; This file is part of GCC. ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the -;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . (define_constants [(SPE_ACC_REGNO 111) diff -Nru gcc/config/rs6000/sync.md gcc/config/rs6000/sync.md --- gcc/config/rs6000/sync.md 2010-10-14 22:27:49.000000000 +0200 +++ gcc/config/rs6000/sync.md 2012-12-31 17:06:03.000000000 +0100 @@ -1,12 +1,12 @@ ;; Machine description for PowerPC synchronization instructions. -;; Copyright (C) 2005 Free Software Foundation, Inc. +;; Copyright (C) 2005, 2007 Free Software Foundation, Inc. ;; Contributed by Geoffrey Keating. ;; This file is part of GCC. ;; GCC is free software; you can redistribute it and/or modify it ;; under the terms of the GNU General Public License as published -;; by the Free Software Foundation; either version 2, or (at your +;; by the Free Software Foundation; either version 3, or (at your ;; option) any later version. ;; GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ ;; License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GCC; see the file COPYING. If not, write to the -;; Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, -;; MA 02110-1301, USA. +;; along with GCC; see the file COPYING3. If not see +;; . (define_mode_attr larx [(SI "lwarx") (DI "ldarx")]) (define_mode_attr stcx [(SI "stwcx.") (DI "stdcx.")]) diff -Nru gcc/config/rtems.h gcc/config/rtems.h --- gcc/config/rtems.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/rtems.h 2012-12-31 17:06:03.000000000 +0100 @@ -1,11 +1,11 @@ /* Configuration common to all targets running RTEMS. - Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2000, 2002, 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -14,9 +14,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* The system headers under RTEMS are C++-aware. */ #define NO_IMPLICIT_EXTERN_C diff -Nru gcc/config/score/score-generic.md gcc/config/score/score-generic.md --- gcc/config/score/score-generic.md 1970-01-01 01:00:00.000000000 +0100 +++ gcc/config/score/score-generic.md 2012-12-31 17:06:03.000000000 +0100 @@ -0,0 +1,45 @@ +;; Machine description for Sunplus S+CORE +;; Sunplus S+CORE Pipeline Description +;; Copyright (C) 2005, 2007 +;; Free Software Foundation, Inc. +;; Contributed by Sunnorth. + +;; This file is part of GCC. + +;; GCC is free software; you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation; either version 3, or (at your option) +;; any later version. + +;; GCC is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GCC; see the file COPYING3. If not see +;; . + +(define_automaton "score") + +(define_cpu_unit "core" "score") + +(define_insn_reservation "memory" 3 + (eq_attr "type" "load") + "core") + +(define_insn_reservation "mul" 3 + (eq_attr "type" "mul,div") + "core") + +(define_insn_reservation "fce" 1 + (eq_attr "type" "fce") + "core") + +(define_insn_reservation "tsr" 1 + (eq_attr "type" "tsr,fsr") + "core") + +(define_insn_reservation "up_c" 1 + (eq_attr "up_c" "yes") + "core") diff -Nru gcc/config/score/score3.c gcc/config/score/score3.c --- gcc/config/score/score3.c 1970-01-01 01:00:00.000000000 +0100 +++ gcc/config/score/score3.c 2012-12-31 17:06:04.000000000 +0100 @@ -0,0 +1,1945 @@ +/* score3.c for Sunplus S+CORE processor + Copyright (C) 2005, 2007 Free Software Foundation, Inc. + Contributed by Sunnorth + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "rtl.h" +#include "regs.h" +#include "hard-reg-set.h" +#include "real.h" +#include "insn-config.h" +#include "conditions.h" +#include "insn-attr.h" +#include "recog.h" +#include "toplev.h" +#include "output.h" +#include "tree.h" +#include "function.h" +#include "expr.h" +#include "optabs.h" +#include "flags.h" +#include "reload.h" +#include "tm_p.h" +#include "ggc.h" +#include "gstab.h" +#include "hashtab.h" +#include "debug.h" +#include "target.h" +#include "target-def.h" +#include "integrate.h" +#include "langhooks.h" +#include "cfglayout.h" +#include "score3.h" + +#define BITSET_P(VALUE, BIT) (((VALUE) & (1L << (BIT))) != 0) +#define INS_BUF_SZ 128 + +/* Define the information needed to generate branch insns. This is + stored from the compare operation. */ +extern rtx cmp_op0, cmp_op1; +extern enum reg_class score_char_to_class[256]; + +static int score3_sdata_max; +static char score3_ins[INS_BUF_SZ + 8]; + +/* Return true if SYMBOL is a SYMBOL_REF and OFFSET + SYMBOL points + to the same object as SYMBOL. */ +static int +score3_offset_within_object_p (rtx symbol, HOST_WIDE_INT offset) +{ + if (GET_CODE (symbol) != SYMBOL_REF) + return 0; + + if (CONSTANT_POOL_ADDRESS_P (symbol) + && offset >= 0 + && offset < (int)GET_MODE_SIZE (get_pool_mode (symbol))) + return 1; + + if (SYMBOL_REF_DECL (symbol) != 0 + && offset >= 0 + && offset < int_size_in_bytes (TREE_TYPE (SYMBOL_REF_DECL (symbol)))) + return 1; + + return 0; +} + +/* Split X into a base and a constant offset, storing them in *BASE + and *OFFSET respectively. */ +static void +score3_split_const (rtx x, rtx *base, HOST_WIDE_INT *offset) +{ + *offset = 0; + + if (GET_CODE (x) == CONST) + x = XEXP (x, 0); + + if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT) + { + *offset += INTVAL (XEXP (x, 1)); + x = XEXP (x, 0); + } + + *base = x; +} + +/* Classify symbol X, which must be a SYMBOL_REF or a LABEL_REF. */ +static enum score_symbol_type +score3_classify_symbol (rtx x) +{ + if (GET_CODE (x) == LABEL_REF) + return SYMBOL_GENERAL; + + gcc_assert (GET_CODE (x) == SYMBOL_REF); + + if (CONSTANT_POOL_ADDRESS_P (x)) + { + if (GET_MODE_SIZE (get_pool_mode (x)) <= SCORE3_SDATA_MAX) + return SYMBOL_SMALL_DATA; + return SYMBOL_GENERAL; + } + if (SYMBOL_REF_SMALL_P (x)) + return SYMBOL_SMALL_DATA; + return SYMBOL_GENERAL; +} + +/* Return true if the current function must save REGNO. */ +static int +score3_save_reg_p (unsigned int regno) +{ + /* Check call-saved registers. */ + if (regs_ever_live[regno] && !call_used_regs[regno]) + return 1; + + /* We need to save the old frame pointer before setting up a new one. */ + if (regno == HARD_FRAME_POINTER_REGNUM && frame_pointer_needed) + return 1; + + /* We need to save the incoming return address if it is ever clobbered + within the function. */ + if (regno == RA_REGNUM && regs_ever_live[regno]) + return 1; + + return 0; +} + +/* Return one word of double-word value OP, taking into account the fixed + endianness of certain registers. HIGH_P is true to select the high part, + false to select the low part. */ +static rtx +score3_subw (rtx op, int high_p) +{ + unsigned int byte; + enum machine_mode mode = GET_MODE (op); + + if (mode == VOIDmode) + mode = DImode; + + byte = (TARGET_LITTLE_ENDIAN ? high_p : !high_p) ? UNITS_PER_WORD : 0; + + if (GET_CODE (op) == REG && REGNO (op) == HI_REGNUM) + return gen_rtx_REG (SImode, high_p ? HI_REGNUM : LO_REGNUM); + + if (GET_CODE (op) == MEM) + return adjust_address (op, SImode, byte); + + return simplify_gen_subreg (SImode, op, mode, byte); +} + +static struct score3_frame_info * +score3_cached_frame (void) +{ + static struct score3_frame_info _frame_info; + return &_frame_info; +} + +/* Return the bytes needed to compute the frame pointer from the current + stack pointer. SIZE is the size (in bytes) of the local variables. */ +static struct score3_frame_info * +score3_compute_frame_size (HOST_WIDE_INT size) +{ + unsigned int regno; + struct score3_frame_info *f = score3_cached_frame (); + + memset (f, 0, sizeof (struct score3_frame_info)); + f->gp_reg_size = 0; + f->mask = 0; + f->var_size = SCORE3_STACK_ALIGN (size); + f->args_size = current_function_outgoing_args_size; + f->cprestore_size = flag_pic ? UNITS_PER_WORD : 0; + + if (f->var_size == 0 && current_function_is_leaf) + f->args_size = f->cprestore_size = 0; + + if (f->args_size == 0 && current_function_calls_alloca) + f->args_size = UNITS_PER_WORD; + + f->total_size = f->var_size + f->args_size + f->cprestore_size; + for (regno = GP_REG_FIRST; regno <= GP_REG_LAST; regno++) + { + if (score3_save_reg_p (regno)) + { + f->gp_reg_size += GET_MODE_SIZE (SImode); + f->mask |= 1 << (regno - GP_REG_FIRST); + } + } + + if (current_function_calls_eh_return) + { + unsigned int i; + for (i = 0;; ++i) + { + regno = EH_RETURN_DATA_REGNO (i); + if (regno == INVALID_REGNUM) + break; + f->gp_reg_size += GET_MODE_SIZE (SImode); + f->mask |= 1 << (regno - GP_REG_FIRST); + } + } + + f->total_size += f->gp_reg_size; + f->num_gp = f->gp_reg_size / UNITS_PER_WORD; + + if (f->mask) + { + HOST_WIDE_INT offset; + offset = (f->args_size + f->cprestore_size + f->var_size + + f->gp_reg_size - GET_MODE_SIZE (SImode)); + f->gp_sp_offset = offset; + } + else + f->gp_sp_offset = 0; + + return f; +} + +/* Return true if X is a valid base register for the given mode. + Allow only hard registers if STRICT. */ +static int +score3_valid_base_register_p (rtx x, int strict) +{ + if (!strict && GET_CODE (x) == SUBREG) + x = SUBREG_REG (x); + + return (GET_CODE (x) == REG + && score3_regno_mode_ok_for_base_p (REGNO (x), strict)); +} + +/* Return true if X is a valid address for machine mode MODE. If it is, + fill in INFO appropriately. STRICT is true if we should only accept + hard base registers. */ +static int +score3_classify_address (struct score3_address_info *info, + enum machine_mode mode, rtx x, int strict) +{ + info->code = GET_CODE (x); + + switch (info->code) + { + case REG: + case SUBREG: + info->type = SCORE3_ADD_REG; + info->reg = x; + info->offset = const0_rtx; + return score3_valid_base_register_p (info->reg, strict); + case PLUS: + info->type = SCORE3_ADD_REG; + info->reg = XEXP (x, 0); + info->offset = XEXP (x, 1); + return (score3_valid_base_register_p (info->reg, strict) + && GET_CODE (info->offset) == CONST_INT + && IMM_IN_RANGE (INTVAL (info->offset), 15, 1)); + case PRE_DEC: + case POST_DEC: + case PRE_INC: + case POST_INC: + if (GET_MODE_SIZE (mode) > GET_MODE_SIZE (SImode)) + return false; + info->type = SCORE3_ADD_REG; + info->reg = XEXP (x, 0); + info->offset = GEN_INT (GET_MODE_SIZE (mode)); + return score3_valid_base_register_p (info->reg, strict); + case CONST_INT: + info->type = SCORE3_ADD_CONST_INT; + return 1; + case CONST: + case LABEL_REF: + case SYMBOL_REF: + info->type = SCORE3_ADD_SYMBOLIC; + return (score3_symbolic_constant_p (x, &info->symbol_type) + && (info->symbol_type == SYMBOL_GENERAL + || info->symbol_type == SYMBOL_SMALL_DATA)); + default: + return 0; + } +} + +bool +score3_return_in_memory (tree type, tree fndecl ATTRIBUTE_UNUSED) +{ + return ((TYPE_MODE (type) == BLKmode) + || (int_size_in_bytes (type) > 2 * UNITS_PER_WORD) + || (int_size_in_bytes (type) == -1)); +} + +/* Return a legitimate address for REG + OFFSET. */ +static rtx +score3_add_offset (rtx reg, HOST_WIDE_INT offset) +{ + if (!IMM_IN_RANGE (offset, 15, 1)) + { + reg = expand_simple_binop (GET_MODE (reg), PLUS, + gen_int_mode (offset & 0xffffc000, + GET_MODE (reg)), + reg, NULL, 0, OPTAB_WIDEN); + offset &= 0x3fff; + } + + return plus_constant (reg, offset); +} + +/* Implement TARGET_ASM_OUTPUT_MI_THUNK. Generate rtl rather than asm text + in order to avoid duplicating too much logic from elsewhere. */ +void +score3_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, + HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset, + tree function) +{ + rtx this, temp1, insn, fnaddr; + + /* Pretend to be a post-reload pass while generating rtl. */ + no_new_pseudos = 1; + reload_completed = 1; + reset_block_changes (); + + /* We need two temporary registers in some cases. */ + temp1 = gen_rtx_REG (Pmode, 8); + + /* Find out which register contains the "this" pointer. */ + if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function)) + this = gen_rtx_REG (Pmode, ARG_REG_FIRST + 1); + else + this = gen_rtx_REG (Pmode, ARG_REG_FIRST); + + /* Add DELTA to THIS. */ + if (delta != 0) + { + rtx offset = GEN_INT (delta); + if (!CONST_OK_FOR_LETTER_P (delta, 'L')) + { + emit_move_insn (temp1, offset); + offset = temp1; + } + emit_insn (gen_add3_insn (this, this, offset)); + } + + /* If needed, add *(*THIS + VCALL_OFFSET) to THIS. */ + if (vcall_offset != 0) + { + rtx addr; + + /* Set TEMP1 to *THIS. */ + emit_move_insn (temp1, gen_rtx_MEM (Pmode, this)); + + /* Set ADDR to a legitimate address for *THIS + VCALL_OFFSET. */ + addr = score3_add_offset (temp1, vcall_offset); + + /* Load the offset and add it to THIS. */ + emit_move_insn (temp1, gen_rtx_MEM (Pmode, addr)); + emit_insn (gen_add3_insn (this, this, temp1)); + } + + /* Jump to the target function. */ + fnaddr = XEXP (DECL_RTL (function), 0); + insn = emit_call_insn (gen_sibcall_internal_score3 (fnaddr, const0_rtx)); + SIBLING_CALL_P (insn) = 1; + + /* Run just enough of rest_of_compilation. This sequence was + "borrowed" from alpha.c. */ + insn = get_insns (); + insn_locators_initialize (); + split_all_insns_noflow (); + shorten_branches (insn); + final_start_function (insn, file, 1); + final (insn, file, 1); + final_end_function (); + + /* Clean up the vars set above. Note that final_end_function resets + the global pointer for us. */ + reload_completed = 0; + no_new_pseudos = 0; +} + +/* Copy VALUE to a register and return that register. If new psuedos + are allowed, copy it into a new register, otherwise use DEST. */ +static rtx +score3_force_temporary (rtx dest, rtx value) +{ + if (!no_new_pseudos) + return force_reg (Pmode, value); + else + { + emit_move_insn (copy_rtx (dest), value); + return dest; + } +} + +/* Return a LO_SUM expression for ADDR. TEMP is as for score_force_temporary + and is used to load the high part into a register. */ +static rtx +score3_split_symbol (rtx temp, rtx addr) +{ + rtx high = score3_force_temporary (temp, + gen_rtx_HIGH (Pmode, copy_rtx (addr))); + return gen_rtx_LO_SUM (Pmode, high, addr); +} + +/* This function is used to implement LEGITIMIZE_ADDRESS. If *XLOC can + be legitimized in a way that the generic machinery might not expect, + put the new address in *XLOC and return true. */ +int +score3_legitimize_address (rtx *xloc) +{ + enum score_symbol_type symbol_type; + + if (score3_symbolic_constant_p (*xloc, &symbol_type) + && symbol_type == SYMBOL_GENERAL) + { + *xloc = score3_split_symbol (0, *xloc); + return 1; + } + + if (GET_CODE (*xloc) == PLUS + && GET_CODE (XEXP (*xloc, 1)) == CONST_INT) + { + rtx reg = XEXP (*xloc, 0); + if (!score3_valid_base_register_p (reg, 0)) + reg = copy_to_mode_reg (Pmode, reg); + *xloc = score3_add_offset (reg, INTVAL (XEXP (*xloc, 1))); + return 1; + } + return 0; +} + +/* Fill INFO with information about a single argument. CUM is the + cumulative state for earlier arguments. MODE is the mode of this + argument and TYPE is its type (if known). NAMED is true if this + is a named (fixed) argument rather than a variable one. */ +static void +score3_classify_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int named, struct score3_arg_info *info) +{ + int even_reg_p; + unsigned int num_words, max_regs; + + even_reg_p = 0; + if (GET_MODE_CLASS (mode) == MODE_INT + || GET_MODE_CLASS (mode) == MODE_FLOAT) + even_reg_p = (GET_MODE_SIZE (mode) > UNITS_PER_WORD); + else + if (type != NULL_TREE && TYPE_ALIGN (type) > BITS_PER_WORD && named) + even_reg_p = 1; + + if (TARGET_MUST_PASS_IN_STACK (mode, type)) + info->reg_offset = ARG_REG_NUM; + else + { + info->reg_offset = cum->num_gprs; + if (even_reg_p) + info->reg_offset += info->reg_offset & 1; + } + + if (mode == BLKmode) + info->num_bytes = int_size_in_bytes (type); + else + info->num_bytes = GET_MODE_SIZE (mode); + + num_words = (info->num_bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + max_regs = ARG_REG_NUM - info->reg_offset; + + /* Partition the argument between registers and stack. */ + info->reg_words = MIN (num_words, max_regs); + info->stack_words = num_words - info->reg_words; + + /* The alignment applied to registers is also applied to stack arguments. */ + if (info->stack_words) + { + info->stack_offset = cum->stack_words; + if (even_reg_p) + info->stack_offset += info->stack_offset & 1; + } +} + +/* Set up the stack and frame (if desired) for the function. */ +void +score3_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) +{ + const char *fnname; + struct score3_frame_info *f = score3_cached_frame (); + HOST_WIDE_INT tsize = f->total_size; + + fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); + if (!flag_inhibit_size_directive) + { + fputs ("\t.ent\t", file); + assemble_name (file, fnname); + fputs ("\n", file); + } + assemble_name (file, fnname); + fputs (":\n", file); + + if (!flag_inhibit_size_directive) + { + fprintf (file, + "\t.frame\t%s," HOST_WIDE_INT_PRINT_DEC ",%s, %d\t\t" + "# vars= " HOST_WIDE_INT_PRINT_DEC ", regs= %d" + ", args= " HOST_WIDE_INT_PRINT_DEC + ", gp= " HOST_WIDE_INT_PRINT_DEC "\n", + (reg_names[(frame_pointer_needed) + ? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM]), + tsize, + reg_names[RA_REGNUM], + current_function_is_leaf ? 1 : 0, + f->var_size, + f->num_gp, + f->args_size, + f->cprestore_size); + + fprintf(file, "\t.mask\t0x%08x," HOST_WIDE_INT_PRINT_DEC "\n", + f->mask, + (f->gp_sp_offset - f->total_size)); + } +} + +/* Do any necessary cleanup after a function to restore stack, frame, + and regs. */ +void +score3_function_epilogue (FILE *file, + HOST_WIDE_INT size ATTRIBUTE_UNUSED) +{ + if (!flag_inhibit_size_directive) + { + const char *fnname; + fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); + fputs ("\t.end\t", file); + assemble_name (file, fnname); + fputs ("\n", file); + } +} + +/* Returns true if X contains a SYMBOL_REF. */ +static bool +score3_symbolic_expression_p (rtx x) +{ + if (GET_CODE (x) == SYMBOL_REF) + return true; + + if (GET_CODE (x) == CONST) + return score3_symbolic_expression_p (XEXP (x, 0)); + + if (UNARY_P (x)) + return score3_symbolic_expression_p (XEXP (x, 0)); + + if (ARITHMETIC_P (x)) + return (score3_symbolic_expression_p (XEXP (x, 0)) + || score3_symbolic_expression_p (XEXP (x, 1))); + + return false; +} + +/* Choose the section to use for the constant rtx expression X that has + mode MODE. */ +section * +score3_select_rtx_section (enum machine_mode mode, rtx x, + unsigned HOST_WIDE_INT align) +{ + if (GET_MODE_SIZE (mode) <= SCORE3_SDATA_MAX) + return get_named_section (0, ".sdata", 0); + else if (flag_pic && score3_symbolic_expression_p (x)) + return get_named_section (0, ".data.rel.ro", 3); + else + return mergeable_constant_section (mode, align, 0); +} + +/* Implement TARGET_IN_SMALL_DATA_P. */ +bool +score3_in_small_data_p (tree decl) +{ + HOST_WIDE_INT size; + + if (TREE_CODE (decl) == STRING_CST + || TREE_CODE (decl) == FUNCTION_DECL) + return false; + + if (TREE_CODE (decl) == VAR_DECL && DECL_SECTION_NAME (decl) != 0) + { + const char *name; + name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl)); + if (strcmp (name, ".sdata") != 0 + && strcmp (name, ".sbss") != 0) + return true; + if (!DECL_EXTERNAL (decl)) + return false; + } + size = int_size_in_bytes (TREE_TYPE (decl)); + return (size > 0 && size <= SCORE3_SDATA_MAX); +} + +/* Implement TARGET_ASM_FILE_START. */ +void +score3_asm_file_start (void) +{ + default_file_start (); + fprintf (asm_out_file, ASM_COMMENT_START + "GCC for S+core %s \n", SCORE_GCC_VERSION); + + if (flag_pic) + fprintf (asm_out_file, "\t.set pic\n"); +} + +/* Implement TARGET_ASM_FILE_END. When using assembler macros, emit + .externs for any small-data variables that turned out to be external. */ +void +score3_asm_file_end (void) +{ + tree name_tree; + struct extern_list *p; + if (extern_head) + { + fputs ("\n", asm_out_file); + for (p = extern_head; p != 0; p = p->next) + { + name_tree = get_identifier (p->name); + if (!TREE_ASM_WRITTEN (name_tree) + && TREE_SYMBOL_REFERENCED (name_tree)) + { + TREE_ASM_WRITTEN (name_tree) = 1; + fputs ("\t.extern\t", asm_out_file); + assemble_name (asm_out_file, p->name); + fprintf (asm_out_file, ", %d\n", p->size); + } + } + } +} + +/* Implement OVERRIDE_OPTIONS macro. */ +void +score3_override_options (void) +{ + flag_pic = false; + if (!flag_pic) + score3_sdata_max = g_switch_set ? g_switch_value : SCORE3_DEFAULT_SDATA_MAX; + else + { + score3_sdata_max = 0; + if (g_switch_set && (g_switch_value != 0)) + warning (0, "-fPIC and -G are incompatible"); + } + + score_char_to_class['d'] = G32_REGS; + score_char_to_class['e'] = G16_REGS; + score_char_to_class['t'] = T32_REGS; + + score_char_to_class['h'] = HI_REG; + score_char_to_class['l'] = LO_REG; + score_char_to_class['x'] = CE_REGS; + + score_char_to_class['q'] = CN_REG; + score_char_to_class['y'] = LC_REG; + score_char_to_class['z'] = SC_REG; + score_char_to_class['a'] = SP_REGS; + + score_char_to_class['c'] = CR_REGS; +} + +/* Implement REGNO_REG_CLASS macro. */ +int +score3_reg_class (int regno) +{ + int c; + gcc_assert (regno >= 0 && regno < FIRST_PSEUDO_REGISTER); + + if (regno == FRAME_POINTER_REGNUM + || regno == ARG_POINTER_REGNUM) + return ALL_REGS; + + for (c = 0; c < N_REG_CLASSES; c++) + if (TEST_HARD_REG_BIT (reg_class_contents[c], regno)) + return c; + + return NO_REGS; +} + +/* Implement PREFERRED_RELOAD_CLASS macro. */ +enum reg_class +score3_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, enum reg_class class) +{ + if (reg_class_subset_p (G16_REGS, class)) + return G16_REGS; + if (reg_class_subset_p (G32_REGS, class)) + return G32_REGS; + return class; +} + +/* Implement SECONDARY_INPUT_RELOAD_CLASS + and SECONDARY_OUTPUT_RELOAD_CLASS macro. */ +enum reg_class +score3_secondary_reload_class (enum reg_class class, + enum machine_mode mode ATTRIBUTE_UNUSED, + rtx x) +{ + int regno = -1; + if (GET_CODE (x) == REG || GET_CODE(x) == SUBREG) + regno = true_regnum (x); + + if (!GR_REG_CLASS_P (class)) + return GP_REG_P (regno) ? NO_REGS : G32_REGS; + return NO_REGS; +} + +/* Implement CONST_OK_FOR_LETTER_P macro. */ +/* imm constraints + I imm16 << 16 + J uimm5 + K uimm16 + L simm16 + M uimm14 + N simm14 + O simm14 + P simm5 + Q uimm32 */ +int +score3_const_ok_for_letter_p (HOST_WIDE_INT value, char c) +{ + switch (c) + { + case 'I': return ((value & 0xffff) == 0); + case 'J': return IMM_IN_RANGE (value, 5, 0); + case 'K': return IMM_IN_RANGE (value, 16, 0); + case 'L': return IMM_IN_RANGE (value, 16, 1); + case 'M': return IMM_IN_RANGE (value, 14, 0); + case 'N': return IMM_IN_RANGE (value, 14, 1); + case 'O': return IMM_IN_RANGE (value, 5, 1); + case 'P': return IMM_IN_RANGE (value, 6, 1); + case 'Q': return score_extra_constraint (GEN_INT(value), c); + default : return 0; + } +} + +/* Implement EXTRA_CONSTRAINT macro. */ +/* + Q uimm32 + Z symbol_ref */ +int +score3_extra_constraint (rtx op, char c) +{ + switch (c) + { + case 'Q': return IMM_IN_RANGE (INTVAL(op), 32, 0); + case 'Z': + return GET_CODE (op) == SYMBOL_REF; + default: + gcc_unreachable (); + } +} + +/* Return truth value on whether or not a given hard register + can support a given mode. */ +int +score3_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode) +{ + int size = GET_MODE_SIZE (mode); + enum mode_class class = GET_MODE_CLASS (mode); + + if (class == MODE_CC) + return regno == CC_REGNUM; + else if (regno == FRAME_POINTER_REGNUM + || regno == ARG_POINTER_REGNUM) + return class == MODE_INT; + else if (GP_REG_P (regno)) + return !(regno & 1) || (size <= UNITS_PER_WORD); + else if (CE_REG_P (regno)) + return (class == MODE_INT + && ((size <= UNITS_PER_WORD) + || (regno == CE_REG_FIRST && size == 2 * UNITS_PER_WORD))); + else + return (class == MODE_INT) && (size <= UNITS_PER_WORD); +} + +/* Implement INITIAL_ELIMINATION_OFFSET. FROM is either the frame + pointer or argument pointer. TO is either the stack pointer or + hard frame pointer. */ +HOST_WIDE_INT +score3_initial_elimination_offset (int from, + int to ATTRIBUTE_UNUSED) +{ + struct score3_frame_info *f = score3_compute_frame_size (get_frame_size ()); + switch (from) + { + case ARG_POINTER_REGNUM: + return f->total_size; + case FRAME_POINTER_REGNUM: + return 0; + default: + gcc_unreachable (); + } +} + +/* Implement FUNCTION_ARG_ADVANCE macro. */ +void +score3_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int named) +{ + struct score3_arg_info info; + score3_classify_arg (cum, mode, type, named, &info); + cum->num_gprs = info.reg_offset + info.reg_words; + if (info.stack_words > 0) + cum->stack_words = info.stack_offset + info.stack_words; + cum->arg_number++; +} + +/* Implement TARGET_ARG_PARTIAL_BYTES macro. */ +int +score3_arg_partial_bytes (CUMULATIVE_ARGS *cum, + enum machine_mode mode, tree type, bool named) +{ + struct score3_arg_info info; + score3_classify_arg (cum, mode, type, named, &info); + return info.stack_words > 0 ? info.reg_words * UNITS_PER_WORD : 0; +} + +/* Implement FUNCTION_ARG macro. */ +rtx +score3_function_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int named) +{ + struct score3_arg_info info; + + if (mode == VOIDmode || !named) + return 0; + + score3_classify_arg (cum, mode, type, named, &info); + + if (info.reg_offset == ARG_REG_NUM) + return 0; + + if (!info.stack_words) + return gen_rtx_REG (mode, ARG_REG_FIRST + info.reg_offset); + else + { + rtx ret = gen_rtx_PARALLEL (mode, rtvec_alloc (info.reg_words)); + unsigned int i, part_offset = 0; + for (i = 0; i < info.reg_words; i++) + { + rtx reg; + reg = gen_rtx_REG (SImode, ARG_REG_FIRST + info.reg_offset + i); + XVECEXP (ret, 0, i) = gen_rtx_EXPR_LIST (SImode, reg, + GEN_INT (part_offset)); + part_offset += UNITS_PER_WORD; + } + return ret; + } +} + +/* Implement FUNCTION_VALUE and LIBCALL_VALUE. For normal calls, + VALTYPE is the return type and MODE is VOIDmode. For libcalls, + VALTYPE is null and MODE is the mode of the return value. */ +rtx +score3_function_value (tree valtype, tree func ATTRIBUTE_UNUSED, + enum machine_mode mode) +{ + if (valtype) + { + int unsignedp; + mode = TYPE_MODE (valtype); + unsignedp = TYPE_UNSIGNED (valtype); + mode = promote_mode (valtype, mode, &unsignedp, 1); + } + return gen_rtx_REG (mode, RT_REGNUM); +} + +/* Implement INITIALIZE_TRAMPOLINE macro. */ +void +score3_initialize_trampoline (rtx ADDR, rtx FUNC, rtx CHAIN) +{ +#define FFCACHE "_flush_cache" +#define CODE_SIZE (TRAMPOLINE_INSNS * UNITS_PER_WORD) + + rtx pfunc, pchain; + + pfunc = plus_constant (ADDR, CODE_SIZE); + pchain = plus_constant (ADDR, CODE_SIZE + GET_MODE_SIZE (SImode)); + + emit_move_insn (gen_rtx_MEM (SImode, pfunc), FUNC); + emit_move_insn (gen_rtx_MEM (SImode, pchain), CHAIN); + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, FFCACHE), + 0, VOIDmode, 2, + ADDR, Pmode, + GEN_INT (TRAMPOLINE_SIZE), SImode); +#undef FFCACHE +#undef CODE_SIZE +} + +/* This function is used to implement REG_MODE_OK_FOR_BASE_P macro. */ +int +score3_regno_mode_ok_for_base_p (int regno, int strict) +{ + if (regno >= FIRST_PSEUDO_REGISTER) + { + if (!strict) + return 1; + regno = reg_renumber[regno]; + } + if (regno == ARG_POINTER_REGNUM + || regno == FRAME_POINTER_REGNUM) + return 1; + return GP_REG_P (regno); +} + +/* Implement GO_IF_LEGITIMATE_ADDRESS macro. */ +int +score3_address_p (enum machine_mode mode, rtx x, int strict) +{ + struct score3_address_info addr; + + return score3_classify_address (&addr, mode, x, strict); +} + +/* Return a number assessing the cost of moving a register in class + FROM to class TO. */ +int +score3_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, + enum reg_class from, enum reg_class to) +{ + if (GR_REG_CLASS_P (from)) + { + if (GR_REG_CLASS_P (to)) + return 2; + else if (SP_REG_CLASS_P (to)) + return 4; + else if (CP_REG_CLASS_P (to)) + return 5; + else if (CE_REG_CLASS_P (to)) + return 6; + } + if (GR_REG_CLASS_P (to)) + { + if (GR_REG_CLASS_P (from)) + return 2; + else if (SP_REG_CLASS_P (from)) + return 4; + else if (CP_REG_CLASS_P (from)) + return 5; + else if (CE_REG_CLASS_P (from)) + return 6; + } + return 12; +} + +/* Return the number of instructions needed to load a symbol of the + given type into a register. */ +static int +score3_symbol_insns (enum score_symbol_type type) +{ + switch (type) + { + case SYMBOL_GENERAL: + return 2; + + case SYMBOL_SMALL_DATA: + return 1; + } + + gcc_unreachable (); +} + +/* Return the number of instructions needed to load or store a value + of mode MODE at X. Return 0 if X isn't valid for MODE. */ +static int +score3_address_insns (rtx x, enum machine_mode mode) +{ + struct score3_address_info addr; + int factor; + + if (mode == BLKmode) + factor = 1; + else + factor = (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + + if (score3_classify_address (&addr, mode, x, false)) + switch (addr.type) + { + case SCORE3_ADD_REG: + case SCORE3_ADD_CONST_INT: + return factor; + + case SCORE3_ADD_SYMBOLIC: + return factor * score3_symbol_insns (addr.symbol_type); + } + return 0; +} + +/* Implement TARGET_RTX_COSTS macro. */ +bool +score3_rtx_costs (rtx x, int code, int outer_code, int *total) +{ + enum machine_mode mode = GET_MODE (x); + + switch (code) + { + case CONST_INT: + if (outer_code == SET) + { + if (CONST_OK_FOR_LETTER_P (INTVAL (x), 'I') + || CONST_OK_FOR_LETTER_P (INTVAL (x), 'L')) + *total = COSTS_N_INSNS (1); + else + *total = COSTS_N_INSNS (2); + } + else if (outer_code == PLUS || outer_code == MINUS) + { + if (CONST_OK_FOR_LETTER_P (INTVAL (x), 'N')) + *total = 0; + else if (CONST_OK_FOR_LETTER_P (INTVAL (x), 'I') + || CONST_OK_FOR_LETTER_P (INTVAL (x), 'L')) + *total = 1; + else + *total = COSTS_N_INSNS (2); + } + else if (outer_code == AND || outer_code == IOR) + { + if (CONST_OK_FOR_LETTER_P (INTVAL (x), 'M')) + *total = 0; + else if (CONST_OK_FOR_LETTER_P (INTVAL (x), 'I') + || CONST_OK_FOR_LETTER_P (INTVAL (x), 'K')) + *total = 1; + else + *total = COSTS_N_INSNS (2); + } + else + { + *total = 0; + } + return true; + + case CONST: + case SYMBOL_REF: + case LABEL_REF: + case CONST_DOUBLE: + *total = COSTS_N_INSNS (2); + return true; + + case MEM: + { + /* If the address is legitimate, return the number of + instructions it needs, otherwise use the default handling. */ + int n = score3_address_insns (XEXP (x, 0), GET_MODE (x)); + if (n > 0) + { + *total = COSTS_N_INSNS (n + 1); + return true; + } + return false; + } + + case FFS: + *total = COSTS_N_INSNS (6); + return true; + + case NOT: + *total = COSTS_N_INSNS (1); + return true; + + case AND: + case IOR: + case XOR: + if (mode == DImode) + { + *total = COSTS_N_INSNS (2); + return true; + } + return false; + + case ASHIFT: + case ASHIFTRT: + case LSHIFTRT: + if (mode == DImode) + { + *total = COSTS_N_INSNS ((GET_CODE (XEXP (x, 1)) == CONST_INT) + ? 4 : 12); + return true; + } + return false; + + case ABS: + *total = COSTS_N_INSNS (4); + return true; + + case PLUS: + case MINUS: + if (mode == DImode) + { + *total = COSTS_N_INSNS (4); + return true; + } + *total = COSTS_N_INSNS (1); + return true; + + case NEG: + if (mode == DImode) + { + *total = COSTS_N_INSNS (4); + return true; + } + return false; + + case MULT: + *total = optimize_size ? COSTS_N_INSNS (2) : COSTS_N_INSNS (12); + return true; + + case DIV: + case MOD: + case UDIV: + case UMOD: + *total = optimize_size ? COSTS_N_INSNS (2) : COSTS_N_INSNS (33); + return true; + + case SIGN_EXTEND: + case ZERO_EXTEND: + switch (GET_MODE (XEXP (x, 0))) + { + case QImode: + case HImode: + if (GET_CODE (XEXP (x, 0)) == MEM) + { + *total = COSTS_N_INSNS (2); + + if (!TARGET_LITTLE_ENDIAN && + side_effects_p (XEXP (XEXP (x, 0), 0))) + *total = 100; + } + else + *total = COSTS_N_INSNS (1); + break; + + default: + *total = COSTS_N_INSNS (1); + break; + } + return true; + + default: + return false; + } +} + +/* Implement TARGET_ADDRESS_COST macro. */ +int +score3_address_cost (rtx addr) +{ + return score3_address_insns (addr, SImode); +} + +/* Implement ASM_OUTPUT_EXTERNAL macro. */ +int +score3_output_external (FILE *file ATTRIBUTE_UNUSED, + tree decl, const char *name) +{ + register struct extern_list *p; + + if (score3_in_small_data_p (decl)) + { + p = (struct extern_list *) ggc_alloc (sizeof (struct extern_list)); + p->next = extern_head; + p->name = name; + p->size = int_size_in_bytes (TREE_TYPE (decl)); + extern_head = p; + } + return 0; +} + +/* Implement RETURN_ADDR_RTX. Note, we do not support moving + back to a previous frame. */ +rtx +score3_return_addr (int count, rtx frame ATTRIBUTE_UNUSED) +{ + if (count != 0) + return const0_rtx; + return get_hard_reg_initial_val (Pmode, RA_REGNUM); +} + +/* Implement PRINT_OPERAND macro. */ +/* Score-specific operand codes: + '[' print .set nor1 directive + ']' print .set r1 directive + 'U' print hi part of a CONST_INT rtx + 'E' print log2(v) + 'F' print log2(~v) + 'D' print SFmode const double + 'S' selectively print "!" if operand is 15bit instruction accessible + 'V' print "v!" if operand is 15bit instruction accessible, or "lfh!" + 'L' low part of DImode reg operand + 'H' high part of DImode reg operand + 'C' print part of opcode for a branch condition. */ +void +score3_print_operand (FILE *file, rtx op, int c) +{ + enum rtx_code code = -1; + if (!PRINT_OPERAND_PUNCT_VALID_P (c)) + code = GET_CODE (op); + + if (c == '[') + { + fprintf (file, ".set r1\n"); + } + else if (c == ']') + { + fprintf (file, "\n\t.set nor1"); + } + else if (c == 'U') + { + gcc_assert (code == CONST_INT); + fprintf (file, HOST_WIDE_INT_PRINT_HEX, + (INTVAL (op) >> 16) & 0xffff); + } + else if (c == 'D') + { + if (GET_CODE (op) == CONST_DOUBLE) + { + rtx temp = gen_lowpart (SImode, op); + gcc_assert (GET_MODE (op) == SFmode); + fprintf (file, HOST_WIDE_INT_PRINT_HEX, INTVAL (temp) & 0xffffffff); + } + else + output_addr_const (file, op); + } + else if (c == 'S') + { + gcc_assert (code == REG); + if (G16_REG_P (REGNO (op))) + fprintf (file, "!"); + } + else if (c == 'V') + { + gcc_assert (code == REG); + fprintf (file, G16_REG_P (REGNO (op)) ? "v!" : "lfh!"); + } + else if (c == 'C') + { + enum machine_mode mode = GET_MODE (XEXP (op, 0)); + + switch (code) + { + case EQ: fputs ("eq!", file); break; + case NE: fputs ("ne!", file); break; + case GT: fputs ("gt!", file); break; + case GE: fputs (mode != CCmode ? "pl" : "ge", file); break; + case LT: fputs (mode != CCmode ? "mi" : "lt", file); break; + case LE: fputs ("le!", file); break; + case GTU: fputs ("gtu!", file); break; + case GEU: fputs ("cs", file); break; + case LTU: fputs ("cc", file); break; + case LEU: fputs ("leu!", file); break; + default: + output_operand_lossage ("invalid operand for code: '%c'", code); + } + } + else if (c == 'G') /* Seperate from b, use for mv. */ + { + enum machine_mode mode = GET_MODE (XEXP (op, 0)); + + switch (code) + { + case EQ: fputs ("eq", file); break; + case NE: fputs ("ne", file); break; + case GT: fputs ("gt", file); break; + case GE: fputs (mode != CCmode ? "pl" : "ge", file); break; + case LT: fputs (mode != CCmode ? "mi" : "lt", file); break; + case LE: fputs ("le", file); break; + case GTU: fputs ("gtu", file); break; + case GEU: fputs ("cs", file); break; + case LTU: fputs ("cc", file); break; + case LEU: fputs ("leu", file); break; + default: + output_operand_lossage ("invalid operand for code: '%c'", code); + } + } + else if (c == 'E') + { + unsigned HOST_WIDE_INT i; + unsigned HOST_WIDE_INT pow2mask = 1; + unsigned HOST_WIDE_INT val; + + val = INTVAL (op); + for (i = 0; i < 32; i++) + { + if (val == pow2mask) + break; + pow2mask <<= 1; + } + gcc_assert (i < 32); + fprintf (file, HOST_WIDE_INT_PRINT_HEX, i); + } + else if (c == 'F') + { + unsigned HOST_WIDE_INT i; + unsigned HOST_WIDE_INT pow2mask = 1; + unsigned HOST_WIDE_INT val; + + val = ~INTVAL (op); + for (i = 0; i < 32; i++) + { + if (val == pow2mask) + break; + pow2mask <<= 1; + } + gcc_assert (i < 32); + fprintf (file, HOST_WIDE_INT_PRINT_HEX, i); + } + else if (code == REG) + { + int regnum = REGNO (op); + if ((c == 'H' && !WORDS_BIG_ENDIAN) + || (c == 'L' && WORDS_BIG_ENDIAN)) + regnum ++; + fprintf (file, "%s", reg_names[regnum]); + } + else + { + switch (code) + { + case MEM: + score3_print_operand_address (file, op); + break; + default: + output_addr_const (file, op); + } + } +} + +/* Implement PRINT_OPERAND_ADDRESS macro. */ +void +score3_print_operand_address (FILE *file, rtx x) +{ + struct score3_address_info addr; + enum rtx_code code = GET_CODE (x); + enum machine_mode mode = GET_MODE (x); + + if (code == MEM) + x = XEXP (x, 0); + + if (score3_classify_address (&addr, mode, x, true)) + { + switch (addr.type) + { + case SCORE3_ADD_REG: + { + switch (addr.code) + { + case PRE_DEC: + fprintf (file, "[%s,-%ld]+", reg_names[REGNO (addr.reg)], + INTVAL (addr.offset)); + break; + case POST_DEC: + fprintf (file, "[%s]+,-%ld", reg_names[REGNO (addr.reg)], + INTVAL (addr.offset)); + break; + case PRE_INC: + fprintf (file, "[%s, %ld]+", reg_names[REGNO (addr.reg)], + INTVAL (addr.offset)); + break; + case POST_INC: + fprintf (file, "[%s]+, %ld", reg_names[REGNO (addr.reg)], + INTVAL (addr.offset)); + break; + default: + if (INTVAL(addr.offset) == 0) + fprintf(file, "[%s]", reg_names[REGNO (addr.reg)]); + else + fprintf(file, "[%s, %ld]", reg_names[REGNO (addr.reg)], + INTVAL(addr.offset)); + break; + } + } + return; + case SCORE3_ADD_CONST_INT: + case SCORE3_ADD_SYMBOLIC: + output_addr_const (file, x); + return; + } + } + print_rtl (stderr, x); + gcc_unreachable (); +} + +/* Implement SELECT_CC_MODE macro. */ +enum machine_mode +score3_select_cc_mode (enum rtx_code op, rtx x, rtx y) +{ + if ((op == EQ || op == NE || op == LT || op == GE) + && y == const0_rtx + && GET_MODE (x) == SImode) + { + switch (GET_CODE (x)) + { + case PLUS: + case MINUS: + case NEG: + case AND: + case IOR: + case XOR: + case NOT: + case ASHIFT: + case LSHIFTRT: + case ASHIFTRT: + return CC_NZmode; + + case SIGN_EXTEND: + case ZERO_EXTEND: + case ROTATE: + case ROTATERT: + return (op == LT || op == GE) ? CC_Nmode : CCmode; + + default: + return CCmode; + } + } + + if ((op == EQ || op == NE) + && (GET_CODE (y) == NEG) + && register_operand (XEXP (y, 0), SImode) + && register_operand (x, SImode)) + { + return CC_NZmode; + } + + return CCmode; +} + +#define EMIT_PL(_rtx) RTX_FRAME_RELATED_P (_rtx) = 1 +/* return 0, no more bit set in mask. */ +static int rpush_first (int mask, int sb, int *rd) +{ + int i, cnt = 1; + + if ((mask & (1 << sb)) == 0) + return 0; + + *rd = sb; + + for (i = sb-1; i >= 0; i--) + { + if (mask & (1 << i)) + { + cnt ++; + continue; + } + + *rd = i+1; + break;; + } + + return cnt; +} + +static void +rpush (int rd, int cnt) +{ + rtx mem = gen_rtx_MEM (SImode, gen_rtx_PRE_DEC (SImode, stack_pointer_rtx)); + rtx reg = gen_rtx_REG (SImode, rd); + + if (!current_function_calls_eh_return) + MEM_READONLY_P (mem) = 1; + + if (cnt == 1) + EMIT_PL (emit_insn (gen_pushsi_score3 (mem, reg))); + else + { + int i; + rtx insn = gen_store_multiple (gen_rtx_MEM (SImode, stack_pointer_rtx), + gen_rtx_REG (SImode, rd), + GEN_INT (cnt)); + + rtx pat = PATTERN (insn); + + for (i = 0; i < XVECLEN (pat, 0); i++) + if (GET_CODE (XVECEXP (pat, 0, i)) == SET) + RTX_FRAME_RELATED_P (XVECEXP (pat, 0, i)) = 1; + + EMIT_PL (emit_insn (insn)); + } +} + +/* Generate the prologue instructions for entry into a S+core function. */ +void +score3_prologue (void) +{ + struct score3_frame_info *f = score3_compute_frame_size (get_frame_size ()); + HOST_WIDE_INT size; + int regno; + + size = f->total_size - f->gp_reg_size; + + if (flag_pic) + emit_insn (gen_cpload_score3 ()); + + { + int cnt, rd; + + for (regno = (int) GP_REG_LAST; regno >= (int) GP_REG_FIRST; regno--) + { + cnt = rpush_first (f->mask, regno, &rd); + if (cnt != 0) + { + rpush (rd, cnt); + regno = regno - cnt; + } + } + } + + if (size > 0) + { + rtx insn; + + if (CONST_OK_FOR_LETTER_P (-size, 'L')) + EMIT_PL (emit_insn (gen_add3_insn (stack_pointer_rtx, + stack_pointer_rtx, + GEN_INT (-size)))); + else + { + EMIT_PL (emit_move_insn (gen_rtx_REG (Pmode, SCORE3_PROLOGUE_TEMP_REGNUM), + GEN_INT (size))); + EMIT_PL (emit_insn + (gen_sub3_insn (stack_pointer_rtx, + stack_pointer_rtx, + gen_rtx_REG (Pmode, + SCORE3_PROLOGUE_TEMP_REGNUM)))); + } + insn = get_last_insn (); + REG_NOTES (insn) = + alloc_EXPR_LIST (REG_FRAME_RELATED_EXPR, + gen_rtx_SET (VOIDmode, stack_pointer_rtx, + plus_constant (stack_pointer_rtx, + -size)), + REG_NOTES (insn)); + } + + if (frame_pointer_needed) + EMIT_PL (emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx)); + + if (flag_pic && f->cprestore_size) + { + if (frame_pointer_needed) + emit_insn (gen_cprestore_use_fp_score3 (GEN_INT (size - f->cprestore_size))); + else + emit_insn (gen_cprestore_use_sp_score3 (GEN_INT (size - f->cprestore_size))); + } +} + +/* return 0, no more bit set in mask. */ +static int +rpop_first (int mask, int sb, int *rd) +{ + int i, cnt = 1; + + if ((mask & (1 << sb)) == 0) + return 0; + + *rd = sb; + + for (i = sb+1; i < 32; i++) + if (mask & (1 << i)) + cnt++; + else + break;; + + return cnt; +} + +static void +rpop (int rd, int cnt) +{ + rtx mem = gen_rtx_MEM (SImode, gen_rtx_POST_INC (SImode, stack_pointer_rtx)); + rtx reg = gen_rtx_REG (SImode, rd); + + if (!current_function_calls_eh_return) + MEM_READONLY_P (mem) = 1; + + if (cnt == 1) + emit_insn (gen_popsi_score3 (reg, mem)); + else + emit_insn (gen_load_multiple (reg, + gen_rtx_MEM (SImode, stack_pointer_rtx), + GEN_INT (cnt))); +} + +/* Generate the epilogue instructions in a S+core function. */ +void +score3_epilogue (int sibcall_p) +{ + struct score3_frame_info *f = score3_compute_frame_size (get_frame_size ()); + HOST_WIDE_INT size; + int regno; + rtx base; + + size = f->total_size - f->gp_reg_size; + + if (!frame_pointer_needed) + base = stack_pointer_rtx; + else + base = hard_frame_pointer_rtx; + + if (size) + { + if (CONST_OK_FOR_LETTER_P (size, 'L')) + emit_insn (gen_add3_insn (base, base, GEN_INT (size))); + else + { + emit_move_insn (gen_rtx_REG (Pmode, SCORE3_EPILOGUE_TEMP_REGNUM), + GEN_INT (size)); + emit_insn (gen_add3_insn (base, base, + gen_rtx_REG (Pmode, + SCORE3_EPILOGUE_TEMP_REGNUM))); + } + } + + if (base != stack_pointer_rtx) + emit_move_insn (stack_pointer_rtx, base); + + if (current_function_calls_eh_return) + emit_insn (gen_add3_insn (stack_pointer_rtx, + stack_pointer_rtx, + EH_RETURN_STACKADJ_RTX)); + + { + int cnt, rd; + + for (regno = (int) GP_REG_FIRST; regno <= (int) GP_REG_LAST; regno++) + { + cnt = rpop_first (f->mask, regno, &rd); + if (cnt != 0) + { + rpop (rd, cnt); + regno = regno + cnt; + } + } + } + + if (!sibcall_p) + emit_jump_insn (gen_return_internal_score3 (gen_rtx_REG (Pmode, RA_REGNUM))); +} + +void +score3_gen_cmp (enum machine_mode mode) +{ + emit_insn (gen_rtx_SET (VOIDmode, gen_rtx_REG (mode, CC_REGNUM), + gen_rtx_COMPARE (mode, cmp_op0, cmp_op1))); +} + +/* Return true if X is a symbolic constant that can be calculated in + the same way as a bare symbol. If it is, store the type of the + symbol in *SYMBOL_TYPE. */ +int +score3_symbolic_constant_p (rtx x, enum score_symbol_type *symbol_type) +{ + HOST_WIDE_INT offset; + + score3_split_const (x, &x, &offset); + if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF) + *symbol_type = score3_classify_symbol (x); + else + return 0; + + if (offset == 0) + return 1; + + /* if offset > 15bit, must reload */ + if (!IMM_IN_RANGE (offset, 15, 1)) + return 0; + + switch (*symbol_type) + { + case SYMBOL_GENERAL: + return 1; + case SYMBOL_SMALL_DATA: + return score3_offset_within_object_p (x, offset); + } + gcc_unreachable (); +} + +void +score3_movsicc (rtx *ops) +{ + enum machine_mode mode; + + mode = score3_select_cc_mode (GET_CODE (ops[1]), ops[2], ops[3]); + emit_insn (gen_rtx_SET (VOIDmode, gen_rtx_REG (mode, CC_REGNUM), + gen_rtx_COMPARE (mode, cmp_op0, cmp_op1))); +} + +/* Call and sibcall pattern all need call this function. */ +void +score3_call (rtx *ops, bool sib) +{ + rtx addr = XEXP (ops[0], 0); + if (!call_insn_operand (addr, VOIDmode)) + { + rtx oaddr = addr; + addr = gen_reg_rtx (Pmode); + gen_move_insn (addr, oaddr); + } + + if (sib) + emit_call_insn (gen_sibcall_internal_score3 (addr, ops[1])); + else + emit_call_insn (gen_call_internal_score3 (addr, ops[1])); +} + +/* Call value and sibcall value pattern all need call this function. */ +void +score3_call_value (rtx *ops, bool sib) +{ + rtx result = ops[0]; + rtx addr = XEXP (ops[1], 0); + rtx arg = ops[2]; + + if (!call_insn_operand (addr, VOIDmode)) + { + rtx oaddr = addr; + addr = gen_reg_rtx (Pmode); + gen_move_insn (addr, oaddr); + } + + if (sib) + emit_call_insn (gen_sibcall_value_internal_score3 (result, addr, arg)); + else + emit_call_insn (gen_call_value_internal_score3 (result, addr, arg)); +} + +/* Machine Split */ +void +score3_movdi (rtx *ops) +{ + rtx dst = ops[0]; + rtx src = ops[1]; + rtx dst0 = score3_subw (dst, 0); + rtx dst1 = score3_subw (dst, 1); + rtx src0 = score3_subw (src, 0); + rtx src1 = score3_subw (src, 1); + + if (GET_CODE (dst0) == REG && reg_overlap_mentioned_p (dst0, src)) + { + emit_move_insn (dst1, src1); + emit_move_insn (dst0, src0); + } + else + { + emit_move_insn (dst0, src0); + emit_move_insn (dst1, src1); + } +} + +void +score3_zero_extract_andi (rtx *ops) +{ + if (INTVAL (ops[1]) == 1 && const_uimm5 (ops[2], SImode)) + emit_insn (gen_zero_extract_bittst_score3 (ops[0], ops[2])); + else + { + unsigned HOST_WIDE_INT mask; + mask = (0xffffffffU & ((1U << INTVAL (ops[1])) - 1U)); + mask = mask << INTVAL (ops[2]); + emit_insn (gen_andsi3_cmp_score3 (ops[3], ops[0], + gen_int_mode (mask, SImode))); + } +} + +const char * +score3_rpush (rtx *ops) +{ + snprintf (score3_ins, INS_BUF_SZ, "rpush!\t%%1, %d", XVECLEN (ops[0], 0)); + return score3_ins; +} + +const char * +score3_rpop (rtx *ops) +{ + snprintf (score3_ins, INS_BUF_SZ, "rpop!\t%%1, %d", XVECLEN (ops[0], 0)); + return score3_ins; +} + +/* Output asm code for ld/sw insn. */ +static int +score3_pr_addr_post (rtx *ops, int idata, int iaddr, char *ip, + enum score_mem_unit unit ATTRIBUTE_UNUSED) +{ + struct score3_address_info ai; + + gcc_assert (GET_CODE (ops[idata]) == REG); + gcc_assert (score3_classify_address (&ai, SImode, XEXP (ops[iaddr], 0), true)); + + if (ai.type == SCORE3_ADD_REG + && ai.code == REG + && GET_CODE (ai.offset) == CONST_INT + && G16_REG_P (REGNO (ops[idata])) + && G8_REG_P (REGNO (ai.reg)) + && ((INTVAL (ai.offset) & 3) == 0) + && (IMM_IN_RANGE (INTVAL (ai.offset), 7, 0))) + { + ops[iaddr] = ai.reg; + return snprintf (ip, INS_BUF_SZ, "!\t%%%d, [%%%d, " + HOST_WIDE_INT_PRINT_DEC "]", + idata, iaddr, INTVAL (ai.offset)); + } + + if (ai.type == SCORE3_ADD_SYMBOLIC) + return snprintf (ip, INS_BUF_SZ, "48\t%%%d, %%a%d", idata, iaddr); + + return snprintf (ip, INS_BUF_SZ, "\t%%%d, %%a%d", idata, iaddr); +} + +/* Output asm insn for load. */ +const char * +score3_linsn (rtx *ops, enum score_mem_unit unit, bool sign) +{ + const char *pre_ins[] = + {"lbu", "lhu", "lw", "??", "lb", "lh", "lw", "??"}; + char *ip; + + strcpy (score3_ins, pre_ins[(sign ? 4 : 0) + unit]); + ip = score3_ins + strlen (score3_ins); + + if (unit == SCORE_WORD) + score3_pr_addr_post (ops, 0, 1, ip, unit); + else + snprintf (ip, INS_BUF_SZ, "\t%%0, %%a1"); + + return score3_ins; +} + +/* Output asm insn for store. */ +const char * +score3_sinsn (rtx *ops, enum score_mem_unit unit) +{ + const char *pre_ins[] = {"sb", "sh", "sw"}; + char *ip; + + strcpy (score3_ins, pre_ins[unit]); + ip = score3_ins + strlen (score3_ins); + + if (unit == SCORE_WORD) + score3_pr_addr_post (ops, 1, 0, ip, unit); + else + snprintf (ip, INS_BUF_SZ, "\t%%1, %%a0"); + + return score3_ins; +} + +/* Output asm insn for load immediate. */ +const char * +score3_limm (rtx *ops) +{ + HOST_WIDE_INT v; + + gcc_assert (GET_CODE (ops[0]) == REG); + gcc_assert (GET_CODE (ops[1]) == CONST_INT); + + v = INTVAL (ops[1]); + if (G16_REG_P (REGNO (ops[0])) && IMM_IN_RANGE (v, 5, 0)) + return "ldiu!\t%0, %c1"; + else if (IMM_IN_RANGE (v, 16, 1)) + return "ldi\t%0, %c1"; + else if ((v & 0xffff) == 0) + return "ldis\t%0, %U1"; + else + return "li\t%0, %c1"; +} + +/* Output asm insn for move. */ +const char * +score3_move (rtx *ops) +{ + gcc_assert (GET_CODE (ops[0]) == REG); + gcc_assert (GET_CODE (ops[1]) == REG); + + return "mv!\t%0, %1"; +} + +/* Generate add insn. */ +const char * +score3_select_add_imm (rtx *ops, bool set_cc) +{ + HOST_WIDE_INT v = INTVAL (ops[2]); + + gcc_assert (GET_CODE (ops[2]) == CONST_INT); + gcc_assert (REGNO (ops[0]) == REGNO (ops[1])); + + if (set_cc) + return "addi.c\t%0, %c2"; + else + if (IMM_IN_RANGE (v, 6, 1) && G16_REG_P (REGNO (ops[0]))) + return "addi!\t%0, %c2"; + else + return "addi\t%0, %c2"; +} + +/* Output arith insn. */ +const char * +score3_select (rtx *ops, const char *inst_pre, bool commu ATTRIBUTE_UNUSED, + const char *letter, bool set_cc) +{ + gcc_assert (GET_CODE (ops[0]) == REG); + gcc_assert (GET_CODE (ops[1]) == REG); + + if (set_cc) + snprintf (score3_ins, INS_BUF_SZ, "%s.c\t%%0, %%1, %%%s2", inst_pre, letter); + else + snprintf (score3_ins, INS_BUF_SZ, "%s\t%%0, %%1, %%%s2", inst_pre, letter); + return score3_ins; +} + +/* Output a Score3 casesi instruction. */ +const char * +score3_output_casesi (rtx *operands) +{ + rtx diff_vec = PATTERN (next_real_insn (operands[2])); + gcc_assert (GET_CODE (diff_vec) == ADDR_DIFF_VEC); + + output_asm_insn ("cmpi.c\t%0, %1", operands); + output_asm_insn ("bgtu\t%3", operands); + switch (GET_MODE(diff_vec)) + { + case QImode: + output_asm_insn ("ldi48\t%4, %2", operands); + output_asm_insn ("ltbb\t%4, [%4, %0]\n%2_tbb:", operands); + return "brr!\t%4"; + case HImode: + output_asm_insn ("ldi48\t%4, %2", operands); + output_asm_insn ("ltbh\t%4, [%4, %0]\n%2_tbb:", operands); + return "brr!\t%4"; + case SImode: + output_asm_insn ("ldi48\t%4, %2", operands); + output_asm_insn ("ltbw\t%4, [%4, %0]", operands); + return "br!\t%4"; + default: + gcc_unreachable (); + } +} diff -Nru gcc/config/score/score3.h gcc/config/score/score3.h --- gcc/config/score/score3.h 1970-01-01 01:00:00.000000000 +0100 +++ gcc/config/score/score3.h 2012-12-31 17:06:04.000000000 +0100 @@ -0,0 +1,159 @@ +/* score3.h for Sunplus S+CORE processor + Copyright (C) 2005, 2007 Free Software Foundation, Inc. + Contributed by Sunnorth + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +#ifndef GCC_SCORE3_H +#define GCC_SCORE3_H + +enum score3_address_type +{ + SCORE3_ADD_REG, + SCORE3_ADD_CONST_INT, + SCORE3_ADD_SYMBOLIC +}; + +struct score3_frame_info +{ + HOST_WIDE_INT total_size; /* bytes that the entire frame takes up */ + HOST_WIDE_INT var_size; /* bytes that variables take up */ + HOST_WIDE_INT args_size; /* bytes that outgoing arguments take up */ + HOST_WIDE_INT gp_reg_size; /* bytes needed to store gp regs */ + HOST_WIDE_INT gp_sp_offset; /* offset from new sp to store gp registers */ + HOST_WIDE_INT cprestore_size; /* # bytes that the .cprestore slot takes up */ + unsigned int mask; /* mask of saved gp registers */ + int num_gp; /* number of gp registers saved */ +}; + +struct score3_arg_info +{ + unsigned int num_bytes; /* The argument's size in bytes */ + unsigned int reg_words; /* The number of words passed in registers */ + unsigned int reg_offset; /* The offset of the first register from */ + /* GP_ARG_FIRST or FP_ARG_FIRST etc */ + unsigned int stack_words; /* The number of words that must be passed */ + /* on the stack */ + unsigned int stack_offset; /* The offset from the start of the stack */ + /* overflow area */ +}; + +#ifdef RTX_CODE +struct score3_address_info +{ + enum score3_address_type type; + rtx reg; + rtx offset; + enum rtx_code code; + enum score_symbol_type symbol_type; +}; +#endif + +#define SCORE3_SDATA_MAX score3_sdata_max +#define SCORE3_STACK_ALIGN(LOC) (((LOC) + 3) & ~3) +#define SCORE3_PROLOGUE_TEMP_REGNUM (GP_REG_FIRST + 8) +#define SCORE3_EPILOGUE_TEMP_REGNUM (GP_REG_FIRST + 8) +#define SCORE3_DEFAULT_SDATA_MAX 8 + +extern int score3_symbolic_constant_p (rtx x, + enum score_symbol_type *symbol_type); +extern bool score3_return_in_memory (tree type, + tree fndecl ATTRIBUTE_UNUSED); +extern void score3_output_mi_thunk (FILE *file, + tree thunk_fndecl ATTRIBUTE_UNUSED, + HOST_WIDE_INT delta, + HOST_WIDE_INT vcall_offset, + tree function); +extern int score3_legitimize_address (rtx *xloc); +extern void +score3_function_prologue (FILE *file, + HOST_WIDE_INT size ATTRIBUTE_UNUSED); +extern void +score3_function_epilogue (FILE *file, + HOST_WIDE_INT size ATTRIBUTE_UNUSED); +extern section *score3_select_rtx_section (enum machine_mode mode, rtx x, + unsigned HOST_WIDE_INT align); +extern bool score3_in_small_data_p (tree decl); +extern void score3_asm_file_start (void); +extern void score3_asm_file_end (void); +extern void score3_override_options (void); +extern int score3_reg_class (int regno); +extern enum reg_class score3_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, + enum reg_class class); +extern enum reg_class +score3_secondary_reload_class (enum reg_class class, + enum machine_mode mode ATTRIBUTE_UNUSED, + rtx x); +extern int score3_const_ok_for_letter_p (HOST_WIDE_INT value, char c); +extern int score3_extra_constraint (rtx op, char c); +extern int score3_hard_regno_mode_ok (unsigned int regno, + enum machine_mode mode); +extern HOST_WIDE_INT +score3_initial_elimination_offset (int from, + int to ATTRIBUTE_UNUSED); +extern void score3_function_arg_advance (CUMULATIVE_ARGS *cum, + enum machine_mode mode, + tree type, + int named); +extern int score3_arg_partial_bytes (CUMULATIVE_ARGS *cum, + enum machine_mode mode, + tree type, + bool named); +extern rtx score3_function_arg (const CUMULATIVE_ARGS *cum, + enum machine_mode mode, + tree type, + int named); +extern rtx score3_function_value (tree valtype, + tree func ATTRIBUTE_UNUSED, + enum machine_mode mode); +extern void score3_initialize_trampoline (rtx ADDR, rtx FUNC, rtx CHAIN); +extern int score3_regno_mode_ok_for_base_p (int regno, int strict); +extern int score3_address_p (enum machine_mode mode, rtx x, int strict); +extern int score3_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, + enum reg_class from, + enum reg_class to); +extern bool score3_rtx_costs (rtx x, int code, int outer_code, int *total); +extern int score3_address_cost (rtx addr); +extern int score3_output_external (FILE *file ATTRIBUTE_UNUSED, + tree decl, + const char *name); +extern rtx score3_return_addr (int count, rtx frame ATTRIBUTE_UNUSED); +extern void score3_print_operand (FILE *file, rtx op, int c); +extern void score3_print_operand_address (FILE *file, rtx x); +extern enum machine_mode +score3_select_cc_mode (enum rtx_code op, rtx x, rtx y); +extern void score3_prologue (void); +extern void score3_epilogue (int sibcall_p); +extern void score3_gen_cmp (enum machine_mode mode); +extern void score3_call (rtx *ops, bool sib); +extern void score3_call_value (rtx *ops, bool sib); +extern void score3_movsicc (rtx *ops); +extern void score3_movdi (rtx *ops); +extern void score3_zero_extract_andi (rtx *ops); +extern const char * score3_select_add_imm (rtx *ops, bool set_cc); +extern const char * score3_select (rtx *ops, const char *inst_pre, bool commu, + const char *letter, bool set_cc); +extern const char * score3_move (rtx *ops); +extern const char * score3_limm (rtx *ops); +extern const char * +score3_linsn (rtx *ops, enum score_mem_unit unit, bool sign); +extern const char * +score3_sinsn (rtx *ops, enum score_mem_unit unit); +extern const char * score3_output_casesi (rtx *operands); +extern const char * score3_rpush (rtx *ops); +extern const char * score3_rpop (rtx *ops); +#endif diff -Nru gcc/config/score/score7.c gcc/config/score/score7.c --- gcc/config/score/score7.c 1970-01-01 01:00:00.000000000 +0100 +++ gcc/config/score/score7.c 2012-12-31 17:06:04.000000000 +0100 @@ -0,0 +1,1849 @@ +/* score7.c for Sunplus S+CORE processor + Copyright (C) 2005, 2007 Free Software Foundation, Inc. + Contributed by Sunnorth + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +#include "config.h" +#include "system.h" +#include "coretypes.h" +#include "tm.h" +#include "rtl.h" +#include "regs.h" +#include "hard-reg-set.h" +#include "real.h" +#include "insn-config.h" +#include "conditions.h" +#include "insn-attr.h" +#include "recog.h" +#include "toplev.h" +#include "output.h" +#include "tree.h" +#include "function.h" +#include "expr.h" +#include "optabs.h" +#include "flags.h" +#include "reload.h" +#include "tm_p.h" +#include "ggc.h" +#include "gstab.h" +#include "hashtab.h" +#include "debug.h" +#include "target.h" +#include "target-def.h" +#include "integrate.h" +#include "langhooks.h" +#include "cfglayout.h" +#include "score7.h" + +#define BITSET_P(VALUE, BIT) (((VALUE) & (1L << (BIT))) != 0) +#define INS_BUF_SZ 128 + +/* Define the information needed to generate branch insns. This is + stored from the compare operation. */ +extern rtx cmp_op0, cmp_op1; +extern enum reg_class score_char_to_class[256]; + +static int score7_sdata_max; +static char score7_ins[INS_BUF_SZ + 8]; + +/* Return true if SYMBOL is a SYMBOL_REF and OFFSET + SYMBOL points + to the same object as SYMBOL. */ +static int +score7_offset_within_object_p (rtx symbol, HOST_WIDE_INT offset) +{ + if (GET_CODE (symbol) != SYMBOL_REF) + return 0; + + if (CONSTANT_POOL_ADDRESS_P (symbol) + && offset >= 0 + && offset < (int)GET_MODE_SIZE (get_pool_mode (symbol))) + return 1; + + if (SYMBOL_REF_DECL (symbol) != 0 + && offset >= 0 + && offset < int_size_in_bytes (TREE_TYPE (SYMBOL_REF_DECL (symbol)))) + return 1; + + return 0; +} + +/* Split X into a base and a constant offset, storing them in *BASE + and *OFFSET respectively. */ +static void +score7_split_const (rtx x, rtx *base, HOST_WIDE_INT *offset) +{ + *offset = 0; + + if (GET_CODE (x) == CONST) + x = XEXP (x, 0); + + if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT) + { + *offset += INTVAL (XEXP (x, 1)); + x = XEXP (x, 0); + } + + *base = x; +} + +/* Classify symbol X, which must be a SYMBOL_REF or a LABEL_REF. */ +static enum score_symbol_type +score7_classify_symbol (rtx x) +{ + if (GET_CODE (x) == LABEL_REF) + return SYMBOL_GENERAL; + + gcc_assert (GET_CODE (x) == SYMBOL_REF); + + if (CONSTANT_POOL_ADDRESS_P (x)) + { + if (GET_MODE_SIZE (get_pool_mode (x)) <= SCORE7_SDATA_MAX) + return SYMBOL_SMALL_DATA; + return SYMBOL_GENERAL; + } + if (SYMBOL_REF_SMALL_P (x)) + return SYMBOL_SMALL_DATA; + return SYMBOL_GENERAL; +} + +/* Return true if the current function must save REGNO. */ +static int +score7_save_reg_p (unsigned int regno) +{ + /* Check call-saved registers. */ + if (regs_ever_live[regno] && !call_used_regs[regno]) + return 1; + + /* We need to save the old frame pointer before setting up a new one. */ + if (regno == HARD_FRAME_POINTER_REGNUM && frame_pointer_needed) + return 1; + + /* We need to save the incoming return address if it is ever clobbered + within the function. */ + if (regno == RA_REGNUM && regs_ever_live[regno]) + return 1; + + return 0; +} + +/* Return one word of double-word value OP, taking into account the fixed + endianness of certain registers. HIGH_P is true to select the high part, + false to select the low part. */ +static rtx +score7_subw (rtx op, int high_p) +{ + unsigned int byte; + enum machine_mode mode = GET_MODE (op); + + if (mode == VOIDmode) + mode = DImode; + + byte = (TARGET_LITTLE_ENDIAN ? high_p : !high_p) ? UNITS_PER_WORD : 0; + + if (GET_CODE (op) == REG && REGNO (op) == HI_REGNUM) + return gen_rtx_REG (SImode, high_p ? HI_REGNUM : LO_REGNUM); + + if (GET_CODE (op) == MEM) + return adjust_address (op, SImode, byte); + + return simplify_gen_subreg (SImode, op, mode, byte); +} + +static struct score7_frame_info * +score7_cached_frame (void) +{ + static struct score7_frame_info _frame_info; + return &_frame_info; +} + +/* Return the bytes needed to compute the frame pointer from the current + stack pointer. SIZE is the size (in bytes) of the local variables. */ +static struct score7_frame_info * +score7_compute_frame_size (HOST_WIDE_INT size) +{ + unsigned int regno; + struct score7_frame_info *f = score7_cached_frame (); + + memset (f, 0, sizeof (struct score7_frame_info)); + f->gp_reg_size = 0; + f->mask = 0; + f->var_size = SCORE7_STACK_ALIGN (size); + f->args_size = current_function_outgoing_args_size; + f->cprestore_size = flag_pic ? UNITS_PER_WORD : 0; + if (f->var_size == 0 && current_function_is_leaf) + f->args_size = f->cprestore_size = 0; + + if (f->args_size == 0 && current_function_calls_alloca) + f->args_size = UNITS_PER_WORD; + + f->total_size = f->var_size + f->args_size + f->cprestore_size; + for (regno = GP_REG_FIRST; regno <= GP_REG_LAST; regno++) + { + if (score7_save_reg_p (regno)) + { + f->gp_reg_size += GET_MODE_SIZE (SImode); + f->mask |= 1 << (regno - GP_REG_FIRST); + } + } + + if (current_function_calls_eh_return) + { + unsigned int i; + for (i = 0;; ++i) + { + regno = EH_RETURN_DATA_REGNO (i); + if (regno == INVALID_REGNUM) + break; + f->gp_reg_size += GET_MODE_SIZE (SImode); + f->mask |= 1 << (regno - GP_REG_FIRST); + } + } + + f->total_size += f->gp_reg_size; + f->num_gp = f->gp_reg_size / UNITS_PER_WORD; + + if (f->mask) + { + HOST_WIDE_INT offset; + offset = (f->args_size + f->cprestore_size + f->var_size + + f->gp_reg_size - GET_MODE_SIZE (SImode)); + f->gp_sp_offset = offset; + } + else + f->gp_sp_offset = 0; + + return f; +} + +/* Return true if X is a valid base register for the given mode. + Allow only hard registers if STRICT. */ +static int +score7_valid_base_register_p (rtx x, int strict) +{ + if (!strict && GET_CODE (x) == SUBREG) + x = SUBREG_REG (x); + + return (GET_CODE (x) == REG + && score7_regno_mode_ok_for_base_p (REGNO (x), strict)); +} + +/* Return true if X is a valid address for machine mode MODE. If it is, + fill in INFO appropriately. STRICT is true if we should only accept + hard base registers. */ +static int +score7_classify_address (struct score7_address_info *info, + enum machine_mode mode, rtx x, int strict) +{ + info->code = GET_CODE (x); + + switch (info->code) + { + case REG: + case SUBREG: + info->type = SCORE7_ADD_REG; + info->reg = x; + info->offset = const0_rtx; + return score7_valid_base_register_p (info->reg, strict); + case PLUS: + info->type = SCORE7_ADD_REG; + info->reg = XEXP (x, 0); + info->offset = XEXP (x, 1); + return (score7_valid_base_register_p (info->reg, strict) + && GET_CODE (info->offset) == CONST_INT + && IMM_IN_RANGE (INTVAL (info->offset), 15, 1)); + case PRE_DEC: + case POST_DEC: + case PRE_INC: + case POST_INC: + if (GET_MODE_SIZE (mode) > GET_MODE_SIZE (SImode)) + return false; + info->type = SCORE7_ADD_REG; + info->reg = XEXP (x, 0); + info->offset = GEN_INT (GET_MODE_SIZE (mode)); + return score7_valid_base_register_p (info->reg, strict); + case CONST_INT: + info->type = SCORE7_ADD_CONST_INT; + return IMM_IN_RANGE (INTVAL (x), 15, 1); + case CONST: + case LABEL_REF: + case SYMBOL_REF: + info->type = SCORE7_ADD_SYMBOLIC; + return (score7_symbolic_constant_p (x, &info->symbol_type) + && (info->symbol_type == SYMBOL_GENERAL + || info->symbol_type == SYMBOL_SMALL_DATA)); + default: + return 0; + } +} + +bool +score7_return_in_memory (tree type, tree fndecl ATTRIBUTE_UNUSED) +{ + return ((TYPE_MODE (type) == BLKmode) + || (int_size_in_bytes (type) > 2 * UNITS_PER_WORD) + || (int_size_in_bytes (type) == -1)); +} + +/* Return a legitimate address for REG + OFFSET. */ +static rtx +score7_add_offset (rtx reg, HOST_WIDE_INT offset) +{ + if (!IMM_IN_RANGE (offset, 15, 1)) + { + reg = expand_simple_binop (GET_MODE (reg), PLUS, + gen_int_mode (offset & 0xffffc000, + GET_MODE (reg)), + reg, NULL, 0, OPTAB_WIDEN); + offset &= 0x3fff; + } + + return plus_constant (reg, offset); +} + +/* Implement TARGET_ASM_OUTPUT_MI_THUNK. Generate rtl rather than asm text + in order to avoid duplicating too much logic from elsewhere. */ +void +score7_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED, + HOST_WIDE_INT delta, HOST_WIDE_INT vcall_offset, + tree function) +{ + rtx this, temp1, insn, fnaddr; + + /* Pretend to be a post-reload pass while generating rtl. */ + no_new_pseudos = 1; + reload_completed = 1; + reset_block_changes (); + + /* We need two temporary registers in some cases. */ + temp1 = gen_rtx_REG (Pmode, 8); + + /* Find out which register contains the "this" pointer. */ + if (aggregate_value_p (TREE_TYPE (TREE_TYPE (function)), function)) + this = gen_rtx_REG (Pmode, ARG_REG_FIRST + 1); + else + this = gen_rtx_REG (Pmode, ARG_REG_FIRST); + + /* Add DELTA to THIS. */ + if (delta != 0) + { + rtx offset = GEN_INT (delta); + if (!CONST_OK_FOR_LETTER_P (delta, 'L')) + { + emit_move_insn (temp1, offset); + offset = temp1; + } + emit_insn (gen_add3_insn (this, this, offset)); + } + + /* If needed, add *(*THIS + VCALL_OFFSET) to THIS. */ + if (vcall_offset != 0) + { + rtx addr; + + /* Set TEMP1 to *THIS. */ + emit_move_insn (temp1, gen_rtx_MEM (Pmode, this)); + + /* Set ADDR to a legitimate address for *THIS + VCALL_OFFSET. */ + addr = score7_add_offset (temp1, vcall_offset); + + /* Load the offset and add it to THIS. */ + emit_move_insn (temp1, gen_rtx_MEM (Pmode, addr)); + emit_insn (gen_add3_insn (this, this, temp1)); + } + + /* Jump to the target function. */ + fnaddr = XEXP (DECL_RTL (function), 0); + insn = emit_call_insn (gen_sibcall_internal_score7 (fnaddr, const0_rtx)); + SIBLING_CALL_P (insn) = 1; + + /* Run just enough of rest_of_compilation. This sequence was + "borrowed" from alpha.c. */ + insn = get_insns (); + insn_locators_initialize (); + split_all_insns_noflow (); + shorten_branches (insn); + final_start_function (insn, file, 1); + final (insn, file, 1); + final_end_function (); + + /* Clean up the vars set above. Note that final_end_function resets + the global pointer for us. */ + reload_completed = 0; + no_new_pseudos = 0; +} + +/* Copy VALUE to a register and return that register. If new psuedos + are allowed, copy it into a new register, otherwise use DEST. */ +static rtx +score7_force_temporary (rtx dest, rtx value) +{ + if (!no_new_pseudos) + return force_reg (Pmode, value); + else + { + emit_move_insn (copy_rtx (dest), value); + return dest; + } +} + +/* Return a LO_SUM expression for ADDR. TEMP is as for score_force_temporary + and is used to load the high part into a register. */ +static rtx +score7_split_symbol (rtx temp, rtx addr) +{ + rtx high = score7_force_temporary (temp, + gen_rtx_HIGH (Pmode, copy_rtx (addr))); + return gen_rtx_LO_SUM (Pmode, high, addr); +} + +/* This function is used to implement LEGITIMIZE_ADDRESS. If *XLOC can + be legitimized in a way that the generic machinery might not expect, + put the new address in *XLOC and return true. */ +int +score7_legitimize_address (rtx *xloc) +{ + enum score_symbol_type symbol_type; + + if (score7_symbolic_constant_p (*xloc, &symbol_type) + && symbol_type == SYMBOL_GENERAL) + { + *xloc = score7_split_symbol (0, *xloc); + return 1; + } + + if (GET_CODE (*xloc) == PLUS + && GET_CODE (XEXP (*xloc, 1)) == CONST_INT) + { + rtx reg = XEXP (*xloc, 0); + if (!score7_valid_base_register_p (reg, 0)) + reg = copy_to_mode_reg (Pmode, reg); + *xloc = score7_add_offset (reg, INTVAL (XEXP (*xloc, 1))); + return 1; + } + return 0; +} + +/* Fill INFO with information about a single argument. CUM is the + cumulative state for earlier arguments. MODE is the mode of this + argument and TYPE is its type (if known). NAMED is true if this + is a named (fixed) argument rather than a variable one. */ +static void +score7_classify_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int named, struct score7_arg_info *info) +{ + int even_reg_p; + unsigned int num_words, max_regs; + + even_reg_p = 0; + if (GET_MODE_CLASS (mode) == MODE_INT + || GET_MODE_CLASS (mode) == MODE_FLOAT) + even_reg_p = (GET_MODE_SIZE (mode) > UNITS_PER_WORD); + else + if (type != NULL_TREE && TYPE_ALIGN (type) > BITS_PER_WORD && named) + even_reg_p = 1; + + if (TARGET_MUST_PASS_IN_STACK (mode, type)) + info->reg_offset = ARG_REG_NUM; + else + { + info->reg_offset = cum->num_gprs; + if (even_reg_p) + info->reg_offset += info->reg_offset & 1; + } + + if (mode == BLKmode) + info->num_bytes = int_size_in_bytes (type); + else + info->num_bytes = GET_MODE_SIZE (mode); + + num_words = (info->num_bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + max_regs = ARG_REG_NUM - info->reg_offset; + + /* Partition the argument between registers and stack. */ + info->reg_words = MIN (num_words, max_regs); + info->stack_words = num_words - info->reg_words; + + /* The alignment applied to registers is also applied to stack arguments. */ + if (info->stack_words) + { + info->stack_offset = cum->stack_words; + if (even_reg_p) + info->stack_offset += info->stack_offset & 1; + } +} + +/* Set up the stack and frame (if desired) for the function. */ +void +score7_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED) +{ + const char *fnname; + struct score7_frame_info *f = score7_cached_frame (); + HOST_WIDE_INT tsize = f->total_size; + + fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); + if (!flag_inhibit_size_directive) + { + fputs ("\t.ent\t", file); + assemble_name (file, fnname); + fputs ("\n", file); + } + assemble_name (file, fnname); + fputs (":\n", file); + + if (!flag_inhibit_size_directive) + { + fprintf (file, + "\t.frame\t%s," HOST_WIDE_INT_PRINT_DEC ",%s, %d\t\t" + "# vars= " HOST_WIDE_INT_PRINT_DEC ", regs= %d" + ", args= " HOST_WIDE_INT_PRINT_DEC + ", gp= " HOST_WIDE_INT_PRINT_DEC "\n", + (reg_names[(frame_pointer_needed) + ? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM]), + tsize, + reg_names[RA_REGNUM], + current_function_is_leaf ? 1 : 0, + f->var_size, + f->num_gp, + f->args_size, + f->cprestore_size); + + fprintf(file, "\t.mask\t0x%08x," HOST_WIDE_INT_PRINT_DEC "\n", + f->mask, + (f->gp_sp_offset - f->total_size)); + } +} + +/* Do any necessary cleanup after a function to restore stack, frame, + and regs. */ +void +score7_function_epilogue (FILE *file, + HOST_WIDE_INT size ATTRIBUTE_UNUSED) +{ + if (!flag_inhibit_size_directive) + { + const char *fnname; + fnname = XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0); + fputs ("\t.end\t", file); + assemble_name (file, fnname); + fputs ("\n", file); + } +} + +/* Returns true if X contains a SYMBOL_REF. */ +static bool +score7_symbolic_expression_p (rtx x) +{ + if (GET_CODE (x) == SYMBOL_REF) + return true; + + if (GET_CODE (x) == CONST) + return score7_symbolic_expression_p (XEXP (x, 0)); + + if (UNARY_P (x)) + return score7_symbolic_expression_p (XEXP (x, 0)); + + if (ARITHMETIC_P (x)) + return (score7_symbolic_expression_p (XEXP (x, 0)) + || score7_symbolic_expression_p (XEXP (x, 1))); + + return false; +} + +/* Choose the section to use for the constant rtx expression X that has + mode MODE. */ +section * +score7_select_rtx_section (enum machine_mode mode, rtx x, + unsigned HOST_WIDE_INT align) +{ + if (GET_MODE_SIZE (mode) <= SCORE7_SDATA_MAX) + return get_named_section (0, ".sdata", 0); + else if (flag_pic && score7_symbolic_expression_p (x)) + return get_named_section (0, ".data.rel.ro", 3); + else + return mergeable_constant_section (mode, align, 0); +} + +/* Implement TARGET_IN_SMALL_DATA_P. */ +bool +score7_in_small_data_p (tree decl) +{ + HOST_WIDE_INT size; + + if (TREE_CODE (decl) == STRING_CST + || TREE_CODE (decl) == FUNCTION_DECL) + return false; + + if (TREE_CODE (decl) == VAR_DECL && DECL_SECTION_NAME (decl) != 0) + { + const char *name; + name = TREE_STRING_POINTER (DECL_SECTION_NAME (decl)); + if (strcmp (name, ".sdata") != 0 + && strcmp (name, ".sbss") != 0) + return true; + if (!DECL_EXTERNAL (decl)) + return false; + } + size = int_size_in_bytes (TREE_TYPE (decl)); + return (size > 0 && size <= SCORE7_SDATA_MAX); +} + +/* Implement TARGET_ASM_FILE_START. */ +void +score7_asm_file_start (void) +{ + default_file_start (); + fprintf (asm_out_file, ASM_COMMENT_START + "GCC for S+core %s \n", SCORE_GCC_VERSION); + + if (flag_pic) + fprintf (asm_out_file, "\t.set pic\n"); +} + +/* Implement TARGET_ASM_FILE_END. When using assembler macros, emit + .externs for any small-data variables that turned out to be external. */ +void +score7_asm_file_end (void) +{ + tree name_tree; + struct extern_list *p; + if (extern_head) + { + fputs ("\n", asm_out_file); + for (p = extern_head; p != 0; p = p->next) + { + name_tree = get_identifier (p->name); + if (!TREE_ASM_WRITTEN (name_tree) + && TREE_SYMBOL_REFERENCED (name_tree)) + { + TREE_ASM_WRITTEN (name_tree) = 1; + fputs ("\t.extern\t", asm_out_file); + assemble_name (asm_out_file, p->name); + fprintf (asm_out_file, ", %d\n", p->size); + } + } + } +} + +/* Implement OVERRIDE_OPTIONS macro. */ +void +score7_override_options (void) +{ + flag_pic = false; + if (!flag_pic) + score7_sdata_max = g_switch_set ? g_switch_value : SCORE7_DEFAULT_SDATA_MAX; + else + { + score7_sdata_max = 0; + if (g_switch_set && (g_switch_value != 0)) + warning (0, "-fPIC and -G are incompatible"); + } + + score_char_to_class['d'] = G32_REGS; + score_char_to_class['e'] = G16_REGS; + score_char_to_class['t'] = T32_REGS; + + score_char_to_class['h'] = HI_REG; + score_char_to_class['l'] = LO_REG; + score_char_to_class['x'] = CE_REGS; + + score_char_to_class['q'] = CN_REG; + score_char_to_class['y'] = LC_REG; + score_char_to_class['z'] = SC_REG; + score_char_to_class['a'] = SP_REGS; + + score_char_to_class['c'] = CR_REGS; +} + +/* Implement REGNO_REG_CLASS macro. */ +int +score7_reg_class (int regno) +{ + int c; + gcc_assert (regno >= 0 && regno < FIRST_PSEUDO_REGISTER); + + if (regno == FRAME_POINTER_REGNUM + || regno == ARG_POINTER_REGNUM) + return ALL_REGS; + + for (c = 0; c < N_REG_CLASSES; c++) + if (TEST_HARD_REG_BIT (reg_class_contents[c], regno)) + return c; + + return NO_REGS; +} + +/* Implement PREFERRED_RELOAD_CLASS macro. */ +enum reg_class +score7_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, enum reg_class class) +{ + if (reg_class_subset_p (G16_REGS, class)) + return G16_REGS; + if (reg_class_subset_p (G32_REGS, class)) + return G32_REGS; + return class; +} + +/* Implement SECONDARY_INPUT_RELOAD_CLASS + and SECONDARY_OUTPUT_RELOAD_CLASS macro. */ +enum reg_class +score7_secondary_reload_class (enum reg_class class, + enum machine_mode mode ATTRIBUTE_UNUSED, + rtx x) +{ + int regno = -1; + if (GET_CODE (x) == REG || GET_CODE(x) == SUBREG) + regno = true_regnum (x); + + if (!GR_REG_CLASS_P (class)) + return GP_REG_P (regno) ? NO_REGS : G32_REGS; + return NO_REGS; +} + +/* Implement CONST_OK_FOR_LETTER_P macro. */ +/* imm constraints + I imm16 << 16 + J uimm5 + K uimm16 + L simm16 + M uimm14 + N simm14 */ +int +score7_const_ok_for_letter_p (HOST_WIDE_INT value, char c) +{ + switch (c) + { + case 'I': return ((value & 0xffff) == 0); + case 'J': return IMM_IN_RANGE (value, 5, 0); + case 'K': return IMM_IN_RANGE (value, 16, 0); + case 'L': return IMM_IN_RANGE (value, 16, 1); + case 'M': return IMM_IN_RANGE (value, 14, 0); + case 'N': return IMM_IN_RANGE (value, 14, 1); + default : return 0; + } +} + +/* Implement EXTRA_CONSTRAINT macro. */ +/* Z symbol_ref */ +int +score7_extra_constraint (rtx op, char c) +{ + switch (c) + { + case 'Z': + return GET_CODE (op) == SYMBOL_REF; + default: + gcc_unreachable (); + } +} + +/* Return truth value on whether or not a given hard register + can support a given mode. */ +int +score7_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode) +{ + int size = GET_MODE_SIZE (mode); + enum mode_class class = GET_MODE_CLASS (mode); + + if (class == MODE_CC) + return regno == CC_REGNUM; + else if (regno == FRAME_POINTER_REGNUM + || regno == ARG_POINTER_REGNUM) + return class == MODE_INT; + else if (GP_REG_P (regno)) + /* ((regno <= (GP_REG_LAST- HARD_REGNO_NREGS (dummy, mode)) + 1) */ + return !(regno & 1) || (size <= UNITS_PER_WORD); + else if (CE_REG_P (regno)) + return (class == MODE_INT + && ((size <= UNITS_PER_WORD) + || (regno == CE_REG_FIRST && size == 2 * UNITS_PER_WORD))); + else + return (class == MODE_INT) && (size <= UNITS_PER_WORD); +} + +/* Implement INITIAL_ELIMINATION_OFFSET. FROM is either the frame + pointer or argument pointer. TO is either the stack pointer or + hard frame pointer. */ +HOST_WIDE_INT +score7_initial_elimination_offset (int from, + int to ATTRIBUTE_UNUSED) +{ + struct score7_frame_info *f = score7_compute_frame_size (get_frame_size ()); + switch (from) + { + case ARG_POINTER_REGNUM: + return f->total_size; + case FRAME_POINTER_REGNUM: + return 0; + default: + gcc_unreachable (); + } +} + +/* Implement FUNCTION_ARG_ADVANCE macro. */ +void +score7_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int named) +{ + struct score7_arg_info info; + score7_classify_arg (cum, mode, type, named, &info); + cum->num_gprs = info.reg_offset + info.reg_words; + if (info.stack_words > 0) + cum->stack_words = info.stack_offset + info.stack_words; + cum->arg_number++; +} + +/* Implement TARGET_ARG_PARTIAL_BYTES macro. */ +int +score7_arg_partial_bytes (CUMULATIVE_ARGS *cum, + enum machine_mode mode, tree type, bool named) +{ + struct score7_arg_info info; + score7_classify_arg (cum, mode, type, named, &info); + return info.stack_words > 0 ? info.reg_words * UNITS_PER_WORD : 0; +} + +/* Implement FUNCTION_ARG macro. */ +rtx +score7_function_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode, + tree type, int named) +{ + struct score7_arg_info info; + + if (mode == VOIDmode || !named) + return 0; + + score7_classify_arg (cum, mode, type, named, &info); + + if (info.reg_offset == ARG_REG_NUM) + return 0; + + if (!info.stack_words) + return gen_rtx_REG (mode, ARG_REG_FIRST + info.reg_offset); + else + { + rtx ret = gen_rtx_PARALLEL (mode, rtvec_alloc (info.reg_words)); + unsigned int i, part_offset = 0; + for (i = 0; i < info.reg_words; i++) + { + rtx reg; + reg = gen_rtx_REG (SImode, ARG_REG_FIRST + info.reg_offset + i); + XVECEXP (ret, 0, i) = gen_rtx_EXPR_LIST (SImode, reg, + GEN_INT (part_offset)); + part_offset += UNITS_PER_WORD; + } + return ret; + } +} + +/* Implement FUNCTION_VALUE and LIBCALL_VALUE. For normal calls, + VALTYPE is the return type and MODE is VOIDmode. For libcalls, + VALTYPE is null and MODE is the mode of the return value. */ +rtx +score7_function_value (tree valtype, tree func ATTRIBUTE_UNUSED, + enum machine_mode mode) +{ + if (valtype) + { + int unsignedp; + mode = TYPE_MODE (valtype); + unsignedp = TYPE_UNSIGNED (valtype); + mode = promote_mode (valtype, mode, &unsignedp, 1); + } + return gen_rtx_REG (mode, RT_REGNUM); +} + +/* Implement INITIALIZE_TRAMPOLINE macro. */ +void +score7_initialize_trampoline (rtx ADDR, rtx FUNC, rtx CHAIN) +{ +#define FFCACHE "_flush_cache" +#define CODE_SIZE (TRAMPOLINE_INSNS * UNITS_PER_WORD) + + rtx pfunc, pchain; + + pfunc = plus_constant (ADDR, CODE_SIZE); + pchain = plus_constant (ADDR, CODE_SIZE + GET_MODE_SIZE (SImode)); + + emit_move_insn (gen_rtx_MEM (SImode, pfunc), FUNC); + emit_move_insn (gen_rtx_MEM (SImode, pchain), CHAIN); + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, FFCACHE), + 0, VOIDmode, 2, + ADDR, Pmode, + GEN_INT (TRAMPOLINE_SIZE), SImode); +#undef FFCACHE +#undef CODE_SIZE +} + +/* This function is used to implement REG_MODE_OK_FOR_BASE_P macro. */ +int +score7_regno_mode_ok_for_base_p (int regno, int strict) +{ + if (regno >= FIRST_PSEUDO_REGISTER) + { + if (!strict) + return 1; + regno = reg_renumber[regno]; + } + if (regno == ARG_POINTER_REGNUM + || regno == FRAME_POINTER_REGNUM) + return 1; + return GP_REG_P (regno); +} + +/* Implement GO_IF_LEGITIMATE_ADDRESS macro. */ +int +score7_address_p (enum machine_mode mode, rtx x, int strict) +{ + struct score7_address_info addr; + + return score7_classify_address (&addr, mode, x, strict); +} + +/* Return a number assessing the cost of moving a register in class + FROM to class TO. */ +int +score7_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, + enum reg_class from, enum reg_class to) +{ + if (GR_REG_CLASS_P (from)) + { + if (GR_REG_CLASS_P (to)) + return 2; + else if (SP_REG_CLASS_P (to)) + return 4; + else if (CP_REG_CLASS_P (to)) + return 5; + else if (CE_REG_CLASS_P (to)) + return 6; + } + if (GR_REG_CLASS_P (to)) + { + if (GR_REG_CLASS_P (from)) + return 2; + else if (SP_REG_CLASS_P (from)) + return 4; + else if (CP_REG_CLASS_P (from)) + return 5; + else if (CE_REG_CLASS_P (from)) + return 6; + } + return 12; +} + +/* Return the number of instructions needed to load a symbol of the + given type into a register. */ +static int +score7_symbol_insns (enum score_symbol_type type) +{ + switch (type) + { + case SYMBOL_GENERAL: + return 2; + + case SYMBOL_SMALL_DATA: + return 1; + } + + gcc_unreachable (); +} + +/* Return the number of instructions needed to load or store a value + of mode MODE at X. Return 0 if X isn't valid for MODE. */ +static int +score7_address_insns (rtx x, enum machine_mode mode) +{ + struct score7_address_info addr; + int factor; + + if (mode == BLKmode) + factor = 1; + else + factor = (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD; + + if (score7_classify_address (&addr, mode, x, false)) + switch (addr.type) + { + case SCORE7_ADD_REG: + case SCORE7_ADD_CONST_INT: + return factor; + + case SCORE7_ADD_SYMBOLIC: + return factor * score7_symbol_insns (addr.symbol_type); + } + return 0; +} + +/* Implement TARGET_RTX_COSTS macro. */ +bool +score7_rtx_costs (rtx x, int code, int outer_code, int *total) +{ + enum machine_mode mode = GET_MODE (x); + + switch (code) + { + case CONST_INT: + if (outer_code == SET) + { + if (CONST_OK_FOR_LETTER_P (INTVAL (x), 'I') + || CONST_OK_FOR_LETTER_P (INTVAL (x), 'L')) + *total = COSTS_N_INSNS (1); + else + *total = COSTS_N_INSNS (2); + } + else if (outer_code == PLUS || outer_code == MINUS) + { + if (CONST_OK_FOR_LETTER_P (INTVAL (x), 'N')) + *total = 0; + else if (CONST_OK_FOR_LETTER_P (INTVAL (x), 'I') + || CONST_OK_FOR_LETTER_P (INTVAL (x), 'L')) + *total = 1; + else + *total = COSTS_N_INSNS (2); + } + else if (outer_code == AND || outer_code == IOR) + { + if (CONST_OK_FOR_LETTER_P (INTVAL (x), 'M')) + *total = 0; + else if (CONST_OK_FOR_LETTER_P (INTVAL (x), 'I') + || CONST_OK_FOR_LETTER_P (INTVAL (x), 'K')) + *total = 1; + else + *total = COSTS_N_INSNS (2); + } + else + { + *total = 0; + } + return true; + + case CONST: + case SYMBOL_REF: + case LABEL_REF: + case CONST_DOUBLE: + *total = COSTS_N_INSNS (2); + return true; + + case MEM: + { + /* If the address is legitimate, return the number of + instructions it needs, otherwise use the default handling. */ + int n = score7_address_insns (XEXP (x, 0), GET_MODE (x)); + if (n > 0) + { + *total = COSTS_N_INSNS (n + 1); + return true; + } + return false; + } + + case FFS: + *total = COSTS_N_INSNS (6); + return true; + + case NOT: + *total = COSTS_N_INSNS (1); + return true; + + case AND: + case IOR: + case XOR: + if (mode == DImode) + { + *total = COSTS_N_INSNS (2); + return true; + } + return false; + + case ASHIFT: + case ASHIFTRT: + case LSHIFTRT: + if (mode == DImode) + { + *total = COSTS_N_INSNS ((GET_CODE (XEXP (x, 1)) == CONST_INT) + ? 4 : 12); + return true; + } + return false; + + case ABS: + *total = COSTS_N_INSNS (4); + return true; + + case PLUS: + case MINUS: + if (mode == DImode) + { + *total = COSTS_N_INSNS (4); + return true; + } + *total = COSTS_N_INSNS (1); + return true; + + case NEG: + if (mode == DImode) + { + *total = COSTS_N_INSNS (4); + return true; + } + return false; + + case MULT: + *total = optimize_size ? COSTS_N_INSNS (2) : COSTS_N_INSNS (12); + return true; + + case DIV: + case MOD: + case UDIV: + case UMOD: + *total = optimize_size ? COSTS_N_INSNS (2) : COSTS_N_INSNS (33); + return true; + + case SIGN_EXTEND: + case ZERO_EXTEND: + switch (GET_MODE (XEXP (x, 0))) + { + case QImode: + case HImode: + if (GET_CODE (XEXP (x, 0)) == MEM) + { + *total = COSTS_N_INSNS (2); + + if (!TARGET_LITTLE_ENDIAN && + side_effects_p (XEXP (XEXP (x, 0), 0))) + *total = 100; + } + else + *total = COSTS_N_INSNS (1); + break; + + default: + *total = COSTS_N_INSNS (1); + break; + } + return true; + + default: + return false; + } +} + +/* Implement TARGET_ADDRESS_COST macro. */ +int +score7_address_cost (rtx addr) +{ + return score7_address_insns (addr, SImode); +} + +/* Implement ASM_OUTPUT_EXTERNAL macro. */ +int +score7_output_external (FILE *file ATTRIBUTE_UNUSED, + tree decl, const char *name) +{ + register struct extern_list *p; + + if (score7_in_small_data_p (decl)) + { + p = (struct extern_list *) ggc_alloc (sizeof (struct extern_list)); + p->next = extern_head; + p->name = name; + p->size = int_size_in_bytes (TREE_TYPE (decl)); + extern_head = p; + } + return 0; +} + +/* Implement RETURN_ADDR_RTX. Note, we do not support moving + back to a previous frame. */ +rtx +score7_return_addr (int count, rtx frame ATTRIBUTE_UNUSED) +{ + if (count != 0) + return const0_rtx; + return get_hard_reg_initial_val (Pmode, RA_REGNUM); +} + +/* Implement PRINT_OPERAND macro. */ +/* Score-specific operand codes: + '[' print .set nor1 directive + ']' print .set r1 directive + 'U' print hi part of a CONST_INT rtx + 'E' print log2(v) + 'F' print log2(~v) + 'D' print SFmode const double + 'S' selectively print "!" if operand is 15bit instruction accessible + 'V' print "v!" if operand is 15bit instruction accessible, or "lfh!" + 'L' low part of DImode reg operand + 'H' high part of DImode reg operand + 'C' print part of opcode for a branch condition. */ +void +score7_print_operand (FILE *file, rtx op, int c) +{ + enum rtx_code code = -1; + if (!PRINT_OPERAND_PUNCT_VALID_P (c)) + code = GET_CODE (op); + + if (c == '[') + { + fprintf (file, ".set r1\n"); + } + else if (c == ']') + { + fprintf (file, "\n\t.set nor1"); + } + else if (c == 'U') + { + gcc_assert (code == CONST_INT); + fprintf (file, HOST_WIDE_INT_PRINT_HEX, + (INTVAL (op) >> 16) & 0xffff); + } + else if (c == 'D') + { + if (GET_CODE (op) == CONST_DOUBLE) + { + rtx temp = gen_lowpart (SImode, op); + gcc_assert (GET_MODE (op) == SFmode); + fprintf (file, HOST_WIDE_INT_PRINT_HEX, INTVAL (temp) & 0xffffffff); + } + else + output_addr_const (file, op); + } + else if (c == 'S') + { + gcc_assert (code == REG); + if (G16_REG_P (REGNO (op))) + fprintf (file, "!"); + } + else if (c == 'V') + { + gcc_assert (code == REG); + fprintf (file, G16_REG_P (REGNO (op)) ? "v!" : "lfh!"); + } + else if (c == 'C') + { + enum machine_mode mode = GET_MODE (XEXP (op, 0)); + + switch (code) + { + case EQ: fputs ("eq", file); break; + case NE: fputs ("ne", file); break; + case GT: fputs ("gt", file); break; + case GE: fputs (mode != CCmode ? "pl" : "ge", file); break; + case LT: fputs (mode != CCmode ? "mi" : "lt", file); break; + case LE: fputs ("le", file); break; + case GTU: fputs ("gtu", file); break; + case GEU: fputs ("cs", file); break; + case LTU: fputs ("cc", file); break; + case LEU: fputs ("leu", file); break; + default: + output_operand_lossage ("invalid operand for code: '%c'", code); + } + } + else if (c == 'E') + { + unsigned HOST_WIDE_INT i; + unsigned HOST_WIDE_INT pow2mask = 1; + unsigned HOST_WIDE_INT val; + + val = INTVAL (op); + for (i = 0; i < 32; i++) + { + if (val == pow2mask) + break; + pow2mask <<= 1; + } + gcc_assert (i < 32); + fprintf (file, HOST_WIDE_INT_PRINT_HEX, i); + } + else if (c == 'F') + { + unsigned HOST_WIDE_INT i; + unsigned HOST_WIDE_INT pow2mask = 1; + unsigned HOST_WIDE_INT val; + + val = ~INTVAL (op); + for (i = 0; i < 32; i++) + { + if (val == pow2mask) + break; + pow2mask <<= 1; + } + gcc_assert (i < 32); + fprintf (file, HOST_WIDE_INT_PRINT_HEX, i); + } + else if (code == REG) + { + int regnum = REGNO (op); + if ((c == 'H' && !WORDS_BIG_ENDIAN) + || (c == 'L' && WORDS_BIG_ENDIAN)) + regnum ++; + fprintf (file, "%s", reg_names[regnum]); + } + else + { + switch (code) + { + case MEM: + score7_print_operand_address (file, op); + break; + default: + output_addr_const (file, op); + } + } +} + +/* Implement PRINT_OPERAND_ADDRESS macro. */ +void +score7_print_operand_address (FILE *file, rtx x) +{ + struct score7_address_info addr; + enum rtx_code code = GET_CODE (x); + enum machine_mode mode = GET_MODE (x); + + if (code == MEM) + x = XEXP (x, 0); + + if (score7_classify_address (&addr, mode, x, true)) + { + switch (addr.type) + { + case SCORE7_ADD_REG: + { + switch (addr.code) + { + case PRE_DEC: + fprintf (file, "[%s,-%ld]+", reg_names[REGNO (addr.reg)], + INTVAL (addr.offset)); + break; + case POST_DEC: + fprintf (file, "[%s]+,-%ld", reg_names[REGNO (addr.reg)], + INTVAL (addr.offset)); + break; + case PRE_INC: + fprintf (file, "[%s, %ld]+", reg_names[REGNO (addr.reg)], + INTVAL (addr.offset)); + break; + case POST_INC: + fprintf (file, "[%s]+, %ld", reg_names[REGNO (addr.reg)], + INTVAL (addr.offset)); + break; + default: + if (INTVAL(addr.offset) == 0) + fprintf(file, "[%s]", reg_names[REGNO (addr.reg)]); + else + fprintf(file, "[%s, %ld]", reg_names[REGNO (addr.reg)], + INTVAL(addr.offset)); + break; + } + } + return; + case SCORE7_ADD_CONST_INT: + case SCORE7_ADD_SYMBOLIC: + output_addr_const (file, x); + return; + } + } + print_rtl (stderr, x); + gcc_unreachable (); +} + +/* Implement SELECT_CC_MODE macro. */ +enum machine_mode +score7_select_cc_mode (enum rtx_code op, rtx x, rtx y) +{ + if ((op == EQ || op == NE || op == LT || op == GE) + && y == const0_rtx + && GET_MODE (x) == SImode) + { + switch (GET_CODE (x)) + { + case PLUS: + case MINUS: + case NEG: + case AND: + case IOR: + case XOR: + case NOT: + case ASHIFT: + case LSHIFTRT: + case ASHIFTRT: + return CC_NZmode; + + case SIGN_EXTEND: + case ZERO_EXTEND: + case ROTATE: + case ROTATERT: + return (op == LT || op == GE) ? CC_Nmode : CCmode; + + default: + return CCmode; + } + } + + if ((op == EQ || op == NE) + && (GET_CODE (y) == NEG) + && register_operand (XEXP (y, 0), SImode) + && register_operand (x, SImode)) + { + return CC_NZmode; + } + + return CCmode; +} + +/* Generate the prologue instructions for entry into a S+core function. */ +void +score7_prologue (void) +{ +#define EMIT_PL(_rtx) RTX_FRAME_RELATED_P (_rtx) = 1 + + struct score7_frame_info *f = score7_compute_frame_size (get_frame_size ()); + HOST_WIDE_INT size; + int regno; + + size = f->total_size - f->gp_reg_size; + + if (flag_pic) + emit_insn (gen_cpload_score7 ()); + + for (regno = (int) GP_REG_LAST; regno >= (int) GP_REG_FIRST; regno--) + { + if (BITSET_P (f->mask, regno - GP_REG_FIRST)) + { + rtx mem = gen_rtx_MEM (SImode, + gen_rtx_PRE_DEC (SImode, stack_pointer_rtx)); + rtx reg = gen_rtx_REG (SImode, regno); + if (!current_function_calls_eh_return) + MEM_READONLY_P (mem) = 1; + EMIT_PL (emit_insn (gen_pushsi_score7 (mem, reg))); + } + } + + if (size > 0) + { + rtx insn; + + if (CONST_OK_FOR_LETTER_P (-size, 'L')) + EMIT_PL (emit_insn (gen_add3_insn (stack_pointer_rtx, + stack_pointer_rtx, + GEN_INT (-size)))); + else + { + EMIT_PL (emit_move_insn (gen_rtx_REG (Pmode, SCORE7_PROLOGUE_TEMP_REGNUM), + GEN_INT (size))); + EMIT_PL (emit_insn + (gen_sub3_insn (stack_pointer_rtx, + stack_pointer_rtx, + gen_rtx_REG (Pmode, + SCORE7_PROLOGUE_TEMP_REGNUM)))); + } + insn = get_last_insn (); + REG_NOTES (insn) = + alloc_EXPR_LIST (REG_FRAME_RELATED_EXPR, + gen_rtx_SET (VOIDmode, stack_pointer_rtx, + plus_constant (stack_pointer_rtx, + -size)), + REG_NOTES (insn)); + } + + if (frame_pointer_needed) + EMIT_PL (emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx)); + + if (flag_pic && f->cprestore_size) + { + if (frame_pointer_needed) + emit_insn (gen_cprestore_use_fp_score7 (GEN_INT (size - f->cprestore_size))); + else + emit_insn (gen_cprestore_use_sp_score7 (GEN_INT (size - f->cprestore_size))); + } + +#undef EMIT_PL +} + +/* Generate the epilogue instructions in a S+core function. */ +void +score7_epilogue (int sibcall_p) +{ + struct score7_frame_info *f = score7_compute_frame_size (get_frame_size ()); + HOST_WIDE_INT size; + int regno; + rtx base; + + size = f->total_size - f->gp_reg_size; + + if (!frame_pointer_needed) + base = stack_pointer_rtx; + else + base = hard_frame_pointer_rtx; + + if (size) + { + if (CONST_OK_FOR_LETTER_P (size, 'L')) + emit_insn (gen_add3_insn (base, base, GEN_INT (size))); + else + { + emit_move_insn (gen_rtx_REG (Pmode, SCORE7_EPILOGUE_TEMP_REGNUM), + GEN_INT (size)); + emit_insn (gen_add3_insn (base, base, + gen_rtx_REG (Pmode, + SCORE7_EPILOGUE_TEMP_REGNUM))); + } + } + + if (base != stack_pointer_rtx) + emit_move_insn (stack_pointer_rtx, base); + + if (current_function_calls_eh_return) + emit_insn (gen_add3_insn (stack_pointer_rtx, + stack_pointer_rtx, + EH_RETURN_STACKADJ_RTX)); + + for (regno = (int) GP_REG_FIRST; regno <= (int) GP_REG_LAST; regno++) + { + if (BITSET_P (f->mask, regno - GP_REG_FIRST)) + { + rtx mem = gen_rtx_MEM (SImode, + gen_rtx_POST_INC (SImode, stack_pointer_rtx)); + rtx reg = gen_rtx_REG (SImode, regno); + + if (!current_function_calls_eh_return) + MEM_READONLY_P (mem) = 1; + + emit_insn (gen_popsi_score7 (reg, mem)); + } + } + + if (!sibcall_p) + emit_jump_insn (gen_return_internal_score7 (gen_rtx_REG (Pmode, RA_REGNUM))); +} + +void +score7_gen_cmp (enum machine_mode mode) +{ + emit_insn (gen_rtx_SET (VOIDmode, gen_rtx_REG (mode, CC_REGNUM), + gen_rtx_COMPARE (mode, cmp_op0, cmp_op1))); +} + +/* Return true if X is a symbolic constant that can be calculated in + the same way as a bare symbol. If it is, store the type of the + symbol in *SYMBOL_TYPE. */ +int +score7_symbolic_constant_p (rtx x, enum score_symbol_type *symbol_type) +{ + HOST_WIDE_INT offset; + + score7_split_const (x, &x, &offset); + if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF) + *symbol_type = score7_classify_symbol (x); + else + return 0; + + if (offset == 0) + return 1; + + /* if offset > 15bit, must reload */ + if (!IMM_IN_RANGE (offset, 15, 1)) + return 0; + + switch (*symbol_type) + { + case SYMBOL_GENERAL: + return 1; + case SYMBOL_SMALL_DATA: + return score7_offset_within_object_p (x, offset); + } + gcc_unreachable (); +} + +void +score7_movsicc (rtx *ops) +{ + enum machine_mode mode; + + mode = score7_select_cc_mode (GET_CODE (ops[1]), ops[2], ops[3]); + emit_insn (gen_rtx_SET (VOIDmode, gen_rtx_REG (mode, CC_REGNUM), + gen_rtx_COMPARE (mode, cmp_op0, cmp_op1))); +} + +/* Call and sibcall pattern all need call this function. */ +void +score7_call (rtx *ops, bool sib) +{ + rtx addr = XEXP (ops[0], 0); + if (!call_insn_operand (addr, VOIDmode)) + { + rtx oaddr = addr; + addr = gen_reg_rtx (Pmode); + gen_move_insn (addr, oaddr); + } + + if (sib) + emit_call_insn (gen_sibcall_internal_score7 (addr, ops[1])); + else + emit_call_insn (gen_call_internal_score7 (addr, ops[1])); +} + +/* Call value and sibcall value pattern all need call this function. */ +void +score7_call_value (rtx *ops, bool sib) +{ + rtx result = ops[0]; + rtx addr = XEXP (ops[1], 0); + rtx arg = ops[2]; + + if (!call_insn_operand (addr, VOIDmode)) + { + rtx oaddr = addr; + addr = gen_reg_rtx (Pmode); + gen_move_insn (addr, oaddr); + } + + if (sib) + emit_call_insn (gen_sibcall_value_internal_score7 (result, addr, arg)); + else + emit_call_insn (gen_call_value_internal_score7 (result, addr, arg)); +} + +/* Machine Split */ +void +score7_movdi (rtx *ops) +{ + rtx dst = ops[0]; + rtx src = ops[1]; + rtx dst0 = score7_subw (dst, 0); + rtx dst1 = score7_subw (dst, 1); + rtx src0 = score7_subw (src, 0); + rtx src1 = score7_subw (src, 1); + + if (GET_CODE (dst0) == REG && reg_overlap_mentioned_p (dst0, src)) + { + emit_move_insn (dst1, src1); + emit_move_insn (dst0, src0); + } + else + { + emit_move_insn (dst0, src0); + emit_move_insn (dst1, src1); + } +} + +void +score7_zero_extract_andi (rtx *ops) +{ + if (INTVAL (ops[1]) == 1 && const_uimm5 (ops[2], SImode)) + emit_insn (gen_zero_extract_bittst_score7 (ops[0], ops[2])); + else + { + unsigned HOST_WIDE_INT mask; + mask = (0xffffffffU & ((1U << INTVAL (ops[1])) - 1U)); + mask = mask << INTVAL (ops[2]); + emit_insn (gen_andsi3_cmp_score7 (ops[3], ops[0], + gen_int_mode (mask, SImode))); + } +} + +/* Check addr could be present as PRE/POST mode. */ +static bool +score7_pindex_mem (rtx addr) +{ + if (GET_CODE (addr) == MEM) + { + switch (GET_CODE (XEXP (addr, 0))) + { + case PRE_DEC: + case POST_DEC: + case PRE_INC: + case POST_INC: + return true; + default: + break; + } + } + return false; +} + +/* Output asm code for ld/sw insn. */ +static int +score7_pr_addr_post (rtx *ops, int idata, int iaddr, char *ip, enum score_mem_unit unit) +{ + struct score7_address_info ai; + + gcc_assert (GET_CODE (ops[idata]) == REG); + gcc_assert (score7_classify_address (&ai, SImode, XEXP (ops[iaddr], 0), true)); + + if (!score7_pindex_mem (ops[iaddr]) + && ai.type == SCORE7_ADD_REG + && GET_CODE (ai.offset) == CONST_INT + && G16_REG_P (REGNO (ops[idata])) + && G16_REG_P (REGNO (ai.reg))) + { + if (INTVAL (ai.offset) == 0) + { + ops[iaddr] = ai.reg; + return snprintf (ip, INS_BUF_SZ, + "!\t%%%d, [%%%d]", idata, iaddr); + } + if (REGNO (ai.reg) == HARD_FRAME_POINTER_REGNUM) + { + HOST_WIDE_INT offset = INTVAL (ai.offset); + if (SCORE_ALIGN_UNIT (offset, unit) + && CONST_OK_FOR_LETTER_P (offset >> unit, 'J')) + { + ops[iaddr] = ai.offset; + return snprintf (ip, INS_BUF_SZ, + "p!\t%%%d, %%c%d", idata, iaddr); + } + } + } + return snprintf (ip, INS_BUF_SZ, "\t%%%d, %%a%d", idata, iaddr); +} + +/* Output asm insn for load. */ +const char * +score7_linsn (rtx *ops, enum score_mem_unit unit, bool sign) +{ + const char *pre_ins[] = + {"lbu", "lhu", "lw", "??", "lb", "lh", "lw", "??"}; + char *ip; + + strcpy (score7_ins, pre_ins[(sign ? 4 : 0) + unit]); + ip = score7_ins + strlen (score7_ins); + + if ((!sign && unit != SCORE_HWORD) + || (sign && unit != SCORE_BYTE)) + score7_pr_addr_post (ops, 0, 1, ip, unit); + else + snprintf (ip, INS_BUF_SZ, "\t%%0, %%a1"); + + return score7_ins; +} + +/* Output asm insn for store. */ +const char * +score7_sinsn (rtx *ops, enum score_mem_unit unit) +{ + const char *pre_ins[] = {"sb", "sh", "sw"}; + char *ip; + + strcpy (score7_ins, pre_ins[unit]); + ip = score7_ins + strlen (score7_ins); + score7_pr_addr_post (ops, 1, 0, ip, unit); + return score7_ins; +} + +/* Output asm insn for load immediate. */ +const char * +score7_limm (rtx *ops) +{ + HOST_WIDE_INT v; + + gcc_assert (GET_CODE (ops[0]) == REG); + gcc_assert (GET_CODE (ops[1]) == CONST_INT); + + v = INTVAL (ops[1]); + if (G16_REG_P (REGNO (ops[0])) && IMM_IN_RANGE (v, 8, 0)) + return "ldiu!\t%0, %c1"; + else if (IMM_IN_RANGE (v, 16, 1)) + return "ldi\t%0, %c1"; + else if ((v & 0xffff) == 0) + return "ldis\t%0, %U1"; + else + return "li\t%0, %c1"; +} + +/* Output asm insn for move. */ +const char * +score7_move (rtx *ops) +{ + gcc_assert (GET_CODE (ops[0]) == REG); + gcc_assert (GET_CODE (ops[1]) == REG); + + if (G16_REG_P (REGNO (ops[0]))) + { + if (G16_REG_P (REGNO (ops[1]))) + return "mv!\t%0, %1"; + else + return "mlfh!\t%0, %1"; + } + else if (G16_REG_P (REGNO (ops[1]))) + return "mhfl!\t%0, %1"; + else + return "mv\t%0, %1"; +} + +/* Generate add insn. */ +const char * +score7_select_add_imm (rtx *ops, bool set_cc) +{ + HOST_WIDE_INT v = INTVAL (ops[2]); + + gcc_assert (GET_CODE (ops[2]) == CONST_INT); + gcc_assert (REGNO (ops[0]) == REGNO (ops[1])); + + if (set_cc && G16_REG_P (REGNO (ops[0]))) + { + if (v > 0 && IMM_IS_POW_OF_2 ((unsigned HOST_WIDE_INT) v, 0, 15)) + { + ops[2] = GEN_INT (ffs (v) - 1); + return "addei!\t%0, %c2"; + } + + if (v < 0 && IMM_IS_POW_OF_2 ((unsigned HOST_WIDE_INT) (-v), 0, 15)) + { + ops[2] = GEN_INT (ffs (-v) - 1); + return "subei!\t%0, %c2"; + } + } + + if (set_cc) + return "addi.c\t%0, %c2"; + else + return "addi\t%0, %c2"; +} + +/* Output arith insn. */ +const char * +score7_select (rtx *ops, const char *inst_pre, + bool commu, const char *letter, bool set_cc) +{ + gcc_assert (GET_CODE (ops[0]) == REG); + gcc_assert (GET_CODE (ops[1]) == REG); + + if (set_cc && G16_REG_P (REGNO (ops[0])) + && (GET_CODE (ops[2]) == REG ? G16_REG_P (REGNO (ops[2])) : 1) + && REGNO (ops[0]) == REGNO (ops[1])) + { + snprintf (score7_ins, INS_BUF_SZ, "%s!\t%%0, %%%s2", inst_pre, letter); + return score7_ins; + } + + if (commu && set_cc && G16_REG_P (REGNO (ops[0])) + && G16_REG_P (REGNO (ops[1])) + && REGNO (ops[0]) == REGNO (ops[2])) + { + gcc_assert (GET_CODE (ops[2]) == REG); + snprintf (score7_ins, INS_BUF_SZ, "%s!\t%%0, %%%s1", inst_pre, letter); + return score7_ins; + } + + if (set_cc) + snprintf (score7_ins, INS_BUF_SZ, "%s.c\t%%0, %%1, %%%s2", inst_pre, letter); + else + snprintf (score7_ins, INS_BUF_SZ, "%s\t%%0, %%1, %%%s2", inst_pre, letter); + return score7_ins; +} + diff -Nru gcc/config/score/score7.h gcc/config/score/score7.h --- gcc/config/score/score7.h 1970-01-01 01:00:00.000000000 +0100 +++ gcc/config/score/score7.h 2012-12-31 17:06:04.000000000 +0100 @@ -0,0 +1,157 @@ +/* score7.h for Sunplus S+CORE processor + Copyright (C) 2005, 2007 Free Software Foundation, Inc. + Contributed by Sunnorth + + This file is part of GCC. + + GCC is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published + by the Free Software Foundation; either version 3, or (at your + option) any later version. + + GCC is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public + License for more details. + + You should have received a copy of the GNU General Public License + along with GCC; see the file COPYING3. If not see + . */ + +#ifndef GCC_SCORE7_H +#define GCC_SCORE7_H + +enum score7_address_type +{ + SCORE7_ADD_REG, + SCORE7_ADD_CONST_INT, + SCORE7_ADD_SYMBOLIC +}; + +struct score7_frame_info +{ + HOST_WIDE_INT total_size; /* bytes that the entire frame takes up */ + HOST_WIDE_INT var_size; /* bytes that variables take up */ + HOST_WIDE_INT args_size; /* bytes that outgoing arguments take up */ + HOST_WIDE_INT gp_reg_size; /* bytes needed to store gp regs */ + HOST_WIDE_INT gp_sp_offset; /* offset from new sp to store gp registers */ + HOST_WIDE_INT cprestore_size; /* # bytes that the .cprestore slot takes up */ + unsigned int mask; /* mask of saved gp registers */ + int num_gp; /* number of gp registers saved */ +}; + +struct score7_arg_info +{ + unsigned int num_bytes; /* The argument's size in bytes */ + unsigned int reg_words; /* The number of words passed in registers */ + unsigned int reg_offset; /* The offset of the first register from */ + /* GP_ARG_FIRST or FP_ARG_FIRST etc */ + unsigned int stack_words; /* The number of words that must be passed */ + /* on the stack */ + unsigned int stack_offset; /* The offset from the start of the stack */ + /* overflow area */ +}; + +#ifdef RTX_CODE +struct score7_address_info +{ + enum score7_address_type type; + rtx reg; + rtx offset; + enum rtx_code code; + enum score_symbol_type symbol_type; +}; +#endif + +#define SCORE7_SDATA_MAX score7_sdata_max +#define SCORE7_STACK_ALIGN(LOC) (((LOC) + 3) & ~3) +#define SCORE7_PROLOGUE_TEMP_REGNUM (GP_REG_FIRST + 8) +#define SCORE7_EPILOGUE_TEMP_REGNUM (GP_REG_FIRST + 8) +#define SCORE7_DEFAULT_SDATA_MAX 8 + +extern int score7_symbolic_constant_p (rtx x, + enum score_symbol_type *symbol_type); +extern bool score7_return_in_memory (tree type, + tree fndecl ATTRIBUTE_UNUSED); +extern void score7_output_mi_thunk (FILE *file, + tree thunk_fndecl ATTRIBUTE_UNUSED, + HOST_WIDE_INT delta, + HOST_WIDE_INT vcall_offset, + tree function); +extern int score7_legitimize_address (rtx *xloc); +extern void +score7_function_prologue (FILE *file, + HOST_WIDE_INT size ATTRIBUTE_UNUSED); +extern void +score7_function_epilogue (FILE *file, + HOST_WIDE_INT size ATTRIBUTE_UNUSED); +extern section *score7_select_rtx_section (enum machine_mode mode, rtx x, + unsigned HOST_WIDE_INT align); +extern bool score7_in_small_data_p (tree decl); +extern void score7_asm_file_start (void); +extern void score7_asm_file_end (void); +extern void score7_override_options (void); +extern int score7_reg_class (int regno); +extern enum reg_class score7_preferred_reload_class (rtx x ATTRIBUTE_UNUSED, + enum reg_class class); +extern enum +reg_class score7_secondary_reload_class (enum reg_class class, + enum machine_mode mode ATTRIBUTE_UNUSED, + rtx x); +extern int score7_const_ok_for_letter_p (HOST_WIDE_INT value, char c); +extern int score7_extra_constraint (rtx op, char c); +extern int score7_hard_regno_mode_ok (unsigned int regno, + enum machine_mode mode); +extern HOST_WIDE_INT +score7_initial_elimination_offset (int from, + int to ATTRIBUTE_UNUSED); +extern void score7_function_arg_advance (CUMULATIVE_ARGS *cum, + enum machine_mode mode, + tree type, + int named); +extern int score7_arg_partial_bytes (CUMULATIVE_ARGS *cum, + enum machine_mode mode, + tree type, + bool named); +extern rtx score7_function_arg (const CUMULATIVE_ARGS *cum, + enum machine_mode mode, + tree type, + int named); +extern rtx score7_function_value (tree valtype, + tree func ATTRIBUTE_UNUSED, + enum machine_mode mode); +extern void score7_initialize_trampoline (rtx ADDR, rtx FUNC, rtx CHAIN); +extern int score7_regno_mode_ok_for_base_p (int regno, int strict); +extern int score7_address_p (enum machine_mode mode, rtx x, int strict); +extern int score7_register_move_cost (enum machine_mode mode ATTRIBUTE_UNUSED, + enum reg_class from, + enum reg_class to); +extern bool score7_rtx_costs (rtx x, int code, int outer_code, int *total); +extern int score7_address_cost (rtx addr); +extern int score7_output_external (FILE *file ATTRIBUTE_UNUSED, + tree decl, + const char *name); +extern rtx score7_return_addr (int count, rtx frame ATTRIBUTE_UNUSED); +extern void score7_print_operand (FILE *file, rtx op, int c); +extern void score7_print_operand_address (FILE *file, rtx x); +extern enum machine_mode score7_select_cc_mode (enum rtx_code op, + rtx x, + rtx y); +extern void score7_prologue (void); +extern void score7_epilogue (int sibcall_p); +extern void score7_gen_cmp (enum machine_mode mode); +extern void score7_call (rtx *ops, bool sib); +extern void score7_call_value (rtx *ops, bool sib); +extern void score7_movsicc (rtx *ops); +extern void score7_movdi (rtx *ops); +extern void score7_zero_extract_andi (rtx *ops); +extern const char * score7_select_add_imm (rtx *ops, bool set_cc); +extern const char * score7_select (rtx *ops, const char *inst_pre, bool commu, + const char *letter, bool set_cc); +extern const char * score7_move (rtx *ops); +extern const char * score7_limm (rtx *ops); +extern const char * +score7_linsn (rtx *ops, enum score_mem_unit unit, bool sign); +extern const char * +score7_sinsn (rtx *ops, enum score_mem_unit unit); +#endif diff -Nru gcc/config/soft-fp/t-softfp gcc/config/soft-fp/t-softfp --- gcc/config/soft-fp/t-softfp 2010-10-14 22:27:52.000000000 +0200 +++ gcc/config/soft-fp/t-softfp 2012-12-31 17:06:04.000000000 +0100 @@ -1,10 +1,10 @@ -# Copyright (C) 2006 Free Software Foundation, Inc. +# Copyright (C) 2006, 2007 Free Software Foundation, Inc. # This file is part of GCC. # GCC is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) +# the Free Software Foundation; either version 3, or (at your option) # any later version. # GCC is distributed in the hope that it will be useful, @@ -13,9 +13,8 @@ # GNU General Public License for more details. # You should have received a copy of the GNU General Public License -# along with GCC; see the file COPYING. If not, write to -# the Free Software Foundation, 51 Franklin Street, Fifth Floor, -# Boston MA 02110-1301, USA. +# along with GCC; see the file COPYING3. If not see +# . # Targets using soft-fp should define the following variables: # diff -Nru gcc/config/sol2-10.h gcc/config/sol2-10.h --- gcc/config/sol2-10.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/sol2-10.h 2012-12-31 17:06:04.000000000 +0100 @@ -1,12 +1,12 @@ /* Operating system specific defines to be used when targeting GCC for any Solaris 2 system starting from Solaris 10. - Copyright 2006 Free Software Foundation, Inc. + Copyright 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Solaris 10 has the float and long double forms of math functions. */ #undef TARGET_C99_FUNCTIONS diff -Nru gcc/config/sol2-6.h gcc/config/sol2-6.h --- gcc/config/sol2-6.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/sol2-6.h 2012-12-31 17:06:04.000000000 +0100 @@ -1,12 +1,12 @@ /* Operating system specific defines to be used when targeting GCC for any Solaris 2 system up to Solaris 2.6. - Copyright 2004 Free Software Foundation, Inc. + Copyright 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #undef CPP_SUBTARGET_SPEC #define CPP_SUBTARGET_SPEC "\ diff -Nru gcc/config/sol2-c.c gcc/config/sol2-c.c --- gcc/config/sol2-c.c 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/sol2-c.c 2012-12-31 17:06:04.000000000 +0100 @@ -1,12 +1,12 @@ /* Solaris support needed only by C/C++ frontends. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 , 2007 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/config/sol2-protos.h gcc/config/sol2-protos.h --- gcc/config/sol2-protos.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/sol2-protos.h 2012-12-31 17:06:04.000000000 +0100 @@ -1,12 +1,12 @@ /* Operating system specific prototypes to be used when targeting GCC for any Solaris 2 system. - Copyright 2004 Free Software Foundation, Inc. + Copyright 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ extern void solaris_insert_attributes (tree, tree *); extern void solaris_register_pragmas (void); diff -Nru gcc/config/sol2.c gcc/config/sol2.c --- gcc/config/sol2.c 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/sol2.c 2012-12-31 17:06:04.000000000 +0100 @@ -1,12 +1,12 @@ /* General Solaris system support. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005 , 2007 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/config/sol2.h gcc/config/sol2.h --- gcc/config/sol2.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/sol2.h 2012-12-31 17:06:04.000000000 +0100 @@ -1,12 +1,12 @@ /* Operating system specific defines to be used when targeting GCC for any Solaris 2 system. - Copyright 2002, 2003, 2004 Free Software Foundation, Inc. + Copyright 2002, 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* We use stabs-in-elf for debugging, because that is what the native toolchain uses. */ diff -Nru gcc/config/svr3.h gcc/config/svr3.h --- gcc/config/svr3.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/svr3.h 2012-12-31 17:06:04.000000000 +0100 @@ -1,13 +1,13 @@ /* Operating system specific defines to be used when targeting GCC for generic System V Release 3 system. - Copyright (C) 1991, 1996, 2000, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 1991, 1996, 2000, 2002, 2004, 2007 Free Software Foundation, Inc. Contributed by Ron Guilmette (rfg@monkeys.com). This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Define a symbol indicating that we are using svr3.h. */ #define USING_SVR3_H diff -Nru gcc/config/svr4.h gcc/config/svr4.h --- gcc/config/svr4.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/svr4.h 2012-12-31 17:06:04.000000000 +0100 @@ -1,14 +1,14 @@ /* Operating system specific defines to be used when targeting GCC for some generic System V Release 4 system. Copyright (C) 1991, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001 Free Software Foundation, Inc. + 2000, 2001, 2007 Free Software Foundation, Inc. Contributed by Ron Guilmette (rfg@monkeys.com). This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -17,9 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. +along with GCC; see the file COPYING3. If not see +. To use this file, make up a line like that in config.gcc: diff -Nru gcc/config/t-freebsd gcc/config/t-freebsd --- gcc/config/t-freebsd 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/t-freebsd 2012-12-31 17:06:04.000000000 +0100 @@ -1,5 +1,5 @@ # Compile crtbeginS.o and crtendS.o with pic. -CRTSTUFF_T_CFLAGS_S = -fPIC +CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC # Compile libgcc.a with pic. TARGET_LIBGCC2_CFLAGS += -fPIC diff -Nru gcc/config/t-libc-ok gcc/config/t-libc-ok --- gcc/config/t-libc-ok 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/t-libc-ok 2012-12-31 17:06:04.000000000 +0100 @@ -1 +1 @@ -CRTSTUFF_T_CFLAGS_S=-fPIC +CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC diff -Nru gcc/config/t-lynx gcc/config/t-lynx --- gcc/config/t-lynx 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/t-lynx 2012-12-31 17:06:04.000000000 +0100 @@ -1,5 +1,5 @@ # Compile crtbeginS.o and crtendS.o with pic. -CRTSTUFF_T_CFLAGS_S = -fPIC +CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC # Compile libgcc2.a with pic. TARGET_LIBGCC2_CFLAGS = -fPIC diff -Nru gcc/config/t-netbsd gcc/config/t-netbsd --- gcc/config/t-netbsd 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/t-netbsd 2012-12-31 17:06:04.000000000 +0100 @@ -1,2 +1,2 @@ # Always build crtstuff with PIC. -CRTSTUFF_T_CFLAGS = -fPIC +CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC diff -Nru gcc/config/t-svr4 gcc/config/t-svr4 --- gcc/config/t-svr4 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/t-svr4 2012-12-31 17:06:04.000000000 +0100 @@ -4,7 +4,7 @@ # we will be doing that, we just always use -fPIC when compiling the # routines in crtstuff.c. Likewise for libgcc2.c. -CRTSTUFF_T_CFLAGS = -fPIC +CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC TARGET_LIBGCC2_CFLAGS = -fPIC # See all the declarations. diff -Nru gcc/config/usegas.h gcc/config/usegas.h --- gcc/config/usegas.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/usegas.h 2012-12-31 17:06:04.000000000 +0100 @@ -1,10 +1,10 @@ -/* Copyright (C) 2001 Free Software Foundation, Inc. +/* Copyright (C) 2001, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -13,9 +13,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to - the Free Software Foundation, 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with GCC; see the file COPYING3. If not see + . */ /* Just set a single flag we can test for it inside other files. */ #define USE_GAS 1 diff -Nru gcc/config/vx-common.h gcc/config/vx-common.h --- gcc/config/vx-common.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/vx-common.h 2012-12-31 17:06:04.000000000 +0100 @@ -1,12 +1,12 @@ /* Target-independent configuration for VxWorks and VxWorks AE. - Copyright (C) 2005 Free Software Foundation, Inc. + Copyright (C) 2005, 2007 Free Software Foundation, Inc. Contributed by by CodeSourcery, LLC. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* VxWorks headers are C++-aware. */ #undef NO_IMPLICIT_EXTERN_C diff -Nru gcc/config/vxworks.h gcc/config/vxworks.h --- gcc/config/vxworks.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/vxworks.h 2012-12-31 17:06:04.000000000 +0100 @@ -1,5 +1,5 @@ /* Common VxWorks target definitions for GNU compiler. - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Wind River Systems. Rewritten by CodeSourcery, LLC. @@ -8,7 +8,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -17,9 +17,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* In kernel mode, VxWorks provides all the libraries itself, as well as the functionality of startup files, etc. In RTP mode, it behaves more diff -Nru gcc/config/vxworks.opt gcc/config/vxworks.opt --- gcc/config/vxworks.opt 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/vxworks.opt 2012-12-31 17:06:04.000000000 +0100 @@ -1,13 +1,13 @@ ; Processor-independent options for VxWorks. ; -; Copyright (C) 2005 Free Software Foundation, Inc. +; Copyright (C) 2005, 2007 Free Software Foundation, Inc. ; Contributed by CodeSourcery, LLC. ; ; This file is part of GCC. ; ; GCC is free software; you can redistribute it and/or modify it under ; the terms of the GNU General Public License as published by the Free -; Software Foundation; either version 2, or (at your option) any later +; Software Foundation; either version 3, or (at your option) any later ; version. ; ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -16,9 +16,8 @@ ; for more details. ; ; You should have received a copy of the GNU General Public License -; along with GCC; see the file COPYING. If not, write to the Free -; Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -; 02110-1301, USA. +; along with GCC; see the file COPYING3. If not see +; . mrtp Target Report RejectNegative Mask(VXWORKS_RTP) Condition(VXWORKS_KIND == VXWORKS_KIND_NORMAL) diff -Nru gcc/config/vxworksae.h gcc/config/vxworksae.h --- gcc/config/vxworksae.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/vxworksae.h 2012-12-31 17:06:04.000000000 +0100 @@ -1,12 +1,12 @@ /* Common VxWorks AE target definitions for GNU compiler. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This header should be included after including vx-common.h. */ diff -Nru gcc/config/windiss.h gcc/config/windiss.h --- gcc/config/windiss.h 2010-10-14 22:27:53.000000000 +0200 +++ gcc/config/windiss.h 2012-12-31 17:06:04.000000000 +0100 @@ -1,12 +1,12 @@ /* Support for GCC using WindISS simulator. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003, 2007 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* windiss uses wchar_t == unsigned short (UCS2) on all architectures. */ diff -Nru gcc/config.build gcc/config.build --- gcc/config.build 2010-10-14 22:27:55.000000000 +0200 +++ gcc/config.build 2012-12-31 17:06:04.000000000 +0100 @@ -1,12 +1,12 @@ # GCC build-specific configuration file. -# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003 +# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2007, 2008 # Free Software Foundation, Inc. #This file is part of GCC. #GCC is free software; you can redistribute it and/or modify it under #the terms of the GNU General Public License as published by the Free -#Software Foundation; either version 2, or (at your option) any later +#Software Foundation; either version 3, or (at your option) any later #version. #GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ #for more details. #You should have received a copy of the GNU General Public License -#along with GCC; see the file COPYING. If not, write to the Free -#Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -#02110-1301, USA. +#along with GCC; see the file COPYING3. If not see +#. # This is the GCC build-specific configuration file # where a configuration type is mapped to different system-specific @@ -48,6 +47,7 @@ build_xm_defines= build_exeext= build_install_headers_dir=install-headers-tar +build_file_translate= # System-specific settings. case $build in @@ -80,6 +80,11 @@ i[34567]86-*-mingw32*) build_xm_file=i386/xm-mingw32.h build_exeext=.exe + t=`(CMD //c echo /c) 2>/dev/null` + case $t in ?:*) + build_file_translate="CMD //c" + ;; + esac ;; i[34567]86-pc-msdosdjgpp*) build_xm_file=i386/xm-djgpp.h diff -Nru gcc/config.gcc gcc/config.gcc --- gcc/config.gcc 2010-10-14 22:27:55.000000000 +0200 +++ gcc/config.gcc 2013-01-01 12:38:24.000000000 +0100 @@ -1,12 +1,12 @@ # GCC target-specific configuration file. -# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 # Free Software Foundation, Inc. #This file is part of GCC. #GCC is free software; you can redistribute it and/or modify it under #the terms of the GNU General Public License as published by the Free -#Software Foundation; either version 2, or (at your option) any later +#Software Foundation; either version 3, or (at your option) any later #version. #GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ #for more details. #You should have received a copy of the GNU General Public License -#along with GCC; see the file COPYING. If not, write to the Free -#Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -#02110-1301, USA. +#along with GCC; see the file COPYING3. If not see +#. # This is the GCC target-specific configuration file # where a configuration type is mapped to different system-specific @@ -445,6 +444,10 @@ tm_defines="${tm_defines} FBSD_MAJOR=8" ;; *-*-freebsd9 | *-*-freebsd[9].*) tm_defines="${tm_defines} FBSD_MAJOR=9" ;; + *-*-freebsd10 | *-*-freebsd10.*) + tm_defines="${tm_defines} FBSD_MAJOR=10" ;; + *-*-freebsd11 | *-*-freebsd11.*) + tm_defines="${tm_defines} FBSD_MAJOR=11" ;; *) echo 'Please update *-*-freebsd* in gcc/config.gcc' exit 1 @@ -1090,6 +1093,7 @@ ;; x86_64-*-freebsd*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h ${fbsd_tm_file} i386/x86-64.h i386/freebsd.h i386/freebsd64.h" + tmake_file="${tmake_file} i386/t-crtstuff" ;; i[34567]86-*-netbsdelf*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h" @@ -1102,6 +1106,7 @@ ;; x86_64-*-netbsd*) tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/x86-64.h i386/netbsd64.h" + tmake_file="${tmake_file} i386/t-crtstuff" ;; i[34567]86-*-openbsd2.*|i[34567]86-*openbsd3.[0123]) tm_file="i386/i386.h i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h openbsd-oldgas.h openbsd.h i386/openbsd.h" @@ -1137,7 +1142,7 @@ x86_64-*-kfreebsd*-gnu) tm_file="${tm_file} kfreebsd-gnu.h" ;; x86_64-*-knetbsd*-gnu) tm_file="${tm_file} knetbsd-gnu.h" ;; esac - tmake_file="${tmake_file} i386/t-linux64 i386/t-crtfm t-dfprules" + tmake_file="${tmake_file} i386/t-linux64 i386/t-crtstuff i386/t-crtfm t-dfprules" ;; i[34567]86-*-gnu*) ;; @@ -1234,7 +1239,7 @@ *-*-solaris2.1[0-9]*) tm_file="${tm_file} i386/x86-64.h i386/sol2-10.h" tm_defines="${tm_defines} TARGET_BI_ARCH=1" - tmake_file="$tmake_file i386/t-sol2-10" + tmake_file="$tmake_file i386/t-crtstuff i386/t-sol2-10" need_64bit_hwint=yes # FIXME: -m64 for i[34567]86-*-* should be allowed just # like -m32 for x86_64-*-*. @@ -1965,7 +1970,7 @@ thread_file='aix' extra_headers= ;; -rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*) +rs6000-ibm-aix5.[23].* | powerpc-ibm-aix5.[23].*) tm_file="${tm_file} rs6000/aix.h rs6000/aix52.h rs6000/xcoff.h" tmake_file=rs6000/t-aix52 extra_options="${extra_options} rs6000/aix64.opt" @@ -1973,6 +1978,14 @@ thread_file='aix' extra_headers= ;; +rs6000-ibm-aix[56789].* | powerpc-ibm-aix[56789].*) + tm_file="${tm_file} rs6000/aix.h rs6000/aix61.h rs6000/xcoff.h" + tmake_file=rs6000/t-aix52 + extra_options="${extra_options} rs6000/aix64.opt" + use_collect2=yes + thread_file='aix' + extra_headers= + ;; s390-*-linux*) tm_file="s390/s390.h dbxelf.h elfos.h svr4.h linux.h s390/linux.h" tmake_file="${tmake_file} t-dfprules s390/t-crtstuff s390/t-linux" @@ -1999,7 +2012,7 @@ score-*-elf) tm_file="dbxelf.h elfos.h score/elf.h score/score.h" tmake_file=score/t-score-elf - extra_objs="score-mdaux.o" + extra_objs="score7.o score3.o" ;; sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \ sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \ diff -Nru gcc/config.host gcc/config.host --- gcc/config.host 2010-10-14 22:27:55.000000000 +0200 +++ gcc/config.host 2012-12-31 17:06:04.000000000 +0100 @@ -1,12 +1,12 @@ # GCC host-specific configuration file. -# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006 +# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2006, 2007 # Free Software Foundation, Inc. #This file is part of GCC. #GCC is free software; you can redistribute it and/or modify it under #the terms of the GNU General Public License as published by the Free -#Software Foundation; either version 2, or (at your option) any later +#Software Foundation; either version 3, or (at your option) any later #version. #GCC is distributed in the hope that it will be useful, but WITHOUT @@ -15,9 +15,8 @@ #for more details. #You should have received a copy of the GNU General Public License -#along with GCC; see the file COPYING. If not, write to the Free -#Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -#02110-1301, USA. +#along with GCC; see the file COPYING3. If not see +#. # This is the GCC host-specific configuration file # where a configuration type is mapped to different system-specific diff -Nru gcc/configure gcc/configure --- gcc/configure 2010-10-14 22:27:54.000000000 +0200 +++ gcc/configure 2012-12-31 17:06:04.000000000 +0100 @@ -309,7 +309,7 @@ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP strict1_warn cxx_compat_warn warn_cflags WERROR nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR stage1_cflags COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT host_cc_for_libada CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir objdir subdirs srcdir all_boot_languages all_compilers all_gtfiles all_gtfiles_files_langs all_gtfiles_files_files all_lang_makefrags all_lang_makefiles all_languages all_selected_languages all_stagestuff build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines check_languages cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os target_noncanonical build_libsubdir build_subdir host_subdir target_subdir GENINSRC CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT NO_MINUS_C_MINUS_O OUTPUT_OPTION CPP EGREP strict1_warn cxx_compat_warn warn_cflags WERROR nocommon_flag TREEBROWSER valgrind_path valgrind_path_defines valgrind_command coverage_flags enable_multilib enable_decimal_float enable_shared TARGET_SYSTEM_ROOT TARGET_SYSTEM_ROOT_DEFINE CROSS_SYSTEM_HEADER_DIR onestep datarootdir docdir htmldir SET_MAKE AWK LN_S LN RANLIB ac_ct_RANLIB ranlib_flags INSTALL INSTALL_PROGRAM INSTALL_DATA make_compare_target have_mktemp_command MAKEINFO BUILD_INFO GENERATED_MANPAGES FLEX BISON NM AR stage1_cflags COLLECT2_LIBS GNAT_LIBEXC LDEXP_LIB TARGET_GETGROUPS_T LIBICONV LTLIBICONV LIBICONV_DEP manext objext gthread_flags extra_modes_file extra_opt_files USE_NLS LIBINTL LIBINTL_DEP INCINTL XGETTEXT GMSGFMT POSUB CATALOGS DATADIRNAME INSTOBJEXT GENCAT CATOBJEXT host_cc_for_libada CROSS ALL SYSTEM_HEADER_DIR inhibit_libc CC_FOR_BUILD BUILD_CFLAGS STMP_FIXINC STMP_FIXPROTO collect2 gcc_cv_as ORIGINAL_AS_FOR_TARGET gcc_cv_ld ORIGINAL_LD_FOR_TARGET gcc_cv_nm ORIGINAL_NM_FOR_TARGET gcc_cv_objdump libgcc_visibility GGC zlibdir zlibinc MAINT gcc_tooldir dollar slibdir objdir subdirs srcdir all_boot_languages all_compilers all_gtfiles all_gtfiles_files_langs all_gtfiles_files_files all_lang_makefrags all_lang_makefiles all_languages all_selected_languages all_stagestuff build_exeext build_install_headers_dir build_xm_file_list build_xm_include_list build_xm_defines build_file_translate check_languages cc_set_by_configure quoted_cc_set_by_configure cpp_install_dir xmake_file tmake_file extra_gcc_objs extra_headers_list extra_objs extra_parts extra_passes extra_programs float_h_file gcc_config_arguments gcc_gxx_include_dir host_exeext host_xm_file_list host_xm_include_list host_xm_defines out_host_hook_obj install lang_opt_files lang_specs_files lang_tree_files local_prefix md_file objc_boehm_gc out_file out_object_file stage_prefix_set_by_configure quoted_stage_prefix_set_by_configure thread_file tm_file_list tm_include_list tm_defines tm_p_file_list tm_p_include_list xm_file_list xm_include_list xm_defines c_target_objs cxx_target_objs target_cpu_default GMPLIBS GMPINC LIBOBJS LTLIBOBJS' ac_subst_files='language_hooks' # Initialize some variables set by options. @@ -7807,7 +7807,7 @@ echo "configure:7807: version of makeinfo is $ac_prog_version" >&5 case $ac_prog_version in '') gcc_cv_prog_makeinfo_modern=no;; - 4.[4-9]*) + 4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*) gcc_cv_prog_makeinfo_modern=yes;; *) gcc_cv_prog_makeinfo_modern=no;; esac @@ -12306,13 +12306,35 @@ # Check whether --enable-sjlj-exceptions or --disable-sjlj-exceptions was given. if test "${enable_sjlj_exceptions+set}" = set; then enableval="$enable_sjlj_exceptions" + case $target in + *-*-hpux10*) + if test $enableval != yes; then + { echo "$as_me:$LINENO: WARNING: dwarf2 exceptions not supported, sjlj exceptions forced" >&5 +echo "$as_me: WARNING: dwarf2 exceptions not supported, sjlj exceptions forced" >&2;} + enableval=yes + fi + ;; +esac +force_sjlj_exceptions=yes +else + case $target in + *-*-hpux10*) + force_sjlj_exceptions=yes + enableval=yes + ;; + *) + force_sjlj_exceptions=no + ;; +esac +fi; +if test $force_sjlj_exceptions = yes; then sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi` cat >>confdefs.h <<_ACEOF #define CONFIG_SJLJ_EXCEPTIONS $sjlj _ACEOF -fi; +fi # For platforms with the unwind ABI which includes an unwind library, # libunwind, we can choose to use the system libunwind. @@ -14134,9 +14156,7 @@ ld_ver=`$gcc_cv_ld --version 2>/dev/null | sed 1q` if echo "$ld_ver" | grep GNU > /dev/null; then ld_vers=`echo $ld_ver | sed -n \ - -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \ - -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \ - -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \ + -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*.*\)$,\1,p' \ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ @@ -16785,6 +16805,7 @@ + # Echo link setup. if test x${build} = x${host} ; then if test x${host} = x${target} ; then @@ -17574,6 +17595,7 @@ s,@build_xm_file_list@,$build_xm_file_list,;t t s,@build_xm_include_list@,$build_xm_include_list,;t t s,@build_xm_defines@,$build_xm_defines,;t t +s,@build_file_translate@,$build_file_translate,;t t s,@check_languages@,$check_languages,;t t s,@cc_set_by_configure@,$cc_set_by_configure,;t t s,@quoted_cc_set_by_configure@,$quoted_cc_set_by_configure,;t t diff -Nru gcc/configure.ac gcc/configure.ac --- gcc/configure.ac 2010-10-14 22:27:54.000000000 +0200 +++ gcc/configure.ac 2012-12-31 17:06:04.000000000 +0100 @@ -8,7 +8,7 @@ #GCC is free software; you can redistribute it and/or modify it under #the terms of the GNU General Public License as published by the Free -#Software Foundation; either version 2, or (at your option) any later +#Software Foundation; either version 3, or (at your option) any later #version. #GCC is distributed in the hope that it will be useful, but WITHOUT @@ -17,9 +17,8 @@ #for more details. #You should have received a copy of the GNU General Public License -#along with GCC; see the file COPYING. If not, write to the Free -#Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -#02110-1301, USA. +#along with GCC; see the file COPYING3. If not see +#. # -------------------------------- # Initialization and sanity checks @@ -882,7 +881,7 @@ # that we can use it. gcc_AC_CHECK_PROG_VER(MAKEINFO, makeinfo, --version, [GNU texinfo.* \([0-9][0-9.]*\)], - [4.[4-9]*]) + [4.[4-9]*|4.[1-9][0-9]*|[5-9]*|[1-9][0-9]*]) if test $gcc_cv_prog_makeinfo_modern = no; then MAKEINFO="$MISSING makeinfo" AC_MSG_WARN([ @@ -1217,9 +1216,29 @@ AC_ARG_ENABLE(sjlj-exceptions, [ --enable-sjlj-exceptions arrange to use setjmp/longjmp exception handling], -[sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi` -AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj, - [Define 0/1 to force the choice for exception handling model.])]) +[case $target in + *-*-hpux10*) + if test $enableval != yes; then + AC_MSG_WARN([dwarf2 exceptions not supported, sjlj exceptions forced]) + enableval=yes + fi + ;; +esac +force_sjlj_exceptions=yes], +[case $target in + *-*-hpux10*) + force_sjlj_exceptions=yes + enableval=yes + ;; + *) + force_sjlj_exceptions=no + ;; +esac]) +if test $force_sjlj_exceptions = yes; then + sjlj=`if test $enableval = yes; then echo 1; else echo 0; fi` + AC_DEFINE_UNQUOTED(CONFIG_SJLJ_EXCEPTIONS, $sjlj, + [Define 0/1 to force the choice for exception handling model.]) +fi # For platforms with the unwind ABI which includes an unwind library, # libunwind, we can choose to use the system libunwind. @@ -2111,9 +2130,7 @@ if echo "$ld_ver" | grep GNU > /dev/null; then changequote(,)dnl ld_vers=`echo $ld_ver | sed -n \ - -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \ - -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \ - -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)$,\1,p' \ + -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*.*\)$,\1,p' \ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ -e 's,^.*[ ]\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\)[ ].*$,\1,p' \ @@ -3623,6 +3640,7 @@ AC_SUBST(build_xm_file_list) AC_SUBST(build_xm_include_list) AC_SUBST(build_xm_defines) +AC_SUBST(build_file_translate) AC_SUBST(check_languages) AC_SUBST(cc_set_by_configure) AC_SUBST(quoted_cc_set_by_configure) diff -Nru gcc/conflict.c gcc/conflict.c --- gcc/conflict.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/conflict.c 2012-12-31 17:06:04.000000000 +0100 @@ -1,12 +1,12 @@ /* Register conflict graph computation routines. - Copyright (C) 2000, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2000, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by CodeSourcery, LLC This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* References: diff -Nru gcc/convert.c gcc/convert.c --- gcc/convert.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/convert.c 2012-12-31 17:06:04.000000000 +0100 @@ -1,12 +1,13 @@ /* Utility routines for data type conversion for GCC. Copyright (C) 1987, 1988, 1991, 1992, 1993, 1994, 1995, 1997, 1998, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +16,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* These routines are somewhat language-independent utility function diff -Nru gcc/convert.h gcc/convert.h --- gcc/convert.h 2010-10-14 22:27:55.000000000 +0200 +++ gcc/convert.h 2012-12-31 17:06:04.000000000 +0100 @@ -1,11 +1,11 @@ /* Definition of functions in convert.c. - Copyright (C) 1993, 2000, 2003, 2004 Free Software Foundation, Inc. + Copyright (C) 1993, 2000, 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_CONVERT_H #define GCC_CONVERT_H diff -Nru gcc/coretypes.h gcc/coretypes.h --- gcc/coretypes.h 2010-10-14 22:27:55.000000000 +0200 +++ gcc/coretypes.h 2012-12-31 17:06:04.000000000 +0100 @@ -1,11 +1,11 @@ /* GCC core type declarations. - Copyright (C) 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2002, 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Provide forward declarations of core types which are referred to by most of the compiler. This allows header files to use these types diff -Nru gcc/coverage.c gcc/coverage.c --- gcc/coverage.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/coverage.c 2012-12-31 17:06:04.000000000 +0100 @@ -1,6 +1,6 @@ /* Read and write coverage files, and associated functionality. Copyright (C) 1990, 1991, 1992, 1993, 1994, 1996, 1997, 1998, 1999, - 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. + 2000, 2001, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by James E. Wilson, UC Berkeley/Cygnus Support; based on some ideas from Dain Samples of UC Berkeley. Further mangling by Bob Manson, Cygnus Support. @@ -10,7 +10,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -19,9 +19,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #define GCOV_LINKAGE diff -Nru gcc/coverage.h gcc/coverage.h --- gcc/coverage.h 2010-10-14 22:27:55.000000000 +0200 +++ gcc/coverage.h 2012-12-31 17:06:04.000000000 +0100 @@ -1,12 +1,12 @@ /* coverage.h - Defines data exported from coverage.c - Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005 + Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_COVERAGE_H #define GCC_COVERAGE_H diff -Nru gcc/cp/Make-lang.in gcc/cp/Make-lang.in --- gcc/cp/Make-lang.in 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/Make-lang.in 2013-01-01 13:21:35.000000000 +0100 @@ -1,13 +1,13 @@ # Top level -*- makefile -*- fragment for GNU C++. # Copyright (C) 1994, 1995, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, -# 2005 +# 2005, 2007 # Free Software Foundation, Inc. #This file is part of GCC. #GCC is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by -#the Free Software Foundation; either version 2, or (at your option) +#the Free Software Foundation; either version 3, or (at your option) #any later version. #GCC is distributed in the hope that it will be useful, @@ -15,10 +15,9 @@ #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. -#You should have received a copy of the GNU General Public License -#along with GCC; see the file COPYING. If not, write to -#the Free Software Foundation, 51 Franklin Street, Fifth Floor, -#Boston, MA 02110-1301, USA. +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . # This file provides the language dependent support in the main Makefile. # Each language makefile fragment must provide the following targets: diff -Nru gcc/cp/call.c gcc/cp/call.c --- gcc/cp/call.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/call.c 2013-01-01 13:32:10.000000000 +0100 @@ -1,6 +1,7 @@ /* Functions related to invoking methods and overloaded functions. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) and modified by Brendan Kehoe (brendan@cygnus.com). @@ -8,7 +9,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -17,9 +18,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* High-level class interface. */ @@ -743,19 +743,7 @@ that necessitates this conversion is ill-formed. Therefore, we use DERIVED_FROM_P, and do not check access or uniqueness. */ - && DERIVED_FROM_P (TREE_TYPE (to), TREE_TYPE (from)) - /* If FROM is not yet complete, then we must be parsing - the body of a class. We know what's derived from - what, but we can't actually perform a - derived-to-base conversion. For example, in: - - struct D : public B { - static const int i = sizeof((B*)(D*)0); - }; - - the D*-to-B* conversion is a reinterpret_cast, not a - static_cast. */ - && COMPLETE_TYPE_P (TREE_TYPE (from))) + && DERIVED_FROM_P (TREE_TYPE (to), TREE_TYPE (from))) { /* APPLE LOCAL begin radar 4668465 */ tree fr = c_dialect_objc () ? @@ -1197,7 +1185,12 @@ return conv; } - else if (CLASS_TYPE_P (from) && !(flags & LOOKUP_NO_CONVERSION)) + /* [class.conv.fct] A conversion function is never used to convert a + (possibly cv-qualified) object to the (possibly cv-qualified) same + object type (or a reference to it), to a (possibly cv-qualified) base + class of that type (or a reference to it).... */ + else if (CLASS_TYPE_P (from) && !related_p + && !(flags & LOOKUP_NO_CONVERSION)) { /* [dcl.init.ref] @@ -2594,7 +2587,21 @@ ctors = lookup_fnfields (totype, complete_ctor_identifier, 0); if (IS_AGGR_TYPE (fromtype)) - conv_fns = lookup_conversions (fromtype); + { + tree to_nonref = non_reference (totype); + if (same_type_ignoring_top_level_qualifiers_p (to_nonref, fromtype) || + (CLASS_TYPE_P (to_nonref) && CLASS_TYPE_P (fromtype) + && DERIVED_FROM_P (to_nonref, fromtype))) + { + /* [class.conv.fct] A conversion function is never used to + convert a (possibly cv-qualified) object to the (possibly + cv-qualified) same object type (or a reference to it), to a + (possibly cv-qualified) base class of that type (or a + reference to it)... */ + } + else + conv_fns = lookup_conversions (fromtype); + } candidates = 0; flags |= LOOKUP_NO_CONVERSION; @@ -4764,7 +4771,27 @@ tree convert_for_arg_passing (tree type, tree val) { - val = convert_bitfield_to_declared_type (val); + tree bitfield_type; + + /* If VAL is a bitfield, then -- since it has already been converted + to TYPE -- it cannot have a precision greater than TYPE. + + If it has a smaller precision, we must widen it here. For + example, passing "int f:3;" to a function expecting an "int" will + not result in any conversion before this point. + + If the precision is the same we must not risk widening. For + example, the COMPONENT_REF for a 32-bit "long long" bitfield will + often have type "int", even though the C++ type for the field is + "long long". If the value is being passed to a function + expecting an "int", then no conversions will be required. But, + if we call convert_bitfield_to_declared_type, the bitfield will + be converted to "long long". */ + bitfield_type = is_bitfield_expr_with_lowered_type (val); + if (bitfield_type + && TYPE_PRECISION (TREE_TYPE (val)) < TYPE_PRECISION (type)) + val = convert_to_integer (TYPE_MAIN_VARIANT (bitfield_type), val); + if (val == error_mark_node) ; /* Pass classes with copy ctors by invisible reference. */ diff -Nru gcc/cp/class.c gcc/cp/class.c --- gcc/cp/class.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/class.c 2013-01-01 13:32:10.000000000 +0100 @@ -1,13 +1,14 @@ /* Functions related to building classes and their related objects. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 + Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* High-level class interface. */ @@ -295,6 +295,16 @@ /* Do we need to look in the vtable for the real offset? */ virtual_access = (v_binfo && fixed_type_p <= 0); + /* Don't bother with the calculations inside sizeof; they'll ICE if the + source type is incomplete and the pointer value doesn't matter. */ + if (skip_evaluation) + { + expr = build_nop (build_pointer_type (target_type), expr); + if (!want_pointer) + expr = build_indirect_ref (expr, NULL); + return expr; + } + /* Do we need to check for a null pointer? */ if (want_pointer && !nonnull) { diff -Nru gcc/cp/config-lang.in gcc/cp/config-lang.in --- gcc/cp/config-lang.in 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/config-lang.in 2013-01-01 13:21:35.000000000 +0100 @@ -1,12 +1,12 @@ # Top level configure fragment for GNU C++. -# Copyright (C) 1994, 1995, 1997, 1998, 2000, 2001, 2002 +# Copyright (C) 1994, 1995, 1997, 1998, 2000, 2001, 2002, 2007 # Free Software Foundation, Inc. #This file is part of GCC. #GCC is free software; you can redistribute it and/or modify #it under the terms of the GNU General Public License as published by -#the Free Software Foundation; either version 2, or (at your option) +#the Free Software Foundation; either version 3, or (at your option) #any later version. #GCC is distributed in the hope that it will be useful, @@ -14,10 +14,9 @@ #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the #GNU General Public License for more details. -#You should have received a copy of the GNU General Public License -#along with GCC; see the file COPYING. If not, write to -#the Free Software Foundation, 51 Franklin Street, Fifth Floor, -#Boston, MA 02110-1301, USA. +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . # Configure looks for the existence of this file to auto-config each language. # We define several parameters used by configure: diff -Nru gcc/cp/cp-gimplify.c gcc/cp/cp-gimplify.c --- gcc/cp/cp-gimplify.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/cp-gimplify.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,13 +1,14 @@ /* C++-specific tree lowering bits; see also c-gimplify.c and tree-gimple.c. - Copyright (C) 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Jason Merrill This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -16,9 +17,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/cp/cp-lang.c gcc/cp/cp-lang.c --- gcc/cp/cp-lang.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/cp-lang.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,12 +1,12 @@ /* Language-dependent hooks for C++. - Copyright 2001, 2002, 2004 Free Software Foundation, Inc. + Copyright 2001, 2002, 2004, 2007 Free Software Foundation, Inc. Contributed by Alexandre Oliva This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/cp/cp-objcp-common.c gcc/cp/cp-objcp-common.c --- gcc/cp/cp-objcp-common.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/cp-objcp-common.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,12 +1,12 @@ /* Some code common to C++ and ObjC++ front ends. - Copyright (C) 2004 Free Software Foundation, Inc. + Copyright (C) 2004, 2007 Free Software Foundation, Inc. Contributed by Ziemowit Laski This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/cp/cp-objcp-common.h gcc/cp/cp-objcp-common.h --- gcc/cp/cp-objcp-common.h 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/cp-objcp-common.h 2013-01-01 13:21:35.000000000 +0100 @@ -1,12 +1,12 @@ /* Language hooks common to C++ and ObjC++ front ends. - Copyright (C) 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Ziemowit Laski This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_CP_OBJCP_COMMON #define GCC_CP_OBJCP_COMMON diff -Nru gcc/cp/cp-tree.def gcc/cp/cp-tree.def --- gcc/cp/cp-tree.def 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/cp-tree.def 2013-01-01 13:21:35.000000000 +0100 @@ -2,14 +2,15 @@ additional tree codes used in the GNU C++ compiler (see tree.def for the standard codes). Copyright (C) 1987, 1988, 1990, 1993, 1997, 1998, 2003, 2004, 2005, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 + Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -18,9 +19,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* An OFFSET_REF is used in two situations: diff -Nru gcc/cp/cp-tree.h gcc/cp/cp-tree.h --- gcc/cp/cp-tree.h 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/cp-tree.h 2013-01-01 13:21:35.000000000 +0100 @@ -1,13 +1,14 @@ /* Definitions for C++ parsing and type checking. Copyright (C) 1987, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_CP_TREE_H #define GCC_CP_TREE_H @@ -4258,6 +4258,7 @@ extern tree build_typeid (tree); extern tree get_tinfo_decl (tree); extern tree get_typeid (tree); +extern tree build_headof (tree); extern tree build_dynamic_cast (tree, tree); extern void emit_support_tinfos (void); extern bool emit_tinfo_decl (tree); diff -Nru gcc/cp/cvt.c gcc/cp/cvt.c --- gcc/cp/cvt.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/cvt.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,13 +1,14 @@ /* Language-level data type conversion for GNU C++. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This file contains the functions for converting C++ expressions diff -Nru gcc/cp/cxx-pretty-print.c gcc/cp/cxx-pretty-print.c --- gcc/cp/cxx-pretty-print.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/cxx-pretty-print.c 2013-01-01 13:32:10.000000000 +0100 @@ -1,12 +1,12 @@ /* Implementation of subroutines for the GNU C++ pretty-printer. - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" @@ -44,6 +43,7 @@ static void pp_cxx_statement (cxx_pretty_printer *, tree); static void pp_cxx_template_parameter (cxx_pretty_printer *, tree); static void pp_cxx_cast_expression (cxx_pretty_printer *, tree); +static void pp_cxx_typeid_expression (cxx_pretty_printer *, tree); static inline void @@ -204,6 +204,18 @@ pp_cxx_unqualified_id (pp, TEMPLATE_PARM_DECL (t)); break; + case UNBOUND_CLASS_TEMPLATE: + pp_cxx_unqualified_id (pp, TYPE_NAME (t)); + break; + + case BOUND_TEMPLATE_TEMPLATE_PARM: + pp_cxx_cv_qualifier_seq (pp, t); + pp_cxx_unqualified_id (pp, TYPE_IDENTIFIER (t)); + pp_cxx_begin_template_argument_list (pp); + pp_cxx_template_argument_list (pp, TYPE_TI_ARGS (t)); + pp_cxx_end_template_argument_list (pp); + break; + default: pp_unsupported_tree (pp, t); break; @@ -337,7 +349,10 @@ :: operator-function-id :: qualifier-id ( expression ) - id-expression */ + id-expression + + GNU Extensions: + __builtin_va_arg ( assignment-expression , type-id ) */ static void pp_cxx_primary_expression (cxx_pretty_printer *pp, tree t) @@ -375,6 +390,10 @@ pp_cxx_right_paren (pp); break; + case VA_ARG_EXPR: + pp_cxx_va_arg_expression (pp, t); + break; + default: pp_c_primary_expression (pp_c_base (pp), t); break; @@ -501,14 +520,7 @@ break; case TYPEID_EXPR: - t = TREE_OPERAND (t, 0); - pp_cxx_identifier (pp, "typeid"); - pp_left_paren (pp); - if (TYPE_P (t)) - pp_cxx_type_id (pp, t); - else - pp_cxx_expression (pp, t); - pp_right_paren (pp); + pp_cxx_typeid_expression (pp, t); break; case PSEUDO_DTOR_EXPR: @@ -604,10 +616,13 @@ if (DELETE_EXPR_USE_GLOBAL (t)) pp_cxx_colon_colon (pp); pp_cxx_identifier (pp, "delete"); - if (code == VEC_DELETE_EXPR) + pp_space (pp); + if (code == VEC_DELETE_EXPR + || DELETE_EXPR_USE_VEC (t)) { pp_left_bracket (pp); pp_right_bracket (pp); + pp_space (pp); } pp_c_cast_expression (pp_c_base (pp), TREE_OPERAND (t, 0)); break; @@ -962,7 +977,7 @@ case NON_DEPENDENT_EXPR: case MUST_NOT_THROW_EXPR: - pp_cxx_expression (pp, t); + pp_cxx_expression (pp, TREE_OPERAND (t, 0)); break; default: @@ -1957,6 +1972,30 @@ } } +static void +pp_cxx_typeid_expression (cxx_pretty_printer *pp, tree t) +{ + t = TREE_OPERAND (t, 0); + pp_cxx_identifier (pp, "typeid"); + pp_cxx_left_paren (pp); + if (TYPE_P (t)) + pp_cxx_type_id (pp, t); + else + pp_cxx_expression (pp, t); + pp_cxx_right_paren (pp); +} + +void +pp_cxx_va_arg_expression (cxx_pretty_printer *pp, tree t) +{ + pp_cxx_identifier (pp, "va_arg"); + pp_cxx_left_paren (pp); + pp_cxx_assignment_expression (pp, TREE_OPERAND (t, 0)); + pp_cxx_separate_with (pp, ','); + pp_cxx_type_id (pp, TREE_TYPE (t)); + pp_cxx_right_paren (pp); +} + typedef c_pretty_print_fn pp_fun; diff -Nru gcc/cp/cxx-pretty-print.h gcc/cp/cxx-pretty-print.h --- gcc/cp/cxx-pretty-print.h 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/cxx-pretty-print.h 2013-01-01 13:32:10.000000000 +0100 @@ -1,12 +1,12 @@ /* Interface for the GNU C++ pretty-printer. - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_CXX_PRETTY_PRINT_H #define GCC_CXX_PRETTY_PRINT_H @@ -70,6 +69,7 @@ void pp_cxx_declaration (cxx_pretty_printer *, tree); void pp_cxx_canonical_template_parameter (cxx_pretty_printer *, tree); +void pp_cxx_va_arg_expression (cxx_pretty_printer *, tree); #endif /* GCC_CXX_PRETTY_PRINT_H */ diff -Nru gcc/cp/decl.c gcc/cp/decl.c --- gcc/cp/decl.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/decl.c 2013-01-01 13:34:56.000000000 +0100 @@ -1,13 +1,13 @@ /* Process declarations and variables for C++ compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Process declarations and symbol lookup for C++ front end. @@ -4179,10 +4178,19 @@ return tem; } +/* Process the declaration of a variable DECL. INITIALIZED is true + iff DECL is explicitly initialized. (INITIALIZED is false if the + variable is initialized via an implicitly-called constructor.) + This function must be called for ordinary variables (including, for + example, implicit instantiations of templates), but must not be + called for template declarations. */ + void start_decl_1 (tree decl, bool initialized) { tree type; + bool complete_p; + bool aggregate_definition_p; gcc_assert (!processing_template_decl); @@ -4190,21 +4198,37 @@ return; gcc_assert (TREE_CODE (decl) == VAR_DECL); + type = TREE_TYPE (decl); + complete_p = COMPLETE_TYPE_P (type); + aggregate_definition_p = IS_AGGR_TYPE (type) && !DECL_EXTERNAL (decl); + + /* If an explicit initializer is present, or if this is a definition + of an aggregate, then we need a complete type at this point. + (Scalars are always complete types, so there is nothing to + check.) This code just sets COMPLETE_P; errors (if necessary) + are issued below. */ + if ((initialized || aggregate_definition_p) + && !complete_p + && COMPLETE_TYPE_P (complete_type (type))) + { + complete_p = true; + /* We will not yet have set TREE_READONLY on DECL if the type + was "const", but incomplete, before this point. But, now, we + have a complete type, so we can try again. */ + cp_apply_type_quals_to_decl (cp_type_quals (type), decl); + } if (initialized) - /* Is it valid for this decl to have an initializer at all? - If not, set INITIALIZED to zero, which will indirectly - tell `cp_finish_decl' to ignore the initializer once it is parsed. */ + /* Is it valid for this decl to have an initializer at all? */ { /* Don't allow initializations for incomplete types except for arrays which might be completed by the initialization. */ - if (COMPLETE_TYPE_P (complete_type (type))) + if (complete_p) ; /* A complete type is ok. */ else if (TREE_CODE (type) != ARRAY_TYPE) { error ("variable %q#D has initializer but incomplete type", decl); - initialized = 0; type = TREE_TYPE (decl) = error_mark_node; } else if (!COMPLETE_TYPE_P (complete_type (TREE_TYPE (type)))) @@ -4212,30 +4236,15 @@ if (DECL_LANG_SPECIFIC (decl) && DECL_TEMPLATE_INFO (decl)) error ("elements of array %q#D have incomplete type", decl); /* else we already gave an error in start_decl. */ - initialized = 0; } } - else if (IS_AGGR_TYPE (type) - && ! DECL_EXTERNAL (decl)) + else if (aggregate_definition_p && !complete_p) { - if (!COMPLETE_TYPE_P (complete_type (type))) - { - error ("aggregate %q#D has incomplete type and cannot be defined", - decl); - /* Change the type so that assemble_variable will give - DECL an rtl we can live with: (mem (const_int 0)). */ - type = TREE_TYPE (decl) = error_mark_node; - } - else - { - /* If any base type in the hierarchy of TYPE needs a constructor, - then we set initialized to 1. This way any nodes which are - created for the purposes of initializing this aggregate - will live as long as it does. This is necessary for global - aggregates which do not have their initializers processed until - the end of the file. */ - initialized = TYPE_NEEDS_CONSTRUCTING (type); - } + error ("aggregate %q#D has incomplete type and cannot be defined", + decl); + /* Change the type so that assemble_variable will give + DECL an rtl we can live with: (mem (const_int 0)). */ + type = TREE_TYPE (decl) = error_mark_node; } /* Create a new scope to hold this declaration if necessary. @@ -5126,15 +5135,10 @@ if (DECL_LANG_SPECIFIC (decl) && DECL_IN_AGGR_P (decl)) { gcc_assert (TREE_STATIC (decl)); - /* APPLE LOCAL begin templated static data 6298605 */ /* An in-class declaration of a static data member should be - external if the decl is accessible from outside this - translation unit (eg something not in an anonymous - namespace); it is only a declaration, and not a - definition. */ - if (init == NULL_TREE && TREE_PUBLIC (decl)) - gcc_assert (DECL_EXTERNAL (decl)); - /* APPLE LOCAL end templated static data 6298605 */ + external; it is only a declaration, and not a definition. */ + if (init == NULL_TREE) + gcc_assert (DECL_EXTERNAL (decl) || !TREE_PUBLIC (decl)); } /* We don't create any RTL for local variables. */ @@ -5754,7 +5758,21 @@ goto finish_end; } - init = fold_non_dependent_expr (init); + if (TREE_CODE (init) == TREE_LIST) + { + /* If the parenthesized-initializer form was used (e.g., + "int A::i(X)"), then INIT will be a TREE_LIST of initializer + arguments. (There is generally only one.) We convert them + individually. */ + tree list = init; + for (; list; list = TREE_CHAIN (list)) + { + tree elt = TREE_VALUE (list); + TREE_VALUE (list) = fold_non_dependent_expr (elt); + } + } + else + init = fold_non_dependent_expr (init); processing_template_decl = 0; } @@ -12120,7 +12138,7 @@ gcc_assert (stmts_are_full_exprs_p ()); /* Set up the named return value optimization, if we can. Candidate - variables are selected in check_return_value. */ + variables are selected in check_return_expr. */ if (current_function_return_value) { tree r = current_function_return_value; diff -Nru gcc/cp/decl.h gcc/cp/decl.h --- gcc/cp/decl.h 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/decl.h 2013-01-01 13:21:35.000000000 +0100 @@ -1,11 +1,12 @@ /* Variables and structures for declaration processing. - Copyright (C) 1993, 2000, 2002, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 1993, 2000, 2002, 2004, 2005, 2007 + Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -14,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* In grokdeclarator, distinguish syntactic contexts of declarators. */ enum decl_context diff -Nru gcc/cp/decl2.c gcc/cp/decl2.c --- gcc/cp/decl2.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/decl2.c 2013-01-01 13:58:30.000000000 +0100 @@ -1,13 +1,13 @@ /* Process declarations and variables for C++ compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Process declarations and symbol lookup for C++ front end. @@ -2284,6 +2283,8 @@ DECL_ONE_ONLY (guard) = DECL_ONE_ONLY (decl); if (TREE_PUBLIC (decl)) DECL_WEAK (guard) = DECL_WEAK (decl); + DECL_VISIBILITY (guard) = DECL_VISIBILITY (decl); + DECL_VISIBILITY_SPECIFIED (guard) = DECL_VISIBILITY_SPECIFIED (decl); DECL_ARTIFICIAL (guard) = 1; DECL_IGNORED_P (guard) = 1; @@ -3596,7 +3597,9 @@ /* Static data members are just like namespace-scope globals. */ for (i = 0; VEC_iterate (tree, pending_statics, i, decl); ++i) { - if (var_finalized_p (decl) || DECL_REALLY_EXTERN (decl)) + if (var_finalized_p (decl) || DECL_REALLY_EXTERN (decl) + /* Don't write it out if we haven't seen a definition. */ + || DECL_IN_AGGR_P (decl)) continue; import_export_decl (decl); /* If this static data member is needed, provide it to the diff -Nru gcc/cp/dump.c gcc/cp/dump.c --- gcc/cp/dump.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/dump.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,5 +1,5 @@ /* Tree-dumping functionality for intermediate representation. - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Mark Mitchell @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/cp/error.c gcc/cp/error.c --- gcc/cp/error.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/error.c 2013-01-01 13:32:10.000000000 +0100 @@ -1,12 +1,12 @@ /* Call-backs for C++ error reporting. This code is non-reentrant. Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, - 2003, 2004, 2005 Free Software Foundation, Inc. + 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" @@ -910,6 +909,10 @@ pp_type_id (cxx_pp, t); break; + case UNBOUND_CLASS_TEMPLATE: + dump_type (t, flags); + break; + default: pp_unsupported_tree (cxx_pp, t); /* Fall through to error. */ @@ -1310,10 +1313,14 @@ resolve_virtual_fun_from_obj_type_ref (tree ref) { tree obj_type = TREE_TYPE (OBJ_TYPE_REF_OBJECT (ref)); - int index = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1); + HOST_WIDE_INT index = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1); tree fun = BINFO_VIRTUALS (TYPE_BINFO (TREE_TYPE (obj_type))); - while (index--) + while (index) + { fun = TREE_CHAIN (fun); + index -= (TARGET_VTABLE_USES_DESCRIPTORS + ? TARGET_VTABLE_USES_DESCRIPTORS : 1); + } return BV_FN (fun); } @@ -1326,6 +1333,12 @@ if (t == 0) return; + if (STATEMENT_CLASS_P (t)) + { + pp_cxx_identifier (cxx_pp, ""); + return; + } + switch (TREE_CODE (t)) { case VAR_DECL: @@ -1429,13 +1442,13 @@ if (TREE_CODE (ob) == ADDR_EXPR) { dump_expr (TREE_OPERAND (ob, 0), flags | TFF_EXPR_IN_PARENS); - pp_dot (cxx_pp); + pp_cxx_dot (cxx_pp); } else if (TREE_CODE (ob) != PARM_DECL || strcmp (IDENTIFIER_POINTER (DECL_NAME (ob)), "this")) { dump_expr (ob, flags | TFF_EXPR_IN_PARENS); - pp_arrow (cxx_pp); + pp_cxx_arrow (cxx_pp); } args = TREE_CHAIN (args); } @@ -1764,10 +1777,6 @@ dump_decl (TEMPLATE_PARM_DECL (t), flags & ~TFF_DECL_SPECIFIERS); break; - case SCOPE_REF: - pp_expression (cxx_pp, t); - break; - case CAST_EXPR: if (TREE_OPERAND (t, 0) == NULL_TREE || TREE_CHAIN (TREE_OPERAND (t, 0))) @@ -1895,6 +1904,18 @@ dump_expr (TREE_OPERAND (t, 0), flags); break; + case VA_ARG_EXPR: + pp_cxx_va_arg_expression (cxx_pp, t); + break; + + case SCOPE_REF: + case TYPEID_EXPR: + case DELETE_EXPR: + case VEC_DELETE_EXPR: + case MODOP_EXPR: + pp_expression (cxx_pp, t); + break; + /* This list is incomplete, but should suffice for now. It is very important that `sorry' does not call `report_error_function'. That could cause an infinite loop. */ diff -Nru gcc/cp/except.c gcc/cp/except.c --- gcc/cp/except.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/except.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,6 +1,6 @@ /* Handle exceptional things in C++. Copyright (C) 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Michael Tiemann Rewritten by Mike Stump , based upon an initial re-implementation courtesy Tad Hunt. @@ -9,7 +9,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -18,9 +18,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" @@ -117,6 +116,9 @@ /* Peel off cv qualifiers. */ type = TYPE_MAIN_VARIANT (type); + /* Functions and arrays decay to pointers. */ + type = type_decays_to (type); + return type; } @@ -409,6 +411,9 @@ See also expand_default_init. */ init = ocp_convert (TREE_TYPE (decl), init, CONV_IMPLICIT|CONV_FORCE_TEMP, 0); + /* Force cleanups now to avoid nesting problems with the + MUST_NOT_THROW_EXPR. */ + init = fold_build_cleanup_point_expr (TREE_TYPE (init), init); init = build1 (MUST_NOT_THROW_EXPR, TREE_TYPE (init), init); } diff -Nru gcc/cp/expr.c gcc/cp/expr.c --- gcc/cp/expr.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/expr.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,13 +1,13 @@ /* Convert language-specific tree expression to rtl instructions, for GNU compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2000, 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" diff -Nru gcc/cp/friend.c gcc/cp/friend.c --- gcc/cp/friend.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/friend.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,12 +1,12 @@ /* Help friends in C++. - Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, + 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/cp/g++spec.c gcc/cp/g++spec.c --- gcc/cp/g++spec.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/g++spec.c 2013-01-01 13:25:28.000000000 +0100 @@ -1,13 +1,13 @@ /* APPLE LOCAL mainline 2007-04-02 5027856 */ \ /* Specific flags and argument handling of the C++ front end. - Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 - Free Software Foundation, Inc. + Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, + 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/cp/init.c gcc/cp/init.c --- gcc/cp/init.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/init.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,13 +1,13 @@ /* Handle initialization things in C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* High-level class interface. */ @@ -137,11 +136,12 @@ /* Return an expression for the zero-initialization of an object with type T. This expression will either be a constant (in the case that T is a scalar), or a CONSTRUCTOR (in the case that T is an - aggregate). In either case, the value can be used as DECL_INITIAL - for a decl of the indicated TYPE; it is a valid static initializer. - If NELTS is non-NULL, and TYPE is an ARRAY_TYPE, NELTS is the - number of elements in the array. If STATIC_STORAGE_P is TRUE, - initializers are only generated for entities for which + aggregate), or NULL (in the case that T does not require + initialization). In either case, the value can be used as + DECL_INITIAL for a decl of the indicated TYPE; it is a valid static + initializer. If NELTS is non-NULL, and TYPE is an ARRAY_TYPE, NELTS + is the number of elements in the array. If STATIC_STORAGE_P is + TRUE, initializers are only generated for entities for which zero-initialization does not simply mean filling the storage with zero bytes. */ @@ -200,7 +200,8 @@ tree value = build_zero_init (TREE_TYPE (field), /*nelts=*/NULL_TREE, static_storage_p); - CONSTRUCTOR_APPEND_ELT(v, field, value); + if (value) + CONSTRUCTOR_APPEND_ELT(v, field, value); } /* For unions, only the first field is initialized. */ @@ -2791,6 +2792,7 @@ } else { + tree head = NULL_TREE; tree do_delete = NULL_TREE; tree ifexp; @@ -2804,8 +2806,9 @@ { /* We will use ADDR multiple times so we must save it. */ addr = save_expr (addr); + head = get_target_expr (build_headof (addr)); /* Delete the object. */ - do_delete = build_builtin_delete_call (addr); + do_delete = build_builtin_delete_call (head); /* Otherwise, treat this like a complete object destructor call. */ auto_delete = sfk_complete_destructor; @@ -2854,6 +2857,10 @@ if (do_delete) expr = build2 (COMPOUND_EXPR, void_type_node, expr, do_delete); + /* We need to calculate this before the dtor changes the vptr. */ + if (head) + expr = build2 (COMPOUND_EXPR, void_type_node, head, expr); + if (flags & LOOKUP_DESTRUCTOR) /* Explicit destructor call; don't check for null pointer. */ ifexp = integer_one_node; diff -Nru gcc/cp/lang-specs.h gcc/cp/lang-specs.h --- gcc/cp/lang-specs.h 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/lang-specs.h 2013-01-01 13:21:35.000000000 +0100 @@ -1,12 +1,12 @@ /* Definitions for specs for C++. Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This is the contribution to the `default_compilers' array in gcc.c for g++. */ diff -Nru gcc/cp/lex.c gcc/cp/lex.c --- gcc/cp/lex.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/lex.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,13 +1,14 @@ /* Separate lexical analyzer for GNU C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 + Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This file is the lexical analyzer for GNU C++. */ diff -Nru gcc/cp/mangle.c gcc/cp/mangle.c --- gcc/cp/mangle.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/mangle.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,5 +1,5 @@ /* Name mangling for the 3.0 C++ ABI. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Alex Samuel @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but @@ -15,10 +15,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ /* This file implements mangling of C++ names according to the IA64 C++ ABI specification. A mangled name encodes a function or diff -Nru gcc/cp/method.c gcc/cp/method.c --- gcc/cp/method.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/method.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,14 +1,15 @@ /* Handle the hair of processing (but not expanding) inline functions. Also manage function and variable name overloading. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 + Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -17,9 +18,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Handle method declarations. */ diff -Nru gcc/cp/name-lookup.c gcc/cp/name-lookup.c --- gcc/cp/name-lookup.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/name-lookup.c 2013-01-01 13:57:19.000000000 +0100 @@ -1,12 +1,13 @@ /* Definitions for C++ name lookup routines. - Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2006, 2007 + Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" @@ -1375,10 +1375,6 @@ is_class_level = 0; } - /* APPLE LOCAL begin visibility 5805832 */ - /* pop_visibility() removed */ - /* APPLE LOCAL end visibility 5805832 */ - /* Move one nesting level up. */ current_binding_level = scope->level_chain; @@ -2952,7 +2948,7 @@ /* See whether this has been declared in the namespace. */ old = lookup_qualified_name (scope, DECL_NAME (decl), false, true); - if (!old) + if (old == error_mark_node) /* No old declaration at all. */ goto complain; if (!is_overloaded_fn (decl)) @@ -3010,28 +3006,64 @@ return result; } -/* Push into the scope of the NAME namespace. If NAME is NULL_TREE, then we - select a name that is unique to this compilation unit. */ +/* Process any ATTRIBUTES on a namespace definition. Currently only + attribute visibility is meaningful, which is a property of the syntactic + block rather than the namespace as a whole, so we don't touch the + NAMESPACE_DECL at all. Returns true if attribute visibility is seen. */ -void -push_namespace (tree name) +bool +handle_namespace_attrs (tree ns, tree attributes) { - push_namespace_with_attribs (name, NULL_TREE); + tree d; + bool saw_vis = false; + + for (d = attributes; d; d = TREE_CHAIN (d)) + { + tree name = TREE_PURPOSE (d); + tree args = TREE_VALUE (d); + +#ifdef HANDLE_PRAGMA_VISIBILITY + if (is_attribute_p ("visibility", name)) + { + tree x = args ? TREE_VALUE (args) : NULL_TREE; + if (x == NULL_TREE || TREE_CODE (x) != STRING_CST || TREE_CHAIN (args)) + { + warning (OPT_Wattributes, + "%qD attribute requires a single NTBS argument", + name); + continue; + } + + if (!TREE_PUBLIC (ns)) + warning (OPT_Wattributes, + "%qD attribute is meaningless since members of the " + "anonymous namespace get local symbols", name); + + push_visibility (TREE_STRING_POINTER (x)); + saw_vis = true; + } + else +#endif + { + warning (OPT_Wattributes, "%qD attribute directive ignored", + name); + continue; + } + } + return saw_vis; } + -/* Same, but specify attributes to apply to the namespace. The attributes - only apply to the current namespace-body, not to any later extensions. */ +/* Push into the scope of the NAME namespace. If NAME is NULL_TREE, then we + select a name that is unique to this compilation unit. */ -/* APPLE LOCAL visibility 5805832 */ -bool -push_namespace_with_attribs (tree name, tree attributes) +void +push_namespace (tree name) { tree d = NULL_TREE; int need_new = 1; int implicit_use = 0; bool anon = !name; - /* APPLE LOCAL visibility 5805832 */ - bool visibility_pushed = false; timevar_push (TV_NAME_LOOKUP); @@ -3095,42 +3127,7 @@ /* Enter the name space. */ current_namespace = d; -#ifdef HANDLE_PRAGMA_VISIBILITY - /* Clear has_visibility in case a previous namespace-definition had a - visibility attribute and this one doesn't. */ - current_binding_level->has_visibility = 0; - for (d = attributes; d; d = TREE_CHAIN (d)) - { - tree name = TREE_PURPOSE (d); - tree args = TREE_VALUE (d); - tree x; - - if (! is_attribute_p ("visibility", name)) - { - warning (OPT_Wattributes, "%qs attribute directive ignored", - IDENTIFIER_POINTER (name)); - continue; - } - - x = args ? TREE_VALUE (args) : NULL_TREE; - if (x == NULL_TREE || TREE_CODE (x) != STRING_CST || TREE_CHAIN (args)) - { - warning (OPT_Wattributes, "%qs attribute requires a single NTBS argument", - IDENTIFIER_POINTER (name)); - continue; - } - - /* APPLE LOCAL visibility 5805832 */ - visibility_pushed = true; - push_visibility (TREE_STRING_POINTER (x)); - goto found; - } - found: -#endif - timevar_pop (TV_NAME_LOOKUP); - /* APPLE LOCAL visibility 5805832 */ - return visibility_pushed; } /* Pop from the scope of the current namespace. */ @@ -4047,12 +4044,49 @@ if (binding) { - /* APPLE LOCAL begin 6322334 */ - /* Ick, we don't want to find a hidden friend inside a - local class! */ if (hidden_name_p (binding)) - POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, NULL_TREE); - /* APPLE LOCAL end 6322334 */ + { + /* A non namespace-scope binding can only be hidden if + we are in a local class, due to friend declarations. + In particular, consider: + + void f() { + struct A { + friend struct B; + void g() { B* b; } // error: B is hidden + } + struct B {}; + } + + The standard says that "B" is a local class in "f" + (but not nested within "A") -- but that name lookup + for "B" does not find this declaration until it is + declared directly with "f". + + In particular: + + [class.friend] + + If a friend declaration appears in a local class and + the name specified is an unqualified name, a prior + declaration is looked up without considering scopes + that are outside the innermost enclosing non-class + scope. For a friend class declaration, if there is no + prior declaration, the class that is specified + belongs to the innermost enclosing non-class scope, + but if it is subsequently referenced, its name is not + found by name lookup until a matching declaration is + provided in the innermost enclosing nonclass scope. + */ + gcc_assert (current_class_type && + LOCAL_CLASS_P (current_class_type)); + + /* This binding comes from a friend declaration in the local + class. The standard (11.4.8) states that the lookup can + only succeed if there is a non-hidden declaration in the + current scope, which is not the case here. */ + POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, NULL_TREE); + } val = binding; break; diff -Nru gcc/cp/name-lookup.h gcc/cp/name-lookup.h --- gcc/cp/name-lookup.h 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/name-lookup.h 2013-01-01 13:57:06.000000000 +0100 @@ -1,12 +1,12 @@ /* Declarations for C++ name lookup routines. - Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -15,9 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_CP_NAME_LOOKUP_H #define GCC_CP_NAME_LOOKUP_H @@ -261,11 +260,7 @@ unsigned more_cleanups_ok : 1; unsigned have_cleanups : 1; - /* Nonzero if this level has associated visibility which we should pop - when leaving the scope. */ - unsigned has_visibility : 1; - - /* 23 bits left to fill a 32-bit word. */ + /* 24 bits left to fill a 32-bit word. */ }; /* The binding level currently in effect. */ @@ -313,11 +308,10 @@ extern void push_binding_level (struct cp_binding_level *); extern void push_namespace (tree); -/* APPLE LOCAL visibility 5805832 */ -extern bool push_namespace_with_attribs (tree, tree); extern void pop_namespace (void); extern void push_nested_namespace (tree); extern void pop_nested_namespace (tree); +extern bool handle_namespace_attrs (tree, tree); extern void pushlevel_class (void); extern void poplevel_class (void); extern tree pushdecl_with_scope (tree, cxx_scope *, bool); diff -Nru gcc/cp/operators.def gcc/cp/operators.def --- gcc/cp/operators.def 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/operators.def 2013-01-01 13:21:35.000000000 +0100 @@ -5,13 +5,14 @@ non-overloadable operators (like the `?:' ternary operator). Written by Mark Mitchell - Copyright (C) 2000, 2001, 2002, 2003, 2005 Free Software Foundation, Inc. + Copyright (C) 2000, 2001, 2002, 2003, 2005, 2007 + Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -20,9 +21,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* The DEF_OPERATOR macro takes the following arguments: diff -Nru gcc/cp/optimize.c gcc/cp/optimize.c --- gcc/cp/optimize.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/optimize.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,5 +1,5 @@ /* Perform optimizations on tree structure. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005 + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Mark Michell (mark@codesourcery.com). @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but @@ -16,9 +16,8 @@ General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/cp/parser.c gcc/cp/parser.c --- gcc/cp/parser.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/parser.c 2013-01-01 13:58:30.000000000 +0100 @@ -1,13 +1,13 @@ /* C++ Parser. Copyright (C) 2000, 2001, 2002, 2003, 2004, - 2005 Free Software Foundation, Inc. + 2005, 2007 Free Software Foundation, Inc. Written by Mark Mitchell . This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but @@ -15,10 +15,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" @@ -5264,6 +5263,7 @@ tree expression_list = NULL_TREE; bool fold_expr_p = is_attribute_list; tree identifier = NULL_TREE; + bool saved_greater_than_is_operator_p; /* Assume all the expressions will be constant. */ if (non_constant_p) @@ -5272,6 +5272,12 @@ if (!cp_parser_require (parser, CPP_OPEN_PAREN, "`('")) return error_mark_node; + /* Within a parenthesized expression, a `>' token is always + the greater-than operator. */ + saved_greater_than_is_operator_p + = parser->greater_than_is_operator_p; + parser->greater_than_is_operator_p = true; + /* Consume expressions until there are no more. */ if (cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_PAREN)) while (true) @@ -5345,9 +5351,16 @@ if (ending < 0) goto get_comma; if (!ending) - return error_mark_node; + { + parser->greater_than_is_operator_p + = saved_greater_than_is_operator_p; + return error_mark_node; + } } + parser->greater_than_is_operator_p + = saved_greater_than_is_operator_p; + /* We built up the list in reverse order so we must reverse it now. */ expression_list = nreverse (expression_list); if (identifier) @@ -8482,7 +8495,7 @@ case RID_FRIEND: if (!at_class_scope_p ()) { - error ("% used outside of class"); + error ("%H% used outside of class", &token->location); cp_lexer_purge_token (parser->lexer); } else @@ -11563,8 +11576,7 @@ cp_parser_namespace_definition (cp_parser* parser) { tree identifier, attribs; - /* APPLE LOCAL visibility 5805832 */ - bool visibility_pushed = false; + bool has_visibility; /* Look for the `namespace' keyword. */ cp_parser_require_keyword (parser, RID_NAMESPACE, "`namespace'"); @@ -11584,16 +11596,18 @@ /* Look for the `{' to start the namespace. */ cp_parser_require (parser, CPP_OPEN_BRACE, "`{'"); /* Start the namespace. */ - /* APPLE LOCAL visibility 5805832 */ - visibility_pushed = push_namespace_with_attribs (identifier, attribs); + push_namespace (identifier); + + has_visibility = handle_namespace_attrs (current_namespace, attribs); + /* Parse the body of the namespace. */ cp_parser_namespace_body (parser); - /* APPLE LOCAL begin visibility 5805832 */ + #ifdef HANDLE_PRAGMA_VISIBILITY - if (visibility_pushed) + if (has_visibility) pop_visibility (); #endif - /* APPLE LOCAL end visibility 5805832 */ + /* Finish the namespace. */ pop_namespace (); /* Look for the final `}'. */ @@ -15745,7 +15759,7 @@ asm_specification = cp_parser_string_literal (parser, false, false); /* Look for the `)'. */ - cp_parser_require (parser, CPP_CLOSE_PAREN, "`('"); + cp_parser_require (parser, CPP_CLOSE_PAREN, "%<)%>"); return asm_specification; } @@ -22434,7 +22448,8 @@ code = TRUTH_ORIF_EXPR; break; default: - cp_parser_error (parser, "`+', `*', `-', `&', `^', `|', `&&', or `||'"); + cp_parser_error (parser, "expected `+', `*', `-', `&', `^', `|', " + "`&&', or `||'"); resync_fail: cp_parser_skip_to_closing_parenthesis (parser, /*recovering=*/true, /*or_comma=*/false, @@ -22465,7 +22480,7 @@ { tree c, t; - if (!cp_parser_require (parser, CPP_OPEN_PAREN, "expected %<(%>")) + if (!cp_parser_require (parser, CPP_OPEN_PAREN, "%<(%>")) return list; c = build_omp_clause (OMP_CLAUSE_SCHEDULE); diff -Nru gcc/cp/pt.c gcc/cp/pt.c --- gcc/cp/pt.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/pt.c 2013-01-01 13:58:30.000000000 +0100 @@ -1,6 +1,6 @@ /* Handle parameterized types (templates) for GNU C++. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Ken Raeburn (raeburn@cygnus.com) while at Watchmaker Computing. Rewritten by Jason Merrill (jason@cygnus.com). @@ -8,7 +8,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -17,9 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Known bugs or deficiencies include: @@ -508,6 +507,37 @@ return new_args; } +/* The inverse of get_innermost_template_args: Return all but the innermost + EXTRA_LEVELS levels of template arguments from the ARGS. */ + +static tree +strip_innermost_template_args (tree args, int extra_levels) +{ + tree new_args; + int n = TMPL_ARGS_DEPTH (args) - extra_levels; + int i; + + gcc_assert (n >= 0); + + /* If N is 1, just return the outermost set of template arguments. */ + if (n == 1) + return TMPL_ARGS_LEVEL (args, 1); + + /* If we're not removing anything, just return the arguments we were + given. */ + gcc_assert (extra_levels >= 0); + if (extra_levels == 0) + return args; + + /* Make a new set of arguments, not containing the inner arguments. */ + new_args = make_tree_vec (n); + for (i = 1; i <= n; ++i) + SET_TMPL_ARGS_LEVEL (new_args, i, + TMPL_ARGS_LEVEL (args, i)); + + return new_args; +} + /* We've got a template header coming up; push to a new level for storing the parms. */ @@ -1971,7 +2001,7 @@ context. */ fns = lookup_qualified_name (CP_DECL_CONTEXT (decl), dname, false, true); - if (!fns || !is_overloaded_fn (fns)) + if (fns == error_mark_node || !is_overloaded_fn (fns)) { error ("%qD is not a template function", dname); fns = error_mark_node; @@ -6305,8 +6335,14 @@ up. */ context = TYPE_CONTEXT (t); if (context) - context = tsubst_aggr_type (context, args, complain, - in_decl, /*entering_scope=*/1); + { + context = tsubst_aggr_type (context, args, complain, + in_decl, /*entering_scope=*/1); + /* If context is a nested class inside a class template, + it may still need to be instantiated (c++/33959). */ + if (TYPE_P (context)) + context = complete_type (context); + } /* Then, figure out what arguments are appropriate for the type we are trying to find. For example, given: @@ -10141,6 +10177,7 @@ if (TREE_CODE (fn) != TEMPLATE_DECL) continue; + ++processing_template_decl; subargs = get_bindings (fn, DECL_TEMPLATE_RESULT (fn), expl_subargs, /*check_ret=*/false); if (subargs) @@ -10149,6 +10186,7 @@ good += try_one_overload (tparms, targs, tempargs, parm, elem, strict, sub_strict, addr_p); } + --processing_template_decl; } } else if (TREE_CODE (arg) != OVERLOAD @@ -10532,6 +10570,8 @@ case TEMPLATE_TEMPLATE_PARM: case BOUND_TEMPLATE_TEMPLATE_PARM: tparm = TREE_VALUE (TREE_VEC_ELT (tparms, 0)); + if (tparm == error_mark_node) + return 1; if (TEMPLATE_TYPE_LEVEL (parm) != template_decl_level (tparm)) @@ -11590,20 +11630,57 @@ int fate; bool ambiguous_p; tree args; + tree outer_args = NULL_TREE; tmpl = most_general_template (tmpl); args = CLASSTYPE_TI_ARGS (type); + + /* For determining which partial specialization to use, only the + innermost args are interesting. */ + if (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (args)) + { + outer_args = strip_innermost_template_args (args, 1); + args = INNERMOST_TEMPLATE_ARGS (args); + } + for (t = DECL_TEMPLATE_SPECIALIZATIONS (tmpl); t; t = TREE_CHAIN (t)) { tree partial_spec_args; tree spec_args; + tree parms = TREE_VALUE (t); partial_spec_args = CLASSTYPE_TI_ARGS (TREE_TYPE (t)); - spec_args = get_class_bindings (TREE_VALUE (t), + if (outer_args) + { + int i; + + ++processing_template_decl; + + /* Discard the outer levels of args, and then substitute in the + template args from the enclosing class. */ + partial_spec_args = INNERMOST_TEMPLATE_ARGS (partial_spec_args); + partial_spec_args = tsubst_template_args + (partial_spec_args, outer_args, tf_none, NULL_TREE); + + /* PARMS already refers to just the innermost parms, but the + template parms in partial_spec_args had their levels lowered + by tsubst, so we need to do the same for the parm list. We + can't just tsubst the TREE_VEC itself, as tsubst wants to + treat a TREE_VEC as an argument vector. */ + parms = copy_node (parms); + for (i = TREE_VEC_LENGTH (parms) - 1; i >= 0; --i) + TREE_VEC_ELT (parms, i) = + tsubst (TREE_VEC_ELT (parms, i), outer_args, tf_none, NULL_TREE); + + --processing_template_decl; + } + spec_args = get_class_bindings (parms, partial_spec_args, args); if (spec_args) { + if (outer_args) + spec_args = add_to_template_args (outer_args, spec_args); list = tree_cons (spec_args, TREE_VALUE (t), list); TREE_TYPE (list) = TREE_TYPE (t); } @@ -12939,7 +13016,7 @@ /* A non-type template parm. */ if (DECL_TEMPLATE_PARM_P (expression)) return true; - return false; + return value_dependent_expression_p (DECL_INITIAL (expression)); case VAR_DECL: /* A constant with integral or enumeration type and is initialized diff -Nru gcc/cp/ptree.c gcc/cp/ptree.c --- gcc/cp/ptree.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/ptree.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,13 +1,14 @@ /* Prints out trees in human readable form. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 + Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" diff -Nru gcc/cp/repo.c gcc/cp/repo.c --- gcc/cp/repo.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/repo.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,13 +1,13 @@ /* Code to maintain a C++ template repository. - Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. + Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2005, + 2007 Free Software Foundation, Inc. Contributed by Jason Merrill (jason@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* My strategy here is as follows: diff -Nru gcc/cp/rtti.c gcc/cp/rtti.c --- gcc/cp/rtti.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/rtti.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,6 +1,6 @@ /* RunTime Type Identification Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005, 2006 + 2005, 2006, 2007 Free Software Foundation, Inc. Mostly written by Jason Merrill (jason@cygnus.com). @@ -8,7 +8,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -17,9 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" @@ -104,7 +103,6 @@ and are generated as needed. */ static GTY (()) VEC(tinfo_s,gc) *tinfo_descs; -static tree build_headof (tree); static tree ifnonnull (tree, tree); static tree tinfo_name (tree); static tree build_dynamic_cast_1 (tree, tree); @@ -158,7 +156,7 @@ virtual functions (TYPE_POLYMORPHIC_P), else just return the expression. */ -static tree +tree build_headof (tree exp) { tree type = TREE_TYPE (exp); diff -Nru gcc/cp/search.c gcc/cp/search.c --- gcc/cp/search.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/search.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,14 +1,14 @@ /* Breadth-first and depth-first routines for searching multiple-inheritance lattice for GNU C++. Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Contributed by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -17,9 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* High-level class interface. */ @@ -1200,6 +1199,9 @@ const char *errstr = 0; + if (name == error_mark_node) + return NULL_TREE; + gcc_assert (TREE_CODE (name) == IDENTIFIER_NODE); if (TREE_CODE (xbasetype) == TREE_BINFO) diff -Nru gcc/cp/semantics.c gcc/cp/semantics.c --- gcc/cp/semantics.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/semantics.c 2013-01-01 13:21:35.000000000 +0100 @@ -3,7 +3,7 @@ building RTL. These routines are used both during actual parsing and during the instantiation of template functions. - Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 + Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Written by Mark Mitchell (mmitchell@usa.net) based on code found formerly in parse.y and pt.c. @@ -12,7 +12,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) + the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but @@ -20,10 +20,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with GCC; see the file COPYING. If not, write to the Free - Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA - 02110-1301, USA. */ +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" @@ -1336,8 +1335,13 @@ void finish_label_decl (tree name) { - tree decl = declare_local_label (name); - add_decl_expr (decl); + if (!at_function_scope_p ()) + { + error ("__label__ declarations are only allowed in function scopes"); + return; + } + + add_decl_expr (declare_local_label (name)); } /* When DECL goes out of scope, make sure that CLEANUP is executed. */ diff -Nru gcc/cp/tree.c gcc/cp/tree.c --- gcc/cp/tree.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/tree.c 2013-01-01 13:21:35.000000000 +0100 @@ -1,13 +1,14 @@ /* Language-dependent node constructors for parse phase of GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 + Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +17,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/cp/typeck.c gcc/cp/typeck.c --- gcc/cp/typeck.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/typeck.c 2013-01-01 13:58:30.000000000 +0100 @@ -1,13 +1,13 @@ /* Build expressions with type checking for C++ compiler. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -16,9 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This file is part of the C++ front end. @@ -1483,6 +1482,13 @@ return DECL_BIT_FIELD_TYPE (field); } + case NOP_EXPR: + case CONVERT_EXPR: + if (TYPE_MAIN_VARIANT (TREE_TYPE (TREE_OPERAND (exp, 0))) + == TYPE_MAIN_VARIANT (TREE_TYPE (exp))) + return is_bitfield_expr_with_lowered_type (TREE_OPERAND (exp, 0)); + /* Fallthrough. */ + default: return NULL_TREE; } @@ -1841,7 +1847,7 @@ warn_deprecated_use (member); } else - member_scope = BINFO_TYPE (BASELINK_BINFO (member)); + member_scope = BINFO_TYPE (BASELINK_ACCESS_BINFO (member)); /* If MEMBER is from an anonymous aggregate, MEMBER_SCOPE will presently be the anonymous union. Go outwards until we find a type related to OBJECT_TYPE. */ @@ -7199,6 +7205,7 @@ && TREE_CODE (retval) == VAR_DECL && DECL_CONTEXT (retval) == current_function_decl && ! TREE_STATIC (retval) + && ! DECL_ANON_UNION_VAR_P (retval) && (DECL_ALIGN (retval) >= DECL_ALIGN (DECL_RESULT (current_function_decl))) && same_type_p ((TYPE_MAIN_VARIANT diff -Nru gcc/cp/typeck2.c gcc/cp/typeck2.c --- gcc/cp/typeck2.c 2010-10-14 22:27:29.000000000 +0200 +++ gcc/cp/typeck2.c 2013-01-01 13:58:30.000000000 +0100 @@ -1,7 +1,7 @@ /* Report error messages, build initializers, and perform some front-end optimizations for C++ compiler. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2004, 2005, 2006 + 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) @@ -9,7 +9,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) +the Free Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, @@ -18,9 +18,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to -the Free Software Foundation, 51 Franklin Street, Fifth Floor, -Boston, MA 02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This file is part of the C++ front end. @@ -1384,9 +1383,9 @@ if (parms && TREE_CHAIN (parms) == NULL_TREE) return build_c_cast (type, TREE_VALUE (parms)); - /* We need to zero-initialize POD types. */ - if (parms == NULL_TREE - && !CLASSTYPE_NON_POD_P (type) + /* We need to zero-initialize POD types. Let's do that for everything + that doesn't need a constructor. */ + if (parms == NULL_TREE && !TYPE_NEEDS_CONSTRUCTING (type) && TYPE_HAS_DEFAULT_CONSTRUCTOR (type)) { exp = build_zero_init (type, diff -Nru gcc/cppdefault.c gcc/cppdefault.c --- gcc/cppdefault.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/cppdefault.c 2012-12-31 17:06:04.000000000 +0100 @@ -1,23 +1,23 @@ /* CPP Library. Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2003, 2004, 2006 Free Software Foundation, Inc. + 1999, 2000, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. Contributed by Per Bothner, 1994-95. Based on CCCP program by Paul Rubin, June 1986 Adapted to ANSI C, Richard Stallman, Jan 1987 -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, 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; see the file COPYING3. If not see + . */ #include "config.h" #include "system.h" diff -Nru gcc/cppdefault.h gcc/cppdefault.h --- gcc/cppdefault.h 2010-10-14 22:27:55.000000000 +0200 +++ gcc/cppdefault.h 2012-12-31 17:06:04.000000000 +0100 @@ -1,23 +1,23 @@ /* CPP Library. Copyright (C) 1986, 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2003, 2004, 2006 Free Software Foundation, Inc. + 1999, 2000, 2003, 2004, 2006, 2007 Free Software Foundation, Inc. Contributed by Per Bothner, 1994-95. Based on CCCP program by Paul Rubin, June 1986 Adapted to ANSI C, Richard Stallman, Jan 1987 -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, 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; see the file COPYING3. If not see + . */ #ifndef GCC_CPPDEFAULT_H #define GCC_CPPDEFAULT_H diff -Nru gcc/cppspec.c gcc/cppspec.c --- gcc/cppspec.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/cppspec.c 2012-12-31 17:06:04.000000000 +0100 @@ -1,11 +1,11 @@ /* Specific flags and argument handling of the C preprocessor. - Copyright (C) 1999 Free Software Foundation, Inc. + Copyright (C) 1999, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/cse.c gcc/cse.c --- gcc/cse.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/cse.c 2012-12-31 17:06:04.000000000 +0100 @@ -1,12 +1,12 @@ /* Common subexpression elimination for GNU compiler. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998 - 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" /* stdio.h must precede rtl.h for FFS. */ @@ -583,7 +582,8 @@ static int mention_regs (rtx); static int insert_regs (rtx, struct table_elt *, int); static void remove_from_table (struct table_elt *, unsigned); -static struct table_elt *lookup (rtx, unsigned, enum machine_mode); +static void remove_pseudo_from_table (rtx, unsigned); +static struct table_elt *lookup (rtx, unsigned, enum machine_mode); static struct table_elt *lookup_for_remove (rtx, unsigned, enum machine_mode); static rtx lookup_as_function (rtx, enum rtx_code); static struct table_elt *insert (rtx, struct table_elt *, unsigned, @@ -1381,6 +1381,19 @@ table_size--; } +/* Same as above, but X is a pseudo-register. */ + +static void +remove_pseudo_from_table (rtx x, unsigned int hash) +{ + struct table_elt *elt; + + /* Because a pseudo-register can be referenced in more than one + mode, we might have to remove more than one table entry. */ + while ((elt = lookup_for_remove (x, hash, VOIDmode))) + remove_from_table (elt, hash); +} + /* Look up X in the hash table and return its table element, or 0 if X is not in the table. @@ -1717,7 +1730,10 @@ delete_reg_equiv (REGNO (exp)); } - remove_from_table (elt, hash); + if (REG_P (exp) && REGNO (exp) >= FIRST_PSEUDO_REGISTER) + remove_pseudo_from_table (exp, hash); + else + remove_from_table (elt, hash); if (insert_regs (exp, class1, 0) || need_rehash) { @@ -1813,14 +1829,7 @@ SUBREG_TICKED (regno) = -1; if (regno >= FIRST_PSEUDO_REGISTER) - { - /* Because a register can be referenced in more than one mode, - we might have to remove more than one table entry. */ - struct table_elt *elt; - - while ((elt = lookup_for_remove (x, hash, GET_MODE (x)))) - remove_from_table (elt, hash); - } + remove_pseudo_from_table (x, hash); else { HOST_WIDE_INT in_table diff -Nru gcc/cselib.c gcc/cselib.c --- gcc/cselib.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/cselib.c 2012-12-31 17:06:04.000000000 +0100 @@ -1,12 +1,12 @@ /* Common subexpression elimination library for GNU compiler. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2000, 2001, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/cselib.h gcc/cselib.h --- gcc/cselib.h 2010-10-14 22:27:55.000000000 +0200 +++ gcc/cselib.h 2012-12-31 17:06:04.000000000 +0100 @@ -1,12 +1,12 @@ /* Common subexpression elimination for GNU compiler. Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2003, 2004, 2005 Free Software Foundation, Inc. + 1999, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Describe a value. */ typedef struct cselib_val_struct GTY(()) diff -Nru gcc/dbxout.c gcc/dbxout.c --- gcc/dbxout.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/dbxout.c 2012-12-31 17:06:05.000000000 +0100 @@ -1,13 +1,13 @@ /* Output dbx-format symbol table information from GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -16,9 +16,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* Output dbx-format symbol table data. diff -Nru gcc/dbxout.h gcc/dbxout.h --- gcc/dbxout.h 2010-10-14 22:27:54.000000000 +0200 +++ gcc/dbxout.h 2012-12-31 17:06:05.000000000 +0100 @@ -1,12 +1,12 @@ /* dbxout.h - Various declarations for functions found in dbxout.c - Copyright (C) 1998, 1999, 2000, 2003, 2004 + Copyright (C) 1998, 1999, 2000, 2003, 2004, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -15,9 +15,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_DBXOUT_H #define GCC_DBXOUT_H diff -Nru gcc/ddg.c gcc/ddg.c --- gcc/ddg.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/ddg.c 2012-12-31 17:06:05.000000000 +0100 @@ -1,5 +1,5 @@ /* DDG - Data Dependence Graph implementation. - Copyright (C) 2004, 2005, 2006 + Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Ayal Zaks and Mustafa Hagog @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -16,9 +16,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" diff -Nru gcc/ddg.h gcc/ddg.h --- gcc/ddg.h 2010-10-14 22:27:54.000000000 +0200 +++ gcc/ddg.h 2012-12-31 17:06:05.000000000 +0100 @@ -1,5 +1,5 @@ /* DDG - Data Dependence Graph - interface. - Copyright (C) 2004 + Copyright (C) 2004, 2007 Free Software Foundation, Inc. Contributed by Ayal Zaks and Mustafa Hagog @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -16,9 +16,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_DDG_H #define GCC_DDG_H diff -Nru gcc/debug.c gcc/debug.c --- gcc/debug.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/debug.c 2012-12-31 17:06:05.000000000 +0100 @@ -1,19 +1,19 @@ /* Do-nothing debug hooks for GCC. - Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, 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; see the file COPYING3. If not see + . */ #include "config.h" #include "system.h" diff -Nru gcc/debug.h gcc/debug.h --- gcc/debug.h 2010-10-14 22:27:54.000000000 +0200 +++ gcc/debug.h 2012-12-31 17:06:05.000000000 +0100 @@ -1,19 +1,19 @@ /* Debug hooks for GCC. - Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007 Free Software Foundation, Inc. -This program is free software; you can redistribute it and/or modify it -under the terms of the GNU General Public License as published by the -Free Software Foundation; either version 2, or (at your option) any -later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 3, 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; see the file COPYING3. If not see + . */ #ifndef GCC_DEBUG_H #define GCC_DEBUG_H diff -Nru gcc/defaults.h gcc/defaults.h --- gcc/defaults.h 2010-10-14 22:27:54.000000000 +0200 +++ gcc/defaults.h 2012-12-31 17:06:05.000000000 +0100 @@ -1,6 +1,6 @@ /* Definitions of various defaults for tm.h macros. Copyright (C) 1992, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, - 2005 + 2005, 2007 Free Software Foundation, Inc. Contributed by Ron Guilmette (rfg@monkeys.com) @@ -8,7 +8,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -17,9 +17,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_DEFAULTS_H #define GCC_DEFAULTS_H diff -Nru gcc/df-core.c gcc/df-core.c --- gcc/df-core.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/df-core.c 2012-12-31 17:06:05.000000000 +0100 @@ -1,5 +1,5 @@ /* Allocation for dataflow support routines. - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Originally contributed by Michael P. Hayes (m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com) @@ -10,7 +10,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -19,10 +19,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. -*/ +along with GCC; see the file COPYING3. If not see +. */ /* OVERVIEW: diff -Nru gcc/df-problems.c gcc/df-problems.c --- gcc/df-problems.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/df-problems.c 2012-12-31 17:06:05.000000000 +0100 @@ -1,5 +1,5 @@ /* Standard problems for dataflow support routines. - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Originally contributed by Michael P. Hayes (m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com) @@ -10,7 +10,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -19,9 +19,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/df-scan.c gcc/df-scan.c --- gcc/df-scan.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/df-scan.c 2012-12-31 17:06:05.000000000 +0100 @@ -3,7 +3,7 @@ /* Scanning of rtl for dataflow analysis. - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Originally contributed by Michael P. Hayes (m.hayes@elec.canterbury.ac.nz, mhayes@redhat.com) @@ -14,7 +14,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -23,10 +23,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. -*/ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" @@ -1586,12 +1584,19 @@ so they are recorded as used. */ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++) if (global_regs[i]) - df_uses_record (dflow, ®no_reg_rtx[i], - DF_REF_REG_USE, bb, insn, - 0); + { + df_uses_record (dflow, ®no_reg_rtx[i], + DF_REF_REG_USE, bb, insn, 0); + df_ref_record (dflow, regno_reg_rtx[i], ®no_reg_rtx[i], + bb, insn, DF_REF_REG_DEF, 0, true); + } + EXECUTE_IF_SET_IN_BITMAP (df_invalidated_by_call, 0, ui, bi) - df_ref_record (dflow, regno_reg_rtx[ui], ®no_reg_rtx[ui], bb, - insn, DF_REF_REG_DEF, DF_REF_MAY_CLOBBER, false); + { + if (!global_regs[ui]) + df_ref_record (dflow, regno_reg_rtx[ui], ®no_reg_rtx[ui], bb, + insn, DF_REF_REG_DEF, DF_REF_MAY_CLOBBER, false); + } } } diff -Nru gcc/df.h gcc/df.h --- gcc/df.h 2010-10-14 22:27:55.000000000 +0200 +++ gcc/df.h 2012-12-31 17:06:05.000000000 +0100 @@ -11,7 +11,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -20,9 +20,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_DF_H #define GCC_DF_H diff -Nru gcc/dfp.c gcc/dfp.c --- gcc/dfp.c 2010-10-14 22:27:55.000000000 +0200 +++ gcc/dfp.c 2012-12-31 17:06:05.000000000 +0100 @@ -1,11 +1,11 @@ /* Decimal floating point support. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #include "config.h" #include "system.h" diff -Nru gcc/dfp.h gcc/dfp.h --- gcc/dfp.h 2010-10-14 22:27:55.000000000 +0200 +++ gcc/dfp.h 2012-12-31 17:06:05.000000000 +0100 @@ -1,11 +1,11 @@ /* Decimal floating point support functions for GNU compiler. - Copyright (C) 2005, 2006 Free Software Foundation, Inc. + Copyright (C) 2005, 2006, 2007 Free Software Foundation, Inc. This file is part of GCC. GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -14,9 +14,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_DFP_H #define GCC_DFP_H diff -Nru gcc/diagnostic.c gcc/diagnostic.c --- gcc/diagnostic.c 2010-10-14 22:27:54.000000000 +0200 +++ gcc/diagnostic.c 2012-12-31 17:06:05.000000000 +0100 @@ -1,5 +1,5 @@ /* Language-independent diagnostic subroutines for the GNU Compiler Collection - Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -16,9 +16,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ /* This file implements the language independent aspect of diagnostic diff -Nru gcc/diagnostic.h gcc/diagnostic.h --- gcc/diagnostic.h 2010-10-14 22:27:54.000000000 +0200 +++ gcc/diagnostic.h 2012-12-31 17:06:05.000000000 +0100 @@ -1,5 +1,5 @@ /* Various declarations for language-independent diagnostics subroutines. - Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. Contributed by Gabriel Dos Reis @@ -7,7 +7,7 @@ GCC is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free -Software Foundation; either version 2, or (at your option) any later +Software Foundation; either version 3, or (at your option) any later version. GCC is distributed in the hope that it will be useful, but WITHOUT ANY @@ -16,9 +16,8 @@ for more details. You should have received a copy of the GNU General Public License -along with GCC; see the file COPYING. If not, write to the Free -Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA -02110-1301, USA. */ +along with GCC; see the file COPYING3. If not see +. */ #ifndef GCC_DIAGNOSTIC_H #define GCC_DIAGNOSTIC_H diff -Nru gcc/doc/contrib.texi gcc/doc/contrib.texi --- gcc/doc/contrib.texi 2010-10-14 22:24:15.000000000 +0200 +++ gcc/doc/contrib.texi 2012-12-31 17:06:05.000000000 +0100 @@ -514,6 +514,10 @@ Robert Lipe for OpenServer support, new testsuites, testing, etc. @item +Chen Liqin for various S+core related fixes/improvement, and for +maintaining the S+core port. + +@item Weiwen Liu for testing and various bug fixes. @item diff -Nru gcc/doc/extend.texi gcc/doc/extend.texi --- gcc/doc/extend.texi 2010-10-14 22:24:15.000000000 +0200 +++ gcc/doc/extend.texi 2012-12-31 17:06:05.000000000 +0100 @@ -6291,6 +6291,14 @@ when testing pointer or floating-point values. @end deftypefn +@deftypefn {Built-in Function} void __builtin_trap (void) +This function causes the program to exit abnormally. GCC implements +this function by using a target-dependent mechanism (such as +intentionally executing an illegal instruction) or by calling +@code{abort}. The mechanism used may vary from release to release so +you should not rely on any particular implementation. +@end deftypefn + @deftypefn {Built-in Function} void __builtin_prefetch (const void *@var{addr}, ...) This function is used to minimize cache-miss latency by moving data into a cache before it is accessed. diff -Nru gcc/doc/gccint.texi gcc/doc/gccint.texi --- gcc/doc/gccint.texi 2010-10-14 22:24:15.000000000 +0200 +++ gcc/doc/gccint.texi 2012-12-31 17:06:05.000000000 +0100 @@ -152,7 +152,7 @@ @include funding.texi @include gnu.texi -@include gpl.texi +@include gpl_v3.texi @c --------------------------------------------------------------------- @c GFDL diff -Nru gcc/doc/include/gpl_v3.texi gcc/doc/include/gpl_v3.texi --- gcc/doc/include/gpl_v3.texi 1970-01-01 01:00:00.000000000 +0100 +++ gcc/doc/include/gpl_v3.texi 2012-12-31 17:06:05.000000000 +0100 @@ -0,0 +1,733 @@ +@ignore +@c Set file name and title for man page. +@setfilename gpl +@settitle GNU General Public License +@c man begin SEEALSO +gfdl(7), fsf-funding(7). +@c man end +@c man begin COPYRIGHT +Copyright @copyright{} 2007 Free Software Foundation, Inc. + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. +@c man end +@end ignore +@node Copying +@c man begin DESCRIPTION +@unnumbered GNU General Public License +@center Version 3, 29 June 2007 + +@c This file is intended to be included in another file. + +@display +Copyright @copyright{} 2007 Free Software Foundation, Inc. @url{http://fsf.org/} + +Everyone is permitted to copy and distribute verbatim copies of this +license document, but changing it is not allowed. +@end display + +@heading Preamble + +The GNU General Public License is a free, copyleft license for +software and other kinds of works. + +The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom +to share and change all versions of a program--to make sure it remains +free software for all its users. We, the Free Software Foundation, +use the GNU General Public License for most of our software; it +applies also to any other work released this way by its authors. You +can apply it to your programs, too. + +When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + +To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you +have certain responsibilities if you distribute copies of the +software, or if you modify it: responsibilities to respect the freedom +of others. + +For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, +receive or can get the source code. And you must show them these +terms so they know their rights. + +Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + +For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + +Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the +manufacturer can do so. This is fundamentally incompatible with the +aim of protecting users' freedom to change the software. The +systematic pattern of such abuse occurs in the area of products for +individuals to use, which is precisely where it is most unacceptable. +Therefore, we have designed this version of the GPL to prohibit the +practice for those products. If such problems arise substantially in +other domains, we stand ready to extend this provision to those +domains in future versions of the GPL, as needed to protect the +freedom of users. + +Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish +to avoid the special danger that patents applied to a free program +could make it effectively proprietary. To prevent this, the GPL +assures that patents cannot be used to render the program non-free. + +The precise terms and conditions for copying, distribution and +modification follow. + +@heading TERMS AND CONDITIONS + +@enumerate 0 +@item Definitions. + +``This License'' refers to version 3 of the GNU General Public License. + +``Copyright'' also means copyright-like laws that apply to other kinds +of works, such as semiconductor masks. + +``The Program'' refers to any copyrightable work licensed under this +License. Each licensee is addressed as ``you''. ``Licensees'' and +``recipients'' may be individuals or organizations. + +To ``modify'' a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of +an exact copy. The resulting work is called a ``modified version'' of +the earlier work or a work ``based on'' the earlier work. + +A ``covered work'' means either the unmodified Program or a work based +on the Program. + +To ``propagate'' a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + +To ``convey'' a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user +through a computer network, with no transfer of a copy, is not +conveying. + +An interactive user interface displays ``Appropriate Legal Notices'' to +the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + +@item Source Code. + +The ``source code'' for a work means the preferred form of the work for +making modifications to it. ``Object code'' means any non-source form +of a work. + +A ``Standard Interface'' means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + +The ``System Libraries'' of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +``Major Component'', in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + +The ``Corresponding Source'' for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + +The Corresponding Source need not include anything that users can +regenerate automatically from other parts of the Corresponding Source. + +The Corresponding Source for a work in source code form is that same +work. + +@item Basic Permissions. + +All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + +You may make, run and propagate covered works that you do not convey, +without conditions so long as your license otherwise remains in force. +You may convey covered works to others for the sole purpose of having +them make modifications exclusively for you, or provide you with +facilities for running those works, provided that you comply with the +terms of this License in conveying all material for which you do not +control copyright. Those thus making or running the covered works for +you must do so exclusively on your behalf, under your direction and +control, on terms that prohibit them from making any copies of your +copyrighted material outside their relationship with you. + +Conveying under any other circumstances is permitted solely under the +conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + +@item Protecting Users' Legal Rights From Anti-Circumvention Law. + +No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + +When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such +circumvention is effected by exercising rights under this License with +respect to the covered work, and you disclaim any intention to limit +operation or modification of the work as a means of enforcing, against +the work's users, your or third parties' legal rights to forbid +circumvention of technological measures. + +@item Conveying Verbatim Copies. + +You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + +You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + +@item Conveying Modified Source Versions. + +You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these +conditions: + +@enumerate a +@item +The work must carry prominent notices stating that you modified it, +and giving a relevant date. + +@item +The work must carry prominent notices stating that it is released +under this License and any conditions added under section 7. This +requirement modifies the requirement in section 4 to ``keep intact all +notices''. + +@item +You must license the entire work, as a whole, under this License to +anyone who comes into possession of a copy. This License will +therefore apply, along with any applicable section 7 additional terms, +to the whole of the work, and all its parts, regardless of how they +are packaged. This License gives no permission to license the work in +any other way, but it does not invalidate such permission if you have +separately received it. + +@item +If the work has interactive user interfaces, each must display +Appropriate Legal Notices; however, if the Program has interactive +interfaces that do not display Appropriate Legal Notices, your work +need not make them do so. +@end enumerate + +A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +``aggregate'' if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + +@item Conveying Non-Source Forms. + +You may convey a covered work in object code form under the terms of +sections 4 and 5, provided that you also convey the machine-readable +Corresponding Source under the terms of this License, in one of these +ways: + +@enumerate a +@item +Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by the +Corresponding Source fixed on a durable physical medium customarily +used for software interchange. + +@item +Convey the object code in, or embodied in, a physical product +(including a physical distribution medium), accompanied by a written +offer, valid for at least three years and valid for as long as you +offer spare parts or customer support for that product model, to give +anyone who possesses the object code either (1) a copy of the +Corresponding Source for all the software in the product that is +covered by this License, on a durable physical medium customarily used +for software interchange, for a price no more than your reasonable +cost of physically performing this conveying of source, or (2) access +to copy the Corresponding Source from a network server at no charge. + +@item +Convey individual copies of the object code with a copy of the written +offer to provide the Corresponding Source. This alternative is +allowed only occasionally and noncommercially, and only if you +received the object code with such an offer, in accord with subsection +6b. + +@item +Convey the object code by offering access from a designated place +(gratis or for a charge), and offer equivalent access to the +Corresponding Source in the same way through the same place at no +further charge. You need not require recipients to copy the +Corresponding Source along with the object code. If the place to copy +the object code is a network server, the Corresponding Source may be +on a different server (operated by you or a third party) that supports +equivalent copying facilities, provided you maintain clear directions +next to the object code saying where to find the Corresponding Source. +Regardless of what server hosts the Corresponding Source, you remain +obligated to ensure that it is available for as long as needed to +satisfy these requirements. + +@item +Convey the object code using peer-to-peer transmission, provided you +inform other peers where the object code and Corresponding Source of +the work are being offered to the general public at no charge under +subsection 6d. + +@end enumerate + +A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + +A ``User Product'' is either (1) a ``consumer product'', which means any +tangible personal property which is normally used for personal, +family, or household purposes, or (2) anything designed or sold for +incorporation into a dwelling. In determining whether a product is a +consumer product, doubtful cases shall be resolved in favor of +coverage. For a particular product received by a particular user, +``normally used'' refers to a typical or common use of that class of +product, regardless of the status of the particular user or of the way +in which the particular user actually uses, or expects or is expected +to use, the product. A product is a consumer product regardless of +whether the product has substantial commercial, industrial or +non-consumer uses, unless such uses represent the only significant +mode of use of the product. + +``Installation Information'' for a User Product means any methods, +procedures, authorization keys, or other information required to +install and execute modified versions of a covered work in that User +Product from a modified version of its Corresponding Source. The +information must suffice to ensure that the continued functioning of +the modified object code is in no case prevented or interfered with +solely because modification has been made. + +If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + +The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or +updates for a work that has been modified or installed by the +recipient, or for the User Product in which it has been modified or +installed. Access to a network may be denied when the modification +itself materially and adversely affects the operation of the network +or violates the rules and protocols for communication across the +network. + +Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + +@item Additional Terms. + +``Additional permissions'' are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + +When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + +Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders +of that material) supplement the terms of this License with terms: + +@enumerate a +@item +Disclaiming warranty or limiting liability differently from the terms +of sections 15 and 16 of this License; or + +@item +Requiring preservation of specified reasonable legal notices or author +attributions in that material or in the Appropriate Legal Notices +displayed by works containing it; or + +@item +Prohibiting misrepresentation of the origin of that material, or +requiring that modified versions of such material be marked in +reasonable ways as different from the original version; or + +@item +Limiting the use for publicity purposes of names of licensors or +authors of the material; or + +@item +Declining to grant rights under trademark law for use of some trade +names, trademarks, or service marks; or + +@item +Requiring indemnification of licensors and authors of that material by +anyone who conveys the material (or modified versions of it) with +contractual assumptions of liability to the recipient, for any +liability that these contractual assumptions directly impose on those +licensors and authors. +@end enumerate + +All other non-permissive additional terms are considered ``further +restrictions'' within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + +If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + +Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; the +above requirements apply either way. + +@item Termination. + +You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + +However, if you cease all violation of this License, then your license +from a particular copyright holder is reinstated (a) provisionally, +unless and until the copyright holder explicitly and finally +terminates your license, and (b) permanently, if the copyright holder +fails to notify you of the violation by some reasonable means prior to +60 days after the cessation. + +Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + +Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + +@item Acceptance Not Required for Having Copies. + +You are not required to accept this License in order to receive or run +a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + +@item Automatic Licensing of Downstream Recipients. + +Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + +An ``entity transaction'' is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + +You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + +@item Patents. + +A ``contributor'' is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's ``contributor version''. + +A contributor's ``essential patent claims'' are all patent claims owned +or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, ``control'' includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + +Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + +In the following three paragraphs, a ``patent license'' is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To ``grant'' such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + +If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. ``Knowingly relying'' means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + +If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + +A patent license is ``discriminatory'' if it does not include within the +scope of its coverage, prohibits the exercise of, or is conditioned on +the non-exercise of one or more of the rights that are specifically +granted under this License. You may not convey a covered work if you +are a party to an arrangement with a third party that is in the +business of distributing software, under which you make payment to the +third party based on the extent of your activity of conveying the +work, and under which the third party grants, to any of the parties +who would receive the covered work from you, a discriminatory patent +license (a) in connection with copies of the covered work conveyed by +you (or copies made from those copies), or (b) primarily for and in +connection with specific products or compilations that contain the +covered work, unless you entered into that arrangement, or that patent +license was granted, prior to 28 March 2007. + +Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + +@item No Surrender of Others' Freedom. + +If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey +a covered work so as to satisfy simultaneously your obligations under +this License and any other pertinent obligations, then as a +consequence you may not convey it at all. For example, if you agree +to terms that obligate you to collect a royalty for further conveying +from those to whom you convey the Program, the only way you could +satisfy both those terms and this License would be to refrain entirely +from conveying the Program. + +@item Use with the GNU Affero General Public License. + +Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + +@item Revised Versions of this License. + +The Free Software Foundation may publish revised and/or new versions +of the GNU General Public License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies that a certain numbered version of the GNU General Public +License ``or any later version'' applies to it, you have the option of +following the terms and conditions either of that numbered version or +of any later version published by the Free Software Foundation. If +the Program does not specify a version number of the GNU General +Public License, you may choose any version ever published by the Free +Software Foundation. + +If the Program specifies that a proxy can decide which future versions +of the GNU General Public License can be used, that proxy's public +statement of acceptance of a version permanently authorizes you to +choose that version for the Program. + +Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + +@item Disclaimer of Warranty. + +THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT +WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE +DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR +CORRECTION. + +@item Limitation of Liability. + +IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR +CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES +ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT +NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR +LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM +TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER +PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +@item Interpretation of Sections 15 and 16. + +If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + +@end enumerate + +@heading END OF TERMS AND CONDITIONS + +@heading How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these +terms. + +To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the ``copyright'' line and a pointer to where the full notice is found. + +@smallexample +@var{one line to give the program's name and a brief idea of what it does.} +Copyright (C) @var{year} @var{name of author} + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or (at +your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see @url{http://www.gnu.org/licenses/}. +@end smallexample + +Also add information on how to contact you by electronic and paper mail. + +If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + +@smallexample +@var{program} Copyright (C) @var{year} @var{name of author} +This program comes with ABSOLUTELY NO WARRANTY; for details type @samp{show w}. +This is free software, and you are welcome to redistribute it +under certain conditions; type @samp{show c} for details. +@end smallexample + +The hypothetical commands @samp{show w} and @samp{show c} should show +the appropriate parts of the General Public License. Of course, your +program's commands might be different; for a GUI interface, you would +use an ``about box''. + +You should also get your employer (if you work as a programmer) or school, +if any, to sign a ``copyright disclaimer'' for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +@url{http://www.gnu.org/licenses/}. + +The GNU General Public License does not permit incorporating your +program into proprietary programs. If your program is a subroutine +library, you may consider it more useful to permit linking proprietary +applications with the library. If this is what you want to do, use +the GNU Lesser General Public License instead of this License. But +first, please read @url{http://www.gnu.org/philosophy/why-not-lgpl.html}. +@c man end diff -Nru gcc/doc/include/texinfo.tex gcc/doc/include/texinfo.tex --- gcc/doc/include/texinfo.tex 2010-10-14 22:24:13.000000000 +0200 +++ gcc/doc/include/texinfo.tex 2012-12-31 17:06:05.000000000 +0100 @@ -3,16 +3,16 @@ % Load plain if necessary, i.e., if running under initex. \expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi % -\def\texinfoversion{2005-06-10.07} +\def\texinfoversion{2008-03-07.10} % % Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, -% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software -% Foundation, Inc. +% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, +% 2007, 2008 Free Software Foundation, Inc. % -% This texinfo.tex file is free software; you can redistribute it and/or +% This texinfo.tex 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. +% published by the Free Software Foundation, either version 3 of the +% License, or (at your option) any later version. % % This texinfo.tex file is distributed in the hope that it will be % useful, but WITHOUT ANY WARRANTY; without even the implied warranty @@ -20,9 +20,7 @@ % General Public License for more details. % % You should have received a copy of the GNU General Public License -% along with this texinfo.tex file; see the file COPYING. If not, write -% to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -% Boston, MA 02110-1301, USA. +% along with this program. If not, see . % % As a special exception, when this file is read by TeX when processing % a Texinfo source document, you may use the result without @@ -67,7 +65,7 @@ \everyjob{\message{[Texinfo version \texinfoversion]}% \catcode`+=\active \catcode`\_=\active} -\message{Basics,} + \chardef\other=12 % We never want plain's \outer definition of \+ in Texinfo. @@ -99,6 +97,7 @@ \let\ptexslash=\/ \let\ptexstar=\* \let\ptext=\t +\let\ptextop=\top % If this character appears in an error message or help string, it % starts a new line in the output. @@ -153,28 +152,22 @@ \ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi \ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi -% In some macros, we cannot use the `\? notation---the left quote is -% in some cases the escape char. -\chardef\backChar = `\\ +% Since the category of space is not known, we have to be careful. +\chardef\spacecat = 10 +\def\spaceisspace{\catcode`\ =\spacecat} + +% sometimes characters are active, so we need control sequences. \chardef\colonChar = `\: \chardef\commaChar = `\, +\chardef\dashChar = `\- \chardef\dotChar = `\. \chardef\exclamChar= `\! -\chardef\plusChar = `\+ +\chardef\lquoteChar= `\` \chardef\questChar = `\? +\chardef\rquoteChar= `\' \chardef\semiChar = `\; \chardef\underChar = `\_ -\chardef\spaceChar = `\ % -\chardef\spacecat = 10 -\def\spaceisspace{\catcode\spaceChar=\spacecat} - -{% for help with debugging. - % example usage: \expandafter\show\activebackslash - \catcode`\! = 0 \catcode`\\ = \active - !global!def!activebackslash{\} -} - % Ignore a token. % \def\gobble#1{} @@ -285,6 +278,50 @@ \newdimen\cornerthick \cornerthick=.3pt \newdimen\topandbottommargin \topandbottommargin=.75in +% Output a mark which sets \thischapter, \thissection and \thiscolor. +% We dump everything together because we only have one kind of mark. +% This works because we only use \botmark / \topmark, not \firstmark. +% +% A mark contains a subexpression of the \ifcase ... \fi construct. +% \get*marks macros below extract the needed part using \ifcase. +% +% Another complication is to let the user choose whether \thischapter +% (\thissection) refers to the chapter (section) in effect at the top +% of a page, or that at the bottom of a page. The solution is +% described on page 260 of The TeXbook. It involves outputting two +% marks for the sectioning macros, one before the section break, and +% one after. I won't pretend I can describe this better than DEK... +\def\domark{% + \toks0=\expandafter{\lastchapterdefs}% + \toks2=\expandafter{\lastsectiondefs}% + \toks4=\expandafter{\prevchapterdefs}% + \toks6=\expandafter{\prevsectiondefs}% + \toks8=\expandafter{\lastcolordefs}% + \mark{% + \the\toks0 \the\toks2 + \noexpand\or \the\toks4 \the\toks6 + \noexpand\else \the\toks8 + }% +} +% \topmark doesn't work for the very first chapter (after the title +% page or the contents), so we use \firstmark there -- this gets us +% the mark with the chapter defs, unless the user sneaks in, e.g., +% @setcolor (or @url, or @link, etc.) between @contents and the very +% first @chapter. +\def\gettopheadingmarks{% + \ifcase0\topmark\fi + \ifx\thischapter\empty \ifcase0\firstmark\fi \fi +} +\def\getbottomheadingmarks{\ifcase1\botmark\fi} +\def\getcolormarks{\ifcase2\topmark\fi} + +% Avoid "undefined control sequence" errors. +\def\lastchapterdefs{} +\def\lastsectiondefs{} +\def\prevchapterdefs{} +\def\prevsectiondefs{} +\def\lastcolordefs{} + % Main output routine. \chardef\PAGE = 255 \output = {\onepageout{\pagecontents\PAGE}} @@ -302,7 +339,9 @@ % % Do this outside of the \shipout so @code etc. will be expanded in % the headline as they should be, not taken literally (outputting ''code). + \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% + \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% % {% @@ -310,10 +349,14 @@ % take effect in \write's, yet the group defined by the \vbox ends % before the \shipout runs. % - \escapechar = `\\ % use backslash in output files. \indexdummies % don't expand commands in the output. \normalturnoffactive % \ in index entries must not stay \, e.g., if - % the page break happens to be in the middle of an example. + % the page break happens to be in the middle of an example. + % We don't want .vr (or whatever) entries like this: + % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} + % "\acronym" won't work when it's read back in; + % it needs to be + % {\code {{\tt \backslashcurfont }acronym} \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi @@ -341,9 +384,9 @@ \pagebody{#1}% \ifdim\ht\footlinebox > 0pt % Only leave this space if the footline is nonempty. - % (We lessened \vsize for it in \oddfootingxxx.) + % (We lessened \vsize for it in \oddfootingyyy.) % The \baselineskip=24pt in plain's \makefootline has no effect. - \vskip 2\baselineskip + \vskip 24pt \unvbox\footlinebox \fi % @@ -364,7 +407,7 @@ \egroup % \vbox from first cropmarks clause \fi }% end of \shipout\vbox - }% end of group with \normalturnoffactive + }% end of group with \indexdummies \advancepageno \ifnum\outputpenalty>-20000 \else\dosupereject\fi } @@ -377,7 +420,7 @@ % marginal hacks, juha@viisa.uucp (Juha Takala) \ifvoid\margin\else % marginal info is present \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi -\dimen@=\dp#1 \unvbox#1 +\dimen@=\dp#1\relax \unvbox#1\relax \ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi \ifr@ggedbottom \kern-\dimen@ \vfil \fi} } @@ -399,7 +442,7 @@ % \def\parsearg{\parseargusing{}} \def\parseargusing#1#2{% - \def\next{#2}% + \def\argtorun{#2}% \begingroup \obeylines \spaceisspace @@ -430,8 +473,7 @@ \def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% \def\temp{#3}% \ifx\temp\empty - % We cannot use \next here, as it holds the macro to run; - % thus we reuse \temp. + % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: \let\temp\finishparsearg \else \let\temp\argcheckspaces @@ -443,14 +485,14 @@ % If a _delimited_ argument is enclosed in braces, they get stripped; so % to get _exactly_ the rest of the line, we had to prevent such situation. % We prepended an \empty token at the very beginning and we expand it now, -% just before passing the control to \next. +% just before passing the control to \argtorun. % (Similarily, we have to think about #3 of \argcheckspacesY above: it is % either the null string, or it ends with \^^M---thus there is no danger % that a pair of braces would be stripped. % % But first, we have to remove the trailing space token. % -\def\finishparsearg#1 \ArgTerm{\expandafter\next\expandafter{#1}} +\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} % \parseargdef\foo{...} % is roughly equivalent to @@ -875,15 +917,19 @@ \temp } -% @include file insert text of that file as input. +% @include FILE -- \input text of FILE. % \def\include{\parseargusing\filenamecatcodes\includezzz} \def\includezzz#1{% \pushthisfilestack \def\thisfile{#1}% {% - \makevalueexpandable - \def\temp{\input #1 }% + \makevalueexpandable % we want to expand any @value in FILE. + \turnoffactive % and allow special characters in the expansion + \edef\temp{\noexpand\input #1 }% + % + % This trickery is to read FILE outside of a group, in case it makes + % definitions, etc. \expandafter }\temp \popthisfilestack @@ -1054,9 +1100,9 @@ % _ active, and distinguish by seeing if the current family is \slfam, % which is what @var uses. { - \catcode\underChar = \active + \catcode`\_ = \active \gdef\mathunderscore{% - \catcode\underChar=\active + \catcode`\_=\active \def_{\ifnum\fam=\slfam \_\else\sb\fi}% } } @@ -1099,15 +1145,24 @@ \def\minus{$-$} % @dots{} outputs an ellipsis using the current font. -% We do .5em per period so that it has the same spacing in a typewriter -% font as three actual period characters. +% We do .5em per period so that it has the same spacing in the cm +% typewriter fonts as three actual period characters; on the other hand, +% in other typewriter fonts three periods are wider than 1.5em. So do +% whichever is larger. % \def\dots{% \leavevmode - \hbox to 1.5em{% - \hskip 0pt plus 0.25fil - .\hfil.\hfil.% - \hskip 0pt plus 0.5fil + \setbox0=\hbox{...}% get width of three periods + \ifdim\wd0 > 1.5em + \dimen0 = \wd0 + \else + \dimen0 = 1.5em + \fi + \hbox to \dimen0{% + \hskip 0pt plus.25fil + .\hskip 0pt plus1fil + .\hskip 0pt plus1fil + .\hskip 0pt plus.5fil }% } @@ -1200,28 +1255,28 @@ \fi \fi -% PDF uses PostScript string constants for the names of xref targets, to +% PDF uses PostScript string constants for the names of xref targets, % for display in the outlines, and in other places. Thus, we have to % double any backslashes. Otherwise, a name like "\node" will be % interpreted as a newline (\n), followed by o, d, e. Not good. % http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html % (and related messages, the final outcome is that it is up to the TeX % user to double the backslashes and otherwise make the string valid, so -% that's we do). +% that's what we do). % double active backslashes. % {\catcode`\@=0 \catcode`\\=\active - @gdef@activebackslash{@catcode`@\=@active @otherbackslash} @gdef@activebackslashdouble{% - @catcode@backChar=@active + @catcode`@\=@active @let\=@doublebackslash} } % To handle parens, we must adopt a different approach, since parens are % not active characters. hyperref.dtx (which has the same problem as -% us) handles it with this amazing macro to replace tokens. I've -% tinkered with it a little for texinfo, but it's definitely from there. +% us) handles it with this amazing macro to replace tokens, with minor +% changes for Texinfo. It is included here under the GPL by permission +% from the author, Heiko Oberdiek. % % #1 is the tokens to replace. % #2 is the replacement. @@ -1246,21 +1301,87 @@ \def\backslashparens#1{% \xdef#1{#1}% redefine it as its expansion; the definition is simply % \lastnode when called from \setref -> \pdfmkdest. - \HyPsdSubst{(}{\backslashlparen}{#1}% - \HyPsdSubst{)}{\backslashrparen}{#1}% + \HyPsdSubst{(}{\realbackslash(}{#1}% + \HyPsdSubst{)}{\realbackslash)}{#1}% } -{\catcode\exclamChar = 0 \catcode\backChar = \other - !gdef!backslashlparen{\(}% - !gdef!backslashrparen{\)}% -} +\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images +with PDF output, and none of those formats could be found. (.eps cannot +be supported due to the design of the PDF format; use regular TeX (DVI +output) for that.)} \ifpdf - \input pdfcolor - \pdfcatalog{/PageMode /UseOutlines}% + % + % Color manipulation macros based on pdfcolor.tex. + \def\cmykDarkRed{0.28 1 1 0.35} + \def\cmykBlack{0 0 0 1} + % + \def\pdfsetcolor#1{\pdfliteral{#1 k}} + % Set color, and create a mark which defines \thiscolor accordingly, + % so that \makeheadline knows which color to restore. + \def\setcolor#1{% + \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% + \domark + \pdfsetcolor{#1}% + } + % + \def\maincolor{\cmykBlack} + \pdfsetcolor{\maincolor} + \edef\thiscolor{\maincolor} + \def\lastcolordefs{} + % + \def\makefootline{% + \baselineskip24pt + \line{\pdfsetcolor{\maincolor}\the\footline}% + } + % + \def\makeheadline{% + \vbox to 0pt{% + \vskip-22.5pt + \line{% + \vbox to8.5pt{}% + % Extract \thiscolor definition from the marks. + \getcolormarks + % Typeset the headline with \maincolor, then restore the color. + \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% + }% + \vss + }% + \nointerlineskip + } + % + % + \pdfcatalog{/PageMode /UseOutlines} + % + % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). \def\dopdfimage#1#2#3{% - \def\imagewidth{#2}% - \def\imageheight{#3}% + \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% + \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% + % + % pdftex (and the PDF format) support .png, .jpg, .pdf (among + % others). Let's try in that order. + \let\pdfimgext=\empty + \begingroup + \openin 1 #1.png \ifeof 1 + \openin 1 #1.jpg \ifeof 1 + \openin 1 #1.jpeg \ifeof 1 + \openin 1 #1.JPG \ifeof 1 + \openin 1 #1.pdf \ifeof 1 + \errhelp = \nopdfimagehelp + \errmessage{Could not find image file #1 for pdf}% + \else \gdef\pdfimgext{pdf}% + \fi + \else \gdef\pdfimgext{JPG}% + \fi + \else \gdef\pdfimgext{jpeg}% + \fi + \else \gdef\pdfimgext{jpg}% + \fi + \else \gdef\pdfimgext{png}% + \fi + \closein 1 + \endgroup + % % without \immediate, pdftex seg faults when the same image is % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) \ifnum\pdftexversion < 14 @@ -1268,32 +1389,38 @@ \else \immediate\pdfximage \fi - \ifx\empty\imagewidth\else width \imagewidth \fi - \ifx\empty\imageheight\else height \imageheight \fi + \ifdim \wd0 >0pt width \imagewidth \fi + \ifdim \wd2 >0pt height \imageheight \fi \ifnum\pdftexversion<13 - #1.pdf% + #1.\pdfimgext \else - {#1.pdf}% + {#1.\pdfimgext}% \fi \ifnum\pdftexversion < 14 \else \pdfrefximage \pdflastximage \fi} + % \def\pdfmkdest#1{{% % We have to set dummies so commands such as @code, and characters % such as \, aren't expanded when present in a section title. - \atdummies + \indexnofonts \turnoffactive \activebackslashdouble + \makevalueexpandable \def\pdfdestname{#1}% \backslashparens\pdfdestname - \pdfdest name{\pdfdestname} xyz% - }}% + \safewhatsit{\pdfdest name{\pdfdestname} xyz}% + }} % % used to mark target names; must be expandable. - \def\pdfmkpgn#1{#1}% + \def\pdfmkpgn#1{#1} + % + % by default, use a color that is dark enough to print on paper as + % nearly black, but still distinguishable for online viewing. + \def\urlcolor{\cmykDarkRed} + \def\linkcolor{\cmykDarkRed} + \def\endlink{\setcolor{\maincolor}\pdfendlink} % - \let\linkcolor = \Blue % was Cyan, but that seems light? - \def\endlink{\Black\pdfendlink} % Adding outlines to PDF; macros for calculating structure of outlines % come from Petr Olsak \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% @@ -1394,8 +1521,8 @@ % now, I guess we'll just let the pdf reader have its way. \indexnofonts \setupdatafile - \activebackslash - \input \jobname.toc + \catcode`\\=\active \otherbackslash + \input \tocreadfilename \endgroup } % @@ -1413,11 +1540,19 @@ \else \let \startlink \pdfstartlink \fi + % make a live url in pdf output. \def\pdfurl#1{% \begingroup - \normalturnoffactive\def\@{@}% + % it seems we really need yet another set of dummies; have not + % tried to figure out what each command should do in the context + % of @url. for now, just make @/ a no-op, that's the only one + % people have actually reported a problem with. + % + \normalturnoffactive + \def\@{@}% + \let\/=\empty \makevalueexpandable - \leavevmode\Red + \leavevmode\setcolor{\urlcolor}% \startlink attr{/Border [0 0 0]}% user{/Subtype /Link /A << /S /URI /URI (#1) >>}% \endgroup} @@ -1444,13 +1579,14 @@ {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} \def\pdflink#1{% \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} - \linkcolor #1\endlink} + \setcolor{\linkcolor}#1\endlink} \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} \else \let\pdfmkdest = \gobble \let\pdfurl = \gobble \let\endlink = \relax - \let\linkcolor = \relax + \let\setcolor = \gobble + \let\pdfsetcolor = \gobble \let\pdfmakeoutlines = \relax \fi % \ifx\pdfoutput @@ -1485,6 +1621,7 @@ % We don't need math for this font style. \def\ttsl{\setfontstyle{ttsl}} + % Default leading. \newdimen\textleading \textleading = 13.2pt @@ -1496,8 +1633,12 @@ \def\strutheightpercent{.70833} \def\strutdepthpercent {.29167} % +% can get a sort of poor man's double spacing by redefining this. +\def\baselinefactor{1} +% \def\setleading#1{% - \normalbaselineskip = #1\relax + \dimen0 = #1\relax + \normalbaselineskip = \baselinefactor\dimen0 \normallineskip = \lineskipfactor\normalbaselineskip \normalbaselines \setbox\strutbox =\hbox{% @@ -1506,10 +1647,279 @@ }% } +% PDF CMaps. See also LaTeX's t1.cmap. +% +% do nothing with this by default. +\expandafter\let\csname cmapOT1\endcsname\gobble +\expandafter\let\csname cmapOT1IT\endcsname\gobble +\expandafter\let\csname cmapOT1TT\endcsname\gobble + +% if we are producing pdf, and we have \pdffontattr, then define cmaps. +% (\pdffontattr was introduced many years ago, but people still run +% older pdftex's; it's easy to conditionalize, so we do.) +\ifpdf \ifx\pdffontattr\undefined \else + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1-0) +%%Title: (TeX-OT1-0 TeX OT1 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1) +/Supplement 0 +>> def +/CMapName /TeX-OT1-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<23> <26> <0023> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +40 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1IT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1IT-0) +%%Title: (TeX-OT1IT-0 TeX OT1IT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1IT) +/Supplement 0 +>> def +/CMapName /TeX-OT1IT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<25> <26> <0025> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +42 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<23> <0023> +<24> <00A3> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1IT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1TT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1TT-0) +%%Title: (TeX-OT1TT-0 TeX OT1TT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1TT) +/Supplement 0 +>> def +/CMapName /TeX-OT1TT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +5 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<21> <26> <0021> +<28> <5F> <0028> +<61> <7E> <0061> +endbfrange +32 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <2191> +<0C> <2193> +<0D> <0027> +<0E> <00A1> +<0F> <00BF> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<20> <2423> +<27> <2019> +<60> <2018> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1TT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +\fi\fi + + % Set the font macro #1 to the font named #2, adding on the % specified font prefix (normally `cm'). -% #3 is the font's design size, #4 is a scale factor -\def\setfont#1#2#3#4{\font#1=\fontprefix#2#3 scaled #4} +% #3 is the font's design size, #4 is a scale factor, #5 is the CMap +% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass +% empty to omit). +\def\setfont#1#2#3#4#5{% + \font#1=\fontprefix#2#3 scaled #4 + \csname cmap#5\endcsname#1% +} +% This is what gets called when #5 of \setfont is empty. +\let\cmap\gobble +% emacs-page end of cmaps % Use cm as the default font prefix. % To specify the font prefix, you must define \fontprefix @@ -1534,118 +1944,297 @@ \def\scshape{csc} \def\scbshape{csc} +% Definitions for a main text size of 11pt. This is the default in +% Texinfo. +% +\def\definetextfontsizexi{% % Text fonts (11.2pt, magstep1). \def\textnominalsize{11pt} \edef\mainmagstep{\magstephalf} -\setfont\textrm\rmshape{10}{\mainmagstep} -\setfont\texttt\ttshape{10}{\mainmagstep} -\setfont\textbf\bfshape{10}{\mainmagstep} -\setfont\textit\itshape{10}{\mainmagstep} -\setfont\textsl\slshape{10}{\mainmagstep} -\setfont\textsf\sfshape{10}{\mainmagstep} -\setfont\textsc\scshape{10}{\mainmagstep} -\setfont\textttsl\ttslshape{10}{\mainmagstep} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} \font\texti=cmmi10 scaled \mainmagstep \font\textsy=cmsy10 scaled \mainmagstep +\def\textecsize{1095} % A few fonts for @defun names and args. -\setfont\defbf\bfshape{10}{\magstep1} -\setfont\deftt\ttshape{10}{\magstep1} -\setfont\defttsl\ttslshape{10}{\magstep1} +\setfont\defbf\bfshape{10}{\magstep1}{OT1} +\setfont\deftt\ttshape{10}{\magstep1}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} \def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} % Fonts for indices, footnotes, small examples (9pt). \def\smallnominalsize{9pt} -\setfont\smallrm\rmshape{9}{1000} -\setfont\smalltt\ttshape{9}{1000} -\setfont\smallbf\bfshape{10}{900} -\setfont\smallit\itshape{9}{1000} -\setfont\smallsl\slshape{9}{1000} -\setfont\smallsf\sfshape{9}{1000} -\setfont\smallsc\scshape{10}{900} -\setfont\smallttsl\ttslshape{10}{900} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} \font\smalli=cmmi9 \font\smallsy=cmsy9 +\def\smallecsize{0900} % Fonts for small examples (8pt). \def\smallernominalsize{8pt} -\setfont\smallerrm\rmshape{8}{1000} -\setfont\smallertt\ttshape{8}{1000} -\setfont\smallerbf\bfshape{10}{800} -\setfont\smallerit\itshape{8}{1000} -\setfont\smallersl\slshape{8}{1000} -\setfont\smallersf\sfshape{8}{1000} -\setfont\smallersc\scshape{10}{800} -\setfont\smallerttsl\ttslshape{10}{800} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} \font\smalleri=cmmi8 \font\smallersy=cmsy8 +\def\smallerecsize{0800} % Fonts for title page (20.4pt): \def\titlenominalsize{20pt} -\setfont\titlerm\rmbshape{12}{\magstep3} -\setfont\titleit\itbshape{10}{\magstep4} -\setfont\titlesl\slbshape{10}{\magstep4} -\setfont\titlett\ttbshape{12}{\magstep3} -\setfont\titlettsl\ttslshape{10}{\magstep4} -\setfont\titlesf\sfbshape{17}{\magstep1} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} \let\titlebf=\titlerm -\setfont\titlesc\scbshape{10}{\magstep4} +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} \font\titlei=cmmi12 scaled \magstep3 \font\titlesy=cmsy10 scaled \magstep4 \def\authorrm{\secrm} \def\authortt{\sectt} +\def\titleecsize{2074} % Chapter (and unnumbered) fonts (17.28pt). \def\chapnominalsize{17pt} -\setfont\chaprm\rmbshape{12}{\magstep2} -\setfont\chapit\itbshape{10}{\magstep3} -\setfont\chapsl\slbshape{10}{\magstep3} -\setfont\chaptt\ttbshape{12}{\magstep2} -\setfont\chapttsl\ttslshape{10}{\magstep3} -\setfont\chapsf\sfbshape{17}{1000} +\setfont\chaprm\rmbshape{12}{\magstep2}{OT1} +\setfont\chapit\itbshape{10}{\magstep3}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep3}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} +\setfont\chapsf\sfbshape{17}{1000}{OT1} \let\chapbf=\chaprm -\setfont\chapsc\scbshape{10}{\magstep3} +\setfont\chapsc\scbshape{10}{\magstep3}{OT1} \font\chapi=cmmi12 scaled \magstep2 \font\chapsy=cmsy10 scaled \magstep3 +\def\chapecsize{1728} % Section fonts (14.4pt). \def\secnominalsize{14pt} -\setfont\secrm\rmbshape{12}{\magstep1} -\setfont\secit\itbshape{10}{\magstep2} -\setfont\secsl\slbshape{10}{\magstep2} -\setfont\sectt\ttbshape{12}{\magstep1} -\setfont\secttsl\ttslshape{10}{\magstep2} -\setfont\secsf\sfbshape{12}{\magstep1} +\setfont\secrm\rmbshape{12}{\magstep1}{OT1} +\setfont\secit\itbshape{10}{\magstep2}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep2}{OT1} +\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\secsf\sfbshape{12}{\magstep1}{OT1} \let\secbf\secrm -\setfont\secsc\scbshape{10}{\magstep2} +\setfont\secsc\scbshape{10}{\magstep2}{OT1} \font\seci=cmmi12 scaled \magstep1 \font\secsy=cmsy10 scaled \magstep2 +\def\sececsize{1440} % Subsection fonts (13.15pt). \def\ssecnominalsize{13pt} -\setfont\ssecrm\rmbshape{12}{\magstephalf} -\setfont\ssecit\itbshape{10}{1315} -\setfont\ssecsl\slbshape{10}{1315} -\setfont\ssectt\ttbshape{12}{\magstephalf} -\setfont\ssecttsl\ttslshape{10}{1315} -\setfont\ssecsf\sfbshape{12}{\magstephalf} +\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} +\setfont\ssecit\itbshape{10}{1315}{OT1IT} +\setfont\ssecsl\slbshape{10}{1315}{OT1} +\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} +\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} \let\ssecbf\ssecrm -\setfont\ssecsc\scbshape{10}{1315} +\setfont\ssecsc\scbshape{10}{1315}{OT1} \font\sseci=cmmi12 scaled \magstephalf \font\ssecsy=cmsy10 scaled 1315 +\def\ssececsize{1200} % Reduced fonts for @acro in text (10pt). \def\reducednominalsize{10pt} -\setfont\reducedrm\rmshape{10}{1000} -\setfont\reducedtt\ttshape{10}{1000} -\setfont\reducedbf\bfshape{10}{1000} -\setfont\reducedit\itshape{10}{1000} -\setfont\reducedsl\slshape{10}{1000} -\setfont\reducedsf\sfshape{10}{1000} -\setfont\reducedsc\scshape{10}{1000} -\setfont\reducedttsl\ttslshape{10}{1000} +\setfont\reducedrm\rmshape{10}{1000}{OT1} +\setfont\reducedtt\ttshape{10}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{1000}{OT1} +\setfont\reducedit\itshape{10}{1000}{OT1IT} +\setfont\reducedsl\slshape{10}{1000}{OT1} +\setfont\reducedsf\sfshape{10}{1000}{OT1} +\setfont\reducedsc\scshape{10}{1000}{OT1} +\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} \font\reducedi=cmmi10 \font\reducedsy=cmsy10 +\def\reducedecsize{1000} + +% reset the current fonts +\textfonts +\rm +} % end of 11pt text font size definitions + + +% Definitions to make the main text be 10pt Computer Modern, with +% section, chapter, etc., sizes following suit. This is for the GNU +% Press printing of the Emacs 22 manual. Maybe other manuals in the +% future. Used with @smallbook, which sets the leading to 12pt. +% +\def\definetextfontsizex{% +% Text fonts (10pt). +\def\textnominalsize{10pt} +\edef\mainmagstep{1000} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep +\def\textecsize{1000} + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstephalf}{OT1} +\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 +\def\smallecsize{0900} + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 +\def\smallerecsize{0800} + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\authorrm{\secrm} +\def\authortt{\sectt} +\def\titleecsize{2074} + +% Chapter fonts (14.4pt). +\def\chapnominalsize{14pt} +\setfont\chaprm\rmbshape{12}{\magstep1}{OT1} +\setfont\chapit\itbshape{10}{\magstep2}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep2}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\chapsf\sfbshape{12}{\magstep1}{OT1} +\let\chapbf\chaprm +\setfont\chapsc\scbshape{10}{\magstep2}{OT1} +\font\chapi=cmmi12 scaled \magstep1 +\font\chapsy=cmsy10 scaled \magstep2 +\def\chapecsize{1440} + +% Section fonts (12pt). +\def\secnominalsize{12pt} +\setfont\secrm\rmbshape{12}{1000}{OT1} +\setfont\secit\itbshape{10}{\magstep1}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep1}{OT1} +\setfont\sectt\ttbshape{12}{1000}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} +\setfont\secsf\sfbshape{12}{1000}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep1}{OT1} +\font\seci=cmmi12 +\font\secsy=cmsy10 scaled \magstep1 +\def\sececsize{1200} + +% Subsection fonts (10pt). +\def\ssecnominalsize{10pt} +\setfont\ssecrm\rmbshape{10}{1000}{OT1} +\setfont\ssecit\itbshape{10}{1000}{OT1IT} +\setfont\ssecsl\slbshape{10}{1000}{OT1} +\setfont\ssectt\ttbshape{10}{1000}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} +\setfont\ssecsf\sfbshape{10}{1000}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1000}{OT1} +\font\sseci=cmmi10 +\font\ssecsy=cmsy10 +\def\ssececsize{1000} + +% Reduced fonts for @acro in text (9pt). +\def\reducednominalsize{9pt} +\setfont\reducedrm\rmshape{9}{1000}{OT1} +\setfont\reducedtt\ttshape{9}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{900}{OT1} +\setfont\reducedit\itshape{9}{1000}{OT1IT} +\setfont\reducedsl\slshape{9}{1000}{OT1} +\setfont\reducedsf\sfshape{9}{1000}{OT1} +\setfont\reducedsc\scshape{10}{900}{OT1} +\setfont\reducedttsl\ttslshape{10}{900}{OT1TT} +\font\reducedi=cmmi9 +\font\reducedsy=cmsy9 +\def\reducedecsize{0900} + +% reduce space between paragraphs +\divide\parskip by 2 + +% reset the current fonts +\textfonts +\rm +} % end of 10pt text font size definitions + + +% We provide the user-level command +% @fonttextsize 10 +% (or 11) to redefine the text font size. pt is assumed. +% +\def\xword{10} +\def\xiword{11} +% +\parseargdef\fonttextsize{% + \def\textsizearg{#1}% + \wlog{doing @fonttextsize \textsizearg}% + % + % Set \globaldefs so that documents can use this inside @tex, since + % makeinfo 4.8 does not support it, but we need it nonetheless. + % + \begingroup \globaldefs=1 + \ifx\textsizearg\xword \definetextfontsizex + \else \ifx\textsizearg\xiword \definetextfontsizexi + \else + \errhelp=\EMsimple + \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} + \fi\fi + \endgroup +} + % In order for the font changes to affect most math symbols and letters, % we have to define the \textfont of the standard families. Since @@ -1757,7 +2346,7 @@ % Set up the default fonts, so we can use them for creating boxes. % -\textfonts \rm +\definetextfontsizexi % Define these so they can be easily changed for other fonts. \def\angleleft{$\langle$} @@ -1767,10 +2356,10 @@ \newcount\fontdepth \fontdepth=0 % Fonts for short table of contents. -\setfont\shortcontrm\rmshape{12}{1000} -\setfont\shortcontbf\bfshape{10}{\magstep1} % no cmb12 -\setfont\shortcontsl\slshape{12}{1000} -\setfont\shortconttt\ttshape{12}{1000} +\setfont\shortcontrm\rmshape{12}{1000}{OT1} +\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 +\setfont\shortcontsl\slshape{12}{1000}{OT1} +\setfont\shortconttt\ttshape{12}{1000}{OT1TT} %% Add scribe-like font environments, plus @l for inline lisp (usually sans %% serif) and @ii for TeX italic @@ -1833,7 +2422,7 @@ \null } \def\samp#1{`\tclose{#1}'\null} -\setfont\keyrm\rmshape{8}{1000} +\setfont\keyrm\rmshape{8}{1000}{OT1} \font\keysy=cmsy9 \def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% @@ -1841,6 +2430,7 @@ \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% \kern-0.4pt\hrule}% \kern-.06em\raise0.4pt\hbox{\angleright}}}} +\def\key #1{{\nohyphenation \uppercase{#1}}\null} % The old definition, with no lozenge: %\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} \def\ctrl #1{{\tt \rawbackslash \hat}#1} @@ -1882,11 +2472,14 @@ % and arrange explicitly to hyphenate at a dash. % -- rms. { - \catcode`\-=\active - \catcode`\_=\active + \catcode`\-=\active \catcode`\_=\active + \catcode`\'=\active \catcode`\`=\active % \global\def\code{\begingroup - \catcode`\-=\active \catcode`\_=\active + \catcode\rquoteChar=\active \catcode\lquoteChar=\active + \let'\codequoteright \let`\codequoteleft + % + \catcode\dashChar=\active \catcode\underChar=\active \ifallowcodebreaks \let-\codedash \let_\codeunder @@ -1972,6 +2565,13 @@ \let\env=\code \let\command=\code +% @clicksequence{File @click{} Open ...} +\def\clicksequence#1{\begingroup #1\endgroup} + +% @clickstyle @arrow (by default) +\parseargdef\clickstyle{\def\click{#1}} +\def\click{\arrow} + % @uref (abbreviation for `urlref') takes an optional (comma-separated) % second argument specifying the text to display and an optional third % arg as text to display instead of (rather than in addition to) the url @@ -2122,6 +2722,35 @@ \thiseurofont } +% Hacks for glyphs from the EC fonts similar to \euro. We don't +% use \let for the aliases, because sometimes we redefine the original +% macro, and the alias should reflect the redefinition. +\def\guillemetleft{{\ecfont \char"13}} +\def\guillemotleft{\guillemetleft} +\def\guillemetright{{\ecfont \char"14}} +\def\guillemotright{\guillemetright} +\def\guilsinglleft{{\ecfont \char"0E}} +\def\guilsinglright{{\ecfont \char"0F}} +\def\quotedblbase{{\ecfont \char"12}} +\def\quotesinglbase{{\ecfont \char"0D}} +% +\def\ecfont{% + % We can't distinguish serif/sanserif and italic/slanted, but this + % is used for crude hacks anyway (like adding French and German + % quotes to documents typeset with CM, where we lose kerning), so + % hopefully nobody will notice/care. + \edef\ecsize{\csname\curfontsize ecsize\endcsname}% + \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% + \ifx\curfontstyle\bfstylename + % bold: + \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize + \else + % regular: + \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \fi + \thisecfont +} + % @registeredsymbol - R in a circle. The font for the R should really % be smaller yet, but lllsize is the best we can do for now. % Adapted from the plain.tex definition of \copyright. @@ -2132,6 +2761,10 @@ }$% } +% @textdegree - the normal degrees sign. +% +\def\textdegree{$^\circ$} + % Laurent Siebenmann reports \Orb undefined with: % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 % so we'll define it if necessary. @@ -2140,6 +2773,12 @@ \def\Orb{\mathhexbox20D} \fi +% Quotes. +\chardef\quotedblleft="5C +\chardef\quotedblright=`\" +\chardef\quoteleft=`\` +\chardef\quoteright=`\' + \message{page headings,} @@ -2303,12 +2942,39 @@ % % Leave some space for the footline. Hopefully ok to assume % @evenfooting will not be used by itself. - \global\advance\pageheight by -\baselineskip - \global\advance\vsize by -\baselineskip + \global\advance\pageheight by -12pt + \global\advance\vsize by -12pt } \parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} +% @evenheadingmarks top \thischapter <- chapter at the top of a page +% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page +% +% The same set of arguments for: +% +% @oddheadingmarks +% @evenfootingmarks +% @oddfootingmarks +% @everyheadingmarks +% @everyfootingmarks + +\def\evenheadingmarks{\headingmarks{even}{heading}} +\def\oddheadingmarks{\headingmarks{odd}{heading}} +\def\evenfootingmarks{\headingmarks{even}{footing}} +\def\oddfootingmarks{\headingmarks{odd}{footing}} +\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} + \headingmarks{odd}{heading}{#1} } +\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} + \headingmarks{odd}{footing}{#1} } +% #1 = even/odd, #2 = heading/footing, #3 = top/bottom. +\def\headingmarks#1#2#3 {% + \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname + \global\expandafter\let\csname get#1#2marks\endcsname \temp +} + +\everyheadingmarks bottom +\everyfootingmarks bottom % @headings double turns headings on for double-sided printing. % @headings single turns headings on for single-sided printing. @@ -2963,6 +3629,7 @@ \def\doignore#1{\begingroup % Scan in ``verbatim'' mode: + \obeylines \catcode`\@ = \other \catcode`\{ = \other \catcode`\} = \other @@ -2983,16 +3650,16 @@ \gdef\dodoignore#1{% % #1 contains the command name as a string, e.g., `ifinfo'. % - % Define a command to find the next `@end #1', which must be on a line - % by itself. - \long\def\doignoretext##1^^M@end #1{\doignoretextyyy##1^^M@#1\_STOP_}% + % Define a command to find the next `@end #1'. + \long\def\doignoretext##1^^M@end #1{% + \doignoretextyyy##1^^M@#1\_STOP_}% + % % And this command to find another #1 command, at the beginning of a % line. (Otherwise, we would consider a line `@c @ifset', for % example, to count as an @ifset for nesting.) \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% % % And now expand that command. - \obeylines % \doignoretext ^^M% }% } @@ -3022,7 +3689,12 @@ } % Finish off ignored text. -\def\enddoignore{\endgroup\ignorespaces} +{ \obeylines% + % Ignore anything after the last `@end #1'; this matters in verbatim + % environments, where otherwise the newline after an ignored conditional + % would result in a blank line in the output. + \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% +} % @set VAR sets the variable VAR to an empty value. @@ -3222,34 +3894,41 @@ % we have to laboriously prevent expansion for those that we don't. % \def\indexdummies{% + \escapechar = `\\ % use backslash in output files. \def\@{@}% change to @@ when we switch to @ as escape char in index files. \def\ {\realbackslash\space }% + % % Need these in case \tex is in effect and \{ is a \delimiter again. % But can't use \lbracecmd and \rbracecmd because texindex assumes % braces and backslashes are used only as delimiters. \let\{ = \mylbrace \let\} = \myrbrace % - % \definedummyword defines \#1 as \realbackslash #1\space, thus - % effectively preventing its expansion. This is used only for control - % words, not control letters, because the \space would be incorrect - % for control characters, but is needed to separate the control word - % from whatever follows. - % - % For control letters, we have \definedummyletter, which omits the - % space. - % - % These can be used both for control words that take an argument and - % those that do not. If it is followed by {arg} in the input, then - % that will dutifully get written to the index (or wherever). - % - \def\definedummyword##1{% - \expandafter\def\csname ##1\endcsname{\realbackslash ##1\space}% - }% - \def\definedummyletter##1{% - \expandafter\def\csname ##1\endcsname{\realbackslash ##1}% - }% - \let\definedummyaccent\definedummyletter + % I don't entirely understand this, but when an index entry is + % generated from a macro call, the \endinput which \scanmacro inserts + % causes processing to be prematurely terminated. This is, + % apparently, because \indexsorttmp is fully expanded, and \endinput + % is an expandable command. The redefinition below makes \endinput + % disappear altogether for that purpose -- although logging shows that + % processing continues to some further point. On the other hand, it + % seems \endinput does not hurt in the printed index arg, since that + % is still getting written without apparent harm. + % + % Sample source (mac-idx3.tex, reported by Graham Percival to + % help-texinfo, 22may06): + % @macro funindex {WORD} + % @findex xyz + % @end macro + % ... + % @funindex commtest + % + % The above is not enough to reproduce the bug, but it gives the flavor. + % + % Sample whatsit resulting: + % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} + % + % So: + \let\endinput = \empty % % Do the redefinitions. \commondummies @@ -3266,147 +3945,162 @@ \let\{ = \lbraceatcmd \let\} = \rbraceatcmd % - % (See comments in \indexdummies.) - \def\definedummyword##1{% - \expandafter\def\csname ##1\endcsname{@##1\space}% - }% - \def\definedummyletter##1{% - \expandafter\def\csname ##1\endcsname{@##1}% - }% - \let\definedummyaccent\definedummyletter - % % Do the redefinitions. \commondummies + \otherbackslash } -% Called from \indexdummies and \atdummies. \definedummyword and -% \definedummyletter must be defined first. +% Called from \indexdummies and \atdummies. % \def\commondummies{% % - \normalturnoffactive + % \definedummyword defines \#1 as \string\#1\space, thus effectively + % preventing its expansion. This is used only for control% words, + % not control letters, because the \space would be incorrect for + % control characters, but is needed to separate the control word + % from whatever follows. + % + % For control letters, we have \definedummyletter, which omits the + % space. + % + % These can be used both for control words that take an argument and + % those that do not. If it is followed by {arg} in the input, then + % that will dutifully get written to the index (or wherever). + % + \def\definedummyword ##1{\def##1{\string##1\space}}% + \def\definedummyletter##1{\def##1{\string##1}}% + \let\definedummyaccent\definedummyletter % \commondummiesnofonts % - \definedummyletter{_}% + \definedummyletter\_% % % Non-English letters. - \definedummyword{AA}% - \definedummyword{AE}% - \definedummyword{L}% - \definedummyword{OE}% - \definedummyword{O}% - \definedummyword{aa}% - \definedummyword{ae}% - \definedummyword{l}% - \definedummyword{oe}% - \definedummyword{o}% - \definedummyword{ss}% - \definedummyword{exclamdown}% - \definedummyword{questiondown}% - \definedummyword{ordf}% - \definedummyword{ordm}% + \definedummyword\AA + \definedummyword\AE + \definedummyword\L + \definedummyword\OE + \definedummyword\O + \definedummyword\aa + \definedummyword\ae + \definedummyword\l + \definedummyword\oe + \definedummyword\o + \definedummyword\ss + \definedummyword\exclamdown + \definedummyword\questiondown + \definedummyword\ordf + \definedummyword\ordm % % Although these internal commands shouldn't show up, sometimes they do. - \definedummyword{bf}% - \definedummyword{gtr}% - \definedummyword{hat}% - \definedummyword{less}% - \definedummyword{sf}% - \definedummyword{sl}% - \definedummyword{tclose}% - \definedummyword{tt}% + \definedummyword\bf + \definedummyword\gtr + \definedummyword\hat + \definedummyword\less + \definedummyword\sf + \definedummyword\sl + \definedummyword\tclose + \definedummyword\tt % - \definedummyword{LaTeX}% - \definedummyword{TeX}% + \definedummyword\LaTeX + \definedummyword\TeX % % Assorted special characters. - \definedummyword{bullet}% - \definedummyword{comma}% - \definedummyword{copyright}% - \definedummyword{registeredsymbol}% - \definedummyword{dots}% - \definedummyword{enddots}% - \definedummyword{equiv}% - \definedummyword{error}% - \definedummyword{euro}% - \definedummyword{expansion}% - \definedummyword{minus}% - \definedummyword{pounds}% - \definedummyword{point}% - \definedummyword{print}% - \definedummyword{result}% + \definedummyword\bullet + \definedummyword\comma + \definedummyword\copyright + \definedummyword\registeredsymbol + \definedummyword\dots + \definedummyword\enddots + \definedummyword\equiv + \definedummyword\error + \definedummyword\euro + \definedummyword\guillemetleft + \definedummyword\guillemetright + \definedummyword\guilsinglleft + \definedummyword\guilsinglright + \definedummyword\expansion + \definedummyword\minus + \definedummyword\pounds + \definedummyword\point + \definedummyword\print + \definedummyword\quotedblbase + \definedummyword\quotedblleft + \definedummyword\quotedblright + \definedummyword\quoteleft + \definedummyword\quoteright + \definedummyword\quotesinglbase + \definedummyword\result + \definedummyword\textdegree + % + % We want to disable all macros so that they are not expanded by \write. + \macrolist + % + \normalturnoffactive % % Handle some cases of @value -- where it does not contain any % (non-fully-expandable) commands. \makevalueexpandable - % - % Normal spaces, not active ones. - \unsepspaces - % - % No macro expansion. - \turnoffmacros } % \commondummiesnofonts: common to \commondummies and \indexnofonts. % -% Better have this without active chars. -{ - \catcode`\~=\other - \gdef\commondummiesnofonts{% - % Control letters and accents. - \definedummyletter{!}% - \definedummyaccent{"}% - \definedummyaccent{'}% - \definedummyletter{*}% - \definedummyaccent{,}% - \definedummyletter{.}% - \definedummyletter{/}% - \definedummyletter{:}% - \definedummyaccent{=}% - \definedummyletter{?}% - \definedummyaccent{^}% - \definedummyaccent{`}% - \definedummyaccent{~}% - \definedummyword{u}% - \definedummyword{v}% - \definedummyword{H}% - \definedummyword{dotaccent}% - \definedummyword{ringaccent}% - \definedummyword{tieaccent}% - \definedummyword{ubaraccent}% - \definedummyword{udotaccent}% - \definedummyword{dotless}% - % - % Texinfo font commands. - \definedummyword{b}% - \definedummyword{i}% - \definedummyword{r}% - \definedummyword{sc}% - \definedummyword{t}% - % - % Commands that take arguments. - \definedummyword{acronym}% - \definedummyword{cite}% - \definedummyword{code}% - \definedummyword{command}% - \definedummyword{dfn}% - \definedummyword{emph}% - \definedummyword{env}% - \definedummyword{file}% - \definedummyword{kbd}% - \definedummyword{key}% - \definedummyword{math}% - \definedummyword{option}% - \definedummyword{samp}% - \definedummyword{strong}% - \definedummyword{tie}% - \definedummyword{uref}% - \definedummyword{url}% - \definedummyword{var}% - \definedummyword{verb}% - \definedummyword{w}% - } +\def\commondummiesnofonts{% + % Control letters and accents. + \definedummyletter\!% + \definedummyaccent\"% + \definedummyaccent\'% + \definedummyletter\*% + \definedummyaccent\,% + \definedummyletter\.% + \definedummyletter\/% + \definedummyletter\:% + \definedummyaccent\=% + \definedummyletter\?% + \definedummyaccent\^% + \definedummyaccent\`% + \definedummyaccent\~% + \definedummyword\u + \definedummyword\v + \definedummyword\H + \definedummyword\dotaccent + \definedummyword\ringaccent + \definedummyword\tieaccent + \definedummyword\ubaraccent + \definedummyword\udotaccent + \definedummyword\dotless + % + % Texinfo font commands. + \definedummyword\b + \definedummyword\i + \definedummyword\r + \definedummyword\sc + \definedummyword\t + % + % Commands that take arguments. + \definedummyword\acronym + \definedummyword\cite + \definedummyword\code + \definedummyword\command + \definedummyword\dfn + \definedummyword\emph + \definedummyword\env + \definedummyword\file + \definedummyword\kbd + \definedummyword\key + \definedummyword\math + \definedummyword\option + \definedummyword\pxref + \definedummyword\ref + \definedummyword\samp + \definedummyword\strong + \definedummyword\tie + \definedummyword\uref + \definedummyword\url + \definedummyword\var + \definedummyword\verb + \definedummyword\w + \definedummyword\xref } % \indexnofonts is used when outputting the strings to sort the index @@ -3416,13 +4110,9 @@ % \def\indexnofonts{% % Accent commands should become @asis. - \def\definedummyaccent##1{% - \expandafter\let\csname ##1\endcsname\asis - }% + \def\definedummyaccent##1{\let##1\asis}% % We can just ignore other control letters. - \def\definedummyletter##1{% - \expandafter\def\csname ##1\endcsname{}% - }% + \def\definedummyletter##1{\let##1\empty}% % Hopefully, all control words can become @asis. \let\definedummyword\definedummyaccent % @@ -3469,15 +4159,35 @@ \def\equiv{==}% \def\error{error}% \def\euro{euro}% + \def\guillemetleft{<<}% + \def\guillemetright{>>}% + \def\guilsinglleft{<}% + \def\guilsinglright{>}% \def\expansion{==>}% \def\minus{-}% \def\pounds{pounds}% \def\point{.}% \def\print{-|}% + \def\quotedblbase{"}% + \def\quotedblleft{"}% + \def\quotedblright{"}% + \def\quoteleft{`}% + \def\quoteright{'}% + \def\quotesinglbase{,}% \def\result{=>}% + \def\textdegree{degrees}% % - % Don't write macro names. - \emptyusermacros + % We need to get rid of all macros, leaving only the arguments (if present). + % Of course this is not nearly correct, but it is the best we can do for now. + % makeinfo does not expand macros in the argument to @deffn, which ends up + % writing an index entry, and texindex isn't prepared for an index sort entry + % that starts with \. + % + % Since macro invocations are followed by braces, we can just redefine them + % to take a single TeX argument. The case of a macro invocation that + % goes to end-of-line is not handled. + % + \macrolist } \let\indexbackslash=0 %overridden during \printindex. @@ -3505,11 +4215,7 @@ % \edef\writeto{\csname#1indfile\endcsname}% % - \ifvmode - \dosubindsanitize - \else - \dosubindwrite - \fi + \safewhatsit\dosubindwrite }% \fi } @@ -3524,7 +4230,6 @@ % % Remember, we are within a group. \indexdummies % Must do this here, since \bf, etc expand at this stage - \escapechar=`\\ \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now % so it will be output as is; and it will print as backslash. % @@ -3547,13 +4252,13 @@ \temp } -% Take care of unwanted page breaks: +% Take care of unwanted page breaks/skips around a whatsit: % % If a skip is the last thing on the list now, preserve it % by backing up by \lastskip, doing the \write, then inserting % the skip again. Otherwise, the whatsit generated by the -% \write will make \lastskip zero. The result is that sequences -% like this: +% \write or \pdfdest will make \lastskip zero. The result is that +% sequences like this: % @end defun % @tindex whatever % @defun ... @@ -3577,25 +4282,31 @@ % \edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} % +\newskip\whatsitskip +\newcount\whatsitpenalty +% % ..., ready, GO: % -\def\dosubindsanitize{% +\def\safewhatsit#1{% +\ifhmode + #1% +\else % \lastskip and \lastpenalty cannot both be nonzero simultaneously. - \skip0 = \lastskip + \whatsitskip = \lastskip \edef\lastskipmacro{\the\lastskip}% - \count255 = \lastpenalty + \whatsitpenalty = \lastpenalty % % If \lastskip is nonzero, that means the last item was a % skip. And since a skip is discardable, that means this - % -\skip0 glue we're inserting is preceded by a + % -\whatsitskip glue we're inserting is preceded by a % non-discardable item, therefore it is not a potential % breakpoint, therefore no \nobreak needed. \ifx\lastskipmacro\zeroskipmacro \else - \vskip-\skip0 + \vskip-\whatsitskip \fi % - \dosubindwrite + #1% % \ifx\lastskipmacro\zeroskipmacro % If \lastskip was zero, perhaps the last item was a penalty, and @@ -3609,13 +4320,14 @@ % Description. % would allow a break between the index-whatever whatsit % and the "Description." paragraph. - \ifnum\count255>9999 \penalty\count255 \fi + \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi \else % On the other hand, if we had a nonzero \lastskip, % this make-up glue would be preceded by a non-discardable item % (the whatsit from the \write), so we must insert a \nobreak. - \nobreak\vskip\skip0 + \nobreak\vskip\whatsitskip \fi +\fi } % The index entry written in the file actually looks like @@ -3658,6 +4370,7 @@ % \smallfonts \rm \tolerance = 9500 + \plainfrenchspacing \everypar = {}% don't want the \kern\-parindent from indentation suppression. % % See if the index file exists and is nonempty. @@ -3787,11 +4500,8 @@ % The following is kludged to not output a line of dots in the index if % there are no page numbers. The next person who breaks this will be % cursed by a Unix daemon. - \def\tempa{{\rm }}% - \def\tempb{#1}% - \edef\tempc{\tempa}% - \edef\tempd{\tempb}% - \ifx\tempc\tempd + \setbox\boxA = \hbox{#1}% + \ifdim\wd\boxA = 0pt \ % \else % @@ -3815,9 +4525,9 @@ \endgroup } -% Like \dotfill except takes at least 1 em. +% Like plain.tex's \dotfill, except uses up at least 1 em. \def\indexdotfill{\cleaders - \hbox{$\mathsurround=0pt \mkern1.5mu ${\it .}$ \mkern1.5mu$}\hskip 1em plus 1fill} + \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} \def\primary #1{\line{#1\hfil}} @@ -3927,6 +4637,34 @@ % % All done with double columns. \def\enddoublecolumns{% + % The following penalty ensures that the page builder is exercised + % _before_ we change the output routine. This is necessary in the + % following situation: + % + % The last section of the index consists only of a single entry. + % Before this section, \pagetotal is less than \pagegoal, so no + % break occurs before the last section starts. However, the last + % section, consisting of \initial and the single \entry, does not + % fit on the page and has to be broken off. Without the following + % penalty the page builder will not be exercised until \eject + % below, and by that time we'll already have changed the output + % routine to the \balancecolumns version, so the next-to-last + % double-column page will be processed with \balancecolumns, which + % is wrong: The two columns will go to the main vertical list, with + % the broken-off section in the recent contributions. As soon as + % the output routine finishes, TeX starts reconsidering the page + % break. The two columns and the broken-off section both fit on the + % page, because the two columns now take up only half of the page + % goal. When TeX sees \eject from below which follows the final + % section, it invokes the new output routine that we've set after + % \balancecolumns below; \onepageout will try to fit the two columns + % and the final section into the vbox of \pageheight (see + % \pagebody), causing an overfull box. + % + % Note that glue won't work here, because glue does not exercise the + % page builder, unlike penalties (see The TeXbook, pp. 280-281). + \penalty0 + % \output = {% % Split the last of the double-column material. Leave it on the % current page, no automatic page break. @@ -4036,11 +4774,15 @@ \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} -% Each @chapter defines this as the name of the chapter. -% page headings and footings can use it. @section does likewise. -% However, they are not reliable, because we don't use marks. +% Each @chapter defines these (using marks) as the number+name, number +% and name of the chapter. Page headings and footings can use +% these. @section does likewise. \def\thischapter{} +\def\thischapternum{} +\def\thischaptername{} \def\thissection{} +\def\thissectionnum{} +\def\thissectionname{} \newcount\absseclevel % used to calculate proper heading level \newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count @@ -4341,7 +5083,20 @@ \def\chapbreak{\dobreak \chapheadingskip {-4000}} \def\chappager{\par\vfill\supereject} -\def\chapoddpage{\chappager \ifodd\pageno \else \hbox to 0pt{} \chappager\fi} +% Because \domark is called before \chapoddpage, the filler page will +% get the headings for the next chapter, which is wrong. But we don't +% care -- we just disable all headings on the filler page. +\def\chapoddpage{% + \chappager + \ifodd\pageno \else + \begingroup + \evenheadline={\hfil}\evenfootline={\hfil}% + \oddheadline={\hfil}\oddfootline={\hfil}% + \hbox to 0pt{}% + \chappager + \endgroup + \fi +} \def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} @@ -4375,41 +5130,72 @@ \def\Yappendixkeyword{Yappendix} % \def\chapmacro#1#2#3{% + % Insert the first mark before the heading break (see notes for \domark). + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs + \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% + \gdef\thissection{}}% + % + \def\temptype{#2}% + \ifx\temptype\Ynothingkeyword + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{\thischaptername}}% + \else\ifx\temptype\Yomitfromtockeyword + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{}}% + \else\ifx\temptype\Yappendixkeyword + \toks0={#1}% + \xdef\lastchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\appendixletter}% + \gdef\noexpand\thischapter{\putwordAppendix{} \noexpand\thischapternum: + \noexpand\thischaptername}% + }% + \else + \toks0={#1}% + \xdef\lastchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\the\chapno}% + \gdef\noexpand\thischapter{\putwordChapter{} \noexpand\thischapternum: + \noexpand\thischaptername}% + }% + \fi\fi\fi + % + % Output the mark. Pass it through \safewhatsit, to take care of + % the preceding space. + \safewhatsit\domark + % + % Insert the chapter heading break. \pchapsepmacro + % + % Now the second mark, after the heading break. No break points + % between here and the heading. + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs + \domark + % {% \chapfonts \rm % - % Have to define \thissection before calling \donoderef, because the + % Have to define \lastsection before calling \donoderef, because the % xref code eventually uses it. On the other hand, it has to be called % after \pchapsepmacro, or the headline will change too soon. - \gdef\thissection{#1}% - \gdef\thischaptername{#1}% + \gdef\lastsection{#1}% % % Only insert the separating space if we have a chapter/appendix % number, and don't print the unnumbered ``number''. - \def\temptype{#2}% \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unnchap}% - \gdef\thischapter{#1}% \else\ifx\temptype\Yomitfromtockeyword \setbox0 = \hbox{}% contents like unnumbered, but no toc entry \def\toctype{omit}% - \gdef\thischapter{}% \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% \def\toctype{app}% - % We don't substitute the actual chapter name into \thischapter - % because we don't want its macros evaluated now. And we don't - % use \thissection because that changes with each section. - % - \xdef\thischapter{\putwordAppendix{} \appendixletter: - \noexpand\thischaptername}% \else \setbox0 = \hbox{#3\enspace}% \def\toctype{numchap}% - \xdef\thischapter{\putwordChapter{} \the\chapno: - \noexpand\thischaptername}% \fi\fi\fi % % Write the toc entry for this chapter. Must come before the @@ -4425,6 +5211,7 @@ \donoderef{#2}% % % Typeset the actual heading. + \nobreak % Avoid page breaks at the interline glue. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright \hangindent=\wd0 \centerparametersmaybe \unhbox0 #1\par}% @@ -4487,45 +5274,95 @@ % the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the % section number. % +\def\seckeyword{sec} +% \def\sectionheading#1#2#3#4{% {% % Switch to the right set of fonts. \csname #2fonts\endcsname \rm % + \def\sectionlevel{#2}% + \def\temptype{#3}% + % + % Insert first mark before the heading break (see notes for \domark). + \let\prevsectiondefs=\lastsectiondefs + \ifx\temptype\Ynothingkeyword + \ifx\sectionlevel\seckeyword + \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% + \gdef\thissection{\thissectionname}}% + \fi + \else\ifx\temptype\Yomitfromtockeyword + % Don't redefine \thissection. + \else\ifx\temptype\Yappendixkeyword + \ifx\sectionlevel\seckeyword + \toks0={#1}% + \xdef\lastsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum: + \noexpand\thissectionname}% + }% + \fi + \else + \ifx\sectionlevel\seckeyword + \toks0={#1}% + \xdef\lastsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum: + \noexpand\thissectionname}% + }% + \fi + \fi\fi\fi + % + % Output the mark. Pass it through \safewhatsit, to take care of + % the preceding space. + \safewhatsit\domark + % % Insert space above the heading. \csname #2headingbreak\endcsname % - % Only insert the space after the number if we have a section number. - \def\sectionlevel{#2}% - \def\temptype{#3}% + % Now the second mark, after the heading break. No break points + % between here and the heading. + \let\prevsectiondefs=\lastsectiondefs + \domark % + % Only insert the space after the number if we have a section number. \ifx\temptype\Ynothingkeyword \setbox0 = \hbox{}% \def\toctype{unn}% - \gdef\thissection{#1}% + \gdef\lastsection{#1}% \else\ifx\temptype\Yomitfromtockeyword % for @headings -- no section number, don't include in toc, - % and don't redefine \thissection. + % and don't redefine \lastsection. \setbox0 = \hbox{}% \def\toctype{omit}% \let\sectionlevel=\empty \else\ifx\temptype\Yappendixkeyword \setbox0 = \hbox{#4\enspace}% \def\toctype{app}% - \gdef\thissection{#1}% + \gdef\lastsection{#1}% \else \setbox0 = \hbox{#4\enspace}% \def\toctype{num}% - \gdef\thissection{#1}% + \gdef\lastsection{#1}% \fi\fi\fi % - % Write the toc entry (before \donoderef). See comments in \chfplain. + % Write the toc entry (before \donoderef). See comments in \chapmacro. \writetocentry{\toctype\sectionlevel}{#1}{#4}% % % Write the node reference (= pdf destination for pdftex). - % Again, see comments in \chfplain. + % Again, see comments in \chapmacro. \donoderef{#3}% % + % Interline glue will be inserted when the vbox is completed. + % That glue will be a valid breakpoint for the page, since it'll be + % preceded by a whatsit (usually from the \donoderef, or from the + % \writetocentry if there was no node). We don't want to allow that + % break, since then the whatsits could end up on page n while the + % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. + \nobreak + % % Output the actual section heading. \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright \hangindent=\wd0 % zero if no section number @@ -4584,11 +5421,11 @@ \fi % \iflinks - {\atdummies \turnoffactive + {\atdummies \edef\temp{% \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% \temp - } + }% \fi \fi % @@ -4623,7 +5460,7 @@ \def\readtocfile{% \setupdatafile \activecatcodes - \input \jobname.toc + \input \tocreadfilename } \newskip\contentsrightmargin \contentsrightmargin=1in @@ -4642,7 +5479,6 @@ % % Don't need to put `Contents' or `Short Contents' in the headline. % It is abundantly clear what they are. - \def\thischapter{}% \chapmacro{#1}{Yomitfromtoc}{}% % \savepageno = \pageno @@ -4654,11 +5490,16 @@ \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi } +% redefined for the two-volume lispref. We always output on +% \jobname.toc even if this is redefined. +% +\def\tocreadfilename{\jobname.toc} % Normal (long) toc. +% \def\contents{% \startcontents{\putwordTOC}% - \openin 1 \jobname.toc + \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi @@ -4696,7 +5537,7 @@ \let\numsubsubsecentry = \numsecentry \let\appsubsubsecentry = \numsecentry \let\unnsubsubsecentry = \numsecentry - \openin 1 \jobname.toc + \openin 1 \tocreadfilename\space \ifeof 1 \else \readtocfile \fi @@ -4823,14 +5664,15 @@ % @point{}, @result{}, @expansion{}, @print{}, @equiv{}. % -% Since these characters are used in examples, it should be an even number of +% Since these characters are used in examples, they should be an even number of % \tt widths. Each \tt character is 1en, so two makes it 1em. % \def\point{$\star$} -\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} -\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} +\def\arrow{\leavevmode\raise.05ex\hbox to 1em{\hfil$\rightarrow$\hfil}} +\def\result{\leavevmode\raise.05ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} +\def\expansion{\leavevmode\hbox to 1em{\hfil$\mapsto$\hfil}} \def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} -\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} +\def\equiv{\leavevmode\hbox to 1em{\hfil$\ptexequiv$\hfil}} % The @error{} command. % Adapted from the TeXbook's \boxit. @@ -4840,7 +5682,7 @@ {\tentt \global\dimen0 = 3em}% Width of the box. \dimen2 = .55pt % Thickness of rules % The text. (`r' is open on the right, `e' somewhat less so on the left.) -\setbox0 = \hbox{\kern-.75pt \tensf error\kern-1.5pt} +\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt} % \setbox\errorbox=\hbox to \dimen0{\hfil \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. @@ -4888,6 +5730,7 @@ \let\/=\ptexslash \let\*=\ptexstar \let\t=\ptext + \expandafter \let\csname top\endcsname=\ptextop % outer \let\frenchspacing=\plainfrenchspacing % \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% @@ -4934,7 +5777,8 @@ \let\afterenvbreak = \aboveenvbreak -% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins. +% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will +% also clear it, so that its embedded environments do the narrowing again. \let\nonarrowing=\relax % @cartouche ... @end cartouche: draw rectangle w/rounded corners around @@ -4971,7 +5815,7 @@ % each corner char, and rule thickness \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip % Flag to tell @lisp, etc., not to narrow margin. - \let\nonarrowing=\comment + \let\nonarrowing = t% \vbox\bgroup \baselineskip=0pt\parskip=0pt\lineskip=0pt \carttop @@ -5011,11 +5855,11 @@ \parskip = 0pt \parindent = 0pt \emergencystretch = 0pt % don't try to avoid overfull boxes - % @cartouche defines \nonarrowing to inhibit narrowing - % at next level down. \ifx\nonarrowing\relax \advance \leftskip by \lispnarrowing \exdentamount=\lispnarrowing + \else + \let\nonarrowing = \relax \fi \let\exdent=\nofillexdent } @@ -5030,12 +5874,18 @@ \let\SETdispenvsize\relax \def\setnormaldispenv{% \ifx\SETdispenvsize\smallword + % end paragraph for sake of leading, in case document has no blank + % line. This is redundant with what happens in \aboveenvbreak, but + % we need to do it before changing the fonts, and it's inconvenient + % to change the fonts afterward. + \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } \def\setsmalldispenv{% \ifx\SETdispenvsize\nosmallword \else + \ifnum \lastpenalty=10000 \else \endgraf \fi \smallexamplefonts \rm \fi } @@ -5062,11 +5912,10 @@ % \maketwodispenvs {lisp}{example}{% \nonfillstart - \tt + \tt\quoteexpand \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. \gobble % eat return } - % @display/@smalldisplay: same as @lisp except keep current font. % \makedispenv {display}{% @@ -5115,6 +5964,7 @@ \advance\leftskip by \lispnarrowing \advance\rightskip by \lispnarrowing \exdentamount = \lispnarrowing + \else \let\nonarrowing = \relax \fi \parsearg\quotationlabel @@ -5193,6 +6043,34 @@ \newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount % \def\starttabbox{\setbox0=\hbox\bgroup} + +% Allow an option to not replace quotes with a regular directed right +% quote/apostrophe (char 0x27), but instead use the undirected quote +% from cmtt (char 0x0d). The undirected quote is ugly, so don't make it +% the default, but it works for pasting with more pdf viewers (at least +% evince), the lilypond developers report. xpdf does work with the +% regular 0x27. +% +\def\codequoteright{% + \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax + \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax + '% + \else \char'15 \fi + \else \char'15 \fi +} +% +% and a similar option for the left quote char vs. a grave accent. +% Modern fonts display ASCII 0x60 as a grave accent, so some people like +% the code environments to do likewise. +% +\def\codequoteleft{% + \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax + \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax + `% + \else \char'22 \fi + \else \char'22 \fi +} +% \begingroup \catcode`\^^I=\active \gdef\tabexpand{% @@ -5205,15 +6083,25 @@ \wd0=\dimen0 \box0 \starttabbox }% } + \catcode`\'=\active + \gdef\rquoteexpand{\catcode\rquoteChar=\active \def'{\codequoteright}}% + % + \catcode`\`=\active + \gdef\lquoteexpand{\catcode\lquoteChar=\active \def`{\codequoteleft}}% + % + \gdef\quoteexpand{\rquoteexpand \lquoteexpand}% \endgroup + +% start the verbatim environment. \def\setupverbatim{% + \let\nonarrowing = t% \nonfillstart - \advance\leftskip by -\defbodyindent % Easiest (and conventionally used) font for verbatim \tt \def\par{\leavevmode\egroup\box0\endgraf}% \catcode`\`=\active \tabexpand + \quoteexpand % Respect line breaks, % print special symbols as themselves, and % make each space count @@ -5298,27 +6186,35 @@ \endgroup } + \message{defuns,} % @defun etc. \newskip\defbodyindent \defbodyindent=.4in \newskip\defargsindent \defargsindent=50pt \newskip\deflastargmargin \deflastargmargin=18pt +\newcount\defunpenalty % Start the processing of @deffn: \def\startdefun{% \ifnum\lastpenalty<10000 \medbreak + \defunpenalty=10003 % Will keep this @deffn together with the + % following @def command, see below. \else % If there are two @def commands in a row, we'll have a \nobreak, % which is there to keep the function description together with its % header. But if there's nothing but headers, we need to allow a % break somewhere. Check specifically for penalty 10002, inserted - % by \defargscommonending, instead of 10000, since the sectioning + % by \printdefunline, instead of 10000, since the sectioning % commands also insert a nobreak penalty, and we don't want to allow % a break between a section heading and a defun. - % - \ifnum\lastpenalty=10002 \penalty2000 \fi + % + % As a minor refinement, we avoid "club" headers by signalling + % with penalty of 10003 after the very first @deffn in the + % sequence (see above), and penalty of 10002 after any following + % @def command. + \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi % % Similarly, after a section heading, do not allow a break. % But do insert the glue. @@ -5336,7 +6232,7 @@ % % As above, allow line break if we have multiple x headers in a row. % It's not a great place, though. - \ifnum\lastpenalty=10002 \penalty3000 \fi + \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi % % And now, it's time to reuse the body of the original defun: \expandafter\gobbledefun#1% @@ -5354,7 +6250,7 @@ \advance\rightskip by 0pt plus 1fil \endgraf \nobreak\vskip -\parskip - \penalty 10002 % signal to \startdefun and \dodefunx + \penalty\defunpenalty % signal to \startdefun and \dodefunx % Some of the @defun-type tags do not enable magic parentheses, % rendering the following check redundant. But we don't optimize. \checkparencounts @@ -5623,12 +6519,14 @@ \ifnum\parencount=0 \else \badparencount \fi \ifnum\brackcount=0 \else \badbrackcount \fi } +% these should not use \errmessage; the glibc manual, at least, actually +% has such constructs (when documenting function pointers). \def\badparencount{% - \errmessage{Unbalanced parentheses in @def}% + \message{Warning: unbalanced parentheses in @def...}% \global\parencount=0 } \def\badbrackcount{% - \errmessage{Unbalanced square braces in @def}% + \message{Warning: unbalanced square brackets in @def...}% \global\brackcount=0 } @@ -5663,7 +6561,6 @@ \spaceisspace % % Append \endinput to make sure that TeX does not see the ending newline. - % % I've verified that it is necessary both for e-TeX and for ordinary TeX % --kasal, 29nov03 \scantokens{#1\endinput}% @@ -5678,8 +6575,19 @@ \newcount\paramno % Count of parameters \newtoks\macname % Macro name \newif\ifrecursive % Is it recursive? -\def\macrolist{} % List of all defined macros in the form - % \do\macro1\do\macro2... + +% List of all defined macros in the form +% \definedummyword\macro1\definedummyword\macro2... +% Currently is also contains all @aliases; the list can be split +% if there is a need. +\def\macrolist{} + +% Add the macro to \macrolist +\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} +\def\addtomacrolistxxx#1{% + \toks0 = \expandafter{\macrolist\definedummyword#1}% + \xdef\macrolist{\the\toks0}% +} % Utility routines. % This does \let #1 = #2, with \csnames; that is, @@ -5713,6 +6621,10 @@ % all characters are catcode 10, 11 or 12, except \ which is active % (as in normal texinfo). It is necessary to change the definition of \. +% Non-ASCII encodings make 8-bit characters active, so un-activate +% them to avoid their expansion. Must do this non-globally, to +% confine the change to the current group. + % It's necessary to have hard CRs when the macro is executed. This is % done by making ^^M (\endlinechar) catcode 12 when reading the macro % body, and then making it the \newlinechar in \scanmacro. @@ -5727,6 +6639,7 @@ \catcode`\_=\other \catcode`\|=\other \catcode`\~=\other + \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi } \def\scanargctxt{% @@ -5777,10 +6690,7 @@ \else \errmessage{Macro name \the\macname\space already defined}\fi \global\cslet{macsave.\the\macname}{\the\macname}% \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% - % Add the macroname to \macrolist - \toks0 = \expandafter{\macrolist\do}% - \xdef\macrolist{\the\toks0 - \expandafter\noexpand\csname\the\macname\endcsname}% + \addtomacrolist{\the\macname}% \fi \begingroup \macrobodyctxt \ifrecursive \expandafter\parsermacbody @@ -5794,7 +6704,7 @@ % Remove the macro name from \macrolist: \begingroup \expandafter\let\csname#1\endcsname \relax - \let\do\unmacrodo + \let\definedummyword\unmacrodo \xdef\macrolist{\macrolist}% \endgroup \else @@ -5806,10 +6716,10 @@ % macro definitions that have been changed to \relax. % \def\unmacrodo#1{% - \ifx#1\relax + \ifx #1\relax % remove this \else - \noexpand\do \noexpand #1% + \noexpand\definedummyword \noexpand#1% \fi } @@ -5922,30 +6832,11 @@ % {. If so it reads up to the closing }, if not, it reads the whole % line. Whatever was read is then fed to the next control sequence % as an argument (by \parsebrace or \parsearg) -\def\braceorline#1{\let\next=#1\futurelet\nchar\braceorlinexxx} +\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} \def\braceorlinexxx{% \ifx\nchar\bgroup\else \expandafter\parsearg - \fi \next} - -% We want to disable all macros during \shipout so that they are not -% expanded by \write. -\def\turnoffmacros{\begingroup \def\do##1{\let\noexpand##1=\relax}% - \edef\next{\macrolist}\expandafter\endgroup\next} - -% For \indexnofonts, we need to get rid of all macros, leaving only the -% arguments (if present). Of course this is not nearly correct, but it -% is the best we can do for now. makeinfo does not expand macros in the -% argument to @deffn, which ends up writing an index entry, and texindex -% isn't prepared for an index sort entry that starts with \. -% -% Since macro invocations are followed by braces, we can just redefine them -% to take a single TeX argument. The case of a macro invocation that -% goes to end-of-line is not handled. -% -\def\emptyusermacros{\begingroup - \def\do##1{\let\noexpand##1=\noexpand\asis}% - \edef\next{\macrolist}\expandafter\endgroup\next} + \fi \macnamexxx} % @alias. @@ -5956,6 +6847,7 @@ \def\aliasyyy #1=#2\relax{% {% \expandafter\let\obeyedspace=\empty + \addtomacrolist{#1}% \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% }% \next @@ -5965,7 +6857,6 @@ \message{cross references,} \newwrite\auxfile - \newif\ifhavexrefs % True if xref values are known. \newif\ifwarnedxrefs % True if we warned once that they aren't known. @@ -6010,7 +6901,7 @@ % \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an % anchor), which consists of three parts: -% 1) NAME-title - the current sectioning name taken from \thissection, +% 1) NAME-title - the current sectioning name taken from \lastsection, % or the anchor name. % 2) NAME-snt - section number and type, passed as the SNT arg, or % empty for anchors. @@ -6025,15 +6916,14 @@ \iflinks {% \atdummies % preserve commands, but don't expand them - \turnoffactive \edef\writexrdef##1##2{% \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef ##1}{##2}}% these are parameters of \writexrdef }% - \toks0 = \expandafter{\thissection}% + \toks0 = \expandafter{\lastsection}% \immediate \writexrdef{title}{\the\toks0 }% \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. - \writexrdef{pg}{\folio}% will be written later, during \shipout + \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout }% \fi } @@ -6079,7 +6969,8 @@ \ifpdf \leavevmode \getfilename{#4}% - {\turnoffactive + {\indexnofonts + \turnoffactive % See comments at \activebackslashdouble. {\activebackslashdouble \xdef\pdfxrefdest{#1}% \backslashparens\pdfxrefdest}% @@ -6092,7 +6983,7 @@ goto name{\pdfmkpgn{\pdfxrefdest}}% \fi }% - \linkcolor + \setcolor{\linkcolor}% \fi % % Float references are printed completely differently: "Figure 1.2" @@ -6110,7 +7001,7 @@ % If the user specified the print name (third arg) to the ref, % print it instead of our usual "Figure 1.2". \ifdim\wd0 = 0pt - \refx{#1-snt}% + \refx{#1-snt}{}% \else \printedrefname \fi @@ -6130,7 +7021,7 @@ % is a loss. Therefore, we give the text of the node name again, so it % is as if TeX is seeing it for the first time. \ifdim \wd1 > 0pt - \putwordsection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}% + \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}% \else % _ (for example) has to be the character _ for the purposes of the % control sequence corresponding to the node, but it has to expand @@ -6226,10 +7117,18 @@ % collisions). But if this is a float type, we have more work to do. % \def\xrdef#1#2{% - \expandafter\gdef\csname XR#1\endcsname{#2}% remember this xref value. + {% The node name might contain 8-bit characters, which in our current + % implementation are changed to commands like @'e. Don't let these + % mess up the control sequence name. + \indexnofonts + \turnoffactive + \xdef\safexrefname{#1}% + }% + % + \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref % % Was that xref control sequence that we just defined for a float? - \expandafter\iffloat\csname XR#1\endcsname + \expandafter\iffloat\csname XR\safexrefname\endcsname % it was a float, and we have the (safe) float type in \iffloattype. \expandafter\let\expandafter\floatlist \csname floatlist\iffloattype\endcsname @@ -6244,7 +7143,8 @@ % % Remember this xref in the control sequence \floatlistFLOATTYPE, % for later use in \listoffloats. - \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0{#1}}% + \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 + {\safexrefname}}% \fi } @@ -6348,6 +7248,7 @@ \input\jobname.#1 \endgroup} + \message{insertions,} % including footnotes. @@ -6540,7 +7441,7 @@ % above and below. \nobreak\vskip\parskip \nobreak - \line\bgroup\hss + \line\bgroup \fi % % Output the image. @@ -6553,7 +7454,7 @@ \epsfbox{#1.eps}% \fi % - \ifimagevmode \hss \egroup \bigbreak \fi % space after the image + \ifimagevmode \egroup \bigbreak \fi % space after the image \endgroup} @@ -6620,13 +7521,13 @@ \global\advance\floatno by 1 % {% - % This magic value for \thissection is output by \setref as the + % This magic value for \lastsection is output by \setref as the % XREFLABEL-title value. \xrefX uses it to distinguish float % labels (which have a completely different output format) from % node and anchor labels. And \xrdef uses it to construct the % lists of floats. % - \edef\thissection{\floatmagic=\safefloattype}% + \edef\lastsection{\floatmagic=\safefloattype}% \setref{\floatlabel}{Yfloat}% }% \fi @@ -6693,7 +7594,8 @@ % \floatlabel-lof. Besides \floatident, we include the short % caption if specified, else the full caption if specified, else nothing. {% - \atdummies \turnoffactive + \atdummies + % % since we read the caption text in the macro world, where ^^M % is turned into a normal character, we have to scan it back, so % we don't write the literal three characters "^^M" into the aux file. @@ -6714,8 +7616,9 @@ % % place the captured inserts % - % BEWARE: when the floats start float, we have to issue warning whenever an - % insert appears inside a float which could possibly float. --kasal, 26may04 + % BEWARE: when the floats start floating, we have to issue warning + % whenever an insert appears inside a float which could possibly + % float. --kasal, 26may04 % \checkinserts } @@ -6759,7 +7662,7 @@ % #1 is the control sequence we are passed; we expand into a conditional % which is true if #1 represents a float ref. That is, the magic -% \thissection value which we \setref above. +% \lastsection value which we \setref above. % \def\iffloat#1{\expandafter\doiffloat#1==\finish} % @@ -6820,39 +7723,871 @@ \writeentry }} + \message{localization,} -% and i18n. % @documentlanguage is usually given very early, just after % @setfilename. If done too late, it may not override everything -% properly. Single argument is the language abbreviation. -% It would be nice if we could set up a hyphenation file here. +% properly. Single argument is the language (de) or locale (de_DE) +% abbreviation. It would be nice if we could set up a hyphenation file. % -\parseargdef\documentlanguage{% +{ + \catcode`\_ = \active + \globaldefs=1 +\parseargdef\documentlanguage{\begingroup + \let_=\normalunderscore % normal _ character for filenames \tex % read txi-??.tex file in plain TeX. - % Read the file if it exists. + % Read the file by the name they passed if it exists. \openin 1 txi-#1.tex \ifeof 1 - \errhelp = \nolanghelp - \errmessage{Cannot read language file txi-#1.tex}% + \documentlanguagetrywithoutunderscore{#1_\finish}% \else \input txi-#1.tex \fi \closein 1 \endgroup +\endgroup} +} +% +% If they passed de_DE, and txi-de_DE.tex doesn't exist, +% try txi-de.tex. +% +\def\documentlanguagetrywithoutunderscore#1_#2\finish{% + \openin 1 txi-#1.tex + \ifeof 1 + \errhelp = \nolanghelp + \errmessage{Cannot read language file txi-#1.tex}% + \else + \input txi-#1.tex + \fi + \closein 1 } +% \newhelp\nolanghelp{The given language definition file cannot be found or is empty. Maybe you need to install it? In the current directory should work if nowhere else does.} +% Set the catcode of characters 128 through 255 to the specified number. +% +\def\setnonasciicharscatcode#1{% + \count255=128 + \loop\ifnum\count255<256 + \global\catcode\count255=#1\relax + \advance\count255 by 1 + \repeat +} + +\def\setnonasciicharscatcodenonglobal#1{% + \count255=128 + \loop\ifnum\count255<256 + \catcode\count255=#1\relax + \advance\count255 by 1 + \repeat +} + +% @documentencoding sets the definition of non-ASCII characters +% according to the specified encoding. +% +\parseargdef\documentencoding{% + % Encoding being declared for the document. + \def\declaredencoding{\csname #1.enc\endcsname}% + % + % Supported encodings: names converted to tokens in order to be able + % to compare them with \ifx. + \def\ascii{\csname US-ASCII.enc\endcsname}% + \def\latnine{\csname ISO-8859-15.enc\endcsname}% + \def\latone{\csname ISO-8859-1.enc\endcsname}% + \def\lattwo{\csname ISO-8859-2.enc\endcsname}% + \def\utfeight{\csname UTF-8.enc\endcsname}% + % + \ifx \declaredencoding \ascii + \asciichardefs + % + \else \ifx \declaredencoding \lattwo + \setnonasciicharscatcode\active + \lattwochardefs + % + \else \ifx \declaredencoding \latone + \setnonasciicharscatcode\active + \latonechardefs + % + \else \ifx \declaredencoding \latnine + \setnonasciicharscatcode\active + \latninechardefs + % + \else \ifx \declaredencoding \utfeight + \setnonasciicharscatcode\active + \utfeightchardefs + % + \else + \message{Unknown document encoding #1, ignoring.}% + % + \fi % utfeight + \fi % latnine + \fi % latone + \fi % lattwo + \fi % ascii +} + +% A message to be logged when using a character that isn't available +% the default font encoding (OT1). +% +\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} + +% Take account of \c (plain) vs. \, (Texinfo) difference. +\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} + +% First, make active non-ASCII characters in order for them to be +% correctly categorized when TeX reads the replacement text of +% macros containing the character definitions. +\setnonasciicharscatcode\active +% +% Latin1 (ISO-8859-1) character definitions. +\def\latonechardefs{% + \gdef^^a0{~} + \gdef^^a1{\exclamdown} + \gdef^^a2{\missingcharmsg{CENT SIGN}} + \gdef^^a3{{\pounds}} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\missingcharmsg{YEN SIGN}} + \gdef^^a6{\missingcharmsg{BROKEN BAR}} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\copyright} + \gdef^^aa{\ordf} + \gdef^^ab{\missingcharmsg{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}} + \gdef^^ac{$\lnot$} + \gdef^^ad{\-} + \gdef^^ae{\registeredsymbol} + \gdef^^af{\={}} + % + \gdef^^b0{\textdegree} + \gdef^^b1{$\pm$} + \gdef^^b2{$^2$} + \gdef^^b3{$^3$} + \gdef^^b4{\'{}} + \gdef^^b5{$\mu$} + \gdef^^b6{\P} + % + \gdef^^b7{$^.$} + \gdef^^b8{\cedilla\ } + \gdef^^b9{$^1$} + \gdef^^ba{\ordm} + % + \gdef^^bb{\missingcharmsg{RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK}} + \gdef^^bc{$1\over4$} + \gdef^^bd{$1\over2$} + \gdef^^be{$3\over4$} + \gdef^^bf{\questiondown} + % + \gdef^^c0{\`A} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\~A} + \gdef^^c4{\"A} + \gdef^^c5{\ringaccent A} + \gdef^^c6{\AE} + \gdef^^c7{\cedilla C} + \gdef^^c8{\`E} + \gdef^^c9{\'E} + \gdef^^ca{\^E} + \gdef^^cb{\"E} + \gdef^^cc{\`I} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\"I} + % + \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER ETH}} + \gdef^^d1{\~N} + \gdef^^d2{\`O} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\~O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\O} + \gdef^^d9{\`U} + \gdef^^da{\'U} + \gdef^^db{\^U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\missingcharmsg{LATIN CAPITAL LETTER THORN}} + \gdef^^df{\ss} + % + \gdef^^e0{\`a} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\~a} + \gdef^^e4{\"a} + \gdef^^e5{\ringaccent a} + \gdef^^e6{\ae} + \gdef^^e7{\cedilla c} + \gdef^^e8{\`e} + \gdef^^e9{\'e} + \gdef^^ea{\^e} + \gdef^^eb{\"e} + \gdef^^ec{\`{\dotless i}} + \gdef^^ed{\'{\dotless i}} + \gdef^^ee{\^{\dotless i}} + \gdef^^ef{\"{\dotless i}} + % + \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER ETH}} + \gdef^^f1{\~n} + \gdef^^f2{\`o} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\~o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\o} + \gdef^^f9{\`u} + \gdef^^fa{\'u} + \gdef^^fb{\^u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\missingcharmsg{LATIN SMALL LETTER THORN}} + \gdef^^ff{\"y} +} + +% Latin9 (ISO-8859-15) encoding character definitions. +\def\latninechardefs{% + % Encoding is almost identical to Latin1. + \latonechardefs + % + \gdef^^a4{\euro} + \gdef^^a6{\v S} + \gdef^^a8{\v s} + \gdef^^b4{\v Z} + \gdef^^b8{\v z} + \gdef^^bc{\OE} + \gdef^^bd{\oe} + \gdef^^be{\"Y} +} + +% Latin2 (ISO-8859-2) character definitions. +\def\lattwochardefs{% + \gdef^^a0{~} + \gdef^^a1{\missingcharmsg{LATIN CAPITAL LETTER A WITH OGONEK}} + \gdef^^a2{\u{}} + \gdef^^a3{\L} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\v L} + \gdef^^a6{\'S} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\v S} + \gdef^^aa{\cedilla S} + \gdef^^ab{\v T} + \gdef^^ac{\'Z} + \gdef^^ad{\-} + \gdef^^ae{\v Z} + \gdef^^af{\dotaccent Z} + % + \gdef^^b0{\textdegree} + \gdef^^b1{\missingcharmsg{LATIN SMALL LETTER A WITH OGONEK}} + \gdef^^b2{\missingcharmsg{OGONEK}} + \gdef^^b3{\l} + \gdef^^b4{\'{}} + \gdef^^b5{\v l} + \gdef^^b6{\'s} + \gdef^^b7{\v{}} + \gdef^^b8{\cedilla\ } + \gdef^^b9{\v s} + \gdef^^ba{\cedilla s} + \gdef^^bb{\v t} + \gdef^^bc{\'z} + \gdef^^bd{\H{}} + \gdef^^be{\v z} + \gdef^^bf{\dotaccent z} + % + \gdef^^c0{\'R} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\u A} + \gdef^^c4{\"A} + \gdef^^c5{\'L} + \gdef^^c6{\'C} + \gdef^^c7{\cedilla C} + \gdef^^c8{\v C} + \gdef^^c9{\'E} + \gdef^^ca{\missingcharmsg{LATIN CAPITAL LETTER E WITH OGONEK}} + \gdef^^cb{\"E} + \gdef^^cc{\v E} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\v D} + % + \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER D WITH STROKE}} + \gdef^^d1{\'N} + \gdef^^d2{\v N} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\H O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\v R} + \gdef^^d9{\ringaccent U} + \gdef^^da{\'U} + \gdef^^db{\H U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\cedilla T} + \gdef^^df{\ss} + % + \gdef^^e0{\'r} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\u a} + \gdef^^e4{\"a} + \gdef^^e5{\'l} + \gdef^^e6{\'c} + \gdef^^e7{\cedilla c} + \gdef^^e8{\v c} + \gdef^^e9{\'e} + \gdef^^ea{\missingcharmsg{LATIN SMALL LETTER E WITH OGONEK}} + \gdef^^eb{\"e} + \gdef^^ec{\v e} + \gdef^^ed{\'\i} + \gdef^^ee{\^\i} + \gdef^^ef{\v d} + % + \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER D WITH STROKE}} + \gdef^^f1{\'n} + \gdef^^f2{\v n} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\H o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\v r} + \gdef^^f9{\ringaccent u} + \gdef^^fa{\'u} + \gdef^^fb{\H u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\cedilla t} + \gdef^^ff{\dotaccent{}} +} + +% UTF-8 character definitions. +% +% This code to support UTF-8 is based on LaTeX's utf8.def, with some +% changes for Texinfo conventions. It is included here under the GPL by +% permission from Frank Mittelbach and the LaTeX team. +% +\newcount\countUTFx +\newcount\countUTFy +\newcount\countUTFz + +\gdef\UTFviiiTwoOctets#1#2{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\endcsname} +% +\gdef\UTFviiiThreeOctets#1#2#3{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} +% +\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} + +\gdef\UTFviiiDefined#1{% + \ifx #1\relax + \message{\linenumber Unicode char \string #1 not defined for Texinfo}% + \else + \expandafter #1% + \fi +} + +\begingroup + \catcode`\~13 + \catcode`\"12 + + \def\UTFviiiLoop{% + \global\catcode\countUTFx\active + \uccode`\~\countUTFx + \uppercase\expandafter{\UTFviiiTmp}% + \advance\countUTFx by 1 + \ifnum\countUTFx < \countUTFy + \expandafter\UTFviiiLoop + \fi} -% @documentencoding should change something in TeX eventually, most -% likely, but for now just recognize it. -\let\documentencoding = \comment + \countUTFx = "C2 + \countUTFy = "E0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiTwoOctets\string~}} + \UTFviiiLoop + + \countUTFx = "E0 + \countUTFy = "F0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiThreeOctets\string~}} + \UTFviiiLoop + + \countUTFx = "F0 + \countUTFy = "F4 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiFourOctets\string~}} + \UTFviiiLoop +\endgroup +\begingroup + \catcode`\"=12 + \catcode`\<=12 + \catcode`\.=12 + \catcode`\,=12 + \catcode`\;=12 + \catcode`\!=12 + \catcode`\~=13 + + \gdef\DeclareUnicodeCharacter#1#2{% + \countUTFz = "#1\relax + \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% + \begingroup + \parseXMLCharref + \def\UTFviiiTwoOctets##1##2{% + \csname u8:##1\string ##2\endcsname}% + \def\UTFviiiThreeOctets##1##2##3{% + \csname u8:##1\string ##2\string ##3\endcsname}% + \def\UTFviiiFourOctets##1##2##3##4{% + \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% + \expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \gdef\UTFviiiTmp{#2}% + \endgroup} -% Page size parameters. + \gdef\parseXMLCharref{% + \ifnum\countUTFz < "A0\relax + \errhelp = \EMsimple + \errmessage{Cannot define Unicode char value < 00A0}% + \else\ifnum\countUTFz < "800\relax + \parseUTFviiiA,% + \parseUTFviiiB C\UTFviiiTwoOctets.,% + \else\ifnum\countUTFz < "10000\relax + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% + \else + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiA!% + \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% + \fi\fi\fi + } + + \gdef\parseUTFviiiA#1{% + \countUTFx = \countUTFz + \divide\countUTFz by 64 + \countUTFy = \countUTFz + \multiply\countUTFz by 64 + \advance\countUTFx by -\countUTFz + \advance\countUTFx by 128 + \uccode `#1\countUTFx + \countUTFz = \countUTFy} + + \gdef\parseUTFviiiB#1#2#3#4{% + \advance\countUTFz by "#10\relax + \uccode `#3\countUTFz + \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} +\endgroup + +\def\utfeightchardefs{% + \DeclareUnicodeCharacter{00A0}{\tie} + \DeclareUnicodeCharacter{00A1}{\exclamdown} + \DeclareUnicodeCharacter{00A3}{\pounds} + \DeclareUnicodeCharacter{00A8}{\"{ }} + \DeclareUnicodeCharacter{00A9}{\copyright} + \DeclareUnicodeCharacter{00AA}{\ordf} + \DeclareUnicodeCharacter{00AB}{\guillemetleft} + \DeclareUnicodeCharacter{00AD}{\-} + \DeclareUnicodeCharacter{00AE}{\registeredsymbol} + \DeclareUnicodeCharacter{00AF}{\={ }} + + \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} + \DeclareUnicodeCharacter{00B4}{\'{ }} + \DeclareUnicodeCharacter{00B8}{\cedilla{ }} + \DeclareUnicodeCharacter{00BA}{\ordm} + \DeclareUnicodeCharacter{00BB}{\guillemetright} + \DeclareUnicodeCharacter{00BF}{\questiondown} + + \DeclareUnicodeCharacter{00C0}{\`A} + \DeclareUnicodeCharacter{00C1}{\'A} + \DeclareUnicodeCharacter{00C2}{\^A} + \DeclareUnicodeCharacter{00C3}{\~A} + \DeclareUnicodeCharacter{00C4}{\"A} + \DeclareUnicodeCharacter{00C5}{\AA} + \DeclareUnicodeCharacter{00C6}{\AE} + \DeclareUnicodeCharacter{00C7}{\cedilla{C}} + \DeclareUnicodeCharacter{00C8}{\`E} + \DeclareUnicodeCharacter{00C9}{\'E} + \DeclareUnicodeCharacter{00CA}{\^E} + \DeclareUnicodeCharacter{00CB}{\"E} + \DeclareUnicodeCharacter{00CC}{\`I} + \DeclareUnicodeCharacter{00CD}{\'I} + \DeclareUnicodeCharacter{00CE}{\^I} + \DeclareUnicodeCharacter{00CF}{\"I} + + \DeclareUnicodeCharacter{00D1}{\~N} + \DeclareUnicodeCharacter{00D2}{\`O} + \DeclareUnicodeCharacter{00D3}{\'O} + \DeclareUnicodeCharacter{00D4}{\^O} + \DeclareUnicodeCharacter{00D5}{\~O} + \DeclareUnicodeCharacter{00D6}{\"O} + \DeclareUnicodeCharacter{00D8}{\O} + \DeclareUnicodeCharacter{00D9}{\`U} + \DeclareUnicodeCharacter{00DA}{\'U} + \DeclareUnicodeCharacter{00DB}{\^U} + \DeclareUnicodeCharacter{00DC}{\"U} + \DeclareUnicodeCharacter{00DD}{\'Y} + \DeclareUnicodeCharacter{00DF}{\ss} + + \DeclareUnicodeCharacter{00E0}{\`a} + \DeclareUnicodeCharacter{00E1}{\'a} + \DeclareUnicodeCharacter{00E2}{\^a} + \DeclareUnicodeCharacter{00E3}{\~a} + \DeclareUnicodeCharacter{00E4}{\"a} + \DeclareUnicodeCharacter{00E5}{\aa} + \DeclareUnicodeCharacter{00E6}{\ae} + \DeclareUnicodeCharacter{00E7}{\cedilla{c}} + \DeclareUnicodeCharacter{00E8}{\`e} + \DeclareUnicodeCharacter{00E9}{\'e} + \DeclareUnicodeCharacter{00EA}{\^e} + \DeclareUnicodeCharacter{00EB}{\"e} + \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} + \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} + \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} + \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} + + \DeclareUnicodeCharacter{00F1}{\~n} + \DeclareUnicodeCharacter{00F2}{\`o} + \DeclareUnicodeCharacter{00F3}{\'o} + \DeclareUnicodeCharacter{00F4}{\^o} + \DeclareUnicodeCharacter{00F5}{\~o} + \DeclareUnicodeCharacter{00F6}{\"o} + \DeclareUnicodeCharacter{00F8}{\o} + \DeclareUnicodeCharacter{00F9}{\`u} + \DeclareUnicodeCharacter{00FA}{\'u} + \DeclareUnicodeCharacter{00FB}{\^u} + \DeclareUn