From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 54439 invoked by alias); 25 Jan 2018 18:24:45 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 54420 invoked by uid 89); 25 Jan 2018 18:24:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy= X-Spam-User: qpsmtpd, 2 recipients X-HELO: troutmask.apl.washington.edu Received: from troutmask.apl.washington.edu (HELO troutmask.apl.washington.edu) (128.95.76.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 25 Jan 2018 18:24:43 +0000 Received: from troutmask.apl.washington.edu (localhost [127.0.0.1]) by troutmask.apl.washington.edu (8.15.2/8.15.2) with ESMTPS id w0PIOfEK057928 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 25 Jan 2018 10:24:41 -0800 (PST) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.15.2/8.15.2/Submit) id w0PIOeeI057927; Thu, 25 Jan 2018 10:24:40 -0800 (PST) (envelope-from sgk) Date: Thu, 25 Jan 2018 18:44:00 -0000 From: Steve Kargl To: Thomas Koenig Cc: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [PATCH] PR fortran/83998 -- fix dot_product on 0-sized arrays Message-ID: <20180125182440.GA57845@troutmask.apl.washington.edu> Reply-To: sgk@troutmask.apl.washington.edu References: <20180125021147.GA52679@troutmask.apl.washington.edu> <20180125150610.GA53868@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180125150610.GA53868@troutmask.apl.washington.edu> User-Agent: Mutt/1.9.2 (2017-12-15) X-SW-Source: 2018-01/txt/msg02103.txt.bz2 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