public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61825] [4.10 regression] g++.dg/cpp0x/static_assert9.C FAILs
  2014-07-17 12:23 [Bug c++/61825] New: [4.10 regression] g++.dg/cpp0x/static_assert9.C FAILs ro at gcc dot gnu.org
@ 2014-07-17 12:23 ` ro at gcc dot gnu.org
  2014-07-17 23:09 ` hp at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ro at gcc dot gnu.org @ 2014-07-17 12:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61825

Rainer Orth <ro at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.10.0


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c++/61825] New: [4.10 regression] g++.dg/cpp0x/static_assert9.C FAILs
@ 2014-07-17 12:23 ro at gcc dot gnu.org
  2014-07-17 12:23 ` [Bug c++/61825] " ro at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: ro at gcc dot gnu.org @ 2014-07-17 12:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61825

            Bug ID: 61825
           Summary: [4.10 regression] g++.dg/cpp0x/static_assert9.C FAILs
           Product: gcc
           Version: 4.10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ro at gcc dot gnu.org
              Host: i386-pc-solaris2.11, sparc-sun-solaris2.11,
                    x86_64-unknown-linux-gnu
            Target: i386-pc-solaris2.11, sparc-sun-solaris2.11,
                    x86_64-unknown-linux-gnu
             Build: i386-pc-solaris2.11, sparc-sun-solaris2.11,
                    x86_64-unknown-linux-gnu

Between 20140711 and 20140716, the ++.dg/cpp0x/static_assert9.C testcase start
to FAIL on at least Solaris/x86, Solaris/SPARC, and Linux/x86:

FAIL: g++.dg/cpp0x/static_assert9.C  -std=c++11 (test for excess errors)
FAIL: g++.dg/cpp0x/static_assert9.C  -std=c++1y (test for excess errors)

Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/cpp0x/static_assert9.C:5:1:
error: non-constant condition for static assertion
/vol/gcc/src/hg/trunk/local/gcc/testsuite/g++.dg/cpp0x/static_assert9.C:5:1:
error: '(f != 0u)' is not a constant expression

This is a regression from 4.9.

  Rainer


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c++/61825] [4.10 regression] g++.dg/cpp0x/static_assert9.C FAILs
  2014-07-17 12:23 [Bug c++/61825] New: [4.10 regression] g++.dg/cpp0x/static_assert9.C FAILs ro at gcc dot gnu.org
  2014-07-17 12:23 ` [Bug c++/61825] " ro at gcc dot gnu.org
@ 2014-07-17 23:09 ` hp at gcc dot gnu.org
  2014-08-24 15:24 ` [Bug c++/61825] [5 " danglin at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hp at gcc dot gnu.org @ 2014-07-17 23:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61825

Hans-Peter Nilsson <hp at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|i386-pc-solaris2.11,        |i386-pc-solaris2.11,
                   |sparc-sun-solaris2.11,      |sparc-sun-solaris2.11,
                   |x86_64-unknown-linux-gnu    |x86_64-unknown-linux-gnu,
                   |                            |cris-elf
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-07-17
                 CC|                            |hp at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
cris-elf too, appearing in the svn revision interval (212498:212499].
I think I noticed some traffic and perhaps a patch go by but maybe that
stalled; it's still there at r212759.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c++/61825] [5 regression] g++.dg/cpp0x/static_assert9.C FAILs
  2014-07-17 12:23 [Bug c++/61825] New: [4.10 regression] g++.dg/cpp0x/static_assert9.C FAILs ro at gcc dot gnu.org
  2014-07-17 12:23 ` [Bug c++/61825] " ro at gcc dot gnu.org
  2014-07-17 23:09 ` hp at gcc dot gnu.org
@ 2014-08-24 15:24 ` danglin at gcc dot gnu.org
  2014-08-25  9:45 ` amker at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: danglin at gcc dot gnu.org @ 2014-08-24 15:24 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61825

John David Anglin <danglin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |danglin at gcc dot gnu.org

--- Comment #2 from John David Anglin <danglin at gcc dot gnu.org> ---
Also seen on hppa2.0w-hp-hpux11.11.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c++/61825] [5 regression] g++.dg/cpp0x/static_assert9.C FAILs
  2014-07-17 12:23 [Bug c++/61825] New: [4.10 regression] g++.dg/cpp0x/static_assert9.C FAILs ro at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-08-24 15:24 ` [Bug c++/61825] [5 " danglin at gcc dot gnu.org
@ 2014-08-25  9:45 ` amker at gcc dot gnu.org
  2014-08-26  9:41 ` dominiq at lps dot ens.fr
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: amker at gcc dot gnu.org @ 2014-08-25  9:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61825

amker at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amker at gcc dot gnu.org

--- Comment #3 from amker at gcc dot gnu.org ---
Also on aarch64/arm, both linux and elf tool-chains.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c++/61825] [5 regression] g++.dg/cpp0x/static_assert9.C FAILs
  2014-07-17 12:23 [Bug c++/61825] New: [4.10 regression] g++.dg/cpp0x/static_assert9.C FAILs ro at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-08-25  9:45 ` amker at gcc dot gnu.org
