Commit 9340544b by Zack Weinberg Committed by Zack Weinberg

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: r52639
parent 920f81e7
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.
......
......@@ -1338,7 +1338,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,
......@@ -1346,7 +1346,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
{
......@@ -1358,10 +1358,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;
}
......@@ -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.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment