Changes for GNU C version 2.3.2, from version 2.3.1. This omits changes in files you can rebuild using TeX, makeinfo, Bison or etags. In addition to applying the diffs below, you should delete the file syslimits.h; it has been replaced. Also install this complete replacement for the file INSTALL: ====================================================================== This file documents the installation of the GNU compiler. Copyright (C) 1988, 1989, 1992 Free Software Foundation, Inc. You may copy, distribute, and modify it freely as long as you preserve this copyright notice and permission notice. Installing GNU CC ****************** Here is the procedure for installing GNU CC on a Unix system. 1. If you have built GNU CC previously 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, it probably means that the directory is already suitably clean. 2. 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. 3. Specify the host and target machine configurations. You do this by running the file `configure' with appropriate arguments. If you are building a compiler to produce code for the machine it runs on, specify just one machine type. Use the `--target' option; the host type will default to be the same as the target. (For information on building a cross-compiler, see *Note Cross-Compiler::.) The command looks like this: configure --target=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 also use simply `sun3-sunos', since the version of SunOS is assumed by default to be version 4. `sun3-bsd' also works, since `configure' knows that the only BSD variant on a Sun 3 is SunOS. 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. Here are the possible CPU types: a29k, alpha, arm, cN, elxsi, hppa1.0, hppa1.1, i386, i860, i960, m68000, m68k, m88k, mips, ns32k, pyramid, romp, rs6000, sparc, vax, we32k. Here are the recognized company names. As you can see, customary abbreviations are used rather than the longer official names. alliant, altos, apollo, att, cbm, convergent, convex, crds, dec, dg, encore, harris, hp, ibm, mips, motorola, ncr, next, ns, omron, sequent, sgi, sony, sun, tti, unicom. 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: aix, aos, bsd, ctix, dgux, dynix, genix, hpux, isc, linux, luna, mach, minix, newsos, osf, osfrose, riscos, sco, sunos, sysv, ultrix, unos, vms. 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. 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. 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, 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. There are four additional options you can specify independently to describe variant hardware and software configurations. These are `--with-gnu-as', `--with-gnu-ld', `--with-stabs' and `--nfp'. `--with-gnu-as' On certain systems, you must specify whether you want GNU CC to work with the usual compilation tools or with the GNU compilation tools (including GAS). Use the `--with-gnu-as' argument when you run `configure', if you want to use the GNU tools. (Specify `--with-gnu-ld' as well, since on these systems GAS works only with the GNU linker.) The systems where this makes a difference are `i386-ANYTHING-sysv', `i860-ANYTHING-bsd', `m68k-hp-hpux', `m68k-sony-bsd', `m68k-altos-sysv', `m68000-hp-hpux', and `m68000-att-sysv'. On any other system, `--with-gnu-as' has no effect. `--with-gnu-ld' Specify the option `--with-gnu-ld' if you plan to use the GNU linker. This inhibits the installation of `collect2', a program which otherwise serves as a front-end for the system's linker on most configurations. `--with-stabs' On MIPS based systems, you must specify whether you want GNU CC 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, GNU CC uses the ECOFF debugging format by default; if you prefer BSD stabs, specify `--with-stabs' when you configure GNU CC. No matter which default you choose when you configure GNU CC, the user can use the `-gcoff' and `-gstabs+' options to specify explicitly the debug format for a particular compilation. `--nfp' On certain systems, you must specify whether the machine has a floating point unit. These systems are `m68k-sun-sunosN' and `m68k-isi-bsd'. On any other system, `--nfp' currently has no effect, though perhaps there are other systems where it could usefully make a difference. 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 entire configuration name is used to form the configuration file names. Thus, if you specify `m68k-local', then the files used are `m68k-local.md', `m68k-local.h', `m68k-local.c', `xm-m68k-local.h', `t-m68k-local', and `x-m68k-local'. Here is a list of configurations that have special treatment or special things you must know: `alpha-*-osf1' Systems using processors that implement the DEC Alpha architecture and are running the OSF/1 operating system. (VMS on the Alpha is not currently supported by GNU CC.) As of this writing, the only Alpha-based product currently available from DEC is the 21064 (EV4) processor chip; no system-level products can be ordered. This port is provided for those developers who might have early Alpha hardware from DEC or other vendors and run the OSF/1 operating system. It has not been extensively tested and both the C++ and Objective-C languages may not work, except in a cross-compilation environment. The `ASSEMBLE_FILE_START' macro writes a `.verstamp' directive containing the version of the calling sequence. Currently, we use `9 0', which we believe will work until the official release by DEC of their system, at which point `3 11' is the correct value. If you get a mismatch error from the assembler on a `.verstamp' line, consult the file `/usr/include/stamp.h' for the present value. GNU C on the Alpha does not support versions of DEC's OSF/1 earlier than BL9; if you are running an older version, we suggest you ask your DEC contact for an update. Note that since the Alpha is a 64-bit architecture, cross-compilers from 32-bit machines will not generate as efficient code 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. `a29k' AMD Am29K-family processors. These are normally used in embedded applications. There are no standard Unix configurations. This configuration corresponds to AMD's standard calling sequence and binary interface and is compatible with other 29K tools. You may need to make a variant of the file `a29k.h' for your particular configuration. `a29k-*-bsd' AMD Am29050 used in a system running a variant of BSD Unix. `elxsi-elxsi-bsd' The Elxsi's C compiler has known limitations that prevent it from compiling GNU C. Please contact `mrs@cygnus.com' for more details. `i386-*-sco' Compilation with RCC is recommended. `i386-ibm-aix' You need a version of GAS that you can get from `tranle@intellicorp.com'. `i386-sequent' Go to the Berkeley universe before compiling. In addition, you probably need to create a file named `string.h' containing just one line: `#include '. `i386-sun-sunos4' You may find that you need another version of GNU CC to begin bootstrapping with, since the current version when built with the system's own compiler seems to get an infinite loop compiling part of `libgcc2.c'. GNU CC version 2 compiled with GNU CC (any version) seems not to have this problem. `m68000-att' AT&T 3b1, a.k.a. 7300 PC. Special procedures are needed to compile GNU CC with this machine's standard C compiler, due to bugs in that compiler. *Note 3b1 Install::. You can bootstrap it more easily with previous versions of GNU CC if you have them. `m68000-hp-bsd' HP 9000 series 200 running BSD. Note that the C compiler that comes with this system cannot compile GNU CC; contact `law@cs.utah.edu' to get binaries of GNU CC for bootstrapping. `m68k-altos' Altos 3068. You must use the GNU assembler, linker and debugger, with COFF-encapsulation. Also, you must fix a kernel bug. Details in the file `README.ALTOS'. `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 GNU CC. To fix it, get patch PHCO_0800 from HP. In addition, `--gas' does not currently work with this configuration. Changes in HP-UX have broken the library conversion tool and the linker. `m68k-sun' Sun 3. We do not provide a configuration file to use the Sun FPA by default, because programs that establish signal handlers for floating point traps inherently cannot work with the FPA. `m88k-svr3' Motorola m88k running the AT&T/Unisoft/Motorola V.3 reference port. These systems tend to use the Green Hills C, revision 1.8.5, as the standard C compiler. There are apparently bugs in this compiler that result in object files differences between stage 2 and stage 3. If this happens, make the stage 4 compiler and compare it to the stage 3 compiler. If the stage 3 and stage 4 object files are identical, this suggests a problem with the standard C compiler. It is best, however, to use an older version of GNU CC for bootstrapping. `m88k-dgux' Motorola m88k running DG/UX. To build native or cross compilers on DG/UX, you must first change to the 88open BCS software development environment. This is done by issuing this command: eval `sde-target m88kbcs` `mips-mips-bsd' MIPS machines running the MIPS operating system in BSD mode. It's possible that some old versions of the system lack the functions `memcpy', `memcmp', and `memset'. If your system lacks these, you must remove or undo the definition of `TARGET_MEM_FUNCTIONS' in `mips-bsd.h'. `mips-sony-sysv' Sony MIPS NEWS. This works in NEWSOS 5.0.1, but not in 5.0.2 (which uses ELF instead of COFF). Support for 5.0.2 will probably be provided soon by volunteers. `ns32k-encore' Encore ns32000 system. Encore systems are supported only under BSD. `ns32k-*-genix' National Semiconductor ns32000 system. Genix has bugs in `alloca' and `malloc'; you must get the compiled versions of these from GNU Emacs. `ns32k-sequent' Go to the Berkeley universe before compiling. In addition, you probably need to create a file named `string.h' containing just one line: `#include '. `ns32k-utek' UTEK ns32000 system ("merlin"). The C compiler that comes with this system cannot compile GNU CC; contact `tektronix!reed!mason' to get binaries of GNU CC for bootstrapping. `romp-*-aos' `romp-*-mach' The only operating systems supported for the IBM RT PC are AOS and MACH. GNU CC does not support AIX running on the RT. We recommend you compile GNU CC with an earlier version of itself; if you compile GNU CC with `hc', the Metaware compiler, it will work, but you will get mismatches between the stage 2 and stage 3 compilers in various files. These errors are minor differences in some floating-point constants and can be safely ignored; the stage 3 compiler is correct. `rs6000-*-aix' *Read the file `README.RS6000' for information on how to get a fix for a problem in the IBM assembler that prevents use of GNU CC.* You must either obtain the new assembler or avoid using the `-g' switch. Note that `Makefile.in' uses `-g' by default when compiling `libgcc2.c'. `vax-dec-ultrix' Don't try compiling with Vax C (`vcc'). It produces incorrect code in some cases (for example, when `alloca' is used). Meanwhile, compiling `cp-parse.c' with pcc does not work because of an internal table size limitation in that compiler. To avoid this problem, compile just the GNU C compiler first, and use it to recompile building all the languages that you want to run. Here we spell out what files will be set up by `configure'. Normally you need not be concerned with these files. * A symbolic link named `config.h' is made to the top-level config file for the machine you plan to run the compiler on (*note The Configuration File: (gcc.info)Config.). This file is responsible for defining information about the host machine. It includes `tm.h'. The top-level config file is located in the subdirectory `config'. Its name is always `xm-SOMETHING.h'; usually `xm-MACHINE.h', but there are some exceptions. If your system does not support symbolic links, you might want to set up `config.h' to contain a `#include' command which refers to the appropriate file. * A symbolic link named `tconfig.h' is made to the top-level config file for your target machine. This is used for compiling certain programs to run on that machine. * A symbolic link named `tm.h' is made to the machine-description macro file for your target machine. It should be in the subdirectory `config' and its name is often `MACHINE.h'. * A symbolic link named `md' will be made to the machine description pattern file. It should be in the `config' subdirectory and its name should be `MACHINE.md'; but MACHINE is often not the same as the name used in the `tm.h' file because the `md' files are more general. * A symbolic link named `aux-output.c' will be made to the output subroutine file for your machine. It should be in the `config' subdirectory and its name should be `MACHINE.c'. * The command file `configure' also constructs `Makefile' by adding some text to the template file `Makefile.in'. The additional text comes from files in the `config' directory, named `t-TARGET' and `h-HOST'. If these files do not exist, it means nothing needs to be added for a given target or host. 4. Make sure the Bison parser generator is installed. (This is unnecessary if the Bison output files `c-parse.c' and `cexp.c' are more recent than `c-parse.y' and `cexp.y' and you do not plan to change the `.y' files.) Bison versions older than Sept 8, 1988 will produce incorrect output for `c-parse.c'. 5. Build the compiler. Just type `make LANGUAGES=c' in the compiler directory. `LANGUAGES=c' specifies that only the C compiler should be compiled. The makefile normally builds compilers for all the supported languages; currently, C, C++ and Objective C. However, C is the only language that is sure to work when you build with other non-GNU C compilers. In addition, building anything but C at this stage is a waste of time. In general, you can specify the languages to build by typing the argument `LANGUAGES="LIST"', where LIST is one or more words from the list `c', `c++', and `objective-c'. Ignore any warnings you may see about "statement not reached" in `insn-emit.c'; they are normal. Any other compilation errors may represent bugs in the port to your machine or operating system, and should be investigated and reported. Some commercial compilers fail to compile GNU CC because they have bugs or limitations. For example, the Microsoft compiler is said to run out of macro space. Some Ultrix compilers run out of expression space; then you need to break up the statement where the problem happens. If you are building with a previous GNU C compiler, do not use `CC=gcc' on the make command or by editing the Makefile. Instead, use a full pathname to specify the compiler, such as `CC=/usr/local/bin/gcc'. This is because make might execute the `gcc' in the current directory before all of the compiler components have been built. 6. If you are using COFF-encapsulation, you must convert `libgcc.a' to a GNU-format library at this point. See the file `README.ENCAP' in the directory containing the GNU binary file utilities, for directions. 7. If you are building a cross-compiler, stop here. *Note Cross-Compiler::. 8. Move the first-stage object files and executables into a subdirectory with this command: make stage1 The files are moved into a subdirectory named `stage1'. Once installation is complete, you may wish to delete these files with `rm -r stage1'. 9. Recompile the compiler with itself, with this command: make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O" This is called making the stage 2 compiler. The command shown above builds compilers for all the supported languages. If you don't want them all, you can specify the languages to build by typing the argument `LANGUAGES="LIST"'. LIST should contain one or more words from the list `c', `c++', `objective-c', and `proto'. Separate the words with spaces. `proto' stands for the programs `protoize' and `unprotoize'; they are not a separate language, but you use `LANGUAGES' to enable or disable their installation. If you are going to build the stage 3 compiler, then you might want to build only the C language in stage 2. Once you have built the stage 2 compiler, if you are short of disk space, you can delete the subdirectory `stage1'. On a 68000 or 68020 system lacking floating point hardware, unless you have selected a `tm.h' file that expects by default that there is no such hardware, do this instead: make CC="stage1/xgcc -Bstage1/" CFLAGS="-g -O -msoft-float" 10. If you wish to test the compiler by compiling it with itself one more time, do this: make stage2 make CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" This is called making the stage 3 compiler. Aside from the `-B' option, the compiler options should be the same as when you made the stage 2 compiler. But the `LANGUAGES' option need not be the same. The command shown above builds compilers for all the supported languages; if you don't want them all, you can specify the languages to build by typing the argument `LANGUAGES="LIST"', as described above. Then compare the latest object files with the stage 2 object files--they ought to be identical, unless they contain time stamps. You can compare the files, disregarding the time stamps if any, like this: make compare This will mention any object files that differ between stage 2 and stage 3. Any difference, no matter how innocuous, indicates that the stage 2 compiler has compiled GNU CC incorrectly, and is therefore a potentially serious bug which you should investigate and report. If your system does not put time stamps in the object files, then this is a faster way to compare them (using the Bourne shell): for file in *.o; do cmp $file stage2/$file done If you have built the compiler with the `-mno-mips-tfile' option on MIPS machines, you will not be able to compare the files. 11. Install the compiler driver, the compiler's passes and run-time support. You can use the following command: make install CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" LANGUAGES="LIST" (Use the same value for `CC', `CFLAGS' and `LANGUAGES' that you used when compiling the files that are being installed. One reason this is necessary is that some versions of Make have bugs and recompile files gratuitously when you do this step. If you use the same variable values, those files will be recompiled properly. This copies the files `cc1', `cpp' and `libgcc.a' to files `cc1', `cpp' and `libgcc.a' in directory `/usr/local/lib/gcc-lib/TARGET/VERSION', which is where the compiler driver program looks for them. Here TARGET is the target machine type specified when you ran `configure', and VERSION is the version number of GNU CC. This naming scheme permits various versions and/or cross-compilers to coexist. It also copies the driver program `gcc' into the directory `/usr/local/bin', so that it appears in typical execution search paths. On some systems, this command will cause recompilation of some files. This is usually due to bugs in `make'. You should either ignore this problem, or use GNU Make. *Warning: there is a bug in `alloca' in the Sun library. To avoid this bug, be sure to install the executables of GNU CC that were compiled by GNU CC. (That is, the executables from stage 2 or 3, not stage 1.) They use `alloca' as a built-in function and never the one in the library.* (It is usually better to install GNU CC executables from stage 2 or 3, since they usually run faster than the ones compiled with some other compiler.) 12. Install the Objective C library (if you have built the Objective C compiler). Here is the command to do this: make install-libobjc CC="stage2/xgcc -Bstage2/" CFLAGS="-g -O" 13. Correct errors in the header files on your machine. Various system header files often contain constructs which are erroneous, incompatible with ANSI C or otherwise unsuitable, and they will not work when you compile programs with GNU CC. The most common erroneous construct is found in `ioctl.h', where a macro expects argument values to be substituted for argument names inside of character constants--something not done in ANSI C. This particular problem can be prevented by using `-traditional'. Other problems are not so easy to work around. GNU CC comes with shell scripts to fix known header file problems. They install corrected copies of various header files in a special directory where only GNU CC will normally look for them. The scripts adapt to various systems by searching all the system header files for the problem cases that we know about. Use the following command to do this: make install-fixincludes If you selected a different directory for GNU CC installation when you installed it, by specifying the Make variable `prefix' or `libdir', specify it the same way in this command. Note that some systems are starting to come with ANSI C system header files. On these systems, don't run `install-fixincludes'; it may not work, and is certainly not necessary. One exception: there are is a special script for System V release 4, which you should run. It is not the purpose of `install-fixincludes' to add prototypes to the system header files. We support headers with ANSI C prototypes in the GNU C Library, and we have no time to support adding them to other systems' header files. If you cannot install the compiler's passes and run-time support in `/usr/local/lib', you can alternatively use the `-B' option to specify a prefix by which they may be found. The compiler concatenates the prefix with the names `cpp', `cc1' and `libgcc.a'. Thus, you can put the files in a directory `/usr/foo/gcc' and specify `-B/usr/foo/gcc/' when you run GNU CC. Also, you can specify an alternative default directory for these files by setting the Make variable `libdir' when you make GNU CC. Compilation in a Separate Directory ==================================== If you wish to build the object files and executables in a directory other than the one containing the source files, here is what you must do differently: 1. Make sure you have a version of Make that supports the `VPATH' feature. (GNU Make supports it, as do Make versions on most BSD systems.) 2. If you have ever run `configure' in the source directory, you must undo the configuration. Do this by running: make distclean 3. Go to the directory in which you want to build the compiler before running `configure': mkdir gcc-sun3 cd gcc-sun3 On systems that do not support symbolic links, this directory must be on the same file system as the source code directory. 4. Specify where to find `configure' when you run it: ../gcc/configure ... This also tells `configure' where to find the compiler sources; `configure' takes the directory from the file name that was used to invoke it. But if you want to be sure, you can specify the source directory with the `--srcdir' option, like this: ../gcc/configure --srcdir=../gcc sun3 The directory you specify with `--srcdir' need not be the same as the one that `configure' is found in. Now, you can run `make' in that directory. You need not repeat the configuration steps shown above, when ordinary source files change. You must, however, run `configure' again when the configuration files change, if your system does not support symbolic links. Building and Installing a Cross-Compiler ========================================= GNU CC can function as a cross-compiler for many machines, but not all. * Cross-compilers for the Mips as target do not work because the auxiliary programs `mips-tdump.c' and `mips-tfile.c' can't be compiled on anything but a Mips. * Cross-compilers to or from the Vax probably don't work completely because the Vax uses an incompatible floating point format (not IEEE format). Since GNU CC generates assembler code, you probably need a cross-assembler that GNU CC can run, in order to produce object files. If you want to link on other than the target machine, you need a cross-linker as well. You also need header files and libraries suitable for the target machine that you can install on the host machine. To build GNU CC as a cross-compiler, you start out by running `configure'. You must specify two different configurations, the host and the target. Use the `--host=HOST' option for the host and `--target=TARGET' to specify the target type. For example, here is how to configure for a cross-compiler that runs on a hypothetical Intel 386 system and produces code for an HP 68030 system running BSD: configure --target=m68k-hp-bsd4.3 --host=i386-bozotheclone-bsd4.3 Next you should install the cross-assembler and cross-linker (and `ar' and `ranlib'). Put them in the directory `/usr/local/TARGET/bin'. The installation of GNU CC will find them there and copy or link them to the proper place to find them when you run the cross-compiler later. If you want to install any additional libraries to use with the cross-compiler, put them in the directory `/usr/local/TARGET/lib'; all files in that subdirectory will be installed in the proper place when you install the cross-compiler. Likewise, put the header files for the target machine in `/usr/local/TARGET/include'. You must now produce a substitute for `libgcc1.a'. Normally this file is compiled with the "native compiler" for the target machine; compiling it with GNU CC does not work. But compiling it with the host machine's compiler also doesn't work--that produces a file that would run on the host, and you need it to run on the target. We can't give you any automatic way to produce this substitute. For some targets, the subroutines in `libgcc1.c' are not actually used. You need not provide the ones that won't be used. The ones that most commonly are used are the multiplication, division and remainder routines--many RISC machines rely on the library for this. One way to make them work is to define the appropriate `perform_...' macros for the subroutines that you need. If these definitions do not use the C arithmetic operators that they are meant to implement, you might be able to compile them with the cross-compiler you are building. To do this, specify `LIBGCC1=libgcc1.a OLDCC=./xgcc' when building the compiler. Now you can proceed just as for compiling a single-machine compiler through the step of building stage 1. If you have not provided some sort of `libgcc1.a', then compilation will give up at the point where it needs that file, printing a suitable error message. If you do provide `libgcc1.a', then building the compiler will automatically compile and link a test program called `cross-test'; if you get errors in the linking, it means that not all of the necessary routines in `libgcc1.a' are available. When you are using a cross-compiler configuration, building stage 1 does not compile all of GNU CC. This is because one part of building, the compilation of `libgcc2.c', requires use of the cross-compiler. However, when you type `make install' to install the bulk of the cross-compiler, that will also compile `libgcc2.c' and install the resulting `libgcc.a'. Do not try to build stage 2 for a cross-compiler. It doesn't work to rebuild GNU CC as a cross-compiler using the cross-compiler, because that would produce a program that runs on the target machine, not on the host. For example, if you compile a 386-to-68030 cross-compiler with itself, the result will not be right either for the 386 (because it was compiled into 68030 code) or for the 68030 (because it was configured for a 386 as the host). If you want to compile GNU CC into 68030 code, whether you compile it on a 68030 or with a cross-compiler on a 386, you must specify a 68030 as the host when you configure it. Installing GNU CC on the HP Precision Architecture =================================================== There are two variants of this CPU, called 1.0 and 1.1, which have different machine descriptions. You must use the right one for your machine. All 7NN machines and 8N7 machines use 1.1, while all other 8NN machines use 1.0. The easiest way to handle this problem is to use `configure hpNNN' or `configure hpNNN-hpux', where NNN is the model number of the machine. Then `configure' will figure out if the machine is a 1.0 or 1.1. Use `uname -a' to find out the model number of your machine. `-g' does not work on HP-UX, since that system uses a peculiar debugging format which GNU CC does not know about. There are preliminary versions of GAS and GDB for the HP-PA which do work with GNU CC for debugging. You can get them by anonymous ftp from `jaguar.cs.utah.edu' `dist' subdirectory. You would need to install GAS in the file /usr/local/lib/gcc-lib/CONFIGURATION/GCCVERSION/as where CONFIGURATION is the configuration name (perhaps `hpNNN-hpux') and GCCVERSION is the GNU CC version number. Do this *before* starting the build process, otherwise you will get errors from the HPUX assembler while building `libgcc2.a'. The command make install-dir will create the necessary directory hierarchy so you can install GAS before building GCC. If you obtained GAS before October 6, 1992 it is highly recommended you get a new one to avoid several bugs which have been discovered recently. To enable debugging, configure GNU CC with the `--gas' option before building. Installing GNU CC on the Sun ============================= Make sure the environment variable `FLOAT_OPTION' is not set when you compile `libgcc.a'. If this option were set to `f68881' when `libgcc.a' is compiled, the resulting code would demand to be linked with a special startup file and would not link properly without special pains. There is a bug in `alloca' in certain versions of the Sun library. To avoid this bug, install the binaries of GNU CC that were compiled by GNU CC. They use `alloca' as a built-in function and never the one in the library. Some versions of the Sun compiler crash when compiling GNU CC. The problem is a segmentation fault in cpp. This problem seems to be due to the bulk of data in the environment variables. You may be able to avoid it by using the following command to compile GNU CC with Sun CC: make CC="TERMCAP=x OBJS=x LIBFUNCS=x STAGESTUFF=x cc" Installing GNU CC on the 3b1 ============================= Installing GNU CC on the 3b1 is difficult if you do not already have GNU CC running, due to bugs in the installed C compiler. However, the following procedure might work. We are unable to test it. 1. Comment out the `#include "config.h"' line on line 37 of `cccp.c' and do `make cpp'. This makes a preliminary version of GNU cpp. 2. Save the old `/lib/cpp' and copy the preliminary GNU cpp to that file name. 3. Undo your change in `cccp.c', or reinstall the original version, and do `make cpp' again. 4. Copy this final version of GNU cpp into `/lib/cpp'. 5. Replace every occurrence of `obstack_free' in the file `tree.c' with `_obstack_free'. 6. Run `make' to get the first-stage GNU CC. 7. Reinstall the original version of `/lib/cpp'. 8. Now you can compile GNU CC with itself and install it in the normal fashion. Installing GNU CC on Unos ========================== Use `configure unos' for building on Unos. The Unos assembler is named `casm' instead of `as'. For some strange reason linking `/bin/as' to `/bin/casm' changes the behavior, and does not work. So, when installing GNU CC, you should install the following script as `as' in the subdirectory where the passes of GCC are installed: #!/bin/sh casm $* The default Unos library is named `libunos.a' instead of `libc.a'. To allow GNU CC to function, either change all references to `-lc' in `gcc.c' to `-lunos' or link `/lib/libc.a' to `/lib/libunos.a'. When compiling GNU CC with the standard compiler, to overcome bugs in the support of `alloca', do not use `-O' when making stage 2. Then use the stage 2 compiler with `-O' to make the stage 3 compiler. This compiler will have the same characteristics as the usual stage 2 compiler on other systems. Use it to make a stage 4 compiler and compare that with stage 3 to verify proper compilation. (Perhaps simply defining `ALLOCA' in `x-crds' as described in the comments there will make the above paragraph superfluous. Please inform us of whether this works.) Unos uses memory segmentation instead of demand paging, so you will need a lot of memory. 5 Mb is barely enough if no other tasks are running. If linking `cc1' fails, try putting the object files into a library and linking from that library. Installing GNU CC on VMS ========================= The VMS version of GNU CC is distributed in a backup saveset containing both source code and precompiled binaries. To install the `gcc' command so you can use the compiler easily, in the same manner as you use the VMS C compiler, you must install the VMS CLD file for GNU CC as follows: 1. Define the VMS logical names `GNU_CC' and `GNU_CC_INCLUDE' to point to the directories where the GNU CC executables (`gcc-cpp.exe', `gcc-cc1.exe', etc.) and the C include files are kept respectively. This should be done with the commands: $ assign /system /translation=concealed - disk:[gcc.] gnu_cc $ assign /system /translation=concealed - disk:[gcc.include.] gnu_cc_include with the appropriate disk and directory names. These commands can be placed in your system startup file so they will be executed whenever the machine is rebooted. You may, if you choose, do this via the `GCC_INSTALL.COM' script in the `[GCC]' directory. 2. Install the `GCC' command with the command line: $ set command /table=sys$common:[syslib]dcltables - /output=sys$common:[syslib]dcltables gnu_cc:[000000]gcc $ install replace sys$common:[syslib]dcltables 3. To install the help file, do the following: $ library/help sys$library:helplib.hlb gcc.hlp Now you can invoke the compiler with a command like `gcc /verbose file.c', which is equivalent to the command `gcc -v -c file.c' in Unix. If you wish to use GNU C++ you must first install GNU CC, and then perform the following steps: 1. Define the VMS logical name `GNU_GXX_INCLUDE' to point to the directory where the preprocessor will search for the C++ header files. This can be done with the command: $ assign /system /translation=concealed - disk:[gcc.gxx_include.] gnu_gxx_include with the appropriate disk and directory name. If you are going to be using libg++, this is where the libg++ install procedure will install the libg++ header files. 2. Obtain the file `gcc-cc1plus.exe', and place this in the same directory that `gcc-cc1.exe' is kept. The GNU C++ compiler can be invoked with a command like `gcc /plus /verbose file.cc', which is equivalent to the command `g++ -v -c file.cc' in Unix. We try to put corresponding binaries and sources on the VMS distribution tape. But sometimes the binaries will be from an older version than the sources, because we don't always have time to update them. (Use the `/version' option to determine the version number of the binaries and compare it with the source file `version.c' to tell whether this is so.) In this case, you should use the binaries you get to recompile the sources. If you must recompile, here is how: 1. Execute the command procedure `vmsconfig.com' to copy files `vax-vms.h', `xm-vax-vms.h', `vax.c' and `vax.md' to `tm.h', `config.h', `aux-output.c', and `md.' respectively, and to create files `tconfig.h' and `hconfig.h'. This procedure also creates several linker option files used by `make-cc1.com' and a data file used by `make-l2.com'. $ @vmsconfig.com 2. Setup the logical names and command tables as defined above. In addition, define the VMS logical name `GNU_BISON' to point at the to the directories where the Bison executable is kept. This should be done with the command: $ assign /system /translation=concealed - disk:[bison.] gnu_bison You may, if you choose, use the `INSTALL_BISON.COM' script in the `[BISON]' directory. 3. Install the `BISON' command with the command line: $ set command /table=sys$common:[syslib]dcltables - /output=sys$common:[syslib]dcltables - gnu_bison:[000000]bison $ install replace sys$common:[syslib]dcltables 4. Type `@make-gcc' to recompile everything (alternatively, you may submit the file `make-gcc.com' to a batch queue). If you wish to build the GNU C++ compiler as well as the GNU CC compiler, you must first edit `make-gcc.com' and follow the instructions that appear in the comments. 5. In order to use GCC, you need a library of functions which GCC compiled code will call to perform certain tasks, and these functions are defined in the file `libgcc2.c'. To compile this you should use the command procedure `make-l2.com', which will generate the library `libgcc2.olb'. `libgcc2.olb' should be built using the compiler built from the same distribution that `libgcc2.c' came from, and `make-gcc.com' will automatically do all of this for you. To install the library, use the following commands: $ library gnu_cc:[000000]gcclib/delete=(new,eprintf) $ library libgcc2/extract=*/output=libgcc2.obj $ library gnu_cc:[000000]gcclib libgcc2.obj The first command simply removes old modules that will be replaced with modules from libgcc2. If the VMS librarian complains about those modules not being present, simply ignore the message and continue on with the next command. Whenever you update the compiler on your system, you should also update the library with the above procedure. 6. You may wish to build GCC in such a way that no files are written to the directory where the source files reside. An example would be the when the source files are on a read-only disk. In these cases, execute the following DCL commands (substituting your actual path names): $ assign dua0:[gcc.build_dir.]/translation=concealed, - dua1:[gcc.source_dir.]/translation=concealed gcc_build $ set default gcc_build:[000000] where `dua1:[gcc.source_dir]' contains the source code, and `dua0:[gcc.build_dir]' is meant to contain all of the generated object files and executables. Once you have done this, you can proceed building GCC as described above. (Keep in mind that `gcc_build' is a rooted logical name, and thus the device names in each element of the search list must be an actual physical device name rather than another rooted logical name). 7. *If you are building GNU CC with a previous version of GNU CC, you also should check to see that you have the newest version of the assembler*. In particular, GNU CC version 2 treats global constant variables slightly differently from GNU CC version 1, and GAS version 1.38.1 does not have the patches required to work with GCC version 2. If you use GAS 1.38.1, then `extern const' variables will not have the read-only bit set, and the linker will generate warning messages about mismatched psect attributes for these variables. These warning messages are merely a nuisance, and can safely be ignored. If you are compiling with a version of GNU CC older than 1.33, specify `/DEFINE=("inline=")' as an option in all the compilations. This requires editing all the `gcc' commands in `make-cc1.com'. (The older versions had problems supporting `inline'.) Once you have a working 1.33 or newer GNU CC, you can change this file back. 8. If you want to build GNU CC with the VAX C compiler, you will need to make minor changes in `make-cccp.com' and `make-cc1.com' to choose alternate definitions of `CC', `CFLAGS', and `LIBS'. See comments in those files. However, you must also have a working version of the GNU assembler (GNU as, aka GAS) as it is used as the back-end for GNU CC to produce binary object modules and is not included in the GNU CC sources. GAS is also needed to compile `libgcc2' in order to build `gcclib' (see above); `make-l2.com' expects to be able to find it operational in `gnu_cc:[000000]gnu-as.exe'. To use GNU CC on VMS, you need the VMS driver programs `gcc.exe', `gcc.com', and `gcc.cld'. They are distributed with the VMS binaries (`gcc-vms') rather than the GNU CC sources. GAS is also included in `gcc-vms', as is Bison. Once you have successfully built GNU CC with VAX C, you should use the resulting compiler to rebuild itself. Before doing this, be sure to restore the `CC', `CFLAGS', and `LIBS' definitions in `make-cccp.com' and `make-cc1.com'. The second generation compiler will be able to take advantage of many optimizations that must be suppressed when building with other compilers. Under previous versions of GNU CC, the generated code would occasionally give strange results when linked with the sharable `VAXCRTL' library. Now this should work. Even with this version, however, GNU CC itself should not be linked with the sharable `VAXCRTL'. The version of `qsort' in `VAXCRTL' has a bug (known to be present in VMS versions V4.6 through V5.5) which causes the compiler to fail. The executables that are generated by `make-cc1.com' and `make-cccp.com' use the object library version of `VAXCRTL' in order to make use of the `qsort' routine in `gcclib.olb'. If you wish to link the compiler executables with the shareable image version of `VAXCRTL', you should edit the file `tm.h' (created by `vmsconfig.com') to define the macro `QSORT_WORKAROUND'. `QSORT_WORKAROUND' is always defined when GNU CC is compiled with VAX C, to avoid a problem in case `gcclib.olb' is not yet available. Installing GNU CC on the WE32K =============================== These computers are also known as the 3b2, 3b5, 3b20 and other similar names. (However, the 3b1 is actually a 68000; see *Note 3b1 Install::.) Don't use `-g' when compiling with the system's compiler. The system's linker seems to be unable to handle such a large program with debugging information. The system's compiler runs out of capacity when compiling `stmt.c' in GNU CC. You can work around this by building `cpp' in GNU CC first, then use that instead of the system's preprocessor with the system's C compiler to compile `stmt.c'. Here is how: mv /lib/cpp /lib/cpp.att cp cpp /lib/cpp.gnu echo "/lib/cpp.gnu -traditional $*" > /lib/cpp chmod +x /lib/cpp The system's compiler produces bad code for some of the GNU CC optimization files. So you must build the stage 2 compiler without optimization. Then build a stage 3 compiler with optimization. That executable should work. Here are the necessary commands: make LANGUAGES=c CC=stage1/xgcc CFLAGS="-Bstage1/ -g" make stage2 make CC=stage2/xgcc CFLAGS="-Bstage2/ -g -O" You may need to raise the ULIMIT setting to build a C++ compiler, as the file `cc1plus' is larger than one megabyte. Installing GNU CC on the MIPS ============================== See *Note Installation:: about whether to use `--with-stabs' or not. The MIPS C compiler needs to be told to increase its table size for switch statements with the `-Wf,-XNg1500' option in order to compile `cp-parse.c'. If you use the `-O2' optimization option, you also need to use `-Olimit 3000'. Both of these options are automatically generated in the `Makefile' that the shell script `configure' builds. If you override the `CC' make variable and use the MIPS compilers, you may need to add `-Wf,-XNg1500 -Olimit 3000'. MIPS computers running RISC-OS can support four different personalities: default, BSD 4.3, System V.3, and System V.4 (older versions of RISC-OS don't support V.4). To configure GCC for these platforms use the following configurations: `mips-mips-riscos`rev'' Default configuration for RISC-OS, revision `rev'. `mips-mips-riscos`rev'bsd' BSD 4.3 configuration for RISC-OS, revision `rev'. `mips-mips-riscos`rev'sysv4' System V.4 configuration for RISC-OS, revision `rev'. `mips-mips-riscos`rev'sysv' System V.3 configuration for RISC-OS, revision `rev'. The revision `rev' mentioned above is the revision of RISC-OS to use. You must reconfigure GCC when going from a RISC-OS revision 4 to RISC-OS revision 5. This has the effect of avoiding a linker bug. DECstations can support three different personalities: Ultrix, DEC OSF/1, and OSF/rose. To configure GCC for these platforms use the following configurations: `decstation-ultrix' Ultrix configuration. `decstation-osf1' Dec's version of OSF/1. `decstation-osfrose' Open Software Foundation reference port of OSF/1 which uses the OSF/rose object file format instead of ECOFF. Normally, you would not select this configuration. ====================================================================== diff -rc2N gcc-2.3.1/ChangeLog gcc-2.3.2/ChangeLog *** gcc-2.3.1/ChangeLog Sun Nov 1 03:26:25 1992 --- gcc-2.3.2/ChangeLog Fri Nov 27 22:33:42 1992 *************** *** 1,2 **** --- 1,1182 ---- + Fri Nov 27 01:30:41 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * Version 2.3.2 released. + + * gcc.c (LINK_LIBGCC_SPECIAL_1): New parameter. + * rs6000.h (LINK_LIBGCC_SPECIAL_1): Defined. + + * t-hp320g (RANLIB, RANLIB_TEST, AR, AR_FLAGS): + Just copy value of ..._FOR_TARGET. + (LIBCONVERT): Use TARGET_TOOLPREFIX. + + * reload.c (find_reloads) [SMALL_REGISTER_CLASSES]: + Don't use preferred_class for a multiword register. + + * cccp.c (do_include): Initialize searchptr to 0. + + Fri Nov 27 07:40:54 1992 Richard Kenner (kenner at vlsi1.ultra.nyu.edu) + + * combine.c (subst, make_field_assignment, num_sign_bit_copies): + Protect calls to significant_bits; unless we only care if the + result is a power of two, don't call if mode size is wider + than HOST_BITS_PER_WIDE_INT. + (extended_count, simplify_shift_const, simplify_comparison): Likewise. + + Thu Nov 26 10:31:48 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * gstdarg.h (va_end): #undef before the declaration. + + * gstdarg.h (va_arg): Alternative definition for big-endian machines. + * gvarargs.h (va_arg): Copy both definitions from gstdarg.h. + + * limitx.h, limit.y: Test and define _GCC_LIMITS_H_, not _LIMITS_H_. + + * mips.c (mips_debugger_offset): Don't crash for unknown cases. + + * c-typeck.c (build_unary_op): Call pedantic_lvalue_warning + for *all* cases of incrementing a cast. + + * libgcc2.c (__udiv_w_sdiv): Cast 1 before shifting by 31. + + * fixincludes (PWDCMD): New variable, set specially for Apollos. + Use it to get the working dir. + + * combine.c (num_sign_bit_copies): Fix 1-off error in PLUS case. + + * c++: Put newline into `for arg do'. + + Thu Nov 26 08:32:20 1992 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * expmed.c (struct algorithm): Make coeff a HOST_WIDE_INT. + + * romp.c (output_epilog): Always call output_fpops. + + Wed Nov 25 16:24:43 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * Makefile.in (install-fixincludes): Use SYSTEM_HEADER_DIR. + + * m68ksgs.h (ASM_OUTPUT_DOUBLE_OPERAND): Really use the operand VALUE. + + * tree.h (CONSTRUCTOR_NAME_FORMAT): Let config.h override this. + * tower-as.h (CONSTRUCTOR_NAME_FORMAT): Defined. + + * c++: Replace `for arg do' which ash can't handle. + + * t-next (OTHER_FIXINCLUDES_DIRS): Delete /NextDeveloper/Headers. + + * apollo68.h (HAVE_ATEXIT): Commented out. + + * regclass.c: Fix typo in use of SECONDARY_INPUT_RELOAD_CLASS. + (copy_cost): Fix typo in use of SECONDARY_OUTPUT_RELOAD_CLASS. + + Wed Nov 25 14:15:50 1992 Jim Wilson (wilson@sphagnum.cygnus.com) + + * fixinc.svr4 (regexp.h): Don't add a getrnge declaration if a + conflicting declaration is already present. + + Wed Nov 25 06:47:18 1992 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * rs6000.h (LINK_LIBGCC_SPECIAL): No longer define. + + * stmt.c (expand_value_return): Don't emit move between differing + modes when PROMOTE_FUNCTION_RETURN is defined; convert instead. + + * integrate.c (expand_inline_function): Ensure a REG used as + COPY has REG_USERVAR_P set if LOC does. + + * optabs.c (expand_binop, expand_twoval_binop): If we are going + to fail, remove any load from MEM we did due to -fforce-mem; + if the MEM was volatile, this will cause an extra load. + (expand_complex_abs): Likewise. + Correct use of variable LAST so it doesn't include the load + from MEM (to fix unrelated bug). + + Tue Nov 24 00:23:39 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * i386bsd.h (FUNCTION_PROFILER): Use mcount, not _mcount. + + * t-next (OTHER_FIXINCLUDES_DIRS): Leave just /LocalDeveloper/Headers + and /NextDeveloper/Headers. + + Mon Nov 23 22:06:31 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * ns32k.md (movsi): Split alt 1 to deprecate xy classes in operand 1. + + * combine.c (make_extraction): When making a low part subreg of a reg, + use inner_mode, not is_mode. + + Mon Nov 23 21:11:13 1992 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * romp.h (ASM_FILE_START): Stop at first blank in VERSION_STRING. + + Mon Nov 23 21:09:20 1992 Tom Wood (wood@dg-rtp.dg.com) + + * fold-const.c (range_test): Convert the constants to the unsigned + type before expanding the range test. + + Mon Nov 23 20:54:45 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + Mon Nov 23 13:21:43 1992 Brendan Kehoe (brendan@cygnus.com) + + * c++ (first): Only shift if $first is no, on the chance we got no + arguments at all. If we didn't get anything, say so (since -lg++ + will fake out the gcc driver into thinking we want to do something). + + * cp-decl.c (start_decl): If grokdeclarator returns a + void_type_node, return a NULL_TREE. + + * cp-typeck.c (build_modify_expr_1): When calling build_opfncall for + `operator=', use make_node to create a plain NOP_EXPR for it to use, + rather than trying to pass NOP_EXPR down hoping it gets there intact. + (build_modify_expr): Ditto. + * cp-parse.y (expr_no_commas): Ditto. + * cp-method.c (build_opfncall): Use TREE_CODE on ARG3 for a + MODIFY_EXPR, since it'll be coming in properly as a tree now. + + Sat Nov 21 02:33:28 1992 Brendan Kehoe (brendan@cygnus.com) + + * cp-init.c (expand_default_init): Clear DECL_REGISTER if we're + going to call a ctor, otherwise we may end up generating bogus and + confusing error messages about taking the addr of something declared + to be `register'. + + * cp-typeck.c (build_x_function_call): Recognize a ptr-to-method + that is being passed in as a function argument or as part of + a COMPONENT_REF. + (build_indirect_ref): If ERRORSTRING is NULL (it's passed in that + way in many places), then don't try to use it. + + Thu Nov 19 01:41:58 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-dem.c (do_builtin_type): Recognize `w', a wide character, since + it's now a type according to the ANSI X3J16 working paper; output + "wchar_t" for it. + (cplus_demangle): Accept `w' as an integral type. + + Wed Nov 18 21:29:14 1992 Brendan Kehoe (brendan@cygnus.com) + + * cp-class.c (finish_struct): Re-enable code to cut down on the size + of symbol output, the positives outweigh the negatives. + + Wed Nov 18 19:51:59 1992 Mike Stump (mrs@cygnus.com) + + * cp-search.c (dfs_walk): Move setting of + vbase_decl_ptr_intermediate out of #ifdef code. + + Wed Nov 18 18:49:13 1992 Mike Stump (mrs@cygnus.com) + + * cp-decl.c (grokdeclarator): Make wording on error message + stronger. + + Tue Nov 17 17:46:11 1992 Brendan Kehoe (brendan@cygnus.com) + + * cp-search.c (CHECK_convert_pointer_to_single_level): Don't define. + + Mon Nov 23 19:44:38 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * mot3300.h (switch_table_difference_label_flag): Define it. + + * ns32k.md (addsi3): Add & for alternative 1 in operand 0. + + Mon Nov 23 18:29:27 1992 Jim Wilson (wilson@sphagnum.cygnus.com) + + * genattrtab.c (obstack.h): Include after sys/time.h. + + * c-decl.c (duplicate_decls): For builtins, create new function + type instead of trying to modify old one. + + Mon Nov 23 16:28:36 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * i386bsd.h (COMMENT_BEGIN): Redefine as #. + (ASM_APP_ON, ASM_APP_OFF): Redefine to use #. + + * combine.c (num_sign_bit_copies): Inhibit x-1 special case + when x is a paradoxical subreg. + + * xm-linux.h (malloc, calloc): Definitions deleted. + + Mon Nov 23 11:52:41 1992 Jeffrey A. Law (law@schirf.cs.utah.edu) + + * pa.md (sh[123]add): Use "nonmemory_operand" instead of + "register_operand" as the predicate for the first operand. + + Mon Nov 23 00:29:27 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * gcc.c (default_compilers): Pass -i* after -U*. + + Sun Nov 22 17:03:48 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * hp320.h (FUNCTION_PROFILER): Complete replacement. + + * xm-hp320.h (index, rindex): Defined. + + * gstddef.h: Fix prev change; test of _STDDEF_H was backwards. + + Sun Nov 22 16:12:38 1992 Tom Wood (wood@dg-rtp.dg.com) + + * toplev.c (W_options): Delete -Wreturn-type, as it is in lang_options. + * c-decl.c (c_decode_option): Decode -Wreturn-type. + + * c-decl.c, cp-decl.c (pushdecl): Don't inherit DECL_INITIAL when + redeclaring the current function. + + * integrate.c (expand_inline_function): Use the original + declaration of the inlined function rather than a redeclaration as + the BLOCK_ABSTRACT_ORIGIN of the body. + + Sat Nov 21 19:54:57 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * cccp.c (main): Do -D's and -A's and -U's in order specified. + + * gcc.c (default_compilers): When running cpp, + move %{D*} and %{U*} (in that order) just before %i. + + Sat Nov 21 18:24:55 1992 Torbjorn Granlund (tege@hal.gnu.ai.mit.edu) + + * xm-pa.h: Remove #ifdef hpux stuff. + (S_ISDIR): Remove. + * xm-pahpux.h: New file, developed from old xm-pa.h. Define + rindex/index. + * pa-hpux7.h, pa-gux7.h: New files. + + * configure (hppa1.0-*-hpux*, hppa1.0-*-hpux*): Use xm-pahpux.h. + (hppa1.0-*-hpux7*): New alternative. + + Sat Nov 21 14:10:57 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * spc-sol2.h (SWITCH_TAKES_ARG, LINK_SPEC): New override definitions. + + * xm-mot3300.h (index, rindex): Defined. + + Sat Nov 21 07:54:53 1992 Michael Meissner (meissner@osf.org) + + * mips.h (MIPS_VERSION): Set Meissner version number to 29. + + * mips.c (mips_expand_prologue): If profiling, emit an insn to + block other insns from being scheduled before the end of the + prologue. + + * mips.md (blockage): New unspec_volatile insn to prevent other + insns from being scheduled before it. + + Sat Nov 21 06:03:38 1992 Brendan Kehoe (brendan@cygnus.com) + + * sdbout.c (template_name_p): New function. + (sdbout_record_type_name): Use it to possibly use the + DECL_ASSEMBLER_NAME instead of DECL_NAME if looking at a template. + (sdbout_symbol): Ditto. + + Fri Nov 20 15:31:05 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * dbxout.c (dbxout_type): Handle need for name of a RECORD_TYPE + when it has none. + + * configure (sparc-*-solaris2): Set broken_install. + + * integrate.c (subst_constants): Inhibit special treatment of subreg + when the stuff inside is not a reg. + + * config/plexus.h (SIZE_TYPE): Fix syntax. + + * gcc.c (do_spec_1): Handle MKTEMP_EACH_FILE. + + Fri Nov 20 15:10:20 1992 david d `zoo' zuhn (zoo at cirdan.cygnus.com) + + * fixincludes (math.h): Get rid of inconsistent inline definitions + for abs that are present in HP-UX 8.0. + + Fri Nov 20 10:07:48 1992 Michael Meissner (meissner@osf.org) + + * collect2.c (FREAD, FWRITE): Undef these macros if they were + defined before including ldfcn.h. + + Fri Nov 20 15:38:47 1992 Tom Wood (wood@dg-rtp.dg.com) + + * integrate.c (expand_inline_function): Mark all notes as integrated. + + * final.c (final): When producing SDB debugging info, delete line + number notes from inlined functions in other files as well as + duplicate line number notes. + + Fri Nov 20 05:24:16 1992 Jim Blandy (jimb@totoro.cs.oberlin.edu) + + * config.sub: Added machines and operating systems for Emacs + ports, since Emacs now uses config.sub for its configuration. + New manufacturers recognized not to be operating systems: High + Level Hardware (highlevel, defaults to using BSD), Gould + (gould, defaults to System V), Commodore (cbm, defaults to + amigados), National Semiconductor (ns, defaults to Genix), and + Masscomp (masscomp, defaults to RTU). + Recognize the NS1600 (ns16k) and the Clipper (clipper) as + processors. + Recognize these processors with default manufacturers: the + Cydra (cydra) from Cydrome (cydrome), the XPS100 (xps100) from + Honeywell (honeywell), and the Orion (orion) and Orion 1/05 + (orion105) from High Level Hardware (highlevel). + If the ISC operating system is given with a version number, + don't kill it and set it to 2.2; just have it default to 2.2 + if omitted. + Make Irix SGI's default operating system, not SYSV. + Make BSD Encore's default, so it applies for all Encore + machines, not just the umax and mmax abbreviations. + All of Encore's machines use BSD, not just the ns32k-based + ones. Make it the manufacturer's default. + Make it possible to specify an operating system for a Gould + machine. Make sysv the manufacturer's default, so it applies + when we specify the manufacturer as well as when we omit it. + Add Uniplus (uniplus), Iris (iris), Xenix (xenix), and RTU + (rtu) as recognized operating system names. + + Wed Nov 18 17:58:18 1992 Karl Berry (karl@cs.umb.edu) + + * i386iscgas.h (SDB_DEBUGGING_INFO): #undef. + (DBX_DEBUGGING_INFO): #define. + (DBX_OUTPUT_MAIN_SOURCE_{DIRECTORY,FILENAME}): Override dbxout.c. + + * bsd386.h (LPREFIX) [NO_UNDERSCORES]: Define as `.L'. + + Wed Nov 18 13:50:43 1992 Michael Meissner (meissner@osf.org) + + * mips.c (compute_frame_size): Make sure the {gp,fp}+offset fields + are always initialized, even if there were no gp/fp registers + saved. + + Wed Nov 18 09:58:50 1992 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * a29k.md (insv): Remove constraints from operand matching + const_0_operand. + + * regclass.c (regclass): Add missing cast from enum to int. + + Wed Nov 18 09:40:01 1992 John Hassey (hassey@dg-rtp.dg.com) + + * core.c (initialize_class): The class may not have an initialize + method. + + Wed Nov 18 09:40:01 1992 Wilson Tien (wtien@urbana.mcd.mot.com) + + * xm-m68kv.h (rindex, index): use strrchr and strchr instead. + + Wed Nov 18 01:27:37 1992 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu) + + * config.sub: Added Xenix operating system. + + Tue Nov 17 18:32:01 1992 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * reload.c (combine_reloads): Don't combine with a reload needed + for multiple things. + + Mon Nov 16 08:52:52 1992 Jeffrey A. Law (law@mole.gnu.ai.mit.edu) + + * pa.c (output_move_double): Handle indirect stores to memory + via an auto-incremented/auto-decremented register in the same + manner in which loads are handled. + + Thu Nov 12 21:02:59 1992 Brendan Kehoe (brendan@mole.gnu.ai.mit.edu) + + Cygnus<-->FSF merge. + + Thu Nov 12 15:02:53 1992 Brendan Kehoe (brendan@cygnus.com) + + * cp-decl.c (finish_decl): Don't try to use TYPE if it's an + error_mark_node. + + * cp-decl.c (sigsegv): Set to the default handler before calling + anything, so we can avoid possible infinite loops. Call + my_friendly_abort instead of just error(). + * cp-type2.c (my_friendly_abort): If I is 0, it's coming from sigsegv. + + * cp-type2.c (my_friendly_assert): New function. + * cp-call.c, cp-class.c, cp-class.h, cp-cvt.c, cp-decl.c, cp-decl.h, + cp-decl2.c, cp-dem.c, cp-edsel.c, cp-except.c, cp-expr.c, cp-gc.c, + cp-hash.h, cp-init.c, cp-input.c, cp-lex.c, cp-lex.h, cp-method.c, + cp-pt.c, cp-search.c, cp-spew.c, cp-tree.c, cp-tree.h, cp-type2.c, + cp-typeck.c, cp-xref.c, cp-parse.y: Don't include assert.h, and use + the new function `my_friendly_assert' instead of the `assert' macro. + + Wed Nov 11 22:14:51 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * tree.h (perm_calloc): Add decl. + * cp-parse.y (except_stmts): Declare return type of get_insns, + since we don't (can't) include rtl.h. + * cp-tree.c (TYPE_HASH): Use HOST_WIDE_INT instead of int when + casting pointers to integers. + (ld_cmp): Likewise. + * cp-call.c (build_method_call): Likewise. + * cp-class.c (finish_struct_methods): Likewise. + * cp-method.c (build_overload_value): Add decl of index. + (build_opfncall): Cast to HOST_WIDE_INT, not int. + * cp-search.c (get_binfo): Likewise. + (get_base_distance): Likewise. + (breadth_first_search): Likewise. Also declare to return + HOST_WIDE_INT, not int. + + Wed Nov 11 14:34:25 1992 Mike Stump (mrs@rtl.cygnus.com) + + Thu Nov 5 15:58:38 1992 Tim Moore (moore at defmacro.cs.utah.edu) + + * cp-decl.c (duplicate_decls): Round to obstack alignment when + testing if newdecl is at the top of the permanent obstack. + + Wed Nov 11 13:56:18 1992 Mike Stump (mrs@rtl.cygnus.com) + + * cp-search.c (build_vbase_vtables_init): Make sure external virtual + tables are declared on machines that need the declaration by calling + assemble_external. + + Wed Nov 11 12:51:44 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-decl2.c (grokfield): If the init field is really a list with + just an error_mark_node, then it wasn't a real initialization, so + don't treat it like one. + + Tue Nov 10 16:21:20 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-init.c (build_new): If arg 1 of an array reference is an + error_mark, then just pretend that there were 0 elements. + + Tue Nov 10 13:23:30 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-typeck.c (build_x_function_call): If the type of FUNCTION is an + error_mark, don't bother checking its lang-specific info. + + Tue Nov 10 12:38:36 1992 Mike Stump (mrs@rtl.cygnus.com) + + * cp-decl.c (decls_match): Avoid core dumping when TREE_TYPE is + NULL_TREE, as is the case when olddecl is a TEMPLATE_DECL. + + Tue Nov 10 11:03:36 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-decl.c (pushdecl_top_level): Disable assert for now; it's + always acted correctly. + + Mon Nov 9 12:04:27 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-parse.y (try_for_typename): Deleted rule. + (scoped_id): Don't use it. + + Fri Nov 6 18:07:37 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-init.c (expand_aggr_init): If INIT is 0, don't bother trying to + play with its type. + + Thu Nov 5 16:52:37 1992 Chip Salzenberg (chip@tct.com) + + * cp-decl.c (finish_decl): Set TREE_STATIC, TREE_PUBLIC and + DECL_EXTERNAL correctly for use with #pragma interface. + + Fri Nov 6 10:07:01 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-class.c (finish_struct): Don't try to work with a field that + got a bogus type. + + * cp-method.c (build_overload_value): Don't call debug_tree! + + * cp-call.c (build_method_call): If processing a default argument + that calls a ctor for its default value, use INSTANCE_PTR for the + parm list, discarding what we knew before. + + * cp-decl.c (grokdeclarator): If initializing a const member and + acting pedantic, then do make it an error. + + * cp-decl2.c (warn_traditional): New variable. + (lang_decode_option): Use it for -Wtraditional and -Wno-traditional. + * cp-tree.h (warn_traditional): Add decl. + * cp-lex.c (readescape): For x, avoid overflow when shifting in if. + Warn for \a and \x if warn_traditional; pass through + the escaped x and a if -traditional. Support \e like \E; for both, + pedwarn about ANSI C. + + * cp-call.c (find_scoped_type): Delete arg TAGS; instead, compute it + inside from TYPE. If TAGS is null, don't return immediately, since + we need to look for TYPE_DECLs. + (resolve_scope_to_name): Call find_scoped_type without replicating + the tags. + + Thu Nov 5 17:53:32 1992 Brendan Kehoe (brendan@cygnus.com) + + * cp-decl.c (grokdeclarator): Constant class members can be + initialized. + + Thu Nov 5 17:11:30 1992 Mike Stump (mrs@cygnus.com) + + Thu Nov 5 19:48:17 1992 Niklas Hallqvist (niklas@appli.se) + + * cp-pt.c (instantiate_class_template): Types are used in later + processing, so they must go into the permanent obstack. + + Thu Nov 5 13:02:56 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-decl.c (grokdeclarator): Don't allow members to be initialized + in the class declaration. + + * cp-decl2.c (finish_file): Set the DECL_CLASS_CONTEXT on a function + that's a file-scope set of ctors/dtors for global variables, so + is_friend will see things the way they should be seen. + + * cp-call.c (find_scoped_type): New function. + (resolve_scope_to_name): Use it to check for names that might be in + base classes. + + Wed Nov 4 00:43:15 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-parse.y (db_yyerror): Deleted fn. + (yyprint, yyerror, init_parse, yyhook, reduce_cmp, token_cmp, + print_parse_statistics,set_yydebug, debug_yytranslate): Moved to + cp-lex.c. + (reduce_count, token_count): Ditto. + (current_declspecs): Made static. + + * cp-typeck.c (build_c_cast): Warn if casting between a pointer and + an integer whose sizes differ. + + * cp-parse.y (unary_expr): Finish making new with placement work; + use the rule `new' instead of the token `NEW' when parsing it. + + Tue Nov 3 02:16:47 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-typeck.c (c_expand_return): Avoid referencing DECL_NAME if it's + null when checking for a ref to or the addr of a local variable. + + * cp-search.c (dfs_pushdecls): Don't try to use the context of a + field which has none at the time. + + * cp-decl.c (redeclaration_error_message): Don't complain about + redefinition of a function if it's a definition of an abstract + virtual function. + (duplicate_decls): For an abstract virtual, don't use the old RTL + from abort when creating the RTL for the newdecl. + + Tue Nov 3 00:15:44 1992 Brendan Kehoe (brendan@cygnus.com) + + * cp-decl.c (grokdeclarator): For `inline', `unsigned', and `signed', + see them as types, not as storage class specs, when looking for more + than one storage class. + + * cp-lex.c (readescape): New arg ignore_ptr. + (real_yylex): Pass new arg, handle result that comes back. + + * cp-decl.c (WCHAR_TYPE_SIZE): Deleted; never used. + + Mon Nov 2 10:23:52 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-lex.c (real_yylex): Let skip_white_space handle \r. + + * cp-parse.y (parmlist): Warn on a decl `foo (...)', without a first + argument. + + * cp-type2.c (build_functional_cast): If expr_as_ctor's argument is + a SAVE_EXPR, don't wipe out the argument. + + * cp-call.c (build_method_call): Only complain about not having an + object for a called method if the method is non-static. + + Sun Nov 1 16:50:14 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-decl2.c (warn_char_subscripts): Declare. + (lang_decode_option): Handle -Wchar-subscripts. + * cp-typeck.c (build_array_ref): If the type of either the array or + its index is an error_mark_node, then return one. Add code to see + if the index is a character (add warning), then do the default + promotions. Don't warn if it's a register array. Make a ref + volatile if the array is volatile. + * cp-tree.h (warn_char_subscripts): Add decl. + + * cp-typeck.c (common_type): If either type is nonsense (an + error_mark), use the other type. + + Thu Oct 29 18:39:50 1992 Mike Stump (mrs@cygnus.com) + + * cp-decl.c (grokdeclarator): Fix problem introduce by me on Oct 22 + 17:41:13. Put back call to build_offset_type that I took out, as it + is not wrong, as the comment for build_offset_type had led me to + believe. + + Thu Oct 29 17:30:12 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-cvt.c: Delete block-level extern decls; include flags.h instead. + * cp-tree.h (flag_int_enum_equivalence): Declare here. + * cp-call.c: Not here. + + * Makefile.in (stamp-cp-parse): There are now only 29 shift/reduce + conflicts, because of the removed wrapper stuff. + + * cp-lex.c (lastiddecl, ridpointers): Define here. + (NORID): Don't define here. + * cp-lex.h (NORID): Define here instead. + (ridpointers, lastiddecl, token_buffer, looking_for_typename): Ditto. + (make_pointer_declarator, make_reference_declarator, + reinit_parse_for_function, reinit_parse_for_method, yylex): Likewise. + * cp-parse.y: Don't define any of them in here. + + * cp-typeck.c (commonparms): Call tree_cons with NULL_TREEs, not 0s. + (convert_arguments): Likewise. + Throughout the file, say `ANSI C++ forbids', not `ANSI C forbids'. + * cp-lex.c, cp-type2.c: Likewise. + + Remove wrapper functionality from the compiler. + * cp-call.c (build_method_call): Delete wrap and wrap_type. + Delete code that used them. Don't set err_name to "wrapper", since + wrapper_name doesn't exist anymore. + * cp-class.c (finish_base_struct): Don't worry about TYPE_WRAP_TYPE. + * cp-decl.c (grokfndecl): Delete code for WRAPPER_EXPR and + ANTI_WRAPPER_EXPR. + (grokdeclarator): Likewise. Don't set TREE_HAS_WRAPPER_PRED. + * cp-decl2.c (grokclassfn): Likewise. + (check_classfn): Likewise. + * cp-init.c (get_member_function): Don't check TYPE_NEEDS_WRAPPER. + * cp-lex.c (real_yylex): Don't check WRAPPER_OR_ANTI_WRAPPER_NAME_P. + * cp-method.c (wrapper_name, wrapper_pred_name, anti_wrapper_name): + Deleted variables. + (init_method): Don't do any setup for *WRAPPER_*. + (hack_wrapper): Deleted function. + * cp-parse.y (wrapper): Deleted rule. + (identifier_or_opname): Deleted all wrapper predicates. + (notype_declarator): Deleted predicates LEFT_RIGHT for wrappers. + * cp-ptree.c (print_lang_type): Deleted message for printing "wrapper". + * cp-search.c (get_wrapper): Deleted fn. + * cp-tree.h (struct lang_type): Deleted has_wrapper_pred and + wrap_type members. + (build_wrapper, hack_wrapper, get_wrapper): Deleted decls. + (wrapper_name, wrapper_pred_name, anti_wrapper_name): Deleted decls. + (TYPE_WRAP_TYPE, TYPE_HAS_WRAPPER, TYPE_NEEDS_WRAPPER, + TYPE_HAS_WRAPPER_PRED, WRAPPER_DECL_FORMAT, WRAPPER_PRED_DECL_FORMAT, + ANTI_WRAPPER_DECL_FORMAT, WRAPPER_NAME_FORMAT, + WRAPPER_PRED_NAME_FORMAT, ANTI_WRAPPER_NAME_FORMAT, + WRAPPER_NAME_P, WRAPPER_PRED_NAME_P, ANTI_WRAPPER_NAME_P, + WRAPPER_OR_ANTI_WRAPPER_NAME_P): Deleted. + (enum overload_flags): Deleted WRAPPER_FLAG, WRAPPER_PRED_FLAG, + and ANTI_WRAPPER_FLAG tags. + * cp-typeck.c (build_function_call_real): Delete wrapper code. + (unary_complex_lvalue): Don't check TYPE_NEEDS_WRAPPER. + * stmt.c (warn_if_unused_value): Don't check *WRAPPER_EXPR. + * tree.def (WRAPPER_EXPR, ANTI_WRAPPER_EXPR): Deleted. + + Wed Oct 28 15:38:44 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-cvt.c (convert_to_reference): New arguments FNDECL, PARMNUM, + and ERRTYPE. Use them to give warnings about const and volatile + references being used incorrectly. Call itself with dummy arguments + where appropriate. + (convert): Call convert_to_reference with dummy args. + (convert_force): Likewise. + * cp-typeck.c (warn_for_assignment): Remove static declaration, + cp-cvt.c needs to see it now. + (convert_for_initialization): Call convert_to_reference with fndecl, + parmnum, and errtype. + + Tue Oct 27 17:38:18 1992 Mike Stump (mrs@cygnus.com) + + * cp-decl.c (grokdeclarator): Fix problem introduce by me on Oct 22 + 17:41:13. Only output error or warning message about extra + qualifiers when we are inside a class declaration. + + Tue Oct 27 16:21:41 1992 Mike Stump (mrs@cygnus.com) + + * cp-tree.h (THIS_NAME_P): Fix to reflect September 1 change in + THIS_NAME. + + Tue Oct 27 12:35:59 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-parse.y (operator_name): Remove check for top-level operator + decl. + * cp-decl.c (grokdeclarator): Complain here about type conversion + operators that aren't declared as members of classes. + + * cp-decl.c (grokdeclarator): Only call do_friend on a friend if + decl's non-zero. + + ue Oct 27 09:31:08 1992 Mike Stump (mrs@cygnus.com) + + * cp-lex.c (do_identifier): Add missing fourth argument to + lookup_field. + + Mon Oct 26 15:15:39 1992 Mike Stump (mrs@cygnus.com) + + * cp-cvt.c (convert_to_reference): Check for ambiguities + between constructor and conversion operators a bit harder. + + Sat Oct 24 19:34:39 1992 Brendan Kehoe (brendan@cygnus.com) + + Mon Sep 14 14:36:53 1992 Chip Salzenberg (chip@tct.com) + + cp-decl.c (poplevel): If apparently nested inline function has + DECL_ABSTRACT_ORIGIN, don't output it; propagate TREE_ADDRESSABLE. + (pushdecl): When copying inline details into an extern decl, + copy DECL_RESULT, TREE_ASM_WRITTEN. Set DECL_ABSTRACT_ORIGIN. + + Fri Oct 23 18:52:19 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-decl.c (poplevel): Use error_with_decl on an unused label, so + its line number comes out correct. + + Thu Oct 22 18:31:50 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-parse.y (operator_name): If a type conversion operator is + defined at the top level, don't crash, complain. + + Thu Oct 22 17:41:13 1992 Mike Stump (mrs@cygnus.com) + + * cp-decl.c (grokdeclarator): Return void_type_node instead of + NULL_TREE on errors, to forestall another error message. Check for + redundant or illegal qualification on class members. + + Thu Oct 22 13:15:57 1992 Mike Stump (mrs@cygnus.com) + + * cp-tree.h (ANON_AGGRNAME_P): Check the second charater as well, as + it could be $vtbl_ptr_type, and not an ANON_AGGRNAME. + + Wed Oct 21 19:31:36 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * cp-call.c (build_method_call): Initialize b_or_d to 0. + + * cp-typeck.c (compparms): Delete dead code for returning if either + TREE_PURPOSE is true when t1 and t2 are both 0. + + * cp-parse.y (object): Only pass one argument into build_x_arrow. + + * cp-parse.y (unary_expr): Add code to parse `&&label'. + (stmt): Expand computed gotos. + + * cp-method.c (fndecl_as_string): Say it's static before giving its + type, it looks better (and matches how you'd declare it). + + Wed Oct 21 16:22:43 1992 Mike Stump (mrs@cygnus.com) + + * cp-decl.c (start_decl): return NULL_TREE, not error_mark_node to + signify error. + * cp-decl2.c (cplus_decl_attributes): New function. Don't call + decl_attributes if the first argument is NULL_TREE. + * cp-tree.h (cplus_decl_attributes): Declare new function. + * cp-parse.y: Changed all calls to decl_attributes into calls to + cplus_decl_attributes, as all calls may pass NULL_TREE in the first + argument. + + Wed Oct 21 11:40:35 1992 Mike Stump (mrs@cygnus.com) + + * cp-call.c (build_method_call): Avoid an abort on parse errors by + changing an assert into a conditional my_friendly_abort. + + Tue Oct 20 16:52:32 1992 Mike Stump (mrs@cygnus.com) + + * cp-tree.h (TYPE_ASSEMBLER_NAME_STRING, + TYPE_ASSEMBLER_NAME_LENGTH): New macros. + * cp-search.c (build_type_pathname): Use new macros. + * cp-decl.c (pushtag): Set DECL_ASSEMBLER_NAME for TYPE_DECLs with + build_overload_name so that assembler names for template type things + are like __vt$t1X1Zi$1T.4 and not __vt$X$T.4. + * cp-decl.c (pushdecl): Since the rest of the compiler wants to use + DECL_NAME for TYPE_DECLs, use that instead of DECL_ASSEMBLER_NAME. + + Tue Oct 20 11:29:50 1992 Mike Stump (mrs@cygnus.com) + + Wed Oct 7 16:01:55 1992 Chip Salzenberg (chip@tct.com) + + [ changes propagated from 921005 snapshot ] + * cp-lex.c (readescape): No warning if digits in \x are all 0's. + + Fri Oct 9 15:18:19 1992 Brendan Kehoe (brendan@cygnus.com) + + * cp-decl.c (duplicate_decls): Only find out if olddecl is a + friend after we know it's not a TREE_LIST. + + Wed Oct 7 16:04:34 1992 Mike Stump (mrs@cygnus.com) + + Wed Oct 7 12:26:07 PDT 1992 Ron Guilmette (rfg at netcom.com) + + * cp-lex.c (readescape): Permit \? as an escape sequence. + + Tue Oct 6 17:54:09 1992 Mike Stump (mrs@cygnus.com) + + Major MI revamp. + + * cp-search.c (get_binfo, find_base_distance): Fix comments. + Disable incorrect code that would incorrectly find ambiguities where + none existed. Add some code to find all ambiguities. + * cp-search.c (get_binfo2_recursive, get_binfo2): Added to find + ambiguities. + + * cp-search.c (convert_pointer_to_single_level): Added so that one + can convert pointer unambiguously to an immediate base class + pointer. + + * cp-search.c (dfs_walk): Added comments. Fixed to keep track of + how it walks the inheritance hierarchy so that when we get down to + the bottom, we have a pointer to what we want. + * cp-search.c (dfs_find_vbases): Changed to use new intermediate + pointer instead of incorrectly trying to convert at the bottom. + * cp-search.c (init_vbase_pointers): Changed to set up new + intermediate pointer. + + * cp-*.c: Rename child -> base_binfo, child_child -> + base_base_binfo, child_binfos -> base_binfos, .*_child -> + .*_base_binfo. Rename DERIVED_FROM_P to UNIQUELY_DERIVED_FROM_P. + + Tue Oct 6 14:51:13 1992 Brendan Kehoe (brendan@rtl.cygnus.com) + + * cp-spew.c (yylex_ctr): Make unsigned. + * cp-decl2.c (spew_debug): Add extern reference. + (lang_decode_option): New option `-spew-debug', so masochists can + use it when they need to. + + Mon Oct 5 15:47:35 1992 Brendan Kehoe (brendan@rtl.cygnus.com) + + Implement protected baseclasses. + * cp-class.c (finish_base_struct): Set TREE_VIA_PROTECTED. + (finish_struct_methods): Check for either public or protected + members to kick out of the "all members are private" test. + * cp-decl.c (xref_tag): Set TREE_VIA_PROTECTED appropriately. + * cp-parse.y (base_class_visibility_list): Remove code about + `protected' visibility not being implemented. + * cp-pt.c (tsubst): Set via_protected and call hash_tree_cons + with it as necessary. + * cp-search.c (compute_visibility): Set visibility if protected. + Return the appropriate visibility when resolving a field. + (lookup_field): Set TREE_VIA_PROTECTED for btypes from its child. + When complaining about a member being protected, differentiate when + it's from a protected base class (could be a public member in the + base). + (lookup_fnfields): Set TREE_VIA_PROTECTED. + (get_baselinks): Pass TREE_VIA_PROTECTED into hash_tree_cons. + Also pass a 0 when necessary. + * cp-tree.c (propagate_binfo_offsets): Set TREE_VIA_PROTECTED. + (layout_vbasetypes): Ditto. + (layout_basetypes): Ditto. + (list_hash_lookup): Check TREE_VIA_PROTECTED when looking at an + incomplete basetype. + (hash_tree_cons): New argument `via_protected'. Set TREE_VIA_PROTECTED + when necessary. + (list_hash_lookup_or_cons): Check TREE_VIA_PROTECTED when making + sure a hash list is sane. + (make_binfo): Set TREE_VIA_PROTECTED for the new child. + + Mon Oct 5 13:27:44 1992 Mike Stump (mrs@cygnus.com) + + * cp-init.c (maybe_adjust_addr_for_delete): Make sure we don't + evaluate the addr twice if it has side effects. + + Mon Oct 5 13:05:37 1992 Mike Stump (mrs@cygnus.com) + + * cp-init.c (build_vec_delete): Make sure we don't evaluate the base + expression twice if it has side effects. + + Mon Oct 5 12:38:35 1992 Brendan Kehoe (brendan@rtl.cygnus.com) + + * cp-decl.c (grokdeclarator): Issue a warning or error if we're + being ANSI-careful when they do `extern inline'. + (flag_ansi): Add extern decl. + + Mon Oct 5 12:34:32 1992 Mike Stump (mrs@cygnus.com) + + * cp-class.c (finish_struct): Don't give an error if an enumeration + type is stuck in a bit-field, as it is legal c++. + + Mon Oct 5 11:43:09 1992 Mike Stump (mrs@cygnus.com) + + Mon Sep 14 16:39:10 1992 Chip Salzenberg (chip@tct.com) + + * cp-cvt.c (convert_to_integer): Don't pass truncation thru lshift + if shift count >= width of narrower type. Instead, just use 0. + + Fri Oct 2 13:21:40 1992 Ken Raeburn (raeburn@kyriath.cygnus.com) + + * cp-decl.c (start_function): Reinstate error check for missing + semicolon erroneously removed. + + Thu Nov 12 17:37:23 1992 Michael Meissner (meissner@osf.org) + + * mips.md (movdf_internal): Split movdf insn into two -- one for + normal use, and one for -msoft-float, and don't prefer FPU + registers in the -msoft-float case. + (movsf_internal): Ditto for movsf. + + Thu Nov 12 07:30:17 1992 James Van Artsdalen (james at bigtex.cactus.org) + + * i386.h (HARD_REGNO_MODE_OK): Restrict MODE_INT from FP regs only. + + * i386.md (floatMN2 recognizers): Don't omit mode on a + match_operand that might be reloaded. Split into separate + patterns for each mode. + (zero_extract test): Disable for now. + + * i386.c (float_op): Delete - no longer used. + + Wed Nov 11 11:55:22 1992 Richard Kenner (kenner at vlsi1.ultra.nyu.edu) + + * combine.c (simplify_comparison, case ASHIFTRT): mode_for_size + returns BLKmode on error, not VOIDmode. + + * romp.md (reload_outdi): Write as proper PARALLEL. + + Wed Nov 11 01:06:33 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * toplev.c (lang_options): Change +e... to -+e... + + * xm-tower.h: Include xm-svr3.h. + (bcopy, bzero, bcmp, USG): Macros deleted. + + Tue Nov 10 12:26:23 1992 Steve Chamberlain (sac@cygnus.com) + + * sdbout.c (plain_type_1): Handle LONG_TYPE_SIZE like INT_TYPE_SIZE. + + Tue Nov 10 14:20:27 1992 Michael Meissner (meissner@osf.org) + + * mips.md (ffssi2): Add =& constraints to the two match_scratch + clobbered registers. Fix from John F Carr. + + * mips-tdump.c (toplevel): Move #undef index and rindex before + including sym.h. + + Tue Nov 10 10:37:50 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * Makefile.in (install-common): Delete deps $(srcdir)/g++ $(srcdir)/c++ + + * expr.c (init_expr_once): Try indexing mem by fp as well as sp. + + Tue Nov 10 10:28:59 1992 Chris Smith (csmith@convex.com) + + * genattrtab.c (main): Unlimit stack size. + + Tue Nov 10 10:17:51 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * print-rtl.c (print_rtx): Use sizeof spaces - 1 to get the length + of the spaces string. + + Tue Nov 10 09:56:32 1992 Jeffrey A. Law (law@schirf.cs.utah.edu) + + * pa-hpux.h (LINK_SPEC): Disable linking against shared libraries. + * pa-ghpux.h (LINK_SPEC): Likewise. + + Tue Nov 10 08:39:01 1992 Richard Kenner (kenner at vlsi1.ultra.nyu.edu) + + * elxsi.h (GO_IF_LEGITIMATE_ADDRESS): Verify that register is valid + for use as base register (un-allocated pseudos aren't when strict). + + Mon Nov 9 22:17:23 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * xm-3b1.h (index, rindex): Define as macros. + + * i386bsd.h: Complete rewrite. + + Mon Nov 9 14:22:38 1992 Michael Meissner (meissner@osf.org) + + * mips.h, decrose.h: Move LINK_LIBGCC_SPECIAL to decrose.h. + + Mon Nov 9 12:39:03 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * unroll.c (final_biv_value): Make a note after loop_end + if we need to use NEXT_INSN (loop_end). + + * objc-actions.c (build_message_expr): Don't crash if super_type is 0. + + Mon Nov 9 07:42:30 1992 Richard Kenner (kenner at vlsi1.ultra.nyu.edu) + + * caller-save.c (save_call_clobbered_regs): Ensure any insns we add + are in the same basic block as the insn we added them for. + + Mon Nov 9 12:35:57 1992 Torbjorn Granlund (tege@jupiter.sics.se) + + * pa.h (TARGET_*): Move it to the beginning of the file. + (CPP_SPEC): Handle -mnosnake. + * pa-ghpux.h pa-hpux.h pa1-ghpux.h pa1-hpux.h pa1.h pa.h: Move + definition of TARGET_DEFAULT to before inclusion of other pa*h files. + Only define TARGET_DEFAULT if not already defined. + Get rid of hpux8 conditionals. + + Sun Nov 8 20:38:19 1992 James Van Artsdalen (james at bigtex.cactus.org) + + * i386.md (movstrsi): mask move count after signed shift. + + Sun Nov 8 00:24:30 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * fixinc.svr4: Avoid use of | in sed regexp; use multiple s commands. + + * i386mach.h: Include i386gstabs.h, not i386gas.h. + + * gsyslimits.h: Renamed from syslimits.h. + * Makefile.in (USER_H): syslimits.h deleted. + (install-common-headers): Install gsyslimits.h as syslimits.h. + Depend on gsyslimits.h and assert.h. + + * cccp.c (rescan): Accept # as command inside macro args, etc. + If an actual newline at the same level precedes. + + * fixincludes (EXINIT): Set it to `set', not null. + + * toplev.c (main): Use strncmp when testing for gstabs+ vs gstabs. + + Sat Nov 7 17:46:35 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * optabs.c (expand_unop): + For complex negation, do get_insns, not gen_sequence. + + * c-decl.c (finish_decl): Don't clear DECL_INITIAL in inline fn decls. + + * c-typeck.c (process_init_constructor): Strip NOP_EXPR from indices. + Clear end_index if there's an error in a range. + + * mips-5sysv.h, mips-5svr4.h, mips-5bsd.h (CPP_PREDEFINES): + Add single-underscore variants of all the predefined symbols. + + * gstddef.h [_ANSI_H_]: When undefing at the end, test _STDDEF_H, + not __need_ptrdiff_t. + + * mips.c (gen_int_relational): Handle overflow when incrementing cmp1. + + Fri Nov 6 23:03:14 1992 Brendan Kehoe (brendan@lisa.cygnus.com) + + * elxsi.c: Include config.h. + + Fri Nov 6 18:53:21 1992 Chip Salzenberg (chip@tct.com) + + * i386sco.h (STARTFILE_SPEC): Fix line wrap. + (SIGNED_CHAR_SPEC): Defined to set _CHAR_UNSIGNED. + + Fri Nov 6 19:06:56 1992 Jim Wilson (wilson@sphagnum.cygnus.com) + + * dbxout.c (dbxout_symbol): Give name ` ' to unnamed enums. + + Fri Nov 6 15:26:30 1992 Richard Kenner (kenner at vlsi1.ultra.nyu.edu) + + * optabs.c (init_libfuncs): Add casts when comparing/incrementing enum. + + Fri Nov 6 15:41:00 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * toplev.c (main): Really accept -gstabs+. + + Fri Nov 6 06:46:22 1992 Tom Wood (wood@dg-rtp.dg.com) + + * m88k.md (tcnd_divide_by_zero, divsi3, udivsi3): Allow the + explicit trap for divide by zero to resume execution along the + expected path. + + * t-m88kv4 (FIXINCLUDES): Delete. + + Fri Nov 6 03:08:13 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * i386.md (andsi3): Mask immed op to 0xff in QI-reg ff00-byte case. + + * gstddef.h: Find ansi.h in machine subdir. + [__need_ptrdiff_t]: Don't undef _SIZE_T_ or _WCHAR_T_. + * gvarargs.h, gstdarg.h: Don't test, define or undef _VA_LIST_ + on NET 2 systems. Don't include ansi.h. + + * c-lex.c (readescape): Support \e like \E. Warn only if -pedantic. + + Fri Nov 6 08:34:17 1992 Tim Moore (moore at defmacro.cs.utah.edu) + + * integrate.c (copy_rtx_and_substitute)[ARGS_GROW_DOWNWARD]: Map + virtual args pointer to the top of the argument block. + * calls.c (expand_call)[ARGS_GROW_DOWNWARD] Fix fencepost error in + calculating high_to_save and low_to_save. Use - high_to_save to + address stack_area. + + Fri Nov 6 00:41:53 1992 Paul Eggert (eggert@twinsun.com) + + * sparc.h (TARGET_EDOM, GEN_ERRNO_RTX): Deleted. + + Thu Nov 5 18:55:44 1992 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * alpha.c (output_prologue): Fix typo: `add' should be `addq'. + + Thu Nov 5 18:35:43 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * Makefile.in (install-fixincludes): Add semicolon in new for-loop. + + Thu Nov 5 15:24:14 1992 Michael Meissner (meissner@osf.org) + + * i386rose.h, decrose.h (REAL_LD_FILE_NAME): Define to be the + correct location on OSF/1 -- /usr/bin/ld points to + /usr/ccs/gcc/ld, which is collect. + (REAL_NM_FILE_NAME): Ditto for nm. + (REAL_STRIP_FILE_NAME): Ditto for strip. + + Wed Nov 4 13:36:10 1992 Jim Wilson (wilson@sphagnum.cygnus.com) + + * optabs.c (expand_binop): When trying to expand a multiple word + add into multiple single word adds, don't overwrite OP0 and OP1 in + case we must backtrack. We use instead new variables XOP0 and XOP1. + + Wed Nov 4 16:45:53 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * config.sub: Don't discard SCO version number if it's 3.2v4. + + * xm-vax-vms.h (HOST_FLOAT_FORMAT): Defined. + + * varasm.c: Fix typos in last change. + + Wed Nov 4 10:11:28 1992 Torbjorn Granlund (tege@jupiter.sics.se) + + * va-pa.h (va_end): Do it like in other va-*.h files. + + Wed Nov 4 07:23:46 1992 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * local-alloc.c (optimize_reg_copy_1): If P is a CALL_INSN, count + it as being crossed by SRC since SRC used to die there. + + Wed Nov 4 00:13:51 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * x-next (libgcc2.a, stdarg.h): New rules. + + * varasm.c (immed_real_const_1, immed_double_const): + Don't push on const_double_chain in nested function. + + * expr.c (emit_move_insn): Do return a value, in complex case. + + Tue Nov 3 10:45:09 1992 H.J. Lu (hlu@yardbird.eecs.wsu.edu) + + * i386linux.h (STARTFILE_SPEC): -static is added to ld if + -pg, -g or -p is passed down by gcc. + + Tue Nov 3 15:14:48 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * pa.c (output_ior): Handle "ior" against zero. + + * i386mach.h (YES_UNDERSCORES): Define it. + + * sun3.h (ASM_OUTPUT_FLOAT_OPERAND): Use REAL_VALUE_MINUS_ZERO. + (ASM_OUTPUT_DOUBLE_OPERAND): Likewise. + + Tue Nov 3 08:25:35 1992 Chris Smith (csmith@convex.com) + + * convex.h (REG_CLASS_FROM_LETTER): Add 'A', index regs. + (movsi alternative): Use it to make psh.w sp (push the + stack pointer) a noninstruction. + + Tue Nov 3 08:05:10 1992 Richard Kenner (kenner@vlsi1.ultra.nyu.edu) + + * jump.c (jump_optimize): Ensure operand of REG_NOTES is an INSN; + otherwise, we might try to read outside allocated memory. + + * va-alpha.h (va_end): Don't define enum if va_end already defined. + + Tue Nov 3 02:56:22 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * objc/Makefile: Use $(srcdir), not `..'. + + * objc-actions.c (build_message_expr): Use save_expr for receiver. + + * va-i860.h (va_end, anonymous enum): Don't declare if + va_end already defined as macro. + * va-mips.h, va-i960.h (va_end): If already a macro, don't declare. + + Mon Nov 2 21:17:40 1992 Paul Eggert (eggert@twinsun.com) + + * va-sparc.h (va_end): If already def as macro, don't declare. + + Mon Nov 2 16:04:51 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) + + * i386linux.h: Include i386gstabs.h, not i386gas.h. + + Mon Nov 2 14:46:31 1992 Richard Kenner (kenner at vlsi1.ultra.nyu.edu) + + * Makefile.in (install-cross-tools): Delete old symlink before + making new one; else symlink will fail and we will use + backed strategy. + + Sun Nov 1 17:55:56 1992 Jim Wilson (wilson@sphagnum.cygnus.com) + + * varasm.c (decode_rtx_const): Handle PC same as LABEL_REF. + Sun Nov 1 03:19:39 1992 Richard Stallman (rms@mole.gnu.ai.mit.edu) *************** *** 1977,1982 **** (finish_function): Always emit debugging info for the return type of a function. ! (pushdecl): Don't change the DECL_CONTEXT of virtual ! methods. (finish_enum): Always output debugging info for enums. (grokdeclarator): It's an error if we're doing an init of an extern --- 3157,3162 ---- (finish_function): Always emit debugging info for the return type of a function. ! (pushdecl): Don't change the DECL_CONTEXT of virtual ! methods. (finish_enum): Always output debugging info for enums. (grokdeclarator): It's an error if we're doing an init of an extern diff -rc2N gcc-2.3.1/Makefile.in gcc-2.3.2/Makefile.in *** gcc-2.3.1/Makefile.in Sat Oct 31 20:05:30 1992 --- gcc-2.3.2/Makefile.in Wed Nov 25 23:43:52 1992 *************** *** 1,4 **** # Makefile for GNU C compiler. ! # Copyright (C) 1987, 1988, 1990, 1991 Free Software Foundation, Inc. #This file is part of GNU CC. --- 1,4 ---- # Makefile for GNU C compiler. ! # Copyright (C) 1987, 1988, 1990, 1991, 1992 Free Software Foundation, Inc. #This file is part of GNU CC. *************** *** 403,407 **** # to programs compiled with GCC. USER_H = va-alpha.h va-i860.h va-i960.h va-mips.h va-m88k.h \ ! va-pa.h va-pyr.h va-sparc.h va-spur.h proto.h syslimits.h $(EXTRA_HEADERS) # All the header files that are installed for users from GCC itself. --- 403,407 ---- # to programs compiled with GCC. USER_H = va-alpha.h va-i860.h va-i960.h va-mips.h va-m88k.h \ ! va-pa.h va-pyr.h va-sparc.h va-spur.h proto.h $(EXTRA_HEADERS) # All the header files that are installed for users from GCC itself. *************** *** 737,741 **** $(srcdir)/cp-parse.c $(srcdir)/cp-parse.h : $(srcdir)/cp-parse.y ! @echo expect 30 shift/reduce conflicts and 14 reduce/reduce conflicts cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o cp-parse.c cp-parse.y cd $(srcdir); grep '^#define[ ]*YYEMPTY' cp-parse.c >>cp-parse.h --- 737,741 ---- $(srcdir)/cp-parse.c $(srcdir)/cp-parse.h : $(srcdir)/cp-parse.y ! @echo expect 29 shift/reduce conflicts and 14 reduce/reduce conflicts cd $(srcdir); $(BISON) $(BISONFLAGS) -d -o cp-parse.c cp-parse.y cd $(srcdir); grep '^#define[ ]*YYEMPTY' cp-parse.c >>cp-parse.h *************** *** 1387,1390 **** --- 1387,1391 ---- then true; \ else \ + rm -rf $(libsubdir)/$$file; \ $(SYMLINK) $(tooldir)/bin/$$file $(libsubdir)/$$file \ || (echo "#!/bin/sh"; echo $(tooldir)/bin/$$file "$$@") > $(libsubdir)/$$file; \ *************** *** 1397,1400 **** --- 1398,1402 ---- then true; \ else \ + rm -rf $(libsubdir)/`basename $$file`; \ $(SYMLINK) $$file $(libsubdir)/`basename $$file` \ || $(INSTALL_DATA) $$file $(libsubdir)/`basename $$file`; \ *************** *** 1404,1407 **** --- 1406,1410 ---- done; \ if [ -d $(tooldir)/include/. ] ; then \ + rm -rf $(libsubdir)/sys-include; \ $(SYMLINK) $(tooldir)/include $(libsubdir)/sys-include \ || (if [ -d $(libsubdir)/sys-include ] ; then true ; else mkdir $(libsubdir)/sys-include ; fi; \ *************** *** 1447,1451 **** # Install the compiler executables built during cross compilation. ! install-common: native install-dir xgcc $(srcdir)/g++ $(srcdir)/c++ $(EXTRA_PARTS) for file in $(COMPILERS); do \ if [ -f $$file ] ; then \ --- 1450,1456 ---- # Install the compiler executables built during cross compilation. ! # Deps on $(srcdir)/g++ $(srcdir)/c++ would be natural here, ! # but the latter would get confused with the target `c++'. ! install-common: native install-dir xgcc $(EXTRA_PARTS) for file in $(COMPILERS); do \ if [ -f $$file ] ; then \ *************** *** 1548,1552 **** # Install the fixed headers that are the same for all machines. ! install-common-headers: install-dir $(USER_H) gvarargs.h gstdarg.h gstddef.h -if [ -d $(libsubdir)/include ] ; then true ; else mkdir $(libsubdir)/include ; fi -chmod ugo+rx $(libsubdir)/include --- 1553,1557 ---- # Install the fixed headers that are the same for all machines. ! install-common-headers: install-dir $(USER_H) gvarargs.h gstdarg.h gstddef.h gsyslimits.h assert.h -if [ -d $(libsubdir)/include ] ; then true ; else mkdir $(libsubdir)/include ; fi -chmod ugo+rx $(libsubdir)/include *************** *** 1577,1580 **** --- 1582,1588 ---- chmod a-x $(assertdir)/assert.h; \ fi + -rm -f $(libsubdir)/include/syslimits.h + $(INSTALL_DATA) $(srcdir)/gsyslimits.h $(libsubdir)/include/syslimits.h + chmod a-x $(libsubdir)/include/syslimits.h -rm -f $(libsubdir)/include/varargs.h $(INSTALL_DATA) $(srcdir)/gvarargs.h $(libsubdir)/include/varargs.h *************** *** 1619,1627 **** rm -rf * # Install fixed copies of system files. ! for dir in /usr/include $(OTHER_FIXINCLUDES_DIRS); do \ if [ -d $$dir ]; \ then \ $(srcdir)/$(FIXINCLUDES) $(libsubdir)/include $$dir $(srcdir); \ ! else true; fi \ done -cd $(libsubdir)/include; \ --- 1627,1635 ---- rm -rf * # Install fixed copies of system files. ! for dir in $(SYSTEM_HEADER_DIR) $(OTHER_FIXINCLUDES_DIRS); do \ if [ -d $$dir ]; \ then \ $(srcdir)/$(FIXINCLUDES) $(libsubdir)/include $$dir $(srcdir); \ ! else true; fi; \ done -cd $(libsubdir)/include; \ diff -rc2N gcc-2.3.1/README gcc-2.3.2/README *** gcc-2.3.1/README Sun Nov 1 03:43:07 1992 --- gcc-2.3.2/README Fri Nov 27 23:53:38 1992 *************** *** 1,3 **** ! This directory contains the version 2.3.1 release of the GNU C compiler. It includes all of the support for compiling C++ and Objective C, including a run-time library for Objective C. --- 1,3 ---- ! This directory contains the version 2.3.2 release of the GNU C compiler. It includes all of the support for compiling C++ and Objective C, including a run-time library for Objective C. diff -rc2N gcc-2.3.1/SERVICE gcc-2.3.2/SERVICE *** gcc-2.3.1/SERVICE Sun Nov 1 03:43:23 1992 --- gcc-2.3.2/SERVICE Fri Nov 27 23:53:56 1992 *************** *** 229,236 ****  Cygnus Support ! 814 University Avenue ...uunet!cygint!info ! Palo Alto, CA 94301 ! +1 415 322 3811 Voice ! +1 415 322 3270 FAX Cygnus Support offers warranty protection (service contracts) for a --- 229,241 ----  Cygnus Support ! 1937 Landings Drive ...uunet!cygint!info ! Mountain View, CA 94043 USA ! +1 415 903 1400 voice ! +1 415 903 0122 fax ! ! Cygnus Support ! 1 Kendall Square ! Cambridge, MA 02139 ! +1 617 494 1040 Cygnus Support offers warranty protection (service contracts) for a diff -rc2N gcc-2.3.1/c++ gcc-2.3.2/c++ *** gcc-2.3.1/c++ Mon Oct 5 18:09:12 1992 --- gcc-2.3.2/c++ Thu Nov 26 14:30:59 1992 *************** *** 28,32 **** numargs=$# ! for arg do if [ $first = yes ] then --- 28,34 ---- numargs=$# ! # ash requires the newline before `do'. ! for arg ! do if [ $first = yes ] then *************** *** 90,94 **** # Get rid of that initial 1st arg ! shift if [ x$quote != x ] --- 92,101 ---- # Get rid of that initial 1st arg ! if [ $first = no ]; then ! shift ! else ! echo "$0: No input files specified." ! exit 1 ! fi if [ x$quote != x ] diff -rc2N gcc-2.3.1/c-decl.c gcc-2.3.2/c-decl.c *** gcc-2.3.1/c-decl.c Wed Oct 28 16:28:28 1992 --- gcc-2.3.2/c-decl.c Mon Nov 23 18:02:50 1992 *************** *** 628,631 **** --- 628,635 ---- else if (!strcmp (p, "-Wno-parentheses")) warn_parentheses = 0; + else if (!strcmp (p, "-Wreturn-type")) + warn_return_type = 1; + else if (!strcmp (p, "-Wno-return-type")) + warn_return_type = 0; else if (!strcmp (p, "-Wcomment")) ; /* cpp handles this one. */ *************** *** 1302,1309 **** if (TYPE_MODE (oldreturntype) == TYPE_MODE (newreturntype)) { ! TREE_TYPE (TREE_TYPE (olddecl)) = newreturntype; ! types_match = comptypes (TREE_TYPE (newdecl), TREE_TYPE (olddecl)); ! if (!types_match) ! TREE_TYPE (TREE_TYPE (olddecl)) = oldreturntype; } } --- 1306,1318 ---- if (TYPE_MODE (oldreturntype) == TYPE_MODE (newreturntype)) { ! /* Function types may be shared, so we can't just modify ! the return type of olddecl's function type. */ ! tree newtype ! = build_function_type (newreturntype, ! TYPE_ARG_TYPES (TREE_TYPE (olddecl))); ! ! types_match = comptypes (TREE_TYPE (newdecl), newtype); ! if (types_match) ! TREE_TYPE (olddecl) = newtype; } } *************** *** 1947,1951 **** { DECL_INLINE (x) = DECL_INLINE (oldglobal); ! DECL_INITIAL (x) = DECL_INITIAL (oldglobal); DECL_SAVED_INSNS (x) = DECL_SAVED_INSNS (oldglobal); DECL_ARGUMENTS (x) = DECL_ARGUMENTS (oldglobal); --- 1956,1961 ---- { DECL_INLINE (x) = DECL_INLINE (oldglobal); ! DECL_INITIAL (x) = (current_function_decl == oldglobal ! ? 0 : DECL_INITIAL (oldglobal)); DECL_SAVED_INSNS (x) = DECL_SAVED_INSNS (oldglobal); DECL_ARGUMENTS (x) = DECL_ARGUMENTS (oldglobal); *************** *** 3336,3340 **** } ! if (temporary && TREE_PERMANENT (decl)) { /* We need to remember that this array HAD an initialization, --- 3346,3352 ---- } ! /* ??? After 2.3, test (init != 0) instead of TREE_CODE. */ ! if (!(TREE_CODE (decl) == FUNCTION_DECL && DECL_INLINE (decl)) ! && temporary && TREE_PERMANENT (decl)) { /* We need to remember that this array HAD an initialization, *************** *** 3341,3344 **** --- 3353,3359 ---- but discard the actual temporary nodes, since we can't have a permanent node keep pointing to them. */ + /* We make an exception for inline functions, since it's + normal for a local extern redeclaration of an inline function + to have a copy of the top-level decl's DECL_INLINE. */ if (DECL_INITIAL (decl) != 0) DECL_INITIAL (decl) = error_mark_node; diff -rc2N gcc-2.3.1/c-lex.c gcc-2.3.2/c-lex.c *** gcc-2.3.1/c-lex.c Thu Oct 8 03:07:25 1992 --- gcc-2.3.2/c-lex.c Fri Nov 6 03:08:12 1992 *************** *** 906,911 **** return TARGET_VT; case 'E': ! pedwarn ("non-ANSI-standard escape sequence, `\\E'"); return 033; --- 906,913 ---- return TARGET_VT; + case 'e': case 'E': ! if (pedantic) ! pedwarn ("non-ANSI-standard escape sequence, `\\%c'", c); return 033; diff -rc2N gcc-2.3.1/c-typeck.c gcc-2.3.2/c-typeck.c *** gcc-2.3.1/c-typeck.c Mon Oct 26 19:02:20 1992 --- gcc-2.3.2/c-typeck.c Thu Nov 26 15:30:00 1992 *************** *** 3012,3015 **** --- 3012,3016 ---- case FIX_ROUND_EXPR: case FIX_CEIL_EXPR: + pedantic_lvalue_warning (CONVERT_EXPR); /* If the real type has the same machine representation as the type it is cast to, we can make better output *************** *** 3023,3027 **** { tree incremented, modify, value; - pedantic_lvalue_warning (CONVERT_EXPR); arg = stabilize_reference (arg); if (code == PREINCREMENT_EXPR || code == PREDECREMENT_EXPR) --- 3024,3027 ---- *************** *** 4971,4975 **** tree index = TREE_PURPOSE (tail); ! if (index && TREE_CODE (index) == NON_LVALUE_EXPR) index = TREE_OPERAND (index, 0); --- 4971,4976 ---- tree index = TREE_PURPOSE (tail); ! if (index && (TREE_CODE (index) == NON_LVALUE_EXPR ! || TREE_CODE (index) == NOP_EXPR)) index = TREE_OPERAND (index, 0); *************** *** 4980,4987 **** end_index = TREE_PURPOSE (TREE_CHAIN (index)); ! /* Expose constants. */ ! if (end_index && TREE_CODE (end_index) == NON_LVALUE_EXPR) end_index = TREE_OPERAND (end_index, 0); ! if (start_index && TREE_CODE (start_index) == NON_LVALUE_EXPR) start_index = TREE_OPERAND (start_index, 0); --- 4981,4993 ---- end_index = TREE_PURPOSE (TREE_CHAIN (index)); ! /* Expose constants. It Doesn't matter if we change ! the mode.*/ ! if (end_index ! && (TREE_CODE (end_index) == NON_LVALUE_EXPR ! || TREE_CODE (end_index) == NOP_EXPR)) end_index = TREE_OPERAND (end_index, 0); ! if (start_index ! && (TREE_CODE (start_index) == NON_LVALUE_EXPR ! || TREE_CODE (start_index) == NOP_EXPR)) start_index = TREE_OPERAND (start_index, 0); *************** *** 5027,5031 **** if (!win) ! TREE_VALUE (tail) = error_mark_node; } --- 5033,5041 ---- if (!win) ! { ! /* If there was an error, end the current range. */ ! end_index = 0; ! TREE_VALUE (tail) = error_mark_node; ! } } diff -rc2N gcc-2.3.1/caller-save.c gcc-2.3.2/caller-save.c *** gcc-2.3.1/caller-save.c Thu Sep 3 19:25:24 1992 --- gcc-2.3.2/caller-save.c Mon Nov 9 15:06:51 1992 *************** *** 375,378 **** --- 375,379 ---- { regset regs_live = basic_block_live_at_start[b]; + rtx prev_block_last = PREV_INSN (basic_block_head[b]); REGSET_ELT_TYPE bit; int offset, i, j; *************** *** 491,494 **** --- 492,498 ---- regno, insn_mode, MOVE_MAX / UNITS_PER_WORD); + /* If we added any insns at the start of the block, update the start + of the block to point at those insns. */ + basic_block_head[b] = NEXT_INSN (prev_block_last); } } diff -rc2N gcc-2.3.1/calls.c gcc-2.3.2/calls.c *** gcc-2.3.1/calls.c Sun Oct 25 17:49:42 1992 --- gcc-2.3.2/calls.c Fri Nov 6 03:21:20 1992 *************** *** 86,90 **** #ifdef ACCUMULATE_OUTGOING_ARGS ! /* A vector of one char per word of stack space. A byte if non-zero if the corresponding stack location has been used. This vector is used to prevent a function call within an argument from --- 86,90 ---- #ifdef ACCUMULATE_OUTGOING_ARGS ! /* A vector of one char per byte of stack space. A byte if non-zero if the corresponding stack location has been used. This vector is used to prevent a function call within an argument from *************** *** 1438,1442 **** --- 1438,1446 ---- Here we compute the boundary of the that needs to be saved, if any. */ + #ifdef ARGS_GROW_DOWNWARD + for (i = 0; i < reg_parm_stack_space + 1; i++) + #else for (i = 0; i < reg_parm_stack_space; i++) + #endif { if (i >= highest_outgoing_arg_in_use *************** *** 1464,1469 **** stack_area = gen_rtx (MEM, save_mode, memory_address (save_mode, plus_constant (argblock, ! low_to_save))); if (save_mode == BLKmode) { --- 1468,1480 ---- stack_area = gen_rtx (MEM, save_mode, memory_address (save_mode, + + #ifdef ARGS_GROW_DOWNWARD + plus_constant (argblock, + - high_to_save) + #else plus_constant (argblock, ! low_to_save) ! #endif ! )); if (save_mode == BLKmode) { *************** *** 1760,1764 **** = gen_rtx (MEM, save_mode, memory_address (save_mode, ! plus_constant (argblock, low_to_save))); if (save_mode != BLKmode) --- 1771,1780 ---- = gen_rtx (MEM, save_mode, memory_address (save_mode, ! #ifdef ARGS_GROW_DOWNWARD ! plus_constant (argblock, - high_to_save) ! #else ! plus_constant (argblock, low_to_save) ! #endif ! )); if (save_mode != BLKmode) diff -rc2N gcc-2.3.1/cccp.c gcc-2.3.2/cccp.c *** gcc-2.3.1/cccp.c Sat Oct 24 21:06:43 1992 --- gcc-2.3.2/cccp.c Fri Nov 27 01:29:50 1992 *************** *** 1452,1457 **** /* Now handle the command line options. */ ! /* Do undefines specified with -U. */ ! for (i = 1; i < argc; i++) if (pend_undefs[i]) { if (debug_output) --- 1452,1457 ---- /* Now handle the command line options. */ ! /* Do -U's, -D's and -A's in the order they were seen. */ ! for (i = 1; i < argc; i++) { if (pend_undefs[i]) { if (debug_output) *************** *** 1459,1470 **** make_undef (pend_undefs[i], &outbuf); } - - /* Do assertions specified with -A. */ - for (i = 1; i < argc; i++) - if (pend_assertions[i]) - make_assertion (pend_assertion_options[i], pend_assertions[i]); - - /* Do defines specified with -D. */ - for (i = 1; i < argc; i++) if (pend_defs[i]) { if (debug_output) --- 1459,1462 ---- *************** *** 1472,1475 **** --- 1464,1470 ---- make_definition (pend_defs[i], &outbuf); } + if (pend_assertions[i]) + make_assertion (pend_assertion_options[i], pend_assertions[i]); + } done_initializing = 1; *************** *** 2261,2267 **** } ! /* Recognize preprocessor directives only when reading ! directly from a file. */ ! if (ip->fname == 0) goto randomchar; if (ident_length) --- 2256,2267 ---- } ! /* If this is expanding a macro definition, don't recognize ! preprocessor directives. */ ! if (ip->macro != 0) ! goto randomchar; ! /* If this is expand_into_temp_buffer, recognize them ! only after an actual newline at this level, ! not at the beginning of the input level. */ ! if (ip->fname == 0 && beg_of_line == ip->buf) goto randomchar; if (ident_length) *************** *** 3643,3647 **** struct file_name_list *search_start = include; /* Chain of dirs to search */ struct file_name_list dsp[1]; /* First in chain, if #include "..." */ ! struct file_name_list *searchptr; int flen; --- 3643,3647 ---- struct file_name_list *search_start = include; /* Chain of dirs to search */ struct file_name_list dsp[1]; /* First in chain, if #include "..." */ ! struct file_name_list *searchptr = 0; int flen; diff -rc2N gcc-2.3.1/collect2.c gcc-2.3.2/collect2.c *** gcc-2.3.1/collect2.c Thu Oct 15 02:10:55 1992 --- gcc-2.3.2/collect2.c Fri Nov 20 20:43:12 1992 *************** *** 104,108 **** #endif ! #if defined (_AIX) || defined (USG) #undef FREAD #undef FWRITE --- 104,109 ---- #endif ! /* Many versions of ldfcn.h define these. */ ! #ifdef FREAD #undef FREAD #undef FWRITE diff -rc2N gcc-2.3.1/combine.c gcc-2.3.2/combine.c *** gcc-2.3.1/combine.c Fri Oct 30 17:47:23 1992 --- gcc-2.3.2/combine.c Fri Nov 27 19:13:54 1992 *************** *** 3257,3262 **** become a & 3. */ ! if ((significant_bits (XEXP (x, 0), mode) ! & significant_bits (XEXP (x, 1), mode)) == 0) { x = gen_binary (IOR, mode, XEXP (x, 0), XEXP (x, 1)); --- 3257,3263 ---- become a & 3. */ ! if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT ! && (significant_bits (XEXP (x, 0), mode) ! & significant_bits (XEXP (x, 1), mode)) == 0) { x = gen_binary (IOR, mode, XEXP (x, 0), XEXP (x, 1)); *************** *** 4068,4071 **** --- 4069,4073 ---- /* (ior A C) is C if all significant bits of A are on in C. */ if (GET_CODE (XEXP (x, 1)) == CONST_INT + && GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT && (significant_bits (XEXP (x, 0), mode) & ~ INTVAL (XEXP (x, 1))) == 0) *************** *** 4633,4638 **** new = gen_rtx (SUBREG, tmode, inner, (WORDS_BIG_ENDIAN ! && GET_MODE_SIZE (is_mode) > UNITS_PER_WORD ! ? ((GET_MODE_SIZE (is_mode) - GET_MODE_SIZE (tmode)) / UNITS_PER_WORD) : 0)); --- 4635,4640 ---- new = gen_rtx (SUBREG, tmode, inner, (WORDS_BIG_ENDIAN ! && GET_MODE_SIZE (inner_mode) > UNITS_PER_WORD ! ? ((GET_MODE_SIZE (inner_mode) - GET_MODE_SIZE (tmode)) / UNITS_PER_WORD) : 0)); *************** *** 5450,5454 **** pos = get_pos_from_mask (~c1, &len); if (pos < 0 || pos + len > GET_MODE_BITSIZE (GET_MODE (dest)) ! || (c1 & significant_bits (other, GET_MODE (other))) != 0) return x; --- 5452,5457 ---- pos = get_pos_from_mask (~c1, &len); if (pos < 0 || pos + len > GET_MODE_BITSIZE (GET_MODE (dest)) ! || (GET_MODE_BITSIZE (GET_MODE (other)) <= HOST_BITS_PER_WIDE_INT ! && (c1 & significant_bits (other, GET_MODE (other))) != 0)) return x; *************** *** 6248,6252 **** Then see how many zero bits we have. */ sig = INTVAL (x) & GET_MODE_MASK (mode); ! if (sig & ((HOST_WIDE_INT) 1 << (bitwidth - 1))) sig = (~ sig) & GET_MODE_MASK (mode); --- 6251,6256 ---- Then see how many zero bits we have. */ sig = INTVAL (x) & GET_MODE_MASK (mode); ! if (bitwidth <= HOST_BITS_PER_WIDE_INT ! && (sig & ((HOST_WIDE_INT) 1 << (bitwidth - 1))) != 0) sig = (~ sig) & GET_MODE_MASK (mode); *************** *** 6327,6330 **** --- 6331,6335 ---- num0 = num_sign_bit_copies (XEXP (x, 0), mode); if (num0 > 1 + && bitwidth <= HOST_BITS_PER_WIDE_INT && (((HOST_WIDE_INT) 1 << (bitwidth - 1)) & sig)) num0--; *************** *** 6346,6350 **** be 0 or 1, we know the result is either -1 or 0. */ ! if (code == PLUS && XEXP (x, 1) == constm1_rtx) { sig = significant_bits (XEXP (x, 0), mode); --- 6351,6360 ---- be 0 or 1, we know the result is either -1 or 0. */ ! if (code == PLUS && XEXP (x, 1) == constm1_rtx ! /* Don't do this if XEXP (x, 0) is a paradoxical subreg ! because in principle we don't know what the high bits are. */ ! && !(GET_CODE (XEXP (x, 0)) == SUBREG ! && (GET_MODE_SIZE (GET_MODE (XEXP (XEXP (x, 0), 0))) ! < GET_MODE_SIZE (GET_MODE (XEXP (x, 0)))))) { sig = significant_bits (XEXP (x, 0), mode); *************** *** 6351,6355 **** if ((((HOST_WIDE_INT) 1 << (bitwidth - 1)) & sig) == 0) return (sig == 1 || sig == 0 ? bitwidth ! : bitwidth - floor_log2 (sig)); } --- 6361,6365 ---- if ((((HOST_WIDE_INT) 1 << (bitwidth - 1)) & sig) == 0) return (sig == 1 || sig == 0 ? bitwidth ! : bitwidth - floor_log2 (sig) - 1); } *************** *** 6369,6372 **** --- 6379,6383 ---- result = bitwidth - (bitwidth - num0) - (bitwidth - num1); if (result > 0 + && bitwidth <= HOST_BITS_PER_INT && ((significant_bits (XEXP (x, 0), mode) & ((HOST_WIDE_INT) 1 << (bitwidth - 1))) != 0) *************** *** 6391,6394 **** --- 6402,6406 ---- result = num_sign_bit_copies (XEXP (x, 0), mode); if (result > 1 + && bitwidth <= HOST_BITS_PER_WIDE_INT && (significant_bits (XEXP (x, 1), mode) & ((HOST_WIDE_INT) 1 << (bitwidth - 1))) != 0) *************** *** 6400,6403 **** --- 6412,6416 ---- result = num_sign_bit_copies (XEXP (x, 1), mode); if (result > 1 + && bitwidth <= HOST_BITS_PER_WIDE_INT && (significant_bits (XEXP (x, 1), mode) & ((HOST_WIDE_INT) 1 << (bitwidth - 1))) != 0) *************** *** 6441,6445 **** /* If we haven't been able to figure it out by one of the above rules, see if some of the high-order bits are known to be zero. If so, ! count those bits and return one less than that amount. */ sig = significant_bits (x, mode); --- 6454,6462 ---- /* If we haven't been able to figure it out by one of the above rules, see if some of the high-order bits are known to be zero. If so, ! count those bits and return one less than that amount. If we can't ! safely compute the mask for this mode, always return BITWIDTH. */ ! ! if (bitwidth > HOST_BITS_PER_WIDE_INT) ! return bitwidth; sig = significant_bits (x, mode); *************** *** 6468,6473 **** return (unsignedp ! ? (GET_MODE_BITSIZE (mode) - 1 ! - floor_log2 (significant_bits (x, mode))) : num_sign_bit_copies (x, mode) - 1); } --- 6485,6491 ---- return (unsignedp ! ? (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT ! && (GET_MODE_BITSIZE (mode) - 1 ! - floor_log2 (significant_bits (x, mode)))) : num_sign_bit_copies (x, mode) - 1); } *************** *** 7144,7147 **** --- 7162,7166 ---- else if ((code == ASHIFTRT || code == LSHIFTRT) && count < HOST_BITS_PER_WIDE_INT + && GET_MODE_BITSIZE (result_mode) <= HOST_BITS_PER_WIDE_INT && 0 == (significant_bits (XEXP (varop, 0), result_mode) >> count) *************** *** 7663,7666 **** --- 7682,7687 ---- && (GET_MODE (SUBREG_REG (XEXP (op0, 0))) == GET_MODE (SUBREG_REG (XEXP (op1, 0)))) + && (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (XEXP (op0, 0)))) + <= HOST_BITS_PER_WIDE_INT) && (significant_bits (SUBREG_REG (XEXP (op0, 0)), GET_MODE (SUBREG_REG (XEXP (op0, 0)))) *************** *** 8358,8362 **** && XEXP (op0, 1) == XEXP (XEXP (op0, 0), 1) && (tmode = mode_for_size (mode_width - INTVAL (XEXP (op0, 1)), ! MODE_INT, 1)) != VOIDmode && ((unsigned HOST_WIDE_INT) const_op <= GET_MODE_MASK (tmode) || ((unsigned HOST_WIDE_INT) - const_op --- 8379,8383 ---- && XEXP (op0, 1) == XEXP (XEXP (op0, 0), 1) && (tmode = mode_for_size (mode_width - INTVAL (XEXP (op0, 1)), ! MODE_INT, 1)) != BLKmode && ((unsigned HOST_WIDE_INT) const_op <= GET_MODE_MASK (tmode) || ((unsigned HOST_WIDE_INT) - const_op *************** *** 8429,8433 **** && GET_MODE_CLASS (GET_MODE (op0)) == MODE_INT && (code == NE || code == EQ) ! && GET_MODE_BITSIZE (GET_MODE (op0)) <= HOST_BITS_PER_WIDE_INT && (significant_bits (SUBREG_REG (op0), GET_MODE (SUBREG_REG (op0))) & ~ GET_MODE_MASK (GET_MODE (op0))) == 0 --- 8450,8455 ---- && GET_MODE_CLASS (GET_MODE (op0)) == MODE_INT && (code == NE || code == EQ) ! && (GET_MODE_BITSIZE (GET_MODE (SUBREG_REG (op0))) ! <= HOST_BITS_PER_WIDE_INT) && (significant_bits (SUBREG_REG (op0), GET_MODE (SUBREG_REG (op0))) & ~ GET_MODE_MASK (GET_MODE (op0))) == 0 diff -rc2N gcc-2.3.1/config/a29k.md gcc-2.3.2/config/a29k.md *** gcc-2.3.1/config/a29k.md Sat Oct 24 10:33:19 1992 --- gcc-2.3.2/config/a29k.md Wed Nov 18 17:25:36 1992 *************** *** 254,258 **** [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r") (const_int 16) ! (match_operand:SI 1 "const_0_operand" "I")) (match_operand:SI 2 "cint_16_operand" "J"))] "" --- 254,258 ---- [(set (zero_extract:SI (match_operand:SI 0 "gpc_reg_operand" "+r") (const_int 16) ! (match_operand:SI 1 "const_0_operand" "")) (match_operand:SI 2 "cint_16_operand" "J"))] "" diff -rc2N gcc-2.3.1/config/alpha.c gcc-2.3.2/config/alpha.c *** gcc-2.3.1/config/alpha.c Mon Oct 26 16:01:33 1992 --- gcc-2.3.2/config/alpha.c Thu Nov 26 17:37:18 1992 *************** *** 1360,1364 **** fprintf (file, "\tlda $15,16384($30)\n\tlda $15,16384($15)\n"); else if (frame_size > 32768) ! fprintf (file, "\tadd $30,$28,$15\n"); else fprintf (file, "\tlda $15,%d($30)\n", frame_size); --- 1360,1364 ---- fprintf (file, "\tlda $15,16384($30)\n\tlda $15,16384($15)\n"); else if (frame_size > 32768) ! fprintf (file, "\taddq $30,$28,$15\n"); else fprintf (file, "\tlda $15,%d($30)\n", frame_size); diff -rc2N gcc-2.3.1/config/apollo68.h gcc-2.3.2/config/apollo68.h *** gcc-2.3.1/config/apollo68.h Sat Jun 13 17:22:19 1992 --- gcc-2.3.2/config/apollo68.h Wed Nov 25 16:24:40 1992 *************** *** 122,126 **** --- 122,129 ---- /* We have atexit(2). So C++ can use it for global destructors. */ + #if 0 /* troy@cbme.unsw.edu.au says people are still using sr10.2 + and it does not support atexit. */ #define HAVE_ATEXIT + #endif /* Every structure or union's size must be a multiple of 2 bytes. */ diff -rc2N gcc-2.3.1/config/bsd386.h gcc-2.3.2/config/bsd386.h *** gcc-2.3.1/config/bsd386.h Thu Oct 1 00:52:06 1992 --- gcc-2.3.2/config/bsd386.h Wed Nov 18 17:51:27 1992 *************** *** 29,34 **** /* Define the syntax of pseudo-ops, labels and comments. */ ! /* Prefix for internally generated assembler labels. */ #define LPREFIX "L" /* Assembler pseudos to introduce constants of various size. */ --- 29,40 ---- /* Define the syntax of pseudo-ops, labels and comments. */ ! /* Prefix for internally generated assembler labels. If we aren't using ! underscores, we are using prefix `.'s to identify labels that should ! be ignored, as in `i386gas.h' --karl@cs.umb.edu */ ! #ifdef NO_UNDERSCORES ! #define LPREFIX ".L" ! #else #define LPREFIX "L" + #endif /* not NO_UNDERSCORES */ /* Assembler pseudos to introduce constants of various size. */ diff -rc2N gcc-2.3.1/config/convex.h gcc-2.3.2/config/convex.h *** gcc-2.3.1/config/convex.h Mon Oct 26 14:20:32 1992 --- gcc-2.3.2/config/convex.h Tue Nov 3 11:20:55 1992 *************** *** 316,320 **** #define REG_CLASS_FROM_LETTER(C) \ ! ((C) == 'a' ? A_REGS : (C) == 'd' ? S_REGS : NO_REGS) /* The letters I, J, K, L and M in a register constraint string --- 316,323 ---- #define REG_CLASS_FROM_LETTER(C) \ ! ((C) == 'a' ? A_REGS : \ ! (C) == 'd' ? S_REGS : \ ! (C) == 'A' ? INDEX_REGS : \ ! NO_REGS) /* The letters I, J, K, L and M in a register constraint string diff -rc2N gcc-2.3.1/config/convex.md gcc-2.3.2/config/convex.md *** gcc-2.3.1/config/convex.md Sun Oct 25 00:39:32 1992 --- gcc-2.3.2/config/convex.md Tue Nov 3 11:21:28 1992 *************** *** 251,254 **** --- 251,262 ---- (define_insn "" + [(set (match_operand:SI 0 "push_operand" "=<,<") + (match_operand:SI 1 "general_operand" "Ad,io"))] + "" + "@ + psh.w %1 + pshea %a1") + + (define_insn "" [(set (match_operand:SI 0 "general_operand" "=g,r,<") (match_operand:SI 1 "general_operand" "r,g,io"))] diff -rc2N gcc-2.3.1/config/decrose.h gcc-2.3.2/config/decrose.h *** gcc-2.3.1/config/decrose.h Thu Oct 29 15:01:31 1992 --- gcc-2.3.2/config/decrose.h Mon Nov 9 14:22:03 1992 *************** *** 90,93 **** --- 90,99 ---- #define LIB_SPEC "-lc" + /* Define this macro meaning that `gcc' should find the library + `libgcc.a' by hand, rather than passing the argument `-lgcc' to + tell the linker to do the search. */ + + #define LINK_LIBGCC_SPECIAL 1 + #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}" *************** *** 135,138 **** --- 141,149 ---- /* Tell collect that the object format is OSF/rose. */ #define OBJECT_FORMAT_ROSE + + /* Tell collect where the appropriate binaries are. */ + #define REAL_LD_FILE_NAME "/usr/ccs/gcc/gld" + #define REAL_NM_FILE_NAME "/usr/ccs/bin/nm" + #define REAL_STRIP_FILE_NAME "/usr/ccs/bin/strip" /* Use atexit for static constructors/destructors, instead of defining diff -rc2N gcc-2.3.1/config/elxsi.c gcc-2.3.2/config/elxsi.c *** gcc-2.3.1/config/elxsi.c Thu Oct 15 16:58:12 1992 --- gcc-2.3.2/config/elxsi.c Sat Nov 7 14:13:09 1992 *************** *** 22,25 **** --- 22,26 ---- #include + #include "config.h" #include "rtl.h" diff -rc2N gcc-2.3.1/config/elxsi.h gcc-2.3.2/config/elxsi.h *** gcc-2.3.1/config/elxsi.h Thu Oct 15 16:58:05 1992 --- gcc-2.3.2/config/elxsi.h Tue Nov 10 09:34:11 1992 *************** *** 574,584 **** if (CONSTANT_ADDRESS_P (X)) goto ADDR; \ if (GET_CODE (X) == PLUS) \ ! { /* Handle [index]
represented with index-sum outermost */\ ! if (GET_CODE (XEXP (X, 0)) == REG && \ ! GET_CODE (XEXP (X, 1)) == CONST_INT) \ goto ADDR; \ ! if (GET_CODE (XEXP (X, 1)) == REG && \ ! GET_CODE (XEXP (X, 0)) == CONST_INT) \ ! goto ADDR; } \ } --- 574,588 ---- if (CONSTANT_ADDRESS_P (X)) goto ADDR; \ if (GET_CODE (X) == PLUS) \ ! { \ ! /* Handle [index]
represented with index-sum outermost */\ ! if (GET_CODE (XEXP (X, 0)) == REG \ ! && REG_OK_FOR_BASE_P (XEXP (X, 0)) \ ! && GET_CODE (XEXP (X, 1)) == CONST_INT) \ goto ADDR; \ ! if (GET_CODE (XEXP (X, 1)) == REG \ ! && REG_OK_FOR_BASE_P (XEXP (X, 0)) \ ! && GET_CODE (XEXP (X, 0)) == CONST_INT) \ ! goto ADDR; \ ! } \ } diff -rc2N gcc-2.3.1/config/hp320.h gcc-2.3.2/config/hp320.h *** gcc-2.3.1/config/hp320.h Sat Jun 13 17:24:55 1992 --- gcc-2.3.2/config/hp320.h Sun Nov 22 17:40:02 1992 *************** *** 612,617 **** #undef FUNCTION_PROFILER ! #define FUNCTION_PROFILER(FILE, LABELNO) \ ! fprintf (FILE, "\tmovl #LP%d,d0\n\tjsr mcount\n", (LABELNO)); #endif /* not HPUX_ASM */ --- 612,622 ---- #undef FUNCTION_PROFILER ! ! /* HP-UX needs the call to mcount before the link instruction. ! Copy the return address onto the stack before the call to fake it out. */ ! #define FUNCTION_PROFILER(FILE, LABEL_NO) \ ! fprintf (FILE, "\tmovel a6@(4),sp@-\n" \ ! "\tmovl #LP%d,a0\n\tjsr mcount\n" \ ! "\taddqw #4,sp\n", (LABEL_NO)); #endif /* not HPUX_ASM */ diff -rc2N gcc-2.3.1/config/i386.c gcc-2.3.2/config/i386.c *** gcc-2.3.1/config/i386.c Sat Oct 31 03:59:37 1992 --- gcc-2.3.2/config/i386.c Thu Nov 12 08:29:28 1992 *************** *** 1458,1476 **** } - /* Return 1 if this is a valid "float from int" operation on a 387. - OP is the expression matched, and MODE is its mode. */ - - int - float_op (op, mode) - register rtx op; - enum machine_mode mode; - { - if (mode != VOIDmode && mode != GET_MODE (op)) - return 0; - - return GET_CODE (op) == FLOAT - && GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT; - } - /* Return 1 if this is a valid shift or rotate operation on a 386. OP is the expression matched, and MODE is its mode. */ --- 1458,1461 ---- diff -rc2N gcc-2.3.1/config/i386.h gcc-2.3.2/config/i386.h *** gcc-2.3.1/config/i386.h Mon Oct 12 09:10:04 1992 --- gcc-2.3.2/config/i386.h Thu Nov 12 08:29:30 1992 *************** *** 277,285 **** #define HARD_REGNO_MODE_OK(REGNO, MODE) \ ! ((REGNO) < 2 ? 1 \ ! : (REGNO) < 4 ? 1 \ ! : (REGNO) >= 8 ? ((GET_MODE_CLASS (MODE) == MODE_FLOAT \ ! || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) \ ! && GET_MODE_UNIT_SIZE (MODE) <= 8) \ : (MODE) != QImode) --- 277,286 ---- #define HARD_REGNO_MODE_OK(REGNO, MODE) \ ! ((REGNO) < 2 ? 1 \ ! : (REGNO) < 4 ? 1 \ ! : FP_REGNO_P ((REGNO)) \ ! ? ((GET_MODE_CLASS (MODE) == MODE_FLOAT \ ! || GET_MODE_CLASS (MODE) == MODE_COMPLEX_FLOAT) \ ! && GET_MODE_UNIT_SIZE (MODE) <= 8) \ : (MODE) != QImode) diff -rc2N gcc-2.3.1/config/i386.md gcc-2.3.2/config/i386.md *** gcc-2.3.1/config/i386.md Sun Oct 25 15:31:05 1992 --- gcc-2.3.2/config/i386.md Thu Nov 12 08:29:31 1992 *************** *** 1306,1314 **** (define_insn "" ! [(set (match_operand 0 "register_operand" "=f,f") ! (match_operator 2 "float_op" ! [(match_operand:DI 1 "general_operand" "m,!*r")]))] ! "TARGET_80387 && GET_MODE (operands[0]) == GET_MODE (operands[2]) ! && GET_MODE_CLASS (GET_MODE (operands[0])) == MODE_FLOAT" "* { --- 1306,1346 ---- (define_insn "" ! [(set (match_operand:DF 0 "register_operand" "=f,f") ! (float:DF (match_operand:DI 1 "general_operand" "m,!*r")))] ! "TARGET_80387" ! "* ! { ! if (NON_STACK_REG_P (operands[1])) ! { ! output_op_from_reg (operands[1], AS1 (fild%z0,%1)); ! RET; ! } ! else if (GET_CODE (operands[1]) == MEM) ! return AS1 (fild%z1,%1); ! else ! abort (); ! }") ! ! (define_insn "" ! [(set (match_operand:SF 0 "register_operand" "=f,f") ! (float:SF (match_operand:DI 1 "general_operand" "m,!*r")))] ! "TARGET_80387" ! "* ! { ! if (NON_STACK_REG_P (operands[1])) ! { ! output_op_from_reg (operands[1], AS1 (fild%z0,%1)); ! RET; ! } ! else if (GET_CODE (operands[1]) == MEM) ! return AS1 (fild%z1,%1); ! else ! abort (); ! }") ! ! (define_insn "" ! [(set (match_operand:DF 0 "register_operand" "=f,f") ! (float:DF (match_operand:SI 1 "general_operand" "m,!*r")))] ! "TARGET_80387" "* { *************** *** 1325,1333 **** (define_insn "" ! [(set (match_operand 0 "register_operand" "=f,f") ! (match_operator 2 "float_op" ! [(match_operand:SI 1 "general_operand" "m,!*r")]))] ! "TARGET_80387 && GET_MODE (operands[0]) == GET_MODE (operands[2]) ! && GET_MODE_CLASS (GET_MODE (operands[0])) == MODE_FLOAT" "* { --- 1357,1363 ---- (define_insn "" ! [(set (match_operand:SF 0 "register_operand" "=f,f") ! (float:SF (match_operand:SI 1 "general_operand" "m,!*r")))] ! "TARGET_80387" "* { *************** *** 1833,1837 **** } ! operands[2] = GEN_INT (INTVAL (operands[2]) >> 8); return AS2 (and%B0,%2,%h0); } --- 1863,1867 ---- } ! operands[2] = GEN_INT ((INTVAL (operands[2]) >> 8) & 0xff); return AS2 (and%B0,%2,%h0); } *************** *** 2940,2943 **** --- 2970,2974 ---- ;; ??? All bets are off if operand 0 is a volatile MEM reference. + /* (define_insn "" [(set (cc0) (zero_extract (match_operand 0 "general_operand" "rm") *************** *** 2956,2961 **** if (! REG_P (operands[0]) || QI_REG_P (operands[0])) { - /* We may set the sign bit spuriously. */ - if ((mask & ~0xff) == 0) { --- 2987,2990 ---- *************** *** 3000,3004 **** return AS2 (test%L1,%0,%1); }") ! (define_insn "" [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "r") --- 3029,3033 ---- return AS2 (test%L1,%0,%1); }") ! */ (define_insn "" [(set (cc0) (zero_extract (match_operand:SI 0 "register_operand" "r") *************** *** 3956,3960 **** if (INTVAL (operands[2]) & ~0x03) { ! xops[0] = GEN_INT (INTVAL (operands[2]) >> 2); xops[1] = operands[4]; --- 3985,3989 ---- if (INTVAL (operands[2]) & ~0x03) { ! xops[0] = GEN_INT ((INTVAL (operands[2]) >> 2) & 0x3fffffff); xops[1] = operands[4]; diff -rc2N gcc-2.3.1/config/i386bsd.h gcc-2.3.2/config/i386bsd.h *** gcc-2.3.1/config/i386bsd.h Wed Oct 28 18:01:46 1992 --- gcc-2.3.2/config/i386bsd.h Tue Nov 24 13:27:59 1992 *************** *** 1,8 **** /* Configuration for an i386 running 386BSD as the target machine. */ - #include "i386mach.h" #undef CPP_PREDEFINES ! #define CPP_PREDEFINES "-Dunix -Di386 -D____386BSD____" ! /* Specify extra dir to search for include files. */ ! #undef SYSTEM_INCLUDE_DIR --- 1,131 ---- /* Configuration for an i386 running 386BSD as the target machine. */ + /* This is tested by i386gas.h. */ + #define YES_UNDERSCORES + + #include "i386gstabs.h" + #undef CPP_PREDEFINES ! #define CPP_PREDEFINES "-Dunix -Di386 -D____386BSD____ -D__386BSD__ -DBSD_NET2" ! ! /* Like the default, except no -lg. */ ! #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" ! ! #undef SIZE_TYPE ! #define SIZE_TYPE "unsigned int" ! ! #undef PTRDIFF_TYPE ! #define PTRDIFF_TYPE "int" ! ! #undef WCHAR_TYPE ! #define WCHAR_TYPE "short unsigned int" ! ! #define WCHAR_UNSIGNED 1 ! ! #undef WCHAR_TYPE_SIZE ! #define WCHAR_TYPE_SIZE 16 ! ! /* 386BSD does have atexit. */ ! ! #define HAVE_ATEXIT ! ! /* Redefine this to use %eax instead of %edx. */ ! #undef FUNCTION_PROFILER ! #define FUNCTION_PROFILER(FILE, LABELNO) \ ! { \ ! if (flag_pic) \ ! { \ ! fprintf (FILE, "\tleal %sP%d@GOTOFF(%%ebx),%%eax\n", \ ! LPREFIX, (LABELNO)); \ ! fprintf (FILE, "\tcall *mcount@GOT(%%ebx)\n"); \ ! } \ ! else \ ! { \ ! fprintf (FILE, "\tmovl $%sP%d,%%eax\n", LPREFIX, (LABELNO)); \ ! fprintf (FILE, "\tcall mcount\n"); \ ! } \ ! } ! ! /* There are conflicting reports about whether this system uses ! a different assembler syntax. wilson@cygnus.com says # is right. */ ! #undef COMMENT_BEGIN ! #define COMMENT_BEGIN "#" ! ! #undef ASM_APP_ON ! #define ASM_APP_ON "#APP\n" ! ! #undef ASM_APP_OFF ! #define ASM_APP_OFF "#NO_APP\n" ! ! /* Defines to be able to build libgcc.a with GCC. ! These are the same as in i386mach.h. */ ! ! /* It might seem that these are not important, since gcc 2 will never ! call libgcc for these functions. But programs might be linked with ! code compiled by gcc 1, and then these will be used. */ ! ! #define perform_udivsi3(a,b) \ ! { \ ! register int dx asm("dx"); \ ! register int ax asm("ax"); \ ! \ ! dx = 0; \ ! ax = a; \ ! asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b), "d" (dx)); \ ! return ax; \ ! } ! ! #define perform_divsi3(a,b) \ ! { \ ! register int dx asm("dx"); \ ! register int ax asm("ax"); \ ! \ ! ax = a; \ ! asm ("cltd\n\tidivl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b)); \ ! return ax; \ ! } ! ! #define perform_umodsi3(a,b) \ ! { \ ! register int dx asm("dx"); \ ! register int ax asm("ax"); \ ! \ ! dx = 0; \ ! ax = a; \ ! asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b), "d" (dx)); \ ! return dx; \ ! } ! ! #define perform_modsi3(a,b) \ ! { \ ! register int dx asm("dx"); \ ! register int ax asm("ax"); \ ! \ ! ax = a; \ ! asm ("cltd\n\tidivl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b)); \ ! return dx; \ ! } ! ! #define perform_fixdfsi(a) \ ! { \ ! auto unsigned short ostatus; \ ! auto unsigned short nstatus; \ ! auto int ret; \ ! auto double tmp; \ ! \ ! &ostatus; /* guarantee these land in memory */ \ ! &nstatus; \ ! &ret; \ ! &tmp; \ ! \ ! asm volatile ("fnstcw %0" : "=m" (ostatus)); \ ! nstatus = ostatus | 0x0c00; \ ! asm volatile ("fldcw %0" : /* no outputs */ : "m" (nstatus)); \ ! tmp = a; \ ! asm volatile ("fldl %0" : /* no outputs */ : "m" (tmp)); \ ! asm volatile ("fistpl %0" : "=m" (ret)); \ ! asm volatile ("fldcw %0" : /* no outputs */ : "m" (ostatus)); \ ! \ ! return ret; \ ! } diff -rc2N gcc-2.3.1/config/i386iscgas.h gcc-2.3.2/config/i386iscgas.h *** gcc-2.3.1/config/i386iscgas.h Mon Jul 27 22:32:25 1992 --- gcc-2.3.2/config/i386iscgas.h Wed Nov 18 17:51:31 1992 *************** *** 15,18 **** --- 15,43 ---- #include "isc.h" + /* We do not want to output SDB debugging information. */ + + #undef SDB_DEBUGGING_INFO + + /* We want to output DBX debugging information. */ + + #define DBX_DEBUGGING_INFO + + + /* The function `dbxout_init' in dbxout.c omits the first character of + `ltext_label_name' when outputting the main source directory and main + source filename. I don't understand why, but rather than making a + system-independent change there, I override dbxout.c's defaults. + Perhaps it would be better to use ".Ltext0" instead of + `ltext_label_name', but we've already generated the label, so we just + use it here. --karl@cs.umb.edu */ + #define DBX_OUTPUT_MAIN_SOURCE_DIRECTORY(asmfile, cwd) \ + fprintf (asmfile, "%s \"%s/\",%d,0,0,%s\n", ASM_STABS_OP, \ + cwd, N_SO, ltext_label_name) + #define DBX_OUTPUT_MAIN_SOURCE_FILENAME(asmfile, input_file_name) \ + fprintf (asmfile, "%s \"%s\",%d,0,0,%s\n", ASM_STABS_OP, input_file_name,\ + N_SO, ltext_label_name); \ + text_section (); \ + ASM_OUTPUT_INTERNAL_LABEL (asmfile, "Ltext", 0) + /* Because we don't include `svr3.h', we haven't yet defined SIZE_TYPE diff -rc2N gcc-2.3.1/config/i386linux.h gcc-2.3.2/config/i386linux.h *** gcc-2.3.1/config/i386linux.h Thu Oct 29 05:40:29 1992 --- gcc-2.3.2/config/i386linux.h Wed Nov 4 00:42:05 1992 *************** *** 21,25 **** #define YES_UNDERSCORES ! #include "i386gas.h" /* Specify predefined symbols in preprocessor. */ --- 21,25 ---- #define YES_UNDERSCORES ! #include "i386gstabs.h" /* Specify predefined symbols in preprocessor. */ *************** *** 65,69 **** #define STARTFILE_SPEC \ ! "%{g*:crt0.o%s} %{!g*:%{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s %{!static:%{nojump:-nojump}} %{static:-static}}}} -L"TOOLDIR"/lib" /* --- 65,69 ---- #define STARTFILE_SPEC \ ! "%{g*:crt0.o%s -static} %{!g*:%{pg:gcrt0.o%s -static} %{!pg:%{p:gcrt0.o%s -static} %{!p:crt0.o%s %{!static:%{nojump:-nojump}} %{static:-static}}}} -L"TOOLDIR"/lib" /* *************** *** 75,79 **** #define STARTFILE_SPEC \ ! "%{g*:crt0.o%s} %{!g*:%{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s %{!static:%{nojump:-nojump}} %{static:-static}}}}" /* --- 75,79 ---- #define STARTFILE_SPEC \ ! "%{g*:crt0.o%s -static} %{!g*:%{pg:gcrt0.o%s -static} %{!pg:%{p:gcrt0.o%s -static} %{!p:crt0.o%s %{!static:%{nojump:-nojump}} %{static:-static}}}}" /* diff -rc2N gcc-2.3.1/config/i386mach.h gcc-2.3.2/config/i386mach.h *** gcc-2.3.1/config/i386mach.h Tue Sep 22 23:39:35 1992 --- gcc-2.3.2/config/i386mach.h Sun Nov 8 16:23:21 1992 *************** *** 1,4 **** /* Configuration for an i386 running Mach as the target machine. */ ! #include "i386gas.h" #undef CPP_PREDEFINES --- 1,9 ---- /* Configuration for an i386 running Mach as the target machine. */ ! ! /* We do want to add an underscore to the front of each user symbol. ! i386gas.h checks this. */ ! #define YES_UNDERSCORES ! ! #include "i386gstabs.h" #undef CPP_PREDEFINES diff -rc2N gcc-2.3.1/config/i386rose.h gcc-2.3.2/config/i386rose.h *** gcc-2.3.1/config/i386rose.h Thu Oct 29 15:01:30 1992 --- gcc-2.3.2/config/i386rose.h Thu Nov 5 14:42:22 1992 *************** *** 324,327 **** --- 324,332 ---- #define OBJECT_FORMAT_ROSE + /* Tell collect where the appropriate binaries are. */ + #define REAL_LD_FILE_NAME "/usr/ccs/gcc/gld" + #define REAL_NM_FILE_NAME "/usr/ccs/bin/nm" + #define REAL_STRIP_FILE_NAME "/usr/ccs/bin/strip" + /* Use atexit for static constructors/destructors, instead of defining our own exit function. */ diff -rc2N gcc-2.3.1/config/i386sco.h gcc-2.3.2/config/i386sco.h *** gcc-2.3.1/config/i386sco.h Sat Oct 10 05:26:55 1992 --- gcc-2.3.2/config/i386sco.h Sat Nov 7 14:16:03 1992 *************** *** 20,24 **** #undef STARTFILE_SPEC ! #define STARTFILE_SPEC "%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}} crtbegin.o%s" #define ENDFILE_SPEC "crtend.o%s crtn.o%s" --- 20,25 ---- #undef STARTFILE_SPEC ! #define STARTFILE_SPEC \ ! "%{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}} crtbegin.o%s" #define ENDFILE_SPEC "crtend.o%s crtn.o%s" *************** *** 37,40 **** --- 38,52 ---- #undef CPP_SPEC #define CPP_SPEC "%{scointl:-DM_INTERNAT}" + + /* This spec is used for telling cpp whether char is signed or not. */ + + #undef SIGNED_CHAR_SPEC + #if DEFAULT_SIGNED_CHAR + #define SIGNED_CHAR_SPEC \ + "%{funsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}" + #else + #define SIGNED_CHAR_SPEC \ + "%{!fsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}" + #endif /* Use atexit for static destructors, instead of defining diff -rc2N gcc-2.3.1/config/m68ksgs.h gcc-2.3.2/config/m68ksgs.h *** gcc-2.3.1/config/m68ksgs.h Tue Jul 21 17:49:29 1992 --- gcc-2.3.2/config/m68ksgs.h Wed Nov 25 22:22:21 1992 *************** *** 216,220 **** #undef ASM_OUTPUT_DOUBLE_OPERAND #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \ ! asm_fprintf ((FILE),"%I0x%x%08x", u.i[0], u.i[1]); /* How to output a block of SIZE zero bytes. Note that the `space' pseudo, --- 216,222 ---- #undef ASM_OUTPUT_DOUBLE_OPERAND #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \ ! do { union real_extract u; \ ! u.d = (VALUE); \ ! asm_fprintf ((FILE),"%I0x%x%08x", u.i[0], u.i[1]); } while (0) /* How to output a block of SIZE zero bytes. Note that the `space' pseudo, diff -rc2N gcc-2.3.1/config/m88k.md gcc-2.3.2/config/m88k.md *** gcc-2.3.1/config/m88k.md Mon Oct 19 16:59:16 1992 --- gcc-2.3.2/config/m88k.md Fri Nov 6 06:45:55 1992 *************** *** 29,33 **** [(match_operand:SI 0 "" "")] "" ! "{ static char sccs_id[] = \"@(#)m88k.md 2.2.13.5 10/19/92 10:13:13\"; FAIL; }") --- 29,33 ---- [(match_operand:SI 0 "" "")] "" ! "{ static char sccs_id[] = \"@(#)m88k.md 2.3.2.2 11/05/92 09:03:51\"; FAIL; }") *************** *** 2378,2382 **** emit_jump_insn (gen_bne (operands[1])); emit_insn (gen_trap_divide_by_zero ()); - emit_barrier (); DONE; }") --- 2378,2381 ---- *************** *** 2407,2411 **** { emit_insn (gen_trap_divide_by_zero ()); - emit_barrier (); emit_insn (gen_dummy (op0)); DONE; --- 2406,2409 ---- *************** *** 2449,2457 **** if (TARGET_CHECK_ZERO_DIV) emit_insn (gen_tcnd_divide_by_zero (op2, join_label)); ! else ! { ! emit_jump_insn (gen_jump (join_label)); ! emit_barrier (); ! } emit_label (label1); /* constant / positive */ --- 2447,2452 ---- if (TARGET_CHECK_ZERO_DIV) emit_insn (gen_tcnd_divide_by_zero (op2, join_label)); ! emit_jump_insn (gen_jump (join_label)); ! emit_barrier (); emit_label (label1); /* constant / positive */ *************** *** 2518,2528 **** emit_label (label4); emit_insn (gen_trap_divide_by_zero ()); - emit_barrier (); } ! else ! { ! emit_jump_insn (gen_jump (join_label)); ! emit_barrier (); ! } emit_label (label2); /* pos.-or-0 / neg.-or-0 */ --- 2513,2519 ---- emit_label (label4); emit_insn (gen_trap_divide_by_zero ()); } ! emit_jump_insn (gen_jump (join_label)); ! emit_barrier (); emit_label (label2); /* pos.-or-0 / neg.-or-0 */ *************** *** 2579,2583 **** { emit_insn (gen_trap_divide_by_zero ()); - emit_barrier (); emit_insn (gen_dummy (operands[0])); DONE; --- 2570,2573 ---- diff -rc2N gcc-2.3.1/config/mips-5bsd.h gcc-2.3.2/config/mips-5bsd.h *** gcc-2.3.1/config/mips-5bsd.h Sat Sep 26 18:02:54 1992 --- gcc-2.3.2/config/mips-5bsd.h Sat Nov 7 21:26:53 1992 *************** *** 20,24 **** #define MIPS_BSD43 ! #define CPP_PREDEFINES "-Dmips -Dunix -Dhost_mips -DMIPSEB -DR3000 -DSYSTYPE_BSD43" #define SYSTEM_INCLUDE_DIR "/bsd43/usr/include" --- 20,25 ---- #define MIPS_BSD43 ! #define CPP_PREDEFINES "-Dmips -Dunix -Dhost_mips -DMIPSEB -DR3000 -DSYSTYPE_BSD43 \ ! -D_mips -D_unix -D_host_mips -D_MIPSEB -D_R3000 -D_SYSTYPE_BSD43" #define SYSTEM_INCLUDE_DIR "/bsd43/usr/include" diff -rc2N gcc-2.3.1/config/mips-5svr4.h gcc-2.3.2/config/mips-5svr4.h *** gcc-2.3.1/config/mips-5svr4.h Sat Sep 26 18:02:56 1992 --- gcc-2.3.2/config/mips-5svr4.h Sat Nov 7 21:26:56 1992 *************** *** 20,24 **** #define MIPS_SVR4 ! #define CPP_PREDEFINES "-Dmips -Dunix -Dhost_mips -DMIPSEB -DR3000 -DSYSTYPE_SVR4" #define SYSTEM_INCLUDE_DIR "/svr4/usr/include" --- 20,25 ---- #define MIPS_SVR4 ! #define CPP_PREDEFINES "-Dmips -Dunix -Dhost_mips -DMIPSEB -DR3000 -DSYSTYPE_SVR4 \ ! -D_mips -D_unix -D_host_mips -D_MIPSEB -D_R3000 -D_SYSTYPE_SVR4" #define SYSTEM_INCLUDE_DIR "/svr4/usr/include" diff -rc2N gcc-2.3.1/config/mips-5sysv.h gcc-2.3.2/config/mips-5sysv.h *** gcc-2.3.1/config/mips-5sysv.h Sat Sep 26 18:02:57 1992 --- gcc-2.3.2/config/mips-5sysv.h Sat Nov 7 21:26:59 1992 *************** *** 20,24 **** #define MIPS_SYSV ! #define CPP_PREDEFINES "-Dmips -Dunix -Dhost_mips -DMIPSEB -DR3000 -DSYSTYPE_SYSV" #define SYSTEM_INCLUDE_DIR "/sysv/usr/include" --- 20,25 ---- #define MIPS_SYSV ! #define CPP_PREDEFINES "-Dmips -Dunix -Dhost_mips -DMIPSEB -DR3000 -DSYSTYPE_SYSV \ ! -D_mips -D_unix -D_host_mips -D_MIPSEB -D_R3000 -D_SYSTYPE_SYSV" #define SYSTEM_INCLUDE_DIR "/sysv/usr/include" diff -rc2N gcc-2.3.1/config/mips.c gcc-2.3.2/config/mips.c *** gcc-2.3.1/config/mips.c Thu Oct 22 12:24:04 1992 --- gcc-2.3.2/config/mips.c Thu Nov 26 16:02:33 1992 *************** *** 1555,1558 **** --- 1555,1559 ---- int invert_const; /* != 0 if invert value if cmp1 is constant */ int invert_reg; /* != 0 if invert value if cmp1 is register */ + int unsignedp; /* != 0 for unsigned comparisons. */ }; *************** *** 1559,1572 **** static struct cmp_info info[ (int)ITEST_MAX ] = { ! { XOR, 0, 65535, 0, 0, 0, 0 }, /* EQ */ ! { XOR, 0, 65535, 0, 0, 1, 1 }, /* NE */ ! { LT, -32769, 32766, 1, 1, 1, 0 }, /* GT */ ! { LT, -32768, 32767, 0, 0, 1, 1 }, /* GE */ ! { LT, -32768, 32767, 0, 0, 0, 0 }, /* LT */ ! { LT, -32769, 32766, 1, 1, 0, 1 }, /* LE */ ! { LTU, -32769, 32766, 1, 1, 1, 0 }, /* GTU */ ! { LTU, -32768, 32767, 0, 0, 1, 1 }, /* GEU */ ! { LTU, -32768, 32767, 0, 0, 0, 0 }, /* LTU */ ! { LTU, -32769, 32766, 1, 1, 0, 1 }, /* LEU */ }; --- 1560,1573 ---- static struct cmp_info info[ (int)ITEST_MAX ] = { ! { XOR, 0, 65535, 0, 0, 0, 0, 0 }, /* EQ */ ! { XOR, 0, 65535, 0, 0, 1, 1, 0 }, /* NE */ ! { LT, -32769, 32766, 1, 1, 1, 0, 0 }, /* GT */ ! { LT, -32768, 32767, 0, 0, 1, 1, 0 }, /* GE */ ! { LT, -32768, 32767, 0, 0, 0, 0, 0 }, /* LT */ ! { LT, -32769, 32766, 1, 1, 0, 1, 0 }, /* LE */ ! { LTU, -32769, 32766, 1, 1, 1, 0, 1 }, /* GTU */ ! { LTU, -32768, 32767, 0, 0, 1, 1, 1 }, /* GEU */ ! { LTU, -32768, 32767, 0, 0, 0, 0, 1 }, /* LTU */ ! { LTU, -32769, 32766, 1, 1, 0, 1, 1 }, /* LEU */ }; *************** *** 1632,1636 **** { if (p_info->const_add != 0) ! cmp1 = GEN_INT (INTVAL (cmp1) + p_info->const_add); } else if (p_info->reverse_regs) --- 1633,1652 ---- { if (p_info->const_add != 0) ! { ! HOST_WIDE_INT new = INTVAL (cmp1) + p_info->const_add; ! /* If modification of cmp1 caused overflow, ! we would get the wrong answer if we follow the usual path; ! thus, x > 0xffffffffu would turn into x > 0u. */ ! if ((p_info->unsignedp ! ? (unsigned HOST_WIDE_INT) new > INTVAL (cmp1) ! : new > INTVAL (cmp1)) ! != (p_info->const_add > 0)) ! /* 1 is the right value in the LE and LEU case. ! In the GT and GTU case, *p_invert is already set, ! so this is effectively 0. */ ! return force_reg (SImode, const1_rtx); ! else ! cmp1 = GEN_INT (new); ! } } else if (p_info->reverse_regs) *************** *** 2988,2993 **** --- 3004,3012 ---- offset = offset - frame_size; } + /* sdbout_parms does not want this to crash for unrecognized cases. */ + #if 0 else if (reg != arg_pointer_rtx) abort_with_insn (addr, "mips_debugger_offset called with non stack/frame/arg pointer."); + #endif return offset; *************** *** 3798,3802 **** if (args_size == 0 && current_function_calls_alloca) ! args_size = 4*UNITS_PER_WORD; total_size = var_size + args_size + extra_size; --- 3817,3821 ---- if (args_size == 0 && current_function_calls_alloca) ! args_size = 4*UNITS_PER_WORD; total_size = var_size + args_size + extra_size; *************** *** 3858,3861 **** --- 3877,3886 ---- current_frame_info.gp_save_offset = offset - total_size; } + else + { + current_frame_info.gp_sp_offset = 0; + current_frame_info.gp_save_offset = 0; + } + if (fmask) *************** *** 3865,3868 **** --- 3890,3898 ---- current_frame_info.fp_save_offset = offset - total_size + UNITS_PER_WORD; } + else + { + current_frame_info.fp_sp_offset = 0; + current_frame_info.fp_save_offset = 0; + } /* Ok, we're done. */ *************** *** 4181,4184 **** --- 4211,4220 ---- emit_insn (gen_movsi (frame_pointer_rtx, stack_pointer_rtx)); } + + /* If we are profiling, make sure no instructions are scheduled before + the call to mcount. */ + + if (profile_flag || profile_block_flag) + emit_insn (gen_blockage ()); } diff -rc2N gcc-2.3.1/config/mips.h gcc-2.3.2/config/mips.h *** gcc-2.3.1/config/mips.h Sat Oct 31 00:44:24 1992 --- gcc-2.3.2/config/mips.h Sat Nov 21 07:54:16 1992 *************** *** 443,452 **** #endif /* LINK_SPEC defined */ - /* Define this macro meaning that `gcc' should find the library - `libgcc.a' by hand, rather than passing the argument `-lgcc' to - tell the linker to do the search. */ - - #define LINK_LIBGCC_SPECIAL 1 - /* Specs for the compiler proper */ --- 443,446 ---- *************** *** 489,493 **** /* Print subsidiary information on the compiler version in use. */ ! #define MIPS_VERSION "[AL 1.1, MM 28]" #ifndef MACHINE_TYPE --- 483,487 ---- /* Print subsidiary information on the compiler version in use. */ ! #define MIPS_VERSION "[AL 1.1, MM 29]" #ifndef MACHINE_TYPE *************** *** 1935,1938 **** --- 1929,1938 ---- fprintf (FILE, "\t.set\tat\n"); \ } + + /* Define this macro if the code for function profiling should come + before the function prologue. Normally, the profiling code comes + after. */ + + /* #define PROFILE_BEFORE_PROLOGUE */ /* EXIT_IGNORE_STACK should be nonzero if, when returning from a function, diff -rc2N gcc-2.3.1/config/mips.md gcc-2.3.2/config/mips.md *** gcc-2.3.1/config/mips.md Sat Oct 31 00:44:38 1992 --- gcc-2.3.2/config/mips.md Sat Nov 21 07:54:18 1992 *************** *** 994,999 **** [(set (match_operand:SI 0 "register_operand" "=&d") (ffs:SI (match_operand:SI 1 "register_operand" "d"))) ! (clobber (match_scratch:SI 2 "d")) ! (clobber (match_scratch:SI 3 "d"))] "" "* --- 994,999 ---- [(set (match_operand:SI 0 "register_operand" "=&d") (ffs:SI (match_operand:SI 1 "register_operand" "d"))) ! (clobber (match_scratch:SI 2 "=&d")) ! (clobber (match_scratch:SI 3 "=&d"))] "" "* *************** *** 2014,2024 **** }") ! (define_insn "movsf_internal" [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,f,R,m,*f,*d,*d,*d,*d,*R,*m") (match_operand:SF 1 "general_operand" "f,G,R,Em,fG,fG,*d,*f,*G*d,*R,*E*m,*d,*d"))] ! "register_operand (operands[0], SFmode) ! || register_operand (operands[1], SFmode) ! || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0) ! || operands[1] == CONST0_RTX (SFmode)" "* return mips_move_1word (operands, insn, FALSE);" [(set_attr "type" "move,xfer,load,load,store,store,xfer,xfer,move,load,load,store,store") --- 2014,2025 ---- }") ! (define_insn "movsf_internal1" [(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f,f,R,m,*f,*d,*d,*d,*d,*R,*m") (match_operand:SF 1 "general_operand" "f,G,R,Em,fG,fG,*d,*f,*G*d,*R,*E*m,*d,*d"))] ! "TARGET_HARD_FLOAT ! && (register_operand (operands[0], SFmode) ! || register_operand (operands[1], SFmode) ! || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0) ! || operands[1] == CONST0_RTX (SFmode))" "* return mips_move_1word (operands, insn, FALSE);" [(set_attr "type" "move,xfer,load,load,store,store,xfer,xfer,move,load,load,store,store") *************** *** 2027,2030 **** --- 2028,2045 ---- + (define_insn "movsf_internal2" + [(set (match_operand:SF 0 "nonimmediate_operand" "=d,d,d,R,m") + (match_operand:SF 1 "general_operand" " Gd,R,Em,d,d"))] + "TARGET_SOFT_FLOAT + && (register_operand (operands[0], SFmode) + || register_operand (operands[1], SFmode) + || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0) + || operands[1] == CONST0_RTX (SFmode))" + "* return mips_move_1word (operands, insn, FALSE);" + [(set_attr "type" "move,load,load,store,store") + (set_attr "mode" "SF") + (set_attr "length" "1,1,2,1,2")]) + + ;; 64-bit floating point moves *************** *** 2047,2057 **** }") ! (define_insn "movdf_internal" [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,o,f,*f,*d,*d,*d,*d,*R,*o") (match_operand:DF 1 "general_operand" "f,R,o,fG,fG,E,*d,*f,*d*G,*R,*o*E,*d,*d"))] ! "register_operand (operands[0], DFmode) ! || register_operand (operands[1], DFmode) ! || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0) ! || operands[1] == CONST0_RTX (DFmode)" "* return mips_move_2words (operands, insn); " [(set_attr "type" "move,load,load,store,store,load,xfer,xfer,move,load,load,store,store") --- 2062,2073 ---- }") ! (define_insn "movdf_internal1" [(set (match_operand:DF 0 "nonimmediate_operand" "=f,f,f,R,o,f,*f,*d,*d,*d,*d,*R,*o") (match_operand:DF 1 "general_operand" "f,R,o,fG,fG,E,*d,*f,*d*G,*R,*o*E,*d,*d"))] ! "TARGET_HARD_FLOAT ! && (register_operand (operands[0], DFmode) ! || register_operand (operands[1], DFmode) ! || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0) ! || operands[1] == CONST0_RTX (DFmode))" "* return mips_move_2words (operands, insn); " [(set_attr "type" "move,load,load,store,store,load,xfer,xfer,move,load,load,store,store") *************** *** 2059,2062 **** --- 2075,2091 ---- (set_attr "length" "1,2,4,2,4,4,2,2,2,2,4,2,4")]) + (define_insn "movdf_internal2" + [(set (match_operand:DF 0 "nonimmediate_operand" "=d,d,d,R,o") + (match_operand:DF 1 "general_operand" "dG,R,oE,d,d"))] + "TARGET_SOFT_FLOAT + && (register_operand (operands[0], DFmode) + || register_operand (operands[1], DFmode) + || (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) == 0) + || operands[1] == CONST0_RTX (DFmode))" + "* return mips_move_2words (operands, insn); " + [(set_attr "type" "move,load,load,store,store") + (set_attr "mode" "DF") + (set_attr "length" "2,2,4,2,4")]) + (define_split [(set (match_operand:DF 0 "register_operand" "") *************** *** 3974,3977 **** --- 4003,4018 ---- } }") + + ;; Block any insns from being moved before this point, since the + ;; profiling call to mcount can use various registers that aren't + ;; saved or used to pass arguments. + + (define_insn "blockage" + [(unspec_volatile [(const_int 0)] 0)] + "" + "" + [(set_attr "type" "unknown") + (set_attr "mode" "none") + (set_attr "length" "0")]) ;; At present, don't expand the epilogue, reorg.c will clobber the diff -rc2N gcc-2.3.1/config/mot3300.h gcc-2.3.2/config/mot3300.h *** gcc-2.3.1/config/mot3300.h Thu Jul 16 16:56:29 1992 --- gcc-2.3.2/config/mot3300.h Mon Nov 23 20:37:35 1992 *************** *** 642,645 **** --- 642,648 ---- #endif + /* We have to define this to avoid errors. */ + int switch_table_difference_label_flag; + /* Translate some opcodes to fit the sysV68 assembler syntax. */ /* The opcodes fdmov and fsmov are guesses. */ diff -rc2N gcc-2.3.1/config/ns32k.md gcc-2.3.2/config/ns32k.md *** gcc-2.3.1/config/ns32k.md Sat Aug 15 00:50:12 1992 --- gcc-2.3.2/config/ns32k.md Mon Nov 23 23:36:23 1992 *************** *** 315,320 **** (define_insn "movsi" ! [(set (match_operand:SI 0 "general_operand" "=g<,*f,g") ! (match_operand:SI 1 "general_operand" "gxy,g,*f"))] "" "* --- 315,320 ---- (define_insn "movsi" ! [(set (match_operand:SI 0 "general_operand" "=g<,g<,*f,g") ! (match_operand:SI 1 "general_operand" "g,?xy,g,*f"))] "" "* *************** *** 838,843 **** (define_insn "addsi3" ! [(set (match_operand:SI 0 "general_operand" "=g,=g<") ! (plus:SI (match_operand:SI 1 "general_operand" "%0,%r") (match_operand:SI 2 "general_operand" "rmn,n")))] "" --- 838,843 ---- (define_insn "addsi3" ! [(set (match_operand:SI 0 "general_operand" "=g,=g&<") ! (plus:SI (match_operand:SI 1 "general_operand" "%0,r") (match_operand:SI 2 "general_operand" "rmn,n")))] "" diff -rc2N gcc-2.3.1/config/pa-ghpux.h gcc-2.3.2/config/pa-ghpux.h *** gcc-2.3.1/config/pa-ghpux.h Wed Oct 14 10:36:15 1992 --- gcc-2.3.2/config/pa-ghpux.h Tue Nov 10 09:55:47 1992 *************** *** 1,2 **** --- 1,25 ---- + /* Definitions of target machine for GNU compiler, for HP-UX using GNU as. + Copyright (C) 1991 Free Software Foundation, Inc. + + This file is part of GNU CC. + + GNU CC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU CC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU CC; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + #ifndef TARGET_DEFAULT + #define TARGET_DEFAULT 8 /* TARGET_SHARED_LIBS */ + #endif + #include "pa.h" *************** *** 24,32 **** #define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -D_HPUX_SOURCE" - /* Link against shared libraries */ - #ifdef hpux8 - #undef TARGET_DEFAULT - #define TARGET_DEFAULT 8 #undef LINK_SPEC ! #define LINK_SPEC "-u main" ! #endif --- 47,50 ---- #define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -D_HPUX_SOURCE" #undef LINK_SPEC ! #define LINK_SPEC "-u main -a archive" diff -rc2N gcc-2.3.1/config/pa-gux7.h gcc-2.3.2/config/pa-gux7.h *** gcc-2.3.1/config/pa-gux7.h --- gcc-2.3.2/config/pa-gux7.h Sat Nov 21 18:17:26 1992 *************** *** 0 **** --- 1,47 ---- + /* Definitions of target machine for GNU compiler, for HP-UX using GNU as. + Copyright (C) 1991 Free Software Foundation, Inc. + + This file is part of GNU CC. + + GNU CC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU CC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU CC; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + #ifndef TARGET_DEFAULT + #define TARGET_DEFAULT 0 + #endif + + #include "pa.h" + + /* Make GCC agree with types.h. */ + #undef SIZE_TYPE + #undef PTRDIFF_TYPE + #undef WCHAR_TYPE + #undef WCHAR_TYPE_SIZE + + #define SIZE_TYPE "unsigned int" + #define PTRDIFF_TYPE "int" + #define WCHAR_TYPE "unsigned int" + #define WCHAR_TYPE_SIZE 32 + + /* Like the default, except no -lg. */ + #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" + + /* Control how gcc finds libgcc.a and how it passes -L options. */ + #define LINK_LIBGCC_SPECIAL + #define RELATIVE_PREFIX_NOT_LINKDIR + + #define HAVE_ATEXIT + + #undef CPP_PREDEFINES + #define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -D_HPUX_SOURCE" diff -rc2N gcc-2.3.1/config/pa-hpux.h gcc-2.3.2/config/pa-hpux.h *** gcc-2.3.1/config/pa-hpux.h Wed Oct 14 10:36:35 1992 --- gcc-2.3.2/config/pa-hpux.h Tue Nov 10 09:55:36 1992 *************** *** 1,2 **** --- 1,25 ---- + /* Definitions of target machine for GNU compiler, for HP-UX. + Copyright (C) 1991 Free Software Foundation, Inc. + + This file is part of GNU CC. + + GNU CC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU CC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU CC; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + #ifndef TARGET_DEFAULT + #define TARGET_DEFAULT 8 /* TARGET_SHARED_LIBS */ + #endif + #include "pa.h" *************** *** 27,35 **** #define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -D_HPUX_SOURCE" - /* Link against shared libraries */ - #ifdef hpux8 - #undef TARGET_DEFAULT - #define TARGET_DEFAULT 8 #undef LINK_SPEC ! #define LINK_SPEC "-u main %{g*:-a archive} %{p:-a archive} %{pg:-a archive}" ! #endif --- 50,53 ---- #define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -D_HPUX_SOURCE" #undef LINK_SPEC ! #define LINK_SPEC "-u main -a archive" diff -rc2N gcc-2.3.1/config/pa-hpux7.h gcc-2.3.2/config/pa-hpux7.h *** gcc-2.3.1/config/pa-hpux7.h --- gcc-2.3.2/config/pa-hpux7.h Sat Nov 21 18:17:25 1992 *************** *** 0 **** --- 1,50 ---- + /* Definitions of target machine for GNU compiler, for HP-UX. + Copyright (C) 1991 Free Software Foundation, Inc. + + This file is part of GNU CC. + + GNU CC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU CC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU CC; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + #ifndef TARGET_DEFAULT + #define TARGET_DEFAULT 0 + #endif + + #include "pa.h" + + /* Make GCC agree with types.h. */ + #undef SIZE_TYPE + #undef PTRDIFF_TYPE + #undef WCHAR_TYPE + #undef WCHAR_TYPE_SIZE + + #define SIZE_TYPE "unsigned int" + #define PTRDIFF_TYPE "int" + #define WCHAR_TYPE "unsigned int" + #define WCHAR_TYPE_SIZE 32 + + /* HPUX doesn't use any debugging format that GCC knows about. */ + #undef DBX_DEBUGGING_INFO + + /* Like the default, except no -lg. */ + #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}" + + /* Control how gcc finds libgcc.a and how it passes -L options. */ + #define LINK_LIBGCC_SPECIAL + #define RELATIVE_PREFIX_NOT_LINKDIR + + #define HAVE_ATEXIT + + #undef CPP_PREDEFINES + #define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -DPWB -Dhpux -Dunix -D_HPUX_SOURCE" diff -rc2N gcc-2.3.1/config/pa.c gcc-2.3.2/config/pa.c *** gcc-2.3.1/config/pa.c Mon Oct 26 16:20:06 1992 --- gcc-2.3.2/config/pa.c Mon Nov 16 08:52:10 1992 *************** *** 799,812 **** if (optype0 == MEMOP) { rtx addr = XEXP (operands[0], 0); ! if (GET_CODE (addr) == POST_INC || GET_CODE (addr) == PRE_INC) { ! operands[0] = gen_rtx (MEM, SImode, addr); ! return "stw%M0 %1,%0\n\tstw%M0 %R1,%0"; } ! else if (GET_CODE (addr) == POST_DEC || GET_CODE (addr) == PRE_DEC) { ! operands[0] = gen_rtx (MEM, SImode, addr); ! return "stw%M0 %R1,%0\n\tstw%M0 %1,%0"; } } --- 799,845 ---- if (optype0 == MEMOP) { + /* We have to output the address syntax ourselves, since print_operand + doesn't deal with the addresses we want to use. Fix this later. */ + rtx addr = XEXP (operands[0], 0); ! if (GET_CODE (addr) == POST_INC || GET_CODE (addr) == POST_DEC) { ! rtx high_reg = gen_rtx (SUBREG, SImode, operands[1], 0); ! ! operands[0] = XEXP (addr, 0); ! if (GET_CODE (operands[1]) != REG || GET_CODE (operands[0]) != REG) ! abort (); ! ! if (!reg_overlap_mentioned_p (high_reg, addr)) ! { ! /* No overlap between high target register and address ! register. (We do this in a non-obvious way to ! save a register file writeback) */ ! if (GET_CODE (addr) == POST_INC) ! return "stws,ma %1,8(0,%0)\n\tstw %R1,-4(0,%0)"; ! return "stws,ma %1,-8(0,%0)\n\tstw %R1,12(0,%0)"; ! } ! else ! abort(); } ! else if (GET_CODE (addr) == PRE_INC || GET_CODE (addr) == PRE_DEC) { ! rtx high_reg = gen_rtx (SUBREG, SImode, operands[1], 0); ! ! operands[0] = XEXP (addr, 0); ! if (GET_CODE (operands[1]) != REG || GET_CODE (operands[0]) != REG) ! abort (); ! ! if (!reg_overlap_mentioned_p (high_reg, addr)) ! { ! /* No overlap between high target register and address ! register. (We do this in a non-obvious way to ! save a register file writeback) */ ! if (GET_CODE (addr) == PRE_INC) ! return "stws,mb %1,8(0,%0)\n\tstw %R1,4(0,%0)"; ! return "stws,mb %1,-8(0,%0)\n\tstw %R1,4(0,%0)"; ! } ! else ! abort(); } } *************** *** 1255,1258 **** --- 1288,1294 ---- unsigned mask = INTVAL (operands[2]); int bs0, bs1, bs2, p, len; + + if (INTVAL (operands[2]) == 0) + return "copy %1,%0"; for (bs0 = 0; bs0 < 32; bs0++) diff -rc2N gcc-2.3.1/config/pa.h gcc-2.3.2/config/pa.h *** gcc-2.3.1/config/pa.h Tue Oct 27 13:38:38 1992 --- gcc-2.3.2/config/pa.h Mon Nov 9 12:20:43 1992 *************** *** 29,79 **** }; - #define DBX_DEBUGGING_INFO - #define DEFAULT_GDB_EXTENSIONS 0 - - #if (TARGET_DEFAULT & 1) == 0 - #define CPP_SPEC "%{msnake:-D__hp9000s700 -D_PA_RISC1_1}\ - %{mpa-risc-1-1:-D__hp9000s700 -D_PA_RISC1_1}" - #else - #define CPP_SPEC "%{!mpa-risc-1-0:-D__hp9000s700 -D_PA_RISC1_1}" - #endif - - /* Defines for a K&R CC */ - - #ifdef OLD_CC - #define CPP_SPEC "%{!gnu:-nostdinc %{!nostinc:-I/usr/include}} \ - %{gnu:%{nostdinc}} %{!gnu:-traditional} -Dvolatile=__volatile" - #define CC1_SPEC "%{!gnu:-traditional -fwritable-strings -fno-defer-pop} \ - %{pg:} %{p:}" - #else - #define CC1_SPEC "%{pg:} %{p:}" - #endif - - /* Brain-dead loader */ - #ifdef hpux8 - #define LINK_SPEC "-u main -a archive" - #else - #define LINK_SPEC "-u main" - #endif - - /* Make gcc agree with */ - - #define SIZE_TYPE "unsigned int" - #define PTRDIFF_TYPE "int" - #define WCHAR_TYPE "short unsigned int" - #define WCHAR_TYPE_SIZE 16 - - /* Omit frame pointer at high optimization levels. */ - - #define OPTIMIZATION_OPTIONS(OPTIMIZE) \ - { \ - if (OPTIMIZE >= 2) \ - flag_omit_frame_pointer = 1; \ - } - - /* Names to predefine in the preprocessor for this target machine. */ - - #define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -Dunix -D_HPUX_SOURCE -Dhp9000 -Dhp800 -Dspectrum -DREVARGV" - /* Print subsidiary information on the compiler version in use. */ --- 29,32 ---- *************** *** 131,135 **** --- 84,133 ---- { "", TARGET_DEFAULT}} + #ifndef TARGET_DEFAULT #define TARGET_DEFAULT 0 + #endif + + #define DBX_DEBUGGING_INFO + #define DEFAULT_GDB_EXTENSIONS 0 + + #if (TARGET_DEFAULT & 1) == 0 + #define CPP_SPEC "%{msnake:-D__hp9000s700 -D_PA_RISC1_1}\ + %{mpa-risc-1-1:-D__hp9000s700 -D_PA_RISC1_1}" + #else + #define CPP_SPEC "%{!mpa-risc-1-0:-D__hp9000s700 -D_PA_RISC1_1}\ + %{!mnosnake:-D__hp9000s700 -D_PA_RISC1_1}" + #endif + + /* Defines for a K&R CC */ + + #ifdef OLD_CC + #define CPP_SPEC "%{!gnu:-nostdinc %{!nostinc:-I/usr/include}} \ + %{gnu:%{nostdinc}} %{!gnu:-traditional} -Dvolatile=__volatile" + #define CC1_SPEC "%{!gnu:-traditional -fwritable-strings -fno-defer-pop} \ + %{pg:} %{p:}" + #else + #define CC1_SPEC "%{pg:} %{p:}" + #endif + + #define LINK_SPEC "-u main" + + /* Make gcc agree with */ + + #define SIZE_TYPE "unsigned int" + #define PTRDIFF_TYPE "int" + #define WCHAR_TYPE "short unsigned int" + #define WCHAR_TYPE_SIZE 16 + + /* Omit frame pointer at high optimization levels. */ + + #define OPTIMIZATION_OPTIONS(OPTIMIZE) \ + { \ + if (OPTIMIZE >= 2) \ + flag_omit_frame_pointer = 1; \ + } + + /* Names to predefine in the preprocessor for this target machine. */ + + #define CPP_PREDEFINES "-Dhppa -Dhp9000s800 -D__hp9000s800 -Dhp9k8 -Dunix -D_HPUX_SOURCE -Dhp9000 -Dhp800 -Dspectrum -DREVARGV" /* target machine storage layout */ diff -rc2N gcc-2.3.1/config/pa.md gcc-2.3.2/config/pa.md *** gcc-2.3.1/config/pa.md Wed Oct 28 14:46:51 1992 --- gcc-2.3.2/config/pa.md Mon Nov 23 14:51:30 1992 *************** *** 2040,2043 **** --- 2040,2045 ---- (set_attr "length" "1")]) + ;; Using nonmemory_operand works around a bug in reload. For 2.4 fix + ;; reload and use register_operand instead. (define_insn "" [(set (match_operand:SI 0 "register_operand" "=r") *************** *** 2044,2048 **** (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r") (const_int 2)) ! (match_operand:SI 1 "register_operand" "r")))] "" "sh1add %2,%1,%0") --- 2046,2050 ---- (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r") (const_int 2)) ! (match_operand:SI 1 "nonmemory_operand" "r")))] "" "sh1add %2,%1,%0") *************** *** 2052,2056 **** (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r") (const_int 4)) ! (match_operand:SI 1 "register_operand" "r")))] "" "sh2add %2,%1,%0") --- 2054,2058 ---- (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r") (const_int 4)) ! (match_operand:SI 1 "nonmemory_operand" "r")))] "" "sh2add %2,%1,%0") *************** *** 2060,2064 **** (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r") (const_int 8)) ! (match_operand:SI 1 "register_operand" "r")))] "" "sh3add %2,%1,%0") --- 2062,2066 ---- (plus:SI (mult:SI (match_operand:SI 2 "register_operand" "r") (const_int 8)) ! (match_operand:SI 1 "nonmemory_operand" "r")))] "" "sh3add %2,%1,%0") diff -rc2N gcc-2.3.1/config/pa1-ghpux.h gcc-2.3.2/config/pa1-ghpux.h *** gcc-2.3.1/config/pa1-ghpux.h Wed Oct 14 10:37:34 1992 --- gcc-2.3.2/config/pa1-ghpux.h Mon Nov 9 12:20:47 1992 *************** *** 24,33 **** #define HP_FP_ARG_DESCRIPTOR_REVERSED ! #include "pa-ghpux.h" ! #undef TARGET_DEFAULT ! #ifdef hpux8 ! #define TARGET_DEFAULT 9 ! #else ! #define TARGET_DEFAULT 1 ! #endif --- 24,28 ---- #define HP_FP_ARG_DESCRIPTOR_REVERSED ! #define TARGET_DEFAULT 9 /* TARGET_SNAKE + TARGET_SHARED_LIBS */ ! #include "pa-ghpux.h" diff -rc2N gcc-2.3.1/config/pa1-hpux.h gcc-2.3.2/config/pa1-hpux.h *** gcc-2.3.1/config/pa1-hpux.h Wed Oct 14 10:37:47 1992 --- gcc-2.3.2/config/pa1-hpux.h Mon Nov 9 12:20:52 1992 *************** *** 20,34 **** /* This is the same as pa-hpux.h, except that we generate snake code by ! default and we have to deal with assembler weirdness. */ #define HP_FP_ARG_DESCRIPTOR_REVERSED ! #include "pa-hpux.h" ! ! #undef TARGET_DEFAULT ! #ifdef hpux8 ! #define TARGET_DEFAULT 9 ! #else ! #define TARGET_DEFAULT 1 ! #endif --- 20,28 ---- /* This is the same as pa-hpux.h, except that we generate snake code by ! default and have to deal with assembler weirdness. */ #define HP_FP_ARG_DESCRIPTOR_REVERSED ! #define TARGET_DEFAULT 9 /* TARGET_SNAKE + TARGET_SHARED_LIBS */ + #include "pa-hpux.h" diff -rc2N gcc-2.3.1/config/pa1.h gcc-2.3.2/config/pa1.h *** gcc-2.3.1/config/pa1.h Mon Jul 27 22:47:15 1992 --- gcc-2.3.2/config/pa1.h Mon Nov 9 12:21:00 1992 *************** *** 19,27 **** the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ ! /* This is the same as hppa.h, except that we generate snake code by default. */ #include "pa.h" - - #undef TARGET_DEFAULT - #define TARGET_DEFAULT 1 --- 19,26 ---- the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ ! #define TARGET_DEFAULT 1 /* TARGET_SNAKE */ ! ! /* This is the same as pa.h, except that we generate snake code by default. */ #include "pa.h" diff -rc2N gcc-2.3.1/config/plexus.h gcc-2.3.2/config/plexus.h *** gcc-2.3.1/config/plexus.h Mon Jul 27 22:21:05 1992 --- gcc-2.3.2/config/plexus.h Fri Nov 20 15:42:42 1992 *************** *** 88,90 **** #define NO_DUP2 ! #define SIZE_TYPE int --- 88,90 ---- #define NO_DUP2 ! #define SIZE_TYPE "int" diff -rc2N gcc-2.3.1/config/romp.c gcc-2.3.2/config/romp.c *** gcc-2.3.1/config/romp.c Fri Oct 23 07:48:23 1992 --- gcc-2.3.2/config/romp.c Thu Nov 26 08:31:32 1992 *************** *** 1,4 **** /* Subroutines used for code generation on ROMP. ! Copyright (C) 1990, 1991 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@nyu.edu) --- 1,4 ---- /* Subroutines used for code generation on ROMP. ! Copyright (C) 1990, 1991, 1992 Free Software Foundation, Inc. Contributed by Richard Kenner (kenner@nyu.edu) *************** *** 1204,1209 **** /* Output any pending floating-point operations. */ ! if (write_code) ! output_fpops (file); } --- 1204,1208 ---- /* Output any pending floating-point operations. */ ! output_fpops (file); } diff -rc2N gcc-2.3.1/config/romp.h gcc-2.3.2/config/romp.h *** gcc-2.3.1/config/romp.h Sun Sep 27 13:03:50 1992 --- gcc-2.3.2/config/romp.h Mon Nov 23 21:10:04 1992 *************** *** 1344,1350 **** #define ASM_FILE_START(FILE) \ { extern char *version_string; \ fprintf (FILE, "\t.globl .oVncs\n\t.set .oVncs,0\n") ; \ ! fprintf (FILE, "\t.globl .oVgcc%s\n\t.set .oVgcc%s,0\n", \ ! version_string, version_string); \ } --- 1344,1357 ---- #define ASM_FILE_START(FILE) \ { extern char *version_string; \ + char *p; \ + \ fprintf (FILE, "\t.globl .oVncs\n\t.set .oVncs,0\n") ; \ ! fprintf (FILE, "\t.globl .oVgcc"); \ ! for (p = version_string; *p != ' ' && *p != 0; p++) \ ! fprintf (FILE, "%c", *p); \ ! fprintf (FILE, "\n\t.set .oVgcc"); \ ! for (p = version_string; *p != ' ' && *p != 0; p++) \ ! fprintf (FILE, "%c", *p); \ ! fprintf (FILE, ",0\n"); \ } diff -rc2N gcc-2.3.1/config/romp.md gcc-2.3.2/config/romp.md *** gcc-2.3.1/config/romp.md Wed Sep 23 19:18:23 1992 --- gcc-2.3.2/config/romp.md Wed Nov 11 12:50:51 1992 *************** *** 455,461 **** (define_expand "reload_outdi" ! [(set (match_operand:DI 0 "symbolic_memory_operand" "=m") ! (match_operand:DI 1 "" "r")) ! (match_operand:SI 2 "" "=&b")] "" "") --- 455,461 ---- (define_expand "reload_outdi" ! [(parallel [(set (match_operand:DI 0 "symbolic_memory_operand" "=m") ! (match_operand:DI 1 "" "r")) ! (clobber (match_operand:SI 2 "" "=&b"))])] "" "") diff -rc2N gcc-2.3.1/config/rs6000.h gcc-2.3.2/config/rs6000.h *** gcc-2.3.1/config/rs6000.h Sat Oct 24 21:03:46 1992 --- gcc-2.3.2/config/rs6000.h Fri Nov 27 18:15:44 1992 *************** *** 58,62 **** /* gcc must do the search itself to find libgcc.a, not use -l. */ ! #define LINK_LIBGCC_SPECIAL /* Don't turn -B into -L if the argument specifies a relative file name. */ --- 58,62 ---- /* gcc must do the search itself to find libgcc.a, not use -l. */ ! #define LINK_LIBGCC_SPECIAL_1 /* Don't turn -B into -L if the argument specifies a relative file name. */ diff -rc2N gcc-2.3.1/config/sparc.h gcc-2.3.2/config/sparc.h *** gcc-2.3.1/config/sparc.h Tue Oct 20 17:12:29 1992 --- gcc-2.3.2/config/sparc.h Sat Nov 21 18:46:21 1992 *************** *** 1278,1281 **** --- 1278,1282 ---- #define MOVE_MAX 8 + #if 0 /* Sun 4 has matherr, so this is no good. */ /* This is the value of the error code EDOM for this machine, used by the sqrt instruction. */ *************** *** 1285,1288 **** --- 1286,1290 ---- #define GEN_ERRNO_RTX \ gen_rtx (MEM, SImode, gen_rtx (SYMBOL_REF, Pmode, "errno")) + #endif /* 0 */ /* Define if normal loads of shorter-than-word items from memory clears diff -rc2N gcc-2.3.1/config/spc-sol2.h gcc-2.3.2/config/spc-sol2.h *** gcc-2.3.1/config/spc-sol2.h Tue Oct 13 14:55:13 1992 --- gcc-2.3.2/config/spc-sol2.h Sat Nov 21 17:16:21 1992 *************** *** 160,161 **** --- 160,193 ---- crtend.o%s \ %{!shared:%{!symbolic:%{pg:crtn.o%s}%{!pg:crtn.o%s}}}" + + /* This should be the same as in svr4.h, except with -R added. */ + #undef LINK_SPEC + #define LINK_SPEC "%{h*} %{V} %{v:%{!V:-V}} \ + %{b} %{Wl,*:%*} \ + %{static:-dn -Bstatic} \ + %{shared:-G -dy} \ + %{symbolic:-Bsymbolic -G -dy} \ + %{G:-G} \ + %{YP,*} \ + %{R*} \ + %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \ + %{!p:-Y P,/usr/ccs/lib:/usr/lib}} \ + %{Qy:} %{!Qn:-Qy}" + + /* This defines which switch letters take arguments. + It is as in svr4.h but with -R added. */ + + #undef SWITCH_TAKES_ARG + #define SWITCH_TAKES_ARG(CHAR) \ + ( (CHAR) == 'D' \ + || (CHAR) == 'U' \ + || (CHAR) == 'o' \ + || (CHAR) == 'e' \ + || (CHAR) == 'u' \ + || (CHAR) == 'I' \ + || (CHAR) == 'm' \ + || (CHAR) == 'L' \ + || (CHAR) == 'R' \ + || (CHAR) == 'A' \ + || (CHAR) == 'h' \ + || (CHAR) == 'z') diff -rc2N gcc-2.3.1/config/sun3.h gcc-2.3.2/config/sun3.h *** gcc-2.3.1/config/sun3.h Tue Oct 20 16:53:13 1992 --- gcc-2.3.2/config/sun3.h Tue Nov 3 15:15:18 1992 *************** *** 207,211 **** (REAL_VALUE_ISINF ((VALUE)) \ ? (asm_fprintf (FILE, "%I0r%s99e999", ((VALUE) > 0 ? "" : "-")), 0) \ ! : (VALUE) == -0.0 \ ? (asm_fprintf (FILE, "%I0r-0.0"), 0) \ : (asm_fprintf (FILE, "%I0r%.9g", (VALUE)), 0)) --- 207,211 ---- (REAL_VALUE_ISINF ((VALUE)) \ ? (asm_fprintf (FILE, "%I0r%s99e999", ((VALUE) > 0 ? "" : "-")), 0) \ ! : REAL_VALUE_MINUS_ZERO (VALUE) \ ? (asm_fprintf (FILE, "%I0r-0.0"), 0) \ : (asm_fprintf (FILE, "%I0r%.9g", (VALUE)), 0)) *************** *** 215,219 **** (REAL_VALUE_ISINF ((VALUE)) \ ? (asm_fprintf (FILE, "%I0r%s99e999", ((VALUE) > 0 ? "" : "-")), 0) \ ! : (VALUE) == -0.0 \ ? (asm_fprintf (FILE, "%I0r-0.0"), 0) \ : (asm_fprintf (FILE, "%I0r%.17g", (VALUE)), 0)) --- 215,219 ---- (REAL_VALUE_ISINF ((VALUE)) \ ? (asm_fprintf (FILE, "%I0r%s99e999", ((VALUE) > 0 ? "" : "-")), 0) \ ! : REAL_VALUE_MINUS_ZERO (VALUE) \ ? (asm_fprintf (FILE, "%I0r-0.0"), 0) \ : (asm_fprintf (FILE, "%I0r%.17g", (VALUE)), 0)) diff -rc2N gcc-2.3.1/config/t-hp320g gcc-2.3.2/config/t-hp320g *** gcc-2.3.1/config/t-hp320g Mon Jul 27 22:56:53 1992 --- gcc-2.3.2/config/t-hp320g Fri Nov 27 17:47:55 1992 *************** *** 2,8 **** LIBGCC1 = libgcc1.conv ! AR=$(tooldir)/ar ! RANLIB=$(tooldir)/ranlib ! RANLIB_TEST = [ -f $(tooldir)/ranlib ] ! LIBCONVERT=$(tooldir)/hpxt --- 2,9 ---- LIBGCC1 = libgcc1.conv ! AR = $(AR_FOR_TARGET) ! AR_FLAGS = $(AR_FOR_TARGET_FLAGS) ! RANLIB = $(RANLIB_FOR_TARGET) ! RANLIB_TEST = $(RANLIB_TEST_FOR_TARGET) ! LIBCONVERT=$(TARGET_TOOLPREFIX)hpxt diff -rc2N gcc-2.3.1/config/t-m88kv4 gcc-2.3.2/config/t-m88kv4 *** gcc-2.3.1/config/t-m88kv4 Wed Oct 7 16:18:05 1992 --- gcc-2.3.2/config/t-m88kv4 Fri Nov 6 06:45:58 1992 *************** *** 17,22 **** EXTRA_PARTS=crtbegin.o crtend.o - - # For svr4 we run the special svr4 fixincludes script. - - FIXINCLUDES=fixinc.svr4 --- 17,18 ---- diff -rc2N gcc-2.3.1/config/t-next gcc-2.3.2/config/t-next *** gcc-2.3.1/config/t-next Fri Oct 23 03:26:35 1992 --- gcc-2.3.2/config/t-next Wed Nov 25 16:29:00 1992 *************** *** 3,8 **** # Specify other dirs of system header files to be fixed. ! OTHER_FIXINCLUDES_DIRS= /NextDeveloper/Headers \ ! /NextDeveloper/Headers/ansi /NextDeveloper/Headers/bsd \ ! /LocalDeveloper/Headers /LocalDeveloper/Headers/ansi \ ! /LocalDeveloper/Headers/bsd --- 3,5 ---- # Specify other dirs of system header files to be fixed. ! OTHER_FIXINCLUDES_DIRS= /LocalDeveloper/Headers diff -rc2N gcc-2.3.1/config/tower-as.h gcc-2.3.2/config/tower-as.h *** gcc-2.3.1/config/tower-as.h Thu Jul 30 00:55:58 1992 --- gcc-2.3.2/config/tower-as.h Wed Nov 25 22:10:45 1992 *************** *** 630,633 **** --- 630,636 ---- #define NO_DOT_IN_LABEL + /* The usual definitions don't work because neither $ nor . is allowed. */ + #define CONSTRUCTOR_NAME_FORMAT "_GLOBAL_%%I%%%s" + /* Define a few machine-specific details of the implementation of constructors. diff -rc2N gcc-2.3.1/config/x-next gcc-2.3.2/config/x-next *** gcc-2.3.1/config/x-next Thu Oct 15 04:15:07 1992 --- gcc-2.3.2/config/x-next Wed Nov 4 21:50:11 1992 *************** *** 2,3 **** --- 2,8 ---- CC=cc -traditional-cpp OLDCC=cc -traditional-cpp + + libgcc2.a: stdarg.h + + stdarg.h: + cp $(srcdir)/gstdarg.h ./stdarg.h diff -rc2N gcc-2.3.1/config/xm-3b1.h gcc-2.3.2/config/xm-3b1.h *** gcc-2.3.1/config/xm-3b1.h Wed Nov 23 02:17:23 1988 --- gcc-2.3.2/config/xm-3b1.h Mon Nov 9 22:18:02 1992 *************** *** 6,7 **** --- 6,9 ---- #define bzero(a,b) memset (a,0,b) #define bcmp(a,b,c) memcmp (a,b,c) + #define index strchr + #define rindex strrchr diff -rc2N gcc-2.3.1/config/xm-hp320.h gcc-2.3.2/config/xm-hp320.h *** gcc-2.3.1/config/xm-hp320.h Mon Jul 27 23:02:38 1992 --- gcc-2.3.2/config/xm-hp320.h Sun Nov 22 17:37:03 1992 *************** *** 7,10 **** --- 7,12 ---- #define bzero(a,b) memset (a,0,b) #define bcmp(a,b,c) memcmp (a,b,c) + #define rindex strrchr + #define index strchr /* If compiling with HPUX compiler, we are probably using alloca.c, diff -rc2N gcc-2.3.1/config/xm-linux.h gcc-2.3.2/config/xm-linux.h *** gcc-2.3.1/config/xm-linux.h Thu Oct 1 16:12:09 1992 --- gcc-2.3.2/config/xm-linux.h Mon Nov 23 16:28:28 1992 *************** *** 15,18 **** --- 15,20 ---- #undef rindex + #if 0 /* These conflict with stdlib.h in protoize, it is said, + and there's no evidence they are actually needed. */ #undef malloc(n) #define malloc(n) malloc ((n) ? (n) : 1) *************** *** 19,20 **** --- 21,23 ---- #undef calloc(n,e) #define calloc(n,e) calloc (((n) ? (n) : 1), ((e) ? (e) : 1)) + #endif diff -rc2N gcc-2.3.1/config/xm-m68kv.h gcc-2.3.2/config/xm-m68kv.h *** gcc-2.3.1/config/xm-m68kv.h Wed Sep 12 19:33:01 1990 --- gcc-2.3.2/config/xm-m68kv.h Wed Nov 18 09:38:09 1992 *************** *** 8,11 **** --- 8,14 ---- #define bcmp(a,b,c) memcmp (a,b,c) + #define rindex strrchr + #define index strchr + #ifndef __GNUC__ #define USE_C_ALLOCA diff -rc2N gcc-2.3.1/config/xm-mot3300.h gcc-2.3.2/config/xm-mot3300.h *** gcc-2.3.1/config/xm-mot3300.h Thu Mar 29 21:41:05 1990 --- gcc-2.3.2/config/xm-mot3300.h Sat Nov 21 14:10:55 1992 *************** *** 6,7 **** --- 6,10 ---- #define bzero(a,b) memset (a,0,b) #define bcmp(a,b,c) memcmp (a,b,c) + + #define rindex strrchr + #define index strchr diff -rc2N gcc-2.3.1/config/xm-pa.h gcc-2.3.2/config/xm-pa.h *** gcc-2.3.1/config/xm-pa.h Wed Oct 14 10:37:56 1992 --- gcc-2.3.2/config/xm-pa.h Sat Nov 21 18:17:22 1992 *************** *** 19,39 **** the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ - #ifdef hpux - - #include - #if defined(SHL_MAGIC) - #define hpux8 1 - #define HAVE_VPRINTF - #endif - - #define USG - #define bcopy(a,b,c) memcpy (b,a,c) - #define bzero(a,b) memset (a,0,b) - #define bcmp(a,b,c) memcmp (a,b,c) - - #else /* hpux */ - #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) extern int errno; - #endif /* hpux */ /* #defines that need visibility everywhere. */ --- 19,23 ---- *************** *** 62,72 **** #define SUCCESS_EXIT_CODE 0 #define FATAL_EXIT_CODE 33 - - #if 0 - /* If compiled with GNU C, use the built-in alloca */ - #ifdef __GNUC__ - #define alloca __builtin_alloca - #endif - #endif /* Don't try to use sys_siglist. */ --- 46,49 ---- diff -rc2N gcc-2.3.1/config/xm-pahpux.h gcc-2.3.2/config/xm-pahpux.h *** gcc-2.3.1/config/xm-pahpux.h --- gcc-2.3.2/config/xm-pahpux.h Sat Nov 21 18:17:24 1992 *************** *** 0 **** --- 1,63 ---- + /* Configuration for GNU C-compiler for PA-RISC. + Copyright (C) 1988 Free Software Foundation, Inc. + Contributed by Michael Tiemann (tiemann@cygnus.com). + + This file is part of GNU CC. + + GNU CC is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + GNU CC is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU CC; see the file COPYING. If not, write to + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + + + /* HP-UX is a flavor of System V */ + #define USG + + /* Use System V memory functions. */ + #define bcopy(a,b,c) memcpy (b,a,c) + #define bzero(a,b) memset (a,0,b) + #define bcmp(a,b,c) memcmp (a,b,c) + + #define rindex strrchr + #define index strchr + + /* #defines that need visibility everywhere. */ + #define FALSE 0 + #define TRUE 1 + + /* This describes the machine the compiler is hosted on. */ + #define HOST_BITS_PER_CHAR 8 + #define HOST_BITS_PER_SHORT 16 + #define HOST_BITS_PER_INT 32 + #define HOST_BITS_PER_LONG 32 + #define HOST_BITS_PER_LONGLONG 64 + + /* Doubles are stored in memory with the high order word first. This + matters when cross-compiling. */ + #define HOST_WORDS_BIG_ENDIAN 1 + + /* Place any machine-dependent include files here, in case we + are bootstrapping. */ + + /* target machine dependencies. + tm.h is a symbolic link to the actual target specific file. */ + #include "tm.h" + + /* Arguments to use with `exit'. */ + #define SUCCESS_EXIT_CODE 0 + #define FATAL_EXIT_CODE 33 + + /* Don't try to use sys_siglist. */ + #define NO_SYS_SIGLIST + + /* HP's compiler has problems with enum bitfields. */ + #define ONLY_INT_FIELDS diff -rc2N gcc-2.3.1/config/xm-tower.h gcc-2.3.2/config/xm-tower.h *** gcc-2.3.1/config/xm-tower.h Sun Dec 2 17:49:05 1990 --- gcc-2.3.2/config/xm-tower.h Wed Nov 11 01:06:30 1992 *************** *** 1,8 **** #include "xm-m68k.h" - #define USG #define HAVE_VPRINTF - - #define bcopy(a,b,c) memcpy (b,a,c) - #define bzero(a,b) memset (a,0,b) - #define bcmp(a,b,c) memcmp (a,b,c) --- 1,4 ---- #include "xm-m68k.h" + #include "xm-svr3.h" #define HAVE_VPRINTF diff -rc2N gcc-2.3.1/config/xm-vax-vms.h gcc-2.3.2/config/xm-vax-vms.h *** gcc-2.3.1/config/xm-vax-vms.h Thu Aug 20 15:23:20 1992 --- gcc-2.3.2/config/xm-vax-vms.h Wed Nov 4 18:28:37 1992 *************** *** 33,36 **** --- 33,38 ---- #define HOST_BITS_PER_LONGLONG 64 + #define HOST_FLOAT_FORMAT VAX_FLOAT_FORMAT + #define SUCCESS_EXIT_CODE 1 #define FATAL_EXIT_CODE (44 | 0x10000000) /* Failure, and no DCL message. */ diff -rc2N gcc-2.3.1/config.sub gcc-2.3.2/config.sub *** gcc-2.3.1/config.sub Thu Oct 15 17:05:53 1992 --- gcc-2.3.2/config.sub Fri Nov 20 12:14:20 1992 *************** *** 37,41 **** # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM ! # it is wrong to echo any other type of specification # First pass through any local machine types. --- 37,41 ---- # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM ! # It is wrong to echo any other type of specification. # First pass through any local machine types. *************** *** 55,60 **** else os=; fi ! # Lets recognize common machines as not being OS so that things like ! # config.subr decstation-3100 work. case $os in -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ --- 55,62 ---- else os=; fi ! ### Let's recognize common machines as not being operating systems so ! ### that things like config.sub decstation-3100 work. We also ! ### recognize some manufacturers as not being operating systems, so we ! ### can provide default operating systems below. case $os in -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ *************** *** 63,70 **** -convergent* | -ncr* | -news | -32* | -3600* | -3100* | \ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ ! -harris | -dolphin) os= basic_machine=$1 ;; -sco*) os=-sco3.2v2 --- 65,77 ---- -convergent* | -ncr* | -news | -32* | -3600* | -3100* | \ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ ! -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp ) os= basic_machine=$1 ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + os=-sco3.2v4 + basic_machine=i386-unknown + ;; -sco*) os=-sco3.2v2 *************** *** 71,76 **** basic_machine=i386-unknown ;; -isc*) - os=-isc basic_machine=i386-unknown ;; --- 78,86 ---- basic_machine=i386-unknown ;; + -isc) + os=-isc2.2 + basic_machine=i386-unknown + ;; -isc*) basic_machine=i386-unknown ;; *************** *** 83,87 **** tahoe | i[34]86 | i860 | m68k | m68000 | m88k | ns32k | arm | pyramid \ | tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \ ! | alpha | we32k) basic_machine=$basic_machine-unknown ;; --- 93,97 ---- tahoe | i[34]86 | i860 | m68k | m68000 | m88k | ns32k | arm | pyramid \ | tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \ ! | alpha | we32k | ns16k | clipper ) basic_machine=$basic_machine-unknown ;; *************** *** 91,95 **** | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \ ! | hppa1.0-* | hppa1.1-* | alpha-* | we32k-*) ;; # Recognize the various machine names and aliases which stand --- 101,106 ---- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \ ! | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \ ! | pn-* | np1-* | xps100-* | clipper-* | orion-* ) ;; # Recognize the various machine names and aliases which stand *************** *** 185,189 **** encore | umax | mmax) basic_machine=ns32k-encore - os=-bsd ;; genix) --- 196,199 ---- *************** *** 280,283 **** --- 290,301 ---- basic_machine=m68k-cbm ;; + amigados) + basic_machine=m68k-cbm + os=-amigados + ;; + amigaunix | amix) + basic_machine=m68k-cbm + os=-sysv4 + ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp *************** *** 335,346 **** os=-sysv ;; - amigados) - basic_machine=m68k-cbm - os=-amigados - ;; - amigaunix | amix) - basic_machine=m68k-cbm - os=-sysv4 - ;; cray | ymp) basic_machine=ymp-cray --- 353,356 ---- *************** *** 405,413 **** pn) basic_machine=pn-gould - os=-sysv ;; np1) basic_machine=np1-gould - os=-sysv ;; ultra3) --- 415,421 ---- *************** *** 423,426 **** --- 431,437 ---- os=-vxworks ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; none) basic_machine=none-none *************** *** 448,451 **** --- 459,471 ---- basic_machine=sparc-sun ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 *************** *** 479,483 **** | -amigados* | -msdos* | -newsos* | -unicos* | -aos* \ | -nindy* | -vxworks* | -ebmon* | -hds* | -m88kbcs* \ ! | -riscos* | -linux* ) ;; -osfrose*) --- 499,503 ---- | -amigados* | -msdos* | -newsos* | -unicos* | -aos* \ | -nindy* | -vxworks* | -ebmon* | -hds* | -m88kbcs* \ ! | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* ) ;; -osfrose*) *************** *** 511,514 **** --- 531,537 ---- os=-sysv3 ;; + -xenix) + os=-xenix + ;; -none) ;; *************** *** 525,528 **** --- 548,558 ---- # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. + + # Note that if you're going to try to match "-MANUFACTURER" here (say, + # "-sun"), then you have to tell the case statement up towards the top + # that MANUFACTURER isn't an operating system. Otherwise, code above + # will signal an error saying that MANUFACTURER isn't an operating + # system, and we'll never get to this point. + case $basic_machine in *-dec | vax-*) *************** *** 550,554 **** os=-hpux ;; ! *-sgi | i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; --- 580,584 ---- os=-hpux ;; ! i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *************** *** 573,576 **** --- 603,621 ---- i[34]86-*) os=-sco3.2v2 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-masscomp) + os=-rtu ;; *) diff -rc2N gcc-2.3.1/configure gcc-2.3.2/configure *** gcc-2.3.1/configure Sun Nov 1 03:25:32 1992 --- gcc-2.3.2/configure Wed Nov 25 16:23:16 1992 *************** *** 474,477 **** --- 474,478 ---- xmake_file=x-sparcv4 fixincludes=fixinc.svr4 + broken_install=yes ;; m68k-cbm-sysv4*) # Commodore variant of V.4. *************** *** 996,1002 **** use_collect2=yes ;; hppa1.1-*-hpux*) cpu_type=pa ! xm_file=xm-pa.h xmake_file=x-pa-hpux tmake_file=t-libc-ok --- 997,1017 ---- use_collect2=yes ;; + hppa1.0-*-hpux7*) + cpu_type=pa + xm_file=xm-pahpux.h + xmake_file=x-pa-hpux + tmake_file=t-libc-ok + if [ x$gas = xyes ] + then + tm_file=pa-gux7.h + else + tm_file=pa-hpux7.h + fi + broken_install=yes + use_collect2=yes + ;; hppa1.1-*-hpux*) cpu_type=pa ! xm_file=xm-pahpux.h xmake_file=x-pa-hpux tmake_file=t-libc-ok *************** *** 1012,1016 **** hppa1.0-*-hpux*) cpu_type=pa ! xm_file=xm-pa.h xmake_file=x-pa-hpux tmake_file=t-libc-ok --- 1027,1031 ---- hppa1.0-*-hpux*) cpu_type=pa ! xm_file=xm-pahpux.h xmake_file=x-pa-hpux tmake_file=t-libc-ok diff -rc2N gcc-2.3.1/cp-call.c gcc-2.3.2/cp-call.c *** gcc-2.3.1/cp-call.c Tue Oct 6 19:28:51 1992 --- gcc-2.3.2/cp-call.c Thu Nov 12 20:50:12 1992 *************** *** 27,31 **** #include "cp-tree.h" #include "flags.h" - #include "assert.h" #include "cp-class.h" --- 27,30 ---- *************** *** 42,48 **** extern tree ctor_label, dtor_label; - /* See cp-decl.c for comment of this variable. */ - extern int flag_int_enum_equivalence; - /* From cp-typeck.c: */ extern tree unary_complex_lvalue (); --- 41,44 ---- *************** *** 206,213 **** if (TYPE_OFFSET_BASETYPE (type) == TYPE_OFFSET_BASETYPE (parmtype)) harshness = 0; ! else if (DERIVED_FROM_P (TYPE_OFFSET_BASETYPE (type), TYPE_OFFSET_BASETYPE (parmtype))) harshness = INT_TO_BD_HARSHNESS (1); ! else if (DERIVED_FROM_P (TYPE_OFFSET_BASETYPE (parmtype), TYPE_OFFSET_BASETYPE (type))) harshness = CONTRAVARIANT_HARSHNESS (-1); --- 202,209 ---- if (TYPE_OFFSET_BASETYPE (type) == TYPE_OFFSET_BASETYPE (parmtype)) harshness = 0; ! else if (UNIQUELY_DERIVED_FROM_P (TYPE_OFFSET_BASETYPE (type), TYPE_OFFSET_BASETYPE (parmtype))) harshness = INT_TO_BD_HARSHNESS (1); ! else if (UNIQUELY_DERIVED_FROM_P (TYPE_OFFSET_BASETYPE (parmtype), TYPE_OFFSET_BASETYPE (type))) harshness = CONTRAVARIANT_HARSHNESS (-1); *************** *** 1050,1055 **** { /* newbase could be a base or a parent of base1 */ ! if (newbase != base1 && ! DERIVED_FROM_P (newbase, base1) ! && ! DERIVED_FROM_P (base1, newbase)) { error_with_aggr_type (basetype, "ambiguous request for function from distinct base classes of type `%s'"); --- 1046,1051 ---- { /* newbase could be a base or a parent of base1 */ ! if (newbase != base1 && ! UNIQUELY_DERIVED_FROM_P (newbase, base1) ! && ! UNIQUELY_DERIVED_FROM_P (base1, newbase)) { error_with_aggr_type (basetype, "ambiguous request for function from distinct base classes of type `%s'"); *************** *** 1123,1127 **** return 0; ! if (DERIVED_FROM_P (parent, current_class_type)) return 0; return 1; --- 1119,1123 ---- return 0; ! if (UNIQUELY_DERIVED_FROM_P (parent, current_class_type)) return 0; return 1; *************** *** 1281,1284 **** --- 1277,1314 ---- } + tree + find_scoped_type (type, inner_name, inner_types) + tree type, inner_name, inner_types; + { + tree tags = CLASSTYPE_TAGS (type); + + while (tags) + { + /* The TREE_PURPOSE of an enum tag (which becomes a member of the + enclosing class) is set to the name for the enum type. So, if + inner_name is `bar', and we strike `baz' for `enum bar { baz }', + then this test will be true. */ + if (TREE_PURPOSE (tags) == inner_name) + { + if (inner_types == NULL_TREE) + return DECL_NESTED_TYPENAME (TYPE_NAME (TREE_VALUE (tags))); + return resolve_scope_to_name (TREE_VALUE (tags), inner_types); + } + tags = TREE_CHAIN (tags); + } + + /* Look for a TYPE_DECL. */ + for (tags = TYPE_FIELDS (type); tags; tags = TREE_CHAIN (tags)) + if (TREE_CODE (tags) == TYPE_DECL && DECL_NAME (tags) == inner_name) + { + /* Code by raeburn. */ + if (inner_types == NULL_TREE) + return DECL_NESTED_TYPENAME (tags); + return resolve_scope_to_name (TREE_TYPE (tags), inner_types); + } + + return NULL_TREE; + } + /* Resolve an expression NAME1::NAME2::...::NAMEn to the name that names the above nested type. INNER_TYPES *************** *** 1290,1295 **** tree outer_type, inner_types; { ! tree tags; ! tree inner_name; if (outer_type == NULL_TREE && current_class_type != NULL_TREE) --- 1320,1325 ---- tree outer_type, inner_types; { ! register tree tmp; ! tree tags, inner_name; if (outer_type == NULL_TREE && current_class_type != NULL_TREE) *************** *** 1329,1367 **** return NULL_TREE; ! /* Look for member classes. */ ! tags = CLASSTYPE_TAGS (outer_type); ! while (tags) { ! if (TREE_PURPOSE (tags) == inner_name) { ! if (inner_types == NULL_TREE) ! return DECL_NESTED_TYPENAME (TYPE_NAME (TREE_VALUE (tags))); ! return resolve_scope_to_name (TREE_VALUE (tags), inner_types); } ! tags = TREE_CHAIN (tags); } ! /* Look for a TYPE_DECL. */ ! for (tags = TYPE_FIELDS (outer_type); tags; tags = TREE_CHAIN (tags)) ! if (TREE_CODE (tags) == TYPE_DECL && DECL_NAME (tags) == inner_name) ! { ! #if 0 ! /* Code by tiemann. */ ! tree type = TREE_TYPE (tags); ! /* With luck, this will name a visible type. */ ! inner_name = TYPE_NAME (type); ! if (TREE_CODE (inner_name) == TYPE_DECL) ! inner_name = DECL_NAME (inner_name); ! return inner_name; ! #else ! /* Code by raeburn. */ ! if (inner_types == NULL_TREE) ! return DECL_NESTED_TYPENAME (tags); ! return resolve_scope_to_name (TREE_TYPE (tags), inner_types); ! #endif ! } ! ! return NULL_TREE; } --- 1359,1384 ---- return NULL_TREE; ! /* Look for member classes or enums. */ ! tmp = find_scoped_type (outer_type, inner_name, inner_types); ! /* If it's not a type in this class, then go down into the ! base classes and search there. */ ! if (! tmp && TYPE_BINFO (outer_type)) { ! tree binfos = TYPE_BINFO_BASETYPES (outer_type); ! int i, n_baselinks = binfos ? TREE_VEC_LENGTH (binfos) : 0; ! ! for (i = 0; i < n_baselinks; i++) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); ! tmp = find_scoped_type (BINFO_TYPE (base_binfo), ! inner_name, inner_types); ! if (tmp) ! return tmp; } ! tmp = NULL_TREE; } ! return tmp; } *************** *** 1490,1495 **** char *name_kind; int ever_seen = 0; - int wrap; - tree wrap_type; tree instance_ptr = NULL_TREE; int all_virtual = flag_all_virtual; --- 1507,1510 ---- *************** *** 1585,1606 **** #endif - if (TREE_CODE (name) == WRAPPER_EXPR) - { - wrap_type = TREE_OPERAND (name, 0); - name = TREE_OPERAND (name, 1); - wrap = 1; - } - else if (TREE_CODE (name) == ANTI_WRAPPER_EXPR) - { - wrap_type = TREE_OPERAND (name, 0); - name = TREE_OPERAND (name, 1); - wrap = -1; - } - else - { - wrap_type = NULL_TREE; - wrap = 0; - } - /* Initialize name for error reporting. */ if (IDENTIFIER_TYPENAME_P (name)) --- 1600,1603 ---- *************** *** 1612,1617 **** sprintf (err_name, "operator %s", p); } - else if (name == wrapper_name) - err_name = "wrapper"; else if (TREE_CODE (name) == SCOPE_REF) err_name = IDENTIFIER_POINTER (TREE_OPERAND (name, 1)); --- 1609,1612 ---- *************** *** 1624,1634 **** GNU_xref_call (current_function_decl, err_name); - if (wrap) - { - char *p = (char *)alloca (strlen (err_name) + 32); - sprintf (p, "%s for `%s'", wrap < 0 ? "anti-wrapper" : "wrapper", err_name); - err_name = p; - } - if (instance == NULL_TREE) { --- 1619,1622 ---- *************** *** 1677,1690 **** } } - if (wrap_type && wrap_type != basetype) - { - error_with_aggr_type (wrap_type, "invalid constructor `%s::%s'", - TYPE_NAME_STRING (basetype)); - return error_mark_node; - } - if (TYPE_VIRTUAL_P (basetype)) - { - wrap_type = basetype; - } if (! IS_AGGR_TYPE (basetype)) --- 1665,1668 ---- *************** *** 1706,1711 **** has a known type, so virtual function tables are not needed. */ if (TYPE_VIRTUAL_P (basetype) ! && !(flags & LOOKUP_NONVIRTUAL) ! && wrap_type == NULL_TREE) need_vtbl = (dtor_label || ctor_label) ? unneeded : maybe_needed; --- 1684,1688 ---- has a known type, so virtual function tables are not needed. */ if (TYPE_VIRTUAL_P (basetype) ! && !(flags & LOOKUP_NONVIRTUAL)) need_vtbl = (dtor_label || ctor_label) ? unneeded : maybe_needed; *************** *** 1722,1736 **** { basetype = TREE_TYPE (instance); - if (wrap_type) - { - if (binfo_or_else (basetype, wrap_type)) - basetype = wrap_type; - else - return error_mark_node; - } /* Should we ever have to make a virtual function reference from a RESULT_DECL, know that it must be of fixed type within the scope of this function. */ ! else if (!(flags & LOOKUP_NONVIRTUAL) && TYPE_VIRTUAL_P (basetype)) need_vtbl = maybe_needed; instance_ptr = build1 (ADDR_EXPR, TYPE_POINTER_TO (basetype), instance); --- 1699,1706 ---- { basetype = TREE_TYPE (instance); /* Should we ever have to make a virtual function reference from a RESULT_DECL, know that it must be of fixed type within the scope of this function. */ ! if (!(flags & LOOKUP_NONVIRTUAL) && TYPE_VIRTUAL_P (basetype)) need_vtbl = maybe_needed; instance_ptr = build1 (ADDR_EXPR, TYPE_POINTER_TO (basetype), instance); *************** *** 1810,1814 **** else { ! assert (TREE_CODE (instance) == CALL_EXPR); if (TYPE_NEEDS_CONSTRUCTOR (basetype)) instance = build_cplus_new (basetype, instance, 0); --- 1780,1785 ---- else { ! if (TREE_CODE (instance) != CALL_EXPR) ! my_friendly_abort (125); if (TYPE_NEEDS_CONSTRUCTOR (basetype)) instance = build_cplus_new (basetype, instance, 0); *************** *** 1842,1853 **** return result; ! if (wrap_type) ! { ! if (binfo_or_else (basetype, wrap_type)) ! basetype = wrap_type; ! else ! return error_mark_node; ! } ! else if (!(flags & LOOKUP_NONVIRTUAL) && TYPE_VIRTUAL_P (basetype)) { if (TREE_SIDE_EFFECTS (instance_ptr)) --- 1813,1817 ---- return result; ! if (!(flags & LOOKUP_NONVIRTUAL) && TYPE_VIRTUAL_P (basetype)) { if (TREE_SIDE_EFFECTS (instance_ptr)) *************** *** 1878,1890 **** } - /* Are we building a non-virtual wrapper? */ - if (flags & LOOKUP_NONVIRTUAL) - { - if (all_virtual) - sorry ("non-virtual call with -fall-virtual"); - if (wrap) - wrap_type = basetype; - } - save_basetype = basetype; --- 1842,1845 ---- *************** *** 1895,1899 **** || instance_ptr == NULL_TREE || (TYPE_OVERLOADS_METHOD_CALL_EXPR (basetype) == 0 ! && TYPE_NEEDS_WRAPPER (basetype) == 0))) all_virtual = 0; #endif --- 1850,1854 ---- || instance_ptr == NULL_TREE || (TYPE_OVERLOADS_METHOD_CALL_EXPR (basetype) == 0 ! /*&& TYPE_NEEDS_WRAPPER (basetype) == 0*/ ))) all_virtual = 0; #endif *************** *** 1955,1959 **** TREE_CALLS_NEW (instance_ptr) = 1; instance = build_indirect_ref (instance_ptr, 0); ! parms = tree_cons (NULL_TREE, instance_ptr, parms); } } --- 1910,1922 ---- TREE_CALLS_NEW (instance_ptr) = 1; instance = build_indirect_ref (instance_ptr, 0); ! ! /* If it's a default argument initialized from a ctor, what we get ! from instance_ptr will match the arglist for the FUNCTION_DECL ! of the constructor. */ ! if (parms && TREE_CODE (TREE_VALUE (parms)) == CALL_EXPR ! && TREE_CALLS_NEW (TREE_VALUE (TREE_OPERAND (TREE_VALUE (parms), 1)))) ! parms = build_tree_list (NULL_TREE, instance_ptr); ! else ! parms = tree_cons (NULL_TREE, instance_ptr, parms); } } *************** *** 1966,2044 **** /* Look up function name in the structure type definition. */ ! if (wrap) ! { ! if (wrap > 0) ! name_kind = "wrapper"; ! else ! name_kind = "anti-wrapper"; ! baselink = get_wrapper (basetype); ! } ! else { ! if ((IDENTIFIER_HAS_TYPE_VALUE (name) ! && IS_AGGR_TYPE (IDENTIFIER_TYPE_VALUE (name))) || name == constructor_name (basetype)) ! { ! tree tmp = NULL_TREE; ! if (IDENTIFIER_TYPE_VALUE (name) == basetype ! || name == constructor_name (basetype)) ! tmp = TYPE_BINFO (basetype); ! else ! tmp = get_binfo (IDENTIFIER_TYPE_VALUE (name), basetype, 0); ! ! if (tmp != 0) ! { ! name_kind = "constructor"; ! ! if (TYPE_USES_VIRTUAL_BASECLASSES (basetype) ! && ! (flags & LOOKUP_HAS_IN_CHARGE)) ! { ! /* Constructors called for initialization ! only are never in charge. */ ! tree tmplist; ! ! flags |= LOOKUP_HAS_IN_CHARGE; ! tmplist = tree_cons (NULL_TREE, integer_zero_node, ! TREE_CHAIN (parms)); ! TREE_CHAIN (parms) = tmplist; ! tmplist = tree_cons (NULL_TREE, integer_type_node, TREE_CHAIN (parmtypes)); ! TREE_CHAIN (parmtypes) = tmplist; ! } ! #ifdef SOS ! if (TYPE_DYNAMIC (basetype) && dtbl_inserted == 0) ! { ! tree parm, parmtype; ! dtbl = get_sos_dtable (basetype); ! parm = tree_cons (NULL_TREE, dtbl, TREE_CHAIN (parms)); ! parmtype = tree_cons (NULL_TREE, build_pointer_type (ptr_type_node), TREE_CHAIN (parmtypes)); ! TREE_CHAIN (parms) = parm; ! TREE_CHAIN (parmtypes) = parmtype; ! dtbl_inserted = -1; ! } #endif ! /* constructors are in very specific places. */ #ifdef SOS ! if (dtbl_inserted == -1) ! { ! TREE_CHAIN (parmtypes) = TREE_CHAIN (TREE_CHAIN (parmtypes)); ! TREE_CHAIN (parms) = TREE_CHAIN (TREE_CHAIN (parms)); ! dtbl_inserted = 0; ! } ! #endif ! basetype = BINFO_TYPE (tmp); } ! else ! name_kind = "method"; } ! else name_kind = "method"; ! ! if (basetype_path == NULL_TREE) ! basetype_path = TYPE_BINFO (basetype); ! result = lookup_fnfields (basetype_path, name, ! (flags & LOOKUP_COMPLAIN)); ! if (result == error_mark_node) ! return error_mark_node; } /* Now, go look for this method name. We do not find destructors here. --- 1929,1997 ---- /* Look up function name in the structure type definition. */ ! if ((IDENTIFIER_HAS_TYPE_VALUE (name) ! && IS_AGGR_TYPE (IDENTIFIER_TYPE_VALUE (name))) ! || name == constructor_name (basetype)) { ! tree tmp = NULL_TREE; ! if (IDENTIFIER_TYPE_VALUE (name) == basetype || name == constructor_name (basetype)) ! tmp = TYPE_BINFO (basetype); ! else ! tmp = get_binfo (IDENTIFIER_TYPE_VALUE (name), basetype, 0); ! ! if (tmp != 0) ! { ! name_kind = "constructor"; ! ! if (TYPE_USES_VIRTUAL_BASECLASSES (basetype) ! && ! (flags & LOOKUP_HAS_IN_CHARGE)) ! { ! /* Constructors called for initialization ! only are never in charge. */ ! tree tmplist; ! ! flags |= LOOKUP_HAS_IN_CHARGE; ! tmplist = tree_cons (NULL_TREE, integer_zero_node, ! TREE_CHAIN (parms)); ! TREE_CHAIN (parms) = tmplist; ! tmplist = tree_cons (NULL_TREE, integer_type_node, TREE_CHAIN (parmtypes)); ! TREE_CHAIN (parmtypes) = tmplist; ! } ! #ifdef SOS ! if (TYPE_DYNAMIC (basetype) && dtbl_inserted == 0) ! { ! tree parm, parmtype; ! dtbl = get_sos_dtable (basetype); ! parm = tree_cons (NULL_TREE, dtbl, TREE_CHAIN (parms)); ! parmtype = tree_cons (NULL_TREE, build_pointer_type (ptr_type_node), TREE_CHAIN (parmtypes)); ! TREE_CHAIN (parms) = parm; ! TREE_CHAIN (parmtypes) = parmtype; ! dtbl_inserted = -1; ! } #endif ! /* constructors are in very specific places. */ #ifdef SOS ! if (dtbl_inserted == -1) ! { ! TREE_CHAIN (parmtypes) = TREE_CHAIN (TREE_CHAIN (parmtypes)); ! TREE_CHAIN (parms) = TREE_CHAIN (TREE_CHAIN (parms)); ! dtbl_inserted = 0; } ! #endif ! basetype = BINFO_TYPE (tmp); } ! else ! name_kind = "method"; } + else name_kind = "method"; + + if (basetype_path == NULL_TREE) + basetype_path = TYPE_BINFO (basetype); + result = lookup_fnfields (basetype_path, name, + (flags & LOOKUP_COMPLAIN)); + if (result == error_mark_node) + return error_mark_node; + /* Now, go look for this method name. We do not find destructors here. *************** *** 2059,2064 **** /* This increments every time we go up the type hierarchy. ! The idea is to prefer a function of the derived class if possible. */ ! int b_or_d; baselink = result; --- 2012,2017 ---- /* This increments every time we go up the type hierarchy. ! The idea is to prefer a function of the derived class if possible. */ ! int b_or_d = 0; baselink = result; *************** *** 2066,2073 **** if (pass > 0) { ! candidates = (struct candidate *) alloca ((ever_seen+1) * sizeof (struct candidate)); cp = candidates; len = list_length (parms); - b_or_d = 0; /* First see if a global function has a shot at it. */ --- 2019,2027 ---- if (pass > 0) { ! candidates ! = (struct candidate *) alloca ((ever_seen+1) ! * sizeof (struct candidate)); cp = candidates; len = list_length (parms); /* First see if a global function has a shot at it. */ *************** *** 2092,2096 **** } else ! assert (0); cp->harshness --- 2046,2050 ---- } else ! my_friendly_assert (0, 167); cp->harshness *************** *** 2318,2322 **** if (ever_seen) { ! if (((int)saw_protected|(int)saw_private) == 0) { if (flags & LOOKUP_SPECULATIVELY) --- 2272,2276 ---- if (ever_seen) { ! if (((HOST_WIDE_INT)saw_protected|(HOST_WIDE_INT)saw_private) == 0) { if (flags & LOOKUP_SPECULATIVELY) *************** *** 2360,2371 **** tag_name = "union"; ! if (wrap) ! buf = "%s has no appropriate wrapper function defined"; ! else ! { ! buf = (char *)alloca (30 + strlen (err_name)); ! strcpy (buf, "%s has no method named `%s'"); ! } ! error (buf, tag_name, err_name); return error_mark_node; --- 2314,2319 ---- tag_name = "union"; ! buf = (char *)alloca (30 + strlen (err_name)); ! strcpy (buf, "%s has no method named `%s'"); error (buf, tag_name, err_name); return error_mark_node; *************** *** 2473,2477 **** } } ! else { error_with_aggr_type (basetype, "cannot call member function `%s::%s' without object", --- 2421,2425 ---- } } ! else if (! TREE_STATIC (function)) { error_with_aggr_type (basetype, "cannot call member function `%s::%s' without object", *************** *** 2541,2620 **** } - /* See if there is a wrapper for this thing. */ - if (wrap < 0 - || static_call_context - || name == wrapper_name - || name == TYPE_IDENTIFIER (basetype)) - ; - else if (wrap > 0 || TYPE_NEEDS_WRAPPER (basetype)) - { - flags &= ~LOOKUP_PROTECT; - if (wrap == 0) - { - wrap = TYPE_NEEDS_WRAPPER (basetype); - /* If no wrapper specified, wrapper may be virtual. */ - flags &= ~LOOKUP_NONVIRTUAL; - } - - if (wrap) - { - tree wrapped_result, unwrapped_result; - - if (!all_virtual && TREE_CODE (function) == FUNCTION_DECL) - parm = build_unary_op (ADDR_EXPR, function, 0); - else - { - fntype = build_cplus_method_type (basetype, TREE_TYPE (fntype), TYPE_ARG_TYPES (fntype)); - parm = build1 (NOP_EXPR, build_pointer_type (fntype), DECL_VINDEX (function)); - } - - if (TYPE_HAS_WRAPPER_PRED (basetype)) - { - unwrapped_result = build_nt (CALL_EXPR, default_conversion (function), parms, NULL_TREE); - - assert (TREE_OPERAND (unwrapped_result, 1) != error_mark_node); - - TREE_TYPE (unwrapped_result) = value_type; - TREE_SIDE_EFFECTS (unwrapped_result) = 1; - TREE_RAISES (unwrapped_result) = !! TYPE_RAISES_EXCEPTIONS (fntype); - } - - /* If this pointer walked as a result of multiple inheritance, - keep its displaced value. */ - parms = tree_cons (NULL_TREE, parm, TREE_CHAIN (parms)); - - wrapped_result = get_wrapper (basetype); - assert (wrapped_result != NULL_TREE); - assert (wrapped_result != error_mark_node); - - /* @@ Should BASETYPE_PATH get TREE_PURPOSE (wrapped_result) here? */ - wrapped_result - = build_method_call (instance, - DECL_NAME (TREE_VALUE (wrapped_result)), - parms, basetype_path, flags); - #if 0 - /* Do this if we want the result of operator->() to inherit - the type of the function it is subbing for. */ - if (wrapped_result != error_mark_node) - TREE_TYPE (wrapped_result) = value_type; - #endif - - if (TYPE_HAS_WRAPPER_PRED (basetype)) - { - result = build_conditional_expr - (build_method_call (instance, wrapper_pred_name, build_tree_list (NULL_TREE, parm), basetype_path, LOOKUP_NORMAL), - wrapped_result, - unwrapped_result); - - } - else - { - result = wrapped_result; - } - - TREE_SIDE_EFFECTS (result) = 1; - return result; - } - } #if 0 /* Constructors do not overload method calls. */ --- 2489,2492 ---- *************** *** 2859,2863 **** /* The list-of-lists should only occur for class things. */ ! assert (functions == IDENTIFIER_CLASS_VALUE (fnname)); for (outer = functions; outer; outer = TREE_CHAIN (outer)) --- 2731,2735 ---- /* The list-of-lists should only occur for class things. */ ! my_friendly_assert (functions == IDENTIFIER_CLASS_VALUE (fnname), 168); for (outer = functions; outer; outer = TREE_CHAIN (outer)) *************** *** 2881,2885 **** cp = candidates; ! assert (TREE_CODE (TREE_VALUE (functions)) != TREE_LIST); /* OUTER is the list of FUNCTION_DECLS, in a TREE_LIST. */ --- 2753,2757 ---- cp = candidates; ! my_friendly_assert (TREE_CODE (TREE_VALUE (functions)) != TREE_LIST, 169); /* OUTER is the list of FUNCTION_DECLS, in a TREE_LIST. */ diff -rc2N gcc-2.3.1/cp-class.c gcc-2.3.2/cp-class.c *** gcc-2.3.1/cp-class.c Thu Sep 24 21:48:03 1992 --- gcc-2.3.2/cp-class.c Mon Nov 23 20:47:21 1992 *************** *** 27,31 **** #include "cp-tree.h" #include "flags.h" - #include "assert.h" #include "cp-class.h" --- 27,30 ---- *************** *** 373,377 **** if (current_vtable_decl == NULL_TREE || current_vtable_decl == error_mark_node ! || !DERIVED_FROM_P (DECL_FCONTEXT (CLASSTYPE_VFIELD (current_class_type)), basetype)) vtbl = build_indirect_ref (build_vfield_ref (instance, basetype)); else --- 372,376 ---- if (current_vtable_decl == NULL_TREE || current_vtable_decl == error_mark_node ! || !UNIQUELY_DERIVED_FROM_P (DECL_FCONTEXT (CLASSTYPE_VFIELD (current_class_type)), basetype)) vtbl = build_indirect_ref (build_vfield_ref (instance, basetype)); else *************** *** 557,562 **** if (TREE_VIA_VIRTUAL (binfo)) ! assert (binfo == binfo_member (BINFO_TYPE (binfo), ! CLASSTYPE_VBASECLASSES (current_class_type))); SET_BINFO_NEW_VTABLE_MARKED (binfo); SET_BINFO_VTABLE_PATH_MARKED (binfo); --- 556,562 ---- if (TREE_VIA_VIRTUAL (binfo)) ! my_friendly_assert (binfo == binfo_member (BINFO_TYPE (binfo), ! CLASSTYPE_VBASECLASSES (current_class_type)), ! 170); SET_BINFO_NEW_VTABLE_MARKED (binfo); SET_BINFO_VTABLE_PATH_MARKED (binfo); *************** *** 1343,1362 **** for (i = n_baseclasses-1; i >= 0; i--) { ! tree child = TREE_VEC_ELT (binfos, i); tree blist; /* Don't initialize virtual baseclasses this way. */ ! if (TREE_VIA_VIRTUAL (child)) continue; ! if (TYPE_HAS_CONSTRUCTOR (BINFO_TYPE (child))) { /* ...and the last shall come first... */ ! base_init_list = maybe_fixup_vptrs (type, child, base_init_list); ! base_init_list = tree_cons (NULL_TREE, child, base_init_list); continue; } ! if ((blist = CLASSTYPE_BASE_INIT_LIST (BINFO_TYPE (child))) == NULL_TREE) /* Nothing to initialize. */ continue; --- 1343,1362 ---- for (i = n_baseclasses-1; i >= 0; i--) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); tree blist; /* Don't initialize virtual baseclasses this way. */ ! if (TREE_VIA_VIRTUAL (base_binfo)) continue; ! if (TYPE_HAS_CONSTRUCTOR (BINFO_TYPE (base_binfo))) { /* ...and the last shall come first... */ ! base_init_list = maybe_fixup_vptrs (type, base_binfo, base_init_list); ! base_init_list = tree_cons (NULL_TREE, base_binfo, base_init_list); continue; } ! if ((blist = CLASSTYPE_BASE_INIT_LIST (BINFO_TYPE (base_binfo))) == NULL_TREE) /* Nothing to initialize. */ continue; *************** *** 1363,1367 **** /* ...ditto... */ ! base_init_list = maybe_fixup_vptrs (type, child, base_init_list); /* This is normally true for single inheritance. --- 1363,1367 ---- /* ...ditto... */ ! base_init_list = maybe_fixup_vptrs (type, base_binfo, base_init_list); /* This is normally true for single inheritance. *************** *** 1371,1375 **** if (TREE_VALUE (blist) && TREE_CODE (TREE_VALUE (blist)) == TREE_VEC ! && tree_int_cst_equal (BINFO_OFFSET (child), BINFO_OFFSET (TREE_VALUE (blist)))) { --- 1371,1375 ---- if (TREE_VALUE (blist) && TREE_CODE (TREE_VALUE (blist)) == TREE_VEC ! && tree_int_cst_equal (BINFO_OFFSET (base_binfo), BINFO_OFFSET (TREE_VALUE (blist)))) { *************** *** 1405,1411 **** an explicit `blist'. */ if (base_init_list) ! base_init_list = tree_cons (NULL_TREE, child, base_init_list); else ! base_init_list = CLASSTYPE_BINFO_AS_LIST (BINFO_TYPE (child)); } } --- 1405,1411 ---- an explicit `blist'. */ if (base_init_list) ! base_init_list = tree_cons (NULL_TREE, base_binfo, base_init_list); else ! base_init_list = CLASSTYPE_BINFO_AS_LIST (BINFO_TYPE (base_binfo)); } } *************** *** 1463,1468 **** for (i = 0; i < n_baseclasses; i++) { ! tree child = TREE_VEC_ELT (binfos, i); ! tree basetype = BINFO_TYPE (child); /* If the type of basetype is incomplete, then --- 1463,1468 ---- for (i = 0; i < n_baseclasses; i++) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); ! tree basetype = BINFO_TYPE (base_binfo); /* If the type of basetype is incomplete, then *************** *** 1483,1493 **** } - if (TYPE_WRAP_TYPE (t) == NULL_TREE) - TYPE_WRAP_TYPE (t) = TYPE_WRAP_TYPE (basetype); - else if (TYPE_WRAP_TYPE (basetype) - && TYPE_WRAP_TYPE (t) != TYPE_WRAP_TYPE (basetype)) - /* Must have its own. */ - TYPE_WRAP_TYPE (t) = error_mark_node; - if (TYPE_NEEDS_DESTRUCTOR (basetype)) b->members_need_dtors = 1; --- 1483,1486 ---- *************** *** 1515,1540 **** TYPE_OVERLOADS_ARROW (t) |= TYPE_OVERLOADS_ARROW (basetype); ! if (! TREE_VIA_VIRTUAL (child) ! && ! BINFO_OFFSET_ZEROP (child) ! && BINFO_BASETYPES (child)) { ! tree child_binfos = BINFO_BASETYPES (child); tree chain = NULL_TREE; int j; ! /* Now unshare the structure beneath CHILD. */ ! for (j = TREE_VEC_LENGTH (child_binfos)-1; j >= 0; j--) { ! tree child_child = TREE_VEC_ELT (child_binfos, j); ! if (! TREE_VIA_VIRTUAL (child_child)) ! TREE_VEC_ELT (child_binfos, j) ! = make_binfo (BINFO_OFFSET (child_child), ! BINFO_TYPE (child_child), ! BINFO_VTABLE (child_child), ! BINFO_VIRTUALS (child_child), chain); ! chain = TREE_VEC_ELT (child_binfos, j); ! TREE_VIA_PUBLIC (chain) = TREE_VIA_PUBLIC (child_child); } --- 1508,1534 ---- TYPE_OVERLOADS_ARROW (t) |= TYPE_OVERLOADS_ARROW (basetype); ! if (! TREE_VIA_VIRTUAL (base_binfo) ! && ! BINFO_OFFSET_ZEROP (base_binfo) ! && BINFO_BASETYPES (base_binfo)) { ! tree base_binfos = BINFO_BASETYPES (base_binfo); tree chain = NULL_TREE; int j; ! /* Now unshare the structure beneath BASE_BINFO. */ ! for (j = TREE_VEC_LENGTH (base_binfos)-1; j >= 0; j--) { ! tree base_base_binfo = TREE_VEC_ELT (base_binfos, j); ! if (! TREE_VIA_VIRTUAL (base_base_binfo)) ! TREE_VEC_ELT (base_binfos, j) ! = make_binfo (BINFO_OFFSET (base_base_binfo), ! BINFO_TYPE (base_base_binfo), ! BINFO_VTABLE (base_base_binfo), ! BINFO_VIRTUALS (base_base_binfo), chain); ! chain = TREE_VEC_ELT (base_binfos, j); ! TREE_VIA_PUBLIC (chain) = TREE_VIA_PUBLIC (base_base_binfo); ! TREE_VIA_PROTECTED (chain) = TREE_VIA_PROTECTED (base_base_binfo); } *************** *** 1541,1548 **** /* Completely unshare potentially shared data, and update what is ours. */ ! propagate_binfo_offsets (child, BINFO_OFFSET (child)); } ! if (! TREE_VIA_VIRTUAL (child)) CLASSTYPE_N_SUPERCLASSES (t) += 1; --- 1535,1542 ---- /* Completely unshare potentially shared data, and update what is ours. */ ! propagate_binfo_offsets (base_binfo, BINFO_OFFSET (base_binfo)); } ! if (! TREE_VIA_VIRTUAL (base_binfo)) CLASSTYPE_N_SUPERCLASSES (t) += 1; *************** *** 1554,1558 **** /* Don't borrow virtuals from virtual baseclasses. */ ! if (TREE_VIA_VIRTUAL (child)) continue; --- 1548,1552 ---- /* Don't borrow virtuals from virtual baseclasses. */ ! if (TREE_VIA_VIRTUAL (base_binfo)) continue; *************** *** 1576,1580 **** { tree value = VF_BASETYPE_VALUE (vfields); ! b->vfields = tree_cons (child, value, b->vfields); if (DECL_NAME (CLASSTYPE_VFIELD (value)) == DECL_NAME (CLASSTYPE_VFIELD (basetype))) --- 1570,1574 ---- { tree value = VF_BASETYPE_VALUE (vfields); ! b->vfields = tree_cons (base_binfo, value, b->vfields); if (DECL_NAME (CLASSTYPE_VFIELD (value)) == DECL_NAME (CLASSTYPE_VFIELD (basetype))) *************** *** 1714,1718 **** { tree this_binfo = TREE_VEC_ELT (binfos, j); ! if (DERIVED_FROM_P (basetype, this_binfo)) { tree virtuals = TREE_CHAIN (BINFO_VIRTUALS (vbases)); --- 1708,1712 ---- { tree this_binfo = TREE_VEC_ELT (binfos, j); ! if (UNIQUELY_DERIVED_FROM_P (basetype, this_binfo)) { tree virtuals = TREE_CHAIN (BINFO_VIRTUALS (vbases)); *************** *** 1765,1769 **** tree fntype = TREE_TYPE (*tmp); tree return_type = TREE_TYPE (fntype); ! assert (TREE_CODE (fntype) == METHOD_TYPE); if (typecode_p (return_type, POINTER_TYPE)) --- 1759,1763 ---- tree fntype = TREE_TYPE (*tmp); tree return_type = TREE_TYPE (fntype); ! my_friendly_assert (TREE_CODE (fntype) == METHOD_TYPE, 171); if (typecode_p (return_type, POINTER_TYPE)) *************** *** 1877,1884 **** if (*testp == NULL_TREE) testp++; ! while ((int)testp < (int)obstack_next_free (&class_obstack) && DECL_NAME (*testp) != fn_name) testp++; ! if ((int)testp < (int)obstack_next_free (&class_obstack)) { tree x, prev_x; --- 1871,1880 ---- if (*testp == NULL_TREE) testp++; ! while (((HOST_WIDE_INT) testp ! < (HOST_WIDE_INT) obstack_next_free (&class_obstack)) && DECL_NAME (*testp) != fn_name) testp++; ! if ((HOST_WIDE_INT) testp ! < (HOST_WIDE_INT) obstack_next_free (&class_obstack)) { tree x, prev_x; *************** *** 1932,1936 **** tree binfos = BINFO_BASETYPES (TYPE_BINFO (t)); for (i = 0; i < n_baseclasses; i++) ! if (TREE_VIA_PUBLIC (TREE_VEC_ELT (binfos, i))) { nonprivate_method = 1; --- 1928,1933 ---- tree binfos = BINFO_BASETYPES (TYPE_BINFO (t)); for (i = 0; i < n_baseclasses; i++) ! if (TREE_VIA_PUBLIC (TREE_VEC_ELT (binfos, i)) ! || TREE_VIA_PROTECTED (TREE_VEC_ELT (binfos, i))) { nonprivate_method = 1; *************** *** 2243,2247 **** error ("redefinition of `struct %s'", err_name); else ! assert (0); popclass (0); return t; --- 2240,2244 ---- error ("redefinition of `struct %s'", err_name); else ! my_friendly_assert (0, 172); popclass (0); return t; *************** *** 2385,2393 **** { t = DECL_NAME (TREE_PURPOSE (IDENTIFIER_TEMPLATE (t))); ! assert (t == d); continue; } else if (IDENTIFIER_CLASS_VALUE (t)) ! assert (TREE_TYPE (DECL_NAME (d)) == TREE_TYPE (DECL_NAME (TREE_TYPE (t)))); else abort (); --- 2382,2392 ---- { t = DECL_NAME (TREE_PURPOSE (IDENTIFIER_TEMPLATE (t))); ! my_friendly_assert (t == d, 173); continue; } else if (IDENTIFIER_CLASS_VALUE (t)) ! my_friendly_assert (TREE_TYPE (DECL_NAME (d)) ! == TREE_TYPE (DECL_NAME (TREE_TYPE (t))), ! 174); else abort (); *************** *** 2497,2519 **** if (TREE_CODE (x) == FIELD_DECL) { ! /* Never let anything with uninheritable virtuals ! make it through without complaint. */ ! if (TYPE_LANG_SPECIFIC (TREE_TYPE (x)) ! && CLASSTYPE_ABSTRACT_VIRTUALS (TREE_TYPE (x))) ! abstract_virtuals_error (x, TREE_TYPE (x)); ! ! if (TYPE_LANG_SPECIFIC (TREE_TYPE (x))) { ! if (TYPE_HAS_DEFAULT_CONSTRUCTOR (TREE_TYPE (x))) ! needs_default_ctor = 1; ! if (TYPE_GETS_CONST_INIT_REF (TREE_TYPE (x))) ! needs_const_ctor = 1; ! else if (TYPE_GETS_INIT_REF (TREE_TYPE (x))) ! cant_have_const_ctor = 1; } - else if (DECL_INITIAL (x) == NULL_TREE - && (TYPE_HAS_CONSTRUCTOR (TREE_TYPE (x)) - || TREE_CODE (TREE_TYPE (x)) == REFERENCE_TYPE)) - cant_have_default_ctor = 1; /* If any field is const, the structure type is pseudo-const. */ --- 2496,2522 ---- if (TREE_CODE (x) == FIELD_DECL) { ! /* If the field has a bogus type, don't bother with it. */ ! if (TREE_TYPE (x) != error_mark_node) { ! /* Never let anything with uninheritable virtuals ! make it through without complaint. */ ! if (TYPE_LANG_SPECIFIC (TREE_TYPE (x)) ! && CLASSTYPE_ABSTRACT_VIRTUALS (TREE_TYPE (x))) ! abstract_virtuals_error (x, TREE_TYPE (x)); ! ! if (TYPE_LANG_SPECIFIC (TREE_TYPE (x))) ! { ! if (TYPE_HAS_DEFAULT_CONSTRUCTOR (TREE_TYPE (x))) ! needs_default_ctor = 1; ! if (TYPE_GETS_CONST_INIT_REF (TREE_TYPE (x))) ! needs_const_ctor = 1; ! else if (TYPE_GETS_INIT_REF (TREE_TYPE (x))) ! cant_have_const_ctor = 1; ! } ! else if (DECL_INITIAL (x) == NULL_TREE ! && (TYPE_HAS_CONSTRUCTOR (TREE_TYPE (x)) ! || TREE_CODE (TREE_TYPE (x)) == REFERENCE_TYPE)) ! cant_have_default_ctor = 1; } /* If any field is const, the structure type is pseudo-const. */ *************** *** 2567,2572 **** if (DECL_INITIAL (x) && pedantic && TREE_TYPE (x) != integer_type_node ! && TREE_TYPE (x) != unsigned_type_node) ! warning_with_decl (x, "bit-field `%s' type invalid in ANSI C"); /* Detect and ignore out of range field width. */ --- 2570,2576 ---- if (DECL_INITIAL (x) && pedantic && TREE_TYPE (x) != integer_type_node ! && TREE_TYPE (x) != unsigned_type_node ! && TREE_CODE (TREE_TYPE (x)) != ENUMERAL_TYPE) ! warning_with_decl (x, "bit-field `%s' type invalid in ANSI C++"); /* Detect and ignore out of range field width. */ *************** *** 2808,2812 **** else if (last_x) { ! assert (TREE_CHAIN (last_x) == 0); TREE_CHAIN (last_x) = vfield; last_x = vfield; --- 2812,2816 ---- else if (last_x) { ! my_friendly_assert (TREE_CHAIN (last_x) == 0, 175); TREE_CHAIN (last_x) = vfield; last_x = vfield; *************** *** 2963,2967 **** a virtual baseclass. */ tree base_fndecls = DECL_VINDEX (TREE_PURPOSE (pending_hard_virtuals)); ! assert (base_fndecls != error_mark_node); while (base_fndecls) { --- 2967,2971 ---- a virtual baseclass. */ tree base_fndecls = DECL_VINDEX (TREE_PURPOSE (pending_hard_virtuals)); ! my_friendly_assert (base_fndecls != error_mark_node, 176); while (base_fndecls) { *************** *** 3388,3392 **** #endif - #if 0 /* but we NEED all those types! --Chip */ /* If the type has methods, we want to think about cutting down the amount of symbol table stuff we output. The value stored in --- 3392,3395 ---- *************** *** 3413,3417 **** else if (CLASSTYPE_INTERFACE_ONLY (t)) DECL_IGNORED_P (TYPE_NAME (t)) = 1; - #endif /* never --Chip */ /* Finish debugging output for this type. */ --- 3416,3419 ---- *************** *** 3892,3896 **** case CONSTRUCTOR: case BUFFER_REF: ! assert (0); return error_mark_node; --- 3894,3898 ---- case CONSTRUCTOR: case BUFFER_REF: ! my_friendly_assert (0, 177); return error_mark_node; *************** *** 3919,3923 **** if (function == error_mark_node) return error_mark_node; ! assert (TREE_CODE (function) == FUNCTION_DECL); if (DECL_VINDEX (function)) { --- 3921,3925 ---- if (function == error_mark_node) return error_mark_node; ! my_friendly_assert (TREE_CODE (function) == FUNCTION_DECL, 185); if (DECL_VINDEX (function)) { *************** *** 3934,3940 **** } ! assert (TREE_CODE (field) == FIELD_DECL); ! assert (!(TREE_CODE (TREE_TYPE (field)) == FUNCTION_TYPE ! || TREE_CODE (TREE_TYPE (field)) == METHOD_TYPE)); TREE_TYPE (rhs) = lhstype; --- 3936,3943 ---- } ! my_friendly_assert (TREE_CODE (field) == FIELD_DECL, 178); ! my_friendly_assert (!(TREE_CODE (TREE_TYPE (field)) == FUNCTION_TYPE ! || TREE_CODE (TREE_TYPE (field)) == METHOD_TYPE), ! 179); TREE_TYPE (rhs) = lhstype; *************** *** 4009,4013 **** if (globals > 0) { ! assert (TREE_CODE (TREE_VALUE (rhs)) == FUNCTION_DECL); elem = rhs; while (elem) --- 4012,4017 ---- if (globals > 0) { ! my_friendly_assert (TREE_CODE (TREE_VALUE (rhs)) == FUNCTION_DECL, ! 180); elem = rhs; while (elem) *************** *** 4054,4061 **** else { ! assert (TREE_CHAIN (rhs) == NULL_TREE); if (TREE_CODE (TREE_VALUE (rhs)) == TREE_LIST) rhs = TREE_VALUE (rhs); ! assert (TREE_CODE (TREE_VALUE (rhs)) == FUNCTION_DECL); } --- 4058,4066 ---- else { ! my_friendly_assert (TREE_CHAIN (rhs) == NULL_TREE, 181); if (TREE_CODE (TREE_VALUE (rhs)) == TREE_LIST) rhs = TREE_VALUE (rhs); ! my_friendly_assert (TREE_CODE (TREE_VALUE (rhs)) == FUNCTION_DECL, ! 182); } *************** *** 4113,4117 **** case CALL_EXPR: /* This is too hard for now. */ ! assert (0); return error_mark_node; --- 4118,4122 ---- case CALL_EXPR: /* This is too hard for now. */ ! my_friendly_assert (0, 183); return error_mark_node; *************** *** 4223,4227 **** case ENTRY_VALUE_EXPR: ! assert (0); return error_mark_node; --- 4228,4232 ---- case ENTRY_VALUE_EXPR: ! my_friendly_assert (0, 184); return error_mark_node; *************** *** 4230,4234 **** default: ! assert (0); return error_mark_node; } --- 4235,4239 ---- default: ! my_friendly_assert (0, 185); return error_mark_node; } diff -rc2N gcc-2.3.1/cp-cvt.c gcc-2.3.2/cp-cvt.c *** gcc-2.3.1/cp-cvt.c Thu Sep 24 21:48:12 1992 --- gcc-2.3.2/cp-cvt.c Thu Nov 12 20:50:31 1992 *************** *** 27,37 **** #include "config.h" #include "tree.h" #include "cp-tree.h" #include "cp-class.h" - #include "assert.h" #define NULL 0 ! extern int flag_int_enum_equivalence; /* Change of width--truncation and extension of integers or reals-- --- 27,37 ---- #include "config.h" #include "tree.h" + #include "flags.h" #include "cp-tree.h" #include "cp-class.h" #define NULL 0 ! extern void warn_for_assignment (); /* Change of width--truncation and extension of integers or reals-- *************** *** 121,125 **** } ! assert (form != OFFSET_TYPE); if (IS_AGGR_TYPE (intype)) --- 121,125 ---- } ! my_friendly_assert (form != OFFSET_TYPE, 186); if (IS_AGGR_TYPE (intype)) *************** *** 217,221 **** tree binfo = NULL_TREE; ! assert (TREE_CODE (type) == REFERENCE_TYPE); if (flags != 0 && TYPE_MAIN_VARIANT (argtype) != TYPE_MAIN_VARIANT (target_type) --- 217,221 ---- tree binfo = NULL_TREE; ! my_friendly_assert (TREE_CODE (type) == REFERENCE_TYPE, 187); if (flags != 0 && TYPE_MAIN_VARIANT (argtype) != TYPE_MAIN_VARIANT (target_type) *************** *** 330,334 **** } /* we should have farmed out member pointers above. */ ! assert (0); case COMPONENT_REF: --- 330,334 ---- } /* we should have farmed out member pointers above. */ ! my_friendly_assert (0, 188); case COMPONENT_REF: *************** *** 538,546 **** and that temporaries may be created. Make sure the use of user-defined conversion operators is un-ambiguous. ! Otherwise, DECL is a _DECL node which can be used in error reporting. */ tree ! convert_to_reference (decl, reftype, expr, strict, flags) tree decl; tree reftype, expr; int strict, flags; { --- 538,553 ---- and that temporaries may be created. Make sure the use of user-defined conversion operators is un-ambiguous. ! Otherwise, DECL is a _DECL node which can be used in error reporting. ! ! FNDECL, PARMNUM, and ERRTYPE are only used when checking for use of ! volatile or const references where they aren't desired. */ tree ! convert_to_reference (decl, reftype, expr, fndecl, parmnum, ! errtype, strict, flags) tree decl; tree reftype, expr; + tree fndecl; + int parmnum; + char *errtype; int strict, flags; { *************** *** 548,551 **** --- 555,559 ---- register tree intype = TREE_TYPE (expr); register enum tree_code form = TREE_CODE (intype); + tree rval = NULL_TREE; if (form == REFERENCE_TYPE) *************** *** 557,566 **** if (IS_AGGR_TYPE (intype)) { ! tree rval = build_type_conversion (CONVERT_EXPR, reftype, expr, 1); if (rval) { if (rval == error_mark_node) ! error ("ambiguous pointer conversion"); ! return rval; } else if (type != intype --- 565,576 ---- if (IS_AGGR_TYPE (intype)) { ! rval = build_type_conversion (CONVERT_EXPR, reftype, expr, 1); if (rval) { if (rval == error_mark_node) ! { ! error ("ambiguous pointer conversion"); ! return rval; ! } } else if (type != intype *************** *** 571,575 **** if (TYPE_NEEDS_DESTRUCTOR (type)) { ! rval = convert_to_reference (NULL_TREE, reftype, rval, strict, flags); } else --- 581,585 ---- if (TYPE_NEEDS_DESTRUCTOR (type)) { ! rval = convert_to_reference (NULL_TREE, reftype, rval, NULL_TREE, -1, (char *)NULL, strict, flags); } else *************** *** 579,585 **** rval = build (COMPOUND_EXPR, reftype, rval, convert_to_reference (NULL_TREE, reftype, decl, strict, flags)); } - return rval; } --- 589,595 ---- rval = build (COMPOUND_EXPR, reftype, rval, convert_to_reference (NULL_TREE, reftype, decl, + NULL_TREE, -1, (char *)NULL, strict, flags)); } } *************** *** 610,613 **** --- 620,642 ---- && int_size_in_bytes (type) == int_size_in_bytes (intype))) { + /* Section 13. */ + /* Since convert_for_initialization didn't call convert_for_assignment, + we have to do this checking here. XXX We should have a common + routine between here and convert_for_assignment. */ + if (TREE_CODE (TREE_TYPE (expr)) == REFERENCE_TYPE) + { + register tree ttl = TREE_TYPE (reftype); + register tree ttr = TREE_TYPE (TREE_TYPE (expr)); + + if (! TYPE_READONLY (ttl) && TYPE_READONLY (ttr)) + warn_for_assignment ("%s of non-`const &' reference from `const &'", + "reference to const given for argument %d of `%s'", + errtype, fndecl, parmnum, pedantic); + if (! TYPE_VOLATILE (ttl) && TYPE_VOLATILE (ttr)) + warn_for_assignment ("%s of non-`volatile &' reference from `volatile &'", + "reference to volatile given for argument %d of `%s'", + errtype, fndecl, parmnum, pedantic); + } + /* If EXPR is of aggregate type, and is really a CALL_EXPR, then we don't need to convert it to reference type if *************** *** 651,656 **** tree init = build_method_call (NULL_TREE, constructor_name (type), build_tree_list (NULL_TREE, expr), ! TYPE_BINFO (type), LOOKUP_NORMAL); ! tree rval; if (init == error_mark_node) --- 680,696 ---- tree init = build_method_call (NULL_TREE, constructor_name (type), build_tree_list (NULL_TREE, expr), ! TYPE_BINFO (type), LOOKUP_NO_CONVERSION); ! tree rval1; ! ! if (init != error_mark_node) ! if (rval) ! { ! error ("both constructor and type conversion operator apply"); ! return error_mark_node; ! } ! ! init = build_method_call (NULL_TREE, constructor_name (type), ! build_tree_list (NULL_TREE, expr), ! TYPE_BINFO (type), LOOKUP_NORMAL); if (init == error_mark_node) *************** *** 662,666 **** } ! assert (form != OFFSET_TYPE); /* This is in two pieces for now, because pointer to first becomes --- 702,706 ---- } ! my_friendly_assert (form != OFFSET_TYPE, 189); /* This is in two pieces for now, because pointer to first becomes *************** *** 708,712 **** { register enum tree_code form = TREE_CODE (TREE_TYPE (expr)); - extern int flag_float_store; if (form == REAL_TYPE) --- 748,751 ---- *************** *** 717,721 **** return build1 (FLOAT_EXPR, type, expr); ! assert (form != OFFSET_TYPE); if (form == POINTER_TYPE) --- 756,760 ---- return build1 (FLOAT_EXPR, type, expr); ! my_friendly_assert (form != OFFSET_TYPE, 190); if (form == POINTER_TYPE) *************** *** 776,781 **** && form == INTEGER_TYPE) { - extern int flag_pedantic_errors; - if (pedantic) pedwarn ("anachronistic conversion from integer type to enumeral type `%s'", --- 815,818 ---- *************** *** 825,842 **** case RSHIFT_EXPR: /* We can pass truncation down through right shifting ! when the shift count is a negative constant. */ ! if (TREE_CODE (TREE_OPERAND (expr, 1)) != INTEGER_CST ! || TREE_INT_CST_LOW (TREE_OPERAND (expr, 1)) > 0) ! break; ! goto trunc1; case LSHIFT_EXPR: /* We can pass truncation down through left shifting ! when the shift count is a positive constant. */ ! if (TREE_CODE (TREE_OPERAND (expr, 1)) != INTEGER_CST ! || TREE_INT_CST_LOW (TREE_OPERAND (expr, 1)) < 0) ! break; ! /* In this case, shifting is like multiplication. */ ! goto trunc1; case MAX_EXPR: --- 862,891 ---- case RSHIFT_EXPR: /* We can pass truncation down through right shifting ! when the shift count is a nonpositive constant. */ ! if (TREE_CODE (TREE_OPERAND (expr, 1)) == INTEGER_CST ! && tree_int_cst_lt (TREE_OPERAND (expr, 1), integer_one_node)) ! goto trunc1; ! break; case LSHIFT_EXPR: /* We can pass truncation down through left shifting ! when the shift count is a nonnegative constant. */ ! if (TREE_CODE (TREE_OPERAND (expr, 1)) == INTEGER_CST ! && ! tree_int_cst_lt (TREE_OPERAND (expr, 1), integer_zero_node) ! && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST) ! { ! /* If shift count is less than the width of the truncated type, ! really shift. */ ! if (tree_int_cst_lt (TREE_OPERAND (expr, 1), TYPE_SIZE (type))) ! /* In this case, shifting is like multiplication. */ ! goto trunc1; ! else ! /* If it is >= that width, result is zero. ! Handling this with trunc1 would give the wrong result: ! (int) ((long long) a << 32) is well defined (as 0) ! but (int) a << 32 is undefined and would get a warning. */ ! return convert_to_integer (type, integer_zero_node); ! } ! break; case MAX_EXPR: *************** *** 1282,1286 **** return error_mark_node; ! assert (!integer_zerop (expr)); if (IS_AGGR_TYPE (type) --- 1331,1335 ---- return error_mark_node; ! my_friendly_assert (!integer_zerop (expr), 191); if (IS_AGGR_TYPE (type) *************** *** 1386,1390 **** /* C++ */ if (code == REFERENCE_TYPE) ! return fold (convert_to_reference (error_mark_node, type, e, -1, LOOKUP_NORMAL)); else if (TREE_CODE (TREE_TYPE (e)) == REFERENCE_TYPE) e = convert_from_reference (e); --- 1435,1442 ---- /* C++ */ if (code == REFERENCE_TYPE) ! return fold (convert_to_reference (error_mark_node, ! type, e, ! NULL_TREE, -1, (char *)NULL, ! -1, LOOKUP_NORMAL)); else if (TREE_CODE (TREE_TYPE (e)) == REFERENCE_TYPE) e = convert_from_reference (e); *************** *** 1427,1431 **** if (TYPE_HAS_CONSTRUCTOR (type)) { ! tree rval = build_method_call (NULL_TREE, constructor_name (type), build_tree_list (NULL_TREE, e), TYPE_BINFO (type), conversion ? LOOKUP_NO_CONVERSION : 0); --- 1479,1485 ---- if (TYPE_HAS_CONSTRUCTOR (type)) { ! tree rval = build_method_call (NULL_TREE, constructor_name (type), ! build_tree_list (NULL_TREE, e), ! TYPE_BINFO (type), conversion ? LOOKUP_NO_CONVERSION : 0); *************** *** 1517,1521 **** if (code == REFERENCE_TYPE) ! return fold (convert_to_reference (0, type, e, -1, 0)); else if (TREE_CODE (TREE_TYPE (e)) == REFERENCE_TYPE) e = convert_from_reference (e); --- 1571,1577 ---- if (code == REFERENCE_TYPE) ! return fold (convert_to_reference (0, type, e, ! NULL_TREE, -1, (char *)NULL, ! -1, 0)); else if (TREE_CODE (TREE_TYPE (e)) == REFERENCE_TYPE) e = convert_from_reference (e); diff -rc2N gcc-2.3.1/cp-decl.c gcc-2.3.2/cp-decl.c *** gcc-2.3.1/cp-decl.c Sat Oct 17 17:46:06 1992 --- gcc-2.3.2/cp-decl.c Mon Nov 23 20:47:34 1992 *************** *** 35,39 **** #include "cp-lex.h" #include - #include "assert.h" #include "obstack.h" --- 35,38 ---- *************** *** 76,83 **** #endif - #ifndef WCHAR_TYPE_SIZE - #define WCHAR_TYPE_SIZE INT_TYPE_SIZE - #endif - #ifndef WCHAR_UNSIGNED #define WCHAR_UNSIGNED 0 --- 75,78 ---- *************** *** 452,455 **** --- 447,456 ---- extern int flag_short_double; + /* Nonzero means handle things in ANSI, instead of GNU fashion. This + flag should be tested for language behavior that's different between + ANSI and GNU, but not so horrible as to merit a PEDANTIC label. */ + + extern int flag_ansi; + /* Pointers to the base and current top of the language name stack. */ *************** *** 659,668 **** if (++n < 3) return; ! assert (global_binding_level != 0); ! assert (current_binding_level != 0); for (b = current_binding_level; b != global_binding_level; b = b->level_chain) { ! assert (b->level_chain != 0); ! assert (b->depth == 1 + b->level_chain->depth); } if (class_binding_level) --- 660,669 ---- if (++n < 3) return; ! my_friendly_assert (global_binding_level != 0, 126); ! my_friendly_assert (current_binding_level != 0, 127); for (b = current_binding_level; b != global_binding_level; b = b->level_chain) { ! my_friendly_assert (b->level_chain != 0, 128); ! my_friendly_assert (b->depth == 1 + b->level_chain->depth, 129); } if (class_binding_level) *************** *** 671,679 **** b = b->level_chain) { ! assert (b->level_chain != 0); ! assert (b->depth == 1 + b->level_chain->depth); } ! assert (global_binding_level->depth == 0); ! assert (global_binding_level->level_chain == 0); return; } --- 672,680 ---- b = b->level_chain) { ! my_friendly_assert (b->level_chain != 0, 130); ! my_friendly_assert (b->depth == 1 + b->level_chain->depth, 131); } ! my_friendly_assert (global_binding_level->depth == 0, 132); ! my_friendly_assert (global_binding_level->level_chain == 0, 133); return; } *************** *** 868,872 **** if (current_binding_level == global_binding_level) ! assert (named_labels == NULL_TREE); /* Reuse or create a struct for this binding level. */ --- 869,873 ---- if (current_binding_level == global_binding_level) ! my_friendly_assert (named_labels == NULL_TREE, 134); /* Reuse or create a struct for this binding level. */ *************** *** 1088,1093 **** if (DECL_INITIAL (label) == 0) { ! error ("label `%s' used somewhere above but not defined", ! IDENTIFIER_POINTER (DECL_NAME (label))); /* Avoid crashing later. */ define_label (input_filename, 1, DECL_NAME (label)); --- 1089,1093 ---- if (DECL_INITIAL (label) == 0) { ! error_with_decl (label, "label `%s' used but not defined"); /* Avoid crashing later. */ define_label (input_filename, 1, DECL_NAME (label)); *************** *** 1526,1530 **** if (id) { ! assert (TREE_CODE (id) == IDENTIFIER_NODE); TREE_VEC_ELT (binding, 0) = id; TREE_VEC_ELT (binding, 1) = IDENTIFIER_TYPE_VALUE (id); --- 1526,1530 ---- if (id) { ! my_friendly_assert (TREE_CODE (id) == IDENTIFIER_NODE, 135); TREE_VEC_ELT (binding, 0) = id; TREE_VEC_ELT (binding, 1) = IDENTIFIER_TYPE_VALUE (id); *************** *** 1664,1673 **** tree decl, classname, name, type; { ! assert (TREE_CODE (decl) == TYPE_DECL); if (classname != 0) { char *buf; ! assert (TREE_CODE (classname) == IDENTIFIER_NODE); ! assert (TREE_CODE (name) == IDENTIFIER_NODE); buf = (char *) alloca (4 + IDENTIFIER_LENGTH (classname) + IDENTIFIER_LENGTH (name)); --- 1664,1673 ---- tree decl, classname, name, type; { ! my_friendly_assert (TREE_CODE (decl) == TYPE_DECL, 136); if (classname != 0) { char *buf; ! my_friendly_assert (TREE_CODE (classname) == IDENTIFIER_NODE, 137); ! my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 138); buf = (char *) alloca (4 + IDENTIFIER_LENGTH (classname) + IDENTIFIER_LENGTH (name)); *************** *** 1760,1763 **** --- 1760,1764 ---- #else d = build_decl (TYPE_DECL, name, type); + DECL_ASSEMBLER_NAME (d) = get_identifier (build_overload_name (type, 1, 1)); #endif /* mark the binding layer marker as internal. (mrs) */ *************** *** 1938,1941 **** --- 1939,1944 ---- if (TREE_TYPE (newdecl) == error_mark_node) types_match = TREE_TYPE (olddecl) == error_mark_node; + else if (TREE_TYPE (olddecl) == NULL_TREE) + types_match = TREE_TYPE (newdecl) == NULL_TREE; else types_match = comptypes (TREE_TYPE (newdecl), TREE_TYPE (olddecl), 1); *************** *** 2194,2198 **** */ #if 0 ! assert (DECL_IGNORED_P (olddecl) == DECL_IGNORED_P (newdecl)); #endif } --- 2197,2201 ---- */ #if 0 ! my_friendly_assert (DECL_IGNORED_P (olddecl) == DECL_IGNORED_P (newdecl), 139); #endif } *************** *** 2269,2274 **** if (DECL_INITIAL (newdecl) == 0) DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl); ! /* Keep the old rtl since we can safely use it. */ ! DECL_RTL (newdecl) = DECL_RTL (olddecl); } /* If cannot merge, then use the new type and qualifiers, --- 2272,2281 ---- if (DECL_INITIAL (newdecl) == 0) DECL_INITIAL (newdecl) = DECL_INITIAL (olddecl); ! /* Keep the old rtl since we can safely use it, unless it's the ! call to abort() used for abstract virtuals. */ ! if ((DECL_LANG_SPECIFIC (olddecl) ! && !DECL_ABSTRACT_VIRTUAL_P (olddecl)) ! || DECL_RTL (olddecl) != DECL_RTL (abort_fndecl)) ! DECL_RTL (newdecl) = DECL_RTL (olddecl); } /* If cannot merge, then use the new type and qualifiers, *************** *** 2388,2393 **** function_size - sizeof (struct tree_common)); ! if ((char *)newdecl == obstack_next_free (&permanent_obstack) ! - (function_size + sizeof (struct lang_decl))) { DECL_MAIN_VARIANT (newdecl) = olddecl; --- 2395,2402 ---- function_size - sizeof (struct tree_common)); ! if ((char *)newdecl + ((function_size + sizeof (struct lang_decl) ! + obstack_alignment_mask (&permanent_obstack)) ! & ~ obstack_alignment_mask (&permanent_obstack)) ! == obstack_next_free (&permanent_obstack)) { DECL_MAIN_VARIANT (newdecl) = olddecl; *************** *** 2514,2519 **** else name = DECL_NAME (x); ! #endif if (name) { --- 2523,2533 ---- else name = DECL_NAME (x); ! #else ! /* Type are looked up using the DECL_NAME, as that is what the rest of the ! compiler wants to use. */ ! if (TREE_CODE (x) == TYPE_DECL) ! name = DECL_NAME (x); #endif + if (name) { *************** *** 2612,2616 **** } } ! assert (TREE_CODE (name) == TYPE_DECL); if (DECL_NAME (name) && !DECL_NESTED_TYPENAME (name)) set_nested_typename (x, current_class_name, DECL_NAME (name), --- 2626,2630 ---- } } ! my_friendly_assert (TREE_CODE (name) == TYPE_DECL, 140); if (DECL_NAME (name) && !DECL_NESTED_TYPENAME (name)) set_nested_typename (x, current_class_name, DECL_NAME (name), *************** *** 2735,2741 **** { DECL_INLINE (x) = DECL_INLINE (oldglobal); ! DECL_INITIAL (x) = DECL_INITIAL (oldglobal); DECL_SAVED_INSNS (x) = DECL_SAVED_INSNS (oldglobal); DECL_ARGUMENTS (x) = DECL_ARGUMENTS (oldglobal); } /* Inner extern decl is built-in if global one is. */ --- 2749,2759 ---- { DECL_INLINE (x) = DECL_INLINE (oldglobal); ! DECL_INITIAL (x) = (current_function_decl == oldglobal ! ? 0 : DECL_INITIAL (oldglobal)); DECL_SAVED_INSNS (x) = DECL_SAVED_INSNS (oldglobal); DECL_ARGUMENTS (x) = DECL_ARGUMENTS (oldglobal); + DECL_RESULT (x) = DECL_RESULT (oldglobal); + TREE_ASM_WRITTEN (x) = TREE_ASM_WRITTEN (oldglobal); + DECL_ABSTRACT_ORIGIN (x) = oldglobal; } /* Inner extern decl is built-in if global one is. */ *************** *** 2885,2889 **** else { ! assert (*ptr == NULL_TREE || *ptr == newval); *ptr = newval; } --- 2903,2913 ---- else { ! #if 0 ! /* Disabled this 11/10/92, since there are many cases which ! behave just fine when *ptr doesn't satisfy either of these. ! For example, nested classes declared as friends of their enclosing ! class will not meet this criteria. (bpk) */ ! my_friendly_assert (*ptr == NULL_TREE || *ptr == newval, 141); ! #endif *ptr = newval; } *************** *** 2935,2939 **** tree list; { ! assert (TREE_CODE (list) == TREE_LIST); /* Don't commit caller to seeing them as globals. */ --- 2959,2963 ---- tree list; { ! my_friendly_assert (TREE_CODE (list) == TREE_LIST, 142); /* Don't commit caller to seeing them as globals. */ *************** *** 3013,3017 **** if (pedantic && TREE_CODE (glob) == VAR_DECL) { ! assert (TREE_CODE_CLASS (TREE_CODE (glob)) == 'd'); error_with_decl (glob, "non-function declaration `%s'"); error_with_decl (decl, "conflicts with function declaration `%s'"); --- 3037,3041 ---- if (pedantic && TREE_CODE (glob) == VAR_DECL) { ! my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (glob)) == 'd', 143); error_with_decl (glob, "non-function declaration `%s'"); error_with_decl (decl, "conflicts with function declaration `%s'"); *************** *** 3149,3152 **** --- 3173,3182 ---- else if (TREE_CODE (newdecl) == FUNCTION_DECL) { + /* If this is a pure function, its olddecl will actually be + the original initialization to `0' (which we force to call + abort()). Don't complain about redefinition in this case. */ + if (DECL_LANG_SPECIFIC (olddecl) && DECL_ABSTRACT_VIRTUAL_P (olddecl)) + return 0; + /* Declarations of functions can insist on internal linkage but they can't be inconsistent with internal linkage, *************** *** 3602,3606 **** struct binding_level *b; ! assert (TREE_CODE (d) == TYPE_DECL); /* If the type value has already been globalized, then we're set. */ if (IDENTIFIER_GLOBAL_VALUE (DECL_NAME (d)) == d) --- 3632,3636 ---- struct binding_level *b; ! my_friendly_assert (TREE_CODE (d) == TYPE_DECL, 144); /* If the type value has already been globalized, then we're set. */ if (IDENTIFIER_GLOBAL_VALUE (DECL_NAME (d)) == d) *************** *** 3828,3831 **** --- 3858,3874 ---- } + /* Arrange for the user to get a source line number, even when the + compiler is going down in flames, so that she at least has a + chance of working around problems in the compiler. We used to + call error(), but that let the segmentation fault continue + through; now, it's much more passive by asking them to send the + maintainers mail about the problem. */ + + static void sigsegv () + { + signal (SIGSEGV, SIG_DFL); + my_friendly_abort (0); + } + /* Array for holding types considered "built-in". These types are output in the module in which `main' is defined. */ *************** *** 3968,3971 **** --- 4011,4019 ---- free_binding_level = NULL_BINDING_LEVEL; + /* Because most segmentation signals can be traced back into user + code, catch them and at least give the user a chance of working + around compiler bugs. */ + signal (SIGSEGV, sigsegv); + gcc_obstack_init (&decl_obstack); if (flag_dossier) *************** *** 4769,4773 **** decl = grokdeclarator (declarator, declspecs, NORMAL, initialized, raises); ! if (decl == NULL_TREE) return decl; type = TREE_TYPE (decl); --- 4817,4822 ---- decl = grokdeclarator (declarator, declspecs, NORMAL, initialized, raises); ! if (decl == NULL_TREE || decl == void_type_node) ! return NULL_TREE; type = TREE_TYPE (decl); *************** *** 5005,5009 **** tree type; type = DECL_CONTEXT (result); ! assert (TREE_CODE (type) == UNINSTANTIATED_P_TYPE); if (/* TREE_CODE (result) == VAR_DECL */ 1) { --- 5054,5058 ---- tree type; type = DECL_CONTEXT (result); ! my_friendly_assert (TREE_CODE (type) == UNINSTANTIATED_P_TYPE, 145); if (/* TREE_CODE (result) == VAR_DECL */ 1) { *************** *** 5029,5033 **** { sorry ("non-function templates not yet supported"); ! return error_mark_node; } else --- 5078,5082 ---- { sorry ("non-function templates not yet supported"); ! return NULL_TREE; } else *************** *** 5074,5078 **** if (TREE_CODE (tmp_addr) == NOP_EXPR) tmp_addr = TREE_OPERAND (tmp_addr, 0); ! assert (TREE_CODE (tmp_addr) == ADDR_EXPR); tmp = TREE_OPERAND (tmp_addr, 0); } --- 5123,5127 ---- if (TREE_CODE (tmp_addr) == NOP_EXPR) tmp_addr = TREE_OPERAND (tmp_addr, 0); ! my_friendly_assert (TREE_CODE (tmp_addr) == ADDR_EXPR, 146); tmp = TREE_OPERAND (tmp_addr, 0); } *************** *** 5461,5465 **** { if (init && init != error_mark_node) ! assert (TREE_PERMANENT (init)); if (asmspec) --- 5510,5514 ---- { if (init && init != error_mark_node) ! my_friendly_assert (TREE_PERMANENT (init), 147); if (asmspec) *************** *** 5492,5496 **** else if (TREE_CODE (decl) == CONST_DECL) { ! assert (TREE_CODE (decl) != REFERENCE_TYPE); DECL_INITIAL (decl) = init; --- 5541,5545 ---- else if (TREE_CODE (decl) == CONST_DECL) { ! my_friendly_assert (TREE_CODE (decl) != REFERENCE_TYPE, 148); DECL_INITIAL (decl) = init; *************** *** 5497,5501 **** /* This will keep us from needing to worry about our obstacks. */ ! assert (init != 0); init = 0; } --- 5546,5550 ---- /* This will keep us from needing to worry about our obstacks. */ ! my_friendly_assert (init != 0, 149); init = 0; } *************** *** 5540,5545 **** { /* User wrote something like `foo x = foo (args)' */ ! assert (TREE_CODE (TREE_OPERAND (init, 0)) == VAR_DECL); ! assert (DECL_NAME (TREE_OPERAND (init, 0)) == NULL_TREE); /* User wrote exactly `foo x = foo (args)' */ --- 5589,5594 ---- { /* User wrote something like `foo x = foo (args)' */ ! my_friendly_assert (TREE_CODE (TREE_OPERAND (init, 0)) == VAR_DECL, 150); ! my_friendly_assert (DECL_NAME (TREE_OPERAND (init, 0)) == NULL_TREE, 151); /* User wrote exactly `foo x = foo (args)' */ *************** *** 5795,5811 **** /* If this is a static const, change its apparent linkage if it belongs to a #pragma interface. */ ! if (TREE_STATIC (decl) && interface_unknown == 0) { ! if (interface_only) ! { ! TREE_STATIC (decl) = 0; ! DECL_EXTERNAL (decl) = 1; ! } ! else ! { ! TREE_PUBLIC (decl) = 1; ! /* Marking it used will cause it to be written. */ ! TREE_USED (decl) = 1; ! } } make_decl_rtl (decl, asmspec, toplev); --- 5844,5851 ---- /* If this is a static const, change its apparent linkage if it belongs to a #pragma interface. */ ! if (TREE_STATIC (decl) && !interface_unknown) { ! TREE_PUBLIC (decl) = 1; ! DECL_EXTERNAL (decl) = interface_only; } make_decl_rtl (decl, asmspec, toplev); *************** *** 5843,5847 **** resume_temporary_allocation (); ! if (TYPE_LANG_SPECIFIC (type) && CLASSTYPE_ABSTRACT_VIRTUALS (type)) abstract_virtuals_error (decl, type); else if ((TREE_CODE (type) == FUNCTION_TYPE --- 5883,5889 ---- resume_temporary_allocation (); ! if (type != error_mark_node ! && TYPE_LANG_SPECIFIC (type) ! && CLASSTYPE_ABSTRACT_VIRTUALS (type)) abstract_virtuals_error (decl, type); else if ((TREE_CODE (type) == FUNCTION_TYPE *************** *** 6259,6266 **** /* Function gets the ugly name, field gets the nice one. This call may change the type of the function (because ! of default parameters)! ! ! Wrappers get field names which will not conflict ! with constructors and destructors. */ if (ctype != NULL_TREE) grokclassfn (ctype, cname, decl, flags, quals); --- 6301,6305 ---- /* Function gets the ugly name, field gets the nice one. This call may change the type of the function (because ! of default parameters)! */ if (ctype != NULL_TREE) grokclassfn (ctype, cname, decl, flags, quals); *************** *** 6302,6309 **** for (i = 0; i < n_baselinks; i++) { ! tree child = TREE_VEC_ELT (binfos, i); ! if (TYPE_VIRTUAL_P (BINFO_TYPE (child)) || flag_all_virtual == 1) { ! tmp = get_first_matching_virtual (child, decl, flags == DTOR_FLAG); if (tmp) --- 6341,6348 ---- for (i = 0; i < n_baselinks; i++) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); ! if (TYPE_VIRTUAL_P (BINFO_TYPE (base_binfo)) || flag_all_virtual == 1) { ! tmp = get_first_matching_virtual (base_binfo, decl, flags == DTOR_FLAG); if (tmp) *************** *** 6321,6327 **** virtualp = 1; ! if ((TYPE_USES_VIRTUAL_BASECLASSES (BINFO_TYPE (child)) || TYPE_USES_MULTIPLE_INHERITANCE (ctype)) ! && BINFO_TYPE (child) != DECL_CONTEXT (tmp)) tmp = get_first_matching_virtual (TYPE_BINFO (DECL_CONTEXT (tmp)), decl, flags == DTOR_FLAG); --- 6360,6366 ---- virtualp = 1; ! if ((TYPE_USES_VIRTUAL_BASECLASSES (BINFO_TYPE (base_binfo)) || TYPE_USES_MULTIPLE_INHERITANCE (ctype)) ! && BINFO_TYPE (base_binfo) != DECL_CONTEXT (tmp)) tmp = get_first_matching_virtual (TYPE_BINFO (DECL_CONTEXT (tmp)), decl, flags == DTOR_FLAG); *************** *** 6652,6656 **** else error ("bad parameter list specification for function"); ! return 0; } bot: --- 6691,6695 ---- else error ("bad parameter list specification for function"); ! return void_type_node; } bot: *************** *** 6664,6685 **** switch (TREE_CODE (decl)) { - case WRAPPER_EXPR: /* for C++ wrappers. */ - ctype = NULL_TREE; - assert (flags == NO_SPECIAL); - flags = WRAPPER_FLAG; - decl = TREE_OPERAND (decl, 0); - break; - - case ANTI_WRAPPER_EXPR: /* for C++ wrappers. */ - ctype = NULL_TREE; - assert (flags == NO_SPECIAL); - flags = ANTI_WRAPPER_FLAG; - decl = TREE_OPERAND (decl, 0); - break; - case COND_EXPR: ctype = NULL_TREE; - assert (flags == WRAPPER_FLAG); - flags = WRAPPER_PRED_FLAG; decl = TREE_OPERAND (decl, 0); break; --- 6703,6708 ---- *************** *** 6690,6697 **** tree rename = NULL_TREE; ! assert (flags == NO_SPECIAL); flags = DTOR_FLAG; return_type = return_dtor; ! assert (TREE_CODE (name) == IDENTIFIER_NODE); if (ctype == NULL_TREE) { --- 6713,6720 ---- tree rename = NULL_TREE; ! my_friendly_assert (flags == NO_SPECIAL, 152); flags = DTOR_FLAG; return_type = return_dtor; ! my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 153); if (ctype == NULL_TREE) { *************** *** 6771,6776 **** case TYPE_EXPR: ctype = NULL_TREE; ! assert (flags == NO_SPECIAL); flags = TYPENAME_FLAG; name = "operator "; --- 6794,6809 ---- case TYPE_EXPR: + if (ctype == NULL_TREE) + { + /* ANSI C++ June 5 1992 WP 12.3.2 only describes + conversion functions in terms of being declared + as a member function. */ + error ("operator `%s' must be declared as a member", + IDENTIFIER_POINTER (TREE_VALUE (TREE_TYPE (decl)))); + return NULL_TREE; + } + ctype = NULL_TREE; ! my_friendly_assert (flags == NO_SPECIAL, 154); flags = TYPENAME_FLAG; name = "operator "; *************** *** 6817,6821 **** else { ! if (! DERIVED_FROM_P (IDENTIFIER_TYPE_VALUE (cname), ctype)) { error ("type `%s' is not derived from type `%s'", --- 6850,6854 ---- else { ! if (! UNIQUELY_DERIVED_FROM_P (IDENTIFIER_TYPE_VALUE (cname), ctype)) { error ("type `%s' is not derived from type `%s'", *************** *** 6858,6862 **** default: ! assert (0); } if (name == 0) --- 6891,6895 ---- default: ! my_friendly_assert (0, 155); } if (name == 0) *************** *** 7243,7254 **** } else if (decl_context == FIELD ! && (specbits ! & (/* C++ allows static class elements */ ! (1 << (int) RID_STATIC) ! /* ...and inlines */ ! | (1 << (int) RID_INLINE) ! /* ...and signed and unsigned elements. */ ! | (1 << (int) RID_SIGNED) ! | (1 << (int) RID_UNSIGNED)))) ; else --- 7276,7283 ---- } else if (decl_context == FIELD ! /* C++ allows static class elements */ ! && (specbits & (1 << (int) RID_STATIC))) ! /* C++ also allows inlines and signed and unsigned elements, ! but in those cases we don't come in here. */ ; else *************** *** 7322,7327 **** a BIT_NOT_EXPR (for destructors) a TYPE_EXPR (for operator typenames) - a WRAPPER_EXPR (for wrappers) - an ANTI_WRAPPER_EXPR (for averting wrappers) At this point, TYPE is the type of elements of an array, --- 7351,7354 ---- *************** *** 7519,7523 **** { error ("destructors cannot be declared `const'"); ! return NULL_TREE; } if (TYPE_VOLATILE (type)) --- 7546,7550 ---- { error ("destructors cannot be declared `const'"); ! return void_type_node; } if (TYPE_VOLATILE (type)) *************** *** 7524,7528 **** { error ("destructors cannot be declared `volatile'"); ! return NULL_TREE; } if (decl_context == FIELD) --- 7551,7555 ---- { error ("destructors cannot be declared `volatile'"); ! return void_type_node; } if (decl_context == FIELD) *************** *** 7530,7563 **** if (! member_function_or_else (ctype, current_class_type, "destructor for alien class `%s' cannot be a member")) ! return NULL_TREE; ! } ! } ! else if (flags == WRAPPER_FLAG || flags == ANTI_WRAPPER_FLAG) ! { ! if (staticp == 2) ! error ("wrapper cannot be static member function"); ! if (decl_context == FIELD) ! { ! if (! member_function_or_else (ctype, current_class_type, ! "wrapper for alien class `%s' cannot be member")) ! return NULL_TREE; ! TYPE_WRAP_TYPE (ctype) = TYPE_MAIN_VARIANT (ctype); ! } ! } ! else if (flags == WRAPPER_PRED_FLAG) ! { ! if (staticp == 2) ! error ("wrapper predicate cannot be static member function"); ! if (TREE_CODE (type) != INTEGER_TYPE) ! { ! error ("wrapper predicated must return an integer type"); ! type = integer_type_node; ! } ! if (decl_context == FIELD) ! { ! if (! member_function_or_else (ctype, current_class_type, ! "wrapper predicate for alien class `%s' cannot be member")) ! return NULL_TREE; ! TYPE_HAS_WRAPPER_PRED (ctype) = 1; } } --- 7557,7561 ---- if (! member_function_or_else (ctype, current_class_type, "destructor for alien class `%s' cannot be a member")) ! return void_type_node; } } *************** *** 7577,7581 **** { error ("constructors cannot be declared `const'"); ! return NULL_TREE; } if (TYPE_VOLATILE (type)) --- 7575,7579 ---- { error ("constructors cannot be declared `const'"); ! return void_type_node; } if (TYPE_VOLATILE (type)) *************** *** 7582,7586 **** { error ("constructors cannot be declared `volatile'"); ! return NULL_TREE; } if (specbits & ~((1 << (int) RID_INLINE)|(1 << (int) RID_STATIC))) --- 7580,7584 ---- { error ("constructors cannot be declared `volatile'"); ! return void_type_node; } if (specbits & ~((1 << (int) RID_INLINE)|(1 << (int) RID_STATIC))) *************** *** 7591,7597 **** if (! member_function_or_else (ctype, current_class_type, "constructor for alien class `%s' cannot be member")) ! return NULL_TREE; TYPE_HAS_CONSTRUCTOR (ctype) = 1; ! assert (return_type == return_ctor); } } --- 7589,7595 ---- if (! member_function_or_else (ctype, current_class_type, "constructor for alien class `%s' cannot be member")) ! return void_type_node; TYPE_HAS_CONSTRUCTOR (ctype) = 1; ! my_friendly_assert (return_type == return_ctor, 156); } } *************** *** 7647,7651 **** if (declarator) { ! /* Get past destructors, wrappers, etc. We know we have one because FLAGS will be non-zero. --- 7645,7649 ---- if (declarator) { ! /* Get past destructors, etc. We know we have one because FLAGS will be non-zero. *************** *** 7664,7723 **** } } - else if (TREE_CODE (declarator) == WRAPPER_EXPR) - { - /* Report misuse of wrappers and their associates. - Note that because wrappers may be invoked - quite a bit implicitly, if we give an error - message, we make an effort to fix that error - so that spurious errors do not show up. */ - if (TREE_CODE (TREE_OPERAND (declarator, 0)) == COND_EXPR) - { - /* First parameter must be a pointer to a member function. - Rest of parameters must all be default parameters. */ - if (arg_types == NULL_TREE - || arg_types == void_list_node - || TREE_CODE (TREE_VALUE (arg_types)) != POINTER_TYPE - || TREE_CODE (TREE_TYPE (TREE_VALUE (arg_types))) != METHOD_TYPE) - { - error ("wrapper predicate takes a pointer-to-member-function as first argument"); - arg_types = NULL_TREE; - } - else if (TREE_CHAIN (arg_types) - && TREE_CHAIN (arg_types) != void_list_node - && TREE_PURPOSE (TREE_CHAIN (arg_types)) == NULL_TREE) - { - error ("all arguments past first must be default for wrapper predicate"); - TREE_CHAIN (arg_types) = NULL_TREE; - } - declarator = wrapper_pred_name; - } - else - { - /* First parameter must be an int. - Second parameter must be a pointer to a member function. */ - if (arg_types == NULL_TREE || TREE_CHAIN (arg_types) == NULL_TREE) - { - error ("wrappers must have at least two arguments (int, pointer-to-member-function)"); - arg_types = NULL_TREE; - } - else - { - if (TREE_CODE (TREE_VALUE (arg_types)) != INTEGER_TYPE) - { - error ("first argument to wrapper must be an integer"); - TREE_VALUE (arg_types) = integer_type_node; - } - if (TREE_CODE (TREE_VALUE (TREE_CHAIN (arg_types))) != POINTER_TYPE - || TREE_CODE (TREE_TYPE (TREE_VALUE (TREE_CHAIN (arg_types)))) != METHOD_TYPE) - { - error ("second argument to wrapper must be a pointer-to-member-function type"); - TREE_CHAIN (arg_types) = NULL_TREE; - } - } - declarator = wrapper_name; - } - } - else if (TREE_CODE (declarator) == ANTI_WRAPPER_EXPR) - declarator = anti_wrapper_name; } /* the top level const or volatile is attached semantically only --- 7662,7665 ---- *************** *** 7866,7874 **** if (TYPE_MAIN_VARIANT (ctype) == current_class_type || friendp) ! if (TREE_CODE (type) == FUNCTION_TYPE) ! type = build_cplus_method_type (build_type_variant (ctype, constp, volatilep), ! TREE_TYPE (type), TYPE_ARG_TYPES (type)); ! else ! type = build_offset_type (ctype, type); else if (TYPE_SIZE (ctype) != 0 || (specbits & (1<<(int)RID_TYPEDEF))) --- 7808,7829 ---- if (TYPE_MAIN_VARIANT (ctype) == current_class_type || friendp) ! { ! if (TREE_CODE (type) == FUNCTION_TYPE) ! type = build_cplus_method_type (build_type_variant (ctype, constp, volatilep), ! TREE_TYPE (type), TYPE_ARG_TYPES (type)); ! else ! { ! if (TYPE_MAIN_VARIANT (ctype) != current_class_type) ! { ! error ("cannot declare member `%s::%s' within this class", ! TYPE_NAME_STRING (ctype), name); ! return void_type_node; ! } ! else if (extra_warnings) ! warning ("extra qualification `%s' on member `%s' ignored", ! TYPE_NAME_STRING (ctype), name); ! type = build_offset_type (ctype, type); ! } ! } else if (TYPE_SIZE (ctype) != 0 || (specbits & (1<<(int)RID_TYPEDEF))) *************** *** 7878,7882 **** this code is used for i.e., typedef int A::M; M *pm; */ ! if (decl_context == FIELD && funcdef_flag == 0) { /* The code in here should only be used to build --- 7833,7838 ---- this code is used for i.e., typedef int A::M; M *pm; */ ! if (explicit_int == -1 && decl_context == FIELD ! && funcdef_flag == 0) { /* The code in here should only be used to build *************** *** 7920,7924 **** TREE_TYPE (type), TYPE_ARG_TYPES (type)); else ! type = build_offset_type (ctype, type); } else if (uses_template_parms (ctype)) --- 7876,7894 ---- TREE_TYPE (type), TYPE_ARG_TYPES (type)); else ! { ! if (current_class_type) ! { ! if (TYPE_MAIN_VARIANT (ctype) != current_class_type) ! { ! error ("cannot declare member `%s::%s' within this class", ! TYPE_NAME_STRING (ctype), name); ! return void_type_node; ! } ! else if (extra_warnings) ! warning ("extra qualification `%s' on member `%s' ignored", ! TYPE_NAME_STRING (ctype), name); ! } ! type = build_offset_type (ctype, type); ! } } else if (uses_template_parms (ctype)) *************** *** 7946,7954 **** This does not work if we don't get a CALL_EXPR back. I did not think about error recovery, hence the ! assert (0). */ /* Get the CALL_EXPR. */ sname = grokoptypename (sname, 0); ! assert (TREE_CODE (sname) == CALL_EXPR); type = TREE_TYPE (TREE_OPERAND (sname, 0)); /* Scope the CALL_EXPR's name. */ --- 7916,7924 ---- This does not work if we don't get a CALL_EXPR back. I did not think about error recovery, hence the ! my_friendly_assert (0). */ /* Get the CALL_EXPR. */ sname = grokoptypename (sname, 0); ! my_friendly_assert (TREE_CODE (sname) == CALL_EXPR, 157); type = TREE_TYPE (TREE_OPERAND (sname, 0)); /* Scope the CALL_EXPR's name. */ *************** *** 7995,8009 **** break; - case WRAPPER_EXPR: - if (TREE_CODE (TREE_OPERAND (declarator, 0)) == COND_EXPR) - declarator = wrapper_pred_name; - else - declarator = wrapper_name; - break; - - case ANTI_WRAPPER_EXPR: - declarator = anti_wrapper_name; - break; - case RECORD_TYPE: case UNION_TYPE: --- 7965,7968 ---- *************** *** 8017,8021 **** default: ! assert (0); } } --- 7976,7980 ---- default: ! my_friendly_assert (0, 158); } } *************** *** 8114,8118 **** if (ctype == NULL_TREE) { ! assert (TREE_CODE (type) == METHOD_TYPE); ctype = TYPE_METHOD_BASETYPE (type); } --- 8073,8077 ---- if (ctype == NULL_TREE) { ! my_friendly_assert (TREE_CODE (type) == METHOD_TYPE, 159); ctype = TYPE_METHOD_BASETYPE (type); } *************** *** 8325,8330 **** if (ctype == current_class_type) warning ("member functions are implicitly friends of their class"); ! else if (DECL_NAME (decl)) ! return do_friend (ctype, declarator, decl, last_function_parms, flags, quals); else return void_type_node; } --- 8284,8290 ---- if (ctype == current_class_type) warning ("member functions are implicitly friends of their class"); ! else if (decl && DECL_NAME (decl)) ! return do_friend (ctype, declarator, decl, ! last_function_parms, flags, quals); else return void_type_node; } *************** *** 8343,8346 **** --- 8303,8327 ---- error ("invalid raises declaration"); + /* ANSI C++ June 5 1992 WP 9.2.2 and 9.4.2. A member-declarator + cannot have an initializer, and a static member declaration must + be defined elsewhere. */ + if (initialized) + { + if (staticp) + error ("static member `%s' must be defined separately from its declaration", + IDENTIFIER_POINTER (declarator)); + /* Note that initialization of const members is not + mentioned in the ARM or draft ANSI standard explicitly, + and it appears to be in common practice. However, + reading the draft section 9.2.2, it does say that a + member declarator can't have an initializer--it does + not except constant members, which also qualify as + member-declarators. */ + else if (!constp || pedantic) + error ("ANSI C++ forbids initialization of %s `%s'", + (constp && pedantic) ? "const member" : "member", + IDENTIFIER_POINTER (declarator)); + } + if (staticp || (constp && initialized)) { *************** *** 8458,8462 **** if (specbits & (1 << (int) RID_EXTERN)) ! current_extern_inline = 1; } if (was_overloaded) --- 8439,8449 ---- if (specbits & (1 << (int) RID_EXTERN)) ! { ! current_extern_inline = 1; ! if (pedantic) ! error ("ANSI C++ does not permit `extern inline'"); ! else if (flag_ansi) ! warning ("ANSI C++ does not permit `extern inline'"); ! } } if (was_overloaded) *************** *** 8922,8927 **** /* Take care of function decl if we had syntax errors. */ if (argtypes == NULL_TREE) ! TREE_TYPE (decl) = build_function_type (ptr_type_node, ! hash_tree_chain (integer_type_node, void_list_node)); else decl = coerce_new_type (TREE_TYPE (current_class_name), --- 8909,8916 ---- /* Take care of function decl if we had syntax errors. */ if (argtypes == NULL_TREE) ! TREE_TYPE (decl) = ! build_function_type (ptr_type_node, ! hash_tree_chain (integer_type_node, ! void_list_node)); else decl = coerce_new_type (TREE_TYPE (current_class_name), *************** *** 8934,8943 **** if (argtypes == NULL_TREE) ! TREE_TYPE (decl) = build_function_type (void_type_node, ! hash_tree_chain (ptr_type_node, void_list_node)); else decl = coerce_delete_type (TREE_TYPE (current_class_name), TREE_TYPE (decl)); - } else --- 8923,8933 ---- if (argtypes == NULL_TREE) ! TREE_TYPE (decl) = ! build_function_type (void_type_node, ! hash_tree_chain (ptr_type_node, ! void_list_node)); else decl = coerce_delete_type (TREE_TYPE (current_class_name), TREE_TYPE (decl)); } else *************** *** 9256,9259 **** --- 9246,9250 ---- || TREE_PURPOSE (binfo) == (tree)visibility_public || TREE_PURPOSE (binfo) == (tree)visibility_public_virtual); + int via_protected = TREE_PURPOSE (binfo) == (tree)visibility_protected; int via_virtual = (TREE_PURPOSE (binfo) == (tree)visibility_private_virtual || TREE_PURPOSE (binfo) == (tree)visibility_public_virtual *************** *** 9260,9264 **** || TREE_PURPOSE (binfo) == (tree)visibility_default_virtual); tree basetype = TREE_TYPE (TREE_VALUE (binfo)); ! tree child; GNU_xref_hier (IDENTIFIER_POINTER (name), --- 9251,9255 ---- || TREE_PURPOSE (binfo) == (tree)visibility_default_virtual); tree basetype = TREE_TYPE (TREE_VALUE (binfo)); ! tree base_binfo; GNU_xref_hier (IDENTIFIER_POINTER (name), *************** *** 9304,9315 **** the `accessability' of that particular inheritance is.) */ ! child = make_binfo (integer_zero_node, basetype, TYPE_BINFO_VTABLE (basetype), TYPE_BINFO_VIRTUALS (basetype), 0); ! TREE_VEC_ELT (binfos, i) = child; ! TREE_VIA_PUBLIC (child) = via_public; ! TREE_VIA_PROTECTED (child) = 0; /* Not yet implemented. */ ! TREE_VIA_VIRTUAL (child) = via_virtual; SET_CLASSTYPE_MARKED (basetype); --- 9295,9306 ---- the `accessability' of that particular inheritance is.) */ ! base_binfo = make_binfo (integer_zero_node, basetype, TYPE_BINFO_VTABLE (basetype), TYPE_BINFO_VIRTUALS (basetype), 0); ! TREE_VEC_ELT (binfos, i) = base_binfo; ! TREE_VIA_PUBLIC (base_binfo) = via_public; ! TREE_VIA_PROTECTED (base_binfo) = via_protected; ! TREE_VIA_VIRTUAL (base_binfo) = via_virtual; SET_CLASSTYPE_MARKED (basetype); *************** *** 9335,9339 **** TYPE_GETS_ASSIGNMENT (ref) |= TYPE_GETS_ASSIGNMENT (basetype); TYPE_OVERLOADS_METHOD_CALL_EXPR (ref) |= TYPE_OVERLOADS_METHOD_CALL_EXPR (basetype); - TYPE_HAS_WRAPPER_PRED (ref) |= TYPE_HAS_WRAPPER_PRED (basetype); TREE_GETS_NEW (ref) |= TREE_GETS_NEW (basetype); TREE_GETS_DELETE (ref) |= TREE_GETS_DELETE (basetype); --- 9326,9329 ---- *************** *** 9681,9686 **** /* Sanity check. */ ! assert (TREE_VALUE (void_list_node) == void_type_node); ! assert (TREE_CHAIN (void_list_node) == NULL_TREE); /* Assume, until we see it does. */ --- 9671,9676 ---- /* Sanity check. */ ! my_friendly_assert (TREE_VALUE (void_list_node) == void_type_node, 160); ! my_friendly_assert (TREE_CHAIN (void_list_node) == NULL_TREE, 161); /* Assume, until we see it does. */ *************** *** 9749,9771 **** && ! CLASSTYPE_GOT_SEMICOLON (restype)) { ! /* ?? Do we care about doing any of this for anonymous aggregate ! types? */ ! /* Give a warning if it isn't "struct {...} f () return x; {...}". ! If it is unnamed, it's likely the user meant it that way(?). ! Should this warning be conditionalized? */ ! tree typename = TYPE_IDENTIFIER (restype); ! if (! ANON_AGGRNAME_P (typename)) ! { ! static int warned; ! warning ("possibly missing semicolon after declaration of `%s'?", ! IDENTIFIER_POINTER (typename)); ! if (!warned) ! { ! warned = 1; ! warning ("(suggest separating class decl and function definition)"); ! } ! } shadow_tag (build_tree_list (NULL_TREE, restype)); CLASSTYPE_GOT_SEMICOLON (restype) = 1; } --- 9739,9753 ---- && ! CLASSTYPE_GOT_SEMICOLON (restype)) { ! error_with_aggr_type (restype, "semicolon missing after declaration of `%s'"); shadow_tag (build_tree_list (NULL_TREE, restype)); CLASSTYPE_GOT_SEMICOLON (restype) = 1; + if (TREE_CODE (fntype) == FUNCTION_TYPE) + fntype = build_function_type (integer_type_node, + TYPE_ARG_TYPES (fntype)); + else + fntype = build_cplus_method_type (build_type_variant (TYPE_METHOD_BASETYPE (fntype), TREE_READONLY (decl1), TREE_SIDE_EFFECTS (decl1)), + integer_type_node, + TYPE_ARG_TYPES (fntype)); + TREE_TYPE (decl1) = fntype; } *************** *** 9958,9963 **** and `current_class_decl'. */ current_class_decl = last_function_parms; ! assert (current_class_decl != NULL_TREE ! && TREE_CODE (current_class_decl) == PARM_DECL); if (TREE_CODE (TREE_TYPE (current_class_decl)) == POINTER_TYPE) { --- 9940,9945 ---- and `current_class_decl'. */ current_class_decl = last_function_parms; ! my_friendly_assert (current_class_decl != NULL_TREE ! && TREE_CODE (current_class_decl) == PARM_DECL, 162); if (TREE_CODE (TREE_TYPE (current_class_decl)) == POINTER_TYPE) { *************** *** 11069,11073 **** if (DECL_NAME (link) != 0) IDENTIFIER_LOCAL_VALUE (DECL_NAME (link)) = 0; ! assert (TREE_CODE (link) != FUNCTION_DECL); DECL_CONTEXT (link) = 0; } --- 11051,11055 ---- if (DECL_NAME (link) != 0) IDENTIFIER_LOCAL_VALUE (DECL_NAME (link)) = 0; ! my_friendly_assert (TREE_CODE (link) != FUNCTION_DECL, 163); DECL_CONTEXT (link) = 0; } *************** *** 11184,11188 **** } } ! assert (current_binding_level->n_incomplete > 0); --current_binding_level->n_incomplete; } --- 11166,11170 ---- } } ! my_friendly_assert (current_binding_level->n_incomplete > 0, 164); --current_binding_level->n_incomplete; } *************** *** 11288,11292 **** if (TREE_RAISES (exp)) { ! assert (flag_handle_exceptions); if (flag_handle_exceptions == 2) { --- 11270,11274 ---- if (TREE_RAISES (exp)) { ! my_friendly_assert (flag_handle_exceptions, 165); if (flag_handle_exceptions == 2) { *************** *** 11350,11354 **** if (decl) { ! assert (current_binding_level->parm_flag == 3); current_binding_level->names = TREE_CHAIN (decl); } --- 11332,11336 ---- if (decl) { ! my_friendly_assert (current_binding_level->parm_flag == 3, 166); current_binding_level->names = TREE_CHAIN (decl); } diff -rc2N gcc-2.3.1/cp-decl2.c gcc-2.3.2/cp-decl2.c *** gcc-2.3.1/cp-decl2.c Thu Sep 24 21:48:49 1992 --- gcc-2.3.2/cp-decl2.c Thu Nov 12 20:51:08 1992 *************** *** 35,39 **** #include "cp-lex.h" #include "cp-decl.h" - #include "assert.h" extern tree grokdeclarator (); --- 35,38 ---- *************** *** 61,64 **** --- 60,67 ---- /* The (assembler) name of the first globally-visible object output. */ extern char * first_global_object_name; + + /* Flag used when debugging cp-spew.c */ + + extern int spew_debug; /* C (and C++) language-specific option variables. */ *************** *** 119,122 **** --- 122,129 ---- int warn_cast_qual; + /* Warn about traditional constructs whose meanings changed in ANSI C. */ + + int warn_traditional; + /* Nonzero means warn about sizeof(function) or addition/subtraction of function pointers. */ *************** *** 142,145 **** --- 149,156 ---- int warn_format; + /* Warn about a subscript that has type char. */ + + int warn_char_subscripts = 0; + /* Warn if a type conversion is done that might have confusing results. */ *************** *** 431,434 **** --- 442,449 ---- else if (!strcmp (p, "cast-qual")) warn_cast_qual = setting; + else if (!strcmp (p, "traditional")) + warn_traditional = setting; + else if (!strcmp (p, "char-subscripts")) + warn_char_subscripts = setting; else if (!strcmp (p, "pointer-arith")) warn_pointer_arith = setting; *************** *** 474,477 **** --- 489,499 ---- else if (!strcmp (p, "-ansi")) flag_no_asm = 1, dollars_in_ident = 0, flag_ansi = 1; + #ifdef SPEW_DEBUG + /* Undocumented, only ever used when you're invoking cc1plus by hand, since + it's probably safe to assume no sane person would ever want to use this + under normal circumstances. */ + else if (!strcmp (p, "-spew-debug")) + spew_debug = 1; + #endif else return 0; *************** *** 673,699 **** TYPE_HAS_DESTRUCTOR (ctype) = 1; } - else if (flags == WRAPPER_FLAG || flags == ANTI_WRAPPER_FLAG) - { - name = (char *)alloca (sizeof (WRAPPER_DECL_FORMAT) - + sizeof (ANTI_WRAPPER_DECL_FORMAT) - + IDENTIFIER_LENGTH (cname) + 2); - sprintf (name, - flags == WRAPPER_FLAG ? WRAPPER_DECL_FORMAT : ANTI_WRAPPER_DECL_FORMAT, - IDENTIFIER_POINTER (cname)); - DECL_ASSEMBLER_NAME (function) = build_decl_overload (get_identifier (name), arg_types, 1); - sprintf (name, flags == WRAPPER_FLAG ? WRAPPER_NAME_FORMAT : ANTI_WRAPPER_NAME_FORMAT, - IDENTIFIER_POINTER (cname)); - DECL_NAME (function) = fn_name = get_identifier (name); - } - else if (flags == WRAPPER_PRED_FLAG) - { - name = (char *)alloca (sizeof (WRAPPER_PRED_DECL_FORMAT) - + sizeof (WRAPPER_PRED_NAME_FORMAT) - + IDENTIFIER_LENGTH (cname) + 2); - sprintf (name, WRAPPER_PRED_DECL_FORMAT, IDENTIFIER_POINTER (cname)); - DECL_ASSEMBLER_NAME (function) = build_decl_overload (get_identifier (name), arg_types, 1); - sprintf (name, WRAPPER_PRED_NAME_FORMAT, IDENTIFIER_POINTER (cname)); - DECL_NAME (function) = fn_name = get_identifier (name); - } else { --- 695,698 ---- *************** *** 801,808 **** sprintf (err_name, "`operator %s'", operator_name_string (fn_name)); } - else if (flags == WRAPPER_FLAG) - err_name = "wrapper"; - else if (flags == WRAPPER_PRED_FLAG) - err_name = "wrapper predicate"; else { --- 800,803 ---- *************** *** 870,873 **** --- 865,874 ---- } + if (init + && TREE_CODE (init) == TREE_LIST + && TREE_VALUE (init) == error_mark_node + && TREE_CHAIN (init) == NULL_TREE) + init = NULL_TREE; + value = grokdeclarator (declarator, declspecs, FIELD, init != 0, raises); if (! value) *************** *** 935,939 **** else if (TREE_CODE (init) == CONSTRUCTOR) init = digest_init (TREE_TYPE (value), init, 0); ! assert (TREE_PERMANENT (init)); if (init == error_mark_node) /* We must make this look different than `error_mark_node' --- 936,940 ---- else if (TREE_CODE (init) == CONSTRUCTOR) init = digest_init (TREE_TYPE (value), init, 0); ! my_friendly_assert (TREE_PERMANENT (init), 192); if (init == error_mark_node) /* We must make this look different than `error_mark_node' *************** *** 1030,1034 **** value = copy_node (value); /* When does this happen? */ ! assert (init == NULL_TREE); } finish_decl (value, init, asmspec_tree, 1); --- 1031,1035 ---- value = copy_node (value); /* When does this happen? */ ! my_friendly_assert (init == NULL_TREE, 193); } finish_decl (value, init, asmspec_tree, 1); *************** *** 1225,1229 **** } else ! assert (0); spec = TREE_CHAIN (spec); } --- 1226,1230 ---- } else ! my_friendly_assert (0, 194); spec = TREE_CHAIN (spec); } *************** *** 1304,1308 **** tree tmp, last; ! assert (TREE_CODE (decl) == TYPE_EXPR); tmp = TREE_OPERAND (decl, 0); --- 1305,1309 ---- tree tmp, last; ! my_friendly_assert (TREE_CODE (decl) == TYPE_EXPR, 195); tmp = TREE_OPERAND (decl, 0); *************** *** 1369,1373 **** default: ! assert (0); } last = tmp; --- 1370,1374 ---- default: ! my_friendly_assert (0, 196); } last = tmp; *************** *** 1514,1517 **** --- 1515,1525 ---- return rval; } + + void cplus_decl_attributes (decl, attributes) + tree decl, attributes; + { + if (decl) + decl_attributes (decl, attributes); + } /* CONSTRUCTOR_NAME: *************** *** 1531,1535 **** && DECL_TEMPLATE_IS_CLASS (thing))) thing = DECL_NAME (thing); ! assert (TREE_CODE (thing) == IDENTIFIER_NODE); t = IDENTIFIER_TEMPLATE (thing); if (!t) --- 1539,1543 ---- && DECL_TEMPLATE_IS_CLASS (thing))) thing = DECL_NAME (thing); ! my_friendly_assert (TREE_CODE (thing) == IDENTIFIER_NODE, 197); t = IDENTIFIER_TEMPLATE (thing); if (!t) *************** *** 1614,1618 **** { struct pending_inline *t = pending_inlines; ! assert (DECL_SAVED_INSNS (decl) == 0); while (t) { --- 1622,1626 ---- { struct pending_inline *t = pending_inlines; ! my_friendly_assert (DECL_SAVED_INSNS (decl) == 0, 198); while (t) { *************** *** 2285,2291 **** if (DECL_RTL (init) == DECL_RTL (decl)) { ! assert (DECL_INITIAL (decl) == error_mark_node || (TREE_CODE (DECL_INITIAL (decl)) == CONSTRUCTOR ! && CONSTRUCTOR_ELTS (DECL_INITIAL (decl)) == NULL_TREE)); init = DECL_INITIAL (init); if (TREE_CODE (init) == CONSTRUCTOR --- 2293,2300 ---- if (DECL_RTL (init) == DECL_RTL (decl)) { ! my_friendly_assert (DECL_INITIAL (decl) == error_mark_node || (TREE_CODE (DECL_INITIAL (decl)) == CONSTRUCTOR ! && CONSTRUCTOR_ELTS (DECL_INITIAL (decl)) == NULL_TREE), ! 199); init = DECL_INITIAL (init); if (TREE_CODE (init) == CONSTRUCTOR *************** *** 2297,2305 **** { #if 1 ! assert (0); #else /* point to real decl's rtl anyway. */ DECL_RTL (init) = DECL_RTL (decl); ! assert (DECL_INITIAL (decl) == error_mark_node); init = DECL_INITIAL (init); #endif /* 1 */ --- 2306,2315 ---- { #if 1 ! my_friendly_assert (0, 200); #else /* point to real decl's rtl anyway. */ DECL_RTL (init) = DECL_RTL (decl); ! my_friendly_assert (DECL_INITIAL (decl) == error_mark_node, ! 201); init = DECL_INITIAL (init); #endif /* 1 */ *************** *** 2311,2315 **** || init == 0 || TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE) ! expand_aggr_init (decl, init, 0); else if (TREE_CODE (init) == TREE_VEC) { --- 2321,2332 ---- || init == 0 || TREE_CODE (TREE_TYPE (decl)) == ARRAY_TYPE) ! { ! /* Set this up so is_friend() works properly on _GLOBAL_ fns. */ ! tree old_dcc = DECL_CLASS_CONTEXT (current_function_decl); ! if (old_dcc == NULL_TREE) ! DECL_CLASS_CONTEXT (current_function_decl) = TREE_TYPE (decl); ! expand_aggr_init (decl, init, 0); ! DECL_CLASS_CONTEXT (current_function_decl) = old_dcc; ! } else if (TREE_CODE (init) == TREE_VEC) { diff -rc2N gcc-2.3.1/cp-dem.c gcc-2.3.2/cp-dem.c *** gcc-2.3.1/cp-dem.c Mon Jul 6 23:41:15 1992 --- gcc-2.3.2/cp-dem.c Mon Nov 23 20:47:09 1992 *************** *** 416,420 **** { int r, i; - int non_empty = 0; string tname; string trawname; --- 416,419 ---- *************** *** 502,505 **** --- 501,505 ---- case 's': /* short */ case 'c': /* char */ + case 'w': /* wchar_t */ done = is_integral = 1; break; *************** *** 933,936 **** --- 933,942 ---- string_append (result, " "); string_append (result, "char"); + break; + case 'w': + *type += 1; + if (*non_empty) + string_append (result, " "); + string_append (result, "wchar_t"); break; case 'r': diff -rc2N gcc-2.3.1/cp-edsel.c gcc-2.3.2/cp-edsel.c *** gcc-2.3.1/cp-edsel.c Sun Jun 28 06:12:46 1992 --- gcc-2.3.2/cp-edsel.c Thu Nov 12 20:51:14 1992 *************** *** 24,28 **** #include #include "cp-tree.h" - #include "assert.h" #include "obstack.h" --- 24,27 ---- *************** *** 389,393 **** CWriteTopLevel (conn, StartMType); ! assert (TREE_CODE (fndecl) == FUNCTION_DECL); CWriteLanguageDecl (conn, fndecl, (TREE_CODE (TREE_TYPE (fndecl)) == METHOD_TYPE --- 388,392 ---- CWriteTopLevel (conn, StartMType); ! my_friendly_assert (TREE_CODE (fndecl) == FUNCTION_DECL, 202); CWriteLanguageDecl (conn, fndecl, (TREE_CODE (TREE_TYPE (fndecl)) == METHOD_TYPE diff -rc2N gcc-2.3.1/cp-except.c gcc-2.3.2/cp-except.c *** gcc-2.3.1/cp-except.c Thu Sep 17 20:01:20 1992 --- gcc-2.3.2/cp-except.c Thu Nov 12 20:51:20 1992 *************** *** 33,37 **** #include "cp-tree.h" #include "flags.h" - #include "assert.h" /* On Suns this can get you to the right definition if you set the right value for TARGET. */ --- 33,36 ---- *************** *** 538,542 **** } ! assert (TREE_CODE (decl) == VAR_DECL && TREE_TYPE (decl) == EHS_type); if (block) { --- 537,542 ---- } ! my_friendly_assert (TREE_CODE (decl) == VAR_DECL ! && TREE_TYPE (decl) == EHS_type, 203); if (block) { *************** *** 983,987 **** return; } ! assert (TREE_CODE (TREE_OPERAND (ex_object, 0)) == VAR_DECL); exceptions = NULL_TREE; } --- 983,988 ---- return; } ! my_friendly_assert (TREE_CODE (TREE_OPERAND (ex_object, 0)) == VAR_DECL, ! 204); exceptions = NULL_TREE; } diff -rc2N gcc-2.3.1/cp-expr.c gcc-2.3.2/cp-expr.c *** gcc-2.3.1/cp-expr.c Thu Jun 11 00:23:21 1992 --- gcc-2.3.2/cp-expr.c Thu Nov 12 20:51:23 1992 *************** *** 26,30 **** #include "expr.h" #include "cp-tree.h" - #include "assert.h" #define NULL 0 --- 26,29 ---- *************** *** 84,89 **** { /* Should always be called with a target in BLKmode case. */ ! assert (mode != BLKmode); ! assert (DECL_RTL (slot) != 0); target = gen_reg_rtx (mode); --- 83,88 ---- { /* Should always be called with a target in BLKmode case. */ ! my_friendly_assert (mode != BLKmode, 205); ! my_friendly_assert (DECL_RTL (slot) != 0, 206); target = gen_reg_rtx (mode); diff -rc2N gcc-2.3.1/cp-gc.c gcc-2.3.2/cp-gc.c *** gcc-2.3.1/cp-gc.c Sat Jul 11 22:57:17 1992 --- gcc-2.3.2/cp-gc.c Thu Nov 12 20:51:28 1992 *************** *** 24,28 **** #include "cp-tree.h" #include "flags.h" - #include "assert.h" #define NULL 0 --- 24,27 ---- diff -rc2N gcc-2.3.1/cp-init.c gcc-2.3.2/cp-init.c *** gcc-2.3.1/cp-init.c Thu Sep 24 21:48:59 1992 --- gcc-2.3.2/cp-init.c Mon Nov 23 20:46:57 1992 *************** *** 27,31 **** #include "cp-tree.h" #include "flags.h" - #include "assert.h" #define NULL 0 --- 27,30 ---- *************** *** 384,406 **** { tree base = current_class_decl; ! tree child = TREE_VEC_ELT (binfos, i); ! if (TYPE_NEEDS_CONSTRUCTING (BINFO_TYPE (child))) { ! if (! TREE_VIA_VIRTUAL (child) ! && ! BINFO_BASEINIT_MARKED (child)) { tree ref; ! if (BINFO_OFFSET_ZEROP (child)) ! base = build1 (NOP_EXPR, TYPE_POINTER_TO (BINFO_TYPE (child)), current_class_decl); else ! base = build (PLUS_EXPR, TYPE_POINTER_TO (BINFO_TYPE (child)), current_class_decl, BINFO_OFFSET (child)); ref = build_indirect_ref (base, 0); expand_aggr_init_1 (t_binfo, 0, ref, NULL_TREE, ! BINFO_OFFSET_ZEROP (child), LOOKUP_PROTECTED_OK|LOOKUP_COMPLAIN); ! if (flag_handle_exceptions == 2 && TYPE_NEEDS_DESTRUCTOR (BINFO_TYPE (child))) { cplus_expand_start_try (1); --- 383,410 ---- { tree base = current_class_decl; ! tree base_binfo = TREE_VEC_ELT (binfos, i); ! if (TYPE_NEEDS_CONSTRUCTING (BINFO_TYPE (base_binfo))) { ! if (! TREE_VIA_VIRTUAL (base_binfo) ! && ! BINFO_BASEINIT_MARKED (base_binfo)) { tree ref; ! if (BINFO_OFFSET_ZEROP (base_binfo)) ! base = build1 (NOP_EXPR, ! TYPE_POINTER_TO (BINFO_TYPE (base_binfo)), ! current_class_decl); else ! base = build (PLUS_EXPR, ! TYPE_POINTER_TO (BINFO_TYPE (base_binfo)), ! current_class_decl, BINFO_OFFSET (base_binfo)); ref = build_indirect_ref (base, 0); expand_aggr_init_1 (t_binfo, 0, ref, NULL_TREE, ! BINFO_OFFSET_ZEROP (base_binfo), LOOKUP_PROTECTED_OK|LOOKUP_COMPLAIN); ! if (flag_handle_exceptions == 2 ! && TYPE_NEEDS_DESTRUCTOR (BINFO_TYPE (base_binfo))) { cplus_expand_start_try (1); *************** *** 409,413 **** } } ! CLEAR_BINFO_BASEINIT_MARKED (child); } for (vbases = CLASSTYPE_VBASECLASSES (t); vbases; vbases = TREE_CHAIN (vbases)) --- 413,417 ---- } } ! CLEAR_BINFO_BASEINIT_MARKED (base_binfo); } for (vbases = CLASSTYPE_VBASECLASSES (t); vbases; vbases = TREE_CHAIN (vbases)) *************** *** 576,580 **** do_pending_stack_adjust (); ! assert (base_init_insns == 0); base_init_insns = get_insns (); end_sequence (); --- 580,584 ---- do_pending_stack_adjust (); ! my_friendly_assert (base_init_insns == 0, 207); base_init_insns = get_insns (); end_sequence (); *************** *** 634,652 **** for (i = n_baselinks-1; i >= 0; i--) { ! tree child = TREE_VEC_ELT (binfos, i); tree this_decl; ! if (get_base_distance (vtype, BINFO_TYPE (child), 0, 0) == -1) continue; ! if (TREE_VIA_VIRTUAL (child)) ! this_decl = build_vbase_pointer (build_indirect_ref (decl), BINFO_TYPE (child)); ! else if (BINFO_OFFSET_ZEROP (child)) ! this_decl = build1 (NOP_EXPR, TYPE_POINTER_TO (BINFO_TYPE (child)), decl); else ! this_decl = build (PLUS_EXPR, TYPE_POINTER_TO (BINFO_TYPE (child)), ! decl, BINFO_OFFSET (child)); ! result = tree_cons (NULL_TREE, build_virtual_init (main_binfo, child, this_decl), result); } return build_compound_expr (result); --- 638,656 ---- for (i = n_baselinks-1; i >= 0; i--) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); tree this_decl; ! if (get_base_distance (vtype, BINFO_TYPE (base_binfo), 0, 0) == -1) continue; ! if (TREE_VIA_VIRTUAL (base_binfo)) ! this_decl = build_vbase_pointer (build_indirect_ref (decl), BINFO_TYPE (base_binfo)); ! else if (BINFO_OFFSET_ZEROP (base_binfo)) ! this_decl = build1 (NOP_EXPR, TYPE_POINTER_TO (BINFO_TYPE (base_binfo)), decl); else ! this_decl = build (PLUS_EXPR, TYPE_POINTER_TO (BINFO_TYPE (base_binfo)), ! decl, BINFO_OFFSET (base_binfo)); ! result = tree_cons (NULL_TREE, build_virtual_init (main_binfo, base_binfo, this_decl), result); } return build_compound_expr (result); *************** *** 664,668 **** BINFO_TYPE (main_binfo), 0)); #else ! assert (BINFO_TYPE (main_binfo) == BINFO_TYPE (binfo)); vtbl = BINFO_VTABLE (main_binfo); #endif /* 1 */ --- 668,672 ---- BINFO_TYPE (main_binfo), 0)); #else ! my_friendly_assert (BINFO_TYPE (main_binfo) == BINFO_TYPE (binfo), 208); vtbl = BINFO_VTABLE (main_binfo); #endif /* 1 */ *************** *** 971,975 **** if (fndecl) ! assert (TREE_CODE (fndecl) == FUNCTION_DECL); /* If the field is unique, we can use the parameter --- 975,979 ---- if (fndecl) ! my_friendly_assert (TREE_CODE (fndecl) == FUNCTION_DECL, 209); /* If the field is unique, we can use the parameter *************** *** 1075,1079 **** tree atype = build_cplus_array_type (TYPE_MAIN_VARIANT (TREE_TYPE (type)), TYPE_DOMAIN (type)); ! if (TREE_TYPE (exp) == TREE_TYPE (init)) TREE_TYPE (init) = atype; TREE_TYPE (exp) = atype; --- 1079,1083 ---- tree atype = build_cplus_array_type (TYPE_MAIN_VARIANT (TREE_TYPE (type)), TYPE_DOMAIN (type)); ! if (init && (TREE_TYPE (exp) == TREE_TYPE (init))) TREE_TYPE (init) = atype; TREE_TYPE (exp) = atype; *************** *** 1152,1155 **** --- 1156,1165 ---- flags |= LOOKUP_HAS_IN_CHARGE; } + + /* ARM $7.1.1: "[register] may be ignored and in most implementations + it will be ignored if the address of the variable is taken." + Since we're likely to do just that in the ctor call, clear this. */ + DECL_REGISTER (exp) = 0; + rval = build_method_call (exp, constructor_name (type), parms, binfo, flags|xxref_init_possible); *************** *** 1164,1168 **** if (TYPE_MAIN_VARIANT (init_type) == TYPE_MAIN_VARIANT (type) || (IS_AGGR_TYPE (init_type) ! && DERIVED_FROM_P (type, init_type))) { if (type == BINFO_TYPE (binfo) --- 1174,1178 ---- if (TYPE_MAIN_VARIANT (init_type) == TYPE_MAIN_VARIANT (type) || (IS_AGGR_TYPE (init_type) ! && UNIQUELY_DERIVED_FROM_P (type, init_type))) { if (type == BINFO_TYPE (binfo) *************** *** 1245,1249 **** { if (init == NULL_TREE) ! assert (parms == NULL_TREE); if (parms == NULL_TREE && TREE_VIA_VIRTUAL (binfo)) error_with_aggr_type (binfo, "virtual baseclass `%s' does not have default initializer"); --- 1255,1259 ---- { if (init == NULL_TREE) ! my_friendly_assert (parms == NULL_TREE, 210); if (parms == NULL_TREE && TREE_VIA_VIRTUAL (binfo)) error_with_aggr_type (binfo, "virtual baseclass `%s' does not have default initializer"); *************** *** 1297,1301 **** tree rval; ! assert (init != error_mark_node && type != error_mark_node); /* Use a function returning the desired type to initialize EXP for us. --- 1307,1311 ---- tree rval; ! my_friendly_assert (init != error_mark_node && type != error_mark_node, 211); /* Use a function returning the desired type to initialize EXP for us. *************** *** 1380,1384 **** /* Failing this assertion means that the return value from receives multiple initializations. */ ! assert (DECL_INITIAL (exp) == NULL_TREE || DECL_INITIAL (exp) == error_mark_node); DECL_INITIAL (exp) = init; } --- 1390,1396 ---- /* Failing this assertion means that the return value from receives multiple initializations. */ ! my_friendly_assert (DECL_INITIAL (exp) == NULL_TREE ! || DECL_INITIAL (exp) == error_mark_node, ! 212); DECL_INITIAL (exp) = init; } *************** *** 1893,1899 **** return error_mark_node; } ! if (DERIVED_FROM_P (DECL_FIELD_CONTEXT (fields), DECL_FIELD_CONTEXT (t))) ; ! else if (DERIVED_FROM_P (DECL_FIELD_CONTEXT (t), DECL_FIELD_CONTEXT (fields))) t = fields; else --- 1905,1911 ---- return error_mark_node; } ! if (UNIQUELY_DERIVED_FROM_P (DECL_FIELD_CONTEXT (fields), DECL_FIELD_CONTEXT (t))) ; ! else if (UNIQUELY_DERIVED_FROM_P (DECL_FIELD_CONTEXT (t), DECL_FIELD_CONTEXT (fields))) t = fields; else *************** *** 2025,2031 **** if (TYPE_VIRTUAL_P (ctype) ! || (flag_all_virtual == 1 ! && (TYPE_OVERLOADS_METHOD_CALL_EXPR (ctype) ! || TYPE_NEEDS_WRAPPER (ctype)))) { tree e0, e1, e3; --- 2037,2041 ---- if (TYPE_VIRTUAL_P (ctype) ! || (flag_all_virtual == 1 && TYPE_OVERLOADS_METHOD_CALL_EXPR (ctype))) { tree e0, e1, e3; *************** *** 2076,2080 **** e3 = build_vfn_ref (exp_addr_ptr, exp, e0); ! assert (e3 != error_mark_node); /* Change this pointer type from `void *' to the --- 2086,2090 ---- e3 = build_vfn_ref (exp_addr_ptr, exp, e0); ! my_friendly_assert (e3 != error_mark_node, 213); /* Change this pointer type from `void *' to the *************** *** 2108,2112 **** if (TREE_CODE (exp) != OFFSET_REF) { ! assert (TREE_CODE (type) == OFFSET_TYPE); if (TYPE_OFFSET_BASETYPE (type) != current_class_type) { --- 2118,2122 ---- if (TREE_CODE (exp) != OFFSET_REF) { ! my_friendly_assert (TREE_CODE (type) == OFFSET_TYPE, 214); if (TYPE_OFFSET_BASETYPE (type) != current_class_type) { *************** *** 2835,2850 **** has_array = 1; this_nelts = TREE_OPERAND (absdcl, 1); ! if (this_nelts) ! this_nelts = save_expr (this_nelts); ! absdcl = TREE_OPERAND (absdcl, 0); ! if (this_nelts == NULL_TREE) ! error ("new of array type fails to specify size"); ! else if (this_nelts == integer_zero_node) { ! warning ("zero size array reserves no space"); ! nelts = integer_zero_node; } else ! nelts = build_binary_op (MULT_EXPR, nelts, this_nelts); } --- 2845,2864 ---- has_array = 1; this_nelts = TREE_OPERAND (absdcl, 1); ! if (this_nelts != error_mark_node) { ! this_nelts = save_expr (this_nelts); ! absdcl = TREE_OPERAND (absdcl, 0); ! if (this_nelts == NULL_TREE) ! error ("new of array type fails to specify size"); ! else if (this_nelts == integer_zero_node) ! { ! warning ("zero size array reserves no space"); ! nelts = integer_zero_node; ! } ! else ! nelts = build_binary_op (MULT_EXPR, nelts, this_nelts); } else ! nelts = integer_zero_node; } *************** *** 2890,2894 **** /* A builtin type. */ decl = lookup_name (decl, 1); ! assert (TREE_CODE (decl) == TYPE_DECL); type = TREE_TYPE (decl); } --- 2904,2908 ---- /* A builtin type. */ decl = lookup_name (decl, 1); ! my_friendly_assert (TREE_CODE (decl) == TYPE_DECL, 215); type = TREE_TYPE (decl); } *************** *** 2934,2938 **** else { ! assert (has_array != 0); nelts = build_binary_op (MULT_EXPR, nelts, this_nelts); } --- 2948,2952 ---- else { ! my_friendly_assert (has_array != 0, 216); nelts = build_binary_op (MULT_EXPR, nelts, this_nelts); } *************** *** 3166,3170 **** else { ! assert (TREE_CODE (rval) == VAR_DECL); RTL_EXPR_RTL (xval) = DECL_RTL (rval); } --- 3180,3184 ---- else { ! my_friendly_assert (TREE_CODE (rval) == VAR_DECL, 217); RTL_EXPR_RTL (xval) = DECL_RTL (rval); } *************** *** 3296,3300 **** tree name; ! assert (TYPE_DYNAMIC (type)); sprintf (buf, "ZN_%s_", TYPE_NAME_STRING (type)); return get_identifier (buf); --- 3310,3314 ---- tree name; ! my_friendly_assert (TYPE_DYNAMIC (type), 218); sprintf (buf, "ZN_%s_", TYPE_NAME_STRING (type)); return get_identifier (buf); *************** *** 3314,3318 **** tree lookup_tmp = integer_zero_node; ! assert (TYPE_DYNAMIC (type)); if (filename) --- 3328,3332 ---- tree lookup_tmp = integer_zero_node; ! my_friendly_assert (TYPE_DYNAMIC (type), 219); if (filename) *************** *** 3566,3574 **** tree addr; { ! tree cookie_addr = build (MINUS_EXPR, TYPE_POINTER_TO (BI_header_type), ! addr, BI_header_size); ! tree cookie = build_indirect_ref (cookie_addr, 0); tree adjusted_addr, ptr_2comp; ptr_2comp = build_component_ref (cookie, get_identifier ("ptr_2comp"), 0, 0); adjusted_addr = save_expr (build (MINUS_EXPR, TREE_TYPE (addr), addr, BI_header_size)); --- 3580,3594 ---- tree addr; { ! tree cookie_addr; ! tree cookie; tree adjusted_addr, ptr_2comp; + if (TREE_SIDE_EFFECTS (addr)) + addr = save_expr (addr); + + cookie_addr = build (MINUS_EXPR, TYPE_POINTER_TO (BI_header_type), + addr, BI_header_size); + cookie = build_indirect_ref (cookie_addr, 0); + ptr_2comp = build_component_ref (cookie, get_identifier ("ptr_2comp"), 0, 0); adjusted_addr = save_expr (build (MINUS_EXPR, TREE_TYPE (addr), addr, BI_header_size)); *************** *** 3693,3697 **** } ! assert (IS_AGGR_TYPE (type)); if (! TYPE_NEEDS_DESTRUCTOR (type)) --- 3713,3717 ---- } ! my_friendly_assert (IS_AGGR_TYPE (type), 220); if (! TYPE_NEEDS_DESTRUCTOR (type)) *************** *** 3798,3802 **** /* Used to mean that this destructor was known to be empty, but that's now obsolete. */ ! assert (DECL_INITIAL (dtor) != void_type_node); TREE_CHAIN (parms) = build_tree_list (NULL_TREE, auto_delete); --- 3818,3822 ---- /* Used to mean that this destructor was known to be empty, but that's now obsolete. */ ! my_friendly_assert (DECL_INITIAL (dtor) != void_type_node, 221); TREE_CHAIN (parms) = build_tree_list (NULL_TREE, auto_delete); *************** *** 3814,3818 **** tree binfos = BINFO_BASETYPES (TYPE_BINFO (type)); int i, n_baseclasses = binfos ? TREE_VEC_LENGTH (binfos) : 0; ! tree child = n_baseclasses > 0 ? TREE_VEC_ELT (binfos, 0) : NULL_TREE; tree exprstmt = NULL_TREE; tree parent_auto_delete = auto_delete; --- 3834,3838 ---- tree binfos = BINFO_BASETYPES (TYPE_BINFO (type)); int i, n_baseclasses = binfos ? TREE_VEC_LENGTH (binfos) : 0; ! tree base_binfo = n_baseclasses > 0 ? TREE_VEC_ELT (binfos, 0) : NULL_TREE; tree exprstmt = NULL_TREE; tree parent_auto_delete = auto_delete; *************** *** 3847,3853 **** } } ! else if (child == NULL_TREE ! || (TREE_VIA_VIRTUAL (child) == 0 ! && ! TYPE_NEEDS_DESTRUCTOR (BINFO_TYPE (child)))) { tree virtual_size; --- 3867,3873 ---- } } ! else if (base_binfo == NULL_TREE ! || (TREE_VIA_VIRTUAL (base_binfo) == 0 ! && ! TYPE_NEEDS_DESTRUCTOR (BINFO_TYPE (base_binfo)))) { tree virtual_size; *************** *** 3869,3879 **** exprstmt = build_tree_list (NULL_TREE, cond); ! if (child ! && ! TREE_VIA_VIRTUAL (child) ! && TYPE_NEEDS_DESTRUCTOR (BINFO_TYPE (child))) { tree this_auto_delete; ! if (BINFO_OFFSET_ZEROP (child)) this_auto_delete = parent_auto_delete; else --- 3889,3899 ---- exprstmt = build_tree_list (NULL_TREE, cond); ! if (base_binfo ! && ! TREE_VIA_VIRTUAL (base_binfo) ! && TYPE_NEEDS_DESTRUCTOR (BINFO_TYPE (base_binfo))) { tree this_auto_delete; ! if (BINFO_OFFSET_ZEROP (base_binfo)) this_auto_delete = parent_auto_delete; else *************** *** 3880,3884 **** this_auto_delete = integer_zero_node; ! expr = build_delete (TYPE_POINTER_TO (BINFO_TYPE (child)), addr, this_auto_delete, flags|LOOKUP_PROTECTED_OK, 0, 0); exprstmt = tree_cons (NULL_TREE, expr, exprstmt); --- 3900,3904 ---- this_auto_delete = integer_zero_node; ! expr = build_delete (TYPE_POINTER_TO (BINFO_TYPE (base_binfo)), addr, this_auto_delete, flags|LOOKUP_PROTECTED_OK, 0, 0); exprstmt = tree_cons (NULL_TREE, expr, exprstmt); *************** *** 3888,3901 **** for (i = 1; i < n_baseclasses; i++) { ! child = TREE_VEC_ELT (binfos, i); ! if (! TYPE_NEEDS_DESTRUCTOR (BINFO_TYPE (child)) ! || TREE_VIA_VIRTUAL (child)) continue; /* May be zero offset if other baseclasses are virtual. */ ! expr = fold (build (PLUS_EXPR, TYPE_POINTER_TO (BINFO_TYPE (child)), ! addr, BINFO_OFFSET (child))); ! expr = build_delete (TYPE_POINTER_TO (BINFO_TYPE (child)), expr, integer_zero_node, flags|LOOKUP_PROTECTED_OK, 0, 0); --- 3908,3921 ---- for (i = 1; i < n_baseclasses; i++) { ! base_binfo = TREE_VEC_ELT (binfos, i); ! if (! TYPE_NEEDS_DESTRUCTOR (BINFO_TYPE (base_binfo)) ! || TREE_VIA_VIRTUAL (base_binfo)) continue; /* May be zero offset if other baseclasses are virtual. */ ! expr = fold (build (PLUS_EXPR, TYPE_POINTER_TO (BINFO_TYPE (base_binfo)), ! addr, BINFO_OFFSET (base_binfo))); ! expr = build_delete (TYPE_POINTER_TO (BINFO_TYPE (base_binfo)), expr, integer_zero_node, flags|LOOKUP_PROTECTED_OK, 0, 0); *************** *** 3933,3937 **** tree result = NULL_TREE; tree addr = build_unary_op (ADDR_EXPR, decl, 0); ! assert (addr != error_mark_node); while (vbases) { --- 3953,3957 ---- tree result = NULL_TREE; tree addr = build_unary_op (ADDR_EXPR, decl, 0); ! my_friendly_assert (addr != error_mark_node, 222); while (vbases) { *************** *** 3997,4000 **** --- 4017,4024 ---- base = stabilize_reference (base); + + /* Since we can use base many times, save_epr it. */ + if (TREE_SIDE_EFFECTS (base)) + base = save_expr (base); if (TREE_CODE (ptype) == POINTER_TYPE) diff -rc2N gcc-2.3.1/cp-input.c gcc-2.3.2/cp-input.c *** gcc-2.3.1/cp-input.c Thu Sep 17 20:01:37 1992 --- gcc-2.3.2/cp-input.c Thu Nov 12 20:51:44 1992 *************** *** 29,33 **** inlining). */ - #include "assert.h" #include #include "obstack.h" --- 29,32 ---- *************** *** 144,148 **** { struct input_source *inp = input; ! assert (putback_char == -1); to_be_restored = inp->input; input->offset++; --- 143,147 ---- { struct input_source *inp = input; ! my_friendly_assert (putback_char == -1, 223); to_be_restored = inp->input; input->offset++; *************** *** 174,178 **** int ch; { ! assert (putback_char == -1); putback_char = ch; } --- 173,177 ---- int ch; { ! my_friendly_assert (putback_char == -1, 224); putback_char = ch; } diff -rc2N gcc-2.3.1/cp-lex.c gcc-2.3.2/cp-lex.c *** gcc-2.3.1/cp-lex.c Tue Oct 20 14:54:29 1992 --- gcc-2.3.2/cp-lex.c Thu Nov 12 20:51:56 1992 *************** *** 22,25 **** --- 22,30 ---- /* This file is the lexical analyzer for GNU C++. */ + #if defined(GATHER_STATISTICS) || defined(SPEW_DEBUG) + #undef YYDEBUG + #define YYDEBUG 1 + #endif + #include #include *************** *** 34,38 **** #include "flags.h" #include "obstack.h" - #include "assert.h" #ifdef MULTIBYTE_CHARS --- 39,42 ---- *************** *** 67,70 **** --- 71,75 ---- void extract_interface_info (); + void yyerror (); /* This obstack is needed to hold text. It is not safe to use *************** *** 106,113 **** so it is left around in case the identifier is not a typedef but is used in a context which makes it a reference to a variable. */ ! extern tree lastiddecl; ! /* C++ extensions */ ! extern tree ridpointers[]; /* need this up here */ /* We may keep statistics about how long which files took to compile. */ --- 111,120 ---- so it is left around in case the identifier is not a typedef but is used in a context which makes it a reference to a variable. */ ! tree lastiddecl; ! /* The elements of `ridpointers' are identifier nodes ! for the reserved type names and storage classes. ! It is indexed by a RID_... value. */ ! tree ridpointers[(int) RID_MAX]; /* We may keep statistics about how long which files took to compile. */ *************** *** 250,255 **** Actual allocated length is maxtoken + 2. */ - #define NORID RID_UNUSED - #include "cp-hash.h" --- 257,260 ---- *************** *** 793,796 **** --- 798,966 ---- } + static + #ifdef __GNUC__ + __inline + #endif + void + yyprint (file, yychar, yylval) + FILE *file; + int yychar; + YYSTYPE yylval; + { + tree t; + switch (yychar) + { + case IDENTIFIER: + case TYPENAME: + case TYPESPEC: + case PTYPENAME: + case IDENTIFIER_DEFN: + case TYPENAME_DEFN: + case PTYPENAME_DEFN: + case TYPENAME_COLON: + case TYPENAME_ELLIPSIS: + case SCOPED_TYPENAME: + case SCSPEC: + t = yylval.ttype; + print_id: + my_friendly_assert (TREE_CODE (t) == IDENTIFIER_NODE, 224); + if (IDENTIFIER_POINTER (t)) + fprintf (file, " `%s'", IDENTIFIER_POINTER (t)); + break; + case AGGR: + if (yylval.ttype == class_type_node) + fprintf (file, " `class'"); + else if (yylval.ttype == record_type_node) + fprintf (file, " `struct'"); + else if (yylval.ttype == union_type_node) + fprintf (file, " `union'"); + else if (yylval.ttype == enum_type_node) + fprintf (file, " `enum'"); + else + my_friendly_abort (80); + break; + case PRE_PARSED_CLASS_DECL: + t = yylval.ttype; + my_friendly_assert (TREE_CODE (t) == TREE_LIST, 225); + t = TREE_VALUE (t); + goto print_id; + } + } + + static int *reduce_count; + int *token_count; + + #define REDUCE_LENGTH (sizeof (yyr2) / sizeof (yyr2[0])) + #define TOKEN_LENGTH (256 + sizeof (yytname) / sizeof (yytname[0])) + + int * + init_parse () + { + #ifdef GATHER_STATISTICS + reduce_count = (int *)malloc (sizeof (int) * (REDUCE_LENGTH + 1)); + bzero (reduce_count, sizeof (int) * (REDUCE_LENGTH + 1)); + reduce_count += 1; + token_count = (int *)malloc (sizeof (int) * (TOKEN_LENGTH + 1)); + bzero (token_count, sizeof (int) * (TOKEN_LENGTH + 1)); + token_count += 1; + #endif + return token_count; + } + + #ifdef GATHER_STATISTICS + void + yyhook (yyn) + int yyn; + { + reduce_count[yyn] += 1; + } + #endif + + static int + reduce_cmp (p, q) + int *p, *q; + { + return reduce_count[*q] - reduce_count[*p]; + } + + static int + token_cmp (p, q) + int *p, *q; + { + return token_count[*q] - token_count[*p]; + } + + void + print_parse_statistics () + { + #ifdef GATHER_STATISTICS + #if YYDEBUG != 0 + int i; + int maxlen = REDUCE_LENGTH; + unsigned *sorted; + + if (reduce_count[-1] == 0) + return; + + if (TOKEN_LENGTH > REDUCE_LENGTH) + maxlen = TOKEN_LENGTH; + sorted = (unsigned *) alloca (sizeof (int) * maxlen); + + for (i = 0; i < TOKEN_LENGTH; i++) + sorted[i] = i; + qsort (sorted, TOKEN_LENGTH, sizeof (int), token_cmp); + for (i = 0; i < TOKEN_LENGTH; i++) + { + int index = sorted[i]; + if (token_count[index] == 0) + break; + if (token_count[index] < token_count[-1]) + break; + fprintf (stderr, "token %d, `%s', count = %d\n", + index, yytname[YYTRANSLATE (index)], token_count[index]); + } + fprintf (stderr, "\n"); + for (i = 0; i < REDUCE_LENGTH; i++) + sorted[i] = i; + qsort (sorted, REDUCE_LENGTH, sizeof (int), reduce_cmp); + for (i = 0; i < REDUCE_LENGTH; i++) + { + int index = sorted[i]; + if (reduce_count[index] == 0) + break; + if (reduce_count[index] < reduce_count[-1]) + break; + fprintf (stderr, "rule %d, line %d, count = %d\n", + index, yyrline[index], reduce_count[index]); + } + fprintf (stderr, "\n"); + #endif + #endif + } + + /* Sets the value of the 'yydebug' variable to VALUE. + This is a function so we don't have to have YYDEBUG defined + in order to build the compiler. */ + void + set_yydebug (value) + int value; + { + #if YYDEBUG != 0 + yydebug = value; + #else + warning ("YYDEBUG not defined."); + #endif + } + + #ifdef SPEW_DEBUG + const char * + debug_yytranslate (value) + int value; + { + return yytname[YYTRANSLATE (value)]; + } + + #endif + /* Functions and data structures for #pragma interface. *************** *** 927,931 **** /* Now start processing the first inline function. */ t = prev; ! assert ((t->parm_vec == NULL_TREE) == (t->bindings == NULL_TREE)); if (t->parm_vec) push_template_decls (t->parm_vec, t->bindings, 0); --- 1097,1102 ---- /* Now start processing the first inline function. */ t = prev; ! my_friendly_assert ((t->parm_vec == NULL_TREE) == (t->bindings == NULL_TREE), ! 226); if (t->parm_vec) push_template_decls (t->parm_vec, t->bindings, 0); *************** *** 967,971 **** { struct pending_inline *i = (struct pending_inline *) TREE_PURPOSE (t); ! assert ((i->parm_vec == NULL_TREE) == (i->bindings == NULL_TREE)); if (i->parm_vec) pop_template_decls (i->parm_vec, i->bindings, 0); --- 1138,1143 ---- { struct pending_inline *i = (struct pending_inline *) TREE_PURPOSE (t); ! my_friendly_assert ((i->parm_vec == NULL_TREE) == (i->bindings == NULL_TREE), ! 227); if (i->parm_vec) pop_template_decls (i->parm_vec, i->bindings, 0); *************** *** 991,995 **** if (i && i->fndecl != NULL_TREE) { ! assert ((i->parm_vec == NULL_TREE) == (i->bindings == NULL_TREE)); if (i->parm_vec) push_template_decls (i->parm_vec, i->bindings, 0); --- 1163,1168 ---- if (i && i->fndecl != NULL_TREE) { ! my_friendly_assert ((i->parm_vec == NULL_TREE) == (i->bindings == NULL_TREE), ! 228); if (i->parm_vec) push_template_decls (i->parm_vec, i->bindings, 0); *************** *** 1043,1047 **** { if (pedantic) ! pedwarn ("ANSI C forbids newline in string constant"); lineno++; } --- 1216,1220 ---- { if (pedantic) ! pedwarn ("ANSI C++ forbids newline in string constant"); lineno++; } *************** *** 1087,1095 **** struct pending_input *p; { ! assert (nextchar == -1); nextchar = p->nextchar; ! assert (yychar == YYEMPTY || yychar == END_OF_SAVED_INPUT); yychar = p->yychar; ! assert (nextyychar == YYEMPTY); nextyychar = p->nextyychar; yylval = p->yylval; --- 1260,1268 ---- struct pending_input *p; { ! my_friendly_assert (nextchar == -1, 229); nextchar = p->nextchar; ! my_friendly_assert (yychar == YYEMPTY || yychar == END_OF_SAVED_INPUT, 230); yychar = p->yychar; ! my_friendly_assert (nextyychar == YYEMPTY, 231); nextyychar = p->nextyychar; yylval = p->yylval; *************** *** 1135,1139 **** else { ! assert (nextyychar == YYEMPTY); nextyychar = yychar; nextyylval = yylval; --- 1308,1312 ---- else { ! my_friendly_assert (nextyychar == YYEMPTY, 232); nextyychar = yychar; nextyylval = yylval; *************** *** 1182,1186 **** { if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE) ! assert (TYPE_MAX_VALUE (TREE_TYPE (decl)) == current_class_type); /* Inline functions can be compiled immediately. Other functions --- 1355,1360 ---- { if (TREE_CODE (TREE_TYPE (decl)) == METHOD_TYPE) ! my_friendly_assert (TYPE_MAX_VALUE (TREE_TYPE (decl)) == current_class_type, ! 233); /* Inline functions can be compiled immediately. Other functions *************** *** 2187,2196 **** #define ENDFILE -1 /* token that represents end-of-file */ static int ! readescape () { register int c = getch (); - register unsigned count; register int code; unsigned firstdig; int nonnull; --- 2361,2374 ---- #define ENDFILE -1 /* token that represents end-of-file */ + /* Read an escape sequence, returning its equivalent as a character, + or store 1 in *ignore_ptr if it is backslash-newline. */ + static int ! readescape (ignore_ptr) ! int *ignore_ptr; { register int c = getch (); register int code; + register unsigned count; unsigned firstdig; int nonnull; *************** *** 2199,2202 **** --- 2377,2386 ---- { case 'x': + if (warn_traditional) + warning ("the meaning of `\\x' varies with -traditional"); + + if (flag_traditional) + return c; + code = 0; count = 0; *************** *** 2231,2236 **** ; else if ((count - 1) * 4 >= TYPE_PRECISION (integer_type_node) ! || ((1 << (TYPE_PRECISION (integer_type_node) - (count - 1) * 4)) ! <= firstdig)) warning ("hex escape out of range"); return code; --- 2415,2421 ---- ; else if ((count - 1) * 4 >= TYPE_PRECISION (integer_type_node) ! || (count > 1 ! && ((1 << (TYPE_PRECISION (integer_type_node) - (count - 1) * 4)) ! <= firstdig))) warning ("hex escape out of range"); return code; *************** *** 2253,2257 **** case '\n': lineno++; ! return -1; case 'n': --- 2438,2443 ---- case '\n': lineno++; ! *ignore_ptr = 1; ! return 0; case 'n': *************** *** 2271,2274 **** --- 2457,2465 ---- case 'a': + if (warn_traditional) + warning ("the meaning of `\\a' varies with -traditional"); + + if (flag_traditional) + return c; return TARGET_BELL; *************** *** 2276,2283 **** --- 2467,2479 ---- return TARGET_VT; + case 'e': case 'E': + if (pedantic) + pedwarn ("non-ANSI-standard escape sequence, `\\%c'", c); return 033; case '?': + return c; + /* `\(', etc, are used at beginning of line to avoid confusing Emacs. */ case '(': *************** *** 2366,2370 **** /* We have already generated the error message. But we still want to return this value. */ ! id = lookup_field (current_class_type, token, 0); else if (TREE_CODE (field) == VAR_DECL || TREE_CODE (field) == CONST_DECL) --- 2562,2566 ---- /* We have already generated the error message. But we still want to return this value. */ ! id = lookup_field (current_class_type, token, 0, 0); else if (TREE_CODE (field) == VAR_DECL || TREE_CODE (field) == CONST_DECL) *************** *** 2507,2511 **** case '\t': case '\f': - case '\r': case '\v': case '\b': --- 2703,2706 ---- *************** *** 2513,2516 **** --- 2708,2714 ---- break; + case '\r': + /* Call skip_white_space so we can warn if appropriate. */ + case '\n': case '/': *************** *** 2715,2719 **** || VPTR_NAME_P (tmp) || DESTRUCTOR_NAME_P (tmp) - || WRAPPER_OR_ANTI_WRAPPER_NAME_P (tmp) || VTABLE_NAME_P (tmp) || TEMP_NAME_P (tmp) --- 2913,2916 ---- *************** *** 3082,3086 **** error ("three `l's in integer constant"); else if (pedantic) ! pedwarn ("ANSI C forbids long long integer constants"); spec_long_long = 1; } --- 3279,3283 ---- error ("three `l's in integer constant"); else if (pedantic) ! pedwarn ("ANSI C++ forbids long long integer constants"); spec_long_long = 1; } *************** *** 3211,3215 **** #if 0 if (warn_traditional && base != 10) ! warning ("small nondecimal constant becomes signed in ANSI C"); #endif type = integer_type_node; --- 3408,3412 ---- #if 0 if (warn_traditional && base != 10) ! warning ("small nondecimal constant becomes signed in ANSI C++"); #endif type = integer_type_node; *************** *** 3232,3236 **** #if 0 if (warn_traditional && !spec_unsigned) ! warning ("large integer constant becomes unsigned in ANSI C"); #endif if (flag_traditional && !spec_unsigned) --- 3429,3433 ---- #if 0 if (warn_traditional && !spec_unsigned) ! warning ("large integer constant becomes unsigned in ANSI C++"); #endif if (flag_traditional && !spec_unsigned) *************** *** 3250,3254 **** #if 0 if (warn_traditional && !spec_unsigned) ! warning ("large nondecimal constant is unsigned in ANSI C"); #endif --- 3447,3451 ---- #if 0 if (warn_traditional && !spec_unsigned) ! warning ("large nondecimal constant is unsigned in ANSI C++"); #endif *************** *** 3304,3309 **** if (c == '\\') { ! c = readescape (); ! if (c < 0) goto tryagain; if (width < HOST_BITS_PER_INT --- 3501,3507 ---- if (c == '\\') { ! int ignore = 0; ! c = readescape (&ignore); ! if (ignore) goto tryagain; if (width < HOST_BITS_PER_INT *************** *** 3314,3318 **** { if (pedantic) ! pedwarn ("ANSI C forbids newline in character constant"); lineno++; } --- 3512,3516 ---- { if (pedantic) ! pedwarn ("ANSI C++ forbids newline in character constant"); lineno++; } *************** *** 3408,3413 **** if (!ignore_escape_flag && c == '\\') { ! c = readescape (); ! if (c < 0) goto skipnewline; if (!wide_flag --- 3606,3612 ---- if (!ignore_escape_flag && c == '\\') { ! int ignore = 0; ! c = readescape (&ignore); ! if (ignore) goto skipnewline; if (!wide_flag *************** *** 3419,3423 **** { if (pedantic) ! pedwarn ("ANSI C forbids newline in string constant"); lineno++; } --- 3618,3622 ---- { if (pedantic) ! pedwarn ("ANSI C++ forbids newline in string constant"); lineno++; } *************** *** 3726,3731 **** LANG_DECL_PERMANENT ((struct lang_decl *) pi) = obstack == &permanent_obstack; ! assert (LANG_DECL_PERMANENT ((struct lang_decl *) pi) ! == TREE_PERMANENT (t)); DECL_MAIN_VARIANT (t) = t; if (current_lang_name == lang_name_cplusplus) --- 3925,3930 ---- LANG_DECL_PERMANENT ((struct lang_decl *) pi) = obstack == &permanent_obstack; ! my_friendly_assert (LANG_DECL_PERMANENT ((struct lang_decl *) pi) ! == TREE_PERMANENT (t), 234); DECL_MAIN_VARIANT (t) = t; if (current_lang_name == lang_name_cplusplus) *************** *** 3789,3793 **** obstack = saveable_obstack; else ! assert (obstack == &permanent_obstack); pi = (int *) obstack_alloc (obstack, sizeof (struct lang_decl_flags)); --- 3988,3992 ---- obstack = saveable_obstack; else ! my_friendly_assert (obstack == &permanent_obstack, 235); pi = (int *) obstack_alloc (obstack, sizeof (struct lang_decl_flags)); *************** *** 3831,3835 **** obstack = saveable_obstack; else ! assert (obstack == &permanent_obstack); pi = (int *) obstack_alloc (obstack, sizeof (struct lang_type)); --- 4030,4034 ---- obstack = saveable_obstack; else ! my_friendly_assert (obstack == &permanent_obstack, 236); pi = (int *) obstack_alloc (obstack, sizeof (struct lang_type)); *************** *** 3871,3875 **** obstack = saveable_obstack; else ! assert (obstack == &permanent_obstack); pi = (int *) obstack_alloc (obstack, sizeof (struct lang_decl)); --- 4070,4074 ---- obstack = saveable_obstack; else ! my_friendly_assert (obstack == &permanent_obstack, 237); pi = (int *) obstack_alloc (obstack, sizeof (struct lang_decl)); *************** *** 3946,3948 **** --- 4145,4178 ---- fprintf (stderr, s, "((anonymous))"); fprintf (stderr, " (compiler error)\n"); + } + + void + yyerror (string) + char *string; + { + extern int end_of_file; + extern int input_redirected (); + char buf[200]; + + strcpy (buf, string); + + /* We can't print string and character constants well + because the token_buffer contains the result of processing escapes. */ + if (end_of_file) + strcat (buf, input_redirected () + ? " at end of saved text" + : " at end of input"); + else if (token_buffer[0] == 0) + strcat (buf, " at null character"); + else if (token_buffer[0] == '"') + strcat (buf, " before string constant"); + else if (token_buffer[0] == '\'') + strcat (buf, " before character constant"); + else if (token_buffer[0] < 040 || (unsigned char) token_buffer[0] >= 0177) + sprintf (buf + strlen (buf), " before character 0%o", + (unsigned char) token_buffer[0]); + else + strcat (buf, " before `%s'"); + + error (buf, token_buffer); } diff -rc2N gcc-2.3.1/cp-lex.h gcc-2.3.2/cp-lex.h *** gcc-2.3.1/cp-lex.h Tue Aug 4 17:31:40 1992 --- gcc-2.3.2/cp-lex.h Thu Nov 12 20:52:00 1992 *************** *** 1,4 **** ! /* Define constants for communication with parse.y. ! Copyright (C) 1987 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@mcc.com) --- 1,4 ---- ! /* Define constants and variables for communication with cp-parse.y. ! Copyright (C) 1987, 1992 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@mcc.com) *************** *** 65,67 **** --- 65,90 ---- }; + #define NORID RID_UNUSED + #define RID_FIRST_MODIFIER RID_UNSIGNED + + /* The elements of `ridpointers' are identifier nodes + for the reserved type names and storage classes. + It is indexed by a RID_... value. */ + extern tree ridpointers[(int) RID_MAX]; + + /* the declaration found for the last IDENTIFIER token read in. + yylex must look this up to detect typedefs, which get token type TYPENAME, + so it is left around in case the identifier is not a typedef but is + used in a context which makes it a reference to a variable. */ + extern tree lastiddecl; + + extern char *token_buffer; /* Pointer to token buffer. */ + + /* Back-door communication channel to the lexer. */ + extern int looking_for_typename; + + extern tree make_pointer_declarator (), make_reference_declarator (); + extern void reinit_parse_for_function (); + extern void reinit_parse_for_method (); + extern int yylex (); diff -rc2N gcc-2.3.1/cp-method.c gcc-2.3.2/cp-method.c *** gcc-2.3.1/cp-method.c Tue Oct 20 14:37:35 1992 --- gcc-2.3.2/cp-method.c Mon Nov 23 20:46:24 1992 *************** *** 31,35 **** #include "cp-tree.h" #include "cp-class.h" - #include "assert.h" #include "obstack.h" --- 31,34 ---- *************** *** 67,72 **** static void dump_init (), dump_unary_op (), dump_binary_op (); - tree wrapper_name, wrapper_pred_name, anti_wrapper_name; - #ifdef NO_AUTO_OVERLOAD int is_overloaded (); --- 66,69 ---- *************** *** 76,86 **** init_method () { - char buf[sizeof (ANTI_WRAPPER_NAME_FORMAT) + 8]; - sprintf (buf, WRAPPER_NAME_FORMAT, ""); - wrapper_name = get_identifier (buf); - sprintf (buf, WRAPPER_PRED_NAME_FORMAT, ""); - wrapper_pred_name = get_identifier (buf); - sprintf (buf, ANTI_WRAPPER_NAME_FORMAT, ""); - anti_wrapper_name = get_identifier (buf); gcc_obstack_init (&scratch_obstack); scratch_firstobj = (char *)obstack_alloc (&scratch_obstack, 0); --- 73,76 ---- *************** *** 716,727 **** OB_PUTC (' '); } - #if 0 - else if (WRAPPER_NAME_P (name)) - sprintf (inline_bufp, " ()%s", IDENTIFIER_POINTER (DECL_NAME (t))); - else if (WRAPPER_PRED_NAME_P (name)) - sprintf (inline_bufp, " ()?%s", IDENTIFIER_POINTER (DECL_NAME (t))); - else if (ANTI_WRAPPER_NAME_P (name)) - sprintf (inline_bufp, " ~()%s", IDENTIFIER_POINTER (DECL_NAME (t))); - #endif else { --- 706,709 ---- *************** *** 892,896 **** { t = TREE_OPERAND (t, 0); ! assert (TREE_CODE (t) == CALL_EXPR); dump_init (TREE_OPERAND (t, 0)); OB_PUTC ('('); --- 874,878 ---- { t = TREE_OPERAND (t, 0); ! my_friendly_assert (TREE_CODE (t) == CALL_EXPR, 237); dump_init (TREE_OPERAND (t, 0)); OB_PUTC ('('); *************** *** 1000,1003 **** --- 982,988 ---- cname = TYPE_NAME (DECL_CLASS_CONTEXT (fndecl)); + if (DECL_STATIC_FUNCTION_P (fndecl)) + OB_PUTS ("static "); + if (print_ret_type_p && ! IDENTIFIER_TYPENAME_P (name)) { *************** *** 1005,1011 **** OB_PUTC (' '); } ! if (DECL_STATIC_FUNCTION_P (fndecl)) ! OB_PUTS ("static "); ! if (cname) { --- 990,994 ---- OB_PUTC (' '); } ! if (cname) { *************** *** 1056,1070 **** } else ! { ! #if 0 ! if (WRAPPER_NAME_P (name)) ! OB_PUTC2 ('(', ')'); ! if (WRAPPER_PRED_NAME_P (name)) ! OB_PUTS ("()?"); ! else if (ANTI_WRAPPER_NAME_P (name)) ! OB_PUTS ("~()"); ! #endif ! dump_decl (DECL_NAME (fndecl)); ! } OB_PUTC ('('); --- 1039,1043 ---- } else ! dump_decl (DECL_NAME (fndecl)); OB_PUTC ('('); *************** *** 1174,1178 **** tree args; ! assert (info->fndecl == method); args = DECL_ARGUMENTS (method); while (args) --- 1147,1151 ---- tree args; ! my_friendly_assert (info->fndecl == method, 238); args = DECL_ARGUMENTS (method); while (args) *************** *** 1195,1199 **** tree args; ! assert (info->fndecl == fndecl); args = DECL_ARGUMENTS (fndecl); while (args) --- 1168,1172 ---- tree args; ! my_friendly_assert (info->fndecl == fndecl, 239); args = DECL_ARGUMENTS (fndecl); while (args) *************** *** 1226,1230 **** { case -4: ! assert (TREE_CODE (cp->function) == TEMPLATE_DECL); error ("type unification failed for function template `%s'", err_name); return; --- 1199,1203 ---- { case -4: ! my_friendly_assert (TREE_CODE (cp->function) == TEMPLATE_DECL, 240); error ("type unification failed for function template `%s'", err_name); return; *************** *** 1246,1251 **** { /* Happens when we have an ambiguous base class. */ ! assert (get_binfo (DECL_CLASS_CONTEXT (cp->function), ! TREE_TYPE (TREE_TYPE (TREE_VALUE (parmtypes))), 1) == error_mark_node); return; } --- 1219,1225 ---- { /* Happens when we have an ambiguous base class. */ ! my_friendly_assert (get_binfo (DECL_CLASS_CONTEXT (cp->function), ! TREE_TYPE (TREE_TYPE (TREE_VALUE (parmtypes))), 1) == error_mark_node, ! 241); return; } *************** *** 1397,1401 **** while (TREE_CODE (value) == NON_LVALUE_EXPR) value = TREE_OPERAND (value, 0); ! assert (TREE_CODE (type) == PARM_DECL); type = TREE_TYPE (type); switch (TREE_CODE (type)) --- 1371,1375 ---- while (TREE_CODE (value) == NON_LVALUE_EXPR) value = TREE_OPERAND (value, 0); ! my_friendly_assert (TREE_CODE (type) == PARM_DECL, 242); type = TREE_TYPE (type); switch (TREE_CODE (type)) *************** *** 1404,1408 **** case ENUMERAL_TYPE: { ! assert (TREE_CODE (value) == INTEGER_CST); if (TYPE_PRECISION (value) == 2 * HOST_BITS_PER_WIDE_INT) { --- 1378,1382 ---- case ENUMERAL_TYPE: { ! my_friendly_assert (TREE_CODE (value) == INTEGER_CST, 243); if (TYPE_PRECISION (value) == 2 * HOST_BITS_PER_WIDE_INT) { *************** *** 1430,1435 **** REAL_VALUE_TYPE val; char *bufp = digit_buffer; ! assert (TREE_CODE (value) == REAL_CST); val = TREE_REAL_CST (value); if (val < 0) --- 1404,1410 ---- REAL_VALUE_TYPE val; char *bufp = digit_buffer; + extern char *index (); ! my_friendly_assert (TREE_CODE (value) == REAL_CST, 244); val = TREE_REAL_CST (value); if (val < 0) *************** *** 1475,1479 **** if (TREE_CODE (value) == VAR_DECL) { ! assert (DECL_NAME (value) != 0); build_overload_identifier (DECL_NAME (value)); return; --- 1450,1454 ---- if (TREE_CODE (value) == VAR_DECL) { ! my_friendly_assert (DECL_NAME (value) != 0, 245); build_overload_identifier (DECL_NAME (value)); return; *************** *** 1481,1485 **** else if (TREE_CODE (value) == FUNCTION_DECL) { ! assert (DECL_NAME (value) != 0); build_overload_identifier (DECL_NAME (value)); return; --- 1456,1460 ---- else if (TREE_CODE (value) == FUNCTION_DECL) { ! my_friendly_assert (DECL_NAME (value) != 0, 246); build_overload_identifier (DECL_NAME (value)); return; *************** *** 1486,1494 **** } else ! { ! debug_tree (type); ! debug_tree (value); ! my_friendly_abort (71); ! } default: sorry ("conversion of %s as PT parameter", --- 1461,1467 ---- } else ! my_friendly_abort (71); ! break; /* not really needed */ ! default: sorry ("conversion of %s as PT parameter", *************** *** 1776,1780 **** /* See if anybody is wasting memory. */ ! assert (parmtypes == void_list_node); #endif /* This is the end of a parameter list. */ --- 1749,1753 ---- /* See if anybody is wasting memory. */ ! my_friendly_assert (parmtypes == void_list_node, 247); #endif /* This is the end of a parameter list. */ *************** *** 1814,1818 **** name = DECL_NAME (name); } ! assert (TREE_CODE (name) == IDENTIFIER_NODE); if (i > 1) { --- 1787,1791 ---- name = DECL_NAME (name); } ! my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 248); if (i > 1) { *************** *** 2009,2013 **** } /* If there's no change, we have an inappropriate T_DESC_FORMAT. */ ! assert (changed != 0); } #endif --- 1982,1986 ---- } /* If there's no change, we have an inappropriate T_DESC_FORMAT. */ ! my_friendly_assert (changed != 0, 249); } #endif *************** *** 2092,2097 **** enum tree_code code; int flags; ! tree xarg1, xarg2; ! tree arg3; { tree rval = 0; --- 2065,2069 ---- enum tree_code code; int flags; ! tree xarg1, xarg2, arg3; { tree rval = 0; *************** *** 2204,2208 **** /* This happens when the user mis-declares `operator delete'. Should now be impossible. */ ! assert (rval != error_mark_node); TREE_TYPE (rval) = void_type_node; return rval; --- 2176,2180 ---- /* This happens when the user mis-declares `operator delete'. Should now be impossible. */ ! my_friendly_assert (rval != error_mark_node, 250); TREE_TYPE (rval) = void_type_node; return rval; *************** *** 2290,2294 **** if (code == MODIFY_EXPR) ! fnname = ansi_assopname[(int)arg3]; else fnname = ansi_opname[(int) code]; --- 2262,2266 ---- if (code == MODIFY_EXPR) ! fnname = ansi_assopname[(int) TREE_CODE (arg3)]; else fnname = ansi_opname[(int) code]; *************** *** 2407,2411 **** fndecl = TREE_VALUE (fields); ! assert (TREE_CODE (fndecl) == FUNCTION_DECL); if (DECL_CHAIN (fndecl) == NULL_TREE) { --- 2379,2383 ---- fndecl = TREE_VALUE (fields); ! my_friendly_assert (TREE_CODE (fndecl) == FUNCTION_DECL, 251); if (DECL_CHAIN (fndecl) == NULL_TREE) { *************** *** 2517,2521 **** if (TREE_CODE (type) == REFERENCE_TYPE) { ! assert (TREE_CODE (value) == VAR_DECL || TREE_CODE (value) == PARM_DECL); if (DECL_REFERENCE_SLOT (value)) return DECL_REFERENCE_SLOT (value); --- 2489,2494 ---- if (TREE_CODE (type) == REFERENCE_TYPE) { ! my_friendly_assert (TREE_CODE (value) == VAR_DECL ! || TREE_CODE (value) == PARM_DECL, 252); if (DECL_REFERENCE_SLOT (value)) return DECL_REFERENCE_SLOT (value); *************** *** 2524,2556 **** } - /* NONWRAPPER is nonzero if this call is not to be wrapped. - TYPE is the type that the wrapper belongs to (in case - it should be non-virtual). - DECL is the function will will be (not be) wrapped. */ - tree - hack_wrapper (nonwrapper, type, decl) - int nonwrapper; - tree type, decl; - { - if (type == NULL_TREE || is_aggr_typedef (type, 1)) - { - if (type) - type = TREE_TYPE (type); - - switch (nonwrapper) - { - case 0: - return build_nt (WRAPPER_EXPR, type, decl); - case 1: - return build_nt (ANTI_WRAPPER_EXPR, type, decl); - case 2: - return build_nt (WRAPPER_EXPR, type, - build_nt (COND_EXPR, decl, NULL_TREE, NULL_TREE)); - default: - assert (0 <= nonwrapper && nonwrapper <= 2); - } - } - return error_mark_node; - } /* Given an object OF, and a type conversion operator COMPONENT --- 2497,2500 ---- *************** *** 2578,2583 **** if (of) ! assert (IS_AGGR_TYPE (TREE_TYPE (of))); ! assert (TREE_CODE (component) == TYPE_EXPR); tmp = TREE_OPERAND (component, 0); --- 2522,2527 ---- if (of) ! my_friendly_assert (IS_AGGR_TYPE (TREE_TYPE (of)), 253); ! my_friendly_assert (TREE_CODE (component) == TYPE_EXPR, 254); tmp = TREE_OPERAND (component, 0); *************** *** 2632,2636 **** case SCOPE_REF: ! assert (cname == 0); cname = TREE_OPERAND (tmp, 0); tmp = TREE_OPERAND (tmp, 1); --- 2576,2580 ---- case SCOPE_REF: ! my_friendly_assert (cname == 0, 255); cname = TREE_OPERAND (tmp, 0); tmp = TREE_OPERAND (tmp, 1); *************** *** 2654,2658 **** of = NULL_TREE; } ! else assert (cname == DECL_NAME (of)); } --- 2598,2602 ---- of = NULL_TREE; } ! else my_friendly_assert (cname == DECL_NAME (of), 256); } diff -rc2N gcc-2.3.1/cp-parse.y gcc-2.3.2/cp-parse.y *** gcc-2.3.1/cp-parse.y Mon Oct 19 18:19:36 1992 --- gcc-2.3.2/cp-parse.y Mon Nov 23 21:08:16 1992 *************** *** 56,60 **** #include "cp-lex.h" #include "cp-tree.h" - #include "assert.h" extern tree void_list_node; --- 56,59 ---- *************** *** 74,84 **** static void position_after_white_space (); - /* The elements of `ridpointers' are identifier nodes - for the reserved type names and storage classes. - It is indexed by a RID_... value. */ - - tree ridpointers[(int) RID_MAX]; - #define NORID RID_UNUSED - /* Contains error message to give if user tries to declare a variable where one does not belong. */ --- 73,76 ---- *************** *** 247,251 **** /* %type primary_no_id */ %type nonmomentary_expr ! %type forhead.2 initdcl0 notype_initdcl0 wrapper member_init_list %type .scope try ansi_try %type template_header template_parm_list template_parm --- 239,243 ---- /* %type primary_no_id */ %type nonmomentary_expr ! %type forhead.2 initdcl0 notype_initdcl0 member_init_list %type .scope try ansi_try %type template_header template_parm_list template_parm *************** *** 253,257 **** %type template_instantiation template_type_name tmpl.1 tmpl.2 %type template_instantiate_once template_instantiate_some ! %type fn_tmpl_end try_for_typename /* in order to recognize aggr tags as defining and thus shadowing. */ --- 245,250 ---- %type template_instantiation template_type_name tmpl.1 tmpl.2 %type template_instantiate_once template_instantiate_some ! %type fn_tmpl_end ! /* %type try_for_typename */ /* in order to recognize aggr tags as defining and thus shadowing. */ *************** *** 267,286 **** %{ - /* the declaration found for the last IDENTIFIER token read in. - yylex must look this up to detect typedefs, which get token type TYPENAME, - so it is left around in case the identifier is not a typedef but is - used in a context which makes it a reference to a variable. */ - tree lastiddecl; - - /* Back-door communication channel to the lexer. */ - extern int looking_for_typename; - - tree make_pointer_declarator (), make_reference_declarator (); - - void reinit_parse_for_function (); - void reinit_parse_for_method (); - /* List of types and structure classes of the current declaration. */ ! tree current_declspecs; /* When defining an aggregate, this is the most recent one being defined. */ --- 260,265 ---- %{ /* List of types and structure classes of the current declaration. */ ! static tree current_declspecs; /* When defining an aggregate, this is the most recent one being defined. */ *************** *** 287,300 **** static tree current_aggr; ! int undeclared_variable_notice; /* 1 if we explained undeclared var errors. */ ! int yylex (); - static - #ifdef __GNUC__ - __inline - #endif - void yyprint (); #define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL) %} --- 266,276 ---- static tree current_aggr; ! /* 1 if we explained undeclared var errors. */ ! int undeclared_variable_notice; ! /* Tell yyparse how to print a token's value, if yydebug is set. */ #define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL) + extern void yyprint (); %} *************** *** 335,339 **** | ASM_KEYWORD '(' string ')' ';' { if (pedantic) ! pedwarn ("ANSI C forbids use of `asm' keyword"); if (TREE_CHAIN ($3)) $3 = combine_strings ($3); assemble_asm ($3); } --- 311,315 ---- | ASM_KEYWORD '(' string ')' ';' { if (pedantic) ! pedwarn ("ANSI C++ forbids use of `asm' keyword"); if (TREE_CHAIN ($3)) $3 = combine_strings ($3); assemble_asm ($3); } *************** *** 451,464 **** momentary = suspend_momentary (); d = start_decl ($2, /*current_declspecs*/0, 0, $3); ! decl_attributes (d, $5); finish_decl (d, NULL_TREE, $4, 0); - - #if 0 /* Need to sort out destructor templates, and not give warnings - for them. */ - if (pedantic) - pedwarn ("ANSI C forbids data definition with no type or storage class"); - else if (! flag_traditional && ! have_extern_spec) - warning ("data definition has no type or storage class"); - #endif end_template_decl ($1, d, 0); if ($6 != ';') --- 427,432 ---- momentary = suspend_momentary (); d = start_decl ($2, /*current_declspecs*/0, 0, $3); ! cplus_decl_attributes (d, $5); finish_decl (d, NULL_TREE, $4, 0); end_template_decl ($1, d, 0); if ($6 != ';') *************** *** 476,480 **** momentary = suspend_momentary (); d = start_decl ($3, current_declspecs, 0, $4); ! decl_attributes (d, $6); finish_decl (d, NULL_TREE, $5, 0); end_exception_decls (); --- 444,448 ---- momentary = suspend_momentary (); d = start_decl ($3, current_declspecs, 0, $4); ! cplus_decl_attributes (d, $6); finish_decl (d, NULL_TREE, $5, 0); end_exception_decls (); *************** *** 511,515 **** notype_initdecls ';' { if (pedantic) ! pedwarn ("ANSI C forbids data definition with no type or storage class"); else if (! flag_traditional && ! have_extern_spec) warning ("data definition has no type or storage class"); } --- 479,483 ---- notype_initdecls ';' { if (pedantic) ! pedwarn ("ANSI C++ forbids data definition with no type or storage class"); else if (! flag_traditional && ! have_extern_spec) warning ("data definition has no type or storage class"); } *************** *** 824,845 **** | '~' identifier { $$ = build_parse_node (BIT_NOT_EXPR,$2);} | operator_name - | wrapper IDENTIFIER - { $$ = hack_wrapper ($$, NULL_TREE, $2); } - | wrapper TYPENAME - { $$ = hack_wrapper ($$, NULL_TREE, $2); } - | wrapper operator_name - { $$ = hack_wrapper ($$, NULL_TREE, $2); } - | wrapper scoped_id IDENTIFIER - { $$ = hack_wrapper ($$, $2, $3); } - | wrapper scoped_id operator_name - { $$ = hack_wrapper ($$, $2, $3); } - ; - - wrapper: LEFT_RIGHT - { $$ = 0; } - | '~' LEFT_RIGHT - { $$ = 1; } - | LEFT_RIGHT '?' - { $$ = 2; } ; --- 792,795 ---- *************** *** 909,913 **** t = xref_tag (DECL_TEMPLATE_INFO (tmpl)->aggr, id, $2); set_current_level_tags_transparency (1); ! assert (TREE_CODE (t) == RECORD_TYPE); $$ = t; --- 859,863 ---- t = xref_tag (DECL_TEMPLATE_INFO (tmpl)->aggr, id, $2); set_current_level_tags_transparency (1); ! my_friendly_assert (TREE_CODE (t) == RECORD_TYPE, 257); $$ = t; *************** *** 923,927 **** /* Need to copy it to clear the chain pointer, and need to get it into permanent storage. */ ! assert (TREE_CODE (decl) == TYPE_DECL); push_obstacks (&permanent_obstack, &permanent_obstack); decl = copy_node (decl); --- 873,877 ---- /* Need to copy it to clear the chain pointer, and need to get it into permanent storage. */ ! my_friendly_assert (TREE_CODE (decl) == TYPE_DECL, 258); push_obstacks (&permanent_obstack, &permanent_obstack); decl = copy_node (decl); *************** *** 1017,1020 **** --- 967,976 ---- TREE_NEGATED_INT ($$) = 1; } + /* Refer to the address of a label as a pointer. */ + | ANDAND identifier + { tree label = lookup_label ($2); + TREE_USED (label) = 1; + $$ = build1 (ADDR_EXPR, ptr_type_node, label); + TREE_CONSTANT ($$) = 1; } | SIZEOF unary_expr %prec UNARY { if (TREE_CODE ($2) == COMPONENT_REF *************** *** 1074,1086 **** | .scope new typespec '(' nonnull_exprlist ')' { $$ = build_new ($2, $3, $5, $$); } ! | .scope NEW '(' nonnull_exprlist ')' typespec '(' nonnull_exprlist ')' { $$ = build_new ($4, $6, $8, $$); } | .scope new typespec LEFT_RIGHT { $$ = build_new ($2, $3, NULL_TREE, $$); } ! | .scope NEW '(' nonnull_exprlist ')' typespec LEFT_RIGHT { $$ = build_new ($4, $6, NULL_TREE, $$); } | .scope new typename '=' init %prec '=' { $$ = build_new ($2, $3, $5, $$); } ! | .scope NEW '(' nonnull_exprlist ')' typename '=' init %prec '=' { $$ = build_new ($4, $6, $8, $$); } --- 1030,1042 ---- | .scope new typespec '(' nonnull_exprlist ')' { $$ = build_new ($2, $3, $5, $$); } ! | .scope new '(' nonnull_exprlist ')' typespec '(' nonnull_exprlist ')' { $$ = build_new ($4, $6, $8, $$); } | .scope new typespec LEFT_RIGHT { $$ = build_new ($2, $3, NULL_TREE, $$); } ! | .scope new '(' nonnull_exprlist ')' typespec LEFT_RIGHT { $$ = build_new ($4, $6, NULL_TREE, $$); } | .scope new typename '=' init %prec '=' { $$ = build_new ($2, $3, $5, $$); } ! | .scope new '(' nonnull_exprlist ')' typename '=' init %prec '=' { $$ = build_new ($4, $6, $8, $$); } *************** *** 1105,1113 **** | .scope new '(' typed_typespecs absdcl ')' { $$ = build_new ($2, build_decl_list ($4, $5), NULL_TREE, $$); } ! | .scope NEW '(' nonnull_exprlist ')' '(' typed_typespecs absdcl ')' { $$ = build_new ($4, build_decl_list ($7, $8), NULL_TREE, $$); } | .scope new '(' nonempty_type_quals absdcl ')' { $$ = build_new ($2, build_decl_list ($4, $5), NULL_TREE, $$); } ! | .scope NEW '(' nonnull_exprlist ')' '(' nonempty_type_quals absdcl ')' { $$ = build_new ($4, build_decl_list ($7, $8), NULL_TREE, $$); } /* Unswallow a ':' which is probably meant for ?: expression. */ --- 1061,1069 ---- | .scope new '(' typed_typespecs absdcl ')' { $$ = build_new ($2, build_decl_list ($4, $5), NULL_TREE, $$); } ! | .scope new '(' nonnull_exprlist ')' '(' typed_typespecs absdcl ')' { $$ = build_new ($4, build_decl_list ($7, $8), NULL_TREE, $$); } | .scope new '(' nonempty_type_quals absdcl ')' { $$ = build_new ($2, build_decl_list ($4, $5), NULL_TREE, $$); } ! | .scope new '(' nonnull_exprlist ')' '(' nonempty_type_quals absdcl ')' { $$ = build_new ($4, build_decl_list ($7, $8), NULL_TREE, $$); } /* Unswallow a ':' which is probably meant for ?: expression. */ *************** *** 1114,1118 **** | .scope new TYPENAME_COLON { yyungetc (':', 1); $$ = build_new ($2, $3, NULL_TREE, $$); } ! | .scope NEW '(' nonnull_exprlist ')' TYPENAME_COLON { yyungetc (':', 1); $$ = build_new ($4, $6, NULL_TREE, $$); } --- 1070,1074 ---- | .scope new TYPENAME_COLON { yyungetc (':', 1); $$ = build_new ($2, $3, NULL_TREE, $$); } ! | .scope new '(' nonnull_exprlist ')' TYPENAME_COLON { yyungetc (':', 1); $$ = build_new ($4, $6, NULL_TREE, $$); } *************** *** 1198,1202 **** tree init = build_nt (CONSTRUCTOR, NULL_TREE, nreverse ($5)); if (pedantic) ! pedwarn ("ANSI C forbids constructor-expressions"); /* Indicate that this was a GNU C constructor expression. */ TREE_HAS_CONSTRUCTOR (init) = 1; --- 1154,1158 ---- tree init = build_nt (CONSTRUCTOR, NULL_TREE, nreverse ($5)); if (pedantic) ! pedwarn ("ANSI C++ forbids constructor-expressions"); /* Indicate that this was a GNU C constructor expression. */ TREE_HAS_CONSTRUCTOR (init) = 1; *************** *** 1266,1270 **** | expr_no_commas ASSIGN expr_no_commas { register tree rval; ! if (rval = build_opfncall (MODIFY_EXPR, LOOKUP_NORMAL, $$, $3, $2)) $$ = rval; else --- 1222,1227 ---- | expr_no_commas ASSIGN expr_no_commas { register tree rval; ! if (rval = build_opfncall (MODIFY_EXPR, LOOKUP_NORMAL, $$, $3, ! make_node ($2))) $$ = rval; else *************** *** 1324,1328 **** { tree rtl_exp; if (pedantic) ! pedwarn ("ANSI C forbids braced-groups within expressions"); rtl_exp = expand_end_stmt_expr ($2); /* The statements have side effects, so the group does. */ --- 1281,1285 ---- { tree rtl_exp; if (pedantic) ! pedwarn ("ANSI C++ forbids braced-groups within expressions"); rtl_exp = expand_end_stmt_expr ($2); /* The statements have side effects, so the group does. */ *************** *** 1585,1589 **** compstmt ')' { if (pedantic) ! pedwarn ("ANSI C forbids braced-groups within expressions"); $$ = expand_end_stmt_expr ($2); } | primary_no_id '(' nonnull_exprlist ')' --- 1542,1546 ---- compstmt ')' { if (pedantic) ! pedwarn ("ANSI C++ forbids braced-groups within expressions"); $$ = expand_end_stmt_expr ($2); } | primary_no_id '(' nonnull_exprlist ')' *************** *** 1669,1673 **** | primary POINTSAT { ! $$ = build_x_arrow ($$, 0); } ; --- 1626,1630 ---- | primary POINTSAT { ! $$ = build_x_arrow ($$); } ; *************** *** 1812,1820 **** { $$ = TREE_TYPE ($3); if (pedantic) ! pedwarn ("ANSI C forbids `typeof'"); } | TYPEOF '(' typename ')' { $$ = groktypename ($3); if (pedantic) ! pedwarn ("ANSI C forbids `typeof'"); } | template_type ; --- 1769,1777 ---- { $$ = TREE_TYPE ($3); if (pedantic) ! pedwarn ("ANSI C++ forbids `typeof'"); } | TYPEOF '(' typename ')' { $$ = groktypename ($3); if (pedantic) ! pedwarn ("ANSI C++ forbids `typeof'"); } | template_type ; *************** *** 1844,1848 **** $$ = $3; if (pedantic) ! pedwarn ("ANSI C forbids use of `asm' keyword"); } ; --- 1801,1805 ---- $$ = $3; if (pedantic) ! pedwarn ("ANSI C++ forbids use of `asm' keyword"); } ; *************** *** 1853,1857 **** $5 = suspend_momentary (); $$ = start_decl ($1, current_declspecs, 1, $2); ! decl_attributes ($$, $4); } init /* Note how the declaration of the variable is in effect while its init is parsed! */ --- 1810,1814 ---- $5 = suspend_momentary (); $$ = start_decl ($1, current_declspecs, 1, $2); ! cplus_decl_attributes ($$, $4); } init /* Note how the declaration of the variable is in effect while its init is parsed! */ *************** *** 1863,1867 **** $$ = suspend_momentary (); d = start_decl ($1, current_declspecs, 0, $2); ! decl_attributes (d, $4); finish_decl (d, NULL_TREE, $3, 0); } ; --- 1820,1824 ---- $$ = suspend_momentary (); d = start_decl ($1, current_declspecs, 0, $2); ! cplus_decl_attributes (d, $4); finish_decl (d, NULL_TREE, $3, 0); } ; *************** *** 1870,1874 **** declarator maybe_raises maybeasm maybe_attribute '=' { $$ = start_decl ($1, current_declspecs, 1, $2); ! decl_attributes ($$, $4); } init /* Note how the declaration of the variable is in effect while its init is parsed! */ --- 1827,1831 ---- declarator maybe_raises maybeasm maybe_attribute '=' { $$ = start_decl ($1, current_declspecs, 1, $2); ! cplus_decl_attributes ($$, $4); } init /* Note how the declaration of the variable is in effect while its init is parsed! */ *************** *** 1876,1880 **** | declarator maybe_raises maybeasm maybe_attribute { tree d = start_decl ($$, current_declspecs, 0, $2); ! decl_attributes ($$, $4); finish_decl (d, NULL_TREE, $3, 0); } ; --- 1833,1837 ---- | declarator maybe_raises maybeasm maybe_attribute { tree d = start_decl ($$, current_declspecs, 0, $2); ! cplus_decl_attributes ($$, $4); finish_decl (d, NULL_TREE, $3, 0); } ; *************** *** 1885,1889 **** $5 = suspend_momentary (); $$ = start_decl ($1, current_declspecs, 1, $2); ! decl_attributes ($$, $4); } init /* Note how the declaration of the variable is in effect while its init is parsed! */ --- 1842,1846 ---- $5 = suspend_momentary (); $$ = start_decl ($1, current_declspecs, 1, $2); ! cplus_decl_attributes ($$, $4); } init /* Note how the declaration of the variable is in effect while its init is parsed! */ *************** *** 1895,1899 **** $$ = suspend_momentary (); d = start_decl ($1, current_declspecs, 0, $2); ! decl_attributes (d, $4); finish_decl (d, NULL_TREE, $3, 0); } ; --- 1852,1856 ---- $$ = suspend_momentary (); d = start_decl ($1, current_declspecs, 0, $2); ! cplus_decl_attributes (d, $4); finish_decl (d, NULL_TREE, $3, 0); } ; *************** *** 1960,1964 **** TREE_HAS_CONSTRUCTOR ($$) = 1; if (pedantic) ! pedwarn ("ANSI C forbids empty initializer braces"); } | '{' initlist '}' { $$ = build_nt (CONSTRUCTOR, NULL_TREE, nreverse ($2)); --- 1917,1921 ---- TREE_HAS_CONSTRUCTOR ($$) = 1; if (pedantic) ! pedwarn ("ANSI C++ forbids empty initializer braces"); } | '{' initlist '}' { $$ = build_nt (CONSTRUCTOR, NULL_TREE, nreverse ($2)); *************** *** 2093,2097 **** | ',' { if (pedantic) ! pedwarn ("ANSI C forbids comma at end of enumerator list"); } ; --- 2050,2054 ---- | ',' { if (pedantic) ! pedwarn ("ANSI C++ forbids comma at end of enumerator list"); } ; *************** *** 2232,2242 **** base_class_visibility_list: VISSPEC - { - if ($$ == visibility_protected) - { - warning ("`protected' visibility not implemented"); - $$ = visibility_public; - } - } | SCSPEC { if ($$ != ridpointers[(int)RID_VIRTUAL]) --- 2189,2192 ---- *************** *** 2322,2326 **** | component_decl_list ';' { if (pedantic) ! pedwarn ("ANSI C forbids extra semicolons here"); } ; --- 2272,2276 ---- | component_decl_list ';' { if (pedantic) ! pedwarn ("ANSI C++ forbids extra semicolons here"); } ; *************** *** 2465,2481 **** { current_declspecs = $0; $$ = grokfield ($$, current_declspecs, $2, NULL_TREE, $3); ! decl_attributes ($$, $4); } | declarator maybe_raises maybeasm maybe_attribute '=' init { current_declspecs = $0; $$ = grokfield ($$, current_declspecs, $2, $6, $3); ! decl_attributes ($$, $4); } | IDENTIFIER ':' expr_no_commas maybe_attribute { current_declspecs = $0; $$ = grokbitfield ($$, current_declspecs, $3); ! decl_attributes ($$, $4); } | TYPENAME_COLON expr_no_commas maybe_attribute { current_declspecs = $0; $$ = grokbitfield ($$, current_declspecs, $2); ! decl_attributes ($$, $3); } | ':' expr_no_commas { current_declspecs = $0; --- 2415,2431 ---- { current_declspecs = $0; $$ = grokfield ($$, current_declspecs, $2, NULL_TREE, $3); ! cplus_decl_attributes ($$, $4); } | declarator maybe_raises maybeasm maybe_attribute '=' init { current_declspecs = $0; $$ = grokfield ($$, current_declspecs, $2, $6, $3); ! cplus_decl_attributes ($$, $4); } | IDENTIFIER ':' expr_no_commas maybe_attribute { current_declspecs = $0; $$ = grokbitfield ($$, current_declspecs, $3); ! cplus_decl_attributes ($$, $4); } | TYPENAME_COLON expr_no_commas maybe_attribute { current_declspecs = $0; $$ = grokbitfield ($$, current_declspecs, $2); ! cplus_decl_attributes ($$, $3); } | ':' expr_no_commas { current_declspecs = $0; *************** *** 2486,2499 **** declarator maybe_raises maybeasm maybe_attribute { $$ = grokfield ($$, current_declspecs, $2, NULL_TREE, $3); ! decl_attributes ($$, $4); } | declarator maybe_raises maybeasm maybe_attribute '=' init { $$ = grokfield ($$, current_declspecs, $2, $6, $3); ! decl_attributes ($$, $4); } | IDENTIFIER ':' expr_no_commas maybe_attribute { $$ = grokbitfield ($$, current_declspecs, $3); ! decl_attributes ($$, $4); } | TYPENAME_COLON expr_no_commas maybe_attribute { $$ = grokbitfield ($$, current_declspecs, $2); ! decl_attributes ($$, $3); } | ':' expr_no_commas { $$ = grokbitfield (NULL_TREE, NULL_TREE, $2); } --- 2436,2449 ---- declarator maybe_raises maybeasm maybe_attribute { $$ = grokfield ($$, current_declspecs, $2, NULL_TREE, $3); ! cplus_decl_attributes ($$, $4); } | declarator maybe_raises maybeasm maybe_attribute '=' init { $$ = grokfield ($$, current_declspecs, $2, $6, $3); ! cplus_decl_attributes ($$, $4); } | IDENTIFIER ':' expr_no_commas maybe_attribute { $$ = grokbitfield ($$, current_declspecs, $3); ! cplus_decl_attributes ($$, $4); } | TYPENAME_COLON expr_no_commas maybe_attribute { $$ = grokbitfield ($$, current_declspecs, $2); ! cplus_decl_attributes ($$, $3); } | ':' expr_no_commas { $$ = grokbitfield (NULL_TREE, NULL_TREE, $2); } *************** *** 2648,2665 **** | '~' PTYPENAME { goto destructor_name; } - | LEFT_RIGHT identifier - { - see_typename (); - $$ = build_parse_node (WRAPPER_EXPR, $2); - } - | LEFT_RIGHT '?' identifier - { - see_typename (); - $$ = build_parse_node (WRAPPER_EXPR, - build_parse_node (COND_EXPR, $3, NULL_TREE, NULL_TREE)); - } - | '~' LEFT_RIGHT identifier - { see_typename (); - $$ = build_parse_node (ANTI_WRAPPER_EXPR, $3); } | scoped_id see_typename notype_declarator %prec '(' { see_typename (); --- 2598,2601 ---- *************** *** 2704,2708 **** } } ! | template_type SCOPE try_for_typename %prec EMPTY { if ($$ == error_mark_node) --- 2640,2644 ---- } } ! | template_type SCOPE /* try_for_typename %prec EMPTY */ { if ($$ == error_mark_node) *************** *** 2717,2721 **** } } ! if ($3) popclass (1); } ; --- 2653,2657 ---- } } ! /* if ($3) popclass (1); */ } ; *************** *** 2863,2867 **** | label_decls { if (pedantic) ! pedwarn ("ANSI C forbids label declarations"); } ; --- 2799,2803 ---- | label_decls { if (pedantic) ! pedwarn ("ANSI C++ forbids label declarations"); } ; *************** *** 3094,3098 **** if (pedantic) ! pedwarn ("ANSI C forbids range expressions in switch statement"); /* build_c_cast puts on a NOP_EXPR to make a non-lvalue. --- 3030,3034 ---- if (pedantic) ! pedwarn ("ANSI C++ forbids range expressions in switch statement"); /* build_c_cast puts on a NOP_EXPR to make a non-lvalue. *************** *** 3232,3235 **** --- 3168,3174 ---- finish_stmt (); } + | GOTO '*' expr ';' + { emit_line_note (input_filename, lineno); + expand_computed_goto ($3); } | GOTO identifier ';' { tree decl; *************** *** 3525,3528 **** --- 3464,3468 ---- compstmt { + extern struct rtx_def *get_insns (); do_pending_stack_adjust (); if (! expand_catch (NULL_TREE)) *************** *** 3530,3534 **** if (! expand_end_catch ()) compiler_error ("except nesting botch"); ! RTL_EXPR_SEQUENCE ($1) = (struct rtx_def *)get_insns (); if ($4) { --- 3470,3474 ---- if (! expand_end_catch ()) compiler_error ("except nesting botch"); ! RTL_EXPR_SEQUENCE ($1) = get_insns (); if ($4) { *************** *** 3611,3619 **** /* empty */ { if (pedantic) ! pedwarn ("ANSI C forbids use of `asm' keyword"); emit_line_note (input_filename, lineno); } | TYPE_QUAL { if (pedantic) ! pedwarn ("ANSI C forbids use of `asm' keyword"); emit_line_note (input_filename, lineno); } ; --- 3551,3559 ---- /* empty */ { if (pedantic) ! pedwarn ("ANSI C++ forbids use of `asm' keyword"); emit_line_note (input_filename, lineno); } | TYPE_QUAL { if (pedantic) ! pedwarn ("ANSI C++ forbids use of `asm' keyword"); emit_line_note (input_filename, lineno); } ; *************** *** 3680,3683 **** --- 3620,3626 ---- | ELLIPSIS { + /* ARM $8.2.5 has this as a boxed-off comment. */ + if (pedantic) + warning ("use of `...' without a first argument is non-portable"); $$ = NULL_TREE; } *************** *** 3758,3761 **** --- 3701,3705 ---- ; + /* try_for_typename: { *************** *** 3769,3772 **** --- 3713,3717 ---- } ; + */ bad_parm: *************** *** 3993,3999 **** here, rather than doing it in class.c . */ | OPERATOR typed_typespecs absdcl ! { ! $$ = build1 (TYPE_EXPR, $2, $3); ! } | OPERATOR error { $$ = ansi_opname[ERROR_MARK]; } --- 3938,3942 ---- here, rather than doing it in class.c . */ | OPERATOR typed_typespecs absdcl ! { $$ = build1 (TYPE_EXPR, $2, $3); } | OPERATOR error { $$ = ansi_opname[ERROR_MARK]; } *************** *** 4007,4246 **** return current_declspecs; } - - #if YYDEBUG != 0 - db_yyerror (s, yyps, yychar) - char *s; - short *yyps; - int yychar; - { - FILE *yyout; - char buf[1024]; - int st; - - yyerror (s); - printf ("State is %d, input token number is %d.\n", *yyps, yychar); - - #ifdef PARSE_OUTPUT - if (*yyps < 1) fatal ("Cannot start from here"); - else if ((yyout = fopen (PARSE_OUTPUT, "r")) == NULL) - error ("cannot open file %s", PARSE_OUTPUT); - else - { - printf ("That is to say,\n\n"); - while (fgets(buf, sizeof (buf)-1, yyout)) - { - if (buf[0] != 's') continue; - st = atoi (buf+6); - if (st != *yyps) continue; - printf ("%s", buf); - while (fgets (buf, sizeof (buf)-1, yyout)) - { - if (buf[0] == 's') break; - printf ("%s", buf); - } - break; - } - printf ("With the token %s\n", yytname[YYTRANSLATE (yychar)]); - fclose (yyout); - } - #endif - } - #endif - - void - yyerror (string) - char *string; - { - extern int end_of_file; - extern char *token_buffer; - extern int input_redirected (); - char buf[200]; - - strcpy (buf, string); - - /* We can't print string and character constants well - because the token_buffer contains the result of processing escapes. */ - if (end_of_file) - strcat (buf, input_redirected () - ? " at end of saved text" - : " at end of input"); - else if (token_buffer[0] == 0) - strcat (buf, " at null character"); - else if (token_buffer[0] == '"') - strcat (buf, " before string constant"); - else if (token_buffer[0] == '\'') - strcat (buf, " before character constant"); - else if (token_buffer[0] < 040 || (unsigned char) token_buffer[0] >= 0177) - sprintf (buf + strlen (buf), " before character 0%o", - (unsigned char) token_buffer[0]); - else - strcat (buf, " before `%s'"); - - error (buf, token_buffer); - } - - static - #ifdef __GNUC__ - __inline - #endif - void - yyprint (file, yychar, yylval) - FILE *file; - int yychar; - YYSTYPE yylval; - { - tree t; - switch (yychar) - { - case IDENTIFIER: - case TYPENAME: - case TYPESPEC: - case PTYPENAME: - case IDENTIFIER_DEFN: - case TYPENAME_DEFN: - case PTYPENAME_DEFN: - case TYPENAME_COLON: - case TYPENAME_ELLIPSIS: - case SCOPED_TYPENAME: - case SCSPEC: - t = yylval.ttype; - print_id: - assert (TREE_CODE (t) == IDENTIFIER_NODE); - if (IDENTIFIER_POINTER (t)) - fprintf (file, " `%s'", IDENTIFIER_POINTER (t)); - break; - case AGGR: - if (yylval.ttype == class_type_node) - fprintf (file, " `class'"); - else if (yylval.ttype == record_type_node) - fprintf (file, " `struct'"); - else if (yylval.ttype == union_type_node) - fprintf (file, " `union'"); - else if (yylval.ttype == enum_type_node) - fprintf (file, " `enum'"); - else - my_friendly_abort (80); - break; - case PRE_PARSED_CLASS_DECL: - t = yylval.ttype; - assert (TREE_CODE (t) == TREE_LIST); - t = TREE_VALUE (t); - goto print_id; - } - } - - static int *reduce_count; - int *token_count; - - #define REDUCE_LENGTH (sizeof (yyr2) / sizeof (yyr2[0])) - #define TOKEN_LENGTH (256 + sizeof (yytname) / sizeof (yytname[0])) - - int * - init_parse () - { - #ifdef GATHER_STATISTICS - reduce_count = (int *)malloc (sizeof (int) * (REDUCE_LENGTH + 1)); - bzero (reduce_count, sizeof (int) * (REDUCE_LENGTH + 1)); - reduce_count += 1; - token_count = (int *)malloc (sizeof (int) * (TOKEN_LENGTH + 1)); - bzero (token_count, sizeof (int) * (TOKEN_LENGTH + 1)); - token_count += 1; - #endif - return token_count; - } - - #ifdef GATHER_STATISTICS - void - yyhook (yyn) - int yyn; - { - reduce_count[yyn] += 1; - } - #endif - - static int - reduce_cmp (p, q) - int *p, *q; - { - return reduce_count[*q] - reduce_count[*p]; - } - - static int - token_cmp (p, q) - int *p, *q; - { - return token_count[*q] - token_count[*p]; - } - - void - print_parse_statistics () - { - #ifdef GATHER_STATISTICS - #if YYDEBUG != 0 - int i; - int maxlen = REDUCE_LENGTH; - unsigned *sorted; - - if (reduce_count[-1] == 0) - return; - - if (TOKEN_LENGTH > REDUCE_LENGTH) - maxlen = TOKEN_LENGTH; - sorted = (unsigned *) alloca (sizeof (int) * maxlen); - - for (i = 0; i < TOKEN_LENGTH; i++) - sorted[i] = i; - qsort (sorted, TOKEN_LENGTH, sizeof (int), token_cmp); - for (i = 0; i < TOKEN_LENGTH; i++) - { - int index = sorted[i]; - if (token_count[index] == 0) - break; - if (token_count[index] < token_count[-1]) - break; - fprintf (stderr, "token %d, `%s', count = %d\n", - index, yytname[YYTRANSLATE (index)], token_count[index]); - } - fprintf (stderr, "\n"); - for (i = 0; i < REDUCE_LENGTH; i++) - sorted[i] = i; - qsort (sorted, REDUCE_LENGTH, sizeof (int), reduce_cmp); - for (i = 0; i < REDUCE_LENGTH; i++) - { - int index = sorted[i]; - if (reduce_count[index] == 0) - break; - if (reduce_count[index] < reduce_count[-1]) - break; - fprintf (stderr, "rule %d, line %d, count = %d\n", - index, yyrline[index], reduce_count[index]); - } - fprintf (stderr, "\n"); - #endif - #endif - } - - - /* Sets the value of the 'yydebug' variable to VALUE. - This is a function so we don't have to have YYDEBUG defined - in order to build the compiler. */ - void - set_yydebug (value) - int value; - { - #if YYDEBUG != 0 - yydebug = value; - #else - warning ("YYDEBUG not defined."); - #endif - } - - #ifdef SPEW_DEBUG - const char * - debug_yytranslate (value) - int value; - { - return yytname[YYTRANSLATE (value)]; - } - - #endif --- 3950,3951 ---- diff -rc2N gcc-2.3.1/cp-pt.c gcc-2.3.2/cp-pt.c *** gcc-2.3.1/cp-pt.c Thu Sep 24 21:49:36 1992 --- gcc-2.3.2/cp-pt.c Thu Nov 12 20:52:30 1992 *************** *** 31,35 **** #include "config.h" #include - #include "assert.h" #include "obstack.h" --- 31,34 ---- *************** *** 81,85 **** int is_type; parm = next; ! assert (TREE_CODE (parm) == TREE_LIST); is_type = TREE_CODE (TREE_PURPOSE (parm)) == IDENTIFIER_NODE; if (!is_type) --- 80,84 ---- int is_type; parm = next; ! my_friendly_assert (TREE_CODE (parm) == TREE_LIST, 259); is_type = TREE_CODE (TREE_PURPOSE (parm)) == IDENTIFIER_NODE; if (!is_type) *************** *** 86,90 **** { parm = TREE_PURPOSE (parm); ! assert (TREE_CODE (parm) == TREE_LIST); parm = TREE_VALUE (parm); /* is a const-param */ --- 85,89 ---- { parm = TREE_PURPOSE (parm); ! my_friendly_assert (TREE_CODE (parm) == TREE_LIST, 260); parm = TREE_VALUE (parm); /* is a const-param */ *************** *** 128,132 **** tree t; p = TREE_PURPOSE (p); ! assert (TREE_CODE (p) == IDENTIFIER_NODE); t = make_node (TEMPLATE_TYPE_PARM); TEMPLATE_TYPE_SET_INFO (t, saved_parmlist, nparms); --- 127,131 ---- tree t; p = TREE_PURPOSE (p); ! my_friendly_assert (TREE_CODE (p) == IDENTIFIER_NODE, 261); t = make_node (TEMPLATE_TYPE_PARM); TEMPLATE_TYPE_SET_INFO (t, saved_parmlist, nparms); *************** *** 137,141 **** { tree tinfo = make_node (TEMPLATE_CONST_PARM); ! assert (TREE_PERMANENT (tinfo)); if (!TREE_PERMANENT (p)) { --- 136,140 ---- { tree tinfo = make_node (TEMPLATE_CONST_PARM); ! my_friendly_assert (TREE_PERMANENT (tinfo), 262); if (!TREE_PERMANENT (p)) { *************** *** 207,215 **** staying only N months behind schedule. Sorry.... */ enum tree_code code; ! assert (TREE_CODE (d2) == CALL_EXPR); code = TREE_CODE (TREE_OPERAND (d2, 0)); ! assert (code == BIT_NOT_EXPR || code == OP_IDENTIFIER ! || code == SCOPE_REF); d2 = grokdeclarator (d2, NULL_TREE, MEMFUNCDEF, 0, NULL_TREE); decl = build_lang_decl (TEMPLATE_DECL, DECL_NAME (d2), --- 206,214 ---- staying only N months behind schedule. Sorry.... */ enum tree_code code; ! my_friendly_assert (TREE_CODE (d2) == CALL_EXPR, 263); code = TREE_CODE (TREE_OPERAND (d2, 0)); ! my_friendly_assert (code == BIT_NOT_EXPR || code == OP_IDENTIFIER ! || code == SCOPE_REF, 264); d2 = grokdeclarator (d2, NULL_TREE, MEMFUNCDEF, 0, NULL_TREE); decl = build_lang_decl (TEMPLATE_DECL, DECL_NAME (d2), *************** *** 228,232 **** /* All routines creating TEMPLATE_DECL nodes should now be using build_lang_decl, which will have set this up already. */ ! assert (DECL_LANG_SPECIFIC (decl) != 0); /* @@ Somewhere, permanent allocation isn't being used. */ --- 227,231 ---- /* All routines creating TEMPLATE_DECL nodes should now be using build_lang_decl, which will have set this up already. */ ! my_friendly_assert (DECL_LANG_SPECIFIC (decl) != 0, 265); /* @@ Somewhere, permanent allocation isn't being used. */ *************** *** 261,265 **** tree ctx = DECL_CONTEXT (DECL_TEMPLATE_RESULT (decl)); tree tmpl; ! assert (TREE_CODE (ctx) == UNINSTANTIATED_P_TYPE); tmpl = UPT_TEMPLATE (ctx); DECL_TEMPLATE_MEMBERS (tmpl) = --- 260,264 ---- tree ctx = DECL_CONTEXT (DECL_TEMPLATE_RESULT (decl)); tree tmpl; ! my_friendly_assert (TREE_CODE (ctx) == UNINSTANTIATED_P_TYPE, 266); tmpl = UPT_TEMPLATE (ctx); DECL_TEMPLATE_MEMBERS (tmpl) = *************** *** 288,292 **** template Foo::method (Foo& x) { ... } Note the missing "A" in the class containing "method". */ ! assert (global_bindings_p ()); #else while (! global_bindings_p ()) --- 287,291 ---- template Foo::method (Foo& x) { ... } Note the missing "A" in the class containing "method". */ ! my_friendly_assert (global_bindings_p (), 267); #else while (! global_bindings_p ()) *************** *** 411,415 **** ccat ('<'); nparms = TREE_VEC_LENGTH (parms); ! assert (nparms == TREE_VEC_LENGTH (arglist)); for (i = 0; i < nparms; i++) { --- 410,414 ---- ccat ('<'); nparms = TREE_VEC_LENGTH (parms); ! my_friendly_assert (nparms == TREE_VEC_LENGTH (arglist), 268); for (i = 0; i < nparms; i++) { *************** *** 439,443 **** } else ! assert (TREE_CODE (parm) == PARM_DECL); /* Should do conversions as for "const" initializers. */ --- 438,442 ---- } else ! my_friendly_assert (TREE_CODE (parm) == PARM_DECL, 269); /* Should do conversions as for "const" initializers. */ *************** *** 449,453 **** /* New list cell was built because old chain link was in use. */ ! assert (TREE_PURPOSE (arg) == NULL_TREE); arg = TREE_VALUE (arg); } --- 448,452 ---- /* New list cell was built because old chain link was in use. */ ! my_friendly_assert (TREE_PURPOSE (arg) == NULL_TREE, 270); arg = TREE_VALUE (arg); } *************** *** 508,512 **** else { ! assert (TREE_CODE_CLASS (TREE_CODE (arg)) == 'd'); cat (IDENTIFIER_POINTER (DECL_NAME (arg))); } --- 507,512 ---- else { ! my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (arg)) == 'd', ! 271); cat (IDENTIFIER_POINTER (DECL_NAME (arg))); } *************** *** 549,553 **** tree id; ! assert (TREE_CODE (d1) == IDENTIFIER_NODE); template = IDENTIFIER_GLOBAL_VALUE (d1); /* XXX */ if (TREE_CODE (template) != TEMPLATE_DECL) --- 549,553 ---- tree id; ! my_friendly_assert (TREE_CODE (d1) == IDENTIFIER_NODE, 272); template = IDENTIFIER_GLOBAL_VALUE (d1); /* XXX */ if (TREE_CODE (template) != TEMPLATE_DECL) *************** *** 622,626 **** } decl = arg; ! assert (TREE_CODE_CLASS (TREE_CODE (decl)) == 't'); decl = build_lang_decl (TYPE_DECL, parm, decl); } --- 622,626 ---- } decl = arg; ! my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (decl)) == 't', 273); decl = build_lang_decl (TYPE_DECL, parm, decl); } *************** *** 795,799 **** case ERROR_MARK: /* Non-error_mark_node ERROR_MARKs are bad things. */ ! assert (t == error_mark_node); /* NOTREACHED */ return 0; --- 795,799 ---- case ERROR_MARK: /* Non-error_mark_node ERROR_MARKs are bad things. */ ! my_friendly_assert (t == error_mark_node, 274); /* NOTREACHED */ return 0; *************** *** 841,846 **** int nparms, xxx, i; ! assert (TREE_VALUE (t) != NULL_TREE); ! assert (TREE_CODE (TREE_VALUE (t)) == TEMPLATE_DECL); /* @@ Should verify that class parm list is a list of distinct template parameters, and covers all the template --- 841,846 ---- int nparms, xxx, i; ! my_friendly_assert (TREE_VALUE (t) != NULL_TREE, 275); ! my_friendly_assert (TREE_CODE (TREE_VALUE (t)) == TEMPLATE_DECL, 276); /* @@ Should verify that class parm list is a list of distinct template parameters, and covers all the template *************** *** 866,870 **** &TREE_VEC_ELT (parmvec, 0)); type = IDENTIFIER_TYPE_VALUE (id); ! assert (type != 0); if (CLASSTYPE_INTERFACE_UNKNOWN (type)) { --- 866,870 ---- &TREE_VEC_ELT (parmvec, 0)); type = IDENTIFIER_TYPE_VALUE (id); ! my_friendly_assert (type != 0, 277); if (CLASSTYPE_INTERFACE_UNKNOWN (type)) { *************** *** 903,907 **** return error_mark_node; ! assert (TREE_CODE (classname) == IDENTIFIER_NODE); template = IDENTIFIER_TEMPLATE (classname); --- 903,907 ---- return error_mark_node; ! my_friendly_assert (TREE_CODE (classname) == IDENTIFIER_NODE, 278); template = IDENTIFIER_TEMPLATE (classname); *************** *** 930,934 **** t1 = TREE_PURPOSE (template); ! assert (TREE_CODE (t1) == TEMPLATE_DECL); /* If a template is declared but not defined, accept it; don't crash. --- 930,934 ---- t1 = TREE_PURPOSE (template); ! my_friendly_assert (TREE_CODE (t1) == TEMPLATE_DECL, 279); /* If a template is declared but not defined, accept it; don't crash. *************** *** 968,972 **** tmpl = TREE_PURPOSE (IDENTIFIER_TEMPLATE (id)); t = xref_tag (DECL_TEMPLATE_INFO (tmpl)->aggr, id, NULL_TREE); ! assert (TREE_CODE (t) == RECORD_TYPE); #if 1 lineno = template_info->lineno; --- 968,972 ---- tmpl = TREE_PURPOSE (IDENTIFIER_TEMPLATE (id)); t = xref_tag (DECL_TEMPLATE_INFO (tmpl)->aggr, id, NULL_TREE); ! my_friendly_assert (TREE_CODE (t) == RECORD_TYPE, 280); #if 1 lineno = template_info->lineno; *************** *** 983,988 **** if (decl) { ! assert (TREE_CODE (decl) == TYPE_DECL); pushdecl_top_level (copy_node (decl)); } pop_from_top_level (); --- 983,994 ---- if (decl) { ! my_friendly_assert (TREE_CODE (decl) == TYPE_DECL, 281); ! /* We'd better make sure we're on the permanent obstack or else ! * we'll get a "friendly" abort 124 in pushdecl. Perhaps a ! * copy_to_permanent would be sufficient here, but then a ! * sharing problem might occur. I don't know -- niklas@appli.se */ ! push_obstacks (&permanent_obstack, &permanent_obstack); pushdecl_top_level (copy_node (decl)); + pop_obstacks (); } pop_from_top_level (); *************** *** 1118,1122 **** for (; method; method = TREE_CHAIN (method)) { ! assert (TREE_CODE (method) == FUNCTION_DECL); if (TREE_TYPE (method) != type) { --- 1124,1129 ---- for (; method; method = TREE_CHAIN (method)) { ! my_friendly_assert (TREE_CODE (method) == FUNCTION_DECL, ! 282); if (TREE_TYPE (method) != type) { *************** *** 1249,1253 **** { tree purpose, value, chain, result; ! int via_public, via_virtual; if (t == void_list_node) --- 1256,1260 ---- { tree purpose, value, chain, result; ! int via_public, via_virtual, via_protected; if (t == void_list_node) *************** *** 1255,1258 **** --- 1262,1266 ---- via_public = TREE_VIA_PUBLIC (t); + via_protected = TREE_VIA_PROTECTED (t); via_virtual = TREE_VIA_VIRTUAL (t); *************** *** 1271,1275 **** && chain == TREE_CHAIN (t)) return t; ! result = hash_tree_cons (via_public, via_virtual, purpose, value, chain); TREE_PARMLIST (result) = TREE_PARMLIST (t); --- 1279,1283 ---- && chain == TREE_CHAIN (t)) return t; ! result = hash_tree_cons (via_public, via_virtual, via_protected, purpose, value, chain); TREE_PARMLIST (result) = TREE_PARMLIST (t); *************** *** 1437,1441 **** function_maybepermanent_obstack = &permanent_obstack; ! assert (TREE_CODE (tmpl) == TEMPLATE_DECL); len = TREE_VEC_LENGTH (DECL_TEMPLATE_PARMS (tmpl)); --- 1445,1449 ---- function_maybepermanent_obstack = &permanent_obstack; ! my_friendly_assert (TREE_CODE (tmpl) == TEMPLATE_DECL, 283); len = TREE_VEC_LENGTH (DECL_TEMPLATE_PARMS (tmpl)); *************** *** 1543,1547 **** struct template_info *tinfo; ! assert (TREE_CODE (id) == IDENTIFIER_NODE); template = IDENTIFIER_TEMPLATE (id); if (!template) --- 1551,1555 ---- struct template_info *tinfo; ! my_friendly_assert (TREE_CODE (id) == IDENTIFIER_NODE, 284); template = IDENTIFIER_TEMPLATE (id); if (!template) *************** *** 1556,1560 **** tinfo = DECL_TEMPLATE_INFO (template); template = DECL_NAME (template); ! assert (template != NULL_TREE); if (!classlevel) --- 1564,1568 ---- tinfo = DECL_TEMPLATE_INFO (template); template = DECL_NAME (template); ! my_friendly_assert (template != NULL_TREE, 285); if (!classlevel) *************** *** 1565,1570 **** t = xref_tag (tinfo->aggr, id, NULL_TREE); ! assert (TREE_CODE (t) == RECORD_TYPE ! || TREE_CODE (t) == UNINSTANTIATED_P_TYPE); decl = build_decl (TYPE_DECL, template, t); --- 1573,1578 ---- t = xref_tag (tinfo->aggr, id, NULL_TREE); ! my_friendly_assert (TREE_CODE (t) == RECORD_TYPE ! || TREE_CODE (t) == UNINSTANTIATED_P_TYPE, 286); decl = build_decl (TYPE_DECL, template, t); *************** *** 1630,1634 **** there was a (supposedly tags-transparent) scope in between. */ t = IDENTIFIER_TYPE_VALUE (TREE_VALUE (t1)); ! assert (t != NULL_TREE && TREE_CODE_CLASS (TREE_CODE (t)) == 't'); CLASSTYPE_USE_TEMPLATE (t) = 2; /* Always make methods of template classes static, until we've --- 1638,1644 ---- there was a (supposedly tags-transparent) scope in between. */ t = IDENTIFIER_TYPE_VALUE (TREE_VALUE (t1)); ! my_friendly_assert (t != NULL_TREE ! && TREE_CODE_CLASS (TREE_CODE (t)) == 't', ! 287); CLASSTYPE_USE_TEMPLATE (t) = 2; /* Always make methods of template classes static, until we've *************** *** 1637,1641 **** CLASSTYPE_INTERFACE_UNKNOWN (t) = 1; decl = IDENTIFIER_GLOBAL_VALUE (TREE_VALUE (t1)); ! assert (TREE_CODE (decl) == TYPE_DECL); undo_template_name_overload (TREE_VALUE (t1), 0); --- 1647,1651 ---- CLASSTYPE_INTERFACE_UNKNOWN (t) = 1; decl = IDENTIFIER_GLOBAL_VALUE (TREE_VALUE (t1)); ! my_friendly_assert (TREE_CODE (decl) == TYPE_DECL, 288); undo_template_name_overload (TREE_VALUE (t1), 0); *************** *** 1719,1726 **** int ntparms = TREE_VEC_LENGTH (tparms); ! assert (TREE_CODE (tparms) == TREE_VEC); ! assert (TREE_CODE (parms) == TREE_LIST); ! assert (TREE_CODE (args) == TREE_LIST); ! assert (ntparms > 0); bzero (targs, sizeof (tree) * ntparms); --- 1729,1736 ---- int ntparms = TREE_VEC_LENGTH (tparms); ! my_friendly_assert (TREE_CODE (tparms) == TREE_VEC, 289); ! my_friendly_assert (TREE_CODE (parms) == TREE_LIST, 290); ! my_friendly_assert (TREE_CODE (args) == TREE_LIST, 291); ! my_friendly_assert (ntparms > 0, 292); bzero (targs, sizeof (tree) * ntparms); *************** *** 1745,1749 **** arg = TREE_TYPE (arg); #else ! assert (TREE_TYPE (arg) != NULL_TREE); arg = TREE_TYPE (arg); #endif --- 1755,1759 ---- arg = TREE_TYPE (arg); #else ! my_friendly_assert (TREE_TYPE (arg) != NULL_TREE, 293); arg = TREE_TYPE (arg); #endif *************** *** 1956,1960 **** #define DECIDE(N) if(1){decision=(N); goto decided;}else ! assert (TREE_CODE (t) == FUNCTION_DECL || TREE_CODE (t) == VAR_DECL); if (TREE_ASM_WRITTEN (t)) DECIDE (0); --- 1966,1971 ---- #define DECIDE(N) if(1){decision=(N); goto decided;}else ! my_friendly_assert (TREE_CODE (t) == FUNCTION_DECL ! || TREE_CODE (t) == VAR_DECL, 294); if (TREE_ASM_WRITTEN (t)) DECIDE (0); diff -rc2N gcc-2.3.1/cp-ptree.c gcc-2.3.2/cp-ptree.c *** gcc-2.3.1/cp-ptree.c Mon Jul 6 18:37:56 1992 --- gcc-2.3.2/cp-ptree.c Thu Nov 12 20:52:35 1992 *************** *** 107,112 **** if (TYPE_GETS_ASSIGN_REF (node)) fputs (" gets=(X&)", file); - if (TYPE_HAS_WRAPPER (node)) - fputs (" wrapper", file); if (TYPE_OVERLOADS_METHOD_CALL_EXPR (node)) fputs (" op->()", file); --- 107,110 ---- diff -rc2N gcc-2.3.1/cp-search.c gcc-2.3.2/cp-search.c *** gcc-2.3.1/cp-search.c Fri Sep 25 19:56:19 1992 --- gcc-2.3.2/cp-search.c Mon Nov 23 20:56:10 1992 *************** *** 20,23 **** --- 20,27 ---- the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + #if 0 + /* Remove before release, should only appear for development and testing. */ + #define CHECK_convert_pointer_to_single_level + #endif /* High-level class interface. */ *************** *** 29,33 **** #include "obstack.h" #include "flags.h" - #include "assert.h" #define obstack_chunk_alloc xmalloc --- 33,36 ---- *************** *** 84,87 **** --- 87,100 ---- static tree lookup_field_1 (); static int lookup_fnfields_1 (); + static void dfs_walk (); + static int markedp (); + static void dfs_unmark (); + static void dfs_init_vbase_pointers (); + + static tree vbase_types; + static tree vbase_decl, vbase_decl_ptr; + static tree vbase_decl_ptr_intermediate; + static tree vbase_init_result; + static int saw_first_vbase; /* Allocate a level of searching. */ *************** *** 240,244 **** make_memoized_table_entry (type, name, function_p) tree type, name; ! int function_p; { int index = MEMOIZED_HASH_FN (name); --- 253,257 ---- make_memoized_table_entry (type, name, function_p) tree type, name; ! int function_p; { int index = MEMOIZED_HASH_FN (name); *************** *** 413,424 **** } ! /* Check whether TYPE is derived from PARENT. ! Return the actual base information if so. Otherwise return 0. ! If PROTECT is 1, then emit an error message if access to ! a public field of PARENT would be private. ! If PROTECT is 2, then emit an error message if ! TYPE is derived from PARENT via private visibility rules. If PROTECT is 3, then immediately private baseclass is ok, ! but deeper than that, if private, emit error message. */ tree get_binfo (parent, binfo, protect) --- 426,449 ---- } ! /* Check whether the type given in BINFO is derived from PARENT. If ! it isn't, return 0. If it is, but the derivation is MI-ambiguous ! AND protect != 0, emit an error message and return error_mark_node. ! ! Otherwise, if TYPE is derived from PARENT, return the actual base ! information, unless a one of the protection violations below ! occurs, in which case emit an error message and return error_mark_node. ! ! The below should be worded better. It may not be exactly what the code ! does, but there should be a lose correlation. If you understand the code ! well, please try and make the comments below more readable. ! ! If PROTECT is 1, then check if access to a public field of PARENT ! would be private. ! ! If PROTECT is 2, then check if the given type is derived from ! PARENT via private visibility rules. ! If PROTECT is 3, then immediately private baseclass is ok, ! but deeper than that, check if private. */ tree get_binfo (parent, binfo, protect) *************** *** 467,475 **** for (i = 0; i < n_baselinks; i++) { ! tree child = TREE_VEC_ELT (binfos, i); ! if (BINFO_MARKED (child) == 0) { ! int via_private = is_private || !TREE_VIA_PUBLIC (child); if (via_private == 0) --- 492,502 ---- for (i = 0; i < n_baselinks; i++) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); ! if (BINFO_MARKED (base_binfo) == 0) { ! int via_private = is_private || !TREE_VIA_PUBLIC (base_binfo); ! ! SET_BINFO_MARKED (base_binfo); if (via_private == 0) *************** *** 491,497 **** #endif - SET_BINFO_MARKED (child); otype = type; ! obstack_ptr_grow (&search_obstack, child); obstack_int_grow (&search_obstack, via_private); tail += 2; --- 518,523 ---- #endif otype = type; ! obstack_ptr_grow (&search_obstack, base_binfo); obstack_int_grow (&search_obstack, via_private); tail += 2; *************** *** 499,503 **** my_friendly_abort (91); } ! else if (protect && ! TREE_VIA_VIRTUAL (child)) { error_with_aggr_type (parent, "type `%s' is ambiguous base class for type `%s'", --- 525,533 ---- my_friendly_abort (91); } ! #if 0 ! /* This code cannot possibly be right. Ambiguities can only be ! checked by traversing the whole tree, and seeing if it pops ! up twice. */ ! else if (protect && ! TREE_VIA_VIRTUAL (base_binfo)) { error_with_aggr_type (parent, "type `%s' is ambiguous base class for type `%s'", *************** *** 507,512 **** TYPE_NAME_STRING (otype)); rval = error_mark_node; ! break; } } --- 537,543 ---- TYPE_NAME_STRING (otype)); rval = error_mark_node; ! goto cleanup; } + #endif } *************** *** 517,521 **** binfo = search_stack->first[head++]; ! is_private = (int)search_stack->first[head++]; if (BINFO_TYPE (binfo) == parent) { --- 548,552 ---- binfo = search_stack->first[head++]; ! is_private = (HOST_WIDE_INT)search_stack->first[head++]; if (BINFO_TYPE (binfo) == parent) { *************** *** 525,531 **** --- 556,577 ---- rval_private = is_private; } + else + /* I believe it is the case that this error is only an error when + used by someone that wants error messages printed. Routines that + call this one, that don't set protect want the first one found, + even if there are more. */ + if (protect) + { + /* Found two or more possible return values. */ + error_with_aggr_type (parent, "type `%s' is ambiguous base class for type `%s'", + TYPE_NAME_STRING (xtype)); + rval = error_mark_node; + goto cleanup; + } goto dont_queue; } } + + cleanup: { tree *tp = search_stack->first; *************** *** 552,557 **** for (i = 0; i < n_baselinks; i++) { ! tree child = TREE_VEC_ELT (binfos, i); ! if (parent == BINFO_TYPE (child)) /* It's ok, since it's immediate. */ return rval; --- 598,603 ---- for (i = 0; i < n_baselinks; i++) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); ! if (parent == BINFO_TYPE (base_binfo)) /* It's ok, since it's immediate. */ return rval; *************** *** 566,573 **** } ! /* Return the number of levels between type PARENT and type TYPE, ! following the leftmost path to PARENT. If PARENT is its own main ! type variant, then if PARENT appears in different places from TYPE's ! point of view, the leftmost PARENT will be the one chosen. Return -1 if TYPE is not derived from PARENT. --- 612,710 ---- } ! /* -------------------------------------------------- */ ! /* These two routines are ONLY here to check for ambiguities for ! get_base_distance, as it probably cannot check by itself for ! all ambiguities. When get_base_distance is sure to check for all, ! these routines can go. (mrs) */ ! ! tree ! get_binfo2_recursive (binfo, parent, type) ! register tree binfo, parent; ! tree type; ! { ! tree rval = NULL_TREE; ! tree nrval; ! tree binfos = BINFO_BASETYPES (binfo); ! int i, n_baselinks = binfos ? TREE_VEC_LENGTH (binfos) : 0; ! ! if (BINFO_TYPE (binfo) == parent) ! { ! return binfo; ! } ! ! /* Process base types. */ ! for (i = 0; i < n_baselinks; i++) ! { ! tree base_binfo = TREE_VEC_ELT (binfos, i); ! ! if (BINFO_MARKED (base_binfo) == 0) ! { ! SET_BINFO_MARKED (base_binfo); ! ! nrval = get_binfo2_recursive (base_binfo, parent, type); ! ! if (nrval == error_mark_node) ! return nrval; ! if (nrval) ! if (rval == 0) ! { ! rval = nrval; ! } ! else ! return error_mark_node; ! } ! } ! return rval; ! } ! ! tree ! get_binfo2 (parent, binfo) ! register tree parent, binfo; ! { ! tree type; ! tree rval = NULL_TREE; ! ! if (TREE_CODE (parent) == TREE_VEC) ! parent = BINFO_TYPE (parent); ! /* unions cannot participate in inheritance relationships */ ! else if (TREE_CODE (parent) == UNION_TYPE) ! return 0; ! else if (TREE_CODE (parent) != RECORD_TYPE) ! my_friendly_abort (89); ! ! parent = TYPE_MAIN_VARIANT (parent); ! ! if (TREE_CODE (binfo) == TREE_VEC) ! type = BINFO_TYPE (binfo); ! else if (TREE_CODE (binfo) == RECORD_TYPE) ! { ! type = binfo; ! binfo = TYPE_BINFO (type); ! } ! else my_friendly_abort (90); ! ! rval = get_binfo2_recursive (binfo, parent, type); ! ! dfs_walk (binfo, dfs_unmark, markedp); ! ! return rval; ! } ! ! /* -------------------------------------------------- */ ! ! /* Return the number of levels between type PARENT and the type given ! in BINFO, following the leftmost path to PARENT. If PARENT is its ! own main type variant, then if PARENT appears in different places ! from TYPE's point of view, the leftmost PARENT will be the one ! chosen. ! ! The term `leftmost' should be defined in g++int.texi and the ! significance should be explained. If it is, this message should be ! deleted, if not, and you understand the term, please add ! documentation for it in g++int.texi. Also, the part about the ! ``PARENT is its own main type variant'' should give reasons when ! and why this happens, and why it is important, and a better ! explaination of what this routine does both when that is true and ! when it is not. Return -1 if TYPE is not derived from PARENT. *************** *** 577,581 **** If PATH_PTR is non-NULL, then also build the list of types from PARENT to TYPE, with TREE_VIA_VIRUAL and TREE_VIA_PUBLIC ! set. */ int get_base_distance (parent, binfo, protect, path_ptr) --- 714,735 ---- If PATH_PTR is non-NULL, then also build the list of types from PARENT to TYPE, with TREE_VIA_VIRUAL and TREE_VIA_PUBLIC ! set. ! ! It is unclear whether or not the path should be built if -2 and/or ! -3 is returned. Maybe, maybe not. I suspect that there is code ! that relies upon it being built, such as prepare_fresh_vtable. ! (mrs) ! ! Also, it would appear that we only sometimes want -2. The question is ! under what exact conditions do we want to see -2, and when do we not ! want to see -2. (mrs) ! ! It is also unlikely that this thing finds all ambiguties, as I ! don't trust any deviation from the method used in get_binfo. It ! would be nice to use that method here, as it is simple and straight ! forward. The code here and in recursive_bounded_basetype_p is not. ! For now, I shall include an extra call to find ambiguities. (mrs) ! */ ! int get_base_distance (parent, binfo, protect, path_ptr) *************** *** 586,590 **** int head, tail; int is_private = 0; ! int rval; int depth = 0; int rval_private = 0; --- 740,744 ---- int head, tail; int is_private = 0; ! int rval = -1; int depth = 0; int rval_private = 0; *************** *** 645,654 **** for (i = 0; i < n_baselinks; i++) { ! tree child = TREE_VEC_ELT (binfos, i); ! if (BINFO_MARKED (child) == 0) { ! int via_private = is_private || !TREE_VIA_PUBLIC (child); if (via_private == 0) ; --- 799,810 ---- for (i = 0; i < n_baselinks; i++) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); ! if (BINFO_MARKED (base_binfo) == 0) { ! int via_private = is_private || !TREE_VIA_PUBLIC (base_binfo); + SET_BINFO_MARKED (base_binfo); + if (via_private == 0) ; *************** *** 656,664 **** via_private = 0; ! SET_BINFO_MARKED (child); ! obstack_ptr_grow (&search_obstack, child); ! obstack_int_grow (&search_obstack, depth); obstack_int_grow (&search_obstack, via_private); if (path_ptr) { --- 812,819 ---- via_private = 0; ! obstack_ptr_grow (&search_obstack, base_binfo); obstack_int_grow (&search_obstack, depth); obstack_int_grow (&search_obstack, via_private); + tail += 3; if (path_ptr) { *************** *** 666,674 **** tail += 1; } - tail += 3; if (tail >= search_stack->limit) my_friendly_abort (93); } ! else if (! TREE_VIA_VIRTUAL (child)) { rval = -2; --- 821,832 ---- tail += 1; } if (tail >= search_stack->limit) my_friendly_abort (93); } ! #if 0 ! /* This code cannot possibly be right. Ambiguities can only be ! checked by traversing the whole tree, and seeing if it pops ! up twice. */ ! else if (! TREE_VIA_VIRTUAL (base_binfo)) { rval = -2; *************** *** 675,678 **** --- 833,837 ---- goto done; } + #endif } *************** *** 679,690 **** /* Process head of queue, if one exists. */ if (head >= tail) ! { ! rval = -1; ! break; ! } binfo = search_stack->first[head++]; ! depth = (int)search_stack->first[head++] + 1; ! is_private = (int)search_stack->first[head++]; if (path_ptr) { --- 838,846 ---- /* Process head of queue, if one exists. */ if (head >= tail) ! break; binfo = search_stack->first[head++]; ! depth = (HOST_WIDE_INT)search_stack->first[head++] + 1; ! is_private = (HOST_WIDE_INT)search_stack->first[head++]; if (path_ptr) { *************** *** 695,698 **** --- 851,861 ---- if (BINFO_TYPE (binfo) == parent) { + /* It is wrong to set this and break, the proper thing to do + would be to set it only if it has not been set before, + and if is has been set, an ambiguity exists, and just + continue searching the tree for more of them as is done + in get_binfo. But until the code below can cope, this + can't be done. Also, it is not clear what should happen if + use_leftmost is set. */ rval = depth; rval_private = is_private; *************** *** 700,704 **** --- 863,870 ---- } } + #if 0 + /* Unneeded now, as we know the above code in the #if 0 is wrong. */ done: + #endif { int increment = path_ptr ? 4 : 3; *************** *** 742,758 **** { /* Pick the best path. */ ! tree child; int i; for (i = 0; i < TREE_VEC_LENGTH (tp_binfos); i++) { ! child = TREE_VEC_ELT (tp_binfos, i); if (tp+((i+1)*increment) < search_tail) ! assert (child == tp[(i+1)*increment]); ! if (rval = recursive_bounded_basetype_p (binfo, child, rval, 1)) break; } if (rval > 0) ! BINFO_INHERITANCE_CHAIN (child) = *tp; } /* Visibilities don't count if we found an ambiguous basetype. */ if (rval == -2) --- 908,946 ---- { /* Pick the best path. */ ! tree base_binfo; int i; for (i = 0; i < TREE_VEC_LENGTH (tp_binfos); i++) { ! base_binfo = TREE_VEC_ELT (tp_binfos, i); if (tp+((i+1)*increment) < search_tail) ! my_friendly_assert (base_binfo == tp[(i+1)*increment], 295); ! if (rval = recursive_bounded_basetype_p (binfo, base_binfo, rval, 1)) break; } if (rval > 0) ! BINFO_INHERITANCE_CHAIN (base_binfo) = *tp; ! } ! ! /* Because I don't trust recursive_bounded_basetype_p to find ! all ambiguities, I will just make sure here. When it is ! sure that all ambiguities are found, the two routines and ! this call can be removed. Not toally sure this should be ! here, but I think it should. (mrs) */ ! ! if (get_binfo2 (parent, type) == error_mark_node && rval != -2) ! { ! #if 1 ! /* This warning is here because the code over in ! prepare_fresh_vtable relies on partial completion ! offered by recursive_bounded_basetype_p I think, but ! that behavior is not documented. It needs to be. I ! don't think prepare_fresh_vtable is the only routine ! that relies upon path_ptr being set to something in a ! particular way when this routine returns -2. (mrs) */ ! warning ("internal consistency check failed, please report, recovering."); ! rval = -2; ! #endif } + /* Visibilities don't count if we found an ambiguous basetype. */ if (rval == -2) *************** *** 892,896 **** { if (context == current_class_type ! || DERIVED_FROM_P (context, current_class_type)) PUBLIC_RETURN; else --- 1080,1084 ---- { if (context == current_class_type ! || UNIQUELY_DERIVED_FROM_P (context, current_class_type)) PUBLIC_RETURN; else *************** *** 922,926 **** || (visibility == visibility_protected && current_class_type ! && DERIVED_FROM_P (context, current_class_type))) visibility = visibility_public; goto ret; --- 1110,1114 ---- || (visibility == visibility_protected && current_class_type ! && UNIQUELY_DERIVED_FROM_P (context, current_class_type))) visibility = visibility_public; goto ret; *************** *** 954,959 **** /* If the next type was not VIA_PUBLIC, then fields of all remaining class past that one are private. */ ! if (types && ! TREE_VIA_PUBLIC (types)) ! visibility = visibility_private; } --- 1142,1152 ---- /* If the next type was not VIA_PUBLIC, then fields of all remaining class past that one are private. */ ! if (types) ! { ! if (TREE_VIA_PROTECTED (types)) ! visibility = visibility_protected; ! else if (! TREE_VIA_PUBLIC (types)) ! visibility = visibility_private; ! } } *************** *** 979,983 **** those same members in one another. */ if (current_class_type ! && DERIVED_FROM_P (context, current_class_type)) PUBLIC_RETURN; PROTECTED_RETURN; --- 1172,1176 ---- those same members in one another. */ if (current_class_type ! && UNIQUELY_DERIVED_FROM_P (context, current_class_type)) PUBLIC_RETURN; PROTECTED_RETURN; *************** *** 986,989 **** --- 1179,1195 ---- } + if (visibility == visibility_protected) + { + /* reverse_path? */ + if (TREE_PRIVATE (field)) + PRIVATE_RETURN; + /* We want to make sure that all non-private members in + the current class (as derived) are accessible. */ + if (current_class_type + && UNIQUELY_DERIVED_FROM_P (context, current_class_type)) + PUBLIC_RETURN; + PROTECTED_RETURN; + } + if (visibility == visibility_private && current_class_type != NULL_TREE) *************** *** 1181,1193 **** for (i = 0; i < n_baselinks; i++) { ! tree child = TREE_VEC_ELT (binfos, i); ! if (BINFO_FIELDS_MARKED (child) == 0) { tree btypes; ! SET_BINFO_FIELDS_MARKED (child); ! btypes = my_tree_cons (NULL_TREE, child, basetype_chain); ! TREE_VIA_PUBLIC (btypes) = TREE_VIA_PUBLIC (child); ! TREE_VIA_VIRTUAL (btypes) = TREE_VIA_VIRTUAL (child); obstack_ptr_grow (&search_obstack, btypes); tail += 1; --- 1387,1400 ---- for (i = 0; i < n_baselinks; i++) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); ! if (BINFO_FIELDS_MARKED (base_binfo) == 0) { tree btypes; ! SET_BINFO_FIELDS_MARKED (base_binfo); ! btypes = my_tree_cons (NULL_TREE, base_binfo, basetype_chain); ! TREE_VIA_PUBLIC (btypes) = TREE_VIA_PUBLIC (base_binfo); ! TREE_VIA_PROTECTED (btypes) = TREE_VIA_PROTECTED (base_binfo); ! TREE_VIA_VIRTUAL (btypes) = TREE_VIA_VIRTUAL (base_binfo); obstack_ptr_grow (&search_obstack, btypes); tail += 1; *************** *** 1324,1330 **** errstr = "member `%s' declared protected"; else if (this_v == visibility_private) ! errstr = TREE_PRIVATE (rval) ? "member `%s' is private" : "member `%s' is from private base class"; else if (this_v == visibility_protected) ! errstr = "member `%s' is protected"; } --- 1531,1541 ---- errstr = "member `%s' declared protected"; else if (this_v == visibility_private) ! errstr = TREE_PRIVATE (rval) ! ? "member `%s' is private" ! : "member `%s' is from private base class"; else if (this_v == visibility_protected) ! errstr = TREE_PROTECTED (rval) ! ? "member `%s' is protected" ! : "member `%s' is from protected base class"; } *************** *** 1419,1423 **** { #ifdef GATHER_STATISTICS ! n_outer_fields_searched++; #endif if (DECL_NAME (*methods) == name) --- 1630,1634 ---- { #ifdef GATHER_STATISTICS ! n_outer_fields_searched++; #endif if (DECL_NAME (*methods) == name) *************** *** 1566,1578 **** for (i = 0; i < n_baselinks; i++) { ! tree child = TREE_VEC_ELT (binfos, i); ! if (BINFO_FIELDS_MARKED (child) == 0) { tree btypes; ! SET_BINFO_FIELDS_MARKED (child); ! btypes = my_tree_cons (NULL_TREE, child, basetype_chain); ! TREE_VIA_PUBLIC (btypes) = TREE_VIA_PUBLIC (child); ! TREE_VIA_VIRTUAL (btypes) = TREE_VIA_VIRTUAL (child); obstack_ptr_grow (&search_obstack, btypes); tail += 1; --- 1777,1790 ---- for (i = 0; i < n_baselinks; i++) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); ! if (BINFO_FIELDS_MARKED (base_binfo) == 0) { tree btypes; ! SET_BINFO_FIELDS_MARKED (base_binfo); ! btypes = my_tree_cons (NULL_TREE, base_binfo, basetype_chain); ! TREE_VIA_PUBLIC (btypes) = TREE_VIA_PUBLIC (base_binfo); ! TREE_VIA_PROTECTED (btypes) = TREE_VIA_PROTECTED (base_binfo); ! TREE_VIA_VIRTUAL (btypes) = TREE_VIA_VIRTUAL (base_binfo); obstack_ptr_grow (&search_obstack, btypes); tail += 1; *************** *** 1707,1711 **** even be queued. */ ! int breadth_first_search (binfo, testfn, qfn) tree binfo; --- 1919,1923 ---- even be queued. */ ! HOST_WIDE_INT breadth_first_search (binfo, testfn, qfn) tree binfo; *************** *** 1727,1736 **** for (i = 0; i < n_baselinks; i++) { ! tree child = TREE_VEC_ELT (binfos, i); ! if (BINFO_MARKED (child) == 0 && (qfn == 0 || (*qfn) (binfo, i))) { ! SET_BINFO_MARKED (child); obstack_ptr_grow (&search_obstack, binfo); obstack_int_grow (&search_obstack, i); --- 1939,1948 ---- for (i = 0; i < n_baselinks; i++) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); ! if (BINFO_MARKED (base_binfo) == 0 && (qfn == 0 || (*qfn) (binfo, i))) { ! SET_BINFO_MARKED (base_binfo); obstack_ptr_grow (&search_obstack, binfo); obstack_int_grow (&search_obstack, i); *************** *** 1748,1752 **** binfo = search_stack->first[head++]; ! i = (int)search_stack->first[head++]; if (rval = (*testfn) (binfo, i)) break; --- 1960,1964 ---- binfo = search_stack->first[head++]; ! i = (HOST_WIDE_INT)search_stack->first[head++]; if (rval = (*testfn) (binfo, i)) break; *************** *** 1759,1763 **** { tree binfo = *tp++; ! int i = (int)(*tp++); CLEAR_BINFO_MARKED (BINFO_BASETYPE (binfo, i)); } --- 1971,1975 ---- { tree binfo = *tp++; ! int i = (HOST_WIDE_INT)(*tp++); CLEAR_BINFO_MARKED (BINFO_BASETYPE (binfo, i)); } *************** *** 1777,1781 **** { tree basetype; ! assert (i != 0); basetype = BINFO_TYPE (BINFO_BASETYPE (binfo, i)); return TYPE_NEEDS_CONSTRUCTOR (basetype); --- 1989,1993 ---- { tree basetype; ! my_friendly_assert (i != 0, 296); basetype = BINFO_TYPE (BINFO_BASETYPE (binfo, i)); return TYPE_NEEDS_CONSTRUCTOR (basetype); *************** *** 2052,2061 **** for (i = 0; i < n_baselinks; i++) { ! tree child = TREE_VEC_ELT (binfos, i); tree btypes; ! btypes = hash_tree_cons (TREE_VIA_PUBLIC (child), ! TREE_VIA_VIRTUAL (child), ! NULL_TREE, child, basetypes); obstack_ptr_grow (&search_obstack, btypes); --- 2264,2274 ---- for (i = 0; i < n_baselinks; i++) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); tree btypes; ! btypes = hash_tree_cons (TREE_VIA_PUBLIC (base_binfo), ! TREE_VIA_VIRTUAL (base_binfo), ! TREE_VIA_PROTECTED (base_binfo), ! NULL_TREE, base_binfo, basetypes); obstack_ptr_grow (&search_obstack, btypes); *************** *** 2076,2080 **** { nval = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), index); ! rval = hash_tree_cons (0, 0, basetypes, nval, rval); if (TYPE_BINFO_BASETYPES (type) == 0) goto dont_queue; --- 2289,2293 ---- { nval = TREE_VEC_ELT (CLASSTYPE_METHOD_VEC (type), index); ! rval = hash_tree_cons (0, 0, 0, basetypes, nval, rval); if (TYPE_BINFO_BASETYPES (type) == 0) goto dont_queue; *************** *** 2137,2141 **** (mi_matrix+(BINFO_CID (C)-1)) ! /* The main function which implements depth first search. */ static void dfs_walk (binfo, fn, qfn) --- 2350,2376 ---- (mi_matrix+(BINFO_CID (C)-1)) ! /* This routine converts a pointer to be a pointer of an immediate ! base class. The normal convert_pointer_to routine would diagnose ! the conversion as ambiguous, under MI code that has the base class ! as an ambiguous base class. */ ! static tree ! convert_pointer_to_single_level (to_type, expr) ! tree to_type, expr; ! { ! tree binfo_of_derived; ! tree last; ! ! binfo_of_derived = TYPE_BINFO (TREE_TYPE (TREE_TYPE (expr))); ! last = get_binfo (to_type, TREE_TYPE (TREE_TYPE (expr)), 0); ! BINFO_INHERITANCE_CHAIN (last) = binfo_of_derived; ! BINFO_INHERITANCE_CHAIN (binfo_of_derived) = NULL_TREE; ! return build_vbase_path (PLUS_EXPR, TYPE_POINTER_TO (to_type), expr, last, 1); ! } ! ! /* The main function which implements depth first search. ! ! This routine has to remember the path it walked up, when ! dfs_init_vbase_pointers is the work function, as otherwise there ! would be no record. */ static void dfs_walk (binfo, fn, qfn) *************** *** 2149,2157 **** for (i = 0; i < n_baselinks; i++) { ! tree child = TREE_VEC_ELT (binfos, i); ! if ((*qfn)(child)) { ! dfs_walk (child, fn, qfn); } } --- 2384,2467 ---- for (i = 0; i < n_baselinks; i++) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); ! if ((*qfn)(base_binfo)) { ! if (fn == dfs_init_vbase_pointers) ! { ! /* When traversing an arbitrary MI hierarchy, we need to keep ! a record of the path we took to get down to the final base ! type, as otherwise there would be no record of it, and just ! trying to blindly convert at the bottom would be ambiguous. ! ! The easiest way is to do the conversions one step at a time, ! as we know we want the immediate base class at each step. ! ! The only special trick to converting one step at a time, ! is that when we hit the first virtual base class, we must ! use the SLOT value for it, and not use the normal convert ! routine. ! */ ! tree saved_vbase_decl_ptr_intermediate ! = vbase_decl_ptr_intermediate; ! int save_saw_first_vbase = saw_first_vbase; ! ! if (!saw_first_vbase && TREE_VIA_VIRTUAL (base_binfo)) ! { ! saw_first_vbase = 1; ! /* No need for the conversion here, as we know it is the ! right type. */ ! vbase_decl_ptr_intermediate = ! (tree)CLASSTYPE_SEARCH_SLOT (BINFO_TYPE (base_binfo)); ! } ! else ! { ! #ifdef CHECK_convert_pointer_to_single_level ! /* This code here introduces a little software fault ! tolerance It should be that case that the second ! one always gets the same valid answer that the ! first one gives, if the first one gives a valid ! answer. ! ! If it doesn't, the second algorithm is at fault ! and needs to be fixed. ! ! The first one is known to be bad and produce ! error_mark_node when dealing with MI base ! classes. It is the only problem supposed to be ! fixed by the second. */ ! #endif ! tree vdpi1, vdpi2; ! ! #ifdef CHECK_convert_pointer_to_single_level ! vdpi1 = convert_pointer_to (BINFO_TYPE (base_binfo), ! vbase_decl_ptr_intermediate); ! #endif ! vdpi2 = convert_pointer_to_single_level (BINFO_TYPE (base_binfo), ! vbase_decl_ptr_intermediate); ! vbase_decl_ptr_intermediate = vdpi2; ! #ifdef CHECK_convert_pointer_to_single_level ! if (vdpi1 == error_mark_node && vdpi2 != vdpi1) ! { ! extern int errorcount; ! errorcount -=2; ! warning ("internal: Don't worry, be happy, I can fix tangs man. (ignore above error)"); ! } ! else if (simple_cst_equal (vdpi1, vdpi2) != 1) { ! if (simple_cst_equal (vdpi1, vdpi2) == 0) ! warning ("internal: convert_pointer_to_single_level: They are not the same, going with old algorithm"); ! else ! warning ("internal: convert_pointer_to_single_level: They might not be the same, going with old algorithm"); ! vbase_decl_ptr_intermediate = vdpi1; ! } ! #endif ! } ! ! dfs_walk (base_binfo, fn, qfn); ! ! vbase_decl_ptr_intermediate = saved_vbase_decl_ptr_intermediate; ! saw_first_vbase = save_saw_first_vbase; ! } else ! dfs_walk (base_binfo, fn, qfn); } } *************** *** 2174,2192 **** static int bfs_unmarkedp (binfo, i) tree binfo; int i; { return BINFO_MARKED (BINFO_BASETYPE (binfo, i)) == 0; } ! static int marked3p (binfo) tree binfo; { return BINFO_VTABLE_PATH_MARKED (binfo); } ! static int bfs_marked3p (binfo, i) tree binfo; int i; { return BINFO_VTABLE_PATH_MARKED (BINFO_BASETYPE (binfo, i)); } ! static int unmarked3p (binfo) tree binfo; { return BINFO_VTABLE_PATH_MARKED (binfo) == 0; } ! static int bfs_unmarked3p (binfo, i) tree binfo; int i; { return BINFO_VTABLE_PATH_MARKED (BINFO_BASETYPE (binfo, i)) == 0; } ! static int marked4p (binfo) tree binfo; { return BINFO_NEW_VTABLE_MARKED (binfo); } ! static int bfs_marked4p (binfo, i) tree binfo; int i; { return BINFO_NEW_VTABLE_MARKED (BINFO_BASETYPE (binfo, i)); } ! static int unmarked4p (binfo) tree binfo; { return BINFO_NEW_VTABLE_MARKED (binfo) == 0; } ! static int bfs_unmarked4p (binfo, i) tree binfo; int i; { return BINFO_NEW_VTABLE_MARKED (BINFO_BASETYPE (binfo, i)) == 0; } --- 2484,2502 ---- static int bfs_unmarkedp (binfo, i) tree binfo; int i; { return BINFO_MARKED (BINFO_BASETYPE (binfo, i)) == 0; } ! static int marked_vtable_pathp (binfo) tree binfo; { return BINFO_VTABLE_PATH_MARKED (binfo); } ! static int bfs_marked_vtable_pathp (binfo, i) tree binfo; int i; { return BINFO_VTABLE_PATH_MARKED (BINFO_BASETYPE (binfo, i)); } ! static int unmarked_vtable_pathp (binfo) tree binfo; { return BINFO_VTABLE_PATH_MARKED (binfo) == 0; } ! static int bfs_unmarked_vtable_pathp (binfo, i) tree binfo; int i; { return BINFO_VTABLE_PATH_MARKED (BINFO_BASETYPE (binfo, i)) == 0; } ! static int marked_new_vtablep (binfo) tree binfo; { return BINFO_NEW_VTABLE_MARKED (binfo); } ! static int bfs_marked_new_vtablep (binfo, i) tree binfo; int i; { return BINFO_NEW_VTABLE_MARKED (BINFO_BASETYPE (binfo, i)); } ! static int unmarked_new_vtablep (binfo) tree binfo; { return BINFO_NEW_VTABLE_MARKED (binfo) == 0; } ! static int bfs_unmarked_new_vtablep (binfo, i) tree binfo; int i; { return BINFO_NEW_VTABLE_MARKED (BINFO_BASETYPE (binfo, i)) == 0; } *************** *** 2227,2251 **** static void ! dfs_mark3 (binfo) tree binfo; { SET_BINFO_VTABLE_PATH_MARKED (binfo); } static void ! dfs_unmark3 (binfo) tree binfo; { CLEAR_BINFO_VTABLE_PATH_MARKED (binfo); } static void ! dfs_mark4 (binfo) tree binfo; { SET_BINFO_NEW_VTABLE_MARKED (binfo); } static void ! dfs_unmark4 (binfo) tree binfo; { CLEAR_BINFO_NEW_VTABLE_MARKED (binfo); } static void - dfs_unmark34 (binfo) tree binfo; - { CLEAR_BINFO_VTABLE_PATH_MARKED (binfo); - CLEAR_BINFO_NEW_VTABLE_MARKED (binfo); } - - static void dfs_clear_search_slot (binfo) tree binfo; { CLASSTYPE_SEARCH_SLOT (BINFO_TYPE (binfo)) = 0; } --- 2537,2556 ---- static void ! dfs_mark_vtable_path (binfo) tree binfo; { SET_BINFO_VTABLE_PATH_MARKED (binfo); } static void ! dfs_unmark_vtable_path (binfo) tree binfo; { CLEAR_BINFO_VTABLE_PATH_MARKED (binfo); } static void ! dfs_mark_new_vtable (binfo) tree binfo; { SET_BINFO_NEW_VTABLE_MARKED (binfo); } static void ! dfs_unmark_new_vtable (binfo) tree binfo; { CLEAR_BINFO_NEW_VTABLE_MARKED (binfo); } static void dfs_clear_search_slot (binfo) tree binfo; { CLASSTYPE_SEARCH_SLOT (BINFO_TYPE (binfo)) = 0; } *************** *** 2301,2308 **** } ! static tree vbase_types; ! static tree vbase_decl, vbase_decl_ptr; ! static tree vbase_init_result; ! static void dfs_find_vbases (binfo) --- 2606,2611 ---- } ! /* Attach to the type of the virtual base class, the pointer to the ! virtual base class, given the global pointer vbase_decl_ptr. */ static void dfs_find_vbases (binfo) *************** *** 2314,2323 **** for (i = n_baselinks-1; i >= 0; i--) { ! tree child = TREE_VEC_ELT (binfos, i); ! if (TREE_VIA_VIRTUAL (child) ! && CLASSTYPE_SEARCH_SLOT (BINFO_TYPE (child)) == 0) { ! tree vbase = BINFO_TYPE (child); tree binfo = binfo_member (vbase, vbase_types); --- 2617,2626 ---- for (i = n_baselinks-1; i >= 0; i--) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); ! if (TREE_VIA_VIRTUAL (base_binfo) ! && CLASSTYPE_SEARCH_SLOT (BINFO_TYPE (base_binfo)) == 0) { ! tree vbase = BINFO_TYPE (base_binfo); tree binfo = binfo_member (vbase, vbase_types); *************** *** 2354,2358 **** --- 2657,2671 ---- return; + this_vbase_ptr = vbase_decl_ptr_intermediate; + + if (TYPE_POINTER_TO (type) != TREE_TYPE (this_vbase_ptr)) + my_friendly_abort (125); + + #if 0 distance = get_base_distance (type, TREE_TYPE (vbase_decl), 0, &path); + if (distance == -2) + { + error ("inheritance lattice too complex below"); + } while (path) { *************** *** 2364,2371 **** if (distance > 0) ! this_vbase_ptr = convert_pointer_to (type, CLASSTYPE_SEARCH_SLOT (BINFO_TYPE (path))); else this_vbase_ptr = convert_pointer_to (type, vbase_decl_ptr); while (fields && DECL_NAME (fields) && VBASE_NAME_P (DECL_NAME (fields))) --- 2677,2689 ---- if (distance > 0) ! this_vbase_ptr = convert_pointer_to (type, (tree)CLASSTYPE_SEARCH_SLOT (BINFO_TYPE (path))); else this_vbase_ptr = convert_pointer_to (type, vbase_decl_ptr); + /* This happens when it is ambiguous. */ + if (this_vbase_ptr == error_mark_node) + return; + #endif + while (fields && DECL_NAME (fields) && VBASE_NAME_P (DECL_NAME (fields))) *************** *** 2382,2388 **** } ! /* Sometimes this needs to clear both 3 and 4. Other times, ! just 4, but optimizer should make both with equal efficiency ! (though it does not currently). */ static void dfs_clear_vbase_slots (binfo) --- 2700,2706 ---- } ! /* Sometimes this needs to clear both VTABLE_PATH and NEW_VTABLE. Other ! times, just NEW_VTABLE, but optimizer should make both with equal ! efficiency (though it does not currently). */ static void dfs_clear_vbase_slots (binfo) *************** *** 2408,2415 **** vbase_decl_ptr = decl_ptr; vbase_decl = build_indirect_ref (decl_ptr, 0); vbase_init_result = NULL_TREE; ! dfs_walk (binfo, dfs_find_vbases, unmarked3p); ! dfs_walk (binfo, dfs_init_vbase_pointers, marked3p); ! dfs_walk (binfo, dfs_clear_vbase_slots, marked4p); flag_this_is_variable = old_flag; return vbase_init_result; --- 2726,2735 ---- vbase_decl_ptr = decl_ptr; vbase_decl = build_indirect_ref (decl_ptr, 0); + vbase_decl_ptr_intermediate = vbase_decl_ptr; + saw_first_vbase = 0; vbase_init_result = NULL_TREE; ! dfs_walk (binfo, dfs_find_vbases, unmarked_vtable_pathp); ! dfs_walk (binfo, dfs_init_vbase_pointers, marked_vtable_pathp); ! dfs_walk (binfo, dfs_clear_vbase_slots, marked_new_vtablep); flag_this_is_variable = old_flag; return vbase_init_result; *************** *** 2453,2457 **** /* This is an object of type IN_TYPE, */ flag_this_is_variable = -2; ! dfs_walk (main_binfo, dfs_find_vbases, unmarked4p); } --- 2773,2777 ---- /* This is an object of type IN_TYPE, */ flag_this_is_variable = -2; ! dfs_walk (main_binfo, dfs_find_vbases, unmarked_new_vtablep); } *************** *** 2468,2471 **** --- 2788,2792 ---- tree vtbl = BINFO_VTABLE (vbases); tree init = build_unary_op (ADDR_EXPR, vtbl, 0); + assemble_external (vtbl); TREE_USED (vtbl) = 1; *************** *** 2487,2491 **** } ! dfs_walk (binfo, dfs_clear_vbase_slots, marked4p); flag_this_is_variable = old_flag; --- 2808,2812 ---- } ! dfs_walk (binfo, dfs_clear_vbase_slots, marked_new_vtablep); flag_this_is_variable = old_flag; *************** *** 2537,2548 **** else for (i = binfos ? TREE_VEC_LENGTH (binfos)-1 : -1; i >= 0; i--) { ! tree child = TREE_VEC_ELT (binfos, i); ! if (TREE_VIA_VIRTUAL (child) && ! BINFO_VBASE_MARKED (child)) { ! vbase_types = make_binfo (integer_zero_node, BINFO_TYPE (child), ! BINFO_VTABLE (child), ! BINFO_VIRTUALS (child), vbase_types); TREE_VIA_VIRTUAL (vbase_types) = 1; ! SET_BINFO_VBASE_MARKED (child); } } --- 2858,2869 ---- else for (i = binfos ? TREE_VEC_LENGTH (binfos)-1 : -1; i >= 0; i--) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); ! if (TREE_VIA_VIRTUAL (base_binfo) && ! BINFO_VBASE_MARKED (base_binfo)) { ! vbase_types = make_binfo (integer_zero_node, BINFO_TYPE (base_binfo), ! BINFO_VTABLE (base_binfo), ! BINFO_VIRTUALS (base_binfo), vbase_types); TREE_VIA_VIRTUAL (vbase_types) = 1; ! SET_BINFO_VBASE_MARKED (base_binfo); } } *************** *** 2621,2627 **** { int j; ! tree child = TREE_VEC_ELT (binfos, i); ! tree baseclass = BINFO_TYPE (child); ! mi_boolean *base_row = BINFO_DERIVES_FROM_STAR (child); /* Don't search if there's nothing there! MI_SIZE can be --- 2942,2948 ---- { int j; ! tree base_binfo = TREE_VEC_ELT (binfos, i); ! tree baseclass = BINFO_TYPE (base_binfo); ! mi_boolean *base_row = BINFO_DERIVES_FROM_STAR (base_binfo); /* Don't search if there's nothing there! MI_SIZE can be *************** *** 2825,2829 **** the row, install it. This happens when that virtual function comes from a virtual baseclass, or a non-leftmost baseclass. */ ! for (row1 = 1; row1 < rows; row1++) { --- 3146,3150 ---- the row, install it. This happens when that virtual function comes from a virtual baseclass, or a non-leftmost baseclass. */ ! for (row1 = 1; row1 < rows; row1++) { *************** *** 2857,2861 **** { /* They are equal. There are four possibilities: ! (1) Derived class is defining this virtual function. (2) Two paths to the same virtual function in the --- 3178,3182 ---- { /* They are equal. There are four possibilities: ! (1) Derived class is defining this virtual function. (2) Two paths to the same virtual function in the *************** *** 2866,2870 **** (4) Two paths to the same virtual function in different base classes. ! The first three cases are ok (non-ambiguous). */ --- 3187,3191 ---- (4) Two paths to the same virtual function in different base classes. ! The first three cases are ok (non-ambiguous). */ *************** *** 2991,2995 **** context = DECL_CLASS_CONTEXT (value); ! if (context == type || TYPE_DERIVES_FROM (context, type)) value = fields; else --- 3312,3317 ---- context = DECL_CLASS_CONTEXT (value); ! if (context && (context == type ! || TYPE_DERIVES_FROM (context, type))) value = fields; else *************** *** 3174,3178 **** break; default: ! assert (0); } tag = xref_tag (code_type_node, TREE_PURPOSE (tags), --- 3496,3500 ---- break; default: ! my_friendly_assert (0, 297); } tag = xref_tag (code_type_node, TREE_PURPOSE (tags), *************** *** 3283,3287 **** it is possible to distinguish "L" from "A's L", and also from ! "C's L from A". */ tree build_type_pathname (format, parent, type) --- 3605,3614 ---- it is possible to distinguish "L" from "A's L", and also from ! "C's L from A". ! ! Make sure to use the DECL_ASSEMBLER_NAME of the TYPE_NAME of the ! type, as template have DECL_NAMEs like: X, whereas the ! DECL_ASSEMBLER_NAME is set to be something the assembler can handle. ! */ tree build_type_pathname (format, parent, type) *************** *** 3301,3308 **** /* Put on TYPE+PARENT. */ obstack_grow (&temporary_obstack, ! TYPE_NAME_STRING (type), TYPE_NAME_LENGTH (type)); obstack_1grow (&temporary_obstack, JOINER); obstack_grow0 (&temporary_obstack, ! TYPE_NAME_STRING (parent), TYPE_NAME_LENGTH (parent)); i = obstack_object_size (&temporary_obstack); base = obstack_base (&temporary_obstack); --- 3628,3637 ---- /* Put on TYPE+PARENT. */ obstack_grow (&temporary_obstack, ! TYPE_ASSEMBLER_NAME_STRING (type), ! TYPE_ASSEMBLER_NAME_LENGTH (type)); obstack_1grow (&temporary_obstack, JOINER); obstack_grow0 (&temporary_obstack, ! TYPE_ASSEMBLER_NAME_STRING (parent), ! TYPE_ASSEMBLER_NAME_LENGTH (parent)); i = obstack_object_size (&temporary_obstack); base = obstack_base (&temporary_obstack); *************** *** 3356,3360 **** tree binfo = TYPE_BINFO (type); bfs_unmark_finished_struct (binfo, -1); ! breadth_first_search (binfo, bfs_unmark_finished_struct, bfs_marked3p); } --- 3685,3689 ---- tree binfo = TYPE_BINFO (type); bfs_unmark_finished_struct (binfo, -1); ! breadth_first_search (binfo, bfs_unmark_finished_struct, bfs_marked_vtable_pathp); } *************** *** 3402,3420 **** type_stack = push_type_level (0, &type_obstack); _vptr_name = get_identifier ("_vptr"); - } - - tree - get_wrapper (type) - tree type; - { - tree wrap_type; - char *name; - assert (IS_AGGR_TYPE (type)); - wrap_type = TYPE_WRAP_TYPE (type); - name = (char *)alloca (TYPE_NAME_LENGTH (wrap_type) - + strlen (WRAPPER_NAME_FORMAT)); - sprintf (name, WRAPPER_NAME_FORMAT, TYPE_NAME_STRING (wrap_type)); - return lookup_fnfields (TYPE_BINFO (wrap_type), - get_identifier (name), 0); } --- 3731,3734 ---- diff -rc2N gcc-2.3.1/cp-spew.c gcc-2.3.2/cp-spew.c *** gcc-2.3.1/cp-spew.c Thu Sep 24 21:49:49 1992 --- gcc-2.3.2/cp-spew.c Thu Nov 12 20:52:57 1992 *************** *** 32,36 **** #include "flags.h" #include "obstack.h" - #include "assert.h" /* This takes a token stream that hasn't decided much about types and --- 32,35 ---- *************** *** 68,72 **** #ifdef SPEW_DEBUG int spew_debug = 0; ! static int yylex_ctr = 0; static int debug_yychar (); #endif --- 67,71 ---- #ifdef SPEW_DEBUG int spew_debug = 0; ! static unsigned int yylex_ctr = 0; static int debug_yychar (); #endif *************** *** 133,137 **** /* could just have this do slurp_ implicitly, but this way is easier * to debug... */ ! assert (n < num_tokens()); return ((struct token*)obstack_base(&token_obstack))+n+first_token; } --- 132,136 ---- /* could just have this do slurp_ implicitly, but this way is easier * to debug... */ ! my_friendly_assert (n < num_tokens(), 298); return ((struct token*)obstack_base(&token_obstack))+n+first_token; } diff -rc2N gcc-2.3.1/cp-tree.c gcc-2.3.2/cp-tree.c *** gcc-2.3.1/cp-tree.c Thu Sep 24 21:49:56 1992 --- gcc-2.3.2/cp-tree.c Thu Nov 12 20:53:05 1992 *************** *** 25,29 **** #include "cp-tree.h" #include "flags.h" - #include "assert.h" #define CEIL(x,y) (((x) + (y) - 1) / (y)) --- 25,28 ---- *************** *** 281,285 **** /* Here is how primitive or already-canonicalized types' hash codes are made. MUST BE CONSISTENT WITH tree.c !!! */ ! #define TYPE_HASH(TYPE) ((int) (TYPE) & 0777777) /* Construct, lay out and return the type of methods belonging to class --- 280,284 ---- /* Here is how primitive or already-canonicalized types' hash codes are made. MUST BE CONSISTENT WITH tree.c !!! */ ! #define TYPE_HASH(TYPE) ((HOST_WIDE_INT) (TYPE) & 0777777) /* Construct, lay out and return the type of methods belonging to class *************** *** 382,386 **** } ! /* Add OFFSET to all child types of T. OFFSET, which is a type offset, is number of bytes. --- 381,385 ---- } ! /* Add OFFSET to all base types of T. OFFSET, which is a type offset, is number of bytes. *************** *** 398,404 **** for (i = 0; i < n_baselinks; /* note increment is done in the loop. */) { ! tree child = TREE_VEC_ELT (binfos, i); ! if (TREE_VIA_VIRTUAL (child)) i += 1; else --- 397,403 ---- for (i = 0; i < n_baselinks; /* note increment is done in the loop. */) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); ! if (TREE_VIA_VIRTUAL (base_binfo)) i += 1; else *************** *** 405,409 **** { int j; ! tree child_binfos = BINFO_BASETYPES (child); tree delta; --- 404,408 ---- { int j; ! tree base_binfos = BINFO_BASETYPES (base_binfo); tree delta; *************** *** 415,419 **** delta = size_binop (MINUS_EXPR, BINFO_OFFSET (TREE_VEC_ELT (binfos, j)), ! BINFO_OFFSET (child)); break; } --- 414,418 ---- delta = size_binop (MINUS_EXPR, BINFO_OFFSET (TREE_VEC_ELT (binfos, j)), ! BINFO_OFFSET (base_binfo)); break; } *************** *** 420,432 **** #if 0 ! if (BINFO_OFFSET_ZEROP (child)) ! BINFO_OFFSET (child) = offset; else ! BINFO_OFFSET (child) ! = size_binop (PLUS_EXPR, BINFO_OFFSET (child), offset); #else ! BINFO_OFFSET (child) = offset; #endif ! if (child_binfos) { int k; --- 419,431 ---- #if 0 ! if (BINFO_OFFSET_ZEROP (base_binfo)) ! BINFO_OFFSET (base_binfo) = offset; else ! BINFO_OFFSET (base_binfo) ! = size_binop (PLUS_EXPR, BINFO_OFFSET (base_binfo), offset); #else ! BINFO_OFFSET (base_binfo) = offset; #endif ! if (base_binfos) { int k; *************** *** 433,453 **** tree chain = NULL_TREE; ! /* Now unshare the structure beneath CHILD. */ ! for (k = TREE_VEC_LENGTH (child_binfos)-1; k >= 0; k--) { ! tree child_child = TREE_VEC_ELT (child_binfos, k); ! if (! TREE_VIA_VIRTUAL (child_child)) ! TREE_VEC_ELT (child_binfos, k) ! = make_binfo (BINFO_OFFSET (child_child), ! BINFO_TYPE (child_child), ! BINFO_VTABLE (child_child), ! BINFO_VIRTUALS (child_child), chain); ! chain = TREE_VEC_ELT (child_binfos, k); ! TREE_VIA_PUBLIC (chain) = TREE_VIA_PUBLIC (child_child); } ! /* Now propagate the offset to the children. */ ! propagate_binfo_offsets (child, offset); } --- 432,453 ---- tree chain = NULL_TREE; ! /* Now unshare the structure beneath BASE_BINFO. */ ! for (k = TREE_VEC_LENGTH (base_binfos)-1; k >= 0; k--) { ! tree base_base_binfo = TREE_VEC_ELT (base_binfos, k); ! if (! TREE_VIA_VIRTUAL (base_base_binfo)) ! TREE_VEC_ELT (base_binfos, k) ! = make_binfo (BINFO_OFFSET (base_base_binfo), ! BINFO_TYPE (base_base_binfo), ! BINFO_VTABLE (base_base_binfo), ! BINFO_VIRTUALS (base_base_binfo), chain); ! chain = TREE_VEC_ELT (base_binfos, k); ! TREE_VIA_PUBLIC (chain) = TREE_VIA_PUBLIC (base_base_binfo); ! TREE_VIA_PROTECTED (chain) = TREE_VIA_PROTECTED (base_base_binfo); } ! /* Now propagate the offset to the base types. */ ! propagate_binfo_offsets (base_binfo, offset); } *************** *** 540,564 **** vbase_types = TREE_CHAIN (vbase_types)) { ! tree child_binfos = BINFO_BASETYPES (vbase_types); ! if (child_binfos) { tree chain = NULL_TREE; int j; ! /* Now unshare the structure beneath CHILD. */ ! for (j = TREE_VEC_LENGTH (child_binfos)-1; j >= 0; j--) { ! tree child_child = TREE_VEC_ELT (child_binfos, j); ! if (! TREE_VIA_VIRTUAL (child_child)) ! TREE_VEC_ELT (child_binfos, j) ! = make_binfo (BINFO_OFFSET (child_child), ! BINFO_TYPE (child_child), ! BINFO_VTABLE (child_child), ! BINFO_VIRTUALS (child_child), chain); ! chain = TREE_VEC_ELT (child_binfos, j); ! TREE_VIA_PUBLIC (chain) = TREE_VIA_PUBLIC (child_child); } --- 540,565 ---- vbase_types = TREE_CHAIN (vbase_types)) { ! tree base_binfos = BINFO_BASETYPES (vbase_types); ! if (base_binfos) { tree chain = NULL_TREE; int j; ! /* Now unshare the structure beneath BASE_BINFO. */ ! for (j = TREE_VEC_LENGTH (base_binfos)-1; j >= 0; j--) { ! tree base_base_binfo = TREE_VEC_ELT (base_binfos, j); ! if (! TREE_VIA_VIRTUAL (base_base_binfo)) ! TREE_VEC_ELT (base_binfos, j) ! = make_binfo (BINFO_OFFSET (base_base_binfo), ! BINFO_TYPE (base_base_binfo), ! BINFO_VTABLE (base_base_binfo), ! BINFO_VIRTUALS (base_base_binfo), chain); ! chain = TREE_VEC_ELT (base_binfos, j); ! TREE_VIA_PUBLIC (chain) = TREE_VIA_PUBLIC (base_base_binfo); ! TREE_VIA_PROTECTED (chain) = TREE_VIA_PROTECTED (base_base_binfo); } *************** *** 606,611 **** { int inc, desired_align, int_vbase_size; ! register tree child = TREE_VEC_ELT (binfos, i); ! register tree basetype = BINFO_TYPE (child); tree decl, offset; --- 607,612 ---- { int inc, desired_align, int_vbase_size; ! register tree base_binfo = TREE_VEC_ELT (binfos, i); ! register tree basetype = BINFO_TYPE (base_binfo); tree decl, offset; *************** *** 612,618 **** if (TYPE_SIZE (basetype) == 0) { ! error_with_aggr_type (child, "base class `%s' has incomplete type"); ! TREE_VIA_PUBLIC (child) = 1; ! TREE_VIA_VIRTUAL (child) = 0; /* Should handle this better so that --- 613,620 ---- if (TYPE_SIZE (basetype) == 0) { ! error_with_aggr_type (base_binfo, "base class `%s' has incomplete type"); ! TREE_VIA_PUBLIC (base_binfo) = 1; ! TREE_VIA_PROTECTED (base_binfo) = 0; ! TREE_VIA_VIRTUAL (base_binfo) = 0; /* Should handle this better so that *************** *** 629,633 **** derived type. */ ! if (TREE_VIA_VIRTUAL (child)) { int j; --- 631,635 ---- derived type. */ ! if (TREE_VIA_VIRTUAL (base_binfo)) { int j; *************** *** 645,652 **** for (j = 0; j < n_baseclasses; j++) { ! tree other_child = TREE_VEC_ELT (binfos, j); ! if (! TREE_VIA_VIRTUAL (other_child) && binfo_member (basetype, ! CLASSTYPE_VBASECLASSES (BINFO_TYPE (other_child)))) goto got_it; } --- 647,654 ---- for (j = 0; j < n_baseclasses; j++) { ! tree other_base_binfo = TREE_VEC_ELT (binfos, j); ! if (! TREE_VIA_VIRTUAL (other_base_binfo) && binfo_member (basetype, ! CLASSTYPE_VBASECLASSES (BINFO_TYPE (other_base_binfo)))) goto got_it; } *************** *** 665,669 **** DECL_ALIGN (decl) = TYPE_ALIGN (ptr_type_node); TREE_CHAIN (decl) = vbase_decls; ! BINFO_VPTR_FIELD (child) = decl; vbase_decls = decl; --- 667,671 ---- DECL_ALIGN (decl) = TYPE_ALIGN (ptr_type_node); TREE_CHAIN (decl) = vbase_decls; ! BINFO_VPTR_FIELD (base_binfo) = decl; vbase_decls = decl; *************** *** 698,713 **** warning ("in inheritance relationship `%s:%s %s'", TYPE_NAME_STRING (rec), ! TREE_VIA_VIRTUAL (child) ? " virtual" : "", TYPE_NAME_STRING (basetype)); } } ! BINFO_OFFSET (child) = offset; if (CLASSTYPE_VSIZE (basetype)) { ! BINFO_VTABLE (child) = TYPE_BINFO_VTABLE (basetype); ! BINFO_VIRTUALS (child) = TYPE_BINFO_VIRTUALS (basetype); } ! TREE_CHAIN (child) = TYPE_BINFO (rec); ! TYPE_BINFO (rec) = child; /* Add only the amount of storage not present in --- 700,715 ---- warning ("in inheritance relationship `%s:%s %s'", TYPE_NAME_STRING (rec), ! TREE_VIA_VIRTUAL (base_binfo) ? " virtual" : "", TYPE_NAME_STRING (basetype)); } } ! BINFO_OFFSET (base_binfo) = offset; if (CLASSTYPE_VSIZE (basetype)) { ! BINFO_VTABLE (base_binfo) = TYPE_BINFO_VTABLE (basetype); ! BINFO_VIRTUALS (base_binfo) = TYPE_BINFO_VIRTUALS (basetype); } ! TREE_CHAIN (base_binfo) = TYPE_BINFO (rec); ! TYPE_BINFO (rec) = base_binfo; /* Add only the amount of storage not present in *************** *** 797,800 **** --- 799,803 ---- && TREE_VIA_VIRTUAL (h->list) == TREE_VIA_VIRTUAL (list) && TREE_VIA_PUBLIC (h->list) == TREE_VIA_PUBLIC (list) + && TREE_VIA_PROTECTED (h->list) == TREE_VIA_PROTECTED (list) && TREE_PURPOSE (h->list) == TREE_PURPOSE (list) && TREE_VALUE (h->list) == TREE_VALUE (list) *************** *** 801,805 **** && TREE_CHAIN (h->list) == TREE_CHAIN (list)) { ! assert (TREE_TYPE (h->list) == TREE_TYPE (list)); return h->list; } --- 804,808 ---- && TREE_CHAIN (h->list) == TREE_CHAIN (list)) { ! my_friendly_assert (TREE_TYPE (h->list) == TREE_TYPE (list), 299); return h->list; } *************** *** 862,867 **** tree ! hash_tree_cons (via_public, via_virtual, purpose, value, chain) ! int via_public, via_virtual; tree purpose, value, chain; { --- 865,870 ---- tree ! hash_tree_cons (via_public, via_virtual, via_protected, purpose, value, chain) ! int via_public, via_virtual, via_protected; tree purpose, value, chain; { *************** *** 873,876 **** --- 876,880 ---- t = tree_cons (purpose, value, chain); TREE_VIA_PUBLIC (t) = via_public; + TREE_VIA_PROTECTED (t) = via_protected; TREE_VIA_VIRTUAL (t) = via_virtual; hashcode = list_hash (t); *************** *** 940,944 **** if (list != NULL_TREE) { ! assert (TREE_CHAIN (list) == NULL_TREE); return list; } --- 944,948 ---- if (list != NULL_TREE) { ! my_friendly_assert (TREE_CHAIN (list) == NULL_TREE, 301); return list; } *************** *** 996,1000 **** if (list != NULL_TREE) { ! assert (TREE_CHAIN (list) == NULL_TREE); return list; } --- 1000,1004 ---- if (list != NULL_TREE) { ! my_friendly_assert (TREE_CHAIN (list) == NULL_TREE, 302); return list; } *************** *** 1007,1015 **** && TREE_VIA_VIRTUAL (h->list) == 0 && TREE_VIA_PUBLIC (h->list) == 0 && TREE_PURPOSE (h->list) == 0 && TREE_VALUE (h->list) == value) { ! assert (TREE_TYPE (h->list) == 0); ! assert (TREE_CHAIN (h->list) == 0); return h->list; } --- 1011,1020 ---- && TREE_VIA_VIRTUAL (h->list) == 0 && TREE_VIA_PUBLIC (h->list) == 0 + && TREE_VIA_PROTECTED (h->list) == 0 && TREE_PURPOSE (h->list) == 0 && TREE_VALUE (h->list) == value) { ! my_friendly_assert (TREE_TYPE (h->list) == 0, 303); ! my_friendly_assert (TREE_CHAIN (h->list) == 0, 304); return h->list; } *************** *** 1065,1075 **** for (i = 0; i < n_baseclasses; i++) { ! tree child = TREE_VEC_ELT (binfos, i); ! tree old_child = old_binfo ? BINFO_BASETYPE (old_binfo, i) : 0; ! BINFO_BASETYPE (binfo, i) = child; if (old_binfo) { ! TREE_VIA_PUBLIC (child) = TREE_VIA_PUBLIC (old_child); ! TREE_VIA_VIRTUAL (child) = TREE_VIA_VIRTUAL (old_child); } } --- 1070,1081 ---- for (i = 0; i < n_baseclasses; i++) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); ! tree old_base_binfo = old_binfo ? BINFO_BASETYPE (old_binfo, i) : 0; ! BINFO_BASETYPE (binfo, i) = base_binfo; if (old_binfo) { ! TREE_VIA_PUBLIC (base_binfo) = TREE_VIA_PUBLIC (old_base_binfo); ! TREE_VIA_PROTECTED (base_binfo) = TREE_VIA_PROTECTED (old_base_binfo); ! TREE_VIA_VIRTUAL (base_binfo) = TREE_VIA_VIRTUAL (old_base_binfo); } } *************** *** 1296,1300 **** register int len = 0; ! assert (TREE_CODE (t) == FUNCTION_DECL); for (tail = t; tail; tail = DECL_CHAIN (tail)) len++; --- 1302,1306 ---- register int len = 0; ! my_friendly_assert (TREE_CODE (t) == FUNCTION_DECL, 300); for (tail = t; tail; tail = DECL_CHAIN (tail)) len++; *************** *** 1426,1430 **** tree *p1, *p2; { ! return (int)TREE_VALUE (*p1) - (int)TREE_VALUE (*p2); } --- 1432,1436 ---- tree *p1, *p2; { ! return (HOST_WIDE_INT)TREE_VALUE (*p1) - (HOST_WIDE_INT)TREE_VALUE (*p2); } *************** *** 1694,1698 **** /* This is used by the `assert' macro. It is provided in libgcc.a, ! which `cc' doesn't know how to link. */ void __eprintf (string, expression, line, filename) --- 1700,1706 ---- /* This is used by the `assert' macro. It is provided in libgcc.a, ! which `cc' doesn't know how to link. Note that the C++ front-end ! no longer actually uses the `assert' macro (instead, it calls ! my_friendly_assert). But all of the back-end files still need this. */ void __eprintf (string, expression, line, filename) diff -rc2N gcc-2.3.1/cp-tree.h gcc-2.3.2/cp-tree.h *** gcc-2.3.1/cp-tree.h Thu Sep 24 21:50:06 1992 --- gcc-2.3.2/cp-tree.h Thu Nov 12 20:53:16 1992 *************** *** 27,33 **** #define PARANOID 0 #endif - #if PARANOID - #include "assert.h" - #endif /* Language-dependent contents of an identifier. */ --- 27,30 ---- *************** *** 61,65 **** #else #define IDENTIFIER_LANG_SPECIFIC_PTR(NODE) \ ! (assert (TREE_CODE (NODE) == IDENTIFIER_NODE), \ (struct lang_identifier *) (NODE)) #define IDENTIFIER_GLOBAL_VALUE(NODE) \ --- 58,62 ---- #else #define IDENTIFIER_LANG_SPECIFIC_PTR(NODE) \ ! (my_friendly_assert (TREE_CODE (NODE) == IDENTIFIER_NODE, 325), \ (struct lang_identifier *) (NODE)) #define IDENTIFIER_GLOBAL_VALUE(NODE) \ *************** *** 82,86 **** #endif static tree * IDENTIFIER_TYPE_VALUE_PTR(NODE) tree NODE; { return ! (assert (TREE_CODE (NODE) == IDENTIFIER_NODE), &TREE_TYPE (NODE)) ;} #define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (IDENTIFIER_TYPE_VALUE(NODE)=TYPE) --- 79,83 ---- #endif static tree * IDENTIFIER_TYPE_VALUE_PTR(NODE) tree NODE; { return ! (my_friendly_assert (TREE_CODE (NODE) == IDENTIFIER_NODE, 326), &TREE_TYPE (NODE)) ;} #define SET_IDENTIFIER_TYPE_VALUE(NODE,TYPE) (IDENTIFIER_TYPE_VALUE(NODE)=TYPE) *************** *** 198,201 **** --- 195,200 ---- #endif + extern void cplus_decl_attributes (); + /* Functions in c-common.c: */ *************** *** 298,301 **** --- 297,304 ---- extern int warn_parentheses; + /* Warn about a subscript that has type char. */ + + extern int warn_char_subscripts; + /* Nonzero means warn about pointer casts that can drop a type qualifier from the pointer target type. */ *************** *** 303,306 **** --- 306,313 ---- extern int warn_cast_qual; + /* Warn about traditional constructs whose meanings changed in ANSI C. */ + + extern int warn_traditional; + /* Nonzero means warn about non virtual destructors in classes that have virtual functions. */ *************** *** 377,381 **** static tree * TYPE_IDENTIFIER_PTR(NODE) tree NODE; { return ! (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), &DECL_NAME (TYPE_NAME (NODE))) ;} #endif --- 384,388 ---- static tree * TYPE_IDENTIFIER_PTR(NODE) tree NODE; { return ! (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 327), &DECL_NAME (TYPE_NAME (NODE))) ;} #endif *************** *** 384,387 **** --- 391,397 ---- #define TYPE_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (TYPE_IDENTIFIER (NODE))) + #define TYPE_ASSEMBLER_NAME_STRING(NODE) (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE)))) + #define TYPE_ASSEMBLER_NAME_LENGTH(NODE) (IDENTIFIER_LENGTH (DECL_ASSEMBLER_NAME (TYPE_NAME (NODE)))) + #define IS_AGGR_TYPE_2(TYPE1,TYPE2) \ (TREE_CODE (TYPE1) == TREE_CODE (TYPE2) \ *************** *** 418,423 **** /* #define IS_AGGR_TYPE_2(TYPE1, TYPE2) (is_aggr_type_2 (TYPE1, TYPE2)) */ #endif ! /* Nonzero iff TYPE is derived from PARENT. */ ! #define DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 0, 0) >= 0) enum conversion_type { ptr_conv, constptr_conv, int_conv, real_conv, last_conversion_type }; --- 428,434 ---- /* #define IS_AGGR_TYPE_2(TYPE1, TYPE2) (is_aggr_type_2 (TYPE1, TYPE2)) */ #endif ! /* Nonzero iff TYPE is uniquely derived from PARENT. Under MI, PARENT can be an ! ambiguous base class of TYPE, and this macro will be false. */ ! #define UNIQUELY_DERIVED_FROM_P(PARENT, TYPE) (get_base_distance (PARENT, TYPE, 0, 0) >= 0) enum conversion_type { ptr_conv, constptr_conv, int_conv, real_conv, last_conversion_type }; *************** *** 478,482 **** unsigned debug_requested : 1; unsigned dynamic : 1; - unsigned has_wrapper_pred : 1; unsigned has_method_call_overloaded : 1; unsigned private_attr : 1; --- 489,492 ---- *************** *** 530,534 **** char *mi_matrix; union tree_node *conversions[last_conversion_type]; - union tree_node *wrap_type; union tree_node *dossier; --- 540,543 ---- *************** *** 611,620 **** #define CLASSTYPE_DOSSIER(NODE) (TYPE_LANG_SPECIFIC(NODE)->dossier) - #define TYPE_WRAP_TYPE(NODE) (TYPE_LANG_SPECIFIC(NODE)->wrap_type) - - #define TYPE_HAS_WRAPPER(NODE) (TYPE_LANG_SPECIFIC(NODE)->wrap_type == TYPE_MAIN_VARIANT (NODE)) - #define TYPE_NEEDS_WRAPPER(NODE) (TYPE_LANG_SPECIFIC(NODE)->wrap_type != 0 && TYPE_LANG_SPECIFIC(NODE)->wrap_type != TYPE_MAIN_VARIANT (NODE)) - #define TYPE_HAS_WRAPPER_PRED(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_wrapper_pred) - /* Nonzero means that this _CLASSTYPE node overloads operator(). */ #define TYPE_OVERLOADS_CALL_EXPR(NODE) (TYPE_LANG_SPECIFIC(NODE)->type_flags.has_call_overloaded) --- 620,623 ---- *************** *** 665,687 **** #define CLEAR_CLASSTYPE_MARKED6(NODE) (CLASSTYPE_MARKED6(NODE) = 0) #else ! #define CLASSTYPE_MARKED(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked) ! #define CLASSTYPE_MARKED2(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked2) ! #define CLASSTYPE_MARKED3(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked3) ! #define CLASSTYPE_MARKED4(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked4) ! #define CLASSTYPE_MARKED5(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked5) ! #define CLASSTYPE_MARKED6(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked6) /* Macros to modify the above flags */ ! #define SET_CLASSTYPE_MARKED(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked = 1) ! #define CLEAR_CLASSTYPE_MARKED(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked = 0) ! #define SET_CLASSTYPE_MARKED2(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked2 = 1) ! #define CLEAR_CLASSTYPE_MARKED2(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked2 = 0) ! #define SET_CLASSTYPE_MARKED3(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked3 = 1) ! #define CLEAR_CLASSTYPE_MARKED3(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked3 = 0) ! #define SET_CLASSTYPE_MARKED4(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked4 = 1) ! #define CLEAR_CLASSTYPE_MARKED4(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked4 = 0) ! #define SET_CLASSTYPE_MARKED5(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked5 = 1) ! #define CLEAR_CLASSTYPE_MARKED5(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked5 = 0) ! #define SET_CLASSTYPE_MARKED6(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked6 = 1) ! #define CLEAR_CLASSTYPE_MARKED6(NODE) (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't'), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked6 = 0) #endif --- 668,690 ---- #define CLEAR_CLASSTYPE_MARKED6(NODE) (CLASSTYPE_MARKED6(NODE) = 0) #else ! #define CLASSTYPE_MARKED(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 328), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked) ! #define CLASSTYPE_MARKED2(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 329), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked2) ! #define CLASSTYPE_MARKED3(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 330), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked3) ! #define CLASSTYPE_MARKED4(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 331), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked4) ! #define CLASSTYPE_MARKED5(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 332), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked5) ! #define CLASSTYPE_MARKED6(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 333), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked6) /* Macros to modify the above flags */ ! #define SET_CLASSTYPE_MARKED(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 334), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked = 1) ! #define CLEAR_CLASSTYPE_MARKED(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 335), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked = 0) ! #define SET_CLASSTYPE_MARKED2(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 336), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked2 = 1) ! #define CLEAR_CLASSTYPE_MARKED2(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 337), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked2 = 0) ! #define SET_CLASSTYPE_MARKED3(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 338), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked3 = 1) ! #define CLEAR_CLASSTYPE_MARKED3(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 339), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked3 = 0) ! #define SET_CLASSTYPE_MARKED4(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 340), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked4 = 1) ! #define CLEAR_CLASSTYPE_MARKED4(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 341), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked4 = 0) ! #define SET_CLASSTYPE_MARKED5(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 342), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked5 = 1) ! #define CLEAR_CLASSTYPE_MARKED5(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 343), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked5 = 0) ! #define SET_CLASSTYPE_MARKED6(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 344), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked6 = 1) ! #define CLEAR_CLASSTYPE_MARKED6(NODE) (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 't', 345), TYPE_LANG_SPECIFIC(NODE)->type_flags.marked6 = 0) #endif *************** *** 1182,1186 **** #endif static tree * DECL_NESTED_TYPENAME_PTR(NODE) tree NODE; { return ! (assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 'd'), &(NODE)->decl.arguments) ;} #endif --- 1185,1189 ---- #endif static tree * DECL_NESTED_TYPENAME_PTR(NODE) tree NODE; { return ! (my_friendly_assert (TREE_CODE_CLASS (TREE_CODE (NODE)) == 'd', 346), &(NODE)->decl.arguments) ;} #endif *************** *** 1378,1382 **** void pushclass (), popclass (), pushclasstype (); extern tree build_operator_fnname (), build_opfncall (), build_type_conversion (); - extern tree build_wrapper (); /* Points to the name of that function. May not be the DECL_NAME --- 1381,1384 ---- *************** *** 1433,1443 **** #define JOINER '$' - #define THIS_NAME "this" #define VPTR_NAME "$v" #define THROW_NAME "$eh_throw" #define DESTRUCTOR_DECL_PREFIX "_$_" - #define WRAPPER_DECL_FORMAT "__W$%s" - #define WRAPPER_PRED_DECL_FORMAT "__P$%s" - #define ANTI_WRAPPER_DECL_FORMAT "__w$%s" #define IN_CHARGE_NAME "__in$chrg" #define AUTO_VTABLE_NAME "__vtbl$me__" --- 1435,1441 ---- *************** *** 1460,1470 **** #define JOINER '.' - #define THIS_NAME "this" #define VPTR_NAME ".v" #define THROW_NAME ".eh_throw" #define DESTRUCTOR_DECL_PREFIX "_._" - #define WRAPPER_DECL_FORMAT "__W.%s" - #define WRAPPER_PRED_DECL_FORMAT "__P.%s" - #define ANTI_WRAPPER_DECL_FORMAT "__w.%s" #define IN_CHARGE_NAME "__in.chrg" #define AUTO_VTABLE_NAME "__vtbl.me__" --- 1458,1464 ---- *************** *** 1486,1493 **** #endif /* NO_DOLLAR_IN_LABEL */ #define DESTRUCTOR_NAME_FORMAT "~%s" - #define WRAPPER_NAME_FORMAT "()%s" - #define WRAPPER_PRED_NAME_FORMAT "()?%s" - #define ANTI_WRAPPER_NAME_FORMAT "~()%s" #define FILE_FUNCTION_PREFIX_LEN 9 #define VTABLE_DELTA_NAME "delta" --- 1480,1485 ---- #endif /* NO_DOLLAR_IN_LABEL */ + #define THIS_NAME "this" #define DESTRUCTOR_NAME_FORMAT "~%s" #define FILE_FUNCTION_PREFIX_LEN 9 #define VTABLE_DELTA_NAME "delta" *************** *** 1497,1502 **** #define EXCEPTION_CLEANUP_NAME "exception cleanup" ! #define THIS_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \ ! && IDENTIFIER_POINTER (ID_NODE)[1] == 't') #define VPTR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \ && IDENTIFIER_POINTER (ID_NODE)[1] == 'v') --- 1489,1493 ---- #define EXCEPTION_CLEANUP_NAME "exception cleanup" ! #define THIS_NAME_P(ID_NODE) (strcmp(IDENTIFIER_POINTER (ID_NODE), "this") == 0) #define VPTR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \ && IDENTIFIER_POINTER (ID_NODE)[1] == 'v') *************** *** 1503,1520 **** #define DESTRUCTOR_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == JOINER) - #define WRAPPER_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == '_' \ - && IDENTIFIER_POINTER (ID_NODE)[2] == 'W' \ - && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER) - #define WRAPPER_PRED_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == '_' \ - && IDENTIFIER_POINTER (ID_NODE)[2] == 'P' \ - && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER) - #define ANTI_WRAPPER_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[1] == '_' \ - && IDENTIFIER_POINTER (ID_NODE)[2] == 'w' \ - && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER) - #define WRAPPER_OR_ANTI_WRAPPER_NAME_P(ID_NODE) \ - (IDENTIFIER_POINTER (ID_NODE)[1] == '_' \ - && (IDENTIFIER_POINTER (ID_NODE)[2]|('W'^'w')) == 'w' \ - && IDENTIFIER_POINTER (ID_NODE)[3] == JOINER) - #define VTABLE_NAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[3] == JOINER \ && IDENTIFIER_POINTER (ID_NODE)[2] == 't'\ --- 1494,1497 ---- *************** *** 1537,1541 **** hold on to. In practice, this should not appear, but it should not be harmful if it does. */ ! #define ANON_AGGRNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER) #define ANON_PARMNAME_FORMAT "_%d" #define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \ --- 1514,1519 ---- hold on to. In practice, this should not appear, but it should not be harmful if it does. */ ! #define ANON_AGGRNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == JOINER \ ! && IDENTIFIER_POINTER (ID_NODE)[1] == '_') #define ANON_PARMNAME_FORMAT "_%d" #define ANON_PARMNAME_P(ID_NODE) (IDENTIFIER_POINTER (ID_NODE)[0] == '_' \ *************** *** 1585,1593 **** /* in cp-method.c */ - extern tree wrapper_name, wrapper_pred_name, anti_wrapper_name; extern struct pending_inline *pending_inlines; extern char *print_fndecl_with_types (); extern tree hack_identifier (); ! extern tree hack_operator (), hack_wrapper (); /* 1 for -fall-virtual: make every member function (except --- 1563,1570 ---- /* in cp-method.c */ extern struct pending_inline *pending_inlines; extern char *print_fndecl_with_types (); extern tree hack_identifier (); ! extern tree hack_operator (); /* 1 for -fall-virtual: make every member function (except *************** *** 1607,1610 **** --- 1584,1593 ---- extern int flag_this_is_variable; + /* Controls whether enums and ints freely convert. + 1 means with complete freedom. + 0 means enums can convert to ints, but not vice-versa. */ + + extern int flag_int_enum_equivalence; + /* Nonzero means layout structures so that we can do garbage collection. */ *************** *** 1623,1627 **** extern int current_function_obstack_usage; ! enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG, WRAPPER_FLAG, WRAPPER_PRED_FLAG, ANTI_WRAPPER_FLAG }; extern tree default_conversion (), pushdecl (), pushdecl_top_level (); --- 1606,1610 ---- extern int current_function_obstack_usage; ! enum overload_flags { NO_SPECIAL = 0, DTOR_FLAG, OP_FLAG, TYPENAME_FLAG }; extern tree default_conversion (), pushdecl (), pushdecl_top_level (); *************** *** 1740,1744 **** extern tree get_vbase_types (); extern tree get_baselinks (); - extern tree get_wrapper (); extern tree make_binfo (), copy_binfo (); extern tree binfo_value (), virtual_member (); --- 1723,1726 ---- diff -rc2N gcc-2.3.1/cp-type2.c gcc-2.3.2/cp-type2.c *** gcc-2.3.1/cp-type2.c Tue Oct 13 22:02:43 1992 --- gcc-2.3.2/cp-type2.c Thu Nov 12 20:53:23 1992 *************** *** 21,28 **** ! /* This file is part of the C front end. ! It contains routines to build C expressions given their operands, ! including computing the types of the result, C-specific error checks, ! and some optimization. There are also routines to build RETURN_STMT nodes and CASE_STMT nodes, --- 21,28 ---- ! /* This file is part of the C++ front end. ! It contains routines to build C++ expressions given their operands, ! including computing the types of the result, C and C++ specific error ! checks, and some optimization. There are also routines to build RETURN_STMT nodes and CASE_STMT nodes, *************** *** 35,39 **** #include "cp-tree.h" #include "flags.h" - #include "assert.h" static tree process_init_constructor (); --- 35,38 ---- *************** *** 43,46 **** --- 42,48 ---- extern tree convert_for_initialization (); + extern int errorcount; + extern int sorrycount; + /* Print an error message stemming from an attempt to use BASETYPE as a base class for TYPE. */ *************** *** 287,305 **** one day, maybe it will be. (mrs) */ ! /* Last used: 124 */ void ! my_friendly_abort(i) int i; { ! extern int errorcount; ! extern int sorrycount; ! if (errorcount + sorrycount == 1) fatal ("please fix above error, and try recompiling."); ! if (errorcount > 0 || sorrycount > 0) fatal ("please fix above errors, and try recompiling."); else { ! error ("Internal compiler error %d.", i); ! fatal ("Please report this to `bug-g++@prep.ai.mit.edu'."); } } --- 289,319 ---- one day, maybe it will be. (mrs) */ ! /* First used: 0 (reserved), Last used: 345 */ ! void ! my_friendly_abort (i) int i; { ! if (i == 0) ! error ("Internal compiler error."); ! else if (errorcount + sorrycount == 1) fatal ("please fix above error, and try recompiling."); ! else if (errorcount > 0 || sorrycount > 0) fatal ("please fix above errors, and try recompiling."); else + error ("Internal compiler error %d.", i); + fatal ("Please report this to `bug-g++@prep.ai.mit.edu'."); + } + + void + my_friendly_assert (cond, where) + int cond, where; + { + if (cond == 0) { ! /* Don't say "please fix above errors", since it's quite ! possible that we've lost somewhere unrelated to an error. */ ! errorcount = sorrycount = 0; ! my_friendly_abort (where); } } *************** *** 473,477 **** { if (! TREE_CONSTANT (value) || ! TREE_STATIC (value)) ! pedwarn ("ANSI C forbids non-constant aggregate initializer expressions"); } } --- 487,491 ---- { if (! TREE_CONSTANT (value) || ! TREE_STATIC (value)) ! pedwarn ("ANSI C++ forbids non-constant aggregate initializer expressions"); } } *************** *** 539,543 **** if (pedantic && code == ARRAY_TYPE && TREE_CODE (init) != STRING_CST) ! pedwarn ("ANSI C forbids initializing array from array expression"); if (TREE_CODE (init) == CONST_DECL) init = DECL_INITIAL (init); --- 553,557 ---- if (pedantic && code == ARRAY_TYPE && TREE_CODE (init) != STRING_CST) ! pedwarn ("ANSI C++ forbids initializing array from array expression"); if (TREE_CODE (init) == CONST_DECL) init = DECL_INITIAL (init); *************** *** 552,558 **** { if (pedantic && code == ARRAY_TYPE) ! pedwarn ("ANSI C forbids initializing array from array expression"); if (pedantic && (code == RECORD_TYPE || code == UNION_TYPE)) ! pedwarn ("ANSI C forbids single nonscalar initializer with braces"); if (TREE_CODE (element) == CONST_DECL) element = DECL_INITIAL (element); --- 566,572 ---- { if (pedantic && code == ARRAY_TYPE) ! pedwarn ("ANSI C++ forbids initializing array from array expression"); if (pedantic && (code == RECORD_TYPE || code == UNION_TYPE)) ! pedwarn ("ANSI C++ forbids single nonscalar initializer with braces"); if (TREE_CODE (element) == CONST_DECL) element = DECL_INITIAL (element); *************** *** 637,641 **** if (pedantic && typ1 != char_type_node) ! pedwarn ("ANSI C forbids string initializer except for `char' elements"); TREE_TYPE (string) = type; if (TYPE_DOMAIN (type) != 0 --- 651,655 ---- if (pedantic && typ1 != char_type_node) ! pedwarn ("ANSI C++ forbids string initializer except for `char' elements"); TREE_TYPE (string) = type; if (TYPE_DOMAIN (type) != 0 *************** *** 781,785 **** next1 = digest_init (TYPE_MAIN_VARIANT (TREE_TYPE (type)), TREE_VALUE (tail), &tail1); ! assert (tail1 == 0 || TREE_CODE (tail1) == TREE_LIST); if (tail == tail1 && len < 0) { --- 795,800 ---- next1 = digest_init (TYPE_MAIN_VARIANT (TREE_TYPE (type)), TREE_VALUE (tail), &tail1); ! my_friendly_assert (tail1 == 0 ! || TREE_CODE (tail1) == TREE_LIST, 319); if (tail == tail1 && len < 0) { *************** *** 851,855 **** next1 = digest_init (TREE_TYPE (field), TREE_VALUE (tail), &tail1); ! assert (tail1 == 0 || TREE_CODE (tail1) == TREE_LIST); if (TREE_CODE (field) == VAR_DECL && ! global_bindings_p ()) --- 866,871 ---- next1 = digest_init (TREE_TYPE (field), TREE_VALUE (tail), &tail1); ! my_friendly_assert (tail1 == 0 ! || TREE_CODE (tail1) == TREE_LIST, 320); if (TREE_CODE (field) == VAR_DECL && ! global_bindings_p ()) *************** *** 1330,1334 **** name = DECL_NAME (name); ! assert (TREE_CODE (name) == IDENTIFIER_NODE); { --- 1346,1350 ---- name = DECL_NAME (name); ! my_friendly_assert (TREE_CODE (name) == IDENTIFIER_NODE, 321); { *************** *** 1364,1376 **** return error_mark_node; } if (current_function_decl) return build_cplus_new (type, expr_as_ctor, 1); ! /* Initializers for static variables and parameters have ! to handle doing the initialization and cleanup themselves. */ ! assert (TREE_CODE (expr_as_ctor) == CALL_EXPR); ! assert (TREE_CALLS_NEW (TREE_VALUE (TREE_OPERAND (expr_as_ctor, 1)))); ! TREE_VALUE (TREE_OPERAND (expr_as_ctor, 1)) = NULL_TREE; ! expr_as_ctor = build_indirect_ref (expr_as_ctor, 0); ! TREE_HAS_CONSTRUCTOR (expr_as_ctor) = 1; return expr_as_ctor; } --- 1380,1402 ---- return error_mark_node; } + if (current_function_decl) return build_cplus_new (type, expr_as_ctor, 1); ! ! { ! register tree parm = TREE_OPERAND (expr_as_ctor, 1); ! ! /* Initializers for static variables and parameters have ! to handle doing the initialization and cleanup themselves. */ ! my_friendly_assert (TREE_CODE (expr_as_ctor) == CALL_EXPR, 322); ! my_friendly_assert (TREE_CALLS_NEW (TREE_VALUE (parm)), 323); ! /* The default parameter could be a call to a constructor, though. */ ! if (TREE_CODE (TREE_VALUE (parm)) != SAVE_EXPR) ! { ! TREE_VALUE (parm) = NULL_TREE; ! expr_as_ctor = build_indirect_ref (expr_as_ctor, 0); ! TREE_HAS_CONSTRUCTOR (expr_as_ctor) = 1; ! } ! } return expr_as_ctor; } *************** *** 1420,1424 **** register HOST_WIDE_INT intval = TREE_INT_CST_LOW (value); ! assert (TREE_CODE (type) == ENUMERAL_TYPE); while (values && TREE_INT_CST_LOW (TREE_VALUE (values)) != intval) --- 1446,1450 ---- register HOST_WIDE_INT intval = TREE_INT_CST_LOW (value); ! my_friendly_assert (TREE_CODE (type) == ENUMERAL_TYPE, 324); while (values && TREE_INT_CST_LOW (TREE_VALUE (values)) != intval) diff -rc2N gcc-2.3.1/cp-typeck.c gcc-2.3.2/cp-typeck.c *** gcc-2.3.1/cp-typeck.c Thu Sep 24 21:50:31 1992 --- gcc-2.3.2/cp-typeck.c Mon Nov 23 20:48:44 1992 *************** *** 1,3 **** ! /* Build expressions with type checking for C compiler. Copyright (C) 1987, 1988, 1989, 1992 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) --- 1,3 ---- ! /* Build expressions with type checking for C++ compiler. Copyright (C) 1987, 1988, 1989, 1992 Free Software Foundation, Inc. Hacked by Michael Tiemann (tiemann@cygnus.com) *************** *** 20,27 **** ! /* This file is part of the C front end. ! It contains routines to build C expressions given their operands, ! including computing the types of the result, C-specific error checks, ! and some optimization. There are also routines to build RETURN_STMT nodes and CASE_STMT nodes, --- 20,27 ---- ! /* This file is part of the C++ front end. ! It contains routines to build C++ expressions given their operands, ! including computing the types of the result, C and C++ specific error ! checks, and some optimization. There are also routines to build RETURN_STMT nodes and CASE_STMT nodes, *************** *** 38,42 **** #include "cp-tree.h" #include "flags.h" - #include "assert.h" int mark_addressable (); --- 38,41 ---- *************** *** 47,51 **** int comp_target_types (); extern tree shorten_compare (); ! static void warn_for_assignment (); extern void binary_op_error (); static tree pointer_int_sum (); --- 46,50 ---- int comp_target_types (); extern tree shorten_compare (); ! void warn_for_assignment (); extern void binary_op_error (); static tree pointer_int_sum (); *************** *** 100,104 **** tree base, member = TREE_OPERAND (value, 1); tree basetype = TYPE_OFFSET_BASETYPE (type); ! assert (TREE_CODE (member) == FIELD_DECL); base = convert_pointer_to (basetype, current_class_decl); value = build (COMPONENT_REF, TREE_TYPE (member), --- 99,103 ---- tree base, member = TREE_OPERAND (value, 1); tree basetype = TYPE_OFFSET_BASETYPE (type); ! my_friendly_assert (TREE_CODE (member) == FIELD_DECL, 305); base = convert_pointer_to (basetype, current_class_decl); value = build (COMPONENT_REF, TREE_TYPE (member), *************** *** 181,185 **** for (; i < len; i++) ! newargs = tree_cons (0, 0, newargs); n = newargs; --- 180,184 ---- for (; i < len; i++) ! newargs = tree_cons (NULL_TREE, NULL_TREE, newargs); n = newargs; *************** *** 190,200 **** if (TREE_PURPOSE (p1) && !TREE_PURPOSE (p2)) { ! #if 0 ! if (! any_warning) ! { ! warning ("default argument given in prototype and not in declaration of function"); ! any_warning++; ! } ! #endif TREE_PURPOSE (n) = TREE_PURPOSE (p1); any_change = 1; --- 189,195 ---- if (TREE_PURPOSE (p1) && !TREE_PURPOSE (p2)) { ! /* We used to give a warning here that advised about a default ! argument being given in the prototype but not in the function's ! declaration. It's best not to bother. */ TREE_PURPOSE (n) = TREE_PURPOSE (p1); any_change = 1; *************** *** 258,261 **** --- 253,262 ---- if (t1 == t2) return t1; + /* If one type is nonsense, use the other. */ + if (t1 == error_mark_node) + return t2; + if (t2 == error_mark_node) + return t1; + /* Treat an enum type as the unsigned integer type of the same width. */ *************** *** 309,313 **** else return t2; - #if 1 case POINTER_TYPE: case REFERENCE_TYPE: --- 310,313 ---- *************** *** 314,317 **** --- 314,320 ---- /* For two pointers, do this recursively on the target type, and combine the qualifiers of the two types' targets. */ + /* This code was turned off; I don't know why. + But ANSI C++ specifies doing this with the qualifiers. + So I turned it on again. */ { tree target = common_type (TYPE_MAIN_VARIANT (TREE_TYPE (t1)), *************** *** 327,331 **** return build_reference_type (target); } ! #else case POINTER_TYPE: return build_pointer_type (common_type (TREE_TYPE (t1), TREE_TYPE (t2))); --- 330,334 ---- return build_reference_type (target); } ! #if 0 case POINTER_TYPE: return build_pointer_type (common_type (TREE_TYPE (t1), TREE_TYPE (t2))); *************** *** 379,384 **** } - /* If both args specify argument types, we must merge the two - lists, argument by argument. */ rval = build_function_type (valtype, commonparms (p1, p2)); return build_exception_variant (NULL_TREE, rval, raises); --- 382,385 ---- *************** *** 387,391 **** case RECORD_TYPE: case UNION_TYPE: ! assert (TYPE_MAIN_VARIANT (t1) == t1 && TYPE_MAIN_VARIANT (t2) == t2); if (binfo_or_else (t1, t2)) --- 388,393 ---- case RECORD_TYPE: case UNION_TYPE: ! my_friendly_assert (TYPE_MAIN_VARIANT (t1) == t1 ! && TYPE_MAIN_VARIANT (t2) == t2, 306); if (binfo_or_else (t1, t2)) *************** *** 451,454 **** --- 453,457 ---- tree d2 = TYPE_DOMAIN (t2); + /* Target types must match incl. qualifiers. */ if (!(TREE_TYPE (t1) == TREE_TYPE (t2) || (*cmp) (TREE_TYPE (t1), TREE_TYPE (t2), strict))) *************** *** 474,478 **** /* Return 1 if TYPE1 and TYPE2 are compatible types for assignment ! or various other operations. This is what ANSI C speaks of as "being the same". --- 477,481 ---- /* Return 1 if TYPE1 and TYPE2 are compatible types for assignment ! or various other operations. This is what ANSI C++ speaks of as "being the same". *************** *** 504,508 **** return 1; /* This should never happen. */ ! assert (t1 != error_mark_node); /* We don't want this to happen. */ --- 507,511 ---- return 1; /* This should never happen. */ ! my_friendly_assert (t1 != error_mark_node, 307); /* We don't want this to happen. */ *************** *** 509,513 **** if (t2 == error_mark_node) { ! warning ("t2 == error_mark_node in `comptypes'"); return 0; } --- 512,516 ---- if (t2 == error_mark_node) { ! warning ("Internal error: t2 == error_mark_node in `comptypes'"); return 0; } *************** *** 578,582 **** int rval; look_hard: ! rval = t1 == t2 || DERIVED_FROM_P (t1, t2); if (rval) --- 581,585 ---- int rval; look_hard: ! rval = t1 == t2 || UNIQUELY_DERIVED_FROM_P (t1, t2); if (rval) *************** *** 583,587 **** return 1; if (strict < 0) ! return DERIVED_FROM_P (t2, t1); } return 0; --- 586,590 ---- return 1; if (strict < 0) ! return UNIQUELY_DERIVED_FROM_P (t2, t1); } return 0; *************** *** 686,692 **** /* If one is a baseclass of another, that's good enough. */ ! if (DERIVED_FROM_P (tt1, tt2)) return tt1; ! if (DERIVED_FROM_P (tt2, tt1)) return tt2; --- 689,695 ---- /* If one is a baseclass of another, that's good enough. */ ! if (UNIQUELY_DERIVED_FROM_P (tt1, tt2)) return tt1; ! if (UNIQUELY_DERIVED_FROM_P (tt2, tt1)) return tt2; *************** *** 773,777 **** if (strict == 0) return t1 && TREE_PURPOSE (t1); - return ((t1 && TREE_PURPOSE (t1)) || TREE_PURPOSE (t2)); } if (! comptypes (TREE_VALUE (t2), TREE_VALUE (t1), strict)) --- 776,779 ---- *************** *** 882,886 **** we use parameter lists, that they are ok as well. */ if (TREE_CODE (p1) == FUNCTION_TYPE || TREE_CODE (p1) == METHOD_TYPE) ! switch (comp_target_parms (TYPE_ARG_TYPES (p1), TYPE_ARG_TYPES (p2), strict)) { case 0: --- 884,890 ---- we use parameter lists, that they are ok as well. */ if (TREE_CODE (p1) == FUNCTION_TYPE || TREE_CODE (p1) == METHOD_TYPE) ! switch (comp_target_parms (TYPE_ARG_TYPES (p1), ! TYPE_ARG_TYPES (p2), ! strict)) { case 0: *************** *** 940,944 **** { tree type1 = TYPE_MAIN_VARIANT (type); - if (type1 == signed_char_type_node || type1 == char_type_node) return unsigned_char_type_node; --- 944,947 ---- *************** *** 961,965 **** { tree type1 = TYPE_MAIN_VARIANT (type); - if (type1 == unsigned_char_type_node || type1 == char_type_node) return signed_char_type_node; --- 964,967 ---- *************** *** 1008,1012 **** { if (pedantic || warn_pointer_arith) ! pedwarn ("ANSI C forbids taking the sizeof a function type"); return size_int (1); } --- 1010,1014 ---- { if (pedantic || warn_pointer_arith) ! pedwarn ("ANSI C++ forbids taking the sizeof a function type"); return size_int (1); } *************** *** 1014,1018 **** { if (pedantic || warn_pointer_arith) ! pedwarn ("ANSI C forbids taking the sizeof a method type"); return size_int (1); } --- 1016,1020 ---- { if (pedantic || warn_pointer_arith) ! pedwarn ("ANSI C++ forbids taking the sizeof a method type"); return size_int (1); } *************** *** 1020,1030 **** { if (pedantic || warn_pointer_arith) ! pedwarn ("ANSI C forbids taking the sizeof a void type"); return size_int (1); } - if (code == ERROR_MARK) return size_int (1); - /* C++: this is really correct! */ if (code == REFERENCE_TYPE) --- 1022,1030 ---- { if (pedantic || warn_pointer_arith) ! pedwarn ("ANSI C++ forbids taking the sizeof a void type"); return size_int (1); } if (code == ERROR_MARK) return size_int (1); /* C++: this is really correct! */ if (code == REFERENCE_TYPE) *************** *** 1107,1113 **** if (code == OFFSET_TYPE) { - #if 0 - warning ("conversion from member type"); - #endif if (TREE_CODE (exp) == OFFSET_REF) return default_conversion (resolve_offset_ref (exp)); --- 1107,1110 ---- *************** *** 1176,1180 **** if (TREE_CODE (exp) == OFFSET_REF) { ! assert (TREE_CODE (TREE_OPERAND (exp, 1)) == FUNCTION_DECL); return build_unary_op (ADDR_EXPR, TREE_OPERAND (exp, 1), 0); } --- 1173,1178 ---- if (TREE_CODE (exp) == OFFSET_REF) { ! my_friendly_assert (TREE_CODE (TREE_OPERAND (exp, 1)) == FUNCTION_DECL, ! 308); return build_unary_op (ADDR_EXPR, TREE_OPERAND (exp, 1), 0); } *************** *** 1356,1361 **** if (TREE_CODE (component) == TREE_LIST) { ! assert (!(TREE_CHAIN (component) == NULL_TREE ! && DECL_CHAIN (TREE_VALUE (component)) == NULL_TREE)); return build (COMPONENT_REF, TREE_TYPE (component), datum, component); } --- 1354,1359 ---- if (TREE_CODE (component) == TREE_LIST) { ! my_friendly_assert (!(TREE_CHAIN (component) == NULL_TREE ! && DECL_CHAIN (TREE_VALUE (component)) == NULL_TREE), 309); return build (COMPONENT_REF, TREE_TYPE (component), datum, component); } *************** *** 1436,1440 **** addr = convert_pointer_to (DECL_CONTEXT (fndecl), addr); datum = build_indirect_ref (addr); ! assert (datum != error_mark_node); fndecl = build_vfn_ref (&addr, datum, DECL_VINDEX (fndecl)); } --- 1434,1438 ---- addr = convert_pointer_to (DECL_CONTEXT (fndecl), addr); datum = build_indirect_ref (addr); ! my_friendly_assert (datum != error_mark_node, 310); fndecl = build_vfn_ref (&addr, datum, DECL_VINDEX (fndecl)); } *************** *** 1490,1494 **** addr = convert_pointer_to (DECL_FIELD_CONTEXT (field), addr); datum = build_indirect_ref (addr); ! assert (datum != error_mark_node); } ref = build (COMPONENT_REF, TREE_TYPE (field), break_out_cleanups (datum), field); --- 1488,1492 ---- addr = convert_pointer_to (DECL_FIELD_CONTEXT (field), addr); datum = build_indirect_ref (addr); ! my_friendly_assert (datum != error_mark_node, 311); } ref = build (COMPONENT_REF, TREE_TYPE (field), break_out_cleanups (datum), field); *************** *** 1549,1553 **** } else if (pointer != error_mark_node) ! error ("invalid type argument of `%s'", errorstring); return error_mark_node; } --- 1547,1556 ---- } else if (pointer != error_mark_node) ! { ! if (errorstring) ! error ("invalid type argument of `%s'", errorstring); ! else ! error ("invalid type argument"); ! } return error_mark_node; } *************** *** 1583,1587 **** { tree itype; - tree rval; if (index == 0) --- 1586,1589 ---- *************** *** 1591,1595 **** --- 1593,1614 ---- } + if (TREE_TYPE (array) == error_mark_node + || TREE_TYPE (index) == error_mark_node) + return error_mark_node; + itype = TREE_TYPE (index); + if (IS_AGGR_TYPE (itype)) + { + if (TYPE_HAS_INT_CONVERSION (itype)) + index = build_type_conversion (CONVERT_EXPR, + integer_type_node, index, 1); + else + { + error_with_aggr_type (itype, + "type `%s' requires integer conversion for array indexing"); + return error_mark_node; + } + } + if (TREE_CODE (itype) == REFERENCE_TYPE) { *************** *** 1598,1616 **** } - if (IS_AGGR_TYPE (itype)) - if (TYPE_HAS_INT_CONVERSION (itype)) - index = build_type_conversion (CONVERT_EXPR, integer_type_node, index, 1); - else - { - error_with_aggr_type (itype, "type `%s' requires integer conversion for array indexing"); - return error_mark_node; - } - if (TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE && TREE_CODE (array) != INDIRECT_REF) { index = default_conversion (index); ! if (index != error_mark_node ! && TREE_CODE (TREE_TYPE (index)) != INTEGER_TYPE) { error ("array subscript is not an integer"); --- 1617,1639 ---- } if (TREE_CODE (TREE_TYPE (array)) == ARRAY_TYPE && TREE_CODE (array) != INDIRECT_REF) { + tree rval, type; + + /* Subscripting with type char is likely to lose + on a machine where chars are signed. + So warn on any machine, but optionally. + Don't warn for unsigned char since that type is safe. + Don't warn for signed char because anyone who uses that + must have done so deliberately. */ + if (warn_char_subscripts + && TYPE_MAIN_VARIANT (TREE_TYPE (index)) == char_type_node) + warning ("array subscript has type `char'"); + + /* Apply default promotions *after* noticing character types. */ index = default_conversion (index); ! ! if (TREE_CODE (TREE_TYPE (index)) != INTEGER_TYPE) { error ("array subscript is not an integer"); *************** *** 1630,1635 **** } if (pedantic && !lvalue_p (array)) ! pedwarn ("ANSI C forbids subscripting non-lvalue array"); if (pedantic) --- 1653,1661 ---- } + /* Note in C++ we don't bother warning about subscripting a + `register' array, since it's legal in C++ to take the address + of something with that storage specification. */ if (pedantic && !lvalue_p (array)) ! pedwarn ("ANSI C++ forbids subscripting non-lvalue array"); if (pedantic) *************** *** 1639,1650 **** foo = TREE_OPERAND (foo, 0); if (TREE_CODE (foo) == VAR_DECL && DECL_REGISTER (foo)) ! pedwarn ("ANSI C forbids subscripting non-lvalue array"); } ! rval = build (ARRAY_REF, TREE_TYPE (TREE_TYPE (array)), array, index); ! /* Array ref is const/volatile if the array elements are. */ ! TREE_READONLY (rval) |= TYPE_READONLY (TREE_TYPE (TREE_TYPE (array))); ! TREE_SIDE_EFFECTS (rval) |= TREE_SIDE_EFFECTS (TREE_TYPE (TREE_TYPE (array))); ! TREE_THIS_VOLATILE (rval) |= TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (array))); return require_complete_type (fold (rval)); } --- 1665,1688 ---- foo = TREE_OPERAND (foo, 0); if (TREE_CODE (foo) == VAR_DECL && DECL_REGISTER (foo)) ! pedwarn ("ANSI C++ forbids subscripting non-lvalue array"); } ! type = TYPE_MAIN_VARIANT (TREE_TYPE (TREE_TYPE (array))); ! rval = build (ARRAY_REF, type, array, index); ! /* Array ref is const/volatile if the array elements are ! or if the array is.. */ ! TREE_READONLY (rval) ! |= (TYPE_READONLY (TREE_TYPE (TREE_TYPE (array))) ! | TREE_READONLY (array)); ! TREE_SIDE_EFFECTS (rval) ! |= (TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (array))) ! | TREE_SIDE_EFFECTS (array)); ! TREE_THIS_VOLATILE (rval) ! |= (TYPE_VOLATILE (TREE_TYPE (TREE_TYPE (array))) ! /* This was added by rms on 16 Nov 91. ! It fixes vol struct foo *a; a->elts[1] ! in an inline function. ! Hope it doesn't break something else. */ ! | TREE_THIS_VOLATILE (array)); return require_complete_type (fold (rval)); } *************** *** 1654,1661 **** tree ind = default_conversion (index); ! if ((TREE_CODE (TREE_TYPE (ar)) == POINTER_TYPE ! && TREE_CODE (TREE_TYPE (ind)) != INTEGER_TYPE) ! || (TREE_CODE (TREE_TYPE (ind)) == POINTER_TYPE ! && TREE_CODE (TREE_TYPE (ar)) != INTEGER_TYPE)) { error ("array subscript is not an integer"); --- 1692,1712 ---- tree ind = default_conversion (index); ! /* Put the integer in IND to simplify error checking. */ ! if (TREE_CODE (TREE_TYPE (ar)) == INTEGER_TYPE) ! { ! tree temp = ar; ! ar = ind; ! ind = temp; ! } ! ! if (ar == error_mark_node) ! return ar; ! ! if (TREE_CODE (TREE_TYPE (ar)) != POINTER_TYPE) ! { ! error ("subscripted value is neither array nor pointer"); ! return error_mark_node; ! } ! if (TREE_CODE (TREE_TYPE (ind)) != INTEGER_TYPE) { error ("array subscript is not an integer"); *************** *** 1724,1728 **** function = TREE_PURPOSE (function); #else ! assert (TREE_CODE (TREE_VALUE (function)) == FUNCTION_DECL); function = TREE_PURPOSE (function); #endif --- 1775,1779 ---- function = TREE_PURPOSE (function); #else ! my_friendly_assert (TREE_CODE (TREE_VALUE (function)) == FUNCTION_DECL, 312); function = TREE_PURPOSE (function); #endif *************** *** 1754,1761 **** } /* Yow: call from a static member function. */ ! decl = build1 (NOP_EXPR, TYPE_POINTER_TO (current_class_type), error_mark_node); } ! return build_method_call (decl, function, params, NULL_TREE, LOOKUP_NORMAL); } else if (TREE_CODE (function) == COMPONENT_REF --- 1805,1815 ---- } /* Yow: call from a static member function. */ ! decl = build1 (NOP_EXPR, ! TYPE_POINTER_TO (current_class_type), ! error_mark_node); } ! return build_method_call (decl, function, params, ! NULL_TREE, LOOKUP_NORMAL); } else if (TREE_CODE (function) == COMPONENT_REF *************** *** 1763,1767 **** { function = TREE_PURPOSE (TREE_OPERAND (function, 1)); ! return build_method_call (decl, function, params, NULL_TREE, LOOKUP_NORMAL); } else if (TREE_CODE (function) == TREE_LIST) --- 1817,1822 ---- { function = TREE_PURPOSE (TREE_OPERAND (function, 1)); ! return build_method_call (decl, function, params, ! NULL_TREE, LOOKUP_NORMAL); } else if (TREE_CODE (function) == TREE_LIST) *************** *** 1770,1774 **** { if (TREE_CODE (TREE_VALUE (function)) == TEMPLATE_DECL) ! return build_overload_call_maybe (TREE_PURPOSE (function), params, 1, 0); else return build_overload_call (TREE_PURPOSE (function), params, 1, 0); --- 1825,1830 ---- { if (TREE_CODE (TREE_VALUE (function)) == TEMPLATE_DECL) ! return build_overload_call_maybe (TREE_PURPOSE (function), ! params, 1, 0); else return build_overload_call (TREE_PURPOSE (function), params, 1, 0); *************** *** 1781,1785 **** } else if (TREE_CODE (TREE_VALUE (function)) == TEMPLATE_DECL) ! return build_overload_call_maybe (TREE_PURPOSE (function), params, 1, 0); else function = TREE_VALUE (function); --- 1837,1842 ---- } else if (TREE_CODE (TREE_VALUE (function)) == TEMPLATE_DECL) ! return build_overload_call_maybe (TREE_PURPOSE (function), ! params, 1, 0); else function = TREE_VALUE (function); *************** *** 1808,1812 **** decl_addr = build_unary_op (ADDR_EXPR, decl, 0); ! function = get_member_function (&decl_addr, decl, TREE_OPERAND (function, 1)); params = tree_cons (NULL_TREE, decl_addr, params); return build_function_call (function, params); --- 1865,1870 ---- decl_addr = build_unary_op (ADDR_EXPR, decl, 0); ! function = get_member_function (&decl_addr, decl, ! TREE_OPERAND (function, 1)); params = tree_cons (NULL_TREE, decl_addr, params); return build_function_call (function, params); *************** *** 1814,1825 **** type = TREE_TYPE (function); ! if (TREE_CODE (type) == REFERENCE_TYPE) ! type = TREE_TYPE (type); ! if (TYPE_LANG_SPECIFIC (type) && TYPE_OVERLOADS_CALL_EXPR (type)) ! return build_opfncall (CALL_EXPR, LOOKUP_NORMAL, function, params); if (is_method) { tree ctypeptr; /* Explicitly named method? */ --- 1872,1887 ---- type = TREE_TYPE (function); ! if (type != error_mark_node) ! { ! if (TREE_CODE (type) == REFERENCE_TYPE) ! type = TREE_TYPE (type); ! if (TYPE_LANG_SPECIFIC (type) && TYPE_OVERLOADS_CALL_EXPR (type)) ! return build_opfncall (CALL_EXPR, LOOKUP_NORMAL, function, params); ! } if (is_method) { + tree fntype = TREE_TYPE (function); tree ctypeptr; /* Explicitly named method? */ *************** *** 1826,1834 **** if (TREE_CODE (function) == FUNCTION_DECL) ctypeptr = TYPE_POINTER_TO (DECL_CLASS_CONTEXT (function)); ! /* Expression with ptr-to-method type? */ ! else if (TREE_CODE_CLASS (TREE_CODE (function)) == 'e' ! && TREE_CODE (TREE_TYPE (function)) == POINTER_TYPE) { ! tree rec = TYPE_METHOD_BASETYPE (TREE_TYPE (TREE_TYPE (function))); ctypeptr = TYPE_POINTER_TO (rec); } --- 1888,1901 ---- if (TREE_CODE (function) == FUNCTION_DECL) ctypeptr = TYPE_POINTER_TO (DECL_CLASS_CONTEXT (function)); ! /* Expression with ptr-to-method type? It could either be a plain ! usage, or it might be a case where the ptr-to-method is being ! passed in as an argument. */ ! else if (TREE_CODE (fntype) == POINTER_TYPE ! && (TREE_CODE_CLASS (TREE_CODE (function)) == 'e' ! || ((TREE_CODE_CLASS (TREE_CODE (function)) == 'd' ! || TREE_CODE_CLASS (TREE_CODE (function)) == 'r') ! && TREE_CODE (TREE_TYPE (fntype)) == METHOD_TYPE))) { ! tree rec = TYPE_METHOD_BASETYPE (TREE_TYPE (fntype)); ctypeptr = TYPE_POINTER_TO (rec); } *************** *** 1956,1985 **** } value_type = TREE_TYPE (fntype) ? TREE_TYPE (fntype) : void_type_node; - - if (is_method) - { - tree parm = TREE_VALUE (coerced_params); - tree parmtype = TREE_TYPE (parm); - if (parmtype == error_mark_node) - return error_mark_node; - - parmtype = TREE_TYPE (parmtype); - if (TYPE_NEEDS_WRAPPER (parmtype)) - { - if (fndecl == NULL_TREE - || ! WRAPPER_NAME_P (DECL_ASSEMBLER_NAME (fndecl))) - { - params = tree_cons (NULL_TREE, function, TREE_CHAIN (coerced_params)); - - return build_method_call (TREE_VALUE (coerced_params), - wrapper_name, params, - NULL_TREE, LOOKUP_NORMAL); - } - } - } { register tree result = ! build (CALL_EXPR, value_type, function, coerced_params, NULL_TREE); TREE_SIDE_EFFECTS (result) = 1; --- 2023,2032 ---- } + /* C++ */ value_type = TREE_TYPE (fntype) ? TREE_TYPE (fntype) : void_type_node; { register tree result = ! build (CALL_EXPR, value_type, ! function, coerced_params, NULL_TREE); TREE_SIDE_EFFECTS (result) = 1; *************** *** 2117,2145 **** { #if 0 - /* well, I am not sure what it means, but I bet it is wrong. - It clears up p0000315. */ - /* ??? What does this mean? - - Convert FUNCTION_DECLs for virtual functions to proper - representation. */ - tree basetype = NULL_TREE; - tree ttype = TREE_TYPE (val); - - if (TREE_CODE (ttype) == METHOD_TYPE) - basetype = TYPE_METHOD_BASETYPE (ttype); - else if (TREE_CODE (ttype) == OFFSET_TYPE) - basetype = TYPE_OFFSET_BASETYPE (ttype); - - /* If BASETYPE is set here, default_conversion will do the - actual conversion for us. */ - if (basetype && TREE_CODE (val) != OFFSET_REF) - { - val = build (OFFSET_REF, ttype, - build1 (NOP_EXPR, basetype, error_mark_node), val); - type = build_pointer_type (ttype); - } - #endif - - #if 0 /* This code forces the assumption that if we have a ptr-to-func type in an arglist, that every routine that wants to check --- 2164,2167 ---- *************** *** 2203,2207 **** #endif } ! result = tree_cons (0, parmval, result); } else --- 2225,2229 ---- #endif } ! result = tree_cons (NULL_TREE, parmval, result); } else *************** *** 2695,2699 **** { if (pedantic && TREE_CODE (tt1) == FUNCTION_TYPE) ! pedwarn ("ANSI C forbids comparison of `void *' with function pointer"); } else if (tt1 == void_type_node) --- 2717,2721 ---- { if (pedantic && TREE_CODE (tt1) == FUNCTION_TYPE) ! pedwarn ("ANSI C++ forbids comparison of `void *' with function pointer"); } else if (tt1 == void_type_node) *************** *** 2700,2704 **** { if (pedantic && TREE_CODE (tt0) == FUNCTION_TYPE) ! pedwarn ("ANSI C forbids comparison of `void *' with function pointer"); } else --- 2722,2726 ---- { if (pedantic && TREE_CODE (tt0) == FUNCTION_TYPE) ! pedwarn ("ANSI C++ forbids comparison of `void *' with function pointer"); } else *************** *** 2713,2717 **** else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE) { ! error ("ANSI C forbids comparison between pointer and integer"); op1 = convert (TREE_TYPE (op0), op1); } --- 2735,2739 ---- else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE) { ! error ("ANSI C++ forbids comparison between pointer and integer"); op1 = convert (TREE_TYPE (op0), op1); } *************** *** 2718,2722 **** else if (code0 == INTEGER_TYPE && code1 == POINTER_TYPE) { ! error ("ANSI C forbids comparison between pointer and integer"); op0 = convert (TREE_TYPE (op1), op0); } --- 2740,2744 ---- else if (code0 == INTEGER_TYPE && code1 == POINTER_TYPE) { ! error ("ANSI C++ forbids comparison between pointer and integer"); op0 = convert (TREE_TYPE (op1), op0); } *************** *** 2738,2742 **** else if (pedantic && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE) ! pedwarn ("ANSI C forbids ordered comparisons of pointers to functions"); result_type = common_type (type0, type1); } --- 2760,2764 ---- else if (pedantic && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE) ! pedwarn ("ANSI C++ forbids ordered comparisons of pointers to functions"); result_type = common_type (type0, type1); } *************** *** 2773,2777 **** else if (pedantic && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE) ! pedwarn ("ANSI C forbids ordered comparisons of pointers to functions"); result_type = integer_type_node; } --- 2795,2799 ---- else if (pedantic && TREE_CODE (TREE_TYPE (type0)) == FUNCTION_TYPE) ! pedwarn ("ANSI C++ forbids ordered comparisons of pointers to functions"); result_type = integer_type_node; } *************** *** 2790,2794 **** op0 = null_pointer_node; if (pedantic) ! pedwarn ("ANSI C forbids ordered comparison of pointer with integer zero"); } else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE) --- 2812,2816 ---- op0 = null_pointer_node; if (pedantic) ! pedwarn ("ANSI C++ forbids ordered comparison of pointer with integer zero"); } else if (code0 == POINTER_TYPE && code1 == INTEGER_TYPE) *************** *** 2796,2800 **** result_type = integer_type_node; if (pedantic) ! pedwarn ("ANSI C forbids comparison between pointer and integer"); else if (! flag_traditional) warning ("comparison between pointer and integer"); --- 2818,2822 ---- result_type = integer_type_node; if (pedantic) ! pedwarn ("ANSI C++ forbids comparison between pointer and integer"); else if (! flag_traditional) warning ("comparison between pointer and integer"); *************** *** 2805,2809 **** result_type = integer_type_node; if (pedantic) ! pedwarn ("ANSI C forbids comparison between pointer and integer"); else if (! flag_traditional) warning ("comparison between pointer and integer"); --- 2827,2831 ---- result_type = integer_type_node; if (pedantic) ! pedwarn ("ANSI C++ forbids comparison between pointer and integer"); else if (! flag_traditional) warning ("comparison between pointer and integer"); *************** *** 3078,3082 **** { if (pedantic || warn_pointer_arith) ! pedwarn ("ANSI C forbids using pointer of type `void *' in arithmetic"); size_exp = integer_one_node; } --- 3100,3104 ---- { if (pedantic || warn_pointer_arith) ! pedwarn ("ANSI C++ forbids using pointer of type `void *' in arithmetic"); size_exp = integer_one_node; } *************** *** 3084,3088 **** { if (pedantic || warn_pointer_arith) ! pedwarn ("ANSI C forbids using pointer to a function in arithmetic"); size_exp = integer_one_node; } --- 3106,3110 ---- { if (pedantic || warn_pointer_arith) ! pedwarn ("ANSI C++ forbids using pointer to a function in arithmetic"); size_exp = integer_one_node; } *************** *** 3154,3160 **** { if (TREE_CODE (target_type) == VOID_TYPE) ! pedwarn ("ANSI C forbids using pointer of type `void *' in subtraction"); if (TREE_CODE (target_type) == FUNCTION_TYPE) ! pedwarn ("ANSI C forbids using pointer to a function in subtraction"); if (TREE_CODE (target_type) == METHOD_TYPE) pedwarn ("ANSI C++ forbids using pointer to a method in subtraction"); --- 3176,3182 ---- { if (TREE_CODE (target_type) == VOID_TYPE) ! pedwarn ("ANSI C++ forbids using pointer of type `void *' in subtraction"); if (TREE_CODE (target_type) == FUNCTION_TYPE) ! pedwarn ("ANSI C++ forbids using pointer to a function in subtraction"); if (TREE_CODE (target_type) == METHOD_TYPE) pedwarn ("ANSI C++ forbids using pointer to a method in subtraction"); *************** *** 3441,3445 **** || TREE_CODE (argtype) == VOID_TYPE || TREE_CODE (argtype) == OFFSET_TYPE)) ! pedwarn ("ANSI C forbids %sing this type of pointer value", ((code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) --- 3463,3467 ---- || TREE_CODE (argtype) == VOID_TYPE || TREE_CODE (argtype) == OFFSET_TYPE)) ! pedwarn ("ANSI C++ forbids %sing this type of pointer value", ((code == PREINCREMENT_EXPR || code == POSTINCREMENT_EXPR) *************** *** 3613,3617 **** case FIX_CEIL_EXPR: if (pedantic) ! pedwarn ("ANSI C forbids taking the address of a cast expression"); return convert (build_pointer_type (TREE_TYPE (arg)), build_unary_op (ADDR_EXPR, TREE_OPERAND (arg, 0), 0)); --- 3635,3639 ---- case FIX_CEIL_EXPR: if (pedantic) ! pedwarn ("ANSI C++ forbids taking the address of a cast expression"); return convert (build_pointer_type (TREE_TYPE (arg)), build_unary_op (ADDR_EXPR, TREE_OPERAND (arg, 0), 0)); *************** *** 3762,3766 **** tree offset; ! assert (TREE_CODE (arg) != SCOPE_REF); if (TREE_CODE (arg) != OFFSET_REF) --- 3784,3788 ---- tree offset; ! my_friendly_assert (TREE_CODE (arg) != SCOPE_REF, 313); if (TREE_CODE (arg) != OFFSET_REF) *************** *** 3779,3784 **** || (flag_all_virtual == 1 && ((context = decl_type_context (t)) ! && (TYPE_OVERLOADS_METHOD_CALL_EXPR (context) ! || TYPE_NEEDS_WRAPPER (context)) && ! DECL_CONSTRUCTOR_P (t)))) { --- 3801,3805 ---- || (flag_all_virtual == 1 && ((context = decl_type_context (t)) ! && TYPE_OVERLOADS_METHOD_CALL_EXPR (context) && ! DECL_CONSTRUCTOR_P (t)))) { *************** *** 3887,3891 **** { if (pedantic) ! pedwarn ("ANSI C forbids use of %s expressions as lvalues", code == COND_EXPR ? "conditional" : code == COMPOUND_EXPR ? "compound" : "cast"); --- 3908,3912 ---- { if (pedantic) ! pedwarn ("ANSI C++ forbids use of %s expressions as lvalues", code == COND_EXPR ? "conditional" : code == COMPOUND_EXPR ? "compound" : "cast"); *************** *** 3894,3901 **** /* Mark EXP saying that we need to be able to take the address of it; it should not be allocated in a register. - Return 1 if taking address of this expression is ok. - Return 0 otherwise. - C++: we do not allow `current_class_decl' to be addressable. */ --- 3915,3920 ---- /* Mark EXP saying that we need to be able to take the address of it; it should not be allocated in a register. + Value is 1 if successful. C++: we do not allow `current_class_decl' to be addressable. */ *************** *** 3948,3952 **** /* Caller should not be trying to mark initialized constant fields addressable. */ ! assert (DECL_LANG_SPECIFIC (x) == 0 || DECL_IN_AGGR_P (x) == 0 || TREE_STATIC (x) || DECL_EXTERNAL (x)); case CONST_DECL: --- 3967,3974 ---- /* Caller should not be trying to mark initialized constant fields addressable. */ ! my_friendly_assert (DECL_LANG_SPECIFIC (x) == 0 ! || DECL_IN_AGGR_P (x) == 0 ! || TREE_STATIC (x) ! || DECL_EXTERNAL (x), 314); case CONST_DECL: *************** *** 4029,4033 **** { if (pedantic) ! pedwarn ("ANSI C forbids omitting the middle term of a ?: expression"); ifexp = op1 = save_expr (ifexp); } --- 4051,4055 ---- { if (pedantic) ! pedwarn ("ANSI C++ forbids omitting the middle term of a ?: expression"); ifexp = op1 = save_expr (ifexp); } *************** *** 4156,4160 **** { if (pedantic && (code1 != VOID_TYPE || code2 != VOID_TYPE)) ! pedwarn ("ANSI C forbids conditional expr with only one void side"); result_type = void_type_node; } --- 4178,4182 ---- { if (pedantic && (code1 != VOID_TYPE || code2 != VOID_TYPE)) ! pedwarn ("ANSI C++ forbids conditional expr with only one void side"); result_type = void_type_node; } *************** *** 4170,4174 **** { if (pedantic && TREE_CODE (type2) == FUNCTION_TYPE) ! pedwarn ("ANSI C forbids conditional expr between `void *' and function pointer"); result_type = qualify_type (type1, type2); } --- 4192,4196 ---- { if (pedantic && TREE_CODE (type2) == FUNCTION_TYPE) ! pedwarn ("ANSI C++ forbids conditional expr between `void *' and function pointer"); result_type = qualify_type (type1, type2); } *************** *** 4176,4180 **** { if (pedantic && TREE_CODE (type1) == FUNCTION_TYPE) ! pedwarn ("ANSI C forbids conditional expr between `void *' and function pointer"); result_type = qualify_type (type2, type1); } --- 4198,4202 ---- { if (pedantic && TREE_CODE (type1) == FUNCTION_TYPE) ! pedwarn ("ANSI C++ forbids conditional expr between `void *' and function pointer"); result_type = qualify_type (type2, type1); } *************** *** 4208,4212 **** op2 = null_pointer_node; if (pedantic && TREE_CODE (type1) == FUNCTION_TYPE) ! pedwarn ("ANSI C forbids conditional expr between 0 and function pointer"); } result_type = type1; --- 4230,4234 ---- op2 = null_pointer_node; if (pedantic && TREE_CODE (type1) == FUNCTION_TYPE) ! pedwarn ("ANSI C++ forbids conditional expr between 0 and function pointer"); } result_type = type1; *************** *** 4220,4224 **** op1 = null_pointer_node; if (pedantic && TREE_CODE (type2) == FUNCTION_TYPE) ! pedwarn ("ANSI C forbids conditional expr between 0 and function pointer"); } result_type = type2; --- 4242,4246 ---- op1 = null_pointer_node; if (pedantic && TREE_CODE (type2) == FUNCTION_TYPE) ! pedwarn ("ANSI C++ forbids conditional expr between 0 and function pointer"); } result_type = type2; *************** *** 4276,4279 **** --- 4298,4302 ---- #if 0 + /* XXX delete me, I've been here for years. */ if (IS_AGGR_TYPE_CODE (code1)) { *************** *** 4295,4299 **** I fear that the entire handling of BLKmode conditional exprs needs to be redone. */ ! assert (TREE_CONSTANT (DECL_SIZE (tempvar))); DECL_RTL (tempvar) = assign_stack_local (DECL_MODE (tempvar), --- 4318,4322 ---- I fear that the entire handling of BLKmode conditional exprs needs to be redone. */ ! my_friendly_assert (TREE_CONSTANT (DECL_SIZE (tempvar)), 315); DECL_RTL (tempvar) = assign_stack_local (DECL_MODE (tempvar), *************** *** 4405,4409 **** { if (pedantic) ! pedwarn ("ANSI C forbids casting to an array type"); type = build_pointer_type (TREE_TYPE (type)); } --- 4428,4432 ---- { if (pedantic) ! pedwarn ("ANSI C++ forbids casting to an array type"); type = build_pointer_type (TREE_TYPE (type)); } *************** *** 4410,4414 **** else { ! error ("ANSI C forbids casting to an array type"); return error_mark_node; } --- 4433,4437 ---- else { ! error ("ANSI C++ forbids casting to an array type"); return error_mark_node; } *************** *** 4431,4434 **** --- 4454,4458 ---- && TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (value))) { + /* For C++, we must copy the constness of TYPE into VALUE. */ if (TREE_READONLY (value) != TYPE_READONLY (type)) { *************** *** 4440,4444 **** if (TREE_CODE (type) == RECORD_TYPE || TREE_CODE (type) == UNION_TYPE) ! pedwarn ("ANSI C forbids casting nonscalar to the same type"); } return value; --- 4464,4468 ---- if (TREE_CODE (type) == RECORD_TYPE || TREE_CODE (type) == UNION_TYPE) ! pedwarn ("ANSI C++ forbids casting nonscalar to the same type"); } return value; *************** *** 4464,4482 **** return error_mark_node; } - #if 0 - /* The below case probably does not happen any more. */ - else if (TREE_CODE (type) == REFERENCE_TYPE - && TREE_CODE (TREE_TYPE (value)) == REFERENCE_TYPE) - { - /* Reference-to-reference conversion is special. */ - value = build_unary_op (ADDR_EXPR, value, 0); - if (value != error_mark_node) - value = convert_force (build_pointer_type (TREE_TYPE (type)), value); - if (value == error_mark_node) - return error_mark_node; - return build1 (NOP_EXPR, type, value); - } - - #endif else { --- 4488,4491 ---- *************** *** 4497,4500 **** --- 4506,4511 ---- && TREE_CODE (otype) == POINTER_TYPE) { + /* For C++ we make these regular warnings, rather than + softening them into pedwarns. */ if (TYPE_VOLATILE (TREE_TYPE (otype)) && ! TYPE_VOLATILE (TREE_TYPE (type))) *************** *** 4514,4517 **** --- 4525,4543 ---- warning ("cast increases required alignment of target type"); + #if 0 + if (TREE_CODE (type) == INTEGER_TYPE + && TREE_CODE (otype) == POINTER_TYPE + && TYPE_PRECISION (type) != TYPE_PRECISION (otype)) + warning ("cast from pointer to integer of different size"); + + if (TREE_CODE (type) == POINTER_TYPE + && TREE_CODE (otype) == INTEGER_TYPE + && TYPE_PRECISION (type) != TYPE_PRECISION (otype) + /* Don't warn about converting 0 to pointer, + provided the 0 was explicit--not cast or made by folding. */ + && !(TREE_CODE (value) == INTEGER_CST && integer_zerop (value))) + warning ("cast to pointer from integer of different size"); + #endif + value = convert_force (type, value); } *************** *** 4542,4555 **** { tree binfos = TYPE_BINFO_BASETYPES (type); ! tree child = TREE_VEC_ELT (binfos, base_index); tree ref; if (TREE_CODE (expr) == ARRAY_REF ! || ! BINFO_OFFSET_ZEROP (child) ! || TREE_VIA_VIRTUAL (child) ! || TYPE_MODE (type) != TYPE_MODE (BINFO_TYPE (child))) { tree addr = build_unary_op (ADDR_EXPR, expr, 0); ! ref = build_indirect_ref (convert_pointer_to (child, addr), 0); } else --- 4568,4581 ---- { tree binfos = TYPE_BINFO_BASETYPES (type); ! tree base_binfo = TREE_VEC_ELT (binfos, base_index); tree ref; if (TREE_CODE (expr) == ARRAY_REF ! || ! BINFO_OFFSET_ZEROP (base_binfo) ! || TREE_VIA_VIRTUAL (base_binfo) ! || TYPE_MODE (type) != TYPE_MODE (BINFO_TYPE (base_binfo))) { tree addr = build_unary_op (ADDR_EXPR, expr, 0); ! ref = build_indirect_ref (convert_pointer_to (base_binfo, addr), 0); } else *************** *** 4556,4560 **** { ref = copy_node (expr); ! TREE_TYPE (ref) = BINFO_TYPE (child); } return ref; --- 4582,4586 ---- { ref = copy_node (expr); ! TREE_TYPE (ref) = BINFO_TYPE (base_binfo); } return ref; *************** *** 4647,4651 **** if (TYPE_LANG_SPECIFIC (lhstype) && TYPE_HAS_ASSIGNMENT (lhstype)) { ! result = build_opfncall (MODIFY_EXPR, LOOKUP_NORMAL, lhs, rhs, (tree)NOP_EXPR); if (result == NULL_TREE) return error_mark_node; --- 4673,4678 ---- if (TYPE_LANG_SPECIFIC (lhstype) && TYPE_HAS_ASSIGNMENT (lhstype)) { ! result = build_opfncall (MODIFY_EXPR, LOOKUP_NORMAL, ! lhs, rhs, make_node (NOP_EXPR)); if (result == NULL_TREE) return error_mark_node; *************** *** 4665,4669 **** for (i = 0; i <= TREE_VEC_LENGTH (binfos)-1; i++) { ! tree child = TREE_VEC_ELT (binfos, i); tree base_lhs, base_rhs; tree new_result; --- 4692,4696 ---- for (i = 0; i <= TREE_VEC_LENGTH (binfos)-1; i++) { ! tree base_binfo = TREE_VEC_ELT (binfos, i); tree base_lhs, base_rhs; tree new_result; *************** *** 4670,4674 **** /* Assignments from virtual baseclasses handled elsewhere. */ ! if (TREE_VIA_VIRTUAL (child)) continue; --- 4697,4701 ---- /* Assignments from virtual baseclasses handled elsewhere. */ ! if (TREE_VIA_VIRTUAL (base_binfo)) continue; *************** *** 4676,4683 **** base_rhs = get_base_ref (lhstype, i, newrhs); ! BINFO_INHERITANCE_CHAIN (child) = basetype_path; new_result = build_modify_expr_1 (base_lhs, modifycode, base_rhs, ! child); /* We either get back a compound stmt, or a simple one. */ --- 4703,4710 ---- base_rhs = get_base_ref (lhstype, i, newrhs); ! BINFO_INHERITANCE_CHAIN (base_binfo) = basetype_path; new_result = build_modify_expr_1 (base_lhs, modifycode, base_rhs, ! base_binfo); /* We either get back a compound stmt, or a simple one. */ *************** *** 4788,4792 **** switch (TREE_CODE (lhs)) { ! /* Handle --foo = 5; as these are valid constructs in c++ */ case PREDECREMENT_EXPR: case PREINCREMENT_EXPR: --- 4815,4819 ---- switch (TREE_CODE (lhs)) { ! /* Handle --foo = 5; as these are valid constructs in C++ */ case PREDECREMENT_EXPR: case PREINCREMENT_EXPR: *************** *** 4844,4848 **** if (TYPE_LANG_SPECIFIC (lhstype) && TYPE_HAS_ASSIGNMENT (lhstype)) { ! result = build_opfncall (MODIFY_EXPR, LOOKUP_NORMAL, lhs, rhs, (tree)NOP_EXPR); if (result == NULL_TREE) return error_mark_node; --- 4871,4876 ---- if (TYPE_LANG_SPECIFIC (lhstype) && TYPE_HAS_ASSIGNMENT (lhstype)) { ! result = build_opfncall (MODIFY_EXPR, LOOKUP_NORMAL, ! lhs, rhs, make_node (NOP_EXPR)); if (result == NULL_TREE) return error_mark_node; *************** *** 4882,4886 **** } } ! result = build_opfncall (MODIFY_EXPR, LOOKUP_NORMAL, lhs, rhs, (tree)NOP_EXPR); if (result == NULL_TREE) return error_mark_node; --- 4910,4915 ---- } } ! result = build_opfncall (MODIFY_EXPR, LOOKUP_NORMAL, ! lhs, rhs, make_node (NOP_EXPR)); if (result == NULL_TREE) return error_mark_node; *************** *** 5059,5063 **** && (TYPE_MAIN_VARIANT (lhstype) == TYPE_MAIN_VARIANT (TREE_TYPE (newrhs)) || (TREE_CODE (TREE_TYPE (newrhs)) == RECORD_TYPE ! && DERIVED_FROM_P (lhstype, TREE_TYPE (newrhs))))) { tree vbases = CLASSTYPE_VBASECLASSES (lhstype); --- 5088,5092 ---- && (TYPE_MAIN_VARIANT (lhstype) == TYPE_MAIN_VARIANT (TREE_TYPE (newrhs)) || (TREE_CODE (TREE_TYPE (newrhs)) == RECORD_TYPE ! && UNIQUELY_DERIVED_FROM_P (lhstype, TREE_TYPE (newrhs))))) { tree vbases = CLASSTYPE_VBASECLASSES (lhstype); *************** *** 5095,5099 **** tree elt_lhs = convert_pointer_to (vbases, lhs_addr); tree elt_rhs = convert_pointer_to (vbases, rhs_addr); ! result = tree_cons (NULL_TREE, build_modify_expr_1 (build_indirect_ref (elt_lhs, 0), modifycode, build_indirect_ref (elt_rhs, 0), TYPE_BINFO (lhstype)), result); if (TREE_VALUE (result) == error_mark_node) return error_mark_node; --- 5124,5134 ---- tree elt_lhs = convert_pointer_to (vbases, lhs_addr); tree elt_rhs = convert_pointer_to (vbases, rhs_addr); ! result ! = tree_cons (NULL_TREE, ! build_modify_expr_1 (build_indirect_ref (elt_lhs, 0), ! modifycode, ! build_indirect_ref (elt_rhs, 0), ! TYPE_BINFO (lhstype)), ! result); if (TREE_VALUE (result) == error_mark_node) return error_mark_node; *************** *** 5101,5105 **** } result = tree_cons (NULL_TREE, ! build_modify_expr_1 (lhs, modifycode, newrhs, TYPE_BINFO (lhstype)), result); return build_compound_expr (result); --- 5136,5143 ---- } result = tree_cons (NULL_TREE, ! build_modify_expr_1 (lhs, ! modifycode, ! newrhs, ! TYPE_BINFO (lhstype)), result); return build_compound_expr (result); *************** *** 5182,5186 **** return error_mark_node; } ! if (result = build_opfncall (MODIFY_EXPR, LOOKUP_NORMAL, lhs, newrhs, NOP_EXPR)) return result; } --- 5220,5225 ---- return error_mark_node; } ! if (result = build_opfncall (MODIFY_EXPR, ! LOOKUP_NORMAL, lhs, newrhs, make_node(NOP_EXPR))) return result; } *************** *** 5210,5215 **** if (TREE_SIDE_EFFECTS (lhs)) ! cond = build_compound_expr (tree_cons (NULL_TREE, lhs, ! build_tree_list (NULL_TREE, cond))); /* Cannot have two identical lhs on this one tree (result) as preexpand calls will rip them out and fill in RTL for them, but when the --- 5249,5256 ---- if (TREE_SIDE_EFFECTS (lhs)) ! cond = build_compound_expr (tree_cons ! (NULL_TREE, lhs, ! build_tree_list (NULL_TREE, cond))); ! /* Cannot have two identical lhs on this one tree (result) as preexpand calls will rip them out and fill in RTL for them, but when the *************** *** 5227,5236 **** /* We have to convert each arm to the proper type because the types may have been munged by constant folding. */ ! result = build (COND_EXPR, result_type, ! cond, ! build_modify_expr (lhs, modifycode, ! convert (result_type, TREE_OPERAND (newrhs, 1))), ! build_modify_expr (lhs1, modifycode, ! convert (result_type, TREE_OPERAND (newrhs, 2)))); } } --- 5268,5279 ---- /* We have to convert each arm to the proper type because the types may have been munged by constant folding. */ ! result ! = build (COND_EXPR, result_type, cond, ! build_modify_expr (lhs, modifycode, ! convert (result_type, ! TREE_OPERAND (newrhs, 1))), ! build_modify_expr (lhs1, modifycode, ! convert (result_type, ! TREE_OPERAND (newrhs, 2)))); } } *************** *** 5450,5453 **** --- 5493,5497 ---- errtype, fndecl, parmnum, 0); } + /* Any non-function converts to a [const][volatile] void * and vice versa; otherwise, targets must be the same. *************** *** 5460,5464 **** && TYPE_MAIN_VARIANT (ttr) == void_type_node && rhs != null_pointer_node) ! pedwarn ("ANSI C++ forbids implicit conversion from `void *' in %s", errtype); else if (pedantic && ((TYPE_MAIN_VARIANT (ttl) == void_type_node --- 5504,5509 ---- && TYPE_MAIN_VARIANT (ttr) == void_type_node && rhs != null_pointer_node) ! pedwarn ("ANSI C++ forbids implicit conversion from `void *' in %s", ! errtype); else if (pedantic && ((TYPE_MAIN_VARIANT (ttl) == void_type_node *************** *** 5508,5516 **** rhs = build (PLUS_EXPR, build_pointer_type (TREE_TYPE (ttr)), current_class_decl, rhs); ! return convert_for_assignment (type, rhs, errtype, fndecl, parmnum); } } if (TREE_CODE (ttl) == METHOD_TYPE) ! error ("%s between pointer-to-method and pointer-to-member types", errtype); else error ("%s between pointer and pointer-to-member types", errtype); --- 5553,5563 ---- rhs = build (PLUS_EXPR, build_pointer_type (TREE_TYPE (ttr)), current_class_decl, rhs); ! return convert_for_assignment (type, rhs, ! errtype, fndecl, parmnum); } } if (TREE_CODE (ttl) == METHOD_TYPE) ! error ("%s between pointer-to-method and pointer-to-member types", ! errtype); else error ("%s between pointer and pointer-to-member types", errtype); *************** *** 5636,5640 **** else if (codel == REFERENCE_TYPE) /* Force an abort. */ ! assert (codel != REFERENCE_TYPE); else if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (rhs))) return build1 (NOP_EXPR, type, rhs); --- 5683,5687 ---- else if (codel == REFERENCE_TYPE) /* Force an abort. */ ! my_friendly_assert (codel != REFERENCE_TYPE, 317); else if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (TREE_TYPE (rhs))) return build1 (NOP_EXPR, type, rhs); *************** *** 5658,5662 **** to that function. ARGNUM is the number of the argument, origin 0. */ ! static void warn_for_assignment (anon_msg, arg_msg, opname, fndecl, argnum, severe) char *anon_msg; --- 5705,5709 ---- to that function. ARGNUM is the number of the argument, origin 0. */ ! void warn_for_assignment (anon_msg, arg_msg, opname, fndecl, argnum, severe) char *anon_msg; *************** *** 5768,5772 **** if (codel == REFERENCE_TYPE) ! return convert_to_reference ((exp ? exp : error_mark_node), type, rhs, 0, flags); rhs = require_complete_type (rhs); --- 5815,5821 ---- if (codel == REFERENCE_TYPE) ! return convert_to_reference ((exp ? exp : error_mark_node), ! type, rhs, fndecl, parmnum, errtype, ! 0, flags); rhs = require_complete_type (rhs); *************** *** 5797,5805 **** else if (TREE_CODE (rhs) == INDIRECT_REF && TREE_HAS_CONSTRUCTOR (rhs)) { ! assert (TREE_CODE (TREE_OPERAND (rhs, 0)) == CALL_EXPR); if (exp) { ! assert (TREE_VALUE (TREE_OPERAND (TREE_OPERAND (rhs, 0), 1)) == NULL_TREE); ! TREE_VALUE (TREE_OPERAND (TREE_OPERAND (rhs, 0), 1)) = build_unary_op (ADDR_EXPR, exp, 0); } else --- 5846,5855 ---- else if (TREE_CODE (rhs) == INDIRECT_REF && TREE_HAS_CONSTRUCTOR (rhs)) { ! my_friendly_assert (TREE_CODE (TREE_OPERAND (rhs, 0)) == CALL_EXPR, 318); if (exp) { ! my_friendly_assert (TREE_VALUE (TREE_OPERAND (TREE_OPERAND (rhs, 0), 1)) == NULL_TREE, 316); ! TREE_VALUE (TREE_OPERAND (TREE_OPERAND (rhs, 0), 1)) ! = build_unary_op (ADDR_EXPR, exp, 0); } else *************** *** 5809,5813 **** } if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (rhstype) ! || (IS_AGGR_TYPE (rhstype) && DERIVED_FROM_P (type, rhstype))) { if (TYPE_HAS_INIT_REF (type)) --- 5859,5863 ---- } if (TYPE_MAIN_VARIANT (type) == TYPE_MAIN_VARIANT (rhstype) ! || (IS_AGGR_TYPE (rhstype) && UNIQUELY_DERIVED_FROM_P (type, rhstype))) { if (TYPE_HAS_INIT_REF (type)) *************** *** 5879,5884 **** cases into cases that expand_asm_operands can handle. ! Arguments are same as for expand_asm_operands. */ void c_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) --- 5929,5937 ---- cases into cases that expand_asm_operands can handle. ! Arguments are same as for expand_asm_operands. + We don't do default conversions on all inputs, because it can screw + up operands that are expected to be in memory. */ + void c_expand_asm_operands (string, outputs, inputs, clobbers, vol, filename, line) *************** *** 5898,5907 **** o[i] = TREE_VALUE (tail); - #if 0 /* Don't do this--it screws up operands expected to be in memory. */ - /* Perform default conversions on all inputs. */ - for (i = 0, tail = inputs; tail; tail = TREE_CHAIN (tail), i++) - TREE_VALUE (tail) = default_conversion (TREE_VALUE (tail)); - #endif - /* Generate the ASM_OPERANDS insn; store into the TREE_VALUEs of OUTPUTS some trees for --- 5951,5954 ---- *************** *** 6045,6055 **** } ! if (TREE_CODE (whats_returned) == VAR_DECL) ! if (DECL_NAME (whats_returned) == NULL_TREE ! || TEMP_NAME_P (DECL_NAME (whats_returned))) ! warning ("reference to non-lvalue returned"); ! else if (! TREE_STATIC (whats_returned) ! && IDENTIFIER_LOCAL_VALUE (DECL_NAME (whats_returned))) ! warning_with_decl (whats_returned, "reference to local variable `%s' returned"); } else if (TREE_CODE (retval) == ADDR_EXPR) --- 6092,6104 ---- } ! if (TREE_CODE (whats_returned) == VAR_DECL && DECL_NAME (whats_returned)) ! { ! if (TEMP_NAME_P (DECL_NAME (whats_returned))) ! warning ("reference to non-lvalue returned"); ! else if (! TREE_STATIC (whats_returned) ! && IDENTIFIER_LOCAL_VALUE (DECL_NAME (whats_returned))) ! warning_with_decl (whats_returned, ! "reference to local variable `%s' returned"); ! } } else if (TREE_CODE (retval) == ADDR_EXPR) *************** *** 6056,6060 **** { tree whats_returned = TREE_OPERAND (retval, 0); ! if (IDENTIFIER_LOCAL_VALUE (DECL_NAME (whats_returned)) && !TREE_STATIC (whats_returned)) warning_with_decl (whats_returned, --- 6105,6110 ---- { tree whats_returned = TREE_OPERAND (retval, 0); ! if (DECL_NAME (whats_returned) ! && IDENTIFIER_LOCAL_VALUE (DECL_NAME (whats_returned)) && !TREE_STATIC (whats_returned)) warning_with_decl (whats_returned, *************** *** 6116,6120 **** else { ! retval = convert_for_initialization (result, valtype, retval, LOOKUP_NORMAL, "return", NULL_TREE, 0); DECL_INITIAL (result) = NULL_TREE; --- 6166,6171 ---- else { ! retval = convert_for_initialization (result, valtype, retval, ! LOOKUP_NORMAL, "return", NULL_TREE, 0); DECL_INITIAL (result) = NULL_TREE; diff -rc2N gcc-2.3.1/cpp.texi gcc-2.3.2/cpp.texi *** gcc-2.3.1/cpp.texi Sat Oct 17 21:41:26 1992 --- gcc-2.3.2/cpp.texi Thu Nov 26 13:08:07 1992 *************** *** 1748,1753 **** expansion. If the expansion consists of multiple statements, then the effect is to distort the line numbers of some of these statements. The ! result can can be incorrect line numbers, in error messages or ! displayed in a debugger. The GNU C preprocessor operating in ANSI C mode adjusts appropriately --- 1748,1753 ---- expansion. If the expansion consists of multiple statements, then the effect is to distort the line numbers of some of these statements. The ! result can be incorrect line numbers, in error messages or displayed in ! a debugger. The GNU C preprocessor operating in ANSI C mode adjusts appropriately diff -rc2N gcc-2.3.1/dbxout.c gcc-2.3.2/dbxout.c *** gcc-2.3.1/dbxout.c Fri Sep 25 01:58:30 1992 --- gcc-2.3.2/dbxout.c Fri Nov 20 23:44:58 1992 *************** *** 855,858 **** --- 855,859 ---- { register tree tem; + static int anonymous_type_number = 0; /* If there was an input error and we don't really have a type, *************** *** 1082,1086 **** abort (); #endif ! dbxout_type_name (type); fprintf (asmfile, ":"); typevec[TYPE_SYMTAB_ADDRESS (type)] = TYPE_XREF; --- 1083,1090 ---- abort (); #endif ! if (TYPE_NAME (type) != 0) ! dbxout_type_name (type); ! else ! fprintf (asmfile, "$$%d", anonymous_type_number++); fprintf (asmfile, ":"); typevec[TYPE_SYMTAB_ADDRESS (type)] = TYPE_XREF; *************** *** 1543,1547 **** current_sym_nchars = 2; ! fprintf (asmfile, "%s \":T", ASM_STABS_OP); dbxout_type (type, 1, 0); dbxout_finish_symbol (NULL_TREE); --- 1547,1553 ---- current_sym_nchars = 2; ! /* Some debuggers fail when given NULL names, so give this a ! harmless name of ` '. */ ! fprintf (asmfile, "%s \" :T", ASM_STABS_OP); dbxout_type (type, 1, 0); dbxout_finish_symbol (NULL_TREE); diff -rc2N gcc-2.3.1/expmed.c gcc-2.3.2/expmed.c *** gcc-2.3.1/expmed.c Mon Oct 5 02:35:14 1992 --- gcc-2.3.2/expmed.c Thu Nov 26 10:33:39 1992 *************** *** 1690,1694 **** unsigned int ops; enum alg_code op[MAX_BITS_PER_WORD]; ! unsigned int coeff[MAX_BITS_PER_WORD]; }; --- 1690,1694 ---- unsigned int ops; enum alg_code op[MAX_BITS_PER_WORD]; ! unsigned HOST_WIDE_INT coeff[MAX_BITS_PER_WORD]; }; diff -rc2N gcc-2.3.1/expr.c gcc-2.3.2/expr.c *** gcc-2.3.1/expr.c Sun Oct 25 14:47:00 1992 --- gcc-2.3.2/expr.c Tue Nov 10 11:02:32 1992 *************** *** 140,144 **** --- 140,148 ---- rtx insn, pat; enum machine_mode mode; + /* Try indexing by frame ptr and try by stack ptr. + It is known that on the Convex the stack ptr isn't a valid index. + With luck, one or the other is valid on any machine. */ rtx mem = gen_rtx (MEM, VOIDmode, stack_pointer_rtx); + rtx mem1 = gen_rtx (MEM, VOIDmode, frame_pointer_rtx); start_sequence (); *************** *** 155,158 **** --- 159,163 ---- direct_load[(int) mode] = direct_store[(int) mode] = 0; PUT_MODE (mem, mode); + PUT_MODE (mem1, mode); /* See if there is some register that can be used in this mode and *************** *** 174,177 **** --- 179,187 ---- direct_load[(int) mode] = 1; + SET_SRC (pat) = mem1; + SET_DEST (pat) = reg; + if (recog (pat, insn, &num_clobbers) >= 0) + direct_load[(int) mode] = 1; + SET_SRC (pat) = reg; SET_DEST (pat) = mem; *************** *** 178,181 **** --- 188,196 ---- if (recog (pat, insn, &num_clobbers) >= 0) direct_store[(int) mode] = 1; + + SET_SRC (pat) = reg; + SET_DEST (pat) = mem1; + if (recog (pat, insn, &num_clobbers) >= 0) + direct_store[(int) mode] = 1; } *************** *** 1477,1480 **** --- 1492,1497 ---- group_insns (prev); + + return get_last_insn (); } diff -rc2N gcc-2.3.1/expr.h gcc-2.3.2/expr.h *** gcc-2.3.1/expr.h Sat Oct 3 14:43:01 1992 --- gcc-2.3.2/expr.h Thu Nov 26 23:35:24 1992 *************** *** 170,174 **** /* Supply a default definition for FUNCTION_ARG_PADDING: ! usually pad upward, but pad short, non-BLKmode args downward on big-endian machines. */ --- 170,174 ---- /* Supply a default definition for FUNCTION_ARG_PADDING: ! usually pad upward, but pad short args downward on big-endian machines. */ diff -rc2N gcc-2.3.1/final.c gcc-2.3.2/final.c *** gcc-2.3.1/final.c Sun Oct 18 04:16:21 1992 --- gcc-2.3.2/final.c Fri Nov 20 15:36:44 1992 *************** *** 903,910 **** new_block = 1; ! /* Make a map indicating which line numbers appear in this function. */ ! for (insn = first; insn; insn = NEXT_INSN (insn)) ! if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > max_line) ! max_line = NOTE_LINE_NUMBER (insn); line_note_exists = (char *) oballoc (max_line + 1); --- 903,939 ---- new_block = 1; ! /* Make a map indicating which line numbers appear in this function. ! When producing SDB debugging info, delete troublesome line number ! notes from inlined functions in other files as well as duplicate ! line number notes. */ ! #ifdef SDB_DEBUGGING_INFO ! if (write_symbols == SDB_DEBUG) ! { ! rtx last = 0; ! for (insn = first; insn; insn = NEXT_INSN (insn)) ! if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0) ! { ! if ((RTX_INTEGRATED_P (insn) ! && strcmp (NOTE_SOURCE_FILE (insn), main_input_filename) != 0) ! || (last != 0 ! && NOTE_LINE_NUMBER (insn) == NOTE_LINE_NUMBER (last) ! && NOTE_SOURCE_FILE (insn) == NOTE_SOURCE_FILE (last))) ! { ! NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED; ! NOTE_SOURCE_FILE (insn) = 0; ! continue; ! } ! last = insn; ! if (NOTE_LINE_NUMBER (insn) > max_line) ! max_line = NOTE_LINE_NUMBER (insn); ! } ! } ! else ! #endif ! { ! for (insn = first; insn; insn = NEXT_INSN (insn)) ! if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > max_line) ! max_line = NOTE_LINE_NUMBER (insn); ! } line_note_exists = (char *) oballoc (max_line + 1); diff -rc2N gcc-2.3.1/fixinc.svr4 gcc-2.3.2/fixinc.svr4 *** gcc-2.3.1/fixinc.svr4 Sat Oct 17 17:20:24 1992 --- gcc-2.3.2/fixinc.svr4 Wed Nov 25 20:13:56 1992 *************** *** 468,471 **** --- 468,475 ---- # Add a `static' declaration of `getrnge' into . + # Don't do this if there is already a `static void getrnge' declaration + # present, since this would cause a redeclaration error. Solaris 2.x has + # such a declaration. + file=regexp.h base=`basename $file` *************** *** 481,488 **** if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix ! cp $file_to_fix /tmp/$base ! chmod +w /tmp/$base ! ex /tmp/$base < /dev/null; then ! true ! else ! cp $file_to_fix /tmp/$base ! chmod +w /tmp/$base ! ex /tmp/$base </dev/null 2>&1; then \ ! echo No change needed in $file_to_fix ! else ! echo Fixed $file_to_fix ! rm -f ${LIB}/$file ! cp /tmp/$base ${LIB}/$file fi rm -f /tmp/$base --- 496,508 ---- static int getrnge (); . ! wq EOF ! if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ ! No change needed in $file_to_fix ! else ! echo Fixed $file_to_fix ! rm -f ${LIB}/$file ! cp /tmp/$base ${LIB}/$file ! fi fi rm -f /tmp/$base *************** *** 912,916 **** if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix ! sed -e 's/extern struct \(stdata\|strevent\);/struct \1;/' $file_to_fix > /tmp/$base if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ echo No change needed in $file_to_fix --- 920,927 ---- if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix ! sed -e ' ! s/extern struct stdata;/struct stdata;/g ! s/extern struct strevent;/struct strevent;/g ! ' $file_to_fix > /tmp/$base if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ echo No change needed in $file_to_fix *************** *** 936,940 **** if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix ! sed -e 's/extern struct \(strbuf\|uio\|thread\|proc\);/struct \1;/' $file_to_fix > /tmp/$base if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ echo No change needed in $file_to_fix --- 947,956 ---- if [ \! -z "$file_to_fix" ]; then echo Checking $file_to_fix ! sed -e ' ! s/extern struct strbuf;/struct strbuf;/g ! s/extern struct uio;/struct uio;/g ! s/extern struct thread;/struct thread;/g ! s/extern struct proc;/struct proc;/g ! ' $file_to_fix > /tmp/$base if cmp $file_to_fix /tmp/$base >/dev/null 2>&1; then \ echo No change needed in $file_to_fix diff -rc2N gcc-2.3.1/fixincludes gcc-2.3.2/fixincludes *** gcc-2.3.1/fixincludes Mon Oct 19 21:20:47 1992 --- gcc-2.3.2/fixincludes Thu Nov 26 23:26:44 1992 *************** *** 19,27 **** TERM=unknown export TERM ! # This prevents /bin/ex from failing if the EXINIT environment variable ! # was set to something invalid. ! EXINIT="" export EXINIT # Directory in which to store the results. LIB=${1?"fixincludes: output directory not specified"} --- 19,40 ---- TERM=unknown export TERM ! # This prevents two problems: ! # Either ex might find a .exrc file and get confused, ! # or ex might complain if the EXINIT variable is invalid. ! # We know there is no .exrc in the GCC source. ! # `set' is a no-op ex command. ! EXINIT=set export EXINIT + # Define PWDCMD as a command to use to get the working dir + # in the form that we want. + PWDCMD=pwd + case "`pwd`" in + //*) + # On an Apollo, discard everything before `/usr'. + PWDCMD="eval pwd | sed -e 's,.*/usr/,/usr/,'" + ;; + esac + # Directory in which to store the results. LIB=${1?"fixincludes: output directory not specified"} *************** *** 33,37 **** # Make LIB absolute. ! cd $LIB; LIB=`pwd` # Fail if no arg to specify a directory for the output. --- 46,50 ---- # Make LIB absolute. ! cd $LIB; LIB=`${PWDCMD}` # Fail if no arg to specify a directory for the output. *************** *** 121,125 **** dest=`ls -ld $file | sed -n 's/.*-> //p'` if [ "$dest" ]; then ! cwd=`pwd` # In case $dest is relative, get to $file's dir first. cd ${INPUT} --- 134,138 ---- dest=`ls -ld $file | sed -n 's/.*-> //p'` if [ "$dest" ]; then ! cwd=`${PWDCMD}` # In case $dest is relative, get to $file's dir first. cd ${INPUT} *************** *** 131,135 **** cd $dest # X gets the dir that the link actually leads to. ! x=`pwd` # If a link points to ., make a similar link to . if [ $x = $INPUT ]; then --- 144,148 ---- cd $dest # X gets the dir that the link actually leads to. ! x=`${PWDCMD}` # If a link points to ., make a similar link to . if [ $x = $INPUT ]; then *************** *** 817,820 **** --- 830,834 ---- # parameter to atof not const on DECstation Ultrix V4.0. + # also get rid of bogus inline definitions in HP-UX 8.0 file=math.h if [ -r $file ] && [ ! -r ${LIB}/$file ]; then *************** *** 826,829 **** --- 840,845 ---- echo Fixing $file, non-const arg sed -e 's@atof( char \*__nptr );@atof( const char *__nptr );@' \ + -e 's@inline int abs(int d) { return (d>0)?d:-d; }@@' \ + -e 's@inline double abs(double d) { return fabs(d); }@@' \ ${LIB}/$file > ${LIB}/${file}.sed rm -f ${LIB}/$file; mv ${LIB}/${file}.sed ${LIB}/$file diff -rc2N gcc-2.3.1/fold-const.c gcc-2.3.2/fold-const.c *** gcc-2.3.1/fold-const.c Wed Oct 21 17:14:52 1992 --- gcc-2.3.2/fold-const.c Mon Nov 23 21:07:52 1992 *************** *** 2552,2555 **** --- 2552,2557 ---- utype = unsigned_type (utype); var = convert (utype, var); + lo_cst = convert (utype, lo_cst); + hi_cst = convert (utype, hi_cst); } diff -rc2N gcc-2.3.1/g++ gcc-2.3.2/g++ *** gcc-2.3.1/g++ Mon Oct 5 18:09:12 1992 --- gcc-2.3.2/g++ Thu Nov 26 14:30:59 1992 *************** *** 28,32 **** numargs=$# ! for arg do if [ $first = yes ] then --- 28,34 ---- numargs=$# ! # ash requires the newline before `do'. ! for arg ! do if [ $first = yes ] then *************** *** 90,94 **** # Get rid of that initial 1st arg ! shift if [ x$quote != x ] --- 92,101 ---- # Get rid of that initial 1st arg ! if [ $first = no ]; then ! shift ! else ! echo "$0: No input files specified." ! exit 1 ! fi if [ x$quote != x ] diff -rc2N gcc-2.3.1/gcc.c gcc-2.3.2/gcc.c *** gcc-2.3.1/gcc.c Sat Oct 31 19:25:02 1992 --- gcc-2.3.2/gcc.c Fri Nov 27 18:08:15 1992 *************** *** 263,267 **** name starts with `o'. %{o*} would substitute this text, including the space; thus, two arguments would be generated. ! %{S*:X} substitutes X if one or more switches whose names with -S are specified to CC. Note that the tail part of the -S option (i.e. the part matched by the `*') will be substituted for each --- 263,267 ---- name starts with `o'. %{o*} would substitute this text, including the space; thus, two arguments would be generated. ! %{S*:X} substitutes X if one or more switches whose names start with -S are specified to CC. Note that the tail part of the -S option (i.e. the part matched by the `*') will be substituted for each *************** *** 430,441 **** {".c", "@c"}, {"@c", ! "cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\ -undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\ ! %{!undef:%{!ansi:%p} %P} %{trigraphs}\ %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\ %{traditional-cpp:-traditional}\ ! %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C\ %i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n", "%{!M:%{!MM:%{!E:cc1 %{!pipe:%g.i} %1 \ --- 430,441 ---- {".c", "@c"}, {"@c", ! "cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\ -undef -D__GNUC__=2 %{ansi:-trigraphs -$ -D__STRICT_ANSI__}\ ! %{!undef:%{!ansi:%p} %P} %{trigraphs} \ %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\ %{traditional-cpp:-traditional}\ ! %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*}\ %i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n", "%{!M:%{!MM:%{!E:cc1 %{!pipe:%g.i} %1 \ *************** *** 450,454 **** %{!pipe:%g.s} %A\n }}}}"}, {"-", ! "%{E:cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\ --- 450,454 ---- %{!pipe:%g.s} %A\n }}}}"}, {"-", ! "%{E:cpp -lang-c %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\ *************** *** 457,461 **** %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\ %{traditional-cpp:-traditional}\ ! %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C\ %i %W{o*}}\ %{!E:%e-E required when input is from standard input}"}, --- 457,461 ---- %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\ %{traditional-cpp:-traditional}\ ! %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*}\ %i %W{o*}}\ %{!E:%e-E required when input is from standard input}"}, *************** *** 462,466 **** {".m", "@objective-c"}, {"@objective-c", ! "cpp -lang-objc %{nostdinc*} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\ --- 462,466 ---- {".m", "@objective-c"}, {"@objective-c", ! "cpp -lang-objc %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d}\ *************** *** 469,473 **** %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\ %{traditional-cpp:-traditional}\ ! %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C\ %i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n", "%{!M:%{!MM:%{!E:cc1obj %{!pipe:%g.i} %1 \ --- 469,473 ---- %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\ %{traditional-cpp:-traditional}\ ! %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*}\ %i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n", "%{!M:%{!MM:%{!E:cc1obj %{!pipe:%g.i} %1 \ *************** *** 485,489 **** {"@c-header", "%{!E:%eCompilation of header file requested} \ ! cpp %{nostdinc*} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} \ --- 485,489 ---- {"@c-header", "%{!E:%eCompilation of header file requested} \ ! cpp %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} \ *************** *** 492,496 **** %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\ %{traditional-cpp:-traditional}\ ! %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C\ %i %W{o*}"}, {".cc", "@c++"}, --- 492,496 ---- %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\ %{traditional-cpp:-traditional}\ ! %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*}\ %i %W{o*}"}, {".cc", "@c++"}, *************** *** 498,502 **** {".C", "@c++"}, {"@c++", ! "cpp -lang-c++ %{nostdinc*} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P} %I\ %{C:%{!E:%eGNU C++ does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} \ --- 498,502 ---- {".C", "@c++"}, {"@c++", ! "cpp -lang-c++ %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C++ does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} \ *************** *** 505,509 **** %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\ %{traditional-cpp:-traditional} %{trigraphs}\ ! %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C\ %i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n", "%{!M:%{!MM:%{!E:cc1plus %{!pipe:%g.i} %1 %2\ --- 505,509 ---- %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\ %{traditional-cpp:-traditional} %{trigraphs}\ ! %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*}\ %i %{!M:%{!MM:%{!E:%{!pipe:%g.i}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n", "%{!M:%{!MM:%{!E:cc1plus %{!pipe:%g.i} %1 %2\ *************** *** 544,548 **** {".S", "@assembler-with-cpp"}, {"@assembler-with-cpp", ! "cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{D*} %{U*} %{I*} %{i*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{trigraphs} \ --- 544,548 ---- {".S", "@assembler-with-cpp"}, {"@assembler-with-cpp", ! "cpp -lang-asm %{nostdinc*} %{C} %{v} %{A*} %{I*} %{P} %I\ %{C:%{!E:%eGNU C does not support -C without using -E}}\ %{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{trigraphs} \ *************** *** 550,554 **** %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\ %{traditional-cpp:-traditional}\ ! %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C\ %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n", "%{!M:%{!MM:%{!E:%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\ --- 550,554 ---- %c %{O*:-D__OPTIMIZE__} %{traditional} %{ftraditional:-traditional}\ %{traditional-cpp:-traditional}\ ! %{g*} %{W*} %{w} %{pedantic*} %{H} %{d*} %C %{D*} %{U*} %{i*}\ %i %{!M:%{!MM:%{!E:%{!pipe:%g.s}}}}%{E:%W{o*}}%{M:%W{o*}}%{MM:%W{o*}} |\n", "%{!M:%{!MM:%{!E:%{!S:as %{R} %{j} %{J} %{h} %{d2} %a %Y\ *************** *** 566,574 **** /* Here is the spec for running the linker, after compiling all files. */ - #ifdef LINK_LIBGCC_SPECIAL - /* Have gcc do the search for libgcc.a. */ /* -u* was put back because both BSD and SysV seem to support it. */ /* %{static:} simply prevents an error message if the target machine doesn't handle -static. */ static char *link_command_spec = "\ %{!c:%{!M:%{!MM:%{!E:%{!S:ld %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \ --- 566,582 ---- /* Here is the spec for running the linker, after compiling all files. */ /* -u* was put back because both BSD and SysV seem to support it. */ /* %{static:} simply prevents an error message if the target machine doesn't handle -static. */ + #ifdef LINK_LIBGCC_SPECIAL_1 + /* Have gcc do the search for libgcc.a, but generate -L options as usual. */ + static char *link_command_spec = "\ + %{!c:%{!M:%{!MM:%{!E:%{!S:ld %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \ + %{r} %{s} %{T*} %{t} %{u*} %{x} %{z}\ + %{!A:%{!nostdlib:%S}} %{static:}\ + %{L*} %D %o %{!nostdlib:libgcc.a%s %L libgcc.a%s %{!A:%E}}\n }}}}}"; + #else + #ifdef LINK_LIBGCC_SPECIAL + /* Have gcc do the search for libgcc.a, and don't generate -L options. */ static char *link_command_spec = "\ %{!c:%{!M:%{!MM:%{!E:%{!S:ld %l %X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} \ *************** *** 584,587 **** --- 592,596 ---- %{L*} %D %o %{!nostdlib:-lgcc %L -lgcc %{!A:%E}}\n }}}}}"; #endif + #endif /* A vector of options to give to the linker. *************** *** 2537,2541 **** --- 2546,2562 ---- else { + #ifdef MKTEMP_EACH_FILE /* ??? This has a problem: the total number of + values mktemp can return is limited. + That matters for the names of object files. + In 2.4, do something about that. */ + /* Choose a new temp_filename, but get rid of the + suffix that the spec wants to add to it. */ + choose_temp_base (); + while (*p == '.' || isalpha (*p)) + p++; obstack_grow (&obstack, temp_filename, temp_filename_length); + delete_this_arg = 1; + #else + obstack_grow (&obstack, temp_filename, temp_filename_length); if (c == 'u' || c == 'U') { *************** *** 2547,2550 **** --- 2568,2572 ---- obstack_grow (&obstack, buff, strlen (buff)); } + #endif delete_this_arg = 1; } diff -rc2N gcc-2.3.1/gcc.texi gcc-2.3.2/gcc.texi *** gcc-2.3.1/gcc.texi Fri Oct 30 01:27:42 1992 --- gcc-2.3.2/gcc.texi Wed Nov 25 17:50:39 1992 *************** *** 67,71 **** @center Richard M. Stallman @sp 3 ! @center last updated 30 Oct 1992 @sp 1 @c The version number appears twice more in this file. --- 67,71 ---- @center Richard M. Stallman @sp 3 ! @center last updated 24 Nov 1992 @sp 1 @c The version number appears twice more in this file. *************** *** 929,932 **** --- 929,956 ---- Revision E of the Micronics motherboard, and is fixed in Revision F. + @item + On some 386 systems, GNU CC crashes trying to compile @file{enquire.c}. + This happens on machines that don't have a 387 FPU chip. On 386 + machines, the system kernel is supposed to emulate the 387 when you + don't have one. The crash is due to a bug in the emulator. + + One of these systems is the Unix from Interactive Systems: 386/ix. + On this system, an alternate emulator is provided, and it does work. + To use it, execute this command as super-user: + + @example + ln /etc/emulator.rel1 /etc/emulator + @end example + + @noindent + and then reboot the system. (The default emulator file remains present + under the name @file{emulator.dflt}.) + + If you have such a problem on the SCO system, try using + @file{/etc/emulator.att}. + + Another system which has this problem is Esix. We don't know whether it + has an alternate emulator that works. + @cindex @code{genflags}, crash on Sun 4 @item *************** *** 2188,2191 **** --- 2212,2218 ---- any conclusion from our observations. + If the problem is a diagnostic when compiling GNU CC with some other + compiler, say whether it is a warning or an error. + Often the observed symptom is incorrect output when your program is run. Sad to say, this is not enough information unless the program is short *************** *** 2244,2251 **** general, whenever a variable is a pointer, its value is no use without the data it points to. - - In addition, include a debugging dump from just before the pass - in which the crash happens. Most bugs involve a series of insns, - not just one. @end itemize --- 2271,2274 ---- *************** *** 2309,2312 **** --- 2332,2342 ---- Such guesses are usually wrong. Even I can't guess right about such things without first using the debugger to find the facts. + + @item + A core dump file. + + We have no way of examining a core dump for your type of machine + unless we have an identical system---and if we do have one, + we should be able to reproduce the crash ourselves. @end itemize diff -rc2N gcc-2.3.1/genattrtab.c gcc-2.3.2/genattrtab.c *** gcc-2.3.1/genattrtab.c Tue Oct 13 00:11:40 1992 --- gcc-2.3.2/genattrtab.c Mon Nov 23 20:59:12 1992 *************** *** 98,105 **** #include "hconfig.h" #include "rtl.h" - #include "obstack.h" #include "insn-config.h" /* For REGISTER_CONSTRAINTS */ #include static struct obstack obstack, obstack1, obstack2; struct obstack *rtl_obstack = &obstack; --- 98,115 ---- #include "hconfig.h" #include "rtl.h" #include "insn-config.h" /* For REGISTER_CONSTRAINTS */ #include + #ifndef VMS + #ifndef USG + #include + #include + #endif + #endif + + /* We must include obstack.h after , to avoid lossage with + /usr/include/sys/stdtypes.h on Sun OS 4.x. */ + #include "obstack.h" + static struct obstack obstack, obstack1, obstack2; struct obstack *rtl_obstack = &obstack; *************** *** 5464,5467 **** --- 5474,5489 ---- rtx tem; int i; + + #ifdef RLIMIT_STACK + /* Get rid of any avoidable limit on stack size. */ + { + struct rlimit rlim; + + /* Set the stack limit huge so that alloca does not fail. */ + getrlimit (RLIMIT_STACK, &rlim); + rlim.rlim_cur = rlim.rlim_max; + setrlimit (RLIMIT_STACK, &rlim); + } + #endif /* RLIMIT_STACK defined */ obstack_init (rtl_obstack); diff -rc2N gcc-2.3.1/getopt.c gcc-2.3.2/getopt.c *** gcc-2.3.1/getopt.c Sun Nov 1 03:44:12 1992 --- gcc-2.3.2/getopt.c Fri Nov 27 23:54:51 1992 *************** *** 35,38 **** --- 35,42 ---- #endif /* not __GNUC__ */ + #if !__STDC__ && !defined(const) + #define const + #endif + #include *************** *** 47,54 **** #define __alloca alloca #endif /* GNU C library. */ - - #if !__STDC__ - #define const - #endif /* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a --- 51,54 ---- diff -rc2N gcc-2.3.1/getopt1.c gcc-2.3.2/getopt1.c *** gcc-2.3.1/getopt1.c Sun Nov 1 03:44:13 1992 --- gcc-2.3.2/getopt1.c Fri Nov 27 23:54:52 1992 *************** *** 18,30 **** #include "getopt.h" ! #ifndef __STDC__ #define const #endif ! #if defined(STDC_HEADERS) || defined(__GNU_LIBRARY__) || defined (LIBC) #include ! #else /* STDC_HEADERS or __GNU_LIBRARY__ */ char *getenv (); ! #endif /* STDC_HEADERS or __GNU_LIBRARY__ */ #ifndef NULL --- 18,34 ---- #include "getopt.h" ! #if !__STDC__ && !defined(const) #define const #endif ! #include ! ! /* This needs to come after some library #include ! to get __GNU_LIBRARY__ defined. */ ! #ifdef __GNU_LIBRARY__ #include ! #else char *getenv (); ! #endif #ifndef NULL diff -rc2N gcc-2.3.1/gstdarg.h gcc-2.3.2/gstdarg.h *** gcc-2.3.1/gstdarg.h Fri Oct 30 04:42:45 1992 --- gcc-2.3.2/gstdarg.h Thu Nov 26 23:47:36 1992 *************** *** 63,66 **** --- 63,67 ---- (AP = ((__gnuc_va_list) __builtin_next_arg ())) + #undef va_end void va_end (__gnuc_va_list); /* Defined in libgcc.a */ #define va_end(AP) *************** *** 68,74 **** --- 69,86 ---- /* We cast to void * and then to TYPE * because this avoids a warning about increasing the alignment requirement. */ + + #if defined (__arm__) || defined (__i386__) || defined (__ns32000__) || defined (__vax__) + /* This is for little-endian machines; small args are padded upward. */ #define va_arg(AP, TYPE) \ (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE)))) + #else /* big-endian */ + /* This is for big-endian machines; small args are padded downward. */ + #define va_arg(AP, TYPE) \ + (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ + *((TYPE *) (void *) ((char *) (AP) - ((sizeof (TYPE) < 4 \ + ? sizeof (TYPE) \ + : __va_rounded_size (TYPE)))))) + #endif /* big-endian */ #endif /* _STDARG_H */ *************** *** 106,129 **** #else /* not __SVR4_2__ */ ! /* On 4.3bsd-net2, make sure ansi.h is included, so we have ! one less case to deal with in the following. */ ! #if defined (__BSD_NET2__) || defined (____386BSD____) ! #include ! #endif ! ! /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which remain ! defined as long as the corresponding type is *not* defined. */ ! #ifdef _ANSI_H_ ! #ifndef _VA_LIST_ ! #define _VA_LIST ! #endif ! #undef _VA_LIST_ ! #endif /* _ANSI_H_ */ ! ! /* The macro _VA_LIST_ is the same thing used by this file in Ultrix. */ ! #ifndef _VA_LIST_ /* The macro _VA_LIST is used in SCO Unix 3.2. */ #ifndef _VA_LIST #define _VA_LIST_ #define _VA_LIST typedef __gnuc_va_list va_list; --- 118,131 ---- #else /* not __SVR4_2__ */ ! /* The macro _VA_LIST_ is the same thing used by this file in Ultrix. ! But on BSD NET2 we must not test or define or undef it. ! (Note that the comments in NET 2's ansi.h ! are incorrect for _VA_LIST_--see stdio.h!) */ ! #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) /* The macro _VA_LIST is used in SCO Unix 3.2. */ #ifndef _VA_LIST + #if !(defined (__BSD_NET2__) || defined (____386BSD____)) #define _VA_LIST_ + #endif #define _VA_LIST typedef __gnuc_va_list va_list; *************** *** 130,138 **** #endif /* not _VA_LIST */ #endif /* not _VA_LIST_ */ - - /* On 4.3bsd-net2, leave _VA_LIST_ undef to indicate va_list is defined. */ - #ifdef _ANSI_H_ - #undef _VA_LIST_ - #endif #endif /* not __SVR4_2__ */ --- 132,135 ---- diff -rc2N gcc-2.3.1/gstddef.h gcc-2.3.2/gstddef.h *** gcc-2.3.1/gstddef.h Thu Oct 29 16:14:26 1992 --- gcc-2.3.2/gstddef.h Sun Nov 22 17:03:34 1992 *************** *** 21,25 **** one less case to deal with in the following. */ #if defined (__BSD_NET2__) || defined (____386BSD____) ! #include #endif --- 21,25 ---- one less case to deal with in the following. */ #if defined (__BSD_NET2__) || defined (____386BSD____) ! #include #endif *************** *** 36,42 **** #define _WCHAR_T #endif - #undef _SIZE_T_ #undef _PTRDIFF_T_ #undef _WCHAR_T_ #endif /* _ANSI_H_ */ --- 36,44 ---- #define _WCHAR_T #endif #undef _PTRDIFF_T_ + #ifndef __need_ptrdiff_t + #undef _SIZE_T_ #undef _WCHAR_T_ + #endif #endif /* _ANSI_H_ */ *************** *** 169,174 **** --- 171,180 ---- #ifdef _ANSI_H_ #undef _PTRDIFF_T_ + #ifdef _STDDEF_H /* This is a kludge. + _STDDEF_H is defined when we are using the whole file, + undefined when obstack.h wants just ptrdiff_t. */ #undef _SIZE_T_ #undef _WCHAR_T_ + #endif #endif diff -rc2N gcc-2.3.1/gsyslimits.h gcc-2.3.2/gsyslimits.h *** gcc-2.3.1/gsyslimits.h --- gcc-2.3.2/gsyslimits.h Thu Sep 24 02:58:53 1992 *************** *** 0 **** --- 1,6 ---- + /* syslimits.h stands for the system's own limits.h file. + If we can use it ok unmodified, then we install this text. + If fixincludes fixes it, then the fixed version is installed + instead of this text. */ + + #include_next diff -rc2N gcc-2.3.1/gvarargs.h gcc-2.3.2/gvarargs.h *** gcc-2.3.1/gvarargs.h Fri Oct 30 04:33:33 1992 --- gcc-2.3.2/gvarargs.h Thu Nov 26 23:46:11 1992 *************** *** 88,94 **** (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) #define va_arg(AP, TYPE) \ ! (AP += __va_rounded_size (TYPE), \ ! *((TYPE *) (AP - __va_rounded_size (TYPE)))) #endif /* not alpha */ --- 88,104 ---- (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int)) + #if defined (__arm__) || defined (__i386__) || defined (__ns32000__) || defined (__vax__) + /* This is for little-endian machines; small args are padded upward. */ #define va_arg(AP, TYPE) \ ! (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ ! *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE)))) ! #else /* big-endian */ ! /* This is for big-endian machines; small args are padded downward. */ ! #define va_arg(AP, TYPE) \ ! (AP = (__gnuc_va_list) ((char *) (AP) + __va_rounded_size (TYPE)), \ ! *((TYPE *) (void *) ((char *) (AP) - ((sizeof (TYPE) < 4 \ ! ? sizeof (TYPE) \ ! : __va_rounded_size (TYPE)))))) ! #endif /* big-endian */ #endif /* not alpha */ *************** *** 120,143 **** #else /* not __SVR4_2__ */ ! /* On 4.3bsd-net2, make sure ansi.h is included, so we have ! one less case to deal with in the following. */ ! #if defined (__BSD_NET2__) || defined (____386BSD____) ! #include ! #endif ! ! /* In 4.3bsd-net2, machine/ansi.h defines these symbols, which remain ! defined as long as the corresponding type is *not* defined. */ ! #ifdef _ANSI_H_ ! #ifndef _VA_LIST_ ! #define _VA_LIST ! #endif ! #undef _VA_LIST_ ! #endif /* _ANSI_H_ */ ! ! /* The macro _VA_LIST_ is the same thing used by this file in Ultrix. */ ! #ifndef _VA_LIST_ /* The macro _VA_LIST is used in SCO Unix 3.2. */ #ifndef _VA_LIST #define _VA_LIST_ #define _VA_LIST typedef __gnuc_va_list va_list; --- 130,143 ---- #else /* not __SVR4_2__ */ ! /* The macro _VA_LIST_ is the same thing used by this file in Ultrix. ! But on BSD NET2 we must not test or define or undef it. ! (Note that the comments in NET 2's ansi.h ! are incorrect for _VA_LIST_--see stdio.h!) */ ! #if !defined (_VA_LIST_) || defined (__BSD_NET2__) || defined (____386BSD____) /* The macro _VA_LIST is used in SCO Unix 3.2. */ #ifndef _VA_LIST + #if !(defined (__BSD_NET2__) || defined (____386BSD____)) #define _VA_LIST_ + #endif #define _VA_LIST typedef __gnuc_va_list va_list; *************** *** 146,154 **** #endif /* not __SVR4_2__ */ - - /* On 4.3bsd-net2, leave _VA_LIST_ undef to indicate va_list is defined. */ - #ifdef _ANSI_H_ - #undef _VA_LIST_ - #endif /* The next BSD release (if there is one) wants this symbol to be --- 146,149 ---- diff -rc2N gcc-2.3.1/install.texi gcc-2.3.2/install.texi *** gcc-2.3.1/install.texi Sat Oct 31 15:58:36 1992 --- gcc-2.3.2/install.texi Wed Nov 25 15:24:43 1992 *************** *** 295,298 **** --- 295,305 ---- @samp{#include }. + @item i386-sun-sunos4 + You may find that you need another version of GNU CC to begin + bootstrapping with, since the current version when built with the + system's own compiler seems to get an infinite loop compiling part of + @file{libgcc2.c}. GNU CC version 2 compiled with GNU CC (any version) + seems not to have this problem. + @item m68000-att AT&T 3b1, a.k.a. 7300 PC. Special procedures are needed to compile GNU *************** *** 892,898 **** where @var{configuration} is the configuration name (perhaps @samp{hp@var{nnn}-hpux}) and @var{gccversion} is the GNU CC version ! number. Note, if you picked up GAS before October 6, 1992 it is highly ! recommended you get a new one to avoid several bugs which have been ! discovered recently. To enable debugging, configure GNU CC with the @samp{--gas} option before --- 899,917 ---- where @var{configuration} is the configuration name (perhaps @samp{hp@var{nnn}-hpux}) and @var{gccversion} is the GNU CC version ! number. Do this @emph{before} starting the build process, otherwise you will ! get errors from the HPUX assembler while building @file{libgcc2.a}. The ! command ! ! @example ! make install-dir ! @end example ! ! @noindent ! will create the necessary directory hierarchy so you can install GAS before ! building GCC. ! ! If you obtained GAS before October 6, 1992 it is highly recommended you ! get a new one to avoid several bugs which have been discovered ! recently. To enable debugging, configure GNU CC with the @samp{--gas} option before diff -rc2N gcc-2.3.1/integrate.c gcc-2.3.2/integrate.c *** gcc-2.3.1/integrate.c Tue Oct 20 06:48:15 1992 --- gcc-2.3.2/integrate.c Wed Nov 25 13:03:18 1992 *************** *** 1193,1197 **** if (GET_CODE (parm_insns) == NOTE && NOTE_LINE_NUMBER (parm_insns) > 0) ! emit_note (NOTE_SOURCE_FILE (parm_insns), NOTE_LINE_NUMBER (parm_insns)); /* Expand the function arguments. Do this first so that any --- 1193,1202 ---- if (GET_CODE (parm_insns) == NOTE && NOTE_LINE_NUMBER (parm_insns) > 0) ! { ! rtx note = emit_note (NOTE_SOURCE_FILE (parm_insns), ! NOTE_LINE_NUMBER (parm_insns)); ! if (note) ! RTX_INTEGRATED_P (note) = 1; ! } /* Expand the function arguments. Do this first so that any *************** *** 1213,1217 **** rtx copy; ! emit_note (DECL_SOURCE_FILE (formal), DECL_SOURCE_LINE (formal)); arg_trees[i] = arg; --- 1218,1225 ---- rtx copy; ! rtx note = emit_note (DECL_SOURCE_FILE (formal), ! DECL_SOURCE_LINE (formal)); ! if (note) ! RTX_INTEGRATED_P (note) = 1; arg_trees[i] = arg; *************** *** 1365,1372 **** /* This is the good case where the parameter is in a register. If it is read-only and our argument is a constant, set up the ! constant equivalence. */ ! if (GET_CODE (copy) != REG && GET_CODE (copy) != SUBREG) { temp = copy_to_mode_reg (GET_MODE (loc), copy); if (CONSTANT_P (copy) || FIXED_BASE_PLUS_P (copy)) { --- 1373,1387 ---- /* This is the good case where the parameter is in a register. If it is read-only and our argument is a constant, set up the ! constant equivalence. ! ! If LOC is REG_USERVAR_P, the usual case, COPY must also have ! that flag set if it is a register. */ ! ! if ((GET_CODE (copy) != REG && GET_CODE (copy) != SUBREG) ! || (GET_CODE (copy) == REG && REG_USERVAR_P (loc) ! && ! REG_USERVAR_P (copy))) { temp = copy_to_mode_reg (GET_MODE (loc), copy); + REG_USERVAR_P (temp) = REG_USERVAR_P (loc); if (CONSTANT_P (copy) || FIXED_BASE_PLUS_P (copy)) { *************** *** 1399,1403 **** && REGNO (XEXP (loc, 0)) > LAST_VIRTUAL_REGISTER)) { ! emit_note (DECL_SOURCE_FILE (formal), DECL_SOURCE_LINE (formal)); /* Compute the address in the area we reserved and store the --- 1414,1421 ---- && REGNO (XEXP (loc, 0)) > LAST_VIRTUAL_REGISTER)) { ! rtx note = emit_note (DECL_SOURCE_FILE (formal), ! DECL_SOURCE_LINE (formal)); ! if (note) ! RTX_INTEGRATED_P (note) = 1; /* Compute the address in the area we reserved and store the *************** *** 1708,1712 **** expand_end_bindings (getdecls (), 1, 1); block = poplevel (1, 1, 0); ! BLOCK_ABSTRACT_ORIGIN (block) = fndecl; poplevel (0, 0, 0); emit_line_note (input_filename, lineno); --- 1726,1731 ---- expand_end_bindings (getdecls (), 1, 1); block = poplevel (1, 1, 0); ! BLOCK_ABSTRACT_ORIGIN (block) = (DECL_ABSTRACT_ORIGIN (fndecl) == NULL ! ? fndecl : DECL_ABSTRACT_ORIGIN (fndecl)); poplevel (0, 0, 0); emit_line_note (input_filename, lineno); *************** *** 1907,1910 **** --- 1926,1935 ---- loc = assign_stack_temp (BLKmode, size, 1); loc = XEXP (loc, 0); + /* When arguments grow downward, the virtual incoming + args pointer points to the top of the argument block, + so the remapped location better do the same. */ + #ifdef ARGS_GROW_DOWNWARD + loc = plus_constant (loc, size); + #endif map->reg_map[regno] = temp = force_reg (Pmode, force_operand (loc, NULL_RTX)); *************** *** 2305,2335 **** case SUBREG: ! /* SUBREG is ordinary, but don't make nested SUBREGs and try to simplify ! constants. */ ! { ! rtx inner = SUBREG_REG (x); ! rtx new = 0; ! /* We can't call subst_constants on &SUBREG_REG (x) because any ! constant or SUBREG wouldn't be valid inside our SUBEG. Instead, ! see what is inside, try to form the new SUBREG and see if that is ! valid. We handle two cases: extracting a full word in an ! integral mode and extracting the low part. */ ! subst_constants (&inner, NULL_RTX, map); ! ! if (GET_MODE_CLASS (GET_MODE (x)) == MODE_INT ! && GET_MODE_SIZE (GET_MODE (x)) == UNITS_PER_WORD ! && GET_MODE (SUBREG_REG (x)) != VOIDmode) ! new = operand_subword (inner, SUBREG_WORD (x), 0, ! GET_MODE (SUBREG_REG (x))); ! if (new == 0 && subreg_lowpart_p (x)) ! new = gen_lowpart_common (GET_MODE (x), inner); ! if (new) ! validate_change (insn, loc, new, 1); ! return; ! } case MEM: --- 2330,2365 ---- case SUBREG: ! /* SUBREG applied to something other than a reg ! should be treated as ordinary, since that must ! be a special hack and we don't know how to treat it specially. ! Consider for example mulsidi3 in m68k.md. ! Ordinary SUBREG of a REG needs this special treatment. */ ! if (GET_CODE (SUBREG_REG (x)) == REG) ! { ! rtx inner = SUBREG_REG (x); ! rtx new = 0; ! /* We can't call subst_constants on &SUBREG_REG (x) because any ! constant or SUBREG wouldn't be valid inside our SUBEG. Instead, ! see what is inside, try to form the new SUBREG and see if that is ! valid. We handle two cases: extracting a full word in an ! integral mode and extracting the low part. */ ! subst_constants (&inner, NULL_RTX, map); ! ! if (GET_MODE_CLASS (GET_MODE (x)) == MODE_INT ! && GET_MODE_SIZE (GET_MODE (x)) == UNITS_PER_WORD ! && GET_MODE (SUBREG_REG (x)) != VOIDmode) ! new = operand_subword (inner, SUBREG_WORD (x), 0, ! GET_MODE (SUBREG_REG (x))); ! if (new == 0 && subreg_lowpart_p (x)) ! new = gen_lowpart_common (GET_MODE (x), inner); ! if (new) ! validate_change (insn, loc, new, 1); ! return; ! } ! break; case MEM: diff -rc2N gcc-2.3.1/invoke.texi gcc-2.3.2/invoke.texi *** gcc-2.3.1/invoke.texi Sat Oct 31 15:54:13 1992 --- gcc-2.3.2/invoke.texi Sat Nov 21 10:24:41 1992 *************** *** 209,213 **** @emph{i386 Options} ! -m486 -mno486 -msoft-float -msvr3-shlib -mieee-fp -mno-fp-ret-in-387 --- 209,213 ---- @emph{i386 Options} ! -m486 -mno-486 -msoft-float -msvr3-shlib -mieee-fp -mno-fp-ret-in-387 *************** *** 2529,2533 **** @table @code @item -m486 ! @itemx -mno486 Control whether or not code is optimized for a 486 instead of an 386. Code generated for an 486 will run on a 386 and vice versa. --- 2529,2533 ---- @table @code @item -m486 ! @itemx -mno-486 Control whether or not code is optimized for a 486 instead of an 386. Code generated for an 486 will run on a 386 and vice versa. diff -rc2N gcc-2.3.1/jump.c gcc-2.3.2/jump.c *** gcc-2.3.1/jump.c Fri Oct 23 07:36:51 1992 --- gcc-2.3.2/jump.c Tue Nov 3 14:57:10 1992 *************** *** 838,841 **** --- 838,842 ---- && BRANCH_COST >= 3 && (temp = next_nonnote_insn (insn)) != 0 + && GET_CODE (temp) == INSN && REG_NOTES (temp) == 0 && (reallabelprev == temp *************** *** 875,880 **** --- 876,883 ---- && BRANCH_COST >= 4 && (temp = next_nonnote_insn (insn)) != 0 + && GET_CODE (temp) == INSN && REG_NOTES (temp) == 0 && (temp3 = next_nonnote_insn (temp)) != 0 + && GET_CODE (temp3) == INSN && REG_NOTES (temp3) == 0 && (reallabelprev == temp3 *************** *** 921,926 **** --- 924,931 ---- && BRANCH_COST >= 4 && (temp = next_nonnote_insn (insn)) != 0 + && GET_CODE (temp) == INSN && REG_NOTES (temp) == 0 && (temp3 = next_nonnote_insn (temp)) != 0 + && GET_CODE (temp3) == INSN && REG_NOTES (temp3) == 0 && (reallabelprev == temp3 diff -rc2N gcc-2.3.1/libgcc2.c gcc-2.3.2/libgcc2.c *** gcc-2.3.1/libgcc2.c Thu Oct 29 16:33:10 1992 --- gcc-2.3.2/libgcc2.c Thu Nov 26 14:04:48 1992 *************** *** 297,301 **** sdiv_qrnnd (q, r, c1, c0, d); /* Add 2^31 to quotient */ ! q += 1 << 31; } } --- 297,301 ---- sdiv_qrnnd (q, r, c1, c0, d); /* Add 2^31 to quotient */ ! q += (USItype) 1 << 31; } } diff -rc2N gcc-2.3.1/limitx.h gcc-2.3.2/limitx.h *** gcc-2.3.1/limitx.h Tue Sep 29 17:29:04 1992 --- gcc-2.3.2/limitx.h Thu Nov 26 21:34:03 1992 *************** *** 2,7 **** if the system has its own version of limits.h. */ ! #ifndef _LIMITS_H_ /* Terminated in limity.h. */ ! #define _LIMITS_H_ #ifndef _LIBC_LIMITS_H_ --- 2,9 ---- if the system has its own version of limits.h. */ ! /* We use _GCC_LIMITS_H_ because we want this not to match ! any macros that the system's limits.h uses for its own purposes. */ ! #ifndef _GCC_LIMITS_H_ /* Terminated in limity.h. */ ! #define _GCC_LIMITS_H_ #ifndef _LIBC_LIMITS_H_ diff -rc2N gcc-2.3.1/limity.h gcc-2.3.2/limity.h *** gcc-2.3.1/limity.h Sat Aug 1 22:53:10 1992 --- gcc-2.3.2/limity.h Thu Nov 26 21:33:23 1992 *************** *** 2,4 **** if the system has its own version of limits.h. */ ! #endif /* not _LIMITS_H_ */ --- 2,4 ---- if the system has its own version of limits.h. */ ! #endif /* not _GCC_LIMITS_H_ */ diff -rc2N gcc-2.3.1/local-alloc.c gcc-2.3.2/local-alloc.c *** gcc-2.3.1/local-alloc.c Fri Oct 9 07:25:42 1992 --- gcc-2.3.2/local-alloc.c Wed Nov 4 07:21:51 1992 *************** *** 698,701 **** --- 698,707 ---- int d_n_calls = 0; + /* If P is a CALL_INSN, SRC crosses one more call, since it + used to die there. */ + + if (GET_CODE (p) == CALL_INSN) + n_calls++; + /* We can do the optimization. Scan forward from INSN again, replacing regs as we go. Set FAILED if a replacement can't diff -rc2N gcc-2.3.1/md.texi gcc-2.3.2/md.texi *** gcc-2.3.1/md.texi Tue Oct 13 21:24:22 1992 --- gcc-2.3.2/md.texi Mon Nov 23 14:53:43 1992 *************** *** 3322,3335 **** value. This blocking effect is computed using the @var{simultaneity}, @var{ready-delay}, @var{issue-delay}, and @var{conflict-list} terms. ! For a normal non-pipelined function unit, @var{simultaneity} will be ! one, the unit will block for the @var{ready-delay} cycles of the ! executing insn, and smaller values of @var{issue-delay} will be ignored. @var{conflict-list} is an optional list giving detailed conflict costs for this unit. If specified, it is a list of condition test expressions ! which are applied to insns already executing in @var{name}. For each ! insn that is in the list, @var{issue-delay} will be used for the conflict ! cost, while a value of zero will be used for insns not in the list. If ! not specified, it defaults to all instructions that use the function unit. Typical uses of this vector are where a floating point function unit can --- 3322,3337 ---- value. This blocking effect is computed using the @var{simultaneity}, @var{ready-delay}, @var{issue-delay}, and @var{conflict-list} terms. ! For a normal non-pipelined function unit, @var{simultaneity} is one, the ! unit is taken to block for the @var{ready-delay} cycles of the executing ! insn, and smaller values of @var{issue-delay} are ignored. @var{conflict-list} is an optional list giving detailed conflict costs for this unit. If specified, it is a list of condition test expressions ! to be applied to insns chosen to execute in @var{name} following the ! particular insn matching @var{test} that is already executing in ! @var{name}. For each insn in the list, @var{issue-delay} specifies the ! conflict cost; for insns not in the list, the cost is zero. If not ! specified, @var{conflict-list} defaults to all instructions that use the ! function unit. Typical uses of this vector are where a floating point function unit can *************** *** 3351,3357 **** @example (define_function_unit ! "fp" 1 0 (eq_attr "type" "sp_fp") 4 4 (eq_attr "type" "dp_fp")] (define_function_unit ! "fp" 1 0 (eq_attr "type" "dp_fp") 4 4 (eq_attr "type" "sp_fp")] @end example --- 3353,3359 ---- @example (define_function_unit ! "fp" 1 0 (eq_attr "type" "sp_fp") 4 4 [(eq_attr "type" "dp_fp")]) (define_function_unit ! "fp" 1 0 (eq_attr "type" "dp_fp") 4 4 [(eq_attr "type" "sp_fp")]) @end example diff -rc2N gcc-2.3.1/mips-tdump.c gcc-2.3.2/mips-tdump.c *** gcc-2.3.1/mips-tdump.c Thu Oct 29 14:32:39 1992 --- gcc-2.3.2/mips-tdump.c Tue Nov 10 17:17:41 1992 *************** *** 27,30 **** --- 27,34 ---- #include "config.h" + #ifdef index + #undef index + #undef rindex + #endif #ifndef CROSS_COMPILE #include *************** *** 60,68 **** #define uint unsigned int #define ulong unsigned long - - #ifdef index - #undef index - #undef rindex - #endif --- 64,67 ---- diff -rc2N gcc-2.3.1/objc/Makefile gcc-2.3.2/objc/Makefile *** gcc-2.3.1/objc/Makefile Sun Oct 18 20:59:28 1992 --- gcc-2.3.2/objc/Makefile Tue Nov 3 05:32:47 1992 *************** *** 36,44 **** # ranlib is run in the parent directory's makefile. ! OBJC_H = objc.h objc-proto.h record.h ../assert.h ../gstdarg.h HASH_H = hash.h mutex.h ! core.o: core.c $(OBJC_H) $(HASH_H) ../gstddef.h ! hash.o: hash.c $(OBJC_H) $(HASH_H) ../gstddef.h object.o: object.m object.h $(OBJC_H) $(GCC_FOR_TARGET) -c $(GCC_CFLAGS) $(SUBDIR_INCLUDES) $< --- 36,44 ---- # ranlib is run in the parent directory's makefile. ! OBJC_H = objc.h objc-proto.h record.h $(srcdir)/assert.h $(srcdir)/gstdarg.h HASH_H = hash.h mutex.h ! core.o: core.c $(OBJC_H) $(HASH_H) $(srcdir)/gstddef.h ! hash.o: hash.c $(OBJC_H) $(HASH_H) $(srcdir)/gstddef.h object.o: object.m object.h $(OBJC_H) $(GCC_FOR_TARGET) -c $(GCC_CFLAGS) $(SUBDIR_INCLUDES) $< diff -rc2N gcc-2.3.1/objc/core.c gcc-2.3.2/objc/core.c *** gcc-2.3.1/objc/core.c Wed Oct 28 16:50:37 1992 --- gcc-2.3.2/objc/core.c Fri Nov 27 23:49:47 1992 *************** *** 790,796 **** { Method_t method = NULL; ! const char* name = sel_getName (sel); ! /* * Scan the method list of the class. If the method isn't found in --- 790,803 ---- { Method_t method = NULL; ! const char* name; + if (sel == 0) + return NULL; + + name = sel_getName (sel); + + if (name == 0) + return NULL; + /* * Scan the method list of the class. If the method isn't found in *************** *** 1227,1232 **** /* Search for the +initialize method. Call it if it exists. */ ! method ! = searchForMethodInList (class->class_pointer->methods, sel_getName (sel)); if (method) { IMP imp; --- 1234,1240 ---- /* Search for the +initialize method. Call it if it exists. */ ! if (sel) ! method = searchForMethodInList (class->class_pointer->methods, ! sel_getName (sel)); if (method) { IMP imp; diff -rc2N gcc-2.3.1/objc-actions.c gcc-2.3.2/objc-actions.c *** gcc-2.3.1/objc-actions.c Sat Oct 31 15:41:21 1992 --- gcc-2.3.2/objc-actions.c Mon Nov 9 12:38:39 1992 *************** *** 1636,1645 **** } ! /* ! * struct objc_super { ! * id self; ! * struct objc_class *class; ! * }; ! */ static tree build_super_template () --- 1636,1643 ---- } ! /* Set super_type to the data type node for struct objc_super *, ! first defining struct objc_super itself. ! This needs to be done just once per compilation. */ ! static tree build_super_template () *************** *** 2640,2643 **** --- 2638,2643 ---- receiver = build_unary_op (ADDR_EXPR, receiver, 0); + /* Don't evaluate the receiver twice. */ + receiver = save_expr (receiver); self_object = receiver; } *************** *** 2694,2698 **** /* Determine operation return type. */ ! if (TYPE_MAIN_VARIANT (rtype) == TYPE_MAIN_VARIANT (super_type)) { tree iface; --- 2694,2699 ---- /* Determine operation return type. */ ! if (super_type != 0 ! && TYPE_MAIN_VARIANT (rtype) == TYPE_MAIN_VARIANT (super_type)) { tree iface; diff -rc2N gcc-2.3.1/optabs.c gcc-2.3.2/optabs.c *** gcc-2.3.1/optabs.c Mon Oct 5 02:21:02 1992 --- gcc-2.3.2/optabs.c Thu Nov 26 23:12:46 1992 *************** *** 281,284 **** --- 281,285 ---- || binoptab->code == ROTATE || binoptab->code == ROTATERT); + rtx entry_last = get_last_insn (); rtx last; *************** *** 559,562 **** --- 560,564 ---- int nwords = GET_MODE_BITSIZE (mode) / BITS_PER_WORD; rtx carry_in, carry_out; + rtx xop0, xop1; /* We can handle either a 1 or -1 value for the carry. If STORE_FLAG *************** *** 570,578 **** /* Prepare the operands. */ ! op0 = force_reg (mode, op0); ! op1 = force_reg (mode, op1); if (target == 0 || GET_CODE (target) != REG ! || target == op0 || target == op1) target = gen_reg_rtx (mode); --- 572,580 ---- /* Prepare the operands. */ ! xop0 = force_reg (mode, op0); ! xop1 = force_reg (mode, op1); if (target == 0 || GET_CODE (target) != REG ! || target == xop0 || target == xop1) target = gen_reg_rtx (mode); *************** *** 582,587 **** int index = (WORDS_BIG_ENDIAN ? nwords - i - 1 : i); rtx target_piece = operand_subword (target, index, 1, mode); ! rtx op0_piece = operand_subword_force (op0, index, mode); ! rtx op1_piece = operand_subword_force (op1, index, mode); rtx x; --- 584,589 ---- int index = (WORDS_BIG_ENDIAN ? nwords - i - 1 : i); rtx target_piece = operand_subword (target, index, 1, mode); ! rtx op0_piece = operand_subword_force (xop0, index, mode); ! rtx op1_piece = operand_subword_force (xop1, index, mode); rtx x; *************** *** 642,646 **** temp = emit_move_insn (target, target); REG_NOTES (temp) = gen_rtx (EXPR_LIST, REG_EQUAL, ! gen_rtx (binoptab->code, mode, op0, op1), REG_NOTES (temp)); return target; --- 644,648 ---- temp = emit_move_insn (target, target); REG_NOTES (temp) = gen_rtx (EXPR_LIST, REG_EQUAL, ! gen_rtx (binoptab->code, mode, xop0, xop1), REG_NOTES (temp)); return target; *************** *** 1093,1097 **** if (! (methods == OPTAB_WIDEN || methods == OPTAB_LIB_WIDEN || methods == OPTAB_MUST_WIDEN)) ! return 0; /* Caller says, don't even try. */ /* Compute the value of METHODS to pass to recursive calls. --- 1095,1103 ---- if (! (methods == OPTAB_WIDEN || methods == OPTAB_LIB_WIDEN || methods == OPTAB_MUST_WIDEN)) ! { ! /* Caller says, don't even try. */ ! delete_insns_since (entry_last); ! return 0; ! } /* Compute the value of METHODS to pass to recursive calls. *************** *** 1172,1175 **** --- 1178,1182 ---- } + delete_insns_since (entry_last); return 0; } *************** *** 1254,1257 **** --- 1261,1265 ---- enum mode_class class; enum machine_mode wider_mode; + rtx entry_last = get_last_insn (); rtx last; *************** *** 1358,1361 **** --- 1366,1370 ---- } + delete_insns_since (entry_last); return 0; } *************** *** 1552,1556 **** emit_move_insn (target_piece, x); ! seq = gen_sequence (); end_sequence (); --- 1561,1565 ---- emit_move_insn (target_piece, x); ! seq = get_insns (); end_sequence (); *************** *** 1651,1655 **** enum machine_mode wider_mode; register rtx temp; ! rtx last = get_last_insn (); rtx pat; --- 1660,1665 ---- enum machine_mode wider_mode; register rtx temp; ! rtx entry_last = get_last_insn (); ! rtx last; rtx pat; *************** *** 1670,1673 **** --- 1680,1685 ---- } + last = get_last_insn (); + if (target) target = protect_from_queue (target, 1); *************** *** 1819,1822 **** --- 1831,1835 ---- } + delete_insns_since (entry_last); return 0; } *************** *** 3747,3751 **** register unsigned opname_len = strlen (opname); ! for (mode = first_mode; mode <= last_mode; mode++) { register char *mname = mode_name[(int) mode]; --- 3760,3765 ---- register unsigned opname_len = strlen (opname); ! for (mode = first_mode; (int) mode <= (int) last_mode; ! mode = (enum machine_mode) ((int) mode + 1)) { register char *mname = mode_name[(int) mode]; diff -rc2N gcc-2.3.1/print-rtl.c gcc-2.3.2/print-rtl.c *** gcc-2.3.1/print-rtl.c Mon Oct 12 18:24:49 1992 --- gcc-2.3.2/print-rtl.c Tue Nov 10 10:17:36 1992 *************** *** 65,69 **** { fprintf (outfile, "\n%s", ! (spaces + (sizeof spaces - indent * 2))); sawclose = 0; } --- 65,69 ---- { fprintf (outfile, "\n%s", ! (spaces + (sizeof spaces - 1 - indent * 2))); sawclose = 0; } *************** *** 133,137 **** { fprintf (outfile, "\n%s", ! (spaces + (sizeof spaces - indent * 2))); sawclose = 0; } --- 133,137 ---- { fprintf (outfile, "\n%s", ! (spaces + (sizeof spaces - 1 - indent * 2))); sawclose = 0; } *************** *** 150,154 **** if (sawclose) fprintf (outfile, "\n%s", ! (spaces + (sizeof spaces - indent * 2))); fprintf (outfile, "] "); --- 150,154 ---- if (sawclose) fprintf (outfile, "\n%s", ! (spaces + (sizeof spaces - 1 - indent * 2))); fprintf (outfile, "] "); diff -rc2N gcc-2.3.1/regclass.c gcc-2.3.2/regclass.c *** gcc-2.3.1/regclass.c Mon Oct 12 18:19:25 1992 --- gcc-2.3.2/regclass.c Wed Nov 25 00:48:29 1992 *************** *** 47,51 **** #ifdef AUTO_INC_DEC ! #if defined(SECONARY_INPUT_RELOAD_CLASS) || defined(SECONDARY_OUTPUT_RELOAD_CLASS) #define FORBIDDEN_INC_DEC_CLASSES #endif --- 47,51 ---- #ifdef AUTO_INC_DEC ! #if defined(SECONDARY_INPUT_RELOAD_CLASS) || defined(SECONDARY_OUTPUT_RELOAD_CLASS) #define FORBIDDEN_INC_DEC_CLASSES #endif *************** *** 894,898 **** for (class = 0; class < N_REG_CLASSES; class++) if (p->cost[class] < p->mem_cost ! && (reg_class_size[reg_class_subunion[(int) alt][class]] > reg_class_size[(int) alt]) #ifdef FORBIDDEN_INC_DEC_CLASSES --- 894,898 ---- for (class = 0; class < N_REG_CLASSES; class++) if (p->cost[class] < p->mem_cost ! && (reg_class_size[(int) reg_class_subunion[(int) alt][class]] > reg_class_size[(int) alt]) #ifdef FORBIDDEN_INC_DEC_CLASSES *************** *** 1322,1326 **** #endif ! #ifdef SECONARY_OUTPUT_RELOAD_CLASS if (! to_p) secondary_class = SECONDARY_OUTPUT_RELOAD_CLASS (class, mode, x); --- 1322,1326 ---- #endif ! #ifdef SECONDARY_OUTPUT_RELOAD_CLASS if (! to_p) secondary_class = SECONDARY_OUTPUT_RELOAD_CLASS (class, mode, x); *************** *** 1330,1334 **** return (move_cost[(int) secondary_class][(int) class] + copy_cost (x, mode, secondary_class, 2)); ! #endif /* HAVE_SECONARY_RELOADS */ /* For memory, use the memory move cost, for (hard) registers, use the --- 1330,1334 ---- return (move_cost[(int) secondary_class][(int) class] + copy_cost (x, mode, secondary_class, 2)); ! #endif /* HAVE_SECONDARY_RELOADS */ /* For memory, use the memory move cost, for (hard) registers, use the diff -rc2N gcc-2.3.1/reload.c gcc-2.3.2/reload.c *** gcc-2.3.1/reload.c Wed Oct 28 17:03:35 1992 --- gcc-2.3.2/reload.c Fri Nov 27 01:50:40 1992 *************** *** 1236,1239 **** --- 1236,1240 ---- /* Life span of this reload must not extend past main insn. */ && reload_when_needed[i] != RELOAD_FOR_OUTPUT_RELOAD_ADDRESS + && ! reload_needed_for_multiple[i] && reload_inmode[i] == reload_outmode[output_reload] && reload_inc[i] == 0 *************** *** 2685,2688 **** --- 2686,2693 ---- operand. + Don't do this for a multiword operand, if + we have to worry about small classes, because making reg groups + harder to allocate is asking for trouble. + Don't do this if the preferred class has only one register because we might otherwise exhaust the class. */ *************** *** 2690,2693 **** --- 2695,2701 ---- if (! win && this_alternative[i] != (int) NO_REGS + #ifdef SMALL_REGISTER_CLASSES + && GET_MODE_SIZE (operand_mode[i]) <= UNITS_PER_WORD + #endif && reg_class_size[(int) preferred_class[i]] > 1) { diff -rc2N gcc-2.3.1/sdbout.c gcc-2.3.2/sdbout.c *** gcc-2.3.1/sdbout.c Fri Oct 23 21:18:34 1992 --- gcc-2.3.2/sdbout.c Sat Nov 21 11:08:54 1992 *************** *** 388,391 **** --- 388,402 ---- } + static int + template_name_p (name) + tree name; + { + register char *ptr = IDENTIFIER_POINTER (name); + while (*ptr && *ptr != '<') + ptr++; + + return *ptr != '\0'; + } + static void sdbout_record_type_name (type) *************** *** 411,414 **** --- 422,430 ---- { t = DECL_NAME (TYPE_NAME (type)); + /* The DECL_NAME for templates includes "<>", which breaks + most assemblers. Use its assembler name instead, which + has been mangled into being safe. */ + if (t && template_name_p (t)) + t = DECL_ASSEMBLER_NAME (TYPE_NAME (type)); } #endif *************** *** 415,419 **** /* Now get the name as a string, or invent one. */ ! if (t != 0) name = IDENTIFIER_POINTER (t); } --- 431,435 ---- /* Now get the name as a string, or invent one. */ ! if (t != NULL_TREE) name = IDENTIFIER_POINTER (t); } *************** *** 453,456 **** --- 469,474 ---- if (size == INT_TYPE_SIZE) return (TREE_UNSIGNED (type) ? T_UINT : T_INT); + if (size == LONG_TYPE_SIZE) + return (TREE_UNSIGNED (type) ? T_ULONG : T_LONG); return 0; } *************** *** 635,639 **** /* Output typedef name. */ ! PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_NAME (decl))); PUT_SDB_SCL (C_TPDEF); break; --- 653,660 ---- /* Output typedef name. */ ! if (template_name_p (DECL_NAME (decl))) ! PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))); ! else ! PUT_SDB_DEF (IDENTIFIER_POINTER (DECL_NAME (decl))); PUT_SDB_SCL (C_TPDEF); break; diff -rc2N gcc-2.3.1/stmt.c gcc-2.3.2/stmt.c *** gcc-2.3.1/stmt.c Fri Oct 9 12:59:03 1992 --- gcc-2.3.2/stmt.c Wed Nov 25 12:10:46 1992 *************** *** 1374,1379 **** case METHOD_CALL_EXPR: case RTL_EXPR: - case WRAPPER_EXPR: - case ANTI_WRAPPER_EXPR: case WITH_CLEANUP_EXPR: case EXIT_EXPR: --- 1374,1377 ---- *************** *** 2188,2192 **** if (return_reg != val) ! emit_move_insn (return_reg, val); if (GET_CODE (return_reg) == REG && REGNO (return_reg) < FIRST_PSEUDO_REGISTER) --- 2186,2209 ---- if (return_reg != val) ! { ! #ifdef PROMOTE_FUNCTION_RETURN ! enum machine_mode mode = DECL_MODE (DECL_RESULT (current_function_decl)); ! tree type = TREE_TYPE (DECL_RESULT (current_function_decl)); ! int unsignedp = TREE_UNSIGNED (type); ! ! if (TREE_CODE (type) == INTEGER_TYPE || TREE_CODE (type) == ENUMERAL_TYPE ! || TREE_CODE (type) == BOOLEAN_TYPE || TREE_CODE (type) == CHAR_TYPE ! || TREE_CODE (type) == REAL_TYPE || TREE_CODE (type) == POINTER_TYPE ! || TREE_CODE (type) == OFFSET_TYPE) ! { ! PROMOTE_MODE (mode, unsignedp, type); ! } ! ! if (GET_MODE (val) != VOIDmode && GET_MODE (val) != mode) ! convert_to_mode (return_reg, val, unsignedp); ! else ! #endif ! emit_move_insn (return_reg, val); ! } if (GET_CODE (return_reg) == REG && REGNO (return_reg) < FIRST_PSEUDO_REGISTER) diff -rc2N gcc-2.3.1/texinfo.tex gcc-2.3.2/texinfo.tex *** gcc-2.3.1/texinfo.tex Sun Nov 1 03:44:45 1992 --- gcc-2.3.2/texinfo.tex Fri Nov 27 23:55:27 1992 *************** *** 23,27 **** %what you give them. Help stamp out software-hoarding! ! \def\texinfoversion{2.88} \message{Loading texinfo package [Version \texinfoversion]:} \message{} --- 23,27 ---- %what you give them. Help stamp out software-hoarding! ! \def\texinfoversion{2.89} \message{Loading texinfo package [Version \texinfoversion]:} \message{} *************** *** 1715,1719 **** \newdimen\doublecolumnhsize - \newdimen\availdimen@ \def\begindoublecolumns{\begingroup --- 1715,1718 ---- *************** *** 1750,1794 **** % since nobody clobbers \vsize.) \vsize = 2\vsize } ! \def\enddoublecolumns{\output={\balancecolumns}\eject ! \endgroup \pagegoal=\vsize} ! \def\doublecolumnout{\splittopskip=\topskip \splitmaxdepth=\maxdepth ! \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage ! \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ ! \onepageout\pagesofar \unvbox255 \penalty\outputpenalty} \def\pagesofar{\unvbox\partialpage % \hsize=\doublecolumnhsize % have to restore this since output routine - % changes it to set cropmarks (P. A. MacKay, 12 Nov. 1986) \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}} ! \def\balancecolumns{% ! % Unset the glue. ! \setbox255=\vbox{\unvbox255} ! \dimen@=\ht255 ! \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip ! \divide\dimen@ by2 ! \availdimen@=\pageheight \advance\availdimen@ by-\ht\partialpage ! % If the remaining data is too big for one page, ! % output one page normally, then work with what remains. ! \ifdim \dimen@>\availdimen@ ! { ! \splittopskip=\topskip \splitmaxdepth=\maxdepth ! \dimen@=\pageheight \advance\dimen@ by-\ht\partialpage ! \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ ! \onepageout\pagesofar ! } ! % Recompute size of what remains, in case we just output some of it. ! \dimen@=\ht255 ! \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip ! \divide\dimen@ by2 \fi ! \setbox0=\vbox{\unvbox255} ! \splittopskip=\topskip ! {\vbadness=10000 \loop \global\setbox3=\copy0 ! \global\setbox1=\vsplit3 to\dimen@ ! \ifdim\ht3>\dimen@ \global\advance\dimen@ by1pt \repeat} ! \setbox0=\vbox to\dimen@{\unvbox1} \setbox2=\vbox to\dimen@{\unvbox3} ! \pagesofar} \catcode `\@=\other --- 1749,1795 ---- % since nobody clobbers \vsize.) \vsize = 2\vsize + \doublecolumnpagegoal } ! \def\enddoublecolumns{\eject \endgroup \pagegoal=\vsize \unvbox\partialpage} ! \def\doublecolumnsplit{\splittopskip=\topskip \splitmaxdepth=\maxdepth ! \global\dimen@=\pageheight \global\advance\dimen@ by-\ht\partialpage ! \global\setbox1=\vsplit255 to\dimen@ \global\setbox0=\vbox{\unvbox1} ! \global\setbox3=\vsplit255 to\dimen@ \global\setbox2=\vbox{\unvbox3} ! \ifdim\ht0>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi ! \ifdim\ht2>\dimen@ \setbox255=\vbox{\unvbox0\unvbox2} \global\setbox255=\copy5 \fi ! } ! \def\doublecolumnpagegoal{% ! \dimen@=\vsize \advance\dimen@ by-2\ht\partialpage \global\pagegoal=\dimen@ ! } \def\pagesofar{\unvbox\partialpage % \hsize=\doublecolumnhsize % have to restore this since output routine \wd0=\hsize \wd2=\hsize \hbox to\pagewidth{\box0\hfil\box2}} ! \def\doublecolumnout{% ! \setbox5=\copy255 ! {\vbadness=10000 \doublecolumnsplit} ! \ifvbox255 ! \setbox0=\vtop to\dimen@{\unvbox0} ! \setbox2=\vtop to\dimen@{\unvbox2} ! \onepageout\pagesofar \unvbox255 \penalty\outputpenalty ! \else ! \setbox0=\vbox{\unvbox5} ! \ifvbox0 ! \dimen@=\ht0 \advance\dimen@ by\topskip \advance\dimen@ by-\baselineskip ! \divide\dimen@ by2 \splittopskip=\topskip \splitmaxdepth=\maxdepth ! {\vbadness=10000 ! \loop \global\setbox5=\copy0 ! \setbox1=\vsplit5 to\dimen@ ! \setbox3=\vsplit5 to\dimen@ ! \ifvbox5 \global\advance\dimen@ by1pt \repeat ! \setbox0=\vbox to\dimen@{\unvbox1} ! \setbox2=\vbox to\dimen@{\unvbox3} ! \global\setbox\partialpage=\vbox{\pagesofar} ! \doublecolumnpagegoal ! } ! \fi \fi ! } \catcode `\@=\other diff -rc2N gcc-2.3.1/toplev.c gcc-2.3.2/toplev.c *** gcc-2.3.1/toplev.c Fri Oct 23 05:50:36 1992 --- gcc-2.3.2/toplev.c Sun Nov 22 16:20:25 1992 *************** *** 563,569 **** /* These are for C++. */ ! "+e0", ! "+e1", ! "+e2", "-fsave-memoized", "-fno-save-memoized", --- 563,569 ---- /* These are for C++. */ ! "-+e0", /* gcc.c tacks the `-' on the front. */ ! "-+e1", ! "-+e2", "-fsave-memoized", "-fno-save-memoized", *************** *** 686,690 **** {"shadow", &warn_shadow, 1}, {"switch", &warn_switch, 1}, - {"return-type", &warn_return_type, 1}, {"aggregate-return", &warn_aggregate_return, 1}, {"cast-align", &warn_cast_align, 1}, --- 686,689 ---- *************** *** 3118,3121 **** --- 3117,3122 ---- else if (!strncmp (str, "gstabs", len)) write_symbols = DBX_DEBUG; + else if (!strncmp (str, "gstabs+", len)) + write_symbols = DBX_DEBUG; /* Always enable extensions for -ggdb or -gstabs+, *************** *** 3125,3129 **** && len >= 2) use_gnu_debug_info_extensions = 1; ! else if (write_symbols == DBX_DEBUG && !strcmp (str, "gstabs+")) use_gnu_debug_info_extensions = 1; else if (write_symbols == DBX_DEBUG --- 3126,3131 ---- && len >= 2) use_gnu_debug_info_extensions = 1; ! else if (write_symbols == DBX_DEBUG && !strncmp (str, "gstabs+", len) ! && len >= 7) use_gnu_debug_info_extensions = 1; else if (write_symbols == DBX_DEBUG diff -rc2N gcc-2.3.1/tree.def gcc-2.3.2/tree.def *** gcc-2.3.1/tree.def Tue Aug 4 21:34:39 1992 --- gcc-2.3.2/tree.def Thu Nov 12 20:54:31 1992 *************** *** 572,582 **** DEFTREECODE (REFERENCE_EXPR, "reference_expr", "e", 1) - /* A wrapper in C++. Operand 0 is the type that the wrapper - belongs to (if non-virtual). Operand 1 is the function - being wrapped. An anti-wrapper means do not wrap the function - (if it would be wrapped by default). */ - DEFTREECODE (WRAPPER_EXPR, "wrapper_expr", "e", 2) - DEFTREECODE (ANTI_WRAPPER_EXPR, "anti_wrapper_expr", "e", 2) - /* Operand is a function constant; result is a function variable value of typeEPmode. Used only for languages that need static chains. */ --- 572,575 ---- diff -rc2N gcc-2.3.1/tree.h gcc-2.3.2/tree.h *** gcc-2.3.1/tree.h Thu Oct 29 01:06:07 1992 --- gcc-2.3.2/tree.h Wed Nov 25 22:06:34 1992 *************** *** 966,969 **** --- 966,970 ---- /* Format for global names of constructor and destructor functions. */ + #ifndef CONSTRUCTOR_NAME_FORMAT /* Some machines need to override this. */ #ifndef NO_DOLLAR_IN_LABEL #define CONSTRUCTOR_NAME_FORMAT "_GLOBAL_$I$%s" *************** *** 971,974 **** --- 972,976 ---- #define CONSTRUCTOR_NAME_FORMAT "_GLOBAL_.I.%s" #endif + #endif /* The following functions accept a wide integer argument. Rather than *************** *** 1354,1357 **** --- 1356,1362 ---- extern char *(*decl_printable_name) (); + + /* In tree.c */ + extern char *perm_calloc PROTO((int, long)); /* In stmt.c */ diff -rc2N gcc-2.3.1/unroll.c gcc-2.3.2/unroll.c *** gcc-2.3.1/unroll.c Tue Oct 6 20:19:34 1992 --- gcc-2.3.2/unroll.c Mon Nov 9 14:59:02 1992 *************** *** 2798,2801 **** --- 2798,2804 ---- tem = gen_reg_rtx (bl->biv->mode); + /* Make sure loop_end is not the last insn. */ + if (NEXT_INSN (loop_end) == 0) + emit_note_after (NOTE_INSN_DELETED, loop_end); emit_iv_add_mult (increment, GEN_INT (loop_n_iterations), bl->initial_value, tem, NEXT_INSN (loop_end)); diff -rc2N gcc-2.3.1/va-alpha.h gcc-2.3.2/va-alpha.h *** gcc-2.3.1/va-alpha.h Fri Oct 9 07:27:31 1992 --- gcc-2.3.2/va-alpha.h Tue Nov 3 08:04:57 1992 *************** *** 43,46 **** --- 43,48 ---- #endif /* _STDARG_H */ + #ifndef va_end + #define va_end(__va) *************** *** 69,72 **** --- 71,76 ---- __lang_type_class }; + + #endif /* Note that parameters are always aligned at least to a word boundary diff -rc2N gcc-2.3.1/va-i860.h gcc-2.3.2/va-i860.h *** gcc-2.3.1/va-i860.h Thu Oct 8 14:22:01 1992 --- gcc-2.3.2/va-i860.h Tue Nov 3 02:56:20 1992 *************** *** 62,70 **** #endif /* _STDARG_H */ - void va_end (__gnuc_va_list); /* Defined in libgcc.a */ - #define va_end(__va) - /* Values returned by __builtin_classify_type. */ enum { __no_type_class = -1, --- 62,68 ---- #endif /* _STDARG_H */ /* Values returned by __builtin_classify_type. */ + #ifndef va_end enum { __no_type_class = -1, *************** *** 89,92 **** --- 87,94 ---- __lang_type_class }; + + void va_end (__gnuc_va_list); /* Defined in libgcc.a */ + #endif + #define va_end(__va) #define __NUM_PARM_FREGS 8 diff -rc2N gcc-2.3.1/va-i960.h gcc-2.3.2/va-i960.h *** gcc-2.3.1/va-i960.h Fri Sep 25 01:41:00 1992 --- gcc-2.3.2/va-i960.h Tue Nov 3 02:58:44 1992 *************** *** 56,60 **** --- 56,62 ---- ) + #ifndef va_end void va_end (__gnuc_va_list); /* Defined in libgcc.a */ + #endif #define va_end(AP) diff -rc2N gcc-2.3.1/va-mips.h gcc-2.3.2/va-mips.h *** gcc-2.3.1/va-mips.h Tue Sep 15 01:04:29 1992 --- gcc-2.3.2/va-mips.h Tue Nov 3 02:57:48 1992 *************** *** 43,47 **** --- 43,49 ---- #endif + #ifndef va_end void va_end (__gnuc_va_list); /* Defined in libgcc.a */ + #endif #define va_end(__AP) diff -rc2N gcc-2.3.1/va-pa.h gcc-2.3.2/va-pa.h *** gcc-2.3.1/va-pa.h Wed Oct 14 10:50:04 1992 --- gcc-2.3.2/va-pa.h Wed Nov 4 10:06:52 1992 *************** *** 39,42 **** --- 39,45 ---- (*((TYPE *) (void *) ((char *)AP + ((8 - sizeof(TYPE)) % 4)))))) + #ifndef va_end + void va_end (__gnuc_va_list); /* Defined in libgcc.a */ + #endif #define va_end(AP) diff -rc2N gcc-2.3.1/va-sparc.h gcc-2.3.2/va-sparc.h *** gcc-2.3.1/va-sparc.h Fri Sep 25 01:47:08 1992 --- gcc-2.3.2/va-sparc.h Tue Nov 3 02:48:37 1992 *************** *** 43,47 **** --- 43,49 ---- #endif + #ifndef va_end void va_end (__gnuc_va_list); /* Defined in libgcc.a */ + #endif #define va_end(pvar) diff -rc2N gcc-2.3.1/varasm.c gcc-2.3.2/varasm.c *** gcc-2.3.1/varasm.c Thu Oct 29 17:29:57 1992 --- gcc-2.3.2/varasm.c Wed Nov 4 16:45:37 1992 *************** *** 1325,1330 **** rtl_in_current_obstack (); ! CONST_DOUBLE_CHAIN (r) = const_double_chain; ! const_double_chain = r; /* Store const0_rtx in mem-slot since this CONST_DOUBLE is on the chain. --- 1325,1335 ---- rtl_in_current_obstack (); ! /* Don't touch const_double_chain in nested function; ! see force_const_mem. */ ! if (outer_function_chain == 0) ! { ! CONST_DOUBLE_CHAIN (r) = const_double_chain; ! const_double_chain = r; ! } /* Store const0_rtx in mem-slot since this CONST_DOUBLE is on the chain. *************** *** 1391,1396 **** rtl_in_current_obstack (); ! CONST_DOUBLE_CHAIN (r) = const_double_chain; ! const_double_chain = r; /* Store const0_rtx in CONST_DOUBLE_MEM since this CONST_DOUBLE is on the --- 1396,1406 ---- rtl_in_current_obstack (); ! /* Don't touch const_double_chain in nested function; ! see force_const_mem. */ ! if (outer_function_chain == 0) ! { ! CONST_DOUBLE_CHAIN (r) = const_double_chain; ! const_double_chain = r; ! } /* Store const0_rtx in CONST_DOUBLE_MEM since this CONST_DOUBLE is on the *************** *** 2167,2170 **** --- 2177,2181 ---- case SYMBOL_REF: case LABEL_REF: + case PC: value->un.addr.base = x; break; diff -rc2N gcc-2.3.1/version.c gcc-2.3.2/version.c *** gcc-2.3.1/version.c Sun Nov 1 01:55:36 1992 --- gcc-2.3.2/version.c Fri Nov 27 22:33:23 1992 *************** *** 1 **** ! char *version_string = "2.3.1"; --- 1 ---- ! char *version_string = "2.3.2";