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

--- Comment #24 from Tom de Vries <vries at gcc dot gnu.org> ---
Created attachment 61858
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=61858&action=edit
debug patch

Using this patch (on top of current trunk), I get the following in
a-test-2.c.092i.inline:
...
Considering gdb_exception::gdb_exception(gdb_exception&&)/482 with 15 size
 to be inlined into void throw_exception(gdb_exception&&)/487 in test-2.c:28
 Estimated badness is -0.002532, frequency 1.00.
 Called 0 (precise) times
flags from gdb_exception::gdb_exception(gdb_exception&&)/482:  nothrow
flags from void throw_exception(gdb_exception&&)/487:  noreturn
merged flags for void throw_exception(gdb_exception&&)/487:  noreturn nothrow
IGNORE_STORES: 1
  Parm map:  -1 0
Updated mod-ref summary for void throw_exception(gdb_exception&&)/487
  loads:
      Base 0: alias set 0
        Ref 0: alias set 0
          access: Parm 0 param offset:0 offset:0 size:64 max_size:128
  stores:
  Side effects
  Try dse
  parm 0 flags: no_direct_clobber no_direct_escape no_indirect_escape
...

Without the "Minor ipa-modref tweaks" change we have instead:
...
Considering gdb_exception::gdb_exception(gdb_exception&&)/482 with 15 size
 to be inlined into void throw_exception(gdb_exception&&)/487 in test-2.c:28
 Estimated badness is -0.002532, frequency 1.00.
 Called 0 (precise) times
flags from gdb_exception::gdb_exception(gdb_exception&&)/482:  nothrow
merged flags for void throw_exception(gdb_exception&&)/487:  nothrow
IGNORE_STORES: 0
  Parm map:  -1 0
Updated mod-ref summary for void throw_exception(gdb_exception&&)/487
  loads:
      Base 0: alias set 0
        Ref 0: alias set 0
          access: Parm 0 param offset:0 offset:0 size:64 max_size:128
  stores:
    Every base
  Side effects
  Nondeterministic
  Try dse
  parm 0 flags: no_direct_escape
... 

I think that the change that the commit brought is not unreasonable:
throw_exception is noreturn before inlining, and should be so after inlining.

It seems wrong to me that we propagate the nothrow flag from the gdb_exception
constructor to throw_exception.  That already happened before the commit.

Reply via email to