From patchwork Sat Aug 26 18:24:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 806135 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-460983-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="EmQrCjCS"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xfmfn1Sdnz9s7M for ; Sun, 27 Aug 2017 04:25:18 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=qsV/h5BMR/b7mhLAx7t3Ub3MGBUXz1kT34nJmvCPhHDab5e5Pk hCdEXjWTdbn+DkVc6odIGvMNfERHG54pdglBvBgh+bpfbJWi9wcpN0pkq+W1GbHY Wu3gw33VC35uPbUiLAXIzKRRMkuMJkqQvNTjE3aQq+bE1fnLAdoNJRlHM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=/KsrisuC5M66jjm2mDmcCzLEi4o=; b=EmQrCjCSF/7yfuIxTv5v jlsUfMu6ASOHRqEkv7FsiN7beWTacYJX3+BKbEKdhBqpXvTEyl6UKgqNEJ9O6Fwo PLCuWGVOr8axxzTcATD593mjku8/IVtySX5fqx3lMMfnPsJ0mcHzKQ8D+i7XAX3F k/vt88nX30v9VpOAwZmBJ+c= Received: (qmail 79280 invoked by alias); 26 Aug 2017 18:25:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 79140 invoked by uid 89); 26 Aug 2017 18:24:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:U*tkoenig, ik X-Spam-User: qpsmtpd, 2 recipients X-HELO: cc-smtpout1.netcologne.de Received: from cc-smtpout1.netcologne.de (HELO cc-smtpout1.netcologne.de) (89.1.8.211) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 26 Aug 2017 18:24:27 +0000 Received: from cc-smtpin1.netcologne.de (cc-smtpin1.netcologne.de [89.1.8.201]) by cc-smtpout1.netcologne.de (Postfix) with ESMTP id 4F8EF133DF; Sat, 26 Aug 2017 20:24:15 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by cc-smtpin1.netcologne.de (Postfix) with ESMTP id 42E8D11D94; Sat, 26 Aug 2017 20:24:15 +0200 (CEST) Received: from [78.35.138.130] (helo=cc-smtpin1.netcologne.de) by localhost with ESMTP (eXpurgate 4.1.9) (envelope-from ) id 59a1bccf-029d-7f0000012729-7f000001a0f9-1 for ; Sat, 26 Aug 2017 20:24:15 +0200 Received: from [192.168.178.20] (xdsl-78-35-138-130.netcologne.de [78.35.138.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by cc-smtpin1.netcologne.de (Postfix) with ESMTPSA; Sat, 26 Aug 2017 20:24:13 +0200 (CEST) To: "fortran@gcc.gnu.org" , gcc-patches From: Thomas Koenig Subject: [patch, fortran] Fix regression with inline matmul Message-ID: Date: Sat, 26 Aug 2017 20:24:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 Hello world, to relieve the boredom on the fortran mailing list and to fix a regression I thought I'd submit a patch :-) Apparently, a call to CONJG wasn't picking up the right typespec, which led to an ICE with gimplification later. Regression-tested. OK for trunk? Regards Thomas 2017-08-26 Thomas Koenig PR fortran/81974 * frontend-passes (inline_matumul_assign): Explicity set typespec for call to CONJG. 2017-08-26 Thomas Koenig PR fortran/81974 * gfortran.dg/inline_matmul_19.f90: New test Index: frontend-passes.c =================================================================== --- frontend-passes.c (Revision 251125) +++ frontend-passes.c (Arbeitskopie) @@ -3837,14 +3837,25 @@ inline_matmul_assign (gfc_code **c, int *walk_subt gcc_unreachable(); } + /* Build the conjg call around the variables. Set the typespec manually + because gfc_build_intrinsic_call sometimes gets this wrong. */ if (conjg_a) - ascalar = gfc_build_intrinsic_call (ns, GFC_ISYM_CONJG, "conjg", - matrix_a->where, 1, ascalar); + { + gfc_typespec ts; + ts = matrix_a->ts; + ascalar = gfc_build_intrinsic_call (ns, GFC_ISYM_CONJG, "conjg", + matrix_a->where, 1, ascalar); + ascalar->ts = ts; + } if (conjg_b) - bscalar = gfc_build_intrinsic_call (ns, GFC_ISYM_CONJG, "conjg", - matrix_b->where, 1, bscalar); - + { + gfc_typespec ts; + ts = matrix_b->ts; + bscalar = gfc_build_intrinsic_call (ns, GFC_ISYM_CONJG, "conjg", + matrix_b->where, 1, bscalar); + bscalar->ts = ts; + } /* First loop comes after the zero assignment. */ assign_zero->next = do_1;