public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Richard Biener <rguenther@suse.de>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] tree.cc: Add tree_builtin_call_types_compatible_p [PR105150]
Date: Wed, 6 Apr 2022 09:57:41 +0200	[thread overview]
Message-ID: <Yk1H9QO3uUO2HLxo@tucnak> (raw)
In-Reply-To: <r94s9439-so2p-289o-61qp-9s96s1q19q67@fhfr.qr>

On Wed, Apr 06, 2022 at 09:49:25AM +0200, Richard Biener wrote:
> On trees we'd use tree_[sign_]nop_conversion () instead of
> useless_type_conversion_p, I think it's OK to allow all such
> pointer conversions.  In the end this probably means being
> more forgiving than TYPE_MAIN_VARIANT equivalence throughout, that
> would also make the code more similar to 
> gimple_builtin_call_types_compatible_p besides
> s/useless_type_conversion_p/tree_sign_nop_conversion/
> 
> What do you think?  If we don't go for strict TYPE_MAIN_VARIANT
> compatibility we should apply lax rules for all, the return
> type and all argument types.  It's not that the GENERIC we end
> up building from GIMPLE in various places adheres to the strict
> GENERIC type compatibility rules ...

Dunno, we don't really have a verifier for GENERIC.

Don't we even require that the types are actually same rather than
similar for say binary ops other than shifts, or for comparisons,
or result and first argument for unary and binary etc.?
I think at least for the most common cases the C/C++ FEs ensure that
through choosing some common type for the operation and folding the
arguments to that type.  Though I bet we violate it pretty often
with e.g. sizetype vs. size_type_node differences etc.

	Jakub


  reply	other threads:[~2022-04-06  7:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-06  7:18 Jakub Jelinek
2022-04-06  7:49 ` Richard Biener
2022-04-06  7:57   ` Jakub Jelinek [this message]
2022-04-06  8:01     ` Richard Biener
2022-04-06 14:57   ` [PATCH] tree.cc, v2: " Jakub Jelinek
2022-04-07  5:58     ` Richard Biener

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=Yk1H9QO3uUO2HLxo@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=rguenther@suse.de \
    /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).