public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenther at suse dot de" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/97474] [8/9/10/11 Regression] produces wrong code with references to another field
Date: Tue, 26 Jan 2021 08:29:44 +0000	[thread overview]
Message-ID: <bug-97474-4-K52vdBgYCQ@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-97474-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #13 from rguenther at suse dot de <rguenther at suse dot de> ---
On Mon, 25 Jan 2021, jason at gcc dot gnu.org wrote:

> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97474
> 
> --- Comment #12 from Jason Merrill <jason at gcc dot gnu.org> ---
> Yeah, adding restrict there is just wrong; the constructor is called outside
> the function, and could e.g. stash a pointer to the object in a global
> variable.  What we actually want is to treat this reference parameter like a
> value parameter.  Is that information actually useful to the optimizers?

It's a layout hint PTA can use but without restricting who can point
to said object it's not going to affect precision much (in fact I'd
have to double check that giving hinting a wrong object size by
passing the base "value" of a derived class object won't cause issues).

ISTR we've explored keying on REFERENCE_TYPE only (for said layout hint)
in the past.

  parent reply	other threads:[~2021-01-26  8:29 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-17 20:42 [Bug c++/97474] New: Regression: optimization produces wrong code sfranzen85 at hotmail dot com
2020-10-17 21:21 ` [Bug c++/97474] " pinskia at gcc dot gnu.org
2020-10-17 21:31 ` [Bug tree-optimization/97474] [8/9/10/11 Regression] produces wrong code with references to another field pinskia at gcc dot gnu.org
2020-10-17 21:40 ` jakub at gcc dot gnu.org
2020-10-19  7:33 ` rguenth at gcc dot gnu.org
2020-10-19  7:49 ` rguenth at gcc dot gnu.org
2020-10-19  8:35 ` rguenth at gcc dot gnu.org
2020-10-19  8:36 ` rguenth at gcc dot gnu.org
2020-10-19 21:32 ` joseph at codesourcery dot com
2020-10-20  6:39 ` [Bug c++/97474] " rguenth at gcc dot gnu.org
2020-10-20  6:47 ` jakub at gcc dot gnu.org
2020-10-20  6:50 ` jakub at gcc dot gnu.org
2021-01-25 16:32 ` jason at gcc dot gnu.org
2021-01-26  8:29 ` rguenther at suse dot de [this message]
2021-01-26 21:12 ` jason at gcc dot gnu.org
2021-01-26 22:11 ` cvs-commit at gcc dot gnu.org
2021-01-27  9:12 ` rguenther at suse dot de
2021-01-29 16:00 ` cvs-commit at gcc dot gnu.org
2021-02-03 15:56 ` [Bug c++/97474] [8/9 " jakub at gcc dot gnu.org
2021-05-14  9:54 ` [Bug c++/97474] [9 " jakub at gcc dot gnu.org
2021-06-01  8:18 ` rguenth at gcc dot gnu.org
2022-05-11 20:05 ` jason at gcc dot gnu.org
2022-05-11 20:13 ` pinskia 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-97474-4-K52vdBgYCQ@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).