From 1f1479dc91216e63870c59ad48fdbb0b1c060d82 Mon Sep 17 00:00:00 2001 From: Mark Mitchell 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. * decl.c (make_rtl_for_local_static): Don't create register RTL for addressable constants. From-SVN: r29945 --- 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 9bb81d0..10e8f69 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 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 +// 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 + +enum ReservedName { + rIGNORE, + rINCLUDE +}; + +void maybeStatusKeyword() +{ + static const ReservedName statusKeywords[] = { rINCLUDE, rIGNORE }; + for (int i = 0; i < 2; i++) { + ReservedName r = statusKeywords[i]; + } +} -- 2.7.4