re PR c/6300 (sparc-sun-solaris2.7 gcc-3.1 C testsuite failure in gcc.dg/cpp/charconst.c)

* c-lex.c (lex_charconst): Call convert to get constant in
	proper type; don't just smash the type field.
	Fixes PR c/6300.

	* config.gcc: Add list of obsolete configurations.  Disallow
	building these without --enable-obsolete.
	* doc/install.texi: Document --enable-obsolete and obsoletion
	policy.  Mention obsoletion of individual targets in
	appropriate places.

From-SVN: r52640
This commit is contained in:
Zack Weinberg 2002-04-22 22:26:06 +00:00 committed by Zack Weinberg
parent 1a84abfade
commit 1b727feadd
4 changed files with 211 additions and 54 deletions

View File

@ -1,3 +1,15 @@
2002-04-22 Zack Weinberg <zack@codesourcery.com>
* c-lex.c (lex_charconst): Call convert to get constant in
proper type; don't just smash the type field.
Fixes PR c/6300.
* config.gcc: Add list of obsolete configurations. Disallow
building these without --enable-obsolete.
* doc/install.texi: Document --enable-obsolete and obsoletion
policy. Mention obsoletion of individual targets in
appropriate places.
2002-04-22 Richard Henderson <rth@redhat.com>
* config/sparc/sol2-bi.h (ASM_DEBUG_SPEC): New.

View File

@ -1407,7 +1407,7 @@ lex_charconst (token)
const cpp_token *token;
{
HOST_WIDE_INT result;
tree value;
tree type, value;
unsigned int chars_seen;
result = cpp_interpret_charconst (parse_in, token, warn_multichar,
@ -1415,7 +1415,7 @@ lex_charconst (token)
if (token->type == CPP_WCHAR)
{
value = build_int_2 (result, 0);
TREE_TYPE (value) = wchar_type_node;
type = wchar_type_node;
}
else
{
@ -1427,10 +1427,24 @@ lex_charconst (token)
/* In C, a character constant has type 'int'.
In C++ 'char', but multi-char charconsts have type 'int'. */
if (c_language == clk_cplusplus && chars_seen <= 1)
TREE_TYPE (value) = char_type_node;
type = char_type_node;
else
TREE_TYPE (value) = integer_type_node;
type = integer_type_node;
}
/* cpp_interpret_charconst issues a warning if the constant
overflows, but if the number fits in HOST_WIDE_INT anyway, it
will return it un-truncated, which may cause problems down the
line. So set the type to widest_integer_literal_type, call
convert to truncate it to the proper type, then clear
TREE_OVERFLOW so we don't get a second warning.
FIXME: cpplib's assessment of overflow may not be accurate on a
platform where the final type can change at (compiler's) runtime. */
TREE_TYPE (value) = widest_integer_literal_type_node;
value = convert (type, value);
TREE_OVERFLOW (value) = 0;
return value;
}

View File

@ -207,6 +207,81 @@ gas="$gas_flag"
gnu_ld="$gnu_ld_flag"
enable_threads=$enable_threads_flag
# Obsolete configurations.
# To avoid some tedious lists, we have a blacklist with a whitelist
# embedded within it.
case $machine in
1750a-* \
| a29k-* \
| alpha*-*-osf[123]* \
| arm-*-riscix* \
| c*-convex-* \
| clipper-* \
| elxsi-* \
| i860-* \
| i?86-*-aix* \
| i?86-*-bsd* \
| i?86-*-chorusos* \
| i?86-*-dgux* \
| i?86-*-freebsd1.* \
| i?86-*-isc* \
| i?86-*-linux*oldld* \
| i?86-*-osf1* \
| i?86-*-osfrose* \
| i?86-*-rtemscoff* \
| i?86-*-sunos* \
| i?86-go32-rtems* \
| i?86-next-* \
| i?86-sequent-bsd* \
| i?86-sequent-ptx[12]* \
| i?86-sequent-sysv3* \
| m68[k0]*-*-lynxos* \
| m68[k0]*-*-rtemscoff* \
| m68[k0]*-*-sysv3* \
| m68[k0]*-altos-* \
| m68[k0]*-apollo-* \
| m68[k0]*-apple-* \
| m68[k0]*-bull-* \
| m68[k0]*-convergent-* \
| m68[k0]*-isi-* \
| m68[k0]*-next-* \
| m68[k0]*-sony-* \
| m88k-* \
| mips-*-bsd* \
| mips-*-riscos* \
| mips-*-sysv* \
| mips-*-ultrix* \
| mips-dec-* \
| mips-sgi-irix[1234]* \
| mips-sony-* \
| mips-tandem-* \
| ns32k-* \
| pj-* \
| pjl-* \
| romp-* \
| sparc-*-rtemsaout* \
| we32k-* \
)
case $machine in
a29k-*-udi | a29k-*-coff \
| mips-sni-sysv4 \
| m88k-*-aout* | m88k-*-openbsd* | m88k-*-sysv4* \
| ns32k-*-netbsd* | ns32k-*-openbsd* \
| romp-*-openbsd* \
)
# Whitelisted.
;;
*)
if test "x$enable_obsolete" = x; then
echo "*** Configuration $machine is obsolete." >&2
echo "*** Specify --enable-obsolete to build it anyway." >&2
echo "*** Support will be REMOVED in the next major release of GCC," >&2
echo "*** unless a maintainer comes forward." >&2
exit 1
fi;;
esac
esac
# Set default cpu_type, tm_file, tm_p_file and xm_file so it can be
# updated in each machine entry. Also set default extra_headers for some
# machines.