@ 2014-08-26  9:41 ` dominiq at lps dot ens.fr
  2014-09-08 14:42 ` ro at CeBiTec dot Uni-Bielefeld.DE
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-08-26  9:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61825

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu.org

--- Comment #4 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Also seen on *86*-*-*. From
https://gcc.gnu.org/ml/gcc-regression/2014-07/msg00218.html the test has
started to fail at revision r212499.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c++/61825] [5 regression] g++.dg/cpp0x/static_assert9.C FAILs
  2014-07-17 12:23 [Bug c++/61825] New: [4.10 regression] g++.dg/cpp0x/static_assert9.C FAILs ro at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2014-08-26  9:41 ` dominiq at lps dot ens.fr
@ 2014-09-08 14:42 ` ro at CeBiTec dot Uni-Bielefeld.DE
  2014-09-09  1:46 ` hubicka at ucw dot cz
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ro at CeBiTec dot Uni-Bielefeld.DE @ 2014-09-08 14:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61825

--- Comment #5 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> ---
Honza,

you meant to prepare a patch in July already

    https://gcc.gnu.org/ml/gcc-patches/2014-07/msg00985.html

but nothing has happened since.  Could you please get to this soon?
This regression is causing testsuite noise for two months now.

Thanks.
        Rainer


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c++/61825] [5 regression] g++.dg/cpp0x/static_assert9.C FAILs
  2014-07-17 12:23 [Bug c++/61825] New: [4.10 regression] g++.dg/cpp0x/static_assert9.C FAILs ro at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2014-09-08 14:42 ` ro at CeBiTec dot Uni-Bielefeld.DE
@ 2014-09-09  1:46 ` hubicka at ucw dot cz
  2014-09-19 22:49 ` hubicka at ucw dot cz
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hubicka at ucw dot cz @ 2014-09-09  1:46 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61825

--- Comment #6 from Jan Hubicka <hubicka at ucw dot cz> ---
Hi,
sorry for the delay, the problem is that I do not feel good about putting back
the old code from fold-const, since it simply does not make sense.  I need to
dive into the C++ standard what it says about this particular case and how that
corelate with our weak and visibility attributes.  I will try to find time for
that this week.

Honza


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c++/61825] [5 regression] g++.dg/cpp0x/static_assert9.C FAILs
  2014-07-17 12:23 [Bug c++/61825] New: [4.10 regression] g++.dg/cpp0x/static_assert9.C FAILs ro at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2014-09-09  1:46 ` hubicka at ucw dot cz
@ 2014-09-19 22:49 ` hubicka at ucw dot cz
  2014-09-19 23:57 ` hubicka at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: hubicka at ucw dot cz @ 2014-09-19 22:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61825

--- Comment #7 from Jan Hubicka <hubicka at ucw dot cz> ---
Hi,
this patch implements necessary bits to record what symbols was declared
nonzero and refuse visibility changes that would change the difference
(i.e. turn it into alias, weakref or weak). Possibly we will want to check
more but those are ones I can think of.


Index: c-family/c-common.c
===================================================================
--- c-family/c-common.c    (revision 215401)
+++ c-family/c-common.c    (working copy)
@@ -7694,6 +7694,15 @@ handle_alias_ifunc_attribute (bool is_al
 {
   tree decl = *node;

+  struct symtab_node *n = symtab_node::get (decl);
+  if (n && n->refuse_visibility_changes)
+    {
+      if (is_alias)
+        error ("%+D declared alias after being used", decl);
+      else
+        error ("%+D declared ifunc after being used", decl);
+    }
+
   if (TREE_CODE (decl) != FUNCTION_DECL
       && (!is_alias || TREE_CODE (decl) != VAR_DECL))
     {
@@ -7808,6 +7817,10 @@ handle_weakref_attribute (tree *node, tr
       return NULL_TREE;
     }

+  struct symtab_node *n = symtab_node::get (*node);
+  if (n && n->refuse_visibility_changes)
+    error ("%+D declared weakref after being used", *node);
+
   /* The idea here is that `weakref("name")' mutates into `weakref,
      alias("name")', and weakref without arguments, in turn,
      implicitly adds weak. */
