diff options
author | Jakub Jelinek <jakub@redhat.com> | 2009-02-19 22:15:12 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2009-02-19 22:15:12 +0100 |
commit | 098126222904e77a0e986d46baa99c5f91f53812 (patch) | |
tree | 6b9e0f3d522152d29df1b4e4be0bfcb62ab812a4 /gcc/c-common.c | |
parent | 9c747b97475ae55912a172e8c94fcbe910e3f2c6 (diff) | |
download | gcc-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/c-common.c')
-rw-r--r-- | gcc/c-common.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gcc/c-common.c b/gcc/c-common.c index e7b90674..f19976b 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -1,6 +1,7 @@ /* Subroutines shared by all languages that are variants of C. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, - 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. + 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + Free Software Foundation, Inc. This file is part of GCC. @@ -6249,8 +6250,18 @@ c_determine_visibility (tree decl) visibility_specified depending on #pragma GCC visibility. */ if (!DECL_VISIBILITY_SPECIFIED (decl)) { - DECL_VISIBILITY (decl) = default_visibility; - DECL_VISIBILITY_SPECIFIED (decl) = visibility_options.inpragma; + if (visibility_options.inpragma + || DECL_VISIBILITY (decl) != default_visibility) + { + DECL_VISIBILITY (decl) = default_visibility; + DECL_VISIBILITY_SPECIFIED (decl) = visibility_options.inpragma; + /* If visibility changed and DECL already has DECL_RTL, ensure + symbol flags are updated. */ + if (((TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl)) + || TREE_CODE (decl) == FUNCTION_DECL) + && DECL_RTL_SET_P (decl)) + make_decl_rtl (decl); + } } return false; } |