From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15985 invoked by alias); 20 May 2003 21:46:00 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 15931 invoked by uid 71); 20 May 2003 21:46:00 -0000 Resent-Date: 20 May 2003 21:46:00 -0000 Resent-Message-ID: <20030520214600.15930.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, Duncan Sands Resent-Reply-To: gcc-gnats@gcc.gnu.org, 192135@bugs.debian.org Received: (qmail 32190 invoked from network); 20 May 2003 21:39:42 -0000 Received: from unknown (HELO hirsch.in-berlin.de) (192.109.42.6) by sources.redhat.com with SMTP; 20 May 2003 21:39:42 -0000 Received: from tango.net.local (dsl-213-023-156-180.arcor-ip.net [213.23.156.180]) (authenticated bits=0) by hirsch.in-berlin.de (8.12.9/8.12.9/Debian-1) with ESMTP id h4KLdeaQ015521 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT); Tue, 20 May 2003 23:39:41 +0200 Received: from doko by tango.net.local with local (Exim 4.20 #1 (Debian) [+araqnid]) id 19IEpf-0003cY-7y; Tue, 20 May 2003 23:39:39 +0200 Message-Id: Date: Tue, 20 May 2003 21:46:00 -0000 From: Matthias Klose Reply-To: 192135@bugs.debian.org To: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org X-Send-Pr-Version: 3.113 X-GNATS-Notify: Duncan Sands Subject: ada/10889: Convention Fortran matrices mishandled in generics X-SW-Source: 2003-05/txt/msg02213.txt.bz2 List-Id: >Number: 10889 >Category: ada >Synopsis: Convention Fortran matrices mishandled in generics >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: sw-bug >Submitter-Id: net >Arrival-Date: Tue May 20 21:46:00 UTC 2003 >Closed-Date: >Last-Modified: >Originator: Duncan Sands >Release: 3.3 (Debian) (Debian testing/unstable) >Organization: The Debian Project >Environment: System: Debian GNU/Linux (unstable) Architecture: i686 >Description: [ Reported to the Debian BTS as report #192135. Please CC 192135@bugs.debian.org on replies. Log of report can be found at http://bugs.debian.org/192135 ] Consider the following test program. It prints out the matrix A twice, using identical code. However the second copy of the code is wrapped up in a generic. Notice how the rows and columns are swapped in the second print out? This only occurs when the matrix is declared to be of convention Fortran. This bug is present in 3.14p to current 3.3. All the best, Duncan. with Ada.Text_IO; use Ada.Text_IO; procedure Bug is subtype Index is Integer range 1 .. 2; type Matrix is array (Index, Index) of Integer; pragma Convention (Fortran, Matrix); generic type Matrix is array (Index, Index) of Integer; procedure Print_Out (A : Matrix); procedure Print_Out (A : Matrix) is begin for I in A'Range (1) loop for J in A'Range (2) loop Put (Integer'Image (A (I, J))); end loop; New_Line; end loop; end Print_Out; procedure Print is new Print_Out (Matrix); A : Matrix; begin for I in A'Range (1) loop for J in A'Range (2) loop A (I, J) := 10 * I + J; end loop; end loop; for I in A'Range (1) loop for J in A'Range (2) loop Put (Integer'Image (A (I, J))); end loop; New_Line; end loop; New_Line; Print (A); end Bug; >How-To-Repeat: >Fix: >Release-Note: >Audit-Trail: >Unformatted: