public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/63239] New: DWARF does not represent C++ deleted methods
@ 2014-09-12 11:05 mpolacek at gcc dot gnu.org
  2014-10-05 15:25 ` [Bug debug/63239] " mark at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2014-09-12 11:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 63239
           Summary: DWARF does not represent C++ deleted methods
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org

C++11 has implicitly deleted functions.  These are declared with the = delete
specifier, and their usage in the program is forbidden.

struct A
{ 
  int i;
  A() = delete;
};
A a = { 42 };

However, it seems that currently the deleted functions are emitted like any
other.


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

* [Bug debug/63239] DWARF does not represent C++ deleted methods
  2014-09-12 11:05 [Bug debug/63239] New: DWARF does not represent C++ deleted methods mpolacek at gcc dot gnu.org
@ 2014-10-05 15:25 ` mark at gcc dot gnu.org
  2014-10-05 15:31 ` mark at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mark at gcc dot gnu.org @ 2014-10-05 15:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Mark Wielaard <mark at gcc dot gnu.org> ---
Author: mark
Date: Sun Oct  5 15:25:03 2014
New Revision: 215901

URL: https://gcc.gnu.org/viewcvs?rev=215901&root=gcc&view=rev
Log:
PR debug/63239 Add DWARF representation for C++11 deleted member function.

include/ChangeLog

    * dwarf2.def (DW_AT_GNU_deleted): New attribute.

gcc/ChangeLog

    * dwarf2out.c (gen_subprogram_die): When a member function is
    explicitly deleted then add a DW_AT_GNU_deleted attribute.
    * langhooks.h (struct lang_hooks_for_decls): Add
    function_decl_deleted_p langhook.
    * langhooks-def.h (LANG_HOOKS_FUNCTION_DECL_DELETED_P): Define.
    (LANG_HOOKS_DECLS): Add LANG_HOOKS_FUNCTION_DECL_DELETED_P.

gcc/cp/ChangeLog

    * cp-objcp-common.h (LANG_HOOKS_FUNCTION_DECL_DELETED_P): Define.
    (cp_function_decl_deleted_p): New prototype.
    * cp-objcp-common.c (cp_function_deleted_p): New function.

gcc/testsuite/ChangeLog

    * g++.dg/debug/dwarf2/deleted-member-function.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/deleted-member-function.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cp-objcp-common.c
    trunk/gcc/cp/cp-objcp-common.h
    trunk/gcc/dwarf2out.c
    trunk/gcc/langhooks-def.h
    trunk/gcc/langhooks.h
    trunk/gcc/testsuite/ChangeLog
    trunk/include/ChangeLog
    trunk/include/dwarf2.def


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

* [Bug debug/63239] DWARF does not represent C++ deleted methods
  2014-09-12 11:05 [Bug debug/63239] New: DWARF does not represent C++ deleted methods mpolacek at gcc dot gnu.org
  2014-10-05 15:25 ` [Bug debug/63239] " mark at gcc dot gnu.org
@ 2014-10-05 15:31 ` mark at gcc dot gnu.org
  2014-11-21  8:51 ` fxcoudert at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mark at gcc dot gnu.org @ 2014-10-05 15:31 UTC (permalink / raw)
  To: gcc-bugs

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

Mark Wielaard <mark at gcc dot gnu.org> changed:

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

--- Comment #3 from Mark Wielaard <mark at gcc dot gnu.org> ---
https://gcc.gnu.org/ml/gcc-patches/2014-10/msg00272.html


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

* [Bug debug/63239] DWARF does not represent C++ deleted methods
  2014-09-12 11:05 [Bug debug/63239] New: DWARF does not represent C++ deleted methods mpolacek at gcc dot gnu.org
  2014-10-05 15:25 ` [Bug debug/63239] " mark at gcc dot gnu.org
  2014-10-05 15:31 ` mark at gcc dot gnu.org
@ 2014-11-21  8:51 ` fxcoudert at gcc dot gnu.org
  2014-11-21  8:52 ` fxcoudert at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2014-11-21  8:51 UTC (permalink / raw)
  To: gcc-bugs

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

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
   Last reconfirmed|                            |2014-11-21
                 CC|                            |fxcoudert at gcc dot gnu.org
         Resolution|FIXED                       |---
     Ever confirmed|0                           |1

--- Comment #4 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
The testcase fails on x86_64-apple-darwin14. With "g++ -O -std=c++11 -g -dA
a.c", we have the following optimized tree dump:

;; Function void bar() (_Z3barv, funcdef_no=3, decl_uid=2126, cgraph_uid=3,
symbol_order=3)
void bar() ()
{
  <bb 2>:
  # DEBUG this => &foo
  return;
}

The assembler (see attachment) does not contain DW_AT_GNU_deleted.


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

* [Bug debug/63239] DWARF does not represent C++ deleted methods
  2014-09-12 11:05 [Bug debug/63239] New: DWARF does not represent C++ deleted methods mpolacek at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-11-21  8:51 ` fxcoudert at gcc dot gnu.org
@ 2014-11-21  8:52 ` fxcoudert at gcc dot gnu.org
  2014-11-21 13:13 ` mark at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2014-11-21  8:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Created attachment 34063
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34063&action=edit
Assembler generated at -O -std=c++11 -g -dA


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

* [Bug debug/63239] DWARF does not represent C++ deleted methods
  2014-09-12 11:05 [Bug debug/63239] New: DWARF does not represent C++ deleted methods mpolacek at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-11-21  8:52 ` fxcoudert at gcc dot gnu.org