Index: cgraph.h
===================================================================
--- cgraph.h    (revision 215401)
+++ cgraph.h    (working copy)
@@ -346,6 +346,10 @@ public:
     return decl->decl_with_vis.symtab_node;
   }

+  /* Try to find a symtab node for declaration DECL and if it does not
+     exist or if it corresponds to an inline clone, create a new one.  */
+  static inline symtab_node * get_create (tree node);
+
   /* Return the cgraph node that has ASMNAME for its DECL_ASSEMBLER_NAME.
      Return NULL if there's no such node.  */
   static symtab_node *get_for_asmname (const_tree asmname);
@@ -394,7 +398,9 @@ public:
   unsigned analyzed : 1;
   /* Set for write-only variables.  */
   unsigned writeonly : 1;
-
+  /* Visibility of symbol was used for further optimization; do not
+     permit further changes.  */
+  unsigned refuse_visibility_changes : 1;

   /*** Visibility and linkage flags.  ***/

@@ -2519,4 +2525,12 @@ cgraph_node::mark_force_output (void)
   gcc_checking_assert (!global.inlined_to);
 }

+inline symtab_node * symtab_node::get_create (tree node)
+{
+  if (TREE_CODE (node) == VAR_DECL)
+    return varpool_node::get_create (node);
+  else
+    return cgraph_node::get_create (node);
+}
+
 #endif  /* GCC_CGRAPH_H  */
