public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug lto/91299] [10/11/12/13 Regression] LTO inlines a weak definition in presence of a non-weak definition from an ELF file
Date: Tue, 18 Oct 2022 07:50:02 +0000	[thread overview]
Message-ID: <bug-91299-4-1B3pBG7lGR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-91299-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
   Target Milestone|---                         |10.5
                 CC|                            |hubicka at gcc dot gnu.org
           Priority|P3                          |P2

--- Comment #15 from Richard Biener <rguenth at gcc dot gnu.org> ---
1
a-weakdef.o 2
195 5359582ee909af0f PREEMPTED_REG foo
198 5359582ee909af0f PREVAILING_DEF main


Considering foo/0 with 3 size
 to be inlined into main/1 in unknown:-1
 Estimated badness is -inf, frequency 1.00.
    Badness calculation for main/1 -> foo/0
      size growth -1, time 0.000000 unspec 2.000000  big_speedup
      -inf: Growth -1 <= 0
      Adjusted by hints -inf
Updated mod-ref summary for main/1
  loads:
    Limits: 32 bases, 16 refs
  stores:
    Limits: 32 bases, 16 refs
optimized:  Inlined foo/0 into main/1 which now has time 2.000000 and size 3,
net change of -1.

but

foo/0 (foo) @0x7ffff65b5110
  Type: function definition analyzed
  Visibility: externally_visible preempted_reg external public weak
  References:
  Referring:
  Read from file: a-weakdef.o
  Availability: available
  Unit id: 1
  Function flags: count:1073741824 (estimated locally)
  Called by: main/1 (1073741824 (estimated locally),1.00 per call)
  Calls:

Honza?  This looks like a bug in handling of PREEMTED_REG?  Or do we apply
some sort of ODR argument here?  We also see 'foo' as 'const' at IPA time
(but at local time we see it's interposable and thus do not analyze it)

  parent reply	other threads:[~2022-10-18  7:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bug-91299-4@http.gcc.gnu.org/bugzilla/>
2022-07-20  6:29 ` [Bug lto/91299] " sen2403 at hotmail dot com
2022-07-20  7:23 ` amonakov at gcc dot gnu.org
2022-07-20 10:44 ` sen2403 at hotmail dot com
2022-07-26 12:27 ` amonakov at gcc dot gnu.org
2022-08-25 13:01 ` sen2403 at hotmail dot com
2022-08-25 13:22 ` sen2403 at hotmail dot com
2022-09-06  7:20 ` [Bug lto/91299] [10/11/12/13 Regression] " amonakov at gcc dot gnu.org
2022-10-18  7:50 ` rguenth at gcc dot gnu.org [this message]
2023-07-07 10:35 ` [Bug lto/91299] [11/12/13/14 " rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-91299-4-1B3pBG7lGR@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).