aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2000-07-17 17:35:46 -0400
committerJason Merrill <jason@gcc.gnu.org>2000-07-17 17:35:46 -0400
commitf49fad00d9ee56c988904d2fb3e97b71ee0918d3 (patch)
tree5cfaec5acedc93cb3444bfca32da7eca809fae6d /gcc
parentc12c6a5618dd43a6d3023776d1aa7117ebfc14d8 (diff)
downloadgcc-f49fad00d9ee56c988904d2fb3e97b71ee0918d3.zip
gcc-f49fad00d9ee56c988904d2fb3e97b71ee0918d3.tar.gz
gcc-f49fad00d9ee56c988904d2fb3e97b71ee0918d3.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog15
-rw-r--r--gcc/cp/call.c7
-rw-r--r--gcc/cp/decl.c13
-rw-r--r--gcc/cp/decl2.c2
-rw-r--r--gcc/cp/exception.cc2
-rw-r--r--gcc/cp/typeck.c11
6 files changed, 29 insertions, 21 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 97c6763..6a592a4 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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.
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index 48ce6fb..4a68f57 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -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);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 1f49ae63..f8c5ff2 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -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)))
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 600cfcef..64a09c0 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -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;
diff --git a/gcc/cp/exception.cc b/gcc/cp/exception.cc
index 1ffd762..886915c 100644
--- a/gcc/cp/exception.cc
+++ b/gcc/cp/exception.cc
@@ -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? */
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index a12ebe9..c85e3d1 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -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;