Index: fold-const.c
===================================================================
--- fold-const.c    (revision 215401)
+++ fold-const.c    (working copy)
@@ -15850,7 +15850,7 @@ tree_single_nonzero_warnv_p (tree t, boo
       {
         struct symtab_node *symbol;

-        symbol = symtab_node::get (base);
+        symbol = symtab_node::get_create (base);
         if (symbol)
           return symbol->nonzero_address ();
         else
Index: varasm.c
===================================================================
--- varasm.c    (revision 215401)
+++ varasm.c    (working copy)
@@ -5230,6 +5230,12 @@ output_constructor (tree exp, unsigned H
 static void
 mark_weak (tree decl)
 {
+  if (DECL_WEAK (decl))
+    return;
+
+  struct symtab_node *n = symtab_node::get (decl);
+  if (n && n->refuse_visibility_changes)
+    error ("%+D declared weak after being used", decl);
   DECL_WEAK (decl) = 1;

   if (DECL_RTL_SET_P (decl)
Index: symtab.c
===================================================================
--- symtab.c    (revision 215401)
+++ symtab.c    (working copy)
@@ -1811,9 +1811,9 @@ bool
 symtab_node::nonzero_address ()
 {
   /* Weakrefs may be NULL when their target is not defined.  */
-  if (this->alias && this->weakref)
+  if (alias && weakref)
     {
-      if (this->analyzed)
+      if (analyzed)
     {
       symtab_node *target = ultimate_alias_target ();

@@ -1828,7 +1828,7 @@ symtab_node::nonzero_address ()
          could be useful to eliminate the NULL pointer checks in LTO
          programs.  */
       if (target->definition && !DECL_EXTERNAL (target->decl))
-        return true;
+          return true;
       if (target->resolution != LDPR_UNKNOWN
           && target->resolution != LDPR_UNDEF
           && flag_delete_null_pointer_checks)
@@ -1847,22 +1847,28 @@ symtab_node::nonzero_address ()
      Those are handled by later check for definition.

      When parsing, beware the cases when WEAK attribute is added later.  */
-  if (!DECL_WEAK (this->decl)
-      && flag_delete_null_pointer_checks
-      && symtab->state > PARSING)
-    return true;
+  if (!DECL_WEAK (decl)
+      && flag_delete_null_pointer_checks)
+    {
+      refuse_visibility_changes = true;
+      return true;
+    }

   /* If target is defined and not extern, we know it will be output and thus
      it will bind to non-NULL.
      Play safe for flag_delete_null_pointer_checks where weak definition maye
      be re-defined by NULL.  */
-  if (this->definition && !DECL_EXTERNAL (this->decl)
-      && (flag_delete_null_pointer_checks || !DECL_WEAK (this->decl)))
-    return true;
+  if (definition && !DECL_EXTERNAL (decl)
+      && (flag_delete_null_pointer_checks || !DECL_WEAK (decl)))
+    {
+      if (!DECL_WEAK (decl))
+        refuse_visibility_changes = true;
+      return true;
+    }

   /* As the last resort, check the resolution info.  */
-  if (this->resolution != LDPR_UNKNOWN
-      && this->resolution != LDPR_UNDEF
+  if (resolution != LDPR_UNKNOWN
+      && resolution != LDPR_UNDEF
       && flag_delete_null_pointer_checks)
     return true;
   return false;


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c++/61825] [5 regression] g++.dg/cpp0x/static_assert9.C FAILs
  2014-07-17 12:23 [Bug c++/61825] New: [4.10 regression] g++.dg/cpp0x/static_assert9.C FAILs ro at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2014-09-19 22:49 ` hubicka at ucw dot cz
@ 2014-09-19 23:57 ` hubicka at gcc dot gnu.org
  2014-09-21 23:21 ` hp at gcc dot gnu.org
  2014-09-22 19:53 ` hubicka at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2014-09-19 23:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61825

--- Comment #8 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Author: hubicka
Date: Fri Sep 19 23:56:52 2014
New Revision: 215409

URL: https://gcc.gnu.org/viewcvs?rev=215409&root=gcc&view=rev
Log:

    PR c++/61825
    * c-family/c-common.c (handle_alias_ifunc_attribute): Check
    that visibility change is possible
    (handle_weakref_attribute): Likewise.
    * cgraph.h (symtab_node): Add method get_create and
    field refuse_visibility_changes.
    (symtab_node::get_create): New method.
    * fold-const.c (tree_single_nonzero_warnv_p): Use get_create.
    * varasm.c (mark_weak): Verify that visibility change is
    possible.

    * gcc.dg/tree-ssa/nonzero-1.c: Require error to be output.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/c-family/c-common.c
    trunk/gcc/cgraph.h
    trunk/gcc/fold-const.c
    trunk/gcc/symtab.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/tree-ssa/nonzero-1.c
    trunk/gcc/varasm.c


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c++/61825] [5 regression] g++.dg/cpp0x/static_assert9.C FAILs
  2014-07-17 12:23 [Bug c++/61825] New: [4.10 regression] g++.dg/cpp0x/static_assert9.C FAILs ro at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2014-09-19 23:57 ` hubicka at gcc dot gnu.org
@ 2014-09-21 23:21 ` hp at gcc dot gnu.org
  2014-09-22 19:53 ` hubicka at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: hp at gcc dot gnu.org @ 2014-09-21 23:21 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61825

--- Comment #9 from Hans-Peter Nilsson <hp at gcc dot gnu.org> ---
Seems to be fixed, but I'm leaving the closing step to the reporter (Rainer).


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [Bug c++/61825] [5 regression] g++.dg/cpp0x/static_assert9.C FAILs
  2014-07-17 12:23 [Bug c++/61825] New: [4.10 regression] g++.dg/cpp0x/static_assert9.C FAILs ro at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2014-09-21 23:21 ` hp at gcc dot gnu.org
@ 2014-09-22 19:53 ` hubicka at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: hubicka at gcc dot gnu.org @ 2014-09-22 19:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61825

Jan Hubicka <hubicka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #10 from Jan Hubicka <hubicka at gcc dot gnu.org> ---
Fixed.


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-09-22 19:53 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-17 12:23 [Bug c++/61825] New: [4.10 regression] g++.dg/cpp0x/static_assert9.C FAILs ro at gcc dot gnu.org
2014-07-17 12:23 ` [Bug c++/61825] " ro at gcc dot gnu.org
2014-07-17 23:09 ` hp at gcc dot gnu.org
2014-08-24 15:24 ` [Bug c++/61825] [5 " danglin at gcc dot gnu.org
2014-08-25  9:45 ` amker at gcc dot gnu.org
2014-08-26  9:41 ` dominiq at lps dot ens.fr
2014-09-08 14:42 ` ro at CeBiTec dot Uni-Bielefeld.DE
2014-09-09  1:46 ` hubicka at ucw dot cz
2014-09-19 22:49 ` hubicka at ucw dot cz
2014-09-19 23:57 ` hubicka at gcc dot gnu.org
2014-09-21 23:21 ` hp at gcc dot gnu.org
2014-09-22 19:53 ` hubicka at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).