public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jamborm at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug ipa/108226] __restrict on inlined function parameters does not function as expected
Date: Fri, 17 Feb 2023 13:57:27 +0000	[thread overview]
Message-ID: <bug-108226-4-5QLJkedGQF@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108226-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from Martin Jambor <jamborm at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #1)
> 
> so somehow the restrict qualification pessimizes IPA-CP?!  Martin?
> 

Well, funny thing.  Without restrict, IPA-CP sees (from release_ssa dump):

void Func3 (char * p1, int * p2)
{
  <bb 2> [local count: 1073741824]:
  *p1_3(D) = 123;
  *p2_2(D) = 1;
  Func1 (p1_3(D), p2_2(D));
  return;
}

But with restrict in Func2 parameters, Func3 becomes:

void Func3 (char * p1, int * p2)
{
  <bb 2> [local count: 1073741824]:
  *p2_2(D) = 1;
  *p1_4(D) = 123;
  Func1 (p1_4(D), p2_2(D));
  return;
}

And the different ordering of the two stores is the problem, even when
p1 is not a char pointer, because we dont't trust the types of the
actual/formal parameters for TBAA (we would need to know in what types
they are read in Func1).

      parent reply	other threads:[~2023-02-17 13:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-26  0:05 [Bug tree-optimization/108226] New: " jhaberman at gmail dot com
2023-01-09 13:54 ` [Bug ipa/108226] " rguenth at gcc dot gnu.org
2023-02-17 13:57 ` jamborm at gcc dot gnu.org [this message]

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-108226-4-5QLJkedGQF@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).