aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>1999-10-13 16:13:25 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>1999-10-13 16:13:25 +0000
commit1f1479dc91216e63870c59ad48fdbb0b1c060d82 (patch)
tree7dc1aa875c16a04ad7f2916c6b5181f6188202fc /gcc
parentce74b7d6e8d6a34aaa8ac19dec9951c61d1454b9 (diff)
downloadgcc-1f1479dc91216e63870c59ad48fdbb0b1c060d82.zip
gcc-1f1479dc91216e63870c59ad48fdbb0b1c060d82.tar.gz
gcc-1f1479dc91216e63870c59ad48fdbb0b1c060d82.tar.bz2
decl.c (make_rtl_for_local_static): Don't create register RTL for addressable constants.
* decl.c (make_rtl_for_local_static): Don't create register RTL for addressable constants. From-SVN: r29945
Diffstat (limited to 'gcc')
-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 9bb81d0..10e8f69 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 60dac52..a6a2037 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 212191c..432e07b 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 0000000..f993fd3
--- /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];
+ }
+}