decl.c (make_rtl_for_local_static): Don't create register RTL for addressable constants.
authorMark Mitchell <mark@codesourcery.com>
Wed, 13 Oct 1999 16:13:25 +0000 (16:13 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Wed, 13 Oct 1999 16:13:25 +0000 (16:13 +0000)
* decl.c (make_rtl_for_local_static): Don't create register RTL
for addressable constants.

From-SVN: r29945

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/g++.old-deja/g++.other/static10.C
gcc/testsuite/g++.old-deja/g++.other/static11.C [new file with mode: 0644]

index 9bb81d02fb77960b026cfdf481adc144c1264c7b..10e8f691f4e882071732c1dcff8c802c986ee92f 100644 (file)
@@ -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.
index 60dac525eb526111bd107c9a9045d3f7bb5ffa0a..a6a203706d50104767184a770addadad73b992f1 100644 (file)
@@ -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
index 212191c5447cee2cac3f46bb7ccae7e858dc1e0c..432e07b9aca3a867403b5eb54a487502baeb211e 100644 (file)
@@ -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 (file)
index 0000000..f993fd3
--- /dev/null
@@ -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];
+  }
+}