public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95917] New: coroutine functions leak under freestanding mode causing dependencies and binary bloat.
@ 2020-06-26 18:44 euloanty at live dot com
  2020-06-26 18:51 ` [Bug c++/95917] " euloanty at live dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: euloanty at live dot com @ 2020-06-26 18:44 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95917
           Summary: coroutine functions leak under freestanding mode
                    causing dependencies and binary bloat.
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: euloanty at live dot com
  Target Milestone: ---

.file   "helloworld_linux_writev.cc"
        .text
        .p2align 4
        .weak   _ZNSt7__n486122__dummy_resume_destroyEv
        .type   _ZNSt7__n486122__dummy_resume_destroyEv, @function
_ZNSt7__n486122__dummy_resume_destroyEv:
.LFB13483:
        .cfi_startproc
        ret
        .cfi_endproc
.LFE13483:
        .size   _ZNSt7__n486122__dummy_resume_destroyEv,
.-_ZNSt7__n486122__dummy_resume_destroyEv
        .section       
.text._ZN7fast_io7details14print_fallbackILb1ENS_23basic_posix_io_observerIcEEJRA13_KciRA5_S4_EEEvRT0_DpOT1_,"axG",@progbits,_ZN7fast_io7details14print_fallbackILb1ENS_23basic_posix_io_observerIcEEJRA13_KciRA5_S4_EEEvRT0_DpOT1_,comdat
        .p2align 4
        .weak  
_ZN7fast_io7details14print_fallbackILb1ENS_23basic_posix_io_observerIcEEJRA13_KciRA5_S4_EEEvRT0_DpOT1_
        .type  
_ZN7fast_io7details14print_fallbackILb1ENS_23basic_posix_io_observerIcEEJRA13_KciRA5_S4_EEEvRT0_DpOT1_,
@function
_ZN7fast_io7details14print_fallbackILb1ENS_23basic_posix_io_observerIcEEJRA13_KciRA5_S4_EEEvRT0_DpOT1_:
.LFB14746:

        .file   "helloworld_linux_writev.cc"         .text         .p2align 4  
      .weak   _ZNSt7__n486122__dummy_resume_destroyEv         .type  
_ZNSt7__n486122__dummy_resume_destroyEv, @function
_ZNSt7__n486122__dummy_resume_destroyEv: .LFB13480:

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

* [Bug c++/95917] coroutine functions leak under freestanding mode causing dependencies and binary bloat.
  2020-06-26 18:44 [Bug c++/95917] New: coroutine functions leak under freestanding mode causing dependencies and binary bloat euloanty at live dot com
@ 2020-06-26 18:51 ` euloanty at live dot com
  2020-06-26 18:54 ` euloanty at live dot com
                   ` (8 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: euloanty at live dot com @ 2020-06-26 18:51 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from fdlbxtqi <euloanty at live dot com> ---

  void __dummy_resume_destroy() __attribute__((__weak__));
  void __dummy_resume_destroy() {}

  struct __noop_coro_frame
  {
    void (*__r)() = __dummy_resume_destroy;
    void (*__d)() = __dummy_resume_destroy;
    struct noop_coroutine_promise __p;
  } __noop_coro_fr __attribute__((__weak__));


Please inline ALL your functions.

inline this variable PLEASE.

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

* [Bug c++/95917] coroutine functions leak under freestanding mode causing dependencies and binary bloat.
  2020-06-26 18:44 [Bug c++/95917] New: coroutine functions leak under freestanding mode causing dependencies and binary bloat euloanty at live dot com
  2020-06-26 18:51 ` [Bug c++/95917] " euloanty at live dot com
@ 2020-06-26 18:54 ` euloanty at live dot com
  2020-06-26 18:57 ` euloanty at live dot com
                   ` (7 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: euloanty at live dot com @ 2020-06-26 18:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from fdlbxtqi <euloanty at live dot com> ---
This makes me mad.

I compiled this under freestanding mode. Now coroutine causes binary bloat
which is completely unacceptable for me.

The problem of C++ is that you have to always write inline to undo the brain
damage of the extern static shit of WG21.

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

* [Bug c++/95917] coroutine functions leak under freestanding mode causing dependencies and binary bloat.
  2020-06-26 18:44 [Bug c++/95917] New: coroutine functions leak under freestanding mode causing dependencies and binary bloat euloanty at live dot com
  2020-06-26 18:51 ` [Bug c++/95917] " euloanty at live dot com
  2020-06-26 18:54 ` euloanty at live dot com
@ 2020-06-26 18:57 ` euloanty at live dot com
  2020-06-26 19:01 ` iains at gcc dot gnu.org
                   ` (6 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: euloanty at live dot com @ 2020-06-26 18:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from fdlbxtqi <euloanty at live dot com> ---
Jonathan. I am MAD at you. This is absolutely your fault. I told you to always
write inline and you guys do not then allow Herb Sutter to ban me. Here is the
fault in your own controlled codebase. Are you satisfied?

https://github.com/isocpp/CppCoreGuidelines/issues/1630

YES! INLINE ALL YOUR FUNCTIONS. AVOID function pointers and virtual functions
as plagues.

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

* [Bug c++/95917] coroutine functions leak under freestanding mode causing dependencies and binary bloat.
  2020-06-26 18:44 [Bug c++/95917] New: coroutine functions leak under freestanding mode causing dependencies and binary bloat euloanty at live dot com
                   ` (2 preceding siblings ...)
  2020-06-26 18:57 ` euloanty at live dot com
@ 2020-06-26 19:01 ` iains at gcc dot gnu.org
  2020-06-26 19:03 ` euloanty at live dot com
                   ` (5 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: iains at gcc dot gnu.org @ 2020-06-26 19:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Iain Sandoe <iains at gcc dot gnu.org> ---
(In reply to fdlbxtqi from comment #3)
> Jonathan. I am MAD at you. This is absolutely your fault. I told you to
> always write inline and you guys do not then allow Herb Sutter to ban me.
> Here is the fault in your own controlled codebase. Are you satisfied?
> 
> https://github.com/isocpp/CppCoreGuidelines/issues/1630
> 
> YES! INLINE ALL YOUR FUNCTIONS. AVOID function pointers and virtual
> functions as plagues.

1. jonathan did not write this header - I did,
2. we all make mistakes, shouting at folks isn't the optimum way to get them
fixed
3. this bloat can only occur IF you include a header you are NOT using.

i.e.
#include <coroutine>
in a source that has no coroutines.

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

* [Bug c++/95917] coroutine functions leak under freestanding mode causing dependencies and binary bloat.
  2020-06-26 18:44 [Bug c++/95917] New: coroutine functions leak under freestanding mode causing dependencies and binary bloat euloanty at live dot com
                   ` (3 preceding siblings ...)
  2020-06-26 19:01 ` iains at gcc dot gnu.org
@ 2020-06-26 19:03 ` euloanty at live dot com
  2020-06-26 19:12 ` euloanty at live dot com
                   ` (4 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: euloanty at live dot com @ 2020-06-26 19:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from fdlbxtqi <euloanty at live dot com> ---
(In reply to Iain Sandoe from comment #4)
> (In reply to fdlbxtqi from comment #3)
> > Jonathan. I am MAD at you. This is absolutely your fault. I told you to
> > always write inline and you guys do not then allow Herb Sutter to ban me.
> > Here is the fault in your own controlled codebase. Are you satisfied?
> > 
> > https://github.com/isocpp/CppCoreGuidelines/issues/1630
> > 
> > YES! INLINE ALL YOUR FUNCTIONS. AVOID function pointers and virtual
> > functions as plagues.
> 
> 1. jonathan did not write this header - I did,
> 2. we all make mistakes, shouting at folks isn't the optimum way to get them
> fixed
> 3. this bloat can only occur IF you include a header you are NOT using.
> 
> i.e.
> #include <coroutine>
> in a source that has no coroutines.

Sorry. It is not your fault. What I am complaining about is that GCC now has
the 
 exactly the problem I talked about 10 days ago and he and Herb Sutter banned
me on C++ Core Guideline.

C++ Core Guideline is absolutely wrong here.

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

* [Bug c++/95917] coroutine functions leak under freestanding mode causing dependencies and binary bloat.
  2020-06-26 18:44 [Bug c++/95917] New: coroutine functions leak under freestanding mode causing dependencies and binary bloat euloanty at live dot com
                   ` (4 preceding siblings ...)
  2020-06-26 19:03 ` euloanty at live dot com
@ 2020-06-26 19:12 ` euloanty at live dot com
  2020-06-27  7:31 ` redi at gcc dot gnu.org
                   ` (3 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: euloanty at live dot com @ 2020-06-26 19:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from fdlbxtqi <euloanty at live dot com> ---
(In reply to Iain Sandoe from comment #4)
> (In reply to fdlbxtqi from comment #3)
> > Jonathan. I am MAD at you. This is absolutely your fault. I told you to
> > always write inline and you guys do not then allow Herb Sutter to ban me.
> > Here is the fault in your own controlled codebase. Are you satisfied?
> > 
> > https://github.com/isocpp/CppCoreGuidelines/issues/1630
> > 
> > YES! INLINE ALL YOUR FUNCTIONS. AVOID function pointers and virtual
> > functions as plagues.
> 
> 1. jonathan did not write this header - I did,
> 2. we all make mistakes, shouting at folks isn't the optimum way to get them
> fixed
> 3. this bloat can only occur IF you include a header you are NOT using.
> 
> i.e.
> #include <coroutine>
> in a source that has no coroutines.

Iain, you did a great job on implementing coroutines.

I am here to show the examples.

https://github.com/expnkx/fast_io/blob/master/testsuites/0005.freestanding/0002.println/helloworld_linux.cc
https://github.com/expnkx/fast_io/blob/master/testsuites/0005.freestanding/0002.println/helloworld_linux.s
https://github.com/expnkx/fast_io/blob/master/testsuites/0005.freestanding/0002.println/helloworld_linux_writev.cc
https://github.com/expnkx/fast_io/blob/master/testsuites/0005.freestanding/0002.println/helloworld_linux_writev.s

 Of course, I disabled exceptions and RTTI.
I can compile this on one computer and fail on another since it introduced
libsupc++ again with std:: bad_alloc, global new for examples. This is serious
if people are using C++ for making operating systems.

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

* [Bug c++/95917] coroutine functions leak under freestanding mode causing dependencies and binary bloat.
  2020-06-26 18:44 [Bug c++/95917] New: coroutine functions leak under freestanding mode causing dependencies and binary bloat euloanty at live dot com
                   ` (5 preceding siblings ...)
  2020-06-26 19:12 ` euloanty at live dot com
@ 2020-06-27  7:31 ` redi at gcc dot gnu.org
  2020-10-20 10:13 ` [Bug libstdc++/95917] " redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2020-06-27  7:31 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|jwakely at redhat dot com          |

--- Comment #7 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Please don't CC me on your stupid rants.

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

* [Bug libstdc++/95917] coroutine functions leak under freestanding mode causing dependencies and binary bloat.
  2020-06-26 18:44 [Bug c++/95917] New: coroutine functions leak under freestanding mode causing dependencies and binary bloat euloanty at live dot com
                   ` (6 preceding siblings ...)
  2020-06-27  7:31 ` redi at gcc dot gnu.org
@ 2020-10-20 10:13 ` redi at gcc dot gnu.org
  2020-10-20 10:38 ` cvs-commit at gcc dot gnu.org
  2020-10-20 10:40 ` redi at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2020-10-20 10:13 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2020-10-20
          Component|c++                         |libstdc++
   Target Milestone|---                         |11.0
           Assignee|unassigned at gcc dot gnu.org      |redi at gcc dot gnu.org

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

* [Bug libstdc++/95917] coroutine functions leak under freestanding mode causing dependencies and binary bloat.
  2020-06-26 18:44 [Bug c++/95917] New: coroutine functions leak under freestanding mode causing dependencies and binary bloat euloanty at live dot com
                   ` (7 preceding siblings ...)
  2020-10-20 10:13 ` [Bug libstdc++/95917] " redi at gcc dot gnu.org
@ 2020-10-20 10:38 ` cvs-commit at gcc dot gnu.org
  2020-10-20 10:40 ` redi at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-10-20 10:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jonathan Wakely <redi@gcc.gnu.org>:

https://gcc.gnu.org/g:94fd05f1f76faca9dc9033b55d44c960155d38e9

commit r11-4120-g94fd05f1f76faca9dc9033b55d44c960155d38e9
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Oct 20 11:19:58 2020 +0100

    libstdc++: Define noop coroutine details private and inline [PR 95917]

    This moves the __noop_coro_frame type, the __noop_coro_fr global
    variable, and the __dummy_resume_destroy function from namespace scope,
    replacing them with private members of the specialization
    coroutine_handle<noop_coroutine_promise>.

    The function and variable are also declared inline, so that they
    generate no code unless used.

    libstdc++-v3/ChangeLog:

            PR libstdc++/95917
            * include/std/coroutine (__noop_coro_frame): Replace with
            noop_coroutine_handle::__frame.
            (__dummy_resume_destroy): Define inline in __frame.
            (__noop_coro_fr): Replace with noop_coroutine_handle::_S_fr
            and define as inline.
            * testsuite/18_support/coroutines/95917.cc: New test.

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

* [Bug libstdc++/95917] coroutine functions leak under freestanding mode causing dependencies and binary bloat.
  2020-06-26 18:44 [Bug c++/95917] New: coroutine functions leak under freestanding mode causing dependencies and binary bloat euloanty at live dot com
                   ` (8 preceding siblings ...)
  2020-10-20 10:38 ` cvs-commit at gcc dot gnu.org
@ 2020-10-20 10:40 ` redi at gcc dot gnu.org
  9 siblings, 0 replies; 11+ messages in thread
From: redi at gcc dot gnu.org @ 2020-10-20 10:40 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

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

--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> ---
.

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

end of thread, other threads:[~2020-10-20 10:40 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-26 18:44 [Bug c++/95917] New: coroutine functions leak under freestanding mode causing dependencies and binary bloat euloanty at live dot com
2020-06-26 18:51 ` [Bug c++/95917] " euloanty at live dot com
2020-06-26 18:54 ` euloanty at live dot com
2020-06-26 18:57 ` euloanty at live dot com
2020-06-26 19:01 ` iains at gcc dot gnu.org
2020-06-26 19:03 ` euloanty at live dot com
2020-06-26 19:12 ` euloanty at live dot com
2020-06-27  7:31 ` redi at gcc dot gnu.org
2020-10-20 10:13 ` [Bug libstdc++/95917] " redi at gcc dot gnu.org
2020-10-20 10:38 ` cvs-commit at gcc dot gnu.org
2020-10-20 10:40 ` redi 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).