diff options
author | Jan Hubicka <jh@suse.cz> | 2010-03-27 12:56:30 +0100 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2010-03-27 11:56:30 +0000 |
commit | a9deb2560c097bfe2484127ee09342a128835061 (patch) | |
tree | e93283e829b9883c3a73386155f1c7dadf9e6228 /gcc/varasm.c | |
parent | 5a9c8a1bb7532b3d26f1bf69f88599852dfdd81e (diff) | |
download | gcc-a9deb2560c097bfe2484127ee09342a128835061.tar.gz |
re PR middle-end/43391 (make_decl_rtl failure for C++ on AIX and HPUX)
PR middle-end/43391
* varasm.c (make_decl_rtl): Deal with COMMON flag to make
notice_global_symbol work.
From-SVN: r157773
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index ba4e6121834..af9adffd73d 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -1435,16 +1435,19 @@ make_decl_rtl (tree decl) /* Specifying a section attribute on a variable forces it into a non-.bss section, and thus it cannot be common. */ - gcc_assert (!(TREE_CODE (decl) == VAR_DECL - && DECL_SECTION_NAME (decl) != NULL_TREE - && DECL_INITIAL (decl) == NULL_TREE - && DECL_COMMON (decl)) - || !DECL_COMMON (decl)); + /* FIXME: In general this code should not be necessary because + visibility pass is doing the same work. But notice_global_symbol + is called early and it needs to make DECL_RTL to get the name. + we take care of recomputing the DECL_RTL after visibility is changed. */ + if (TREE_CODE (decl) == VAR_DECL + && DECL_SECTION_NAME (decl) != NULL_TREE + && DECL_INITIAL (decl) == NULL_TREE + && DECL_COMMON (decl)) + DECL_COMMON (decl) = 0; /* Variables can't be both common and weak. */ - gcc_assert (TREE_CODE (decl) != VAR_DECL - || !DECL_WEAK (decl) - || !DECL_COMMON (decl)); + if (TREE_CODE (decl) == VAR_DECL && DECL_WEAK (decl)) + DECL_COMMON (decl) = 0; if (use_object_blocks_p () && use_blocks_for_decl_p (decl)) x = create_block_symbol (name, get_block_for_decl (decl), -1); |