summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static10.C1
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/static11.C15
4 files changed, 22 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 9bb81d02fb7..10e8f691f4e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+1999-10-13 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (make_rtl_for_local_static): Don't create register RTL
+ for addressable constants.
+
1999-10-13 Nathan Sidwell <nathan@acm.org>
* cp-tree.h (build_x_va_arg): Prototype new function.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 60dac525eb5..a6a203706d5 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -7434,6 +7434,7 @@ make_rtl_for_local_static (decl)
&& ! TREE_PUBLIC (decl)
&& ! DECL_EXTERNAL (decl)
&& ! TYPE_NEEDS_DESTRUCTOR (type)
+ && ! TREE_ADDRESSABLE (decl)
&& DECL_MODE (decl) != BLKmode)
{
/* As an optimization, we try to put register-sized static
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static10.C b/gcc/testsuite/g++.old-deja/g++.other/static10.C
index 212191c5447..432e07b9aca 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/static10.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/static10.C
@@ -1,5 +1,6 @@
// Build don't link:
// Origin: Ulrich Drepper <drepper@cygnus.com>
+// Special g++ Options: -w
struct st
{
diff --git a/gcc/testsuite/g++.old-deja/g++.other/static11.C b/gcc/testsuite/g++.old-deja/g++.other/static11.C
new file mode 100644
index 00000000000..f993fd38c5e
--- /dev/null
+++ b/gcc/testsuite/g++.old-deja/g++.other/static11.C
@@ -0,0 +1,15 @@
+// Build don't link:
+// Origin: Raja R Harinath <harinath@cs.umn.edu>
+
+enum ReservedName {
+ rIGNORE,
+ rINCLUDE
+};
+
+void maybeStatusKeyword()
+{
+ static const ReservedName statusKeywords[] = { rINCLUDE, rIGNORE };
+ for (int i = 0; i < 2; i++) {
+ ReservedName r = statusKeywords[i];
+ }
+}
OpenPOWER on IntegriCloud