From patchwork Wed Sep 5 21:55:54 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 181964 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 1C3302C008C for ; Thu, 6 Sep 2012 07:56:19 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1347486980; h=Comment: DomainKey-Signature:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=4+uJPqH WzOoZGvjC37fdogBZpAg=; b=Fm9S1tIShsZO2HKjeJq8gso+qmxlTrQgSBbEWxu WDSYrxfOcHTg7Oe2mBfcwii0bO3hC29tiYwUXi4/qqdV8TzoBoPoyv1sAEggz4uX iqsp2O9+8Pr+oyhh5R1BuRaJDg8UlR2CEt3UqeQOSAAeldUGMeE0zv2mSXyEusL5 HpAg= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=KfS36pYOiwhUGc+Gn9xQcBHUeLMvn8iFO0TuBpDcAIDuSOf3vYH7mSJS2bqj31 ZhMqpY0K4//03mNeUwQ8TZ1mtNtuIwCrtKYwWOn1jaSmybfLTEZYAoLYt73wdnHD uzozsHaUT/ouMpusGW3UWJMXbPP7QDysf1a7vDfuEeQmQ=; Received: (qmail 9017 invoked by alias); 5 Sep 2012 21:56:12 -0000 Received: (qmail 9000 invoked by uid 22791); 5 Sep 2012 21:56:10 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, TW_FN X-Spam-Check-By: sourceware.org Received: from mx01.qsc.de (HELO mx01.qsc.de) (213.148.129.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 05 Sep 2012 21:55:56 +0000 Received: from [192.168.178.22] (port-92-204-67-8.dynamic.qsc.de [92.204.67.8]) by mx01.qsc.de (Postfix) with ESMTP id 289AD3D1E6; Wed, 5 Sep 2012 23:55:55 +0200 (CEST) Message-ID: <5047CA6A.8020808@net-b.de> Date: Wed, 05 Sep 2012 23:55:54 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120825 Thunderbird/15.0 MIME-Version: 1.0 To: gcc patches , gfortran Subject: [Patch, Fortran] PR54463 - fix -fexternal-matmul with -fdefault-real-8 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 Rather obvious fix. Build on x86-64-linux. OK for the trunk when regtesting has succeeded? Tobias 2012-09-06 Tobias Burnus PR fortran/54463 * trans-intrinsic.c (gfc_conv_intrinsic_funcall): Fix matmul call to BLAS if the default-kind has been promoted. 2012-09-06 Tobias Burnus PR fortran/54463 * gfortran.dg/promotion_2.f90: New. diff --git a/gcc/fortran/trans-intrinsic.c b/gcc/fortran/trans-intrinsic.c index add4baa..4b268b3 100644 --- a/gcc/fortran/trans-intrinsic.c +++ b/gcc/fortran/trans-intrinsic.c @@ -2362,21 +2362,20 @@ gfc_conv_intrinsic_funcall (gfc_se * se, gfc_expr * expr) if (gfc_option.flag_external_blas && (sym->ts.type == BT_REAL || sym->ts.type == BT_COMPLEX) - && (sym->ts.kind == gfc_default_real_kind - || sym->ts.kind == gfc_default_double_kind)) + && (sym->ts.kind == 4 || sym->ts.kind == 8)) { tree gemm_fndecl; if (sym->ts.type == BT_REAL) { - if (sym->ts.kind == gfc_default_real_kind) + if (sym->ts.kind == 4) gemm_fndecl = gfor_fndecl_sgemm; else gemm_fndecl = gfor_fndecl_dgemm; } else { - if (sym->ts.kind == gfc_default_real_kind) + if (sym->ts.kind == 4) gemm_fndecl = gfor_fndecl_cgemm; else gemm_fndecl = gfor_fndecl_zgemm; --- /dev/null 2012-09-03 07:48:56.919718426 +0200 +++ gcc/gcc/testsuite/gfortran.dg/promotion_2.f90 2012-09-05 19:52:17.000000000 +0200 @@ -0,0 +1,16 @@ +! { dg-do compile } +! { dg-options "-fdefault-real-8 -fexternal-blas -fdump-tree-original" } +! +! PR fortran/54463 +! +! Contributed by Simon Reinhardt +! +program test + implicit none + real, dimension(3,3) :: A + A = matmul(A,A) +end program test + +! { dg-final { scan-tree-dump-times "sgemm_" 0 "original" } } +! { dg-final { scan-tree-dump-times "dgemm_" 1 "original" } } +! { dg-final { cleanup-tree-dump "original" } }