@ 2014-11-21 13:13 ` mark at gcc dot gnu.org
  2014-11-21 13:16 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: mark at gcc dot gnu.org @ 2014-11-21 13:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Mark Wielaard <mark at gcc dot gnu.org> ---
It looks like for some reason Darwin defaults to some ancient (v2) strict
version of DWARF. Please try adding -gno-strict-dwarf -gdwarf-4 to
gcc/testsuite/g++.dg/debug/dwarf2/deleted-member-function.C dg-options.


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

* [Bug debug/63239] DWARF does not represent C++ deleted methods
  2014-09-12 11:05 [Bug debug/63239] New: DWARF does not represent C++ deleted methods mpolacek at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2014-11-21 13:13 ` mark at gcc dot gnu.org
@ 2014-11-21 13:16 ` jakub at gcc dot gnu.org
  2014-11-21 13:28 ` fxcoudert at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-11-21 13:16 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Mark Wielaard from comment #6)
> It looks like for some reason Darwin defaults to some ancient (v2) strict
> version of DWARF. Please try adding -gno-strict-dwarf -gdwarf-4 to
> gcc/testsuite/g++.dg/debug/dwarf2/deleted-member-function.C dg-options.

The reason for that is that Darwin has a set of tools that crash or otherwise
break on valid DWARF 3 or DWARF 4 or various extensions.  So using -gdwarf-2
and -gstrict-dwarf by default is necessary because of badly written toolchain.


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

* [Bug debug/63239] DWARF does not represent C++ deleted methods
  2014-09-12 11:05 [Bug debug/63239] New: DWARF does not represent C++ deleted methods mpolacek at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2014-11-21 13:16 ` jakub at gcc dot gnu.org
@ 2014-11-21 13:28 ` fxcoudert at gcc dot gnu.org
  2014-11-21 13:28 ` fxcoudert at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2014-11-21 13:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Author: fxcoudert
Date: Fri Nov 21 13:27:57 2014
New Revision: 217918

URL: https://gcc.gnu.org/viewcvs?rev=217918&root=gcc&view=rev
Log:
    PR debug/63239
    * g++.dg/debug/dwarf2/deleted-member-function.C: Pass
    -gno-strict-dwarf on darwin.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/deleted-member-function.C


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

* [Bug debug/63239] DWARF does not represent C++ deleted methods
  2014-09-12 11:05 [Bug debug/63239] New: DWARF does not represent C++ deleted methods mpolacek at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2014-11-21 13:28 ` fxcoudert at gcc dot gnu.org
@ 2014-11-21 13:28 ` fxcoudert at gcc dot gnu.org
  2014-11-21 13:30 ` jakub at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2014-11-21 13:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #7)
> So using
> -gdwarf-2 and -gstrict-dwarf by default is necessary because of badly
> written toolchain.

I had tried -gdwarf-4, but didn't know about -gstrict-dwarf. Will commit the
obvious patch, then.


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

* [Bug debug/63239] DWARF does not represent C++ deleted methods
  2014-09-12 11:05 [Bug debug/63239] New: DWARF does not represent C++ deleted methods mpolacek at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2014-11-21 13:28 ` fxcoudert at gcc dot gnu.org
@ 2014-11-21 13:30 ` jakub at gcc dot gnu.org
  2014-11-21 13:32 ` fxcoudert at gcc dot gnu.org
  2014-11-21 13:33 ` fxcoudert at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-11-21 13:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
You should pass -gno-strict-dwarf unconditionally, I think vxworks has similar
defaults as darwin.


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

* [Bug debug/63239] DWARF does not represent C++ deleted methods
  2014-09-12 11:05 [Bug debug/63239] New: DWARF does not represent C++ deleted methods mpolacek at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2014-11-21 13:30 ` jakub at gcc dot gnu.org
@ 2014-11-21 13:32 ` fxcoudert at gcc dot gnu.org
  2014-11-21 13:33 ` fxcoudert at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2014-11-21 13:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Author: fxcoudert
Date: Fri Nov 21 13:32:08 2014
New Revision: 217920

URL: https://gcc.gnu.org/viewcvs?rev=217920&root=gcc&view=rev
Log:
    PR debug/63239
    * g++.dg/debug/dwarf2/deleted-member-function.C: Pass
    -gno-strict-dwarf.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/g++.dg/debug/dwarf2/deleted-member-function.C


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

* [Bug debug/63239] DWARF does not represent C++ deleted methods
  2014-09-12 11:05 [Bug debug/63239] New: DWARF does not represent C++ deleted methods mpolacek at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2014-11-21 13:32 ` fxcoudert at gcc dot gnu.org
@ 2014-11-21 13:33 ` fxcoudert at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2014-11-21 13:33 UTC (permalink / raw)
  To: gcc-bugs

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

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

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

--- Comment #12 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #10)
> You should pass -gno-strict-dwarf unconditionally, I think vxworks has
> similar defaults as darwin.

OK, it's true it cannot hurt as we're not calling the assembler anyway.


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

end of thread, other threads:[~2014-11-21 13:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-12 11:05 [Bug debug/63239] New: DWARF does not represent C++ deleted methods mpolacek at gcc dot gnu.org
2014-10-05 15:25 ` [Bug debug/63239] " mark at gcc dot gnu.org
2014-10-05 15:31 ` mark at gcc dot gnu.org
2014-11-21  8:51 ` fxcoudert at gcc dot gnu.org
2014-11-21  8:52 ` fxcoudert at gcc dot gnu.org
2014-11-21 13:13 ` mark at gcc dot gnu.org
2014-11-21 13:16 ` jakub at gcc dot gnu.org
2014-11-21 13:28 ` fxcoudert at gcc dot gnu.org
2014-11-21 13:28 ` fxcoudert at gcc dot gnu.org
2014-11-21 13:30 ` jakub at gcc dot gnu.org
2014-11-21 13:32 ` fxcoudert at gcc dot gnu.org
2014-11-21 13:33 ` fxcoudert 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).