From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31305 invoked by alias); 5 Aug 2005 06:08:47 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 31083 invoked by uid 48); 5 Aug 2005 06:08:42 -0000 Date: Fri, 05 Aug 2005 06:08:00 -0000 Message-ID: <20050805060842.31082.qmail@sourceware.org> From: "pault at gcc dot gnu dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050705050725.22304.albertm@uphs.upenn.edu> References: <20050705050725.22304.albertm@uphs.upenn.edu> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug fortran/22304] gfortran silently changes values in equilvanence'd variables X-Bugzilla-Reason: CC X-SW-Source: 2005-08/txt/msg00536.txt.bz2 List-Id: ------- Additional Comments From pault at gcc dot gnu dot org 2005-08-05 06:08 ------- This is amusing..... integer o(4), b, c COMMON /IBM/ o EQUIVALENCE (o(1),b),(C,o(4)) o(3)=1 CALL MYSUB1 CALL MYSUB2 END subroutine MYSUB1 integer o (4), b, c COMMON /IBM/ o EQUIVALENCE (o(1), b), (o(4), c) WRITE (6,*) "IN MYSUB1: o(3)= ", o(3) RETURN END subroutine MYSUB2 integer o (4), b, c COMMON /IBM/ o EQUIVALENCE (o(1), b), (c, o(4)) WRITE (6,*) "IN MYSUB2: o(3)= ", o(3) RETURN END IN MYSUB1: o(3)= 0 IN MYSUB2: o(3)= 134519416 The code shows that SUB1 references the common block, whereas SUB2 goes for a home grown equivalence. This is a good clue as to where things are failing. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22304