typeck.c (mark_addressable): Never set TREE_USED.

* typeck.c (mark_addressable): Never set TREE_USED.
        * call.c (build_call): Don't abort on calls to library functions
        that have been declared normally.

        * typeck.c (build_binary_op): Fix grammar in warning.

        * exception.cc (__eh_free): Fix prototype.

        * decl2.c (finish_decl_parsing): Handle TEMPLATE_ID_EXPR.

        * decl.c (pushdecl): Handle seeing an OVERLOAD in
        IDENTIFIER_NAMESPACE_VALUE.

From-SVN: r35104
This commit is contained in:
Jason Merrill 2000-07-17 17:35:46 -04:00 committed by Jason Merrill
parent c12c6a5618
commit f49fad00d9
6 changed files with 29 additions and 21 deletions

View File

@ -1,3 +1,18 @@
2000-07-17 Jason Merrill <jason@redhat.com>
* typeck.c (mark_addressable): Never set TREE_USED.
* call.c (build_call): Don't abort on calls to library functions
that have been declared normally.
* typeck.c (build_binary_op): Fix grammar in warning.
* exception.cc (__eh_free): Fix prototype.
* decl2.c (finish_decl_parsing): Handle TEMPLATE_ID_EXPR.
* decl.c (pushdecl): Handle seeing an OVERLOAD in
IDENTIFIER_NAMESPACE_VALUE.
2000-07-14 Zack Weinberg <zack@wolery.cumb.org>
* .cvsignore: parse.h and parse.c have no cp- prefix.

View File

@ -397,8 +397,11 @@ build_call (function, parms)
if (decl && ! TREE_USED (decl))
{
/* We invoke build_call directly for several library functions. */
if (DECL_ARTIFICIAL (decl))
/* We invoke build_call directly for several library functions.
These may have been declared normally if we're building libgcc,
so we can't just check DECL_ARTIFICIAL. */
if (DECL_ARTIFICIAL (decl)
|| !strncmp (IDENTIFIER_POINTER (DECL_NAME (decl)), "__", 2))
mark_used (decl);
else
my_friendly_abort (990125);

View File

@ -4019,15 +4019,12 @@ pushdecl (x)
{
tree decl;
if (IDENTIFIER_NAMESPACE_VALUE (name) != NULL_TREE
&& IDENTIFIER_NAMESPACE_VALUE (name) != error_mark_node
&& (DECL_EXTERNAL (IDENTIFIER_NAMESPACE_VALUE (name))
|| TREE_PUBLIC (IDENTIFIER_NAMESPACE_VALUE (name))))
decl = IDENTIFIER_NAMESPACE_VALUE (name);
else
decl = NULL_TREE;
decl = IDENTIFIER_NAMESPACE_VALUE (name);
if (decl && TREE_CODE (decl) == OVERLOAD)
decl = OVL_FUNCTION (decl);
if (decl
if (decl && decl != error_mark_node
&& (DECL_EXTERNAL (decl) || TREE_PUBLIC (decl))
/* If different sort of thing, we already gave an error. */
&& TREE_CODE (decl) == TREE_CODE (x)
&& !same_type_p (TREE_TYPE (x), TREE_TYPE (decl)))

View File

@ -4310,6 +4310,8 @@ finish_decl_parsing (decl)
/* For attribute handling. */
TREE_VALUE (decl) = finish_decl_parsing (TREE_VALUE (decl));
return decl;
case TEMPLATE_ID_EXPR:
return decl;
default:
my_friendly_abort (5);
return NULL_TREE;

View File

@ -120,7 +120,7 @@ extern "C" cp_eh_info **__get_eh_info (); // actually void **
/* Exception allocate and free, defined in libgcc2. */
extern "C" void *__eh_alloc(size_t);
extern "C" void __eh_free();
extern "C" void __eh_free(void *);
/* Is P the type_info node for a pointer of some kind? */

View File

@ -3963,7 +3963,7 @@ build_binary_op (code, orig_op0, orig_op1, convert_p)
signed_type (result_type)))))
/* OK */;
else
warning ("comparison between a signed and an unsigned integer expressions");
warning ("comparison between signed and unsigned integer expressions");
/* Warn if two unsigned values are being compared in a size
larger than their original size, and one (and only one) is the
@ -4969,21 +4969,12 @@ mark_addressable (exp)
cp_warning ("address requested for `%D', which is declared `register'",
x);
TREE_ADDRESSABLE (x) = 1;
TREE_USED (x) = 1;
if (cfun && expanding_p)
put_var_into_stack (x);
return 1;
case FUNCTION_DECL:
/* We have to test both conditions here. The first may be
non-zero in the case of processing a default function. The
second may be non-zero in the case of a template function. */
if (DECL_LANG_SPECIFIC (x)
&& DECL_TEMPLATE_INFO (x)
&& !DECL_TEMPLATE_SPECIALIZATION (x))
mark_used (x);
TREE_ADDRESSABLE (x) = 1;
TREE_USED (x) = 1;
TREE_ADDRESSABLE (DECL_ASSEMBLER_NAME (x)) = 1;
return 1;