public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/63657] [4.9/5 regression] -Wunused-variable: warning supressed by virtual dtor
       [not found] <bug-63657-4@http.gcc.gnu.org/bugzilla/>
@ 2014-10-28  9:07 ` rguenth at gcc dot gnu.org
  2014-10-30 10:38 ` jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-10-28  9:07 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic
                 CC|                            |paolo.carlini at oracle dot com
   Target Milestone|---                         |4.9.2
            Summary|[4.9 regression]            |[4.9/5 regression]
                   |-Wunused-variable: warning  |-Wunused-variable: warning
                   |supressed by virtual dtor   |supressed by virtual dtor


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

* [Bug c++/63657] [4.9/5 regression] -Wunused-variable: warning supressed by virtual dtor
       [not found] <bug-63657-4@http.gcc.gnu.org/bugzilla/>
  2014-10-28  9:07 ` [Bug c++/63657] [4.9/5 regression] -Wunused-variable: warning supressed by virtual dtor rguenth at gcc dot gnu.org
@ 2014-10-30 10:38 ` jakub at gcc dot gnu.org
  2014-11-02  8:50 ` paolo.carlini at oracle dot com
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-10-30 10:38 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.9.2                       |4.9.3

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.9.2 has been released.


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

* [Bug c++/63657] [4.9/5 regression] -Wunused-variable: warning supressed by virtual dtor
       [not found] <bug-63657-4@http.gcc.gnu.org/bugzilla/>
  2014-10-28  9:07 ` [Bug c++/63657] [4.9/5 regression] -Wunused-variable: warning supressed by virtual dtor rguenth at gcc dot gnu.org
  2014-10-30 10:38 ` jakub at gcc dot gnu.org
@ 2014-11-02  8:50 ` paolo.carlini at oracle dot com
  2014-11-03 12:57 ` petschy at gmail dot com
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-11-02  8:50 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|paolo.carlini at oracle dot com    |
         Resolution|---                         |DUPLICATE

--- Comment #3 from Paolo Carlini <paolo.carlini at oracle dot com> ---
This is exactly the same issue as c++/61935 etc, indeed, the change is
intended.

*** This bug has been marked as a duplicate of bug 38958 ***


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

* [Bug c++/63657] [4.9/5 regression] -Wunused-variable: warning supressed by virtual dtor
       [not found] <bug-63657-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2014-11-02  8:50 ` paolo.carlini at oracle dot com
@ 2014-11-03 12:57 ` petschy at gmail dot com
  2014-11-09 11:30 ` petschy at gmail dot com
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: petschy at gmail dot com @ 2014-11-03 12:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from petschy at gmail dot com ---
Sorry, but this is definitely not the same issue. Bug 38958 is about returning
by value and binding to a reference. This issue is about returning a REFERENCE
and binding it to a reference. No class ctor/dtor/copy is involved, references
are just syntactic sugar on pointers: a single pointer is returned and stored
locally. This is 100% sure, since in the production code the bug appeared with
a singleton which is not constructible/destructible/copyable to the outside
world.

Please reopen the issue.


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

* [Bug c++/63657] [4.9/5 regression] -Wunused-variable: warning supressed by virtual dtor
       [not found] <bug-63657-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2014-11-03 12:57 ` petschy at gmail dot com
@ 2014-11-09 11:30 ` petschy at gmail dot com
  2014-11-09 17:12 ` paolo.carlini at oracle dot com
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: petschy at gmail dot com @ 2014-11-09 11:30 UTC (permalink / raw)
  To: gcc-bugs

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

petschy at gmail dot com changed:

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

--- Comment #5 from petschy at gmail dot com ---
To further prove my case, here is the disassembly of foo() and bar(). As
expected, they are identical, no ctors/dtors are ever called, so there can be
no side effects.

Dump of assembler code for function foo():
   0x0000000000400766 <+0>:     push   %rbp
   0x0000000000400767 <+1>:     mov    %rsp,%rbp
   0x000000000040076a <+4>:     sub    $0x10,%rsp
   0x000000000040076e <+8>:     callq  0x400797 <getfoo()>
   0x0000000000400773 <+13>:    mov    %rax,-0x8(%rbp)
   0x0000000000400777 <+17>:    leaveq 
   0x0000000000400778 <+18>:    retq   
End of assembler dump.

Dump of assembler code for function bar():
   0x0000000000400779 <+0>:     push   %rbp
   0x000000000040077a <+1>:     mov    %rsp,%rbp
   0x000000000040077d <+4>:     sub    $0x10,%rsp
   0x0000000000400781 <+8>:     callq  0x4007a2 <getbar()>
   0x0000000000400786 <+13>:    mov    %rax,-0x8(%rbp)
   0x000000000040078a <+17>:    leaveq 
   0x000000000040078b <+18>:    retq   
End of assembler dump.


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

* [Bug c++/63657] [4.9/5 regression] -Wunused-variable: warning supressed by virtual dtor
       [not found] <bug-63657-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2014-11-09 11:30 ` petschy at gmail dot com
