public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95518] New: [coroutines] [[maybe_unused]] does not propagate to actor() and destroy()
@ 2020-06-03 21:18 bruck.michael at gmail dot com
  2020-06-03 21:41 ` [Bug c++/95518] " bruck.michael at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: bruck.michael at gmail dot com @ 2020-06-03 21:18 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95518
           Summary: [coroutines] [[maybe_unused]] does not propagate to
                    actor() and destroy()
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bruck.michael at gmail dot com
  Target Milestone: ---

Example with -Wall -Ofast:
---
#include <coroutine>

struct dummy
{
    struct promise_type
    {
        dummy get_return_object() const noexcept { return {}; }
        std::suspend_never initial_suspend() const noexcept { return {}; }
        std::suspend_never final_suspend() const noexcept { return {}; }
        void return_void() const noexcept {}
        void unhandled_exception() const noexcept {}
    };
    int i; // work around #95516
};

[[maybe_unused]] static dummy foo()
{ 
    co_return;
}

int main() {}
--
<source>:19:1: warning: 'void _ZL3foov.destroy(foo()::_ZL3foov.frame*)' defined
but not used [-Wunused-function]
   19 | }
      | ^
<source>:19:1: warning: 'void _ZL3foov.actor(foo()::_ZL3foov.frame*)' defined
but not used [-Wunused-function]

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

* [Bug c++/95518] [coroutines] [[maybe_unused]] does not propagate to actor() and destroy()
  2020-06-03 21:18 [Bug c++/95518] New: [coroutines] [[maybe_unused]] does not propagate to actor() and destroy() bruck.michael at gmail dot com
@ 2020-06-03 21:41 ` bruck.michael at gmail dot com
  2020-06-04 19:48 ` iains at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: bruck.michael at gmail dot com @ 2020-06-03 21:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Michael Bruck <bruck.michael at gmail dot com> ---
This bug probably applies to all attributes. Of the more plausible ones I
tested [[gnu::section("")]] which also fails to propagate.

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

* [Bug c++/95518] [coroutines] [[maybe_unused]] does not propagate to actor() and destroy()
  2020-06-03 21:18 [Bug c++/95518] New: [coroutines] [[maybe_unused]] does not propagate to actor() and destroy() bruck.michael at gmail dot com
  2020-06-03 21:41 ` [Bug c++/95518] " bruck.michael at gmail dot com
@ 2020-06-04 19:48 ` iains at gcc dot gnu.org
  2020-06-24 20:06 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: iains at gcc dot gnu.org @ 2020-06-04 19:48 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Assignee|unassigned at gcc dot gnu.org      |iains at gcc dot gnu.org
   Last reconfirmed|                            |2020-06-04
             Status|UNCONFIRMED                 |NEW
   Target Milestone|---                         |10.2

--- Comment #2 from Iain Sandoe <iains at gcc dot gnu.org> ---
thanks for the report, that's an oversight on my part
- interesting will be to consider if all attributes should be copied or only
some sub-set.

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

* [Bug c++/95518] [coroutines] [[maybe_unused]] does not propagate to actor() and destroy()
  2020-06-03 21:18 [Bug c++/95518] New: [coroutines] [[maybe_unused]] does not propagate to actor() and destroy() bruck.michael at gmail dot com
  2020-06-03 21:41 ` [Bug c++/95518] " bruck.michael at gmail dot com
  2020-06-04 19:48 ` iains at gcc dot gnu.org
@ 2020-06-24 20:06 ` cvs-commit at gcc dot gnu.org
  2020-06-28  8:59 ` cvs-commit at gcc dot gnu.org
  2020-06-28  9:05 ` iains at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-24 20:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Iain D Sandoe <iains@gcc.gnu.org>:

https://gcc.gnu.org/g:1e5da6a02fec8aa84bb00966282f420cb70fe4f0

