From 3459bb21384e65c9e01d24a56fc6f1f554293671 Mon Sep 17 00:00:00 2001 From: mmitchel Date: Wed, 13 Oct 1999 16:13:25 +0000 Subject: [PATCH] * decl.c (make_rtl_for_local_static): Don't create register RTL for addressable constants. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29945 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/decl.c | 1 + gcc/testsuite/g++.old-deja/g++.other/static10.C | 1 + gcc/testsuite/g++.old-deja/g++.other/static11.C | 15 +++++++++++++++ 4 files changed, 22 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.other/static11.C 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 + + * decl.c (make_rtl_for_local_static): Don't create register RTL + for addressable constants. + 1999-10-13 Nathan Sidwell * 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 +// 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 + +enum ReservedName { + rIGNORE, + rINCLUDE +}; + +void maybeStatusKeyword() +{ + static const ReservedName statusKeywords[] = { rINCLUDE, rIGNORE }; + for (int i = 0; i < 2; i++) { + ReservedName r = statusKeywords[i]; + } +} -- 2.11.4.GIT