View File

@ -811,6 +811,16 @@ libiconv library files in @file{@var{dir}/lib}.
@item --with-system-zlib
Use installed zlib rather than that included with GCC@. This option
only applies if the Java front end is being built.
@item --enable-obsolete
Enable configuration for an obsoleted system. If you attempt to
configure GCC for a system (build, host, or target) which has been
obsoleted, and you do not specify this flag, configure will halt with an
error message.
All support for systems which have been obsoleted in one release of GCC
is removed entirely in the next major release, unless someone steps
forward to maintain the port.
@end table
Some options which only apply to building cross compilers:
@ -1536,9 +1546,7 @@ These lists are updated as new information becomes available.
@item
@uref{#ix86-sequent-bsd,,i?86-sequent-bsd}
@item
@uref{#ix86-sequent-ptx1*,,i?86-sequent-ptx1*, i?86-sequent-ptx2*}
@item
@uref{#ix86-*-sysv3*,,i?86-*-sysv3*}
@uref{#ix86-sequent-ptx1*,,i?86-sequent-ptx1*, i?86-sequent-ptx2*, i?86-sequent-sysv3*}
@item
@uref{#i860-intel-osf*,,i860-intel-osf*}
@item
@ -1564,7 +1572,7 @@ These lists are updated as new information becomes available.
@item
@uref{#m68k-bull-sysv,,m68k-bull-sysv}
@item
@uref{#m68k-crds-unox,,m68k-crds-unox}
@uref{#m68k-crds-unos,,m68k-crds-unos}
@item
@uref{#m68k-hp-hpux,,m68k-hp-hpux}
@item
@ -1683,7 +1691,7 @@ These lists are updated as new information becomes available.
<hr>
@end html
@heading @anchor{1750a-*-*}1750a-*-*
MIL-STD-1750A processors.
MIL-STD-1750A processors. This target is obsoleted in GCC 3.1.
The MIL-STD-1750A cross configuration produces output for
@code{as1750}, an assembler/linker available under the GNU General Public
@ -1726,10 +1734,12 @@ GCC@.
@end html
@heading @anchor{a29k}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.
applications. This configuration corresponds to AMD's standard calling
sequence and binary interface and is compatible with other 29k tools.
AMD has abandoned this processor, and most variants are obsoleted in GCC
3.1. We are preserving the a29k-*-udi and a29k-*-coff configurations
for one more release.
You may need to make a variant of the file @file{a29k.h} for your
particular configuration.
@ -1766,6 +1776,8 @@ Systems using processors that implement the DEC Alpha architecture and
are running the DEC/Compaq Unix (DEC OSF/1, Digital UNIX, or Compaq
Tru64 UNIX) operating system, for example the DEC Alpha AXP systems.
Support for versions before Tru64 UNIX V4.0 is obsoleted in GCC 3.1.
In Tru64 UNIX V5.1, Compaq introduced a new assembler that does not
currently (2001-06-13) work with @command{mips-tfile}. As a workaround,
we need to use the old assembler, invoked via the barely documented
@ -1899,6 +1911,8 @@ We require GNU binutils 2.10 or newer.
@end html
@heading @anchor{arm-*-riscix}arm-*-riscix
The ARM2 or ARM3 processor running RISC iX, Acorn's port of BSD Unix.
This configuration is obsoleted in GCC 3.1.
If you are running a version of RISC iX prior to 1.2 then you must
specify the version number during configuration. Note that the
assembler shipped with RISC iX does not support stabs debugging
@ -2053,6 +2067,8 @@ place. FreeBSD 2.2.7 has been known to bootstrap completely; however,
it is unknown which version of binutils was used (it is assumed that it
was the system copy in @file{/usr/bin}) and C++ EH failures were noted.
Support for FreeBSD 1 is obsoleted in GCC 3.1.
For FreeBSD using the ELF file format: DWARF 2 debugging is now the
default for all CPU architectures. It had been the default on
FreeBSD/alpha since its inception. You may use @option{-gstabs} instead
@ -2088,6 +2104,8 @@ Shared @file{libgcc_s.so} is now built and installed by default.
The Elxsi's C compiler has known limitations that prevent it from
compiling GCC@. Please contact @email{mrs@@wrs.com} for more details.
Support for this processor is obsoleted in GCC 3.1.
@html
</p>
<hr>
@ -2231,7 +2249,9 @@ glibc 2.2.4 whether patches for GCC 3.0 are needed. You can use glibc
@heading @anchor{ix86-*-linux*oldld}i?86-*-linux*oldld
Use this configuration to generate @file{a.out} binaries on Linux-based
GNU systems if you do not have gas/binutils version 2.5.2 or later
installed. This is an obsolete configuration.
installed.
This configuration is obsoleted in GCC 3.1.
@html
</p>
@ -2385,25 +2405,21 @@ have installed.
<hr>
@end html
@heading @anchor{ix86-*-isc}i?86-*-isc
This configuration is obsoleted in GCC 3.1.
It may be a good idea to link with GNU malloc instead of the malloc that
comes with the system.
In ISC version 4.1, @command{sed} core dumps when building
@file{deduced.h}. Use the version of @command{sed} from version 4.0.
@html
</p>
<hr>
@end html
@heading @anchor{ix86-*-esix}i?86-*-esix
It may be good idea to link with GNU malloc instead of the malloc that
comes with the system.
@html
</p>
<hr>
@end html
@heading @anchor{ix86-ibm-aix}i?86-ibm-aix
This configuration is obsoleted in GCC 3.1.
You need to use GAS version 2.1 or later, and LD from
GNU binutils version 2.2 or later.
@ -2412,30 +2428,30 @@ GNU binutils version 2.2 or later.
<hr>
@end html
@heading @anchor{ix86-sequent-bsd}i?86-sequent-bsd
This configuration is obsoleted in GCC 3.1.
Go to the Berkeley universe before compiling.
@html
</p>
<hr>
@end html
@heading @anchor{ix86-sequent-ptx1*}i?86-sequent-ptx1*, i?86-sequent-ptx2*
@heading @anchor{ix86-sequent-ptx1*}i?86-sequent-ptx1*, i?86-sequent-ptx2*, i?86-sequent-sysv3*
This configuration is obsoleted in GCC 3.1.
You must install GNU @command{sed} before running @command{configure}.
@html
</p>
<hr>
@end html
@heading @anchor{#ix86-*-sysv3*}i?86-*-sysv3*
The @code{fixproto} shell script may trigger a bug in the system shell.
If you encounter this problem, upgrade your operating system or
use @command{bash} (the GNU shell) to run @code{fixproto}.
@html
</p>
<hr>
@end html
@heading @anchor{i860-intel-osf*}i860-intel-osf*
All support for the i860 processor is obsoleted in GCC 3.1.
On the Intel Paragon (an i860 machine), if you are using operating
system version 1.0, you will get warnings or errors about redefinition
of @code{va_arg} when you build GCC@.
@ -2630,7 +2646,9 @@ applications. There are no standard Unix configurations.
<hr>
@end html
@heading @anchor{m68k-altos}m68k-altos
Altos 3068. You must use the GNU assembler, linker and debugger.
Altos 3068. This configuration is obsoleted in GCC 3.1.
You must use the GNU assembler, linker and debugger.
Also, you must fix a kernel bug.
@html
@ -2639,6 +2657,8 @@ Also, you must fix a kernel bug.
@end html
@heading @anchor{m68k-apple-aux}m68k-apple-aux
Apple Macintosh running A/UX@.
This configuration is obsoleted in GCC 3.1.
You may configure GCC to use either the system assembler and
linker or the GNU assembler and linker. You should use the GNU configuration
if you can, especially if you also want to use G++. You enable
@ -2667,7 +2687,10 @@ bootstrap. Binaries are available from the OSU-CIS archive, at
<hr>
@end html
@heading @anchor{m68k-bull-sysv}m68k-bull-sysv
Bull DPX/2 series 200 and 300 with BOS-2.00.45 up to BOS-2.01. GCC works
Bull DPX/2 series 200 and 300 with BOS-2.00.45 up to BOS-2.01.
This configuration is obsoleted in GCC 3.1.
GCC works
either with native assembler or GNU assembler. You can use
GNU assembler with native COFF generation by providing @option{--with-gnu-as} to
the configure script or use GNU assembler with stabs-in-COFF encapsulation
@ -2679,7 +2702,7 @@ assembler or for availability of the DPX/2 port of GAS, contact
</p>
<hr>
@end html
@heading @anchor{m68k-crds-unox}m68k-crds-unox
@heading @anchor{m68k-crds-unos}m68k-crds-unos
Use @samp{configure unos} for building on Unos.
The Unos assembler is named @code{casm} instead of @code{as}. For some
@ -2779,6 +2802,7 @@ to look like:
<hr>
@end html
@heading @anchor{m68k-*-nextstep*}m68k-*-nextstep*
These configurations are obsoleted in GCC 3.1.
Current GCC versions probably do not work on version 2 of the NeXT
operating system.
@ -2865,6 +2889,8 @@ It is reported that you may need the GNU assembler on this platform.
@end html
@heading @anchor{m88k-*-svr3}m88k-*-svr3
Motorola m88k running the AT&T/Unisoft/Motorola V.3 reference port.
These configurations are obsoleted in GCC 3.1.
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
@ -2881,7 +2907,10 @@ if you have one.
<hr>
@end html
@heading @anchor{m88k-*-dgux}m88k-*-dgux
Motorola m88k running DG/UX@. To build 88open BCS native or cross
Motorola m88k running DG/UX@.
These configurations are obsoleted in GCC 3.1.
To build 88open BCS native or cross
compilers on DG/UX, specify the configuration name as
@samp{m88k-*-dguxbcs} and build in the 88open BCS software development
environment. To build ELF native or cross compilers on DG/UX, specify
@ -2898,7 +2927,10 @@ configuration based on the current software development environment.
<hr>
@end html
@heading @anchor{m88k-tektronix-sysv3}m88k-tektronix-sysv3
Tektronix XD88 running UTekV 3.2e. Do not turn on
Tektronix XD88 running UTekV 3.2e.
These configurations are obsoleted in GCC 3.1.
Do not turn on
optimization while building stage1 if you bootstrap with
the buggy Green Hills compiler. Also, the bundled LAI
System V NFS is buggy so if you build in an NFS mounted
@ -2943,8 +2975,10 @@ linker unless you pass an explicit @option{-shared} or
@option{-call_shared} switch.
@heading @anchor{mips-mips-bsd}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
MIPS machines running the MIPS operating system in BSD mode.
These configurations are obsoleted in GCC 3.1.
It's possible that some old versions of the system lack the functions
@code{memcpy}, @code{memmove}, @code{memcmp}, and @code{memset}. If your
system lacks these, you must remove or undo the definition of
@code{TARGET_MEM_FUNCTIONS} in @file{mips-bsd.h}.
@ -2963,6 +2997,8 @@ compilers, you may need to add @option{-Wf,-XNg1500 -Olimit 3000}.
<hr>
@end html
@heading @anchor{mips-dec-*}mips-dec-*
These configurations are obsoleted in GCC 3.1.
MIPS-based DECstations can support three different personalities:
Ultrix, DEC OSF/1, and OSF/rose. (Alpha-based DECstation products have
a configuration name beginning with @samp{alpha*-dec}.) To configure GCC
@ -2995,6 +3031,8 @@ compilers, you may need to add @option{-Wf,-XNg1500 -Olimit 3000}.
<hr>
@end html
@heading @anchor{mips-mips-riscos*}mips-mips-riscos*
These configurations are obsoleted in GCC 3.1.
If you use the MIPS C compiler to bootstrap, it may be necessary
to increase its table size for switch statements with the
@option{-Wf,-XNg1500} option. If you use the @option{-O2}
@ -3037,6 +3075,7 @@ avoiding a linker bug.
<hr>
@end html
@heading @anchor{mips-sgi-irix4}mips-sgi-irix4
This configuration is obsoleted in GCC 3.1.
In order to compile GCC on an SGI running IRIX 4, the ``c.hdr.lib''
option must be installed from the CD-ROM supplied from Silicon Graphics.
@ -3194,17 +3233,19 @@ information about using GCC on IRIX platforms.
<hr>
@end html
@heading @anchor{mips-sony-sysv}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. In particular, the linker does not like the
code generated by GCC when shared libraries are linked in.
Sony MIPS NEWS@. This configuration is obsoleted in GCC 3.1.
This works in NEWSOS 5.0.1, but not in 5.0.2 (which uses ELF instead of
COFF)@. In particular, the linker does not like the code generated by
GCC when shared libraries are linked in.
@html
</p>
<hr>
@end html
@heading @anchor{ns32k-encore}ns32k-encore
This configuration is obsoleted in GCC 3.1.
Encore ns32000 system. Encore systems are supported only under BSD@.
@html
@ -3212,15 +3253,19 @@ Encore ns32000 system. Encore systems are supported only under BSD@.
<hr>
@end html
@heading @anchor{ns32k-*-genix}ns32k-*-genix
National Semiconductor ns32000 system. Genix has bugs in @code{alloca}
and @code{malloc}; you must get the compiled versions of these from GNU
Emacs.
National Semiconductor ns32000 system. This configuration is obsoleted
in GCC 3.1.
Genix has bugs in @code{alloca} and @code{malloc}; you must get the
compiled versions of these from GNU Emacs.
@html
</p>
<hr>
@end html
@heading @anchor{ns32k-sequent}ns32k-sequent
This configuration is obsoleted in GCC 3.1.
Go to the Berkeley universe before compiling.
@html
@ -3228,9 +3273,11 @@ Go to the Berkeley universe before compiling.
<hr>
@end html
@heading @anchor{ns32k-utek}ns32k-utek
UTEK ns32000 system (``merlin''). The C compiler that comes with this
system cannot compile GCC; contact @samp{tektronix!reed!mason} to get
binaries of GCC for bootstrapping.
UTEK ns32000 system (``merlin''). This configuration is obsoleted in
GCC 3.1.
The C compiler that comes with this system cannot compile GCC; contact
@samp{tektronix!reed!mason} to get binaries of GCC for bootstrapping.
@html
@ -3360,13 +3407,14 @@ PowerPC system in little endian mode running Windows NT@.
<hr>
@end html
@heading @anchor{romp-*-aos}romp-*-aos, romp-*-mach
The only operating systems supported for the IBM RT PC are AOS and
MACH@. GCC does not support AIX running on the RT@. We recommend you
compile GCC with an earlier version of itself; if you compile GCC
with @command{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.
These configurations are obsoleted in GCC 3.1.
We recommend you compile GCC with an earlier version of itself; if you
compile GCC with @command{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.
@html
</p>
@ -3650,6 +3698,7 @@ in some cases (for example, when @code{alloca} is used).
@heading @anchor{we32k-*-*}we32k-*-*
These computers are also known as the 3b2, 3b5, 3b20 and other similar
names. (However, the 3b1 is actually a 68000.)
These configurations are obsoleted in GCC 3.1.
Don't use @option{-g} when compiling with the system's compiler. The
system's linker seems to be unable to handle such a large program with
@ -3753,6 +3802,13 @@ has been removed from GCC 3: fx80, ns32-ns-genix, pyramid, tahoe,
gmicro, spur; most of these targets had not been updated since GCC
version 1.
We are planning to remove support for more older systems, starting in
GCC 3.1. Each release will have a list of ``obsoleted'' systems.
Support for these systems is still present in that release, but
@command{configure} will fail unless the @option{--enable-obsolete}
option is given. Unless a maintainer steps forward, support for
these systems will be removed from the next release of GCC@.
Support for older systems as targets for cross-compilation is less
problematic than support for them as hosts for GCC; if an enthusiast
wishes to make such a target work again (including resurrecting any