From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12172 invoked by alias); 20 Feb 2007 16:39:20 -0000 Received: (qmail 12149 invoked by uid 48); 20 Feb 2007 16:39:11 -0000 Date: Tue, 20 Feb 2007 16:39:00 -0000 Message-ID: <20070220163911.12148.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/30875] Equivalence of derived types with (same) default initializer In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "burnus at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-02/txt/msg02359.txt.bz2 ------- Comment #1 from burnus at gcc dot gnu dot org 2007-02-20 16:39 ------- EQUIVALENCE(a1,a2) 1 Error: Derived type variable 'a1' at (1) with default initializer cannot be an EQUIVALENCE object ffv.f90:11.17: EQUIVALENCE(a1,a2) 1 Error: Initialized objects 'a1' and 'a2' cannot both be in the EQUIVALENCE statement at (1) Compiles with ifort, g95 and nagf95. Observations: If T1 is initialized with "1" and T2 with "2", ifort and nag95 compile it and g95 rejects it with: "Memory is initialized more than once (offset 0)" If run (both "1"): g95: 1 1 nagf95: garbage value (twice) ifort: 1 1 If run with "1", "2": g95: - (does not compile, see above) ifort: 2 2 nagf95: garbage value (twice) -- burnus at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |rejects-valid Summary|incorrect error message for |Equivalence of derived types |valid code |with (same) default | |initializer http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30875