public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og
@ 2022-01-12 12:10 marc@nieper-wisskirchen.de
  2022-01-12 12:16 ` [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb marxin at gcc dot gnu.org
                   ` (20 more replies)
  0 siblings, 21 replies; 25+ messages in thread
From: marc@nieper-wisskirchen.de @ 2022-01-12 12:10 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 103989
           Summary: [12 regression] std::optional and bogus
                    -Wmaybe-unitialized at -Og
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marc@nieper-wisskirchen.de
  Target Milestone: ---

With the trunk version of GCC compiling the following program with 

-std=c++17 -Og -Wall -Werror

gives a bogus maybe-uninitialized error (in the standard library component for
the shared pointer):

////
#include <optional>
#include <memory>

struct A {
  A (int a) : a {a} 
  {}

  const std::shared_ptr <int> x;
  int a;
};

class B
{
public:
  B (const std::optional <A>& a)
    : a {a}
  {
  }
public:
  const std::optional <A> a;
};

int
main ()
{
  B b {std::nullopt};
}
////

Compiling it with

-std=c++17 -O1 -Wall -Werror

doesn't produce the error.

As the code compiles find at -Og and -O1 with GCC 11.2, this is a regression.

The error triggering is brittle. It goes away if the dummy member variable a in
class A is removed, for example.

