From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25850 invoked by alias); 10 Jun 2014 13:06:51 -0000 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 Received: (qmail 25741 invoked by uid 48); 10 Jun 2014 13:06:42 -0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/41227] COMMON block, BIND(C) and LTO interoperability issues Date: Tue, 10 Jun 2014 13:06:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.5.0 X-Bugzilla-Keywords: lto, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-06/txt/msg00695.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41227 --- Comment #11 from Richard Biener --- I think there is no good way apart from treating single-element structs equal to its single element in LTO with regarding to TYPE_CANONICAL. At least not if you want to inter-operate with both int i; and struct { int i; }. Otherwise I'd lean towards not using a struct in Fortran for single-element commons. That should be an implementation detail anyways. > Unfortunately, the idiom "use a single variable common block, say common/x/y, > access it via the name of the common block, followed by an underscore, say x_" > is also common. At least in my workplace it's the way everybody uses. But then simply name the symbol of the variable without a struct in that way, no?