From: Steve Kargl <sgk@troutmask.apl.washington.edu>
To: Thomas Koenig <tkoenig@netcologne.de>
Cc: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] PR fortran/83998 -- fix dot_product on 0-sized arrays
Date: Thu, 25 Jan 2018 18:44:00 -0000 [thread overview]
Message-ID: <20180125182440.GA57845@troutmask.apl.washington.edu> (raw)
In-Reply-To: <20180125150610.GA53868@troutmask.apl.washington.edu>
On Thu, Jan 25, 2018 at 07:06:10AM -0800, Steve Kargl wrote:
> On Thu, Jan 25, 2018 at 08:37:54AM +0100, Thomas Koenig wrote:
> >
> > Second, why do you remove this
> >
> > > - temp.value.op.op = INTRINSIC_NONE;
> > > - temp.value.op.op1 = vector_a;
> > > - temp.value.op.op2 = vector_b;
> > > - gfc_type_convert_binary (&temp, 1);
> >
> > block of code?
>
> It is dead code. temp is set to the typespec of
> the mixed-mode math result, but it is never used.
> compute_dot_product does the mixed-mode math,
> because it uses gfc_add() from arith.c.
>
Upon re-reading gfc_type_convert_binary, it isn't dead.
It simply isn't needed, because gfc_add() eventually
lands at arith.c (eval_intrinsics):
/* Numeric binary */
case INTRINSIC_PLUS:
case INTRINSIC_MINUS:
case INTRINSIC_TIMES:
case INTRINSIC_DIVIDE:
case INTRINSIC_POWER:
if (!gfc_numeric_ts (&op1->ts) || !gfc_numeric_ts (&op2->ts))
goto runtime;
/* Insert any necessary type conversions to make the operands
compatible. */
temp.expr_type = EXPR_OP;
gfc_clear_ts (&temp.ts);
temp.value.op.op = op;
temp.value.op.op1 = op1;
temp.value.op.op2 = op2;
gfc_type_convert_binary (&temp, warn_conversion || warn_conversion_extra);
--
Steve
next prev parent reply other threads:[~2018-01-25 18:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-25 2:42 Steve Kargl
2018-01-25 10:09 ` Thomas Koenig
2018-01-25 15:26 ` Steve Kargl
2018-01-25 18:44 ` Steve Kargl [this message]
2018-01-25 19:13 ` Thomas Koenig
2018-01-25 19:15 ` Steve Kargl
2018-01-25 19:23 ` Steve Kargl
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=20180125182440.GA57845@troutmask.apl.washington.edu \
--to=sgk@troutmask.apl.washington.edu \
--cc=fortran@gcc.gnu.org \
--cc=gcc-patches@gcc.gnu.org \
--cc=tkoenig@netcologne.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).