diff options
author | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-12 16:37:52 +0000 |
---|---|---|
committer | mmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-11-12 16:37:52 +0000 |
commit | 4c0dd8e7d3e5eefea04e601ea96489d5a01a4cfc (patch) | |
tree | 517e3e9fda4562c722cfb2ed96466fb15762390e | |
parent | 4d6fcc7a94ae52c37470ae24090b6cf838ebad53 (diff) | |
download | gcc-4c0dd8e7d3e5eefea04e601ea96489d5a01a4cfc.tar.gz |
PR c++/18416
* passes.c (rest_of_decl_compilation): Do not look at DECL_RTL
when deciding whether to pass a variable to
cgraph_varpool_finalize_decl or assemble_variable.
* toplev.c (check_global_declarations): Do not clear DECL_RTL.
PR c++/18416
* g++.dg/init/global1.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@90532 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/passes.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/init/global1.C | 16 | ||||
-rw-r--r-- | gcc/toplev.c | 7 |
5 files changed, 30 insertions, 15 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9994394b32c..371046337db 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2004-11-12 Mark Mitchell <mark@codesourcery.com> + + PR c++/18416 + * passes.c (rest_of_decl_compilation): Do not look at DECL_RTL + when deciding whether to pass a variable to + cgraph_varpool_finalize_decl or assemble_variable. + * toplev.c (check_global_declarations): Do not clear DECL_RTL. + 2004-11-12 Kazu Hirata <kazu@cs.umass.edu> * tree-vectorizer.c: Fix a comment typo. diff --git a/gcc/passes.c b/gcc/passes.c index 9a486b7b42f..e6343725804 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -229,14 +229,7 @@ rest_of_decl_compilation (tree decl, && !DECL_EXTERNAL (decl)) { if (flag_unit_at_a_time && !cgraph_global_info_ready - && TREE_CODE (decl) != FUNCTION_DECL && top_level - /* If we defer processing of decls that have had their - DECL_RTL set above (say, in make_decl_rtl), - check_global_declarations() will clear it before - assemble_variable has a chance to act on it. This - would remove all traces of the register name in a - global register variable, for example. */ - && !DECL_RTL_SET_P (decl)) + && TREE_CODE (decl) != FUNCTION_DECL && top_level) cgraph_varpool_finalize_decl (decl); else assemble_variable (decl, top_level, at_end, 0); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f04c8abaf5a..d24479bf672 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-11-12 Mark Mitchell <mark@codesourcery.com> + + PR c++/18416 + * g++.dg/init/global1.C: New test. + 2004-11-12 Eric Botcazou <ebotcazou@act-europe.fr> * gcc.c-torture/execute/20041112-1.c: New test. diff --git a/gcc/testsuite/g++.dg/init/global1.C b/gcc/testsuite/g++.dg/init/global1.C new file mode 100644 index 00000000000..21f1cac0663 --- /dev/null +++ b/gcc/testsuite/g++.dg/init/global1.C @@ -0,0 +1,16 @@ +// PR c++/18416 + +class errarg { + enum { EMPTY } type; +public: + errarg(); +}; +extern errarg empty_errarg; +extern void errprint(const char *, + const errarg &arg1 = empty_errarg, + const errarg &arg2 = empty_errarg, + const errarg &arg3 = empty_errarg); +errarg::errarg() : type(EMPTY) +{ +} +errarg empty_errarg; diff --git a/gcc/toplev.c b/gcc/toplev.c index 4ce593a462c..29ae0651426 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -819,13 +819,6 @@ check_global_declarations (tree *vec, int len) { decl = vec[i]; - if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl) - && ! TREE_ASM_WRITTEN (decl)) - /* Cancel the RTL for this decl so that, if debugging info - output for global variables is still to come, - this one will be omitted. */ - SET_DECL_RTL (decl, NULL_RTX); - /* Warn about any function declared static but not defined. We don't warn about variables, |