From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9996 invoked by alias); 12 Feb 2013 13:07:28 -0000 Received: (qmail 9946 invoked by uid 48); 12 Feb 2013 13:07:11 -0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/56293] Segfault when trying to access pass-by-reference value of a not-word-aligned REAL(16) / -fno-align-commons Date: Tue, 12 Feb 2013 13:07: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-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: 2013-02/txt/msg01174.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D56293 --- Comment #5 from Tobias Burnus 2013-02-12 13= :07:10 UTC --- Some tests with ifort, which by default uses unaligned commons: The first t= est case works, i.e. I/O with the unaligned "p" works. However, if one calls a = user procedure ("call foo(p)"), it segfaults. Possible solutions: a) Copy-in/copy-out around procedure calls - which is fun with large arrays. b) Require the user to annotate the functions to possibly accept unaligned input =E2=80=93 or do so automatically. (With all the fun of third-party li= braries like LAPACK, BLAS, ...) c) Simply deprecating the -fno-align-commons flag, improving the wording of the diagnostic and the description in the man page. Somehow, I am in favour of (c). The question is also whether one can construct a fully standard-conform exa= mple which fails without -fno-align-commons =E2=80=93 and whether some real-worl= d code uses COMMON in a way that would fails with alignments/padding.