From patchwork Sat Oct 16 16:25:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 68047 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 47651B70F0 for ; Sun, 17 Oct 2010 03:25:51 +1100 (EST) Received: (qmail 15309 invoked by alias); 16 Oct 2010 16:25:40 -0000 Received: (qmail 15289 invoked by uid 22791); 16 Oct 2010 16:25:39 -0000 X-SWARE-Spam-Status: No, hits=-1.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp5.netcologne.de (HELO smtp5.netcologne.de) (194.8.194.25) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 16 Oct 2010 16:25:34 +0000 Received: from [192.168.0.197] (xdsl-87-79-49-101.netcologne.de [87.79.49.101]) by smtp5.netcologne.de (Postfix) with ESMTP id B391E40D8C1; Sat, 16 Oct 2010 18:25:31 +0200 (CEST) Subject: [patch, fortran] Adjust fn spec for transfer_array From: Thomas Koenig To: fortran@gcc.gnu.org Cc: gcc-patches@gcc.gnu.org Date: Sat, 16 Oct 2010 18:25:31 +0200 Message-ID: <1287246331.4082.7.camel@linux-fd1f.site> Mime-Version: 1.0 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 world, the attached one-letter patch fixes the fn spec for transfer_array, because its array descriptor argument contains a pointer that can (and will) be followed. I am not aware of any test case that this fixes, but it is a latent bug which may be exposed by some test case, or maybe be more aggressive optimization later. 2010-10-16 Thomas Koenig Regression-tested. OK for trunk? Thomas * trans-io.c (gfc_build_io_library_fndecls): Array descriptor arguments to transfer_array can be dereferenced recursively. Index: trans-io.c =================================================================== --- trans-io.c (Revision 165559) +++ trans-io.c (Arbeitskopie) @@ -366,7 +366,7 @@ gfc_build_io_library_fndecls (void) void_type_node, 3, dt_parm_type, pvoid_type_node, gfc_int4_type_node); iocall[IOCALL_X_ARRAY] = gfc_build_library_function_decl_with_spec ( - get_identifier (PREFIX("transfer_array")), ".wW", + get_identifier (PREFIX("transfer_array")), ".ww", void_type_node, 4, dt_parm_type, pvoid_type_node, integer_type_node, gfc_charlen_type_node);