commit r11-1640-g1e5da6a02fec8aa84bb00966282f420cb70fe4f0
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Wed Jun 24 18:48:33 2020 +0100

    coroutines: Copy attributes to the outlined functions [PR95518,PR95813]

    We had omitted the copying of function attributes, we now copy
    the used, alignment, section values from the original decal and
    the complete set of function attributes.  It is likely that
    some function attributes don't really make sense for coroutines,
    but that can be disgnosed separately. Also mark the outlined
    functions as artificial, since they are; some diagnostic
    processing tests this.

    gcc/cp/ChangeLog:

            PR c++/95518
            PR c++/95813
            * coroutines.cc (act_des_fn): Copy function
            attributes onto the outlined coroutine helpers.

    gcc/testsuite/ChangeLog:

            PR c++/95518
            PR c++/95813
            * g++.dg/coroutines/pr95518.C: New test.
            * g++.dg/coroutines/pr95813.C: New test.

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

* [Bug c++/95518] [coroutines] [[maybe_unused]] does not propagate to actor() and destroy()
  2020-06-03 21:18 [Bug c++/95518] New: [coroutines] [[maybe_unused]] does not propagate to actor() and destroy() bruck.michael at gmail dot com
                   ` (2 preceding siblings ...)
  2020-06-24 20:06 ` cvs-commit at gcc dot gnu.org
@ 2020-06-28  8:59 ` cvs-commit at gcc dot gnu.org
  2020-06-28  9:05 ` iains at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-28  8:59 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Iain D Sandoe
<iains@gcc.gnu.org>:

https://gcc.gnu.org/g:c3bf482a0e59b9da925b382387686656c3d8839f

commit r10-8380-gc3bf482a0e59b9da925b382387686656c3d8839f
Author: Iain Sandoe <iain@sandoe.co.uk>
Date:   Sun Jun 28 09:48:33 2020 +0100

    coroutines: Copy attributes to the outlined functions [PR95518,PR95813]

    We had omitted the copying of function attributes, we now copy
    the used, alignment, section values from the original decal and
    the complete set of function attributes.  It is likely that
    some function attributes don't really make sense for coroutines,
    but that can be disgnosed separately. Also mark the outlined
    functions as artificial, since they are; some diagnostic
    processing tests this.

    gcc/cp/ChangeLog:

            PR c++/95518
            PR c++/95813
            * coroutines.cc (act_des_fn): Copy function
            attributes onto the outlined coroutine helpers.

    gcc/testsuite/ChangeLog:

            PR c++/95518
            PR c++/95813
            * g++.dg/coroutines/pr95518.C: New test.
            * g++.dg/coroutines/pr95813.C: New test.

    (cherry picked from commit 1e5da6a02fec8aa84bb00966282f420cb70fe4f0)

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

* [Bug c++/95518] [coroutines] [[maybe_unused]] does not propagate to actor() and destroy()
  2020-06-03 21:18 [Bug c++/95518] New: [coroutines] [[maybe_unused]] does not propagate to actor() and destroy() bruck.michael at gmail dot com
                   ` (3 preceding siblings ...)
  2020-06-28  8:59 ` cvs-commit at gcc dot gnu.org
@ 2020-06-28  9:05 ` iains at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: iains at gcc dot gnu.org @ 2020-06-28  9:05 UTC (permalink / raw)
  To: gcc-bugs

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

Iain Sandoe <iains at gcc dot gnu.org> changed:

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

--- Comment #5 from Iain Sandoe <iains at gcc dot gnu.org> ---
fixed for master and 10.2

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

end of thread, other threads:[~2020-06-28  9:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-03 21:18 [Bug c++/95518] New: [coroutines] [[maybe_unused]] does not propagate to actor() and destroy() bruck.michael at gmail dot com
2020-06-03 21:41 ` [Bug c++/95518] " bruck.michael at gmail dot com
2020-06-04 19:48 ` iains at gcc dot gnu.org
2020-06-24 20:06 ` cvs-commit at gcc dot gnu.org
2020-06-28  8:59 ` cvs-commit at gcc dot gnu.org
2020-06-28  9:05 ` iains 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).