mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-23 05:19:14 +08:00
re PR c++/31806 (miscompilation with -fschedule-insns2 -fno-threadsafe-statics)
PR c++/31806 * decl.c (cp_finish_decl): Also clear was_readonly if a static var needs runtime initialization. From-SVN: r125229
This commit is contained in:
parent
2664efb66b
commit
3273551821
@ -1,3 +1,9 @@
|
||||
2007-05-31 Jakub Jelinek <jakub@redhat.com>
|
||||
|
||||
PR c++/31806
|
||||
* decl.c (cp_finish_decl): Also clear was_readonly if a static var
|
||||
needs runtime initialization.
|
||||
|
||||
2007-05-31 Paolo Carlini <pcarlini@suse.de>
|
||||
|
||||
PR c++/32158
|
||||
|
@ -5361,8 +5361,12 @@ cp_finish_decl (tree decl, tree init, bool init_const_expr_p,
|
||||
/* If a TREE_READONLY variable needs initialization
|
||||
at runtime, it is no longer readonly and we need to
|
||||
avoid MEM_READONLY_P being set on RTL created for it. */
|
||||
if (init && TREE_READONLY (decl))
|
||||
TREE_READONLY (decl) = 0;
|
||||
if (init)
|
||||
{
|
||||
if (TREE_READONLY (decl))
|
||||
TREE_READONLY (decl) = 0;
|
||||
was_readonly = 0;
|
||||
}
|
||||
expand_static_init (decl, init);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user