For experimentation, the test case can be found here:
https://godbolt.org/z/arGKT7d5n.

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
@ 2022-01-12 12:16 ` marxin at gcc dot gnu.org
  2022-01-12 12:54 ` rguenth at gcc dot gnu.org
                   ` (19 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-01-12 12:16 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-01-12
            Summary|[12 regression]             |[12 regression]
                   |std::optional and bogus     |std::optional and bogus
                   |-Wmaybe-unitialized at -Og  |-Wmaybe-unitialized at -Og
                   |                            |since
                   |                            |r12-1992-g6feb628a706e86eb
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |msebor at gcc dot gnu.org

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r12-1992-g6feb628a706e86eb.

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
  2022-01-12 12:16 ` [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb marxin at gcc dot gnu.org
@ 2022-01-12 12:54 ` rguenth at gcc dot gnu.org
  2022-01-12 17:44 ` jakub at gcc dot gnu.org
                   ` (18 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-12 12:54 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
The IL has

  <bb 2> [local count: 1073741824]:
  D.35417 = D.35181;
  [/home/rguenther/install/gcc-12/usr/local/include/c++/12.0.0/optional:737:17]
D.34833 ={v} {CLOBBER};
  [/home/rguenther/install/gcc-12/usr/local/include/c++/12.0.0/optional:237:14]
MEM[(union _Storage *)[t.C:26:20] &D.34833] ={v} {CLOBBER};
  [/home/rguenther/install/gcc-12/usr/local/include/c++/12.0.0/optional:118:7]
[/home/rguenther/install/gcc-12/usr/local/include/c++/12.0.0/optional:118:7]
MEM[(struct _Optional_payload_base *)[t.C:26:20] &D.34833]._M_engaged = 0;
  [t.C:26:20] D.35417 ={v} {CLOBBER};

I suspect we warn on the use of D.35181 which is indeed not initialized
(of std::nullopt_t type).  The copied to D.35417 is dead but at -Og we
fail to elide the store.  I see there's no DSE performed for -Og
possibly on purpose to not degrade debug info more.  But that makes
-Wuninitialized susceptible for these kind of issues.

Note at -O1 the same IL is in the program, it's just elided before we get
the chance to warn on it.  The uninit use there is even visible before
inlining but we don't seem to diagnose by value passing of uninitialized
aggregates:

int main ()
{
  struct B b;
  struct nullopt_t D.35181;
  const struct optional D.34833;
  int _8;

  <bb 2> :
  [t.C:26:20] std::optional<A>::optional ([t.C:26:20] &D.34833, D.35181);

here D.35181 is passed to the CTOR (where it might be eventually not
used so not warning at the call is eventually OK).  The copy itself
is emitted by the inliner, so it's spurious to warn there and the
inliner could either try harder to not emit it or alternatively
mark the copy as to be not warned about.

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
  2022-01-12 12:16 ` [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb marxin at gcc dot gnu.org
  2022-01-12 12:54 ` rguenth at gcc dot gnu.org
@ 2022-01-12 17:44 ` jakub at gcc dot gnu.org
  2022-01-12 19:11 ` pinskia at gcc dot gnu.org
                   ` (17 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-12 17:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That IMHO bogus D.35417 = D.35181; statement comes from the inliner and it can
be fixed easily:

--- gcc/tree-inline.c.jj        2022-01-11 23:11:23.422275652 +0100
+++ gcc/tree-inline.c   2022-01-12 18:37:44.119950128 +0100
@@ -3608,7 +3608,7 @@ setup_one_parameter (copy_body_data *id,
              init_stmt = gimple_build_assign (def, rhs);
            }
        }
-      else
+      else if (!is_empty_type (TREE_TYPE (var)))
         init_stmt = gimple_build_assign (var, rhs);

       if (bb && init_stmt)

which I think matches what the gimplifier does with assignments of empty type
objects.
Unfortunately that patch doesn't do anything with these warnings.

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (2 preceding siblings ...)
  2022-01-12 17:44 ` jakub at gcc dot gnu.org
@ 2022-01-12 19:11 ` pinskia at gcc dot gnu.org
  2022-01-13 11:10 ` jakub at gcc dot gnu.org
                   ` (16 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-01-12 19:11 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #3)
> That IMHO bogus D.35417 = D.35181; statement comes from the inliner and it
> can be fixed easily:
> 
> --- gcc/tree-inline.c.jj	2022-01-11 23:11:23.422275652 +0100
> +++ gcc/tree-inline.c	2022-01-12 18:37:44.119950128 +0100
> @@ -3608,7 +3608,7 @@ setup_one_parameter (copy_body_data *id,
>  	      init_stmt = gimple_build_assign (def, rhs);
>  	    }
>  	}
> -      else
> +      else if (!is_empty_type (TREE_TYPE (var)))
>          init_stmt = gimple_build_assign (var, rhs);

We should do this patch no matter what, it will speed up the compiler I think
(there has been other issues in the past in ipa-modref even of handling such IR
too).

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (3 preceding siblings ...)
  2022-01-12 19:11 ` pinskia at gcc dot gnu.org
@ 2022-01-13 11:10 ` jakub at gcc dot gnu.org
  2022-01-13 11:39 ` rguenth at gcc dot gnu.org
                   ` (15 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-13 11:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
The reason we warn is that at -Og we don't optimize away the dead code.  In
uninit2 we have:
  MEM[(struct _Optional_payload_base *)&D.34851]._M_engaged = 0;
...
  _27 = MEM[(const struct _Optional_payload_base &)&D.34851]._M_engaged;
  if (_27 != 0)
    goto <bb 3>; [33.00%]
  else
    goto <bb 10>; [67.00%]

  <bb 10> [local count: 719407024]:
  goto <bb 9>; [100.00%]

  <bb 3> [local count: 354334800]:
  MEM[(struct __as_base  &)&b] ={v} {CLOBBER};
  MEM[(struct shared_ptr *)&b] ={v} {CLOBBER};
  MEM[(struct __shared_ptr *)&b] ={v} {CLOBBER};
  _30 = MEM[(const struct __shared_ptr &)&D.34851]._M_ptr;
  MEM[(struct __shared_ptr *)&b]._M_ptr = _30;
  MEM[(struct __shared_count *)&b + 8B] ={v} {CLOBBER};
  _31 = MEM[(const struct __shared_count &)&D.34851 + 8]._M_pi;
  MEM[(struct __shared_count *)&b + 8B]._M_pi = _31;
and we haven't figured out that bb 3 is all dead, because we store into
_M_engaged 0 and bb 3 is done only if _M_engaged is non-zero.
-Og runs fre1, but that is too early, fre1 sees
  MEM[(struct _Optional_payload_base *)&D.34851]._M_engaged = 0;
  D.35431 ={v} {CLOBBER};
  b ={v} {CLOBBER};
  MEM[(struct optional *)&b] ={v} {CLOBBER};
  std::_Optional_base<A, false, false>::_Optional_base (&MEM[(struct optional
*)&b].D.34640, &D.34851.D.34640);
and _Optional_base isn't inlined there.  And -Og doesn't do any FRE or PRE
after inlining, unlike e.g. -O1 which has fre3 very soon after inlining.
-Og doesn't even do forwprop after inlining.

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (4 preceding siblings ...)
  2022-01-13 11:10 ` jakub at gcc dot gnu.org
@ 2022-01-13 11:39 ` rguenth at gcc dot gnu.org
  2022-01-13 11:56   ` Jan Hubicka
  2022-01-13 11:56 ` hubicka at kam dot mff.cuni.cz
                   ` (14 subsequent siblings)
  20 siblings, 1 reply; 25+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-13 11:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Honza, -Og was supposed to not do so much work, I intended to disable IPA
inlining but there's no knob for that.  I wonder where to best put such
guard?  I set flag_inline_small_functions to zero for -Og but we still
run inline_small_functions ().  Basically -Og was supposed to only do
early opts and then what is necessary for correct RTL expansion.  Doing
IPA inlining defeats this :/

Can you help?  Is it safe to simply gate the inline_small_functions ()
call?  Do we want an extra -f[no-]ipa-inline like we have -fearly-inlining?

Using -fdisable-ipa-inline gets rid of the diagnostic

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

* Re: [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-13 11:39 ` rguenth at gcc dot gnu.org
@ 2022-01-13 11:56   ` Jan Hubicka
  0 siblings, 0 replies; 25+ messages in thread
From: Jan Hubicka @ 2022-01-13 11:56 UTC (permalink / raw)
  To: rguenth at gcc dot gnu.org; +Cc: gcc-bugs

> --- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
> Honza, -Og was supposed to not do so much work, I intended to disable IPA
> inlining but there's no knob for that.  I wonder where to best put such
> guard?  I set flag_inline_small_functions to zero for -Og but we still
> run inline_small_functions ().  Basically -Og was supposed to only do
> early opts and then what is necessary for correct RTL expansion.  Doing
> IPA inlining defeats this :/
> 
> Can you help?  Is it safe to simply gate the inline_small_functions ()
> call?  Do we want an extra -f[no-]ipa-inline like we have -fearly-inlining?
> 
> Using -fdisable-ipa-inline gets rid of the diagnostic

You can not disable an IPA pass becasuse then we will mishandle
optimize attributes.  I think you simply want to set

flag_inline_small_functions = 0
flag_inline_functions_called_once = 0 

and we should only inline always_inlines. inline_small_functions will
still loop and check inlinability of functions but if everything is
compiled with -Og it will not find anything inlinable and exit.

Perhaps we may also extend initialize_inline_failed to add
CIF_DEBUG_OPTIMIZE so -Winline does say something more useufl then
"function not considered"

Honza


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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (5 preceding siblings ...)
  2022-01-13 11:39 ` rguenth at gcc dot gnu.org
@ 2022-01-13 11:56 ` hubicka at kam dot mff.cuni.cz
  2022-01-13 12:03   ` Jan Hubicka
  2022-01-13 12:03 ` hubicka at kam dot mff.cuni.cz
                   ` (13 subsequent siblings)
  20 siblings, 1 reply; 25+ messages in thread
From: hubicka at kam dot mff.cuni.cz @ 2022-01-13 11:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from hubicka at kam dot mff.cuni.cz ---
> --- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
> Honza, -Og was supposed to not do so much work, I intended to disable IPA
> inlining but there's no knob for that.  I wonder where to best put such
> guard?  I set flag_inline_small_functions to zero for -Og but we still
> run inline_small_functions ().  Basically -Og was supposed to only do
> early opts and then what is necessary for correct RTL expansion.  Doing
> IPA inlining defeats this :/
> 
> Can you help?  Is it safe to simply gate the inline_small_functions ()
> call?  Do we want an extra -f[no-]ipa-inline like we have -fearly-inlining?
> 
> Using -fdisable-ipa-inline gets rid of the diagnostic

You can not disable an IPA pass becasuse then we will mishandle
optimize attributes.  I think you simply want to set

flag_inline_small_functions = 0
flag_inline_functions_called_once = 0 

and we should only inline always_inlines. inline_small_functions will
still loop and check inlinability of functions but if everything is
compiled with -Og it will not find anything inlinable and exit.

Perhaps we may also extend initialize_inline_failed to add
CIF_DEBUG_OPTIMIZE so -Winline does say something more useufl then
"function not considered"

Honza

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

* Re: [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-13 11:56 ` hubicka at kam dot mff.cuni.cz
@ 2022-01-13 12:03   ` Jan Hubicka
  0 siblings, 0 replies; 25+ messages in thread
From: Jan Hubicka @ 2022-01-13 12:03 UTC (permalink / raw)
  To: hubicka at kam dot mff.cuni.cz; +Cc: gcc-bugs

> You can not disable an IPA pass becasuse then we will mishandle
> optimize attributes.  I think you simply want to set
> 
> flag_inline_small_functions = 0
> flag_inline_functions_called_once = 0 

Actually I forgot, we have flag_no_inline which makes
tree_inlinable_function_p to return false for everything except for
ALWAYS_INLINE and so we only want to set this one for Og.



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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (6 preceding siblings ...)
  2022-01-13 11:56 ` hubicka at kam dot mff.cuni.cz
@ 2022-01-13 12:03 ` hubicka at kam dot mff.cuni.cz
  2022-01-13 12:25 ` rguenth at gcc dot gnu.org
                   ` (12 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: hubicka at kam dot mff.cuni.cz @ 2022-01-13 12:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from hubicka at kam dot mff.cuni.cz ---
> You can not disable an IPA pass becasuse then we will mishandle
> optimize attributes.  I think you simply want to set
> 
> flag_inline_small_functions = 0
> flag_inline_functions_called_once = 0 

Actually I forgot, we have flag_no_inline which makes
tree_inlinable_function_p to return false for everything except for
ALWAYS_INLINE and so we only want to set this one for Og.

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (7 preceding siblings ...)
  2022-01-13 12:03 ` hubicka at kam dot mff.cuni.cz
@ 2022-01-13 12:25 ` rguenth at gcc dot gnu.org
  2022-01-13 13:39 ` hubicka at kam dot mff.cuni.cz
                   ` (11 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-13 12:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to hubicka from comment #8)
> > You can not disable an IPA pass becasuse then we will mishandle
> > optimize attributes.  I think you simply want to set
> > 
> > flag_inline_small_functions = 0
> > flag_inline_functions_called_once = 0 

I'm doing the above.

> Actually I forgot, we have flag_no_inline which makes
> tree_inlinable_function_p to return false for everything except for
> ALWAYS_INLINE and so we only want to set this one for Og.

And I'm intentionally not doing this because -Og should still remove
abstraction during early inlining (for functions marked 'inline'), we
just don't want to spend the extra compile time doing IPA inlining
or cleaning up after IPA inlining.

As can be seen with the testcase there are 5 calls inlined at IPA time
still (and 47 in early inlining):

> grep optimized: t.C.083i.inline 
/home/rguenther/install/gcc-12/usr/local/include/c++/12.0.0/optional:703:11:
optimized:  Inlined constexpr std::_Optional_base<_Tp, <anonymous>, <anonymous>
>::_Optional_base(const std::_Optional_base<_Tp, <anonymous>, <anonymous> >&)
[with _Tp = A; bool <anonymous> = false; bool <anonymous> = false]/387 into int
main()/360 which now has time 34.125000 and size 17, net change of -7.
/home/rguenther/install/gcc-12/usr/local/include/c++/12.0.0/bits/shared_ptr_base.h:785:26:
optimized:  Inlined void std::_Sp_counted_base<_Lp>::_M_add_ref_copy() [with
__gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]/459 into A::A(const A&)/453
which now has time 13.010361 and size 17, net change of -6.
/home/rguenther/install/gcc-12/usr/local/include/c++/12.0.0/bits/shared_ptr_base.h:196:28:
optimized:  Inlined void std::_Sp_counted_base<_Lp>::_M_release_last_use()
[with __gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]/416 into void
std::_Sp_counted_base<_Lp>::_M_release_last_use_cold() [with
__gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]/367 which now has time
33.410000 and size 23, net change of -7.
/home/rguenther/install/gcc-12/usr/local/include/c++/12.0.0/bits/stl_construct.h:119:7:
optimized:  Inlined A::A(const A&)/453 into constexpr std::_Optional_base<_Tp,
<anonymous>, <anonymous> >::_Optional_base(const std::_Optional_base<_Tp,
<anonymous>, <anonymous> >&) [with _Tp = A; bool <anonymous> = false; bool
<anonymous> = false]/387 which now has time 32.808419 and size 11, net change
of -9.
/home/rguenther/install/gcc-12/usr/local/include/c++/12.0.0/bits/shared_ptr_base.h:778:21:
optimized:  Inlined void std::_Sp_counted_base<_Lp>::_M_release() [with
__gnu_cxx::_Lock_policy _Lp = __gnu_cxx::_S_atomic]/272 into constexpr void
std::_Optional_payload_base<_Tp>::_M_reset() [with _Tp = A]/427 which now has
time 14.914755 and size 39, net change of -7.

but of course IPA inline size estimates are a bit off since we are not
going to do any optimization on the inlined body.

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (8 preceding siblings ...)
  2022-01-13 12:25 ` rguenth at gcc dot gnu.org
@ 2022-01-13 13:39 ` hubicka at kam dot mff.cuni.cz
  2022-01-13 13:44 ` rguenther at suse dot de
                   ` (10 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: hubicka at kam dot mff.cuni.cz @ 2022-01-13 13:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from hubicka at kam dot mff.cuni.cz ---
> And I'm intentionally not doing this because -Og should still remove
> abstraction during early inlining (for functions marked 'inline'), we
> just don't want to spend the extra compile time doing IPA inlining
> or cleaning up after IPA inlining.

Indeed it seemed bit too extreme to disable inlining completely at -Og :)
So you want early inliner to behave normally according to flags
while IPA inliner to skip all calls where either caller or
callee is -Og and callee is not always_inline?
This can be done in can_inline_edge_p. I will make patch for that.

It may be nice to also avoid re-analyzing functions completely to save
some compile time, but that may be bit tricky if we decide to do things
like cross-module always_inline.  I will look into that too, but perhaps
that can wait for next stage1.
> 
> but of course IPA inline size estimates are a bit off since we are not
> going to do any optimization on the inlined body.

We still do late ccp and other things, but indeed inline estimates
anticipate FRE to happen which it doesn't.

Looking into what passes are in the pipeline I also noticed that
we could also probably skip late modref from -Og optimization pipeline.
(I think David added it htere originally since we do pure-const).
I am thinking about retiring pure-const from pure-const discovery next
stage1 since modref should be monotonosly stronger doing that (and
if we add a stripped down mode of modref it should not be more expensive
than pure-const)

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (9 preceding siblings ...)
  2022-01-13 13:39 ` hubicka at kam dot mff.cuni.cz
@ 2022-01-13 13:44 ` rguenther at suse dot de
  2022-01-13 13:55 ` hubicka at kam dot mff.cuni.cz
                   ` (9 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: rguenther at suse dot de @ 2022-01-13 13:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from rguenther at suse dot de <rguenther at suse dot de> ---
On Thu, 13 Jan 2022, hubicka at kam dot mff.cuni.cz wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103989
> 
> --- Comment #10 from hubicka at kam dot mff.cuni.cz ---
> > And I'm intentionally not doing this because -Og should still remove
> > abstraction during early inlining (for functions marked 'inline'), we
> > just don't want to spend the extra compile time doing IPA inlining
> > or cleaning up after IPA inlining.
> 
> Indeed it seemed bit too extreme to disable inlining completely at -Og :)
> So you want early inliner to behave normally according to flags
> while IPA inliner to skip all calls where either caller or
> callee is -Og and callee is not always_inline?
> This can be done in can_inline_edge_p. I will make patch for that.

Yeah, and since we inline all always inline and also flatten during
early inline the IPA inliner should really do nothing.

> It may be nice to also avoid re-analyzing functions completely to save
> some compile time, but that may be bit tricky if we decide to do things
> like cross-module always_inline.  I will look into that too, but perhaps
> that can wait for next stage1.

I think we decided to have all always inline early and drop bodies now,
didn't you patch it that way this stage1?

> > 
> > but of course IPA inline size estimates are a bit off since we are not
> > going to do any optimization on the inlined body.
> 
> We still do late ccp and other things, but indeed inline estimates
> anticipate FRE to happen which it doesn't.

IIRC the CCP was necessary for some odd reason I don't remember
right now ;)

> Looking into what passes are in the pipeline I also noticed that
> we could also probably skip late modref from -Og optimization pipeline.

Yes, I noticed it was there just now ...

> (I think David added it htere originally since we do pure-const).
> I am thinking about retiring pure-const from pure-const discovery next
> stage1 since modref should be monotonosly stronger doing that (and
> if we add a stripped down mode of modref it should not be more expensive
> than pure-const)

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (10 preceding siblings ...)
  2022-01-13 13:44 ` rguenther at suse dot de
@ 2022-01-13 13:55 ` hubicka at kam dot mff.cuni.cz
  2022-01-13 13:58 ` rguenth at gcc dot gnu.org
                   ` (8 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: hubicka at kam dot mff.cuni.cz @ 2022-01-13 13:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from hubicka at kam dot mff.cuni.cz ---
> Yeah, and since we inline all always inline and also flatten during
> early inline the IPA inliner should really do nothing.

OK, can_inline_edge_p will do that but we will still walk the calls
which is bit of wasted effort.  Will look into that incrementally.
> 
> > It may be nice to also avoid re-analyzing functions completely to save
> > some compile time, but that may be bit tricky if we decide to do things
> > like cross-module always_inline.  I will look into that too, but perhaps
> > that can wait for next stage1.
> 
> I think we decided to have all always inline early and drop bodies now,
> didn't you patch it that way this stage1?
I think that gets into trouble i.e. with kernel calling always_inlines
indirectly. It is a mess...
> 
> IIRC the CCP was necessary for some odd reason I don't remember
> right now ;)

I would bet it was builtin_constat_p and inlining, so perhaps if we
completely ban late inlining ccp can go.
> 
> > Looking into what passes are in the pipeline I also noticed that
> > we could also probably skip late modref from -Og optimization pipeline.
> 
> Yes, I noticed it was there just now ...

I will make patch to drop it for trunk.  If we disable all optimization
the repeated pure-const seems pointless as well?

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (11 preceding siblings ...)
  2022-01-13 13:55 ` hubicka at kam dot mff.cuni.cz
@ 2022-01-13 13:58 ` rguenth at gcc dot gnu.org
  2022-01-13 14:11   ` Jan Hubicka
  2022-01-13 14:11 ` hubicka at kam dot mff.cuni.cz
                   ` (7 subsequent siblings)
  20 siblings, 1 reply; 25+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-13 13:58 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to hubicka from comment #12)
> > Yeah, and since we inline all always inline and also flatten during
> > early inline the IPA inliner should really do nothing.
> 
> OK, can_inline_edge_p will do that but we will still walk the calls
> which is bit of wasted effort.  Will look into that incrementally.
> > 
> > > It may be nice to also avoid re-analyzing functions completely to save
> > > some compile time, but that may be bit tricky if we decide to do things
> > > like cross-module always_inline.  I will look into that too, but perhaps
> > > that can wait for next stage1.
> > 
> > I think we decided to have all always inline early and drop bodies now,
> > didn't you patch it that way this stage1?
> I think that gets into trouble i.e. with kernel calling always_inlines
> indirectly. It is a mess...

Sure - I just remember (falsely?) that we finally decided to do it :)
If we don't run IPA inline we don't figure we failed to inline the
always_inline either ;)  And IPA inline can expose more indirect
alywas-inlines we only discover after even more optimization so the
issue is really moot unless we sorry () (or link-fail).

> > 
> > IIRC the CCP was necessary for some odd reason I don't remember
> > right now ;)
> 
> I would bet it was builtin_constat_p and inlining, so perhaps if we
> completely ban late inlining ccp can go.

Yeah, or __builtin_unreachable, or whatever ;)

> > 
> > > Looking into what passes are in the pipeline I also noticed that
> > > we could also probably skip late modref from -Og optimization pipeline.
> > 
> > Yes, I noticed it was there just now ...
> 
> I will make patch to drop it for trunk.  If we disable all optimization
> the repeated pure-const seems pointless as well?

Yes.

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

* Re: [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-13 13:58 ` rguenth at gcc dot gnu.org
@ 2022-01-13 14:11   ` Jan Hubicka
  0 siblings, 0 replies; 25+ messages in thread
From: Jan Hubicka @ 2022-01-13 14:11 UTC (permalink / raw)
  To: rguenth at gcc dot gnu.org; +Cc: gcc-bugs

> 
> Sure - I just remember (falsely?) that we finally decided to do it :)

I do not recall this, but I may have forgotten :))

> If we don't run IPA inline we don't figure we failed to inline the
> always_inline either ;)  And IPA inline can expose more indirect
> alywas-inlines we only discover after even more optimization so the
> issue is really moot unless we sorry () (or link-fail).

Problem with kernel was that it relied on quite complicated indirect
inliing of always inlined and did not work without it.  At beggining I
think we should have introduced two attributes - always_inline and
disregard_inline_limits just like we have internally. Always_inline
should have never allowed public linkage or taking its address, but
it is probbly late to fix that :(

Honza


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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (12 preceding siblings ...)
  2022-01-13 13:58 ` rguenth at gcc dot gnu.org
@ 2022-01-13 14:11 ` hubicka at kam dot mff.cuni.cz
  2022-01-13 15:01 ` cvs-commit at gcc dot gnu.org
                   ` (6 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: hubicka at kam dot mff.cuni.cz @ 2022-01-13 14:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from hubicka at kam dot mff.cuni.cz ---
> 
> Sure - I just remember (falsely?) that we finally decided to do it :)

I do not recall this, but I may have forgotten :))

> If we don't run IPA inline we don't figure we failed to inline the
> always_inline either ;)  And IPA inline can expose more indirect
> alywas-inlines we only discover after even more optimization so the
> issue is really moot unless we sorry () (or link-fail).

Problem with kernel was that it relied on quite complicated indirect
inliing of always inlined and did not work without it.  At beggining I
think we should have introduced two attributes - always_inline and
disregard_inline_limits just like we have internally. Always_inline
should have never allowed public linkage or taking its address, but
it is probbly late to fix that :(

Honza

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (13 preceding siblings ...)
  2022-01-13 14:11 ` hubicka at kam dot mff.cuni.cz
@ 2022-01-13 15:01 ` cvs-commit at gcc dot gnu.org
  2022-01-13 15:05 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-13 15:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:53ead5787921be799593232cfc9931f916b79002

commit r12-6550-g53ead5787921be799593232cfc9931f916b79002
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Thu Jan 13 15:59:47 2022 +0100

    inliner: Don't emit copy stmts for empty type parameters [PR103989]

    The following patch avoids emitting a parameter copy statement when
inlining
    if the parameter has empty type.  E.g. the gimplifier does something
similar
    (except that it needs to evaluate side-effects if any, which isn't the case
    here):
      /* For empty types only gimplify the left hand side and right hand
         side as statements and throw away the assignment.  Do this after
         gimplify_modify_expr_rhs so we handle TARGET_EXPRs of addressable
         types properly.  */
      if (is_empty_type (TREE_TYPE (*from_p))
          && !want_value
          /* Don't do this for calls that return addressable types, expand_call
             relies on those having a lhs.  */
          && !(TREE_ADDRESSABLE (TREE_TYPE (*from_p))
               && TREE_CODE (*from_p) == CALL_EXPR))
        {
          gimplify_stmt (from_p, pre_p);
          gimplify_stmt (to_p, pre_p);
          *expr_p = NULL_TREE;
          return GS_ALL_DONE;
        }
    Unfortunately, this patch doesn't cure the uninit warnings in that PR,
    which is caused by ipa inlining happening even at -Og when the post-IPA
    -Og passes don't expect the need to clean up after ipa inlining,
    but I think is desirable anyway.

    2022-01-13  Jakub Jelinek  <jakub@redhat.com>

            PR tree-optimization/103989
            * tree-inline.c (setup_one_parameter): Don't copy parms with
            empty type.

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (14 preceding siblings ...)
  2022-01-13 15:01 ` cvs-commit at gcc dot gnu.org
@ 2022-01-13 15:05 ` jakub at gcc dot gnu.org
  2022-01-13 15:10 ` rguenther at suse dot de
                   ` (4 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-13 15:05 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Perhaps if we punt for -Og caller (and maybe -Og callees) on IPA inlining
except for always_inline, we could set some flag if IPA inlining happened and
schedule some extra cleanup passes just for those rare cases?
Though arguably, if a call to always_inline function was indirect during
einline,  we don't need to guarantee that it will be inlined.
But, what about -Og -fno-early-inlining?

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (15 preceding siblings ...)
  2022-01-13 15:05 ` jakub at gcc dot gnu.org
@ 2022-01-13 15:10 ` rguenther at suse dot de
  2022-01-18 12:35 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: rguenther at suse dot de @ 2022-01-13 15:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from rguenther at suse dot de <rguenther at suse dot de> ---
On Thu, 13 Jan 2022, jakub at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103989
> 
> --- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
> Perhaps if we punt for -Og caller (and maybe -Og callees) on IPA inlining
> except for always_inline, we could set some flag if IPA inlining happened and
> schedule some extra cleanup passes just for those rare cases?

I'd rather not.  At some point I wanted to refactor the main opt
pipeline to work like this and skip some of the early passes there
if we did _not_ inline ...

> Though arguably, if a call to always_inline function was indirect during
> einline,  we don't need to guarantee that it will be inlined.
> But, what about -Og -fno-early-inlining?

-Og -fno-early-inline will still do always inline inlining early.

  /* Even when not optimizing or not inlining inline always-inline
     functions.  */
  inlined = inline_always_inline_functions (node);

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (16 preceding siblings ...)
  2022-01-13 15:10 ` rguenther at suse dot de
@ 2022-01-18 12:35 ` rguenth at gcc dot gnu.org
  2022-01-18 14:43 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  20 siblings, 0 replies; 25+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-18 12:35 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |rguenth at gcc dot gnu.org

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (17 preceding siblings ...)
  2022-01-18 12:35 ` rguenth at gcc dot gnu.org
@ 2022-01-18 14:43 ` cvs-commit at gcc dot gnu.org
  2022-01-18 14:43 ` cvs-commit at gcc dot gnu.org
  2022-01-18 14:43 ` rguenth at gcc dot gnu.org
  20 siblings, 0 replies; 25+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-18 14:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

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

commit r12-6676-ge89b2a270d31d7298d516ae545e256645992c7b9
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Jan 18 13:31:56 2022 +0100

    ipa/103989 - tame IPA optimizations at -Og

    With -Og we are not prepared to do cleanup after IPA optimizations
    and dead code exposed by those confuses late diagnostic passes.
    This is a first patch removing unwanted IPA optimizations, namely
    both late modref and pure-const analysis.

    2022-01-18  Richard Biener  <rguenther@suse.de>

            PR ipa/103989
            * passes.def (pass_all_optimizations_g): Remove pass_modref
            and pass_local_pure_const.

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (18 preceding siblings ...)
  2022-01-18 14:43 ` cvs-commit at gcc dot gnu.org
@ 2022-01-18 14:43 ` cvs-commit at gcc dot gnu.org
  2022-01-18 14:43 ` rguenth at gcc dot gnu.org
  20 siblings, 0 replies; 25+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-18 14:43 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>:

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

commit r12-6677-gc952126870c92cf293d59ffb1497e402eb8fc269
Author: Richard Biener <rguenther@suse.de>
Date:   Tue Jan 18 13:48:34 2022 +0100

    ipa/103989 - avoid IPA inlining of small functions with -Og

    The following change avoids doing IPA inlining of small functions
    into functions compiled with -Og - those functions will see almost no
    followup scalar cleanups so that the benefit anticipated by the
    inliner will not be realized and instead the late diagnostic code
    will be confused by dead code that is left around.

    2022-01-18  Richard Biener  <rguenther@suse.de>

            PR ipa/103989
            * ipa-inline.cc (inline_small_functions): Do not enqueue call
            edges originating in functions compiled with -Og.

            * g++.dg/opt/pr103989.C: New testcase.

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

* [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb
  2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
                   ` (19 preceding siblings ...)
  2022-01-18 14:43 ` cvs-commit at gcc dot gnu.org
@ 2022-01-18 14:43 ` rguenth at gcc dot gnu.org
  20 siblings, 0 replies; 25+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-01-18 14:43 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

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

end of thread, other threads:[~2022-01-18 14:43 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 12:10 [Bug tree-optimization/103989] New: [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og marc@nieper-wisskirchen.de
2022-01-12 12:16 ` [Bug tree-optimization/103989] [12 regression] std::optional and bogus -Wmaybe-unitialized at -Og since r12-1992-g6feb628a706e86eb marxin at gcc dot gnu.org
2022-01-12 12:54 ` rguenth at gcc dot gnu.org
2022-01-12 17:44 ` jakub at gcc dot gnu.org
2022-01-12 19:11 ` pinskia at gcc dot gnu.org
2022-01-13 11:10 ` jakub at gcc dot gnu.org
2022-01-13 11:39 ` rguenth at gcc dot gnu.org
2022-01-13 11:56   ` Jan Hubicka
2022-01-13 11:56 ` hubicka at kam dot mff.cuni.cz
2022-01-13 12:03   ` Jan Hubicka
2022-01-13 12:03 ` hubicka at kam dot mff.cuni.cz
2022-01-13 12:25 ` rguenth at gcc dot gnu.org
2022-01-13 13:39 ` hubicka at kam dot mff.cuni.cz
2022-01-13 13:44 ` rguenther at suse dot de
2022-01-13 13:55 ` hubicka at kam dot mff.cuni.cz
2022-01-13 13:58 ` rguenth at gcc dot gnu.org
2022-01-13 14:11   ` Jan Hubicka
2022-01-13 14:11 ` hubicka at kam dot mff.cuni.cz
2022-01-13 15:01 ` cvs-commit at gcc dot gnu.org
2022-01-13 15:05 ` jakub at gcc dot gnu.org
2022-01-13 15:10 ` rguenther at suse dot de
2022-01-18 12:35 ` rguenth at gcc dot gnu.org
2022-01-18 14:43 ` cvs-commit at gcc dot gnu.org
2022-01-18 14:43 ` cvs-commit at gcc dot gnu.org
2022-01-18 14:43 ` rguenth 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).