@ 2014-11-09 17:12 ` paolo.carlini at oracle dot com
  2014-11-22  2:23 ` jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-11-09 17:12 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org,
                   |                            |paolo.carlini at oracle dot com

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> ---
It occurs to me that a pretty robust (and in principle easy to implement) way
to decide whether we want to suppress the warning or not would be storing in a
flag of the VAR_DECL whether set_up_extended_ref_temp has been called on it.
However, I don't think we have any unused flag... Jason, what do you think?


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

* [Bug c++/63657] [4.9/5 regression] -Wunused-variable: warning supressed by virtual dtor
       [not found] <bug-63657-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2014-11-09 17:12 ` paolo.carlini at oracle dot com
@ 2014-11-22  2:23 ` jason at gcc dot gnu.org
  2014-11-24 13:39 ` [Bug c++/63657] [4.9 " rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2014-11-22  2:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Sat Nov 22 02:21:35 2014
New Revision: 217957

URL: https://gcc.gnu.org/viewcvs?rev=217957&root=gcc&view=rev
Log:
    PR c++/63657
    PR c++/38958
    * call.c (set_up_extended_ref_temp): Set TREE_USED on the reference
    if the temporary has a non-trivial destructor.
    * decl.c (poplevel): Don't look through references.

Added:
    trunk/gcc/testsuite/g++.dg/warn/Wunused-var-22.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/call.c
    trunk/gcc/cp/decl.c


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

* [Bug c++/63657] [4.9 regression] -Wunused-variable: warning supressed by virtual dtor
       [not found] <bug-63657-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2014-11-22  2:23 ` jason at gcc dot gnu.org
@ 2014-11-24 13:39 ` rguenth at gcc dot gnu.org
  2014-11-24 13:44 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-24 13:39 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |5.0
            Summary|[4.9/5 regression]          |[4.9 regression]
                   |-Wunused-variable: warning  |-Wunused-variable: warning
                   |supressed by virtual dtor   |supressed by virtual dtor

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed on trunk.


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

* [Bug c++/63657] [4.9 regression] -Wunused-variable: warning supressed by virtual dtor
       [not found] <bug-63657-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2014-11-24 13:39 ` [Bug c++/63657] [4.9 " rguenth at gcc dot gnu.org
@ 2014-11-24 13:44 ` paolo.carlini at oracle dot com
  2014-11-24 16:55 ` rguenth at gcc dot gnu.org
  2015-01-07 15:18 ` jason at gcc dot gnu.org
  10 siblings, 0 replies; 11+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-11-24 13:44 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-11-24
     Ever confirmed|0                           |1


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

* [Bug c++/63657] [4.9 regression] -Wunused-variable: warning supressed by virtual dtor
       [not found] <bug-63657-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2014-11-24 13:44 ` paolo.carlini at oracle dot com
@ 2014-11-24 16:55 ` rguenth at gcc dot gnu.org
  2015-01-07 15:18 ` jason at gcc dot gnu.org
  10 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-11-24 16:55 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
      Known to work|                            |4.8.3
      Known to fail|                            |4.9.1


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

* [Bug c++/63657] [4.9 regression] -Wunused-variable: warning supressed by virtual dtor
       [not found] <bug-63657-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2014-11-24 16:55 ` rguenth at gcc dot gnu.org
@ 2015-01-07 15:18 ` jason at gcc dot gnu.org
  10 siblings, 0 replies; 11+ messages in thread
From: jason at gcc dot gnu.org @ 2015-01-07 15:18 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Wed Jan  7 15:18:05 2015
New Revision: 219306

URL: https://gcc.gnu.org/viewcvs?rev=219306&root=gcc&view=rev
Log:
    PR c++/63657
    PR c++/38958
    * call.c (set_up_extended_ref_temp): Set TREE_USED on the reference
    if the temporary has a non-trivial destructor.
    * decl.c (poplevel): Don't look through references.

Added:
    branches/gcc-4_9-branch/gcc/testsuite/g++.dg/warn/Wunused-var-22.C
Modified:
    branches/gcc-4_9-branch/gcc/cp/ChangeLog
    branches/gcc-4_9-branch/gcc/cp/call.c
    branches/gcc-4_9-branch/gcc/cp/decl.c


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

end of thread, other threads:[~2015-01-07 15:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-63657-4@http.gcc.gnu.org/bugzilla/>
2014-10-28  9:07 ` [Bug c++/63657] [4.9/5 regression] -Wunused-variable: warning supressed by virtual dtor rguenth at gcc dot gnu.org
2014-10-30 10:38 ` jakub at gcc dot gnu.org
2014-11-02  8:50 ` paolo.carlini at oracle dot com
2014-11-03 12:57 ` petschy at gmail dot com
2014-11-09 11:30 ` petschy at gmail dot com
2014-11-09 17:12 ` paolo.carlini at oracle dot com
2014-11-22  2:23 ` jason at gcc dot gnu.org
2014-11-24 13:39 ` [Bug c++/63657] [4.9 " rguenth at gcc dot gnu.org
2014-11-24 13:44 ` paolo.carlini at oracle dot com
2014-11-24 16:55 ` rguenth at gcc dot gnu.org
2015-01-07 15:18 ` jason 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).