public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/101597] [12 Regression] ICE in pretty-printer formatting an OBJ_TYPE_REF since r12-2132-ga110855667782dac
Date: Mon, 15 Nov 2021 15:40:23 +0000	[thread overview]
Message-ID: <bug-101597-4-Fzx1n3ou2Y@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-101597-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I guess the problem is that for the middle-end, pointer conversions are
considered useless (with the small exceptions or different address spaces and
function/method vs. object pointers or if the pointers have different
TYPE_MODE),
so trying to figure out something from the type of OBJ_TYPE_REF's
OBJ_TYPE_REF_OBJECT operand is wrong.
So, either we want to print something ugly, e.g. with obj_type_ref in it
somewhere, if !virtual_method_call_p (t, true), or perhaps could change aall
the spots that create OBJ_TYPE_REFs such that the OBJ_TYPE_REF_TOKEN which I
think must be INTEGER_CST wouldn't have integer_type_node type, but would
actually have
the original type of the second argument of OBJ_TYPE_REF.
E.g. in build_vfn_ref instead of doing
  aref = build3 (OBJ_TYPE_REF, TREE_TYPE (aref), aref, instance_ptr, idx);
do
  aref = build3 (OBJ_TYPE_REF, TREE_TYPE (aref), aref, instance_ptr,
                 fold_convert (TREE_TYPE (instance_ptr), idx));
or so and use that for resolve_virtual_fun_from_obj_type_ref purposes.
It would be similar to what we do e.g. with MEM_REFs.
Devirtualization and constexpr virtual call handling would need to be verified
for that change of course.

  parent reply	other threads:[~2021-11-15 15:40 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-23 10:52 [Bug tree-optimization/101597] New: r12-2132-ga110855667782dac[12 Regression] ICE in evrp since marxin at gcc dot gnu.org
2021-07-23 10:53 ` [Bug tree-optimization/101597] [12 Regression] ICE in evrp since r12-2132-ga110855667782dac marxin at gcc dot gnu.org
2021-07-23 17:15 ` [Bug c++/101597] [12 Regression] ICE in pretty-printer formatting an OBJ_TYPE_REF " msebor at gcc dot gnu.org
2021-09-21 14:58 ` philip.herron at embecosm dot com
2021-11-15 14:57 ` jakub at gcc dot gnu.org
2021-11-15 15:40 ` jakub at gcc dot gnu.org [this message]
2021-12-30 16:14 ` jakub at gcc dot gnu.org
2021-12-30 16:23 ` jakub at gcc dot gnu.org
2022-01-11 18:22 ` cvs-commit at gcc dot gnu.org
2022-01-11 18:23 ` jakub 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-101597-4-Fzx1n3ou2Y@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).