From patchwork Wed Dec 22 20:45:28 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mikael Morin X-Patchwork-Id: 76449 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 CA885B70E2 for ; Thu, 23 Dec 2010 07:45:45 +1100 (EST) Received: (qmail 28245 invoked by alias); 22 Dec 2010 20:45:43 -0000 Received: (qmail 28223 invoked by uid 22791); 22 Dec 2010 20:45:42 -0000 X-SWARE-Spam-Status: No, hits=0.1 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_NEUTRAL, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp21.services.sfr.fr (HELO smtp21.services.sfr.fr) (93.17.128.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Dec 2010 20:45:36 +0000 Received: from filter.sfr.fr (localhost [127.0.0.1]) by msfrf2108.sfr.fr (SMTP Server) with ESMTP id D9322700009A; Wed, 22 Dec 2010 21:45:33 +0100 (CET) Received: from gimli.local (107.183.72-86.rev.gaoland.net [86.72.183.107]) by msfrf2108.sfr.fr (SMTP Server) with ESMTP id A9FAF7000087; Wed, 22 Dec 2010 21:45:33 +0100 (CET) X-SFR-UUID: 20101222204533696.A9FAF7000087@msfrf2108.sfr.fr From: Mikael Morin To: fortran@gcc.gnu.org Subject: [Patch, fortran] PR fortran/46978 wrong-code with transpose(reshape(...)) Date: Wed, 22 Dec 2010 21:45:28 +0100 User-Agent: KMail/1.13.5 (FreeBSD/8.0-STABLE; KDE/4.5.4; amd64; ; ) Cc: gcc patches MIME-Version: 1.0 Message-Id: <201012222145.30120.mikael.morin@sfr.fr> X-IsSubscribed: yes 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 Hello, I'm going to commit the patch below as obvious, once the regression test has finished. Historical note: this has changed several times already in the past: - Revision 162276: n -> dim At that time n and dim were guaranteed to be equal so it didn't matter, but I suppose transpose was already in sight then. - Revision 164112: dim -> n This revision introduced a linear to[] array with transpose already taken into account, so n had to be used for that part. One part was still using loop->to[], so it shouldn't have been changed (it is the cause of the regression). Yet again, it didn't matter at the time. - Revision 164205: This is the regression Starting from here, the dimensions can be transposed, so n and dim can be different. Mikael 2010-12-22 Mikael Morin PR fortran/46978 Revert part of revision 164112 * trans-array.c (gfc_trans_create_temp_array): Set loop n'th upper bound from (possibly transposed) array's dim bounds. 2010-12-22 Mikael Morin to[n] = tmp; continue; }