public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "bugdal at aerifal dot cx" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/95558] New: Invalid IPA optimizations based on weak definition
Date: Sat, 06 Jun 2020 03:45:47 +0000	[thread overview]
Message-ID: <bug-95558-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 95558
           Summary: Invalid IPA optimizations based on weak definition
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bugdal at aerifal dot cx
  Target Milestone: ---

Created attachment 48689
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=48689&action=edit
test case

Here is a case that came up in WIP code on musl libc, where I wanted to provide
a weak dummy definition for functionality that would optionally be replaced by
a strong definition elsewhere at ld time. I've been looking for some plausible
explanation aside from an IPA bug, like interaction with UB, but I can't find
any.

In the near-minimal test case here, the function reclaim() still has all of the
logic it should, but reclaim_gaps gets optimized down to a nop.

What seems to be happening is that the dummy weak definition does not leak into
its direct caller via IPA optimizations, but does leak to the caller's caller.

             reply	other threads:[~2020-06-06  3:45 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-06  3:45 bugdal at aerifal dot cx [this message]
2020-06-06  8:01 ` [Bug ipa/95558] " amonakov at gcc dot gnu.org
2020-06-06 14:36 ` bugdal at aerifal dot cx
2020-06-06 14:40 ` bugdal at aerifal dot cx
2020-06-09  6:47 ` rguenth at gcc dot gnu.org
2021-09-22  5:59 ` [Bug ipa/95558] [9/10/11/12 Regression] " pinskia at gcc dot gnu.org
2022-01-17 15:08 ` rguenth at gcc dot gnu.org
2022-01-17 16:33 ` bugdal at aerifal dot cx
2022-01-17 17:32 ` hubicka at kam dot mff.cuni.cz
2022-01-17 17:44 ` bugdal at aerifal dot cx
2022-01-17 19:15 ` amonakov at gcc dot gnu.org
2022-01-17 22:05 ` bugdal at aerifal dot cx
2022-01-17 22:20 ` pinskia at gcc dot gnu.org
2022-01-17 23:54 ` hubicka at kam dot mff.cuni.cz
2022-01-21 13:31 ` rguenth at gcc dot gnu.org
2022-05-27  9:42 ` [Bug ipa/95558] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:41 ` jakub at gcc dot gnu.org
2023-01-19 13:12 ` rguenth at gcc dot gnu.org
2023-07-07 10:37 ` [Bug ipa/95558] [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-95558-4@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).