Commit 7bab6543 by Diego Novillo

richi's fixes for c++ bootstrap

From-SVN: r160105
parent 41361b9f
......@@ -822,22 +822,26 @@ ocp_convert (tree type, tree expr, int convtype, int flags)
tree
convert_to_void (tree expr, const char *implicit, tsubst_flags_t complain)
{
tree exprv;
if (expr == error_mark_node
|| TREE_TYPE (expr) == error_mark_node)
return error_mark_node;
exprv = expr;
while (TREE_CODE (exprv) == COMPOUND_EXPR)
exprv = TREE_OPERAND (exprv, 1);
if (DECL_P (exprv) || handled_component_p (exprv))
/* Expr is not being 'used' here, otherwise we whould have
called mark_{rl}value_use use here, which would have in turn
called mark_exp_read. Rather, we call mark_exp_read directly
to avoid some warnings when
-Wunused-but-set-{variable,parameter} is in effect. */
mark_exp_read (exprv);
if (implicit == NULL)
mark_rvalue_use (expr);
else
{
tree exprv = expr;
while (TREE_CODE (exprv) == COMPOUND_EXPR)
exprv = TREE_OPERAND (exprv, 1);
if (DECL_P (exprv) || handled_component_p (exprv))
/* Expr is not being 'used' here, otherwise we whould have
called mark_{rl}value_use use here, which would have in turn
called mark_exp_read. Rather, we call mark_exp_read directly
to avoid some warnings when
-Wunused-but-set-{variable,parameter} is in effect. */
mark_exp_read (exprv);
}
if (!TREE_TYPE (expr))
return expr;
......
......@@ -4875,7 +4875,7 @@ simplify_immed_subreg (enum machine_mode outermode, rtx op,
a mistake.) */
{
unsigned byte = (elem * elem_bitsize) / BITS_PER_UNIT;
unsigned ibyte = (((num_elem - 1 - elem) * elem_bitsize)
unsigned ibyte ATTRIBUTE_UNUSED = (((num_elem - 1 - elem) * elem_bitsize)
/ BITS_PER_UNIT);
unsigned word_byte = WORDS_BIG_ENDIAN ? ibyte : byte;
unsigned subword_byte = BYTES_BIG_ENDIAN ? ibyte : byte;
......@@ -4979,7 +4979,7 @@ simplify_immed_subreg (enum machine_mode outermode, rtx op,
will already have offset 0. */
if (GET_MODE_SIZE (innermode) >= GET_MODE_SIZE (outermode))
{
unsigned ibyte = (GET_MODE_SIZE (innermode) - GET_MODE_SIZE (outermode)
unsigned ibyte ATTRIBUTE_UNUSED = (GET_MODE_SIZE (innermode) - GET_MODE_SIZE (outermode)
- byte);
unsigned word_byte = WORDS_BIG_ENDIAN ? ibyte : byte;
unsigned subword_byte = BYTES_BIG_ENDIAN ? ibyte : byte;
......@@ -5024,7 +5024,7 @@ simplify_immed_subreg (enum machine_mode outermode, rtx op,
a mistake.) */
{
unsigned byte = (elem * elem_bitsize) / BITS_PER_UNIT;
unsigned ibyte = (((num_elem - 1 - elem) * elem_bitsize)
unsigned ibyte ATTRIBUTE_UNUSED = (((num_elem - 1 - elem) * elem_bitsize)
/ BITS_PER_UNIT);
unsigned word_byte = WORDS_BIG_ENDIAN ? ibyte : byte;
unsigned subword_byte = BYTES_BIG_ENDIAN ? ibyte : byte;
......
......@@ -22,3 +22,74 @@ m4_include([../config/lib-link.m4])
m4_include([../config/lib-prefix.m4])
m4_include([../config/override.m4])
m4_include([../config/warnings.m4])
## ---------------------------------------------------------------- ##
## Checking for declared symbols. ##
## This is like *AC_CHECK_DECL*, except that for c++, we may use a ##
## prototype to check for a (possibly overloaded) function. ##
## ---------------------------------------------------------------- ##
# _AC_CHECK_PROTO_BODY
# -------------------
# Shell function body for AC_CHECK_PROTO.
m4_define([_AC_CHECK_PROTO_BODY],
[ AS_LINENO_PUSH([$[]1])
[as_decl_name=`echo $][2|sed 's/(.*//'`]
[as_decl_use=`echo $][2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`]
AC_CACHE_CHECK([whether $as_decl_name is declared], [$[]3],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([$[]4],
[@%:@ifndef $[]as_decl_name
@%:@ifdef __cplusplus
(void) $[]as_decl_use;
@%:@else
(void) $[]as_decl_name;
@%:@endif
@%:@endif
])],
[AS_VAR_SET([$[]3], [yes])],
[AS_VAR_SET([$[]3], [no])])])
AS_LINENO_POP
])# _AC_CHECK_PROTO_BODY
# AC_CHECK_PROTO(SYMBOL,
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
# [INCLUDES = DEFAULT-INCLUDES])
# -------------------------------------------------------
# Check whether SYMBOL (a function, variable, or constant) is declared.
AC_DEFUN([AC_CHECK_PROTO],
[AC_REQUIRE_SHELL_FN([ac_fn_]_AC_LANG_ABBREV[_check_proto],
[AS_FUNCTION_DESCRIBE([ac_fn_]_AC_LANG_ABBREV[_check_proto],
[LINENO SYMBOL VAR],
[Tests whether SYMBOL is declared, setting cache variable VAR accordingly.])],
[_$0_BODY])]dnl
[AS_VAR_PUSHDEF([ac_Symbol], [ac_cv_have_decl_$1])]dnl
[ac_fn_[]_AC_LANG_ABBREV[]_check_proto ]dnl
["$LINENO" "$1" "ac_Symbol" "AS_ESCAPE([AC_INCLUDES_DEFAULT([$4])], [""])"
AS_VAR_IF([ac_Symbol], [yes], [$2], [$3])
AS_VAR_POPDEF([ac_Symbol])dnl
])# AC_CHECK_PROTO
# _AC_CHECK_PROTOS(SYMBOL, ACTION-IF_FOUND, ACTION-IF-NOT-FOUND,
# INCLUDES)
# -------------------------------------------------------------
# Helper to AC_CHECK_PROTOS, which generates the check for a single
# SYMBOL with INCLUDES, performs the AC_DEFINE, then expands
# ACTION-IF-FOUND or ACTION-IF-NOT-FOUND.
m4_define([_AC_CHECK_PROTOS],
[AC_CHECK_PROTO([$1], [ac_have_decl=1], [ac_have_decl=0], [$4])]dnl
[AC_DEFINE_UNQUOTED(AS_TR_CPP(patsubst(HAVE_DECL_[$1],[(.*])), [$ac_have_decl],
[Define to 1 if you have the declaration of `$1',
and to 0 if you don't.])]dnl
[m4_ifvaln([$2$3], [AS_IF([test $ac_have_decl = 1], [$2], [$3])])])
# AC_CHECK_PROTOS(SYMBOLS,
# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND],
# [INCLUDES = DEFAULT-INCLUDES])
# --------------------------------------------------------
# Defines HAVE_DECL_SYMBOL to 1 if declared, 0 otherwise. See the
# documentation for a detailed explanation of this difference with
# other AC_CHECK_*S macros. SYMBOLS is an m4 list.
AC_DEFUN([AC_CHECK_PROTOS],
[m4_map_args_sep([_$0(], [, [$2], [$3], [$4])], [], $1)])
......@@ -81,8 +81,8 @@ define(libcpp_UNLOCKED_FUNCS, clearerr_unlocked feof_unlocked dnl
fread_unlocked fwrite_unlocked getchar_unlocked getc_unlocked dnl
putchar_unlocked putc_unlocked)
AC_CHECK_FUNCS(libcpp_UNLOCKED_FUNCS)
AC_CHECK_DECLS(m4_split(m4_normalize(abort asprintf basename errno getopt \
libcpp_UNLOCKED_FUNCS vasprintf)))
AC_CHECK_PROTOS(m4_split(m4_normalize(abort asprintf basename(char*) errno \
getopt libcpp_UNLOCKED_FUNCS vasprintf)))
# Checks for library functions.
AC_FUNC_ALLOCA
......
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