diff options
author | Geoffrey Keating <geoffk@gcc.gnu.org> | 2003-06-10 18:32:57 +0000 |
---|---|---|
committer | Geoffrey Keating <geoffk@gcc.gnu.org> | 2003-06-10 18:32:57 +0000 |
commit | d192828ab610545ea373b5791fecbe6ba083c31d (patch) | |
tree | d2cf3b2787ee242a4fd2bb22945e77dec333dccf /gcc | |
parent | 4db8f48acab5d9a6a2dc06ed132c78820f2df326 (diff) | |
download | gcc-d192828ab610545ea373b5791fecbe6ba083c31d.zip gcc-d192828ab610545ea373b5791fecbe6ba083c31d.tar.gz gcc-d192828ab610545ea373b5791fecbe6ba083c31d.tar.bz2 |
[multiple changes]
2003-06-10 Andrew Pinski <pinskia@physics.uc.edu>
* decl.c (start_cleanup_fn): Move static 'counter' out, mark with GTY.
(start_cleanup_cnt): New.
2003-06-10 Geoffrey Keating <geoffk@apple.com>
* g++.dg/pch/static-1.C: New file.
* g++.dg/pch/static-1.Hs: New file.
From-SVN: r67719
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl.c | 5 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/pch/static-1.C | 10 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/pch/static-1.Hs | 13 |
5 files changed, 36 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 0de9c7b..155a2f1 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2003-06-10 Andrew Pinski <pinskia@physics.uc.edu> + + * decl.c (start_cleanup_fn): Move static 'counter' out, mark with GTY. + (start_cleanup_cnt): New. + 2003-06-10 Mark Mitchell <mark@codesourcery.com> PR c++/11131 diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 1807d05..1340640 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -8347,10 +8347,11 @@ get_dso_handle_node (void) /* Begin a new function with internal linkage whose job will be simply to destroy some particular variable. */ +static GTY(()) int start_cleanup_cnt; + static tree start_cleanup_fn (void) { - static int counter = 0; int old_interface_only = interface_only; int old_interface_unknown = interface_unknown; char name[32]; @@ -8377,7 +8378,7 @@ start_cleanup_fn (void) /* Build the function type itself. */ fntype = build_function_type (void_type_node, parmtypes); /* Build the name of the function. */ - sprintf (name, "__tcf_%d", counter++); + sprintf (name, "__tcf_%d", start_cleanup_cnt++); /* Build the function declaration. */ fndecl = build_lang_decl (FUNCTION_DECL, get_identifier (name), fntype); /* It's a function with internal linkage, generated by the diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f39da11..f9e8c6e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-06-10 Geoffrey Keating <geoffk@apple.com> + + * g++.dg/pch/static-1.C: New file. + * g++.dg/pch/static-1.Hs: New file. + 2003-06-10 Richard Henderson <rth@redhat.com> * gcc.dg/asm-7.c: Adjust expected warning text. diff --git a/gcc/testsuite/g++.dg/pch/static-1.C b/gcc/testsuite/g++.dg/pch/static-1.C new file mode 100644 index 0000000..21e7789 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/static-1.C @@ -0,0 +1,10 @@ +#include "static-1.H" +int LocalStaticTest() +{ + static A sa; +} + +int main(int argc, char **argv) +{ + A::StaticTest(); +} diff --git a/gcc/testsuite/g++.dg/pch/static-1.Hs b/gcc/testsuite/g++.dg/pch/static-1.Hs new file mode 100644 index 0000000..d277b78 --- /dev/null +++ b/gcc/testsuite/g++.dg/pch/static-1.Hs @@ -0,0 +1,13 @@ +class A +{ +public: + int val; + + ~A() { + int i = 2; + } + + static void StaticTest() { + static A a; + } +}; |