aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2009-02-19 22:15:12 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2009-02-19 22:15:12 +0100
commit098126222904e77a0e986d46baa99c5f91f53812 (patch)
tree6b9e0f3d522152d29df1b4e4be0bfcb62ab812a4 /gcc/cp
parent9c747b97475ae55912a172e8c94fcbe910e3f2c6 (diff)
downloadgcc-098126222904e77a0e986d46baa99c5f91f53812.zip
gcc-098126222904e77a0e986d46baa99c5f91f53812.tar.gz
gcc-098126222904e77a0e986d46baa99c5f91f53812.tar.bz2
re PR target/39175 (ICE while compiling qt-4.5.0-rc1)
PR target/39175 * c-common.c (c_determine_visibility): If visibility changed and DECL_RTL has been already set, call make_decl_rtl to update symbol flags. * decl2.c (determine_visibility): If visibility changed and DECL_RTL has been already set, call make_decl_rtl to update symbol flags. * gcc.dg/visibility-20.c: New test. * g++.dg/ext/visibility/visibility-11.C: New test. From-SVN: r144305
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/decl2.c16
2 files changed, 22 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index c766c7f..00ac24e 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,10 @@
+2009-02-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/39175
+ * decl2.c (determine_visibility): If visibility changed and
+ DECL_RTL has been already set, call make_decl_rtl to update symbol
+ flags.
+
2009-02-19 H.J. Lu <hongjiu.lu@intel.com>
PR c++/39188
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 9d33bbf..d570150 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -1,6 +1,6 @@
/* Process declarations and variables for C++ compiler.
Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009
Free Software Foundation, Inc.
Hacked by Michael Tiemann (tiemann@cygnus.com)
@@ -1922,6 +1922,8 @@ determine_visibility (tree decl)
{
tree class_type = NULL_TREE;
bool use_template;
+ bool orig_visibility_specified;
+ enum symbol_visibility orig_visibility;
/* Remember that all decls get VISIBILITY_DEFAULT when built. */
@@ -1934,6 +1936,9 @@ determine_visibility (tree decl)
maybe_clone_body. */
gcc_assert (!DECL_CLONED_FUNCTION_P (decl));
+ orig_visibility_specified = DECL_VISIBILITY_SPECIFIED (decl);
+ orig_visibility = DECL_VISIBILITY (decl);
+
if (TREE_CODE (decl) == TYPE_DECL)
{
if (CLASS_TYPE_P (TREE_TYPE (decl)))
@@ -2062,6 +2067,15 @@ determine_visibility (tree decl)
|| ! DECL_VISIBILITY_SPECIFIED (decl))
constrain_visibility (decl, tvis);
}
+
+ /* If visibility changed and DECL already has DECL_RTL, ensure
+ symbol flags are updated. */
+ if ((DECL_VISIBILITY (decl) != orig_visibility
+ || DECL_VISIBILITY_SPECIFIED (decl) != orig_visibility_specified)
+ && ((TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
+ || TREE_CODE (decl) == FUNCTION_DECL)
+ && DECL_RTL_SET_P (decl))
+ make_decl_rtl (decl);
}
/* By default, static data members and function members receive