public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Thomas Schwinge <thomas_schwinge@mentor.com>
Cc: gcc@gcc.gnu.org
Subject: Re: Question about 'gcc/fold-const.c:fold_convert_loc' for 'real_cst' -> 'reference_type' of 'real_type'
Date: Tue, 15 Dec 2020 17:07:51 +0100	[thread overview]
Message-ID: <20201215160751.GU3788@tucnak> (raw)
In-Reply-To: <878s9zgir3.fsf@euler.schwinge.homeip.net>

On Tue, Dec 15, 2020 at 05:02:24PM +0100, Thomas Schwinge wrote:
> Per the 'fold_convert_loc' code (cited below), we see that for 'type' of
> 'case INTEGER_TYPE' etc. -- which 'type' of 'case REFERENCE_TYPE' does
> "fall through" into -- we do not handle 'arg' of 'REAL_CST' like we do
> for 'type' of 'case REAL_TYPE'.
> 
> Now, as this code has been like that "forever", I have difficulties to
> imagine that this may be a bug.  Is this wrong usage of
> 'fold_convert_loc'?  (What does it mean to convert a 'real_cst' into a
> 'reference_type' of 'real_type'?)  (... translating to: something is
> going wrong elsewhere, in OpenACC 'reductions' handling?)

This is definitely not a bug in fold_convert, but in whatever is calling it,
converting something floating to a REFERENCE_TYPE doesn't make any sense.
One usually wants to convert some pointer to reference or another reference
to reference; and as one can't take address of real_cst, one probably
somewhere should have forced the constant into a variable so that its
address could be converted to the reference.

	Jakub


      reply	other threads:[~2020-12-15 16:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-15 16:02 Thomas Schwinge
2020-12-15 16:07 ` Jakub Jelinek [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=20201215160751.GU3788@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=thomas_schwinge@mentor.com \
    /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).