]> gcc.gnu.org Git - gcc.git/commitdiff
decl2.c (constrain_visibility): Clear WEAK and COMMON flags.
authorJan Hubicka <jh@suse.cz>
Thu, 12 Nov 2009 06:50:19 +0000 (07:50 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Thu, 12 Nov 2009 06:50:19 +0000 (06:50 +0000)
* decl2.c (constrain_visibility): Clear WEAK and COMMON flags.

* ipa.c (function_and_variable_visibility): Verify that WEAK || COMMON
imply PUBLIC || EXTERNAL.

From-SVN: r154115

gcc/ChangeLog
gcc/cp/ChangeLog
gcc/cp/decl2.c
gcc/ipa.c

index 7ec401bc0be91e09774dcbf6276115a23490c6f2..4c45b70fe469b6f10f424d79d956ca34630f4dfd 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-12  Jan Hubicka  <jh@suse.cz>
+
+       * ipa.c (function_and_variable_visibility): Verify that WEAK || COMMON
+       imply PUBLIC || EXTERNAL.
+
 2009-11-11  Andy Hutchinson  <hutchinsonandy@gcc.gnu.org>
 
        PR middle-end/41440
index 355cf9969123f464d8189e2721d89f2d8d75e6cc..9a28a4960eda652dcf403842e6afbc08c879854f 100644 (file)
@@ -1,3 +1,7 @@
+2009-11-12  Jan Hubicka  <jh@suse.cz>
+
+       * decl2.c (constrain_visibility): Clear WEAK and COMMON flags.
+
 2009-11-11  Jason Merrill  <jason@redhat.com>
 
        PR c++/39131
index ba987f7888c0ca4d82be2da9913d5fed6f9662bc..510aa8faec1c5a1bc2443f18480dee55ea02b518 100644 (file)
@@ -1883,6 +1883,8 @@ constrain_visibility (tree decl, int visibility)
       if (!DECL_EXTERN_C_P (decl))
        {
          TREE_PUBLIC (decl) = 0;
+         DECL_WEAK (decl) = 0;
+         DECL_COMMON (decl) = 0;
          DECL_COMDAT_GROUP (decl) = NULL_TREE;
          DECL_INTERFACE_KNOWN (decl) = 1;
          if (DECL_LANG_SPECIFIC (decl))
index 1e5f22c8bf439750d66dcfd8c692820072369340..4297ea2f46fa7b7d624ac8da0dde4c9d087c0450 100644 (file)
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -292,6 +292,7 @@ function_and_variable_visibility (bool whole_program)
 
   for (node = cgraph_nodes; node; node = node->next)
     {
+      gcc_assert (!DECL_WEAK (node->decl) || TREE_PUBLIC (node->decl) || DECL_EXTERNAL (node->decl));
       if (cgraph_externally_visible_p (node, whole_program))
         {
          gcc_assert (!node->global.inlined_to);
@@ -316,6 +317,8 @@ function_and_variable_visibility (bool whole_program)
     {
       if (!vnode->finalized)
         continue;
+      gcc_assert ((!DECL_WEAK (vnode->decl) || DECL_COMMON (vnode->decl))
+                 || TREE_PUBLIC (vnode->decl) || DECL_EXTERNAL (node->decl));
       if (vnode->needed
          && (DECL_COMDAT (vnode->decl) || TREE_PUBLIC (vnode->decl))
          && (!whole_program
This page took 0.101022 seconds and 5 git